diff options
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/advice.el | 6 | ||||
-rw-r--r-- | lisp/emacs-lisp/bindat.el | 17 | ||||
-rw-r--r-- | lisp/emacs-lisp/checkdoc.el | 3 | ||||
-rw-r--r-- | lisp/emacs-lisp/cl-macs.el | 16 | ||||
-rw-r--r-- | lisp/emacs-lisp/cl.el | 6 | ||||
-rw-r--r-- | lisp/emacs-lisp/easy-mmode.el | 3 | ||||
-rw-r--r-- | lisp/emacs-lisp/eldoc.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/find-func.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/timer.el | 34 | ||||
-rw-r--r-- | lisp/emacs-lisp/trace.el | 13 |
10 files changed, 58 insertions, 44 deletions
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 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)) 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") 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) diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el index 222407f86f2..d2d68189230 100644 --- a/lisp/emacs-lisp/cl.el +++ b/lisp/emacs-lisp/cl.el @@ -155,7 +155,11 @@ 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 ((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))) (defun cl-set-elt (seq n val) 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 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" 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-\\|$\\|\(\\|\)\\)") diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el index 82eac50c874..0c66a207351 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,12 +292,19 @@ 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.") + "*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. @@ -440,6 +455,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) 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 |