From 81e213dc7cb42ca0195a1b81d5cb1d50164d9182 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 28 Aug 2006 16:57:28 +0000 Subject: * emacs-lisp/checkdoc.el (checkdoc-file-comments-engine): Insert commentary after first line summary. --- lisp/emacs-lisp/checkdoc.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 68603c905a5..666b373ca53 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -2261,7 +2261,8 @@ Code:, and others referenced in the style guide." (re-search-forward "^;;; Code" nil t) (re-search-forward "^(require" nil t) (re-search-forward "^(" nil t)) - (beginning-of-line))) + (beginning-of-line)) + (t (re-search-forward ";;; .* --- .*\n"))) (if (checkdoc-y-or-n-p "You should have a \";;; Commentary:\", add one? ") (insert "\n;;; Commentary:\n;; \n\n") -- cgit v1.2.1 From 5b061d28eb0ceea29ce05f7769ab65a6a978fcd5 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 31 Aug 2006 23:10:24 +0000 Subject: (trace-function-background): Doc fix. --- lisp/emacs-lisp/trace.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/trace.el b/lisp/emacs-lisp/trace.el index 1ebf1186c2d..191be58c0b5 100644 --- a/lisp/emacs-lisp/trace.el +++ b/lisp/emacs-lisp/trace.el @@ -265,11 +265,14 @@ display oriented stuff, use `trace-function-background' instead." ;;;###autoload (defun trace-function-background (function &optional buffer) "Traces FUNCTION with trace output going quietly to BUFFER. -For every call of FUNCTION Lisp-style trace messages that display argument -and return values will be inserted into BUFFER. This function generates the -trace advice for FUNCTION and activates it together with any other advice -there might be!! Trace output will quietly go to BUFFER without changing -the window or buffer configuration at all." +When this tracing is enabled, every call to FUNCTION writes +a Lisp-style trace message (showing the arguments and return value) +into BUFFER. This function generates advice to trace FUNCTION +and activates it together with any other advice there might be. +The trace output goes to BUFFER quietly, without changing +the window or buffer configuration. + +BUFFER defaults to `trace-buffer'." (interactive (list (intern -- cgit v1.2.1 From da506c0e742b495a813083b253e610d2b0340f91 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 31 Aug 2006 23:14:26 +0000 Subject: (define-minor-mode): Reference manual about customization, rather than M-x customize, in the doc string made for the defcustom. --- lisp/emacs-lisp/easy-mmode.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index d4ba8d30623..b22e49dac34 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -200,7 +200,8 @@ Use the command `%s' to change this variable." pretty-name mode)) See the command `%s' for a description of this minor-mode." (if body " Setting this variable directly does not take effect; -use either \\[customize] or the function `%s'.")))) +either customize it (see the info node `Easy Customization') +or call the function `%s'.")))) `(defcustom ,mode ,init-value ,(format base-doc-string pretty-name mode mode) ,@set -- cgit v1.2.1 From 3ac5a59d71e23392cdc31f609a9ce32e80f42dfd Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 8 Sep 2006 11:59:33 +0000 Subject: (bindat-unpack): Doc fix. --- lisp/emacs-lisp/bindat.el | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/bindat.el b/lisp/emacs-lisp/bindat.el index 1b37f3f772f..792272ef88a 100644 --- a/lisp/emacs-lisp/bindat.el +++ b/lisp/emacs-lisp/bindat.el @@ -66,13 +66,13 @@ ;; ;; The corresponding Lisp bindat specification looks like this: ;; -;; (setq header-spec +;; (setq header-bindat-spec ;; '((dest-ip ip) ;; (src-ip ip) ;; (dest-port u16) ;; (src-port u16))) ;; -;; (setq data-spec +;; (setq data-bindat-spec ;; '((type u8) ;; (opcode u8) ;; (length u16r) ;; little endian order @@ -80,12 +80,12 @@ ;; (data vec (length)) ;; (align 4))) ;; -;; (setq packet-spec -;; '((header struct header-spec) +;; (setq packet-bindat-spec +;; '((header struct header-bindat-spec) ;; (items u8) ;; (fill 3) ;; (item repeat (items) -;; (struct data-spec)))) +;; (struct data-bindat-spec)))) ;; ;; ;; A binary data representation may look like @@ -121,6 +121,9 @@ ;; Binary Data Structure Specification Format ;; ------------------------------------------ +;; We recommend using names that end in `-bindat-spec'; such names +;; are recognized automatically as "risky" variables. + ;; The data specification is formatted as follows: ;; SPEC ::= ( ITEM... ) @@ -342,8 +345,8 @@ (defun bindat-unpack (spec bindat-raw &optional bindat-idx) "Return structured data according to SPEC for binary data in BINDAT-RAW. -BINDAT-RAW is a unibyte string or vector. Optional third arg BINDAT-IDX specifies -the starting offset in BINDAT-RAW." +BINDAT-RAW is a unibyte string or vector. +Optional third arg BINDAT-IDX specifies the starting offset in BINDAT-RAW." (when (multibyte-string-p bindat-raw) (error "String is multibyte")) (unless bindat-idx (setq bindat-idx 0)) -- cgit v1.2.1 From b8bd37f2f80d5436ad2d4a18561da1dc69f54ac4 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 8 Sep 2006 12:00:40 +0000 Subject: (timer-create, timer-activate): Doc fixes. (cancel-timer-internal): Add doc string. (cancel-function-timers): Doc fix. (with-timeout-handler, timer-event-last*): Add doc strings. --- lisp/emacs-lisp/timer.el | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el index 82eac50c874..54c5aff305a 100644 --- a/lisp/emacs-lisp/timer.el +++ b/lisp/emacs-lisp/timer.el @@ -32,9 +32,11 @@ ;; Layout of a timer vector: ;; [triggered-p high-seconds low-seconds usecs repeat-delay ;; function args idle-delay] +;; triggered-p is nil if the timer is active (waiting to be triggered), +;; t if it is inactive ("already triggered", in theory) (defun timer-create () - "Create a timer object." + "Create a timer object which can be passed to `timer-activate'." (let ((timer (make-vector 8 nil))) (aset timer 0 t) timer)) @@ -173,6 +175,10 @@ fire repeatedly that many seconds apart." (defun timer-activate (timer &optional triggered-p reuse-cell) "Put TIMER on the list of active timers. +If TRIGGERED-P is t, that means to make the timer inactive +\(put it on the list, but mark it as already triggered). +To remove from the list, use `cancel-timer'. + REUSE-CELL, if non-nil, is a cons cell to reuse instead of allocating a new one." (if (and (timerp timer) @@ -256,10 +262,10 @@ of allocating a new one." (setq timer-idle-list (delq timer timer-idle-list)) nil) -;; Remove TIMER from the list of active timers or idle timers. -;; Only to be used in this file. It returns the cons cell -;; that was removed from the list. (defun cancel-timer-internal (timer) + "Remove TIMER from the list of active timers or idle timers. +Only to be used in this file. It returns the cons cell +that was removed from the timer list." (let ((cell1 (memq timer timer-list)) (cell2 (memq timer timer-idle-list))) (if cell1 @@ -270,7 +276,9 @@ of allocating a new one." ;;;###autoload (defun cancel-function-timers (function) - "Cancel all timers scheduled by `run-at-time' which would run FUNCTION." + "Cancel all timers which would run FUNCTION. +This affects ordinary timers such as are scheduled by `run-at-time', +and idle timers such as are scheduled by `run-with-idle-timer'." (interactive "aCancel timers of function: ") (let ((tail timer-list)) (while tail @@ -284,9 +292,12 @@ of allocating a new one." (setq tail (cdr tail))))) ;; Record the last few events, for debugging. -(defvar timer-event-last-2 nil) -(defvar timer-event-last-1 nil) -(defvar timer-event-last nil) +(defvar timer-event-last nil + "Last timer that was run.") +(defvar timer-event-last-1 nil + "Next-to-last timer that was run.") +(defvar timer-event-last-2 nil + "Third-to-last timer that was run.") (defvar timer-max-repeats 10 "*Maximum number of times to repeat a timer, if real time jumps.") @@ -440,6 +451,7 @@ This function returns a timer object which you can use in `cancel-timer'." timer)) (defun with-timeout-handler (tag) + "This is the timer function used for the timer made by `with-timeout'." (throw tag 'timeout)) ;;;###autoload (put 'with-timeout 'lisp-indent-function 1) -- cgit v1.2.1 From 612c16f1307be001af8fac7df6e35b5c7fe21502 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Fri, 8 Sep 2006 14:15:02 +0000 Subject: * window.el (mouse-autoselect-window-timer) (mouse-autoselect-window-position) (mouse-autoselect-window-window) (mouse-autoselect-window-now): New vars. (mouse-autoselect-window-cancel) (mouse-autoselect-window-select) (mouse-autoselect-window-start): New functions. (handle-select-window): Call `mouse-autoselect-window-start' when delayed window autoselection is enabled. * cus-start.el (mouse-autoselect-window): Handle delayed window autoselection. * emacs-lisp/eldoc.el: Add `handle-select-window' to the set of commands after which it is allowed to print in the echo area. --- lisp/emacs-lisp/eldoc.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index 805184e15de..98d778f1507 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -432,7 +432,7 @@ Emacs Lisp mode) that support Eldoc.") ;; Prime the command list. (eldoc-add-command-completions "backward-" "beginning-of-" "move-beginning-of-" "delete-other-windows" - "delete-window" + "delete-window" "handle-select-window" "end-of-" "move-end-of-" "exchange-point-and-mark" "forward-" "indent-for-tab-command" "goto-" "mark-page" "mark-paragraph" "mouse-set-point" "move-" "pop-global-mark" "next-" "other-window" -- cgit v1.2.1 From 6b34950fadc011554873fb9f2f421b261235916f Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 10 Sep 2006 17:47:39 +0000 Subject: (pushnew): Use add-to-list when convenient. --- lisp/emacs-lisp/cl.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el index 222407f86f2..9db3fc027d6 100644 --- a/lisp/emacs-lisp/cl.el +++ b/lisp/emacs-lisp/cl.el @@ -149,13 +149,20 @@ be a symbol, or any generalized variable allowed by `setf'." (if (symbolp place) (list 'setq place (list 'cons x place)) (list 'callf2 'cons x place))) +(defvar pushnew-internal) + (defmacro pushnew (x place &rest keys) "(pushnew X PLACE): insert X at the head of the list if not already there. Like (push X PLACE), except that the list is unmodified if X is `eql' to an element already on the list. \nKeywords supported: :test :test-not :key \n(fn X PLACE [KEYWORD VALUE]...)" - (if (symbolp place) (list 'setq place (list* 'adjoin x place keys)) + (if (symbolp place) + (if (null keys) + `(let ((pushnew-internal ,place)) + (add-to-list 'pushnew-internal x nil 'eql) + (setq ,place pushnew-internal)) + (list 'setq place (list* 'adjoin x place keys))) (list* 'callf2 'adjoin x place keys))) (defun cl-set-elt (seq n val) -- cgit v1.2.1 From e027c6e48d4c199a70366a951b3c771e16f6a486 Mon Sep 17 00:00:00 2001 From: Reiner Steib Date: Mon, 11 Sep 2006 11:15:54 +0000 Subject: (pushnew): Add missing `,'. --- lisp/emacs-lisp/cl.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el index 9db3fc027d6..53bec05ddc3 100644 --- a/lisp/emacs-lisp/cl.el +++ b/lisp/emacs-lisp/cl.el @@ -160,7 +160,7 @@ an element already on the list. (if (symbolp place) (if (null keys) `(let ((pushnew-internal ,place)) - (add-to-list 'pushnew-internal x nil 'eql) + (add-to-list 'pushnew-internal ,x nil 'eql) (setq ,place pushnew-internal)) (list 'setq place (list* 'adjoin x place keys))) (list* 'callf2 'adjoin x place keys))) -- cgit v1.2.1 From 5bde639f478b246e33bfb74f03e8f8ccfa7542f9 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Wed, 20 Sep 2006 23:12:15 +0000 Subject: (pushnew): Rework 2006-09-10 change. Use memql instead of add-to-list in the simple case. --- lisp/emacs-lisp/cl.el | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el index 53bec05ddc3..3399f7e7b20 100644 --- a/lisp/emacs-lisp/cl.el +++ b/lisp/emacs-lisp/cl.el @@ -159,9 +159,7 @@ an element already on the list. \n(fn X PLACE [KEYWORD VALUE]...)" (if (symbolp place) (if (null keys) - `(let ((pushnew-internal ,place)) - (add-to-list 'pushnew-internal ,x nil 'eql) - (setq ,place pushnew-internal)) + `(if (memql ,x ,place) ,place (setq ,place (cons ,x ,place))) (list 'setq place (list* 'adjoin x place keys))) (list* 'callf2 'adjoin x place keys))) -- cgit v1.2.1 From eae510750d41e542edc35b5c74e9093f8afb2e01 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Wed, 20 Sep 2006 23:12:25 +0000 Subject: (member*): Use memql instead of complex code. Suggested by Miles Bader. --- lisp/emacs-lisp/cl-macs.el | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index e8590933863..b7d63acc861 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2578,21 +2578,7 @@ surrounded by (block NAME ...). (cl-const-expr-val (nth 1 keys))))) (cond ((eq test 'eq) (list 'memq a list)) ((eq test 'equal) (list 'member a list)) - ((or (null keys) (eq test 'eql)) - (if (eq (cl-const-expr-p a) t) - (list (if (floatp-safe (cl-const-expr-val a)) 'member 'memq) - a list) - (if (eq (cl-const-expr-p list) t) - (let ((p (cl-const-expr-val list)) (mb nil) (mq nil)) - (if (not (cdr p)) - (and p (list 'eql a (list 'quote (car p)))) - (while p - (if (floatp-safe (car p)) (setq mb t) - (or (integerp (car p)) (symbolp (car p)) (setq mq t))) - (setq p (cdr p))) - (if (not mb) (list 'memq a list) - (if (not mq) (list 'member a list) form)))) - form))) + ((or (null keys) (eq test 'eql)) (list 'memql a list)) (t form)))) (define-compiler-macro assoc* (&whole form a list &rest keys) -- cgit v1.2.1 From e00c3f6fb6adb73db3ffcdf4bf69a125c49e5b6c Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 24 Sep 2006 20:39:52 +0000 Subject: (timer-max-repeats): Doc fix. --- lisp/emacs-lisp/timer.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el index 54c5aff305a..0c66a207351 100644 --- a/lisp/emacs-lisp/timer.el +++ b/lisp/emacs-lisp/timer.el @@ -300,7 +300,11 @@ and idle timers such as are scheduled by `run-with-idle-timer'." "Third-to-last timer that was run.") (defvar timer-max-repeats 10 - "*Maximum number of times to repeat a timer, if real time jumps.") + "*Maximum number of times to repeat a timer, if many repeats are delayed. +Timer invocations can be delayed because Emacs is suspended or busy, +or because the system's time changes. If such an occurrence makes it +appear that many invocations are overdue, this variable controls +how many will really happen.") (defun timer-until (timer time) "Calculate number of seconds from when TIMER will run, until TIME. -- cgit v1.2.1 From 8f1a5a9b18f83bf8044d0b79cd83707d9d75ef32 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 2 Oct 2006 02:27:12 +0000 Subject: (find-function-regexp): Don't match "define-button-type". --- lisp/emacs-lisp/find-func.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 50b7d8dc9ef..42c5d3183e7 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el @@ -64,7 +64,7 @@ (concat "^\\s-*(\\(def\\(ine-skeleton\\|ine-generic-mode\\|ine-derived-mode\\|\ ine\\(?:-global\\)?-minor-mode\\|ine-compilation-mode\\|un-cvs-mode\\|\ -foo\\|[^cfgv]\\(\\w\\|\\s_\\)+\\*?\\)\\|easy-mmode-define-[a-z-]+\\|easy-menu-define\\|\ +foo\\|[^icfgv]\\(\\w\\|\\s_\\)+\\*?\\)\\|easy-mmode-define-[a-z-]+\\|easy-menu-define\\|\ menu-bar-make-toggle\\)" find-function-space-re "\\('\\|\(quote \\)?%s\\(\\s-\\|$\\|\(\\|\)\\)") -- cgit v1.2.1 From fcecceea0fd32073e8d0496ca841e6db8b18b2ad Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Tue, 3 Oct 2006 09:19:17 +0000 Subject: (pushnew-internal): Remove defvar. (pushnew): Fix last change. --- lisp/emacs-lisp/cl.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el index 3399f7e7b20..d2d68189230 100644 --- a/lisp/emacs-lisp/cl.el +++ b/lisp/emacs-lisp/cl.el @@ -149,8 +149,6 @@ be a symbol, or any generalized variable allowed by `setf'." (if (symbolp place) (list 'setq place (list 'cons x place)) (list 'callf2 'cons x place))) -(defvar pushnew-internal) - (defmacro pushnew (x place &rest keys) "(pushnew X PLACE): insert X at the head of the list if not already there. Like (push X PLACE), except that the list is unmodified if X is `eql' to @@ -159,7 +157,8 @@ an element already on the list. \n(fn X PLACE [KEYWORD VALUE]...)" (if (symbolp place) (if (null keys) - `(if (memql ,x ,place) ,place (setq ,place (cons ,x ,place))) + `(let ((x ,x)) + (if (memql x ,place) ,place (setq ,place (cons x ,place)))) (list 'setq place (list* 'adjoin x place keys))) (list* 'callf2 'adjoin x place keys))) -- cgit v1.2.1 From 6b0a96341e8940314525e72ebe7f283ca3d90c82 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Thu, 5 Oct 2006 15:53:30 +0000 Subject: (ad-remove-advice, ad-parse-arglist, ad-make-mapped-call): Use `let', not `let*'. --- lisp/emacs-lisp/advice.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index d03245bf452..5aa8bbd14cc 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el @@ -2409,7 +2409,7 @@ If such an advice was found it will be removed from the list of advices in that CLASS." (interactive (ad-read-advice-specification "Remove advice of")) (if (ad-is-advised function) - (let* ((advice-to-remove (ad-find-advice function class name))) + (let ((advice-to-remove (ad-find-advice function class name))) (if advice-to-remove (ad-set-advice-info-field function class @@ -2747,7 +2747,7 @@ For that it has to be fbound with a non-autoload definition." A three-element list is returned, where the 1st element is the list of required arguments, the 2nd is the list of optional arguments, and the 3rd is the name of an optional rest parameter (or nil)." - (let* (required optional rest) + (let (required optional rest) (setq rest (car (cdr (memq '&rest arglist)))) (if rest (setq arglist (reverse (cdr (memq '&rest (reverse arglist)))))) (setq optional (cdr (memq '&optional arglist))) @@ -2958,7 +2958,7 @@ Example: `(ad-map-arglists '(a &rest args) '(w x y z))' will return (defun ad-make-mapped-call (source-arglist target-arglist target-function) "Make form to call TARGET-FUNCTION with args from SOURCE-ARGLIST." - (let* ((mapped-form (ad-map-arglists source-arglist target-arglist))) + (let ((mapped-form (ad-map-arglists source-arglist target-arglist))) (if (eq (car mapped-form) 'funcall) (cons target-function (cdr (cdr mapped-form))) (prog1 mapped-form -- cgit v1.2.1