diff options
| author | Anders Lindgren | 2015-10-28 12:13:18 +0100 |
|---|---|---|
| committer | Anders Lindgren | 2015-10-28 12:13:18 +0100 |
| commit | e69f7770611d85e130806763a46db7e212bc952f (patch) | |
| tree | 96bdd02003f21cea72a604d8f14a06ff99cd9744 /lisp | |
| parent | 0392e241b844487261d4dfcccc9a442793e0a868 (diff) | |
| parent | cc587a3539612d250d222363b18d15258e33f82a (diff) | |
| download | emacs-e69f7770611d85e130806763a46db7e212bc952f.tar.gz emacs-e69f7770611d85e130806763a46db7e212bc952f.zip | |
Merge branch 'master' of /Volumes/HD2/build/emacs-git-ssh
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/autorevert.el | 79 | ||||
| -rw-r--r-- | lisp/cedet/cedet-global.el | 16 | ||||
| -rw-r--r-- | lisp/cedet/ede/generic.el | 2 | ||||
| -rw-r--r-- | lisp/emacs-lisp/ert.el | 5 | ||||
| -rw-r--r-- | lisp/emacs-lisp/map.el | 23 | ||||
| -rw-r--r-- | lisp/emacs-lisp/seq.el | 343 | ||||
| -rw-r--r-- | lisp/emacs-lisp/thunk.el | 4 | ||||
| -rw-r--r-- | lisp/filenotify.el | 44 | ||||
| -rw-r--r-- | lisp/gnus/gnus-topic.el | 21 | ||||
| -rw-r--r-- | lisp/help.el | 7 | ||||
| -rw-r--r-- | lisp/international/ccl.el | 59 | ||||
| -rw-r--r-- | lisp/json.el | 2 | ||||
| -rw-r--r-- | lisp/net/eww.el | 2 | ||||
| -rw-r--r-- | lisp/net/tramp-smb.el | 7 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 1 | ||||
| -rw-r--r-- | lisp/obsolete/vc-arch.el | 4 | ||||
| -rw-r--r-- | lisp/textmodes/tex-mode.el | 30 | ||||
| -rw-r--r-- | lisp/vc/vc-bzr.el | 1 | ||||
| -rw-r--r-- | lisp/vc/vc-cvs.el | 2 | ||||
| -rw-r--r-- | lisp/vc/vc-git.el | 2 | ||||
| -rw-r--r-- | lisp/vc/vc-hg.el | 21 | ||||
| -rw-r--r-- | lisp/vc/vc-mtn.el | 4 | ||||
| -rw-r--r-- | lisp/vc/vc-svn.el | 4 |
23 files changed, 374 insertions, 309 deletions
diff --git a/lisp/autorevert.el b/lisp/autorevert.el index 37ee8eedcfd..f0c12d2d97e 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el | |||
| @@ -570,37 +570,54 @@ no more reverts are possible until the next call of | |||
| 570 | ;; Since we watch a directory, a file name must be returned. | 570 | ;; Since we watch a directory, a file name must be returned. |
| 571 | (cl-assert (stringp file)) | 571 | (cl-assert (stringp file)) |
| 572 | (when (eq action 'renamed) (cl-assert (stringp file1))) | 572 | (when (eq action 'renamed) (cl-assert (stringp file1))) |
| 573 | ;; Loop over all buffers, in order to find the intended one. | 573 | |
| 574 | (cl-dolist (buffer buffers) | 574 | (if (eq action 'stopped) |
| 575 | (when (buffer-live-p buffer) | 575 | ;; File notification has stopped. Continue with polling. |
| 576 | (with-current-buffer buffer | 576 | (cl-dolist (buffer buffers) |
| 577 | (when (or | 577 | (with-current-buffer buffer |
| 578 | ;; A buffer associated with a file. | 578 | (when (or |
| 579 | (and (stringp buffer-file-name) | 579 | ;; A buffer associated with a file. |
| 580 | (or | 580 | (and (stringp buffer-file-name) |
| 581 | (and (memq action '(attribute-changed changed created)) | 581 | (string-equal |
| 582 | (string-equal | 582 | (file-name-nondirectory file) |
| 583 | (file-name-nondirectory file) | 583 | (file-name-nondirectory buffer-file-name))) |
| 584 | (file-name-nondirectory buffer-file-name))) | 584 | ;; A buffer w/o a file, like dired. |
| 585 | (and (eq action 'renamed) | 585 | (null buffer-file-name)) |
| 586 | (string-equal | 586 | (auto-revert-notify-rm-watch) |
| 587 | (file-name-nondirectory file1) | 587 | (setq-local auto-revert-use-notify nil)))) |
| 588 | (file-name-nondirectory buffer-file-name))))) | 588 | |
| 589 | ;; A buffer w/o a file, like dired. | 589 | ;; Loop over all buffers, in order to find the intended one. |
| 590 | (and (null buffer-file-name) | 590 | (cl-dolist (buffer buffers) |
| 591 | (memq action '(created renamed deleted)))) | 591 | (when (buffer-live-p buffer) |
| 592 | ;; Mark buffer modified. | 592 | (with-current-buffer buffer |
| 593 | (setq auto-revert-notify-modified-p t) | 593 | (when (or |
| 594 | 594 | ;; A buffer associated with a file. | |
| 595 | ;; Revert the buffer now if we're not locked out. | 595 | (and (stringp buffer-file-name) |
| 596 | (when (/= auto-revert-buffers-counter-lockedout | 596 | (or |
| 597 | auto-revert-buffers-counter) | 597 | (and (memq |
| 598 | (auto-revert-handler) | 598 | action '(attribute-changed changed created)) |
| 599 | (setq auto-revert-buffers-counter-lockedout | 599 | (string-equal |
| 600 | auto-revert-buffers-counter)) | 600 | (file-name-nondirectory file) |
| 601 | 601 | (file-name-nondirectory buffer-file-name))) | |
| 602 | ;; No need to check other buffers. | 602 | (and (eq action 'renamed) |
| 603 | (cl-return)))))))) | 603 | (string-equal |
| 604 | (file-name-nondirectory file1) | ||
| 605 | (file-name-nondirectory buffer-file-name))))) | ||
| 606 | ;; A buffer w/o a file, like dired. | ||
| 607 | (and (null buffer-file-name) | ||
| 608 | (memq action '(created renamed deleted)))) | ||
| 609 | ;; Mark buffer modified. | ||
| 610 | (setq auto-revert-notify-modified-p t) | ||
| 611 | |||
| 612 | ;; Revert the buffer now if we're not locked out. | ||
| 613 | (when (/= auto-revert-buffers-counter-lockedout | ||
| 614 | auto-revert-buffers-counter) | ||
| 615 | (auto-revert-handler) | ||
| 616 | (setq auto-revert-buffers-counter-lockedout | ||
| 617 | auto-revert-buffers-counter)) | ||
| 618 | |||
| 619 | ;; No need to check other buffers. | ||
| 620 | (cl-return))))))))) | ||
| 604 | 621 | ||
| 605 | (defun auto-revert-active-p () | 622 | (defun auto-revert-active-p () |
| 606 | "Check if auto-revert is active (in current buffer or globally)." | 623 | "Check if auto-revert is active (in current buffer or globally)." |
diff --git a/lisp/cedet/cedet-global.el b/lisp/cedet/cedet-global.el index 3773ba09f32..3ceed5d3b54 100644 --- a/lisp/cedet/cedet-global.el +++ b/lisp/cedet/cedet-global.el | |||
| @@ -97,7 +97,7 @@ SCOPE is the scope of the search, such as 'project or 'subdirs." | |||
| 97 | ;; Check for warnings. | 97 | ;; Check for warnings. |
| 98 | (with-current-buffer b | 98 | (with-current-buffer b |
| 99 | (goto-char (point-min)) | 99 | (goto-char (point-min)) |
| 100 | (when (re-search-forward "Error\\|Warning" nil t) | 100 | (when (re-search-forward "Error\\|Warning\\|invalid" nil t) |
| 101 | (error "Output:\n%S" (buffer-string)))) | 101 | (error "Output:\n%S" (buffer-string)))) |
| 102 | 102 | ||
| 103 | b)) | 103 | b)) |
| @@ -186,12 +186,14 @@ If a database already exists, then just update it." | |||
| 186 | (let ((root (cedet-gnu-global-root dir))) | 186 | (let ((root (cedet-gnu-global-root dir))) |
| 187 | (if root (setq dir root)) | 187 | (if root (setq dir root)) |
| 188 | (let ((default-directory dir)) | 188 | (let ((default-directory dir)) |
| 189 | (cedet-gnu-global-gtags-call | 189 | (if root |
| 190 | (when root | 190 | ;; Incremental update. This can be either "gtags -i" or |
| 191 | '("-u");; Incremental update flag. | 191 | ;; "global -u"; the gtags manpage says it's better to use |
| 192 | )) | 192 | ;; "global -u". |
| 193 | ) | 193 | (cedet-gnu-global-call (list "-u")) |
| 194 | )) | 194 | (cedet-gnu-global-gtags-call nil) |
| 195 | ) | ||
| 196 | ))) | ||
| 195 | 197 | ||
| 196 | (provide 'cedet-global) | 198 | (provide 'cedet-global) |
| 197 | 199 | ||
diff --git a/lisp/cedet/ede/generic.el b/lisp/cedet/ede/generic.el index b865ff5028d..d3be545a158 100644 --- a/lisp/cedet/ede/generic.el +++ b/lisp/cedet/ede/generic.el | |||
| @@ -303,7 +303,7 @@ CLASS is the EIEIO class that is used to track this project. It should subclass | |||
| 303 | (ede-generic-new-autoloader "generic-cvs" "Generic CVS" | 303 | (ede-generic-new-autoloader "generic-cvs" "Generic CVS" |
| 304 | "CVS" 'ede-generic-vc-project) | 304 | "CVS" 'ede-generic-vc-project) |
| 305 | (ede-generic-new-autoloader "generic-mtn" "Generic Monotone" | 305 | (ede-generic-new-autoloader "generic-mtn" "Generic Monotone" |
| 306 | "_MTN/options" 'ede-generic-vc-project) | 306 | "_MTN" 'ede-generic-vc-project) |
| 307 | 307 | ||
| 308 | ;; Take advantage of existing 'projectile' based projects. | 308 | ;; Take advantage of existing 'projectile' based projects. |
| 309 | ;; @TODO - if projectile supports compile commands etc, can we | 309 | ;; @TODO - if projectile supports compile commands etc, can we |
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 2eba0216faf..21c1f1be394 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el | |||
| @@ -64,7 +64,7 @@ | |||
| 64 | (require 'ewoc) | 64 | (require 'ewoc) |
| 65 | (require 'find-func) | 65 | (require 'find-func) |
| 66 | (require 'help) | 66 | (require 'help) |
| 67 | 67 | (require 'pp) | |
| 68 | 68 | ||
| 69 | ;;; UI customization options. | 69 | ;;; UI customization options. |
| 70 | 70 | ||
| @@ -1300,7 +1300,8 @@ EXPECTEDP specifies whether the result was expected." | |||
| 1300 | (defun ert--pp-with-indentation-and-newline (object) | 1300 | (defun ert--pp-with-indentation-and-newline (object) |
| 1301 | "Pretty-print OBJECT, indenting it to the current column of point. | 1301 | "Pretty-print OBJECT, indenting it to the current column of point. |
| 1302 | Ensures a final newline is inserted." | 1302 | Ensures a final newline is inserted." |
| 1303 | (let ((begin (point))) | 1303 | (let ((begin (point)) |
| 1304 | (pp-escape-newlines nil)) | ||
| 1304 | (pp object (current-buffer)) | 1305 | (pp object (current-buffer)) |
| 1305 | (unless (bolp) (insert "\n")) | 1306 | (unless (bolp) (insert "\n")) |
| 1306 | (save-excursion | 1307 | (save-excursion |
diff --git a/lisp/emacs-lisp/map.el b/lisp/emacs-lisp/map.el index cc437e02e78..5ef51f12d96 100644 --- a/lisp/emacs-lisp/map.el +++ b/lisp/emacs-lisp/map.el | |||
| @@ -45,12 +45,12 @@ | |||
| 45 | (require 'seq) | 45 | (require 'seq) |
| 46 | 46 | ||
| 47 | (pcase-defmacro map (&rest args) | 47 | (pcase-defmacro map (&rest args) |
| 48 | "pcase pattern matching map elements. | 48 | "Build a `pcase' pattern matching map elements. |
| 49 | 49 | ||
| 50 | Matches if the object is a map (list, hash-table or array), and | 50 | The `pcase' pattern will match each element of PATTERN against |
| 51 | each PATTERN matches the corresponding elements of the map. | 51 | the corresponding elements of the map. |
| 52 | 52 | ||
| 53 | Supernumerary elements of the map are ignored if fewer ARGS are | 53 | Extra elements of the map are ignored if fewer ARGS are |
| 54 | given, and the match does not fail. | 54 | given, and the match does not fail. |
| 55 | 55 | ||
| 56 | ARGS can be a list of the form (KEY PAT), in which case KEY in an | 56 | ARGS can be a list of the form (KEY PAT), in which case KEY in an |
| @@ -92,7 +92,7 @@ Return RESULT if non-nil or the result of evaluation of the form." | |||
| 92 | (t (error "Unsupported map: %s" ,map-var))))) | 92 | (t (error "Unsupported map: %s" ,map-var))))) |
| 93 | 93 | ||
| 94 | (defun map-elt (map key &optional default) | 94 | (defun map-elt (map key &optional default) |
| 95 | "Perform a lookup in MAP of KEY and return its associated value. | 95 | "Lookup KEY in MAP and return its associated value. |
| 96 | If KEY is not found, return DEFAULT which defaults to nil. | 96 | If KEY is not found, return DEFAULT which defaults to nil. |
| 97 | 97 | ||
| 98 | If MAP is a list, `eql' is used to lookup KEY. | 98 | If MAP is a list, `eql' is used to lookup KEY. |
| @@ -122,7 +122,7 @@ MAP can be a list, hash-table or array." | |||
| 122 | default))) | 122 | default))) |
| 123 | 123 | ||
| 124 | (defmacro map-put (map key value) | 124 | (defmacro map-put (map key value) |
| 125 | "In MAP, associate KEY with VALUE and return MAP. | 125 | "Associate KEY with VALUE in MAP and return MAP. |
| 126 | If KEY is already present in MAP, replace the associated value | 126 | If KEY is already present in MAP, replace the associated value |
| 127 | with VALUE. | 127 | with VALUE. |
| 128 | 128 | ||
| @@ -133,8 +133,9 @@ MAP can be a list, hash-table or array." | |||
| 133 | ,map))) | 133 | ,map))) |
| 134 | 134 | ||
| 135 | (defmacro map-delete (map key) | 135 | (defmacro map-delete (map key) |
| 136 | "In MAP, delete the key KEY if present and return MAP. | 136 | "Delete KEY from MAP and return MAP. |
| 137 | If MAP is an array, store nil at the index KEY. | 137 | No error is signaled if KEY is not a key of MAP. If MAP is an |
| 138 | array, store nil at the index KEY. | ||
| 138 | 139 | ||
| 139 | MAP can be a list, hash-table or array." | 140 | MAP can be a list, hash-table or array." |
| 140 | (declare (debug t)) | 141 | (declare (debug t)) |
| @@ -245,7 +246,7 @@ MAP can be a list, hash-table or array." | |||
| 245 | (arrayp map))) | 246 | (arrayp map))) |
| 246 | 247 | ||
| 247 | (defun map-empty-p (map) | 248 | (defun map-empty-p (map) |
| 248 | "Return non-nil is MAP is empty. | 249 | "Return non-nil if MAP is empty. |
| 249 | 250 | ||
| 250 | MAP can be a list, hash-table or array." | 251 | MAP can be a list, hash-table or array." |
| 251 | (map--dispatch map | 252 | (map--dispatch map |
| @@ -254,7 +255,7 @@ MAP can be a list, hash-table or array." | |||
| 254 | :hash-table (zerop (hash-table-count map)))) | 255 | :hash-table (zerop (hash-table-count map)))) |
| 255 | 256 | ||
| 256 | (defun map-contains-key (map key &optional testfn) | 257 | (defun map-contains-key (map key &optional testfn) |
| 257 | "Return non-nil if MAP contain the key KEY, nil otherwise. | 258 | "Return non-nil if MAP contain KEY, nil otherwise. |
| 258 | Equality is defined by TESTFN if non-nil or by `equal' if nil. | 259 | Equality is defined by TESTFN if non-nil or by `equal' if nil. |
| 259 | 260 | ||
| 260 | MAP can be a list, hash-table or array." | 261 | MAP can be a list, hash-table or array." |
| @@ -284,7 +285,7 @@ MAP can be a list, hash-table or array." | |||
| 284 | t)) | 285 | t)) |
| 285 | 286 | ||
| 286 | (defun map-merge (type &rest maps) | 287 | (defun map-merge (type &rest maps) |
| 287 | "Merge into a map of type TYPE all the key/value pairs in the maps MAPS. | 288 | "Merge into a map of type TYPE all the key/value pairs in MAPS. |
| 288 | 289 | ||
| 289 | MAP can be a list, hash-table or array." | 290 | MAP can be a list, hash-table or array." |
| 290 | (let (result) | 291 | (let (result) |
diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index f5189c7dc97..d0c2d24b015 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el | |||
| @@ -61,305 +61,310 @@ | |||
| 61 | 61 | ||
| 62 | (defmacro seq-doseq (spec &rest body) | 62 | (defmacro seq-doseq (spec &rest body) |
| 63 | "Loop over a sequence. | 63 | "Loop over a sequence. |
| 64 | Similar to `dolist' but can be applied to lists, strings, and vectors. | 64 | Evaluate BODY with VAR bound to each element of SEQUENCE, in turn. |
| 65 | 65 | ||
| 66 | Evaluate BODY with VAR bound to each element of SEQ, in turn. | 66 | Similar to `dolist' but can be applied to lists, strings, and vectors. |
| 67 | 67 | ||
| 68 | \(fn (VAR SEQ) BODY...)" | 68 | \(fn (VAR SEQUENCE) BODY...)" |
| 69 | (declare (indent 1) (debug ((symbolp form &optional form) body))) | 69 | (declare (indent 1) (debug ((symbolp form &optional form) body))) |
| 70 | `(seq-do (lambda (,(car spec)) | 70 | `(seq-do (lambda (,(car spec)) |
| 71 | ,@body) | 71 | ,@body) |
| 72 | ,(cadr spec))) | 72 | ,(cadr spec))) |
| 73 | 73 | ||
| 74 | (pcase-defmacro seq (&rest patterns) | 74 | (pcase-defmacro seq (&rest patterns) |
| 75 | "pcase pattern matching sequence elements. | 75 | "Build a `pcase' pattern that matches elements of SEQUENCE. |
| 76 | 76 | ||
| 77 | Matches if the object is a sequence (list, string or vector), and | 77 | The `pcase' pattern will match each element of PATTERNS against the |
| 78 | each PATTERN matches the corresponding element of the sequence. | 78 | corresponding element of SEQUENCE. |
| 79 | 79 | ||
| 80 | Supernumerary elements of the sequence are ignored if fewer | 80 | Extra elements of the sequence are ignored if fewer PATTERNS are |
| 81 | PATTERNS are given, and the match does not fail." | 81 | given, and the match does not fail." |
| 82 | `(and (pred seq-p) | 82 | `(and (pred seq-p) |
| 83 | ,@(seq--make-pcase-bindings patterns))) | 83 | ,@(seq--make-pcase-bindings patterns))) |
| 84 | 84 | ||
| 85 | (defmacro seq-let (args seq &rest body) | 85 | (defmacro seq-let (args sequence &rest body) |
| 86 | "Bind the variables in ARGS to the elements of SEQ then evaluate BODY. | 86 | "Bind the variables in ARGS to the elements of SEQUENCE, then evaluate BODY. |
| 87 | 87 | ||
| 88 | ARGS can also include the `&rest' marker followed by a variable | 88 | ARGS can also include the `&rest' marker followed by a variable |
| 89 | name to be bound to the rest of SEQ." | 89 | name to be bound to the rest of SEQUENCE." |
| 90 | (declare (indent 2) (debug t)) | 90 | (declare (indent 2) (debug t)) |
| 91 | `(pcase-let ((,(seq--make-pcase-patterns args) ,seq)) | 91 | `(pcase-let ((,(seq--make-pcase-patterns args) ,sequence)) |
| 92 | ,@body)) | 92 | ,@body)) |
| 93 | 93 | ||
| 94 | 94 | ||
| 95 | ;;; Basic seq functions that have to be implemented by new seq types | 95 | ;;; Basic seq functions that have to be implemented by new sequence types |
| 96 | (cl-defgeneric seq-elt (seq n) | 96 | (cl-defgeneric seq-elt (sequence n) |
| 97 | "Return the element of SEQ at index N." | 97 | "Return Nth element of SEQUENCE." |
| 98 | (elt seq n)) | 98 | (elt sequence n)) |
| 99 | 99 | ||
| 100 | ;; Default gv setters for `seq-elt'. | 100 | ;; Default gv setters for `seq-elt'. |
| 101 | ;; It can be a good idea for new sequence implementations to provide a | 101 | ;; It can be a good idea for new sequence implementations to provide a |
| 102 | ;; "gv-setter" for `seq-elt'. | 102 | ;; "gv-setter" for `seq-elt'. |
| 103 | (cl-defmethod (setf seq-elt) (store (seq array) n) | 103 | (cl-defmethod (setf seq-elt) (store (sequence array) n) |
| 104 | (aset seq n store)) | 104 | (aset sequence n store)) |
| 105 | 105 | ||
| 106 | (cl-defmethod (setf seq-elt) (store (seq cons) n) | 106 | (cl-defmethod (setf seq-elt) (store (sequence cons) n) |
| 107 | (setcar (nthcdr n seq) store)) | 107 | (setcar (nthcdr n sequence) store)) |
| 108 | 108 | ||
| 109 | (cl-defgeneric seq-length (seq) | 109 | (cl-defgeneric seq-length (sequence) |
| 110 | "Return the length of the sequence SEQ." | 110 | "Return the number of elements of SEQUENCE." |
| 111 | (length seq)) | 111 | (length sequence)) |
| 112 | 112 | ||
| 113 | (cl-defgeneric seq-do (function seq) | 113 | (cl-defgeneric seq-do (function sequence) |
| 114 | "Apply FUNCTION to each element of SEQ, presumably for side effects. | 114 | "Apply FUNCTION to each element of SEQUENCE, presumably for side effects. |
| 115 | Return SEQ." | 115 | Return SEQUENCE." |
| 116 | (mapc function seq)) | 116 | (mapc function sequence)) |
| 117 | 117 | ||
| 118 | (defalias 'seq-each #'seq-do) | 118 | (defalias 'seq-each #'seq-do) |
| 119 | 119 | ||
| 120 | (cl-defgeneric seq-p (seq) | 120 | (cl-defgeneric seq-p (sequence) |
| 121 | "Return non-nil if SEQ is a sequence, nil otherwise." | 121 | "Return non-nil if SEQUENCE is a sequence, nil otherwise." |
| 122 | (sequencep seq)) | 122 | (sequencep sequence)) |
| 123 | 123 | ||
| 124 | (cl-defgeneric seq-copy (seq) | 124 | (cl-defgeneric seq-copy (sequence) |
| 125 | "Return a shallow copy of SEQ." | 125 | "Return a shallow copy of SEQUENCE." |
| 126 | (copy-sequence seq)) | 126 | (copy-sequence sequence)) |
| 127 | 127 | ||
| 128 | (cl-defgeneric seq-subseq (seq start &optional end) | 128 | (cl-defgeneric seq-subseq (sequence start &optional end) |
| 129 | "Return the subsequence of SEQ from START to END. | 129 | "Return the sequence of elements of SEQUENCE from START to END. |
| 130 | If END is omitted, it defaults to the length of the sequence. | 130 | END is inclusive. |
| 131 | If START or END is negative, it counts from the end. | 131 | |
| 132 | Signal an error if START or END are outside of the sequence (i.e | 132 | If END is omitted, it defaults to the length of the sequence. If |
| 133 | too large if positive or too small if negative)." | 133 | START or END is negative, it counts from the end. Signal an |
| 134 | (cl-subseq seq start end)) | 134 | error if START or END are outside of the sequence (i.e too large |
| 135 | if positive or too small if negative)." | ||
| 136 | (cl-subseq sequence start end)) | ||
| 135 | 137 | ||
| 136 | 138 | ||
| 137 | (cl-defgeneric seq-map (function seq) | 139 | (cl-defgeneric seq-map (function sequence) |
| 138 | "Return the result of applying FUNCTION to each element of SEQ." | 140 | "Return the result of applying FUNCTION to each element of SEQUENCE." |
| 139 | (let (result) | 141 | (let (result) |
| 140 | (seq-do (lambda (elt) | 142 | (seq-do (lambda (elt) |
| 141 | (push (funcall function elt) result)) | 143 | (push (funcall function elt) result)) |
| 142 | seq) | 144 | sequence) |
| 143 | (nreverse result))) | 145 | (nreverse result))) |
| 144 | 146 | ||
| 145 | ;; faster implementation for sequences (sequencep) | 147 | ;; faster implementation for sequences (sequencep) |
| 146 | (cl-defmethod seq-map (function (seq sequence)) | 148 | (cl-defmethod seq-map (function (sequence sequence)) |
| 147 | (mapcar function seq)) | 149 | (mapcar function sequence)) |
| 148 | 150 | ||
| 149 | (cl-defgeneric seq-drop (seq n) | 151 | (cl-defgeneric seq-drop (sequence n) |
| 150 | "Return a subsequence of SEQ without its first N elements. | 152 | "Remove the first N elements of SEQUENCE and return the result. |
| 151 | The result is a sequence of the same type as SEQ. | 153 | The result is a sequence of the same type as SEQUENCE. |
| 152 | 154 | ||
| 153 | If N is a negative integer or zero, SEQ is returned." | 155 | If N is a negative integer or zero, SEQUENCE is returned." |
| 154 | (if (<= n 0) | 156 | (if (<= n 0) |
| 155 | seq | 157 | sequence |
| 156 | (let ((length (seq-length seq))) | 158 | (let ((length (seq-length sequence))) |
| 157 | (seq-subseq seq (min n length) length)))) | 159 | (seq-subseq sequence (min n length) length)))) |
| 158 | 160 | ||
| 159 | (cl-defgeneric seq-take (seq n) | 161 | (cl-defgeneric seq-take (sequence n) |
| 160 | "Return a subsequence of SEQ with its first N elements. | 162 | "Take the first N elements of SEQUENCE and return the result. |
| 161 | The result is a sequence of the same type as SEQ. | 163 | The result is a sequence of the same type as SEQUENCE. |
| 162 | 164 | ||
| 163 | If N is a negative integer or zero, an empty sequence is | 165 | If N is a negative integer or zero, an empty sequence is |
| 164 | returned." | 166 | returned." |
| 165 | (seq-subseq seq 0 (min (max n 0) (seq-length seq)))) | 167 | (seq-subseq sequence 0 (min (max n 0) (seq-length sequence)))) |
| 166 | 168 | ||
| 167 | (cl-defgeneric seq-drop-while (pred seq) | 169 | (cl-defgeneric seq-drop-while (pred sequence) |
| 168 | "Return a sequence from the first element for which (PRED element) is nil in SEQ. | 170 | "Remove the successive elements of SEQUENCE for which PRED returns non-nil. |
| 169 | The result is a sequence of the same type as SEQ." | 171 | PRED is a function of one argument. The result is a sequence of |
| 170 | (seq-drop seq (seq--count-successive pred seq))) | 172 | the same type as SEQUENCE." |
| 171 | 173 | (seq-drop sequence (seq--count-successive pred sequence))) | |
| 172 | (cl-defgeneric seq-take-while (pred seq) | 174 | |
| 173 | "Return the successive elements for which (PRED element) is non-nil in SEQ. | 175 | (cl-defgeneric seq-take-while (pred sequence) |
| 174 | The result is a sequence of the same type as SEQ." | 176 | "Take the successive elements of SEQUENCE for which PRED returns non-nil. |
| 175 | (seq-take seq (seq--count-successive pred seq))) | 177 | PRED is a function of one argument. The result is a sequence of |
| 176 | 178 | the same type as SEQUENCE." | |
| 177 | (cl-defgeneric seq-empty-p (seq) | 179 | (seq-take sequence (seq--count-successive pred sequence))) |
| 178 | "Return non-nil if the sequence SEQ is empty, nil otherwise." | 180 | |
| 179 | (= 0 (seq-length seq))) | 181 | (cl-defgeneric seq-empty-p (sequence) |
| 180 | 182 | "Return non-nil if the SEQUENCE is empty, nil otherwise." | |
| 181 | (cl-defgeneric seq-sort (pred seq) | 183 | (= 0 (seq-length sequence))) |
| 182 | "Return a sorted sequence comparing using PRED the elements of SEQ. | 184 | |
| 183 | The result is a sequence of the same type as SEQ." | 185 | (cl-defgeneric seq-sort (pred sequence) |
| 184 | (let ((result (seq-sort pred (append seq nil)))) | 186 | "Sort SEQUENCE using PRED as comparison function. |
| 185 | (seq-into result (type-of seq)))) | 187 | The result is a sequence of the same type as SEQUENCE." |
| 188 | (let ((result (seq-sort pred (append sequence nil)))) | ||
| 189 | (seq-into result (type-of sequence)))) | ||
| 186 | 190 | ||
| 187 | (cl-defmethod seq-sort (pred (list list)) | 191 | (cl-defmethod seq-sort (pred (list list)) |
| 188 | (sort (seq-copy list) pred)) | 192 | (sort (seq-copy list) pred)) |
| 189 | 193 | ||
| 190 | (cl-defgeneric seq-reverse (seq) | 194 | (cl-defgeneric seq-reverse (sequence) |
| 191 | "Return the reversed shallow copy of SEQ." | 195 | "Return a sequence with elements of SEQUENCE in reverse order." |
| 192 | (let ((result '())) | 196 | (let ((result '())) |
| 193 | (seq-map (lambda (elt) | 197 | (seq-map (lambda (elt) |
| 194 | (push elt result)) | 198 | (push elt result)) |
| 195 | seq) | 199 | sequence) |
| 196 | (seq-into result (type-of seq)))) | 200 | (seq-into result (type-of sequence)))) |
| 197 | 201 | ||
| 198 | ;; faster implementation for sequences (sequencep) | 202 | ;; faster implementation for sequences (sequencep) |
| 199 | (cl-defmethod seq-reverse ((seq sequence)) | 203 | (cl-defmethod seq-reverse ((sequence sequence)) |
| 200 | (reverse seq)) | 204 | (reverse sequence)) |
| 201 | 205 | ||
| 202 | (cl-defgeneric seq-concatenate (type &rest seqs) | 206 | (cl-defgeneric seq-concatenate (type &rest sequences) |
| 203 | "Concatenate, into a sequence of type TYPE, the sequences SEQS. | 207 | "Concatenate SEQUENCES into a single sequence of type TYPE. |
| 204 | TYPE must be one of following symbols: vector, string or list. | 208 | TYPE must be one of following symbols: vector, string or list. |
| 205 | 209 | ||
| 206 | \n(fn TYPE SEQUENCE...)" | 210 | \n(fn TYPE SEQUENCE...)" |
| 207 | (apply #'cl-concatenate type (seq-map #'seq-into-sequence seqs))) | 211 | (apply #'cl-concatenate type (seq-map #'seq-into-sequence sequences))) |
| 208 | 212 | ||
| 209 | (cl-defgeneric seq-into-sequence (seq) | 213 | (cl-defgeneric seq-into-sequence (sequence) |
| 210 | "Convert SEQ into a sequence. | 214 | "Convert SEQUENCE into a sequence. |
| 211 | 215 | ||
| 212 | The default implementation is to signal an error if SEQ is not a | 216 | The default implementation is to signal an error if SEQUENCE is not a |
| 213 | sequence, specific functions should be implemented for new types | 217 | sequence, specific functions should be implemented for new types |
| 214 | of seq." | 218 | of sequence." |
| 215 | (unless (sequencep seq) | 219 | (unless (sequencep sequence) |
| 216 | (error "Cannot convert %S into a sequence" seq)) | 220 | (error "Cannot convert %S into a sequence" sequence)) |
| 217 | seq) | 221 | sequence) |
| 218 | 222 | ||
| 219 | (cl-defgeneric seq-into (seq type) | 223 | (cl-defgeneric seq-into (sequence type) |
| 220 | "Convert the sequence SEQ into a sequence of type TYPE. | 224 | "Concatenate the elements of SEQUENCE into a sequence of type TYPE. |
| 221 | TYPE can be one of the following symbols: vector, string or list." | 225 | TYPE can be one of the following symbols: vector, string or |
| 226 | list." | ||
| 222 | (pcase type | 227 | (pcase type |
| 223 | (`vector (vconcat seq)) | 228 | (`vector (vconcat sequence)) |
| 224 | (`string (concat seq)) | 229 | (`string (concat sequence)) |
| 225 | (`list (append seq nil)) | 230 | (`list (append sequence nil)) |
| 226 | (_ (error "Not a sequence type name: %S" type)))) | 231 | (_ (error "Not a sequence type name: %S" type)))) |
| 227 | 232 | ||
| 228 | (cl-defgeneric seq-filter (pred seq) | 233 | (cl-defgeneric seq-filter (pred sequence) |
| 229 | "Return a list of all the elements for which (PRED element) is non-nil in SEQ." | 234 | "Return a list of all the elements for which (PRED element) is non-nil in SEQUENCE." |
| 230 | (let ((exclude (make-symbol "exclude"))) | 235 | (let ((exclude (make-symbol "exclude"))) |
| 231 | (delq exclude (seq-map (lambda (elt) | 236 | (delq exclude (seq-map (lambda (elt) |
| 232 | (if (funcall pred elt) | 237 | (if (funcall pred elt) |
| 233 | elt | 238 | elt |
| 234 | exclude)) | 239 | exclude)) |
| 235 | seq)))) | 240 | sequence)))) |
| 236 | 241 | ||
| 237 | (cl-defgeneric seq-remove (pred seq) | 242 | (cl-defgeneric seq-remove (pred sequence) |
| 238 | "Return a list of all the elements for which (PRED element) is nil in SEQ." | 243 | "Return a list of all the elements for which (PRED element) is nil in SEQUENCE." |
| 239 | (seq-filter (lambda (elt) (not (funcall pred elt))) | 244 | (seq-filter (lambda (elt) (not (funcall pred elt))) |
| 240 | seq)) | 245 | sequence)) |
| 241 | 246 | ||
| 242 | (cl-defgeneric seq-reduce (function seq initial-value) | 247 | (cl-defgeneric seq-reduce (function sequence initial-value) |
| 243 | "Reduce the function FUNCTION across SEQ, starting with INITIAL-VALUE. | 248 | "Reduce the function FUNCTION across SEQUENCE, starting with INITIAL-VALUE. |
| 244 | 249 | ||
| 245 | Return the result of calling FUNCTION with INITIAL-VALUE and the | 250 | Return the result of calling FUNCTION with INITIAL-VALUE and the |
| 246 | first element of SEQ, then calling FUNCTION with that result and | 251 | first element of SEQUENCE, then calling FUNCTION with that result and |
| 247 | the second element of SEQ, then with that result and the third | 252 | the second element of SEQUENCE, then with that result and the third |
| 248 | element of SEQ, etc. | 253 | element of SEQUENCE, etc. |
| 249 | 254 | ||
| 250 | If SEQ is empty, return INITIAL-VALUE and FUNCTION is not called." | 255 | If SEQUENCE is empty, return INITIAL-VALUE and FUNCTION is not called." |
| 251 | (if (seq-empty-p seq) | 256 | (if (seq-empty-p sequence) |
| 252 | initial-value | 257 | initial-value |
| 253 | (let ((acc initial-value)) | 258 | (let ((acc initial-value)) |
| 254 | (seq-doseq (elt seq) | 259 | (seq-doseq (elt sequence) |
| 255 | (setq acc (funcall function acc elt))) | 260 | (setq acc (funcall function acc elt))) |
| 256 | acc))) | 261 | acc))) |
| 257 | 262 | ||
| 258 | (cl-defgeneric seq-every-p (pred seq) | 263 | (cl-defgeneric seq-every-p (pred sequence) |
| 259 | "Return non-nil if (PRED element) is non-nil for all elements of the sequence SEQ." | 264 | "Return non-nil if (PRED element) is non-nil for all elements of SEQUENCE." |
| 260 | (catch 'seq--break | 265 | (catch 'seq--break |
| 261 | (seq-doseq (elt seq) | 266 | (seq-doseq (elt sequence) |
| 262 | (or (funcall pred elt) | 267 | (or (funcall pred elt) |
| 263 | (throw 'seq--break nil))) | 268 | (throw 'seq--break nil))) |
| 264 | t)) | 269 | t)) |
| 265 | 270 | ||
| 266 | (cl-defgeneric seq-some (pred seq) | 271 | (cl-defgeneric seq-some (pred sequence) |
| 267 | "Return the first value for which if (PRED element) is non-nil for in SEQ." | 272 | "Return the first value for which if (PRED element) is non-nil for in SEQUENCE." |
| 268 | (catch 'seq--break | 273 | (catch 'seq--break |
| 269 | (seq-doseq (elt seq) | 274 | (seq-doseq (elt sequence) |
| 270 | (let ((result (funcall pred elt))) | 275 | (let ((result (funcall pred elt))) |
| 271 | (when result | 276 | (when result |
| 272 | (throw 'seq--break result)))) | 277 | (throw 'seq--break result)))) |
| 273 | nil)) | 278 | nil)) |
| 274 | 279 | ||
| 275 | (cl-defgeneric seq-find (pred seq &optional default) | 280 | (cl-defgeneric seq-find (pred sequence &optional default) |
| 276 | "Return the first element for which (PRED element) is non-nil in SEQ. | 281 | "Return the first element for which (PRED element) is non-nil in SEQUENCE. |
| 277 | If no element is found, return DEFAULT. | 282 | If no element is found, return DEFAULT. |
| 278 | 283 | ||
| 279 | Note that `seq-find' has an ambiguity if the found element is | 284 | Note that `seq-find' has an ambiguity if the found element is |
| 280 | identical to DEFAULT, as it cannot be known if an element was | 285 | identical to DEFAULT, as it cannot be known if an element was |
| 281 | found or not." | 286 | found or not." |
| 282 | (catch 'seq--break | 287 | (catch 'seq--break |
| 283 | (seq-doseq (elt seq) | 288 | (seq-doseq (elt sequence) |
| 284 | (when (funcall pred elt) | 289 | (when (funcall pred elt) |
| 285 | (throw 'seq--break elt))) | 290 | (throw 'seq--break elt))) |
| 286 | default)) | 291 | default)) |
| 287 | 292 | ||
| 288 | (cl-defgeneric seq-count (pred seq) | 293 | (cl-defgeneric seq-count (pred sequence) |
| 289 | "Return the number of elements for which (PRED element) is non-nil in SEQ." | 294 | "Return the number of elements for which (PRED element) is non-nil in SEQUENCE." |
| 290 | (let ((count 0)) | 295 | (let ((count 0)) |
| 291 | (seq-doseq (elt seq) | 296 | (seq-doseq (elt sequence) |
| 292 | (when (funcall pred elt) | 297 | (when (funcall pred elt) |
| 293 | (setq count (+ 1 count)))) | 298 | (setq count (+ 1 count)))) |
| 294 | count)) | 299 | count)) |
| 295 | 300 | ||
| 296 | (cl-defgeneric seq-contains (seq elt &optional testfn) | 301 | (cl-defgeneric seq-contains (sequence elt &optional testfn) |
| 297 | "Return the first element in SEQ that is equal to ELT. | 302 | "Return the first element in SEQUENCE that is equal to ELT. |
| 298 | Equality is defined by TESTFN if non-nil or by `equal' if nil." | 303 | Equality is defined by TESTFN if non-nil or by `equal' if nil." |
| 299 | (seq-some (lambda (e) | 304 | (seq-some (lambda (e) |
| 300 | (funcall (or testfn #'equal) elt e)) | 305 | (funcall (or testfn #'equal) elt e)) |
| 301 | seq)) | 306 | sequence)) |
| 302 | 307 | ||
| 303 | (cl-defgeneric seq-position (seq elt &optional testfn) | 308 | (cl-defgeneric seq-position (sequence elt &optional testfn) |
| 304 | "Return the index of the first element in SEQ that is equal to ELT. | 309 | "Return the index of the first element in SEQUENCE that is equal to ELT. |
| 305 | Equality is defined by TESTFN if non-nil or by `equal' if nil." | 310 | Equality is defined by TESTFN if non-nil or by `equal' if nil." |
| 306 | (let ((index 0)) | 311 | (let ((index 0)) |
| 307 | (catch 'seq--break | 312 | (catch 'seq--break |
| 308 | (seq-doseq (e seq) | 313 | (seq-doseq (e sequence) |
| 309 | (when (funcall (or testfn #'equal) e elt) | 314 | (when (funcall (or testfn #'equal) e elt) |
| 310 | (throw 'seq--break index)) | 315 | (throw 'seq--break index)) |
| 311 | (setq index (1+ index))) | 316 | (setq index (1+ index))) |
| 312 | nil))) | 317 | nil))) |
| 313 | 318 | ||
| 314 | (cl-defgeneric seq-uniq (seq &optional testfn) | 319 | (cl-defgeneric seq-uniq (sequence &optional testfn) |
| 315 | "Return a list of the elements of SEQ with duplicates removed. | 320 | "Return a list of the elements of SEQUENCE with duplicates removed. |
| 316 | TESTFN is used to compare elements, or `equal' if TESTFN is nil." | 321 | TESTFN is used to compare elements, or `equal' if TESTFN is nil." |
| 317 | (let ((result '())) | 322 | (let ((result '())) |
| 318 | (seq-doseq (elt seq) | 323 | (seq-doseq (elt sequence) |
| 319 | (unless (seq-contains result elt testfn) | 324 | (unless (seq-contains result elt testfn) |
| 320 | (setq result (cons elt result)))) | 325 | (setq result (cons elt result)))) |
| 321 | (nreverse result))) | 326 | (nreverse result))) |
| 322 | 327 | ||
| 323 | (cl-defgeneric seq-mapcat (function seq &optional type) | 328 | (cl-defgeneric seq-mapcat (function sequence &optional type) |
| 324 | "Concatenate the result of applying FUNCTION to each element of SEQ. | 329 | "Concatenate the result of applying FUNCTION to each element of SEQUENCE. |
| 325 | The result is a sequence of type TYPE, or a list if TYPE is nil." | 330 | The result is a sequence of type TYPE, or a list if TYPE is nil." |
| 326 | (apply #'seq-concatenate (or type 'list) | 331 | (apply #'seq-concatenate (or type 'list) |
| 327 | (seq-map function seq))) | 332 | (seq-map function sequence))) |
| 328 | 333 | ||
| 329 | (cl-defgeneric seq-partition (seq n) | 334 | (cl-defgeneric seq-partition (sequence n) |
| 330 | "Return a list of the elements of SEQ grouped into sub-sequences of length N. | 335 | "Return a list of the elements of SEQUENCE grouped into sub-sequences of length N. |
| 331 | The last sequence may contain less than N elements. If N is a | 336 | The last sequence may contain less than N elements. If N is a |
| 332 | negative integer or 0, nil is returned." | 337 | negative integer or 0, nil is returned." |
| 333 | (unless (< n 1) | 338 | (unless (< n 1) |
| 334 | (let ((result '())) | 339 | (let ((result '())) |
| 335 | (while (not (seq-empty-p seq)) | 340 | (while (not (seq-empty-p sequence)) |
| 336 | (push (seq-take seq n) result) | 341 | (push (seq-take sequence n) result) |
| 337 | (setq seq (seq-drop seq n))) | 342 | (setq sequence (seq-drop sequence n))) |
| 338 | (nreverse result)))) | 343 | (nreverse result)))) |
| 339 | 344 | ||
| 340 | (cl-defgeneric seq-intersection (seq1 seq2 &optional testfn) | 345 | (cl-defgeneric seq-intersection (sequence1 sequence2 &optional testfn) |
| 341 | "Return a list of the elements that appear in both SEQ1 and SEQ2. | 346 | "Return a list of the elements that appear in both SEQUENCE1 and SEQUENCE2. |
| 342 | Equality is defined by TESTFN if non-nil or by `equal' if nil." | 347 | Equality is defined by TESTFN if non-nil or by `equal' if nil." |
| 343 | (seq-reduce (lambda (acc elt) | 348 | (seq-reduce (lambda (acc elt) |
| 344 | (if (seq-contains seq2 elt testfn) | 349 | (if (seq-contains sequence2 elt testfn) |
| 345 | (cons elt acc) | 350 | (cons elt acc) |
| 346 | acc)) | 351 | acc)) |
| 347 | (seq-reverse seq1) | 352 | (seq-reverse sequence1) |
| 348 | '())) | 353 | '())) |
| 349 | 354 | ||
| 350 | (cl-defgeneric seq-difference (seq1 seq2 &optional testfn) | 355 | (cl-defgeneric seq-difference (sequence1 sequence2 &optional testfn) |
| 351 | "Return a list of the elements that appear in SEQ1 but not in SEQ2. | 356 | "Return a list of the elements that appear in SEQUENCE1 but not in SEQUENCE2. |
| 352 | Equality is defined by TESTFN if non-nil or by `equal' if nil." | 357 | Equality is defined by TESTFN if non-nil or by `equal' if nil." |
| 353 | (seq-reduce (lambda (acc elt) | 358 | (seq-reduce (lambda (acc elt) |
| 354 | (if (not (seq-contains seq2 elt testfn)) | 359 | (if (not (seq-contains sequence2 elt testfn)) |
| 355 | (cons elt acc) | 360 | (cons elt acc) |
| 356 | acc)) | 361 | acc)) |
| 357 | (seq-reverse seq1) | 362 | (seq-reverse sequence1) |
| 358 | '())) | 363 | '())) |
| 359 | 364 | ||
| 360 | (cl-defgeneric seq-group-by (function seq) | 365 | (cl-defgeneric seq-group-by (function sequence) |
| 361 | "Apply FUNCTION to each element of SEQ. | 366 | "Apply FUNCTION to each element of SEQUENCE. |
| 362 | Separate the elements of SEQ into an alist using the results as | 367 | Separate the elements of SEQUENCE into an alist using the results as |
| 363 | keys. Keys are compared using `equal'." | 368 | keys. Keys are compared using `equal'." |
| 364 | (seq-reduce | 369 | (seq-reduce |
| 365 | (lambda (acc elt) | 370 | (lambda (acc elt) |
| @@ -369,25 +374,25 @@ keys. Keys are compared using `equal'." | |||
| 369 | (setcdr cell (push elt (cdr cell))) | 374 | (setcdr cell (push elt (cdr cell))) |
| 370 | (push (list key elt) acc)) | 375 | (push (list key elt) acc)) |
| 371 | acc)) | 376 | acc)) |
| 372 | (seq-reverse seq) | 377 | (seq-reverse sequence) |
| 373 | nil)) | 378 | nil)) |
| 374 | 379 | ||
| 375 | (cl-defgeneric seq-min (seq) | 380 | (cl-defgeneric seq-min (sequence) |
| 376 | "Return the smallest element of SEQ. | 381 | "Return the smallest element of SEQUENCE. |
| 377 | SEQ must be a sequence of numbers or markers." | 382 | SEQUENCE must be a sequence of numbers or markers." |
| 378 | (apply #'min (seq-into seq 'list))) | 383 | (apply #'min (seq-into sequence 'list))) |
| 379 | 384 | ||
| 380 | (cl-defgeneric seq-max (seq) | 385 | (cl-defgeneric seq-max (sequence) |
| 381 | "Return the largest element of SEQ. | 386 | "Return the largest element of SEQUENCE. |
| 382 | SEQ must be a sequence of numbers or markers." | 387 | SEQUENCE must be a sequence of numbers or markers." |
| 383 | (apply #'max (seq-into seq 'list))) | 388 | (apply #'max (seq-into sequence 'list))) |
| 384 | 389 | ||
| 385 | (defun seq--count-successive (pred seq) | 390 | (defun seq--count-successive (pred sequence) |
| 386 | "Return the number of successive elements for which (PRED element) is non-nil in SEQ." | 391 | "Return the number of successive elements for which (PRED element) is non-nil in SEQUENCE." |
| 387 | (let ((n 0) | 392 | (let ((n 0) |
| 388 | (len (seq-length seq))) | 393 | (len (seq-length sequence))) |
| 389 | (while (and (< n len) | 394 | (while (and (< n len) |
| 390 | (funcall pred (seq-elt seq n))) | 395 | (funcall pred (seq-elt sequence n))) |
| 391 | (setq n (+ 1 n))) | 396 | (setq n (+ 1 n))) |
| 392 | n)) | 397 | n)) |
| 393 | 398 | ||
| @@ -419,10 +424,10 @@ SEQ must be a sequence of numbers or markers." | |||
| 419 | args))) | 424 | args))) |
| 420 | 425 | ||
| 421 | ;; TODO: make public? | 426 | ;; TODO: make public? |
| 422 | (defun seq--elt-safe (seq n) | 427 | (defun seq--elt-safe (sequence n) |
| 423 | "Return element of SEQ at the index N. | 428 | "Return element of SEQUENCE at the index N. |
| 424 | If no element is found, return nil." | 429 | If no element is found, return nil." |
| 425 | (ignore-errors (seq-elt seq n))) | 430 | (ignore-errors (seq-elt sequence n))) |
| 426 | 431 | ||
| 427 | 432 | ||
| 428 | ;;; Optimized implementations for lists | 433 | ;;; Optimized implementations for lists |
diff --git a/lisp/emacs-lisp/thunk.el b/lisp/emacs-lisp/thunk.el index d07b25736aa..0c5816a616d 100644 --- a/lisp/emacs-lisp/thunk.el +++ b/lisp/emacs-lisp/thunk.el | |||
| @@ -57,8 +57,8 @@ | |||
| 57 | ,forced | 57 | ,forced |
| 58 | (unless ,forced | 58 | (unless ,forced |
| 59 | (setf ,val (progn ,@body)) | 59 | (setf ,val (progn ,@body)) |
| 60 | (setf ,forced t))) | 60 | (setf ,forced t)) |
| 61 | ,val)))) | 61 | ,val))))) |
| 62 | 62 | ||
| 63 | (defun thunk-force (delayed) | 63 | (defun thunk-force (delayed) |
| 64 | "Force the evaluation of DELAYED. | 64 | "Force the evaluation of DELAYED. |
diff --git a/lisp/filenotify.el b/lisp/filenotify.el index 55d9028f252..6a180a86570 100644 --- a/lisp/filenotify.el +++ b/lisp/filenotify.el | |||
| @@ -48,32 +48,33 @@ The value in the hash table is a list | |||
| 48 | Several values for a given DIR happen only for `inotify', when | 48 | Several values for a given DIR happen only for `inotify', when |
| 49 | different files from the same directory are watched.") | 49 | different files from the same directory are watched.") |
| 50 | 50 | ||
| 51 | (defun file-notify--rm-descriptor (descriptor) | 51 | (defun file-notify--rm-descriptor (descriptor &optional what) |
| 52 | "Remove DESCRIPTOR from `file-notify-descriptors'. | 52 | "Remove DESCRIPTOR from `file-notify-descriptors'. |
| 53 | DESCRIPTOR should be an object returned by `file-notify-add-watch'. | 53 | DESCRIPTOR should be an object returned by `file-notify-add-watch'. |
| 54 | If it is registered in `file-notify-descriptors', a stopped event is sent." | 54 | If it is registered in `file-notify-descriptors', a stopped event is sent. |
| 55 | WHAT is a file or directory name to be removed, needed just for `inotify'." | ||
| 55 | (let* ((desc (if (consp descriptor) (car descriptor) descriptor)) | 56 | (let* ((desc (if (consp descriptor) (car descriptor) descriptor)) |
| 56 | (file (if (consp descriptor) (cdr descriptor))) | 57 | (file (if (consp descriptor) (cdr descriptor))) |
| 57 | (registered (gethash desc file-notify-descriptors)) | 58 | (registered (gethash desc file-notify-descriptors)) |
| 58 | (dir (car registered))) | 59 | (dir (car registered))) |
| 59 | 60 | ||
| 60 | (when (consp registered) | 61 | (when (and (consp registered) (or (null what) (string-equal dir what))) |
| 61 | ;; Send `stopped' event. | 62 | ;; Send `stopped' event. |
| 62 | (dolist (entry (cdr registered)) | 63 | (dolist (entry (cdr registered)) |
| 63 | (funcall (cdr entry) | 64 | (funcall (cdr entry) |
| 64 | `(,(file-notify--descriptor desc) stopped | 65 | `(,(file-notify--descriptor desc) stopped |
| 65 | ,(or (and (stringp (car entry)) | 66 | ,(or (and (stringp (car entry)) |
| 66 | (expand-file-name (car entry) dir)) | 67 | (expand-file-name (car entry) dir)) |
| 67 | dir)))) | 68 | dir)))) |
| 68 | 69 | ||
| 69 | ;; Modify `file-notify-descriptors'. | 70 | ;; Modify `file-notify-descriptors'. |
| 70 | (if (not file) | 71 | (if (not file) |
| 71 | (remhash desc file-notify-descriptors) | 72 | (remhash desc file-notify-descriptors) |
| 72 | (setcdr registered | 73 | (setcdr registered |
| 73 | (delete (assoc file (cdr registered)) (cdr registered))) | 74 | (delete (assoc file (cdr registered)) (cdr registered))) |
| 74 | (if (null (cdr registered)) | 75 | (if (null (cdr registered)) |
| 75 | (remhash desc file-notify-descriptors) | 76 | (remhash desc file-notify-descriptors) |
| 76 | (puthash desc registered file-notify-descriptors)))))) | 77 | (puthash desc registered file-notify-descriptors)))))) |
| 77 | 78 | ||
| 78 | ;; This function is used by `gfilenotify', `inotify' and `w32notify' events. | 79 | ;; This function is used by `gfilenotify', `inotify' and `w32notify' events. |
| 79 | ;;;###autoload | 80 | ;;;###autoload |
| @@ -85,6 +86,7 @@ If EVENT is a filewatch event, call its callback. It has the format | |||
| 85 | 86 | ||
| 86 | Otherwise, signal a `file-notify-error'." | 87 | Otherwise, signal a `file-notify-error'." |
| 87 | (interactive "e") | 88 | (interactive "e") |
| 89 | ;;(message "file-notify-handle-event %S" event) | ||
| 88 | (if (and (eq (car event) 'file-notify) | 90 | (if (and (eq (car event) 'file-notify) |
| 89 | (>= (length event) 3)) | 91 | (>= (length event) 3)) |
| 90 | (funcall (nth 2 event) (nth 1 event)) | 92 | (funcall (nth 2 event) (nth 1 event)) |
| @@ -224,6 +226,7 @@ EVENT is the cadr of the event in `file-notify-handle-event' | |||
| 224 | (setq pending-event nil)) | 226 | (setq pending-event nil)) |
| 225 | 227 | ||
| 226 | ;; Check for stopped. | 228 | ;; Check for stopped. |
| 229 | ;;(message "file-notify-callback %S %S" file registered) | ||
| 227 | (setq | 230 | (setq |
| 228 | stopped | 231 | stopped |
| 229 | (or | 232 | (or |
| @@ -232,7 +235,9 @@ EVENT is the cadr of the event in `file-notify-handle-event' | |||
| 232 | (memq action '(deleted renamed)) | 235 | (memq action '(deleted renamed)) |
| 233 | (= (length (cdr registered)) 1) | 236 | (= (length (cdr registered)) 1) |
| 234 | (string-equal | 237 | (string-equal |
| 235 | (or (file-name-nondirectory file) "") (car (cadr registered)))))) | 238 | (file-name-nondirectory file) |
| 239 | (or (file-name-nondirectory (car registered)) | ||
| 240 | (car (cadr registered))))))) | ||
| 236 | 241 | ||
| 237 | ;; Apply callback. | 242 | ;; Apply callback. |
| 238 | (when (and action | 243 | (when (and action |
| @@ -257,7 +262,7 @@ EVENT is the cadr of the event in `file-notify-handle-event' | |||
| 257 | 262 | ||
| 258 | ;; Modify `file-notify-descriptors'. | 263 | ;; Modify `file-notify-descriptors'. |
| 259 | (when stopped | 264 | (when stopped |
| 260 | (file-notify--rm-descriptor (file-notify--descriptor desc)))))) | 265 | (file-notify--rm-descriptor (file-notify--descriptor desc) file))))) |
| 261 | 266 | ||
| 262 | ;; `gfilenotify' and `w32notify' return a unique descriptor for every | 267 | ;; `gfilenotify' and `w32notify' return a unique descriptor for every |
| 263 | ;; `file-notify-add-watch', while `inotify' returns a unique | 268 | ;; `file-notify-add-watch', while `inotify' returns a unique |
| @@ -324,8 +329,8 @@ FILE is the name of the file whose event is being reported." | |||
| 324 | (setq desc (funcall | 329 | (setq desc (funcall |
| 325 | handler 'file-notify-add-watch dir flags callback)) | 330 | handler 'file-notify-add-watch dir flags callback)) |
| 326 | 331 | ||
| 327 | ;; Check, whether Emacs has been compiled with file | 332 | ;; Check, whether Emacs has been compiled with file notification |
| 328 | ;; notification support. | 333 | ;; support. |
| 329 | (unless file-notify--library | 334 | (unless file-notify--library |
| 330 | (signal 'file-notify-error | 335 | (signal 'file-notify-error |
| 331 | '("No file notification package available"))) | 336 | '("No file notification package available"))) |
| @@ -344,7 +349,8 @@ FILE is the name of the file whose event is being reported." | |||
| 344 | (setq | 349 | (setq |
| 345 | l-flags | 350 | l-flags |
| 346 | (cond | 351 | (cond |
| 347 | ((eq file-notify--library 'inotify) '(create modify move delete)) | 352 | ((eq file-notify--library 'inotify) |
| 353 | '(create delete delete-self modify move-self move)) | ||
| 348 | ((eq file-notify--library 'w32notify) | 354 | ((eq file-notify--library 'w32notify) |
| 349 | '(file-name directory-name size last-write-time))))) | 355 | '(file-name directory-name size last-write-time))))) |
| 350 | (when (memq 'attribute-change flags) | 356 | (when (memq 'attribute-change flags) |
diff --git a/lisp/gnus/gnus-topic.el b/lisp/gnus/gnus-topic.el index 7c6e1098100..b9897832517 100644 --- a/lisp/gnus/gnus-topic.el +++ b/lisp/gnus/gnus-topic.el | |||
| @@ -508,7 +508,6 @@ articles in the topic and its subtopics." | |||
| 508 | (all-entries entries) | 508 | (all-entries entries) |
| 509 | (point-max (point-max)) | 509 | (point-max (point-max)) |
| 510 | (unread 0) | 510 | (unread 0) |
| 511 | (topic (car type)) | ||
| 512 | info entry end active tick) | 511 | info entry end active tick) |
| 513 | ;; Insert any sub-topics. | 512 | ;; Insert any sub-topics. |
| 514 | (while topicl | 513 | (while topicl |
| @@ -586,7 +585,7 @@ articles in the topic and its subtopics." | |||
| 586 | (goto-char end) | 585 | (goto-char end) |
| 587 | unread)) | 586 | unread)) |
| 588 | 587 | ||
| 589 | (defun gnus-topic-remove-topic (&optional insert total-remove hide in-level) | 588 | (defun gnus-topic-remove-topic (&optional insert total-remove _hide in-level) |
| 590 | "Remove the current topic." | 589 | "Remove the current topic." |
| 591 | (let ((topic (gnus-group-topic-name)) | 590 | (let ((topic (gnus-group-topic-name)) |
| 592 | (level (gnus-group-topic-level)) | 591 | (level (gnus-group-topic-level)) |
| @@ -631,6 +630,8 @@ articles in the topic and its subtopics." | |||
| 631 | (or insert (not (gnus-topic-visible-p))) nil nil 9) | 630 | (or insert (not (gnus-topic-visible-p))) nil nil 9) |
| 632 | (gnus-topic-enter-dribble))))))) | 631 | (gnus-topic-enter-dribble))))))) |
| 633 | 632 | ||
| 633 | (defvar gnus-tmp-header) | ||
| 634 | |||
| 634 | (defun gnus-topic-insert-topic-line (name visiblep shownp level entries | 635 | (defun gnus-topic-insert-topic-line (name visiblep shownp level entries |
| 635 | &optional unread) | 636 | &optional unread) |
| 636 | (let* ((visible (if visiblep "" "...")) | 637 | (let* ((visible (if visiblep "" "...")) |
| @@ -694,8 +695,7 @@ articles in the topic and its subtopics." | |||
| 694 | (let* ((topic (gnus-group-topic group)) | 695 | (let* ((topic (gnus-group-topic group)) |
| 695 | (groups (cdr (assoc topic gnus-topic-alist))) | 696 | (groups (cdr (assoc topic gnus-topic-alist))) |
| 696 | (g (cdr (member group groups))) | 697 | (g (cdr (member group groups))) |
| 697 | (unfound t) | 698 | (unfound t)) |
| 698 | entry) | ||
| 699 | ;; Try to jump to a visible group. | 699 | ;; Try to jump to a visible group. |
| 700 | (while (and g | 700 | (while (and g |
| 701 | (not (gnus-group-goto-group (car g) t))) | 701 | (not (gnus-group-goto-group (car g) t))) |
| @@ -1454,7 +1454,7 @@ If NON-RECURSIVE (which is the prefix) is t, don't mark its subtopics." | |||
| 1454 | (funcall (if unmark 'gnus-group-remove-mark 'gnus-group-set-mark) | 1454 | (funcall (if unmark 'gnus-group-remove-mark 'gnus-group-set-mark) |
| 1455 | (gnus-info-group (nth 2 (pop groups))))))))) | 1455 | (gnus-info-group (nth 2 (pop groups))))))))) |
| 1456 | 1456 | ||
| 1457 | (defun gnus-topic-unmark-topic (topic &optional dummy non-recursive) | 1457 | (defun gnus-topic-unmark-topic (topic &optional _dummy non-recursive) |
| 1458 | "Remove the process mark from all groups in the TOPIC. | 1458 | "Remove the process mark from all groups in the TOPIC. |
| 1459 | If NON-RECURSIVE (which is the prefix) is t, don't unmark its subtopics." | 1459 | If NON-RECURSIVE (which is the prefix) is t, don't unmark its subtopics." |
| 1460 | (interactive (list (gnus-group-topic-name) | 1460 | (interactive (list (gnus-group-topic-name) |
| @@ -1488,15 +1488,14 @@ If NON-RECURSIVE (which is the prefix) is t, don't unmark its subtopics." | |||
| 1488 | (gnus-group-mark-regexp regexp) | 1488 | (gnus-group-mark-regexp regexp) |
| 1489 | (gnus-topic-move-group nil topic copyp)) | 1489 | (gnus-topic-move-group nil topic copyp)) |
| 1490 | 1490 | ||
| 1491 | (defun gnus-topic-copy-matching (regexp topic &optional copyp) | 1491 | (defun gnus-topic-copy-matching (regexp topic &optional _copyp) |
| 1492 | "Copy all groups that match REGEXP to some topic." | 1492 | "Copy all groups that match REGEXP to some topic." |
| 1493 | (interactive | 1493 | (interactive |
| 1494 | (let (topic) | 1494 | (let ((topic (gnus-completing-read "Copy to topic" |
| 1495 | (mapcar #'car gnus-topic-alist) t))) | ||
| 1495 | (nreverse | 1496 | (nreverse |
| 1496 | (list | 1497 | (list topic |
| 1497 | (setq topic (gnus-completing-read "Copy to topic" | 1498 | (read-string (format "Copy to %s (regexp): " topic)))))) |
| 1498 | (mapcar 'car gnus-topic-alist) t)) | ||
| 1499 | (read-string (format "Copy to %s (regexp): " topic)))))) | ||
| 1500 | (gnus-topic-move-matching regexp topic t)) | 1499 | (gnus-topic-move-matching regexp topic t)) |
| 1501 | 1500 | ||
| 1502 | (defun gnus-topic-delete (topic) | 1501 | (defun gnus-topic-delete (topic) |
diff --git a/lisp/help.el b/lisp/help.el index 3387628fb8a..c558b652b7e 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -1394,9 +1394,10 @@ ARGLIST can also be t or a string of the form \"(FUN ARG1 ARG2 ...)\"." | |||
| 1394 | (if (string-match "\n?\n\\'" docstring) | 1394 | (if (string-match "\n?\n\\'" docstring) |
| 1395 | (if (< (- (match-end 0) (match-beginning 0)) 2) "\n" "") | 1395 | (if (< (- (match-end 0) (match-beginning 0)) 2) "\n" "") |
| 1396 | "\n\n") | 1396 | "\n\n") |
| 1397 | (if (and (stringp arglist) | 1397 | (if (stringp arglist) |
| 1398 | (string-match "\\`([^ ]+\\(.*\\))\\'" arglist)) | 1398 | (if (string-match "\\`[^ ]+\\(.*\\))\\'" arglist) |
| 1399 | (concat "(fn" (match-string 1 arglist) ")") | 1399 | (concat "(fn" (match-string 1 arglist) ")") |
| 1400 | (error "Unrecognized usage format")) | ||
| 1400 | (help--make-usage-docstring 'fn arglist))))) | 1401 | (help--make-usage-docstring 'fn arglist))))) |
| 1401 | 1402 | ||
| 1402 | (defun help-function-arglist (def &optional preserve-names) | 1403 | (defun help-function-arglist (def &optional preserve-names) |
diff --git a/lisp/international/ccl.el b/lisp/international/ccl.el index daba2b6ed09..2fcbc884b35 100644 --- a/lisp/international/ccl.el +++ b/lisp/international/ccl.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; ccl.el --- CCL (Code Conversion Language) compiler | 1 | ;;; ccl.el --- CCL (Code Conversion Language) compiler -*- lexical-binding:t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1997-1998, 2001-2015 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1997-1998, 2001-2015 Free Software Foundation, Inc. |
| 4 | ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, | 4 | ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, |
| @@ -479,8 +479,7 @@ If READ-FLAG is non-nil, this statement has the form | |||
| 479 | (let ((condition (nth 1 cmd)) | 479 | (let ((condition (nth 1 cmd)) |
| 480 | (true-cmds (nth 2 cmd)) | 480 | (true-cmds (nth 2 cmd)) |
| 481 | (false-cmds (nth 3 cmd)) | 481 | (false-cmds (nth 3 cmd)) |
| 482 | jump-cond-address | 482 | jump-cond-address) |
| 483 | false-ic) | ||
| 484 | (if (and (listp condition) | 483 | (if (and (listp condition) |
| 485 | (listp (car condition))) | 484 | (listp (car condition))) |
| 486 | ;; If CONDITION is a nested expression, the inner expression | 485 | ;; If CONDITION is a nested expression, the inner expression |
| @@ -678,8 +677,7 @@ is a list of CCL-BLOCKs." | |||
| 678 | (ccl-embed-code 'write-const-jump 0 ccl-loop-head) | 677 | (ccl-embed-code 'write-const-jump 0 ccl-loop-head) |
| 679 | (ccl-embed-data arg)) | 678 | (ccl-embed-data arg)) |
| 680 | ((stringp arg) | 679 | ((stringp arg) |
| 681 | (let ((len (length arg)) | 680 | (let ((len (length arg))) |
| 682 | (i 0)) | ||
| 683 | (ccl-embed-code 'write-string-jump 0 ccl-loop-head) | 681 | (ccl-embed-code 'write-string-jump 0 ccl-loop-head) |
| 684 | (ccl-embed-data len) | 682 | (ccl-embed-data len) |
| 685 | (ccl-embed-string len arg))) | 683 | (ccl-embed-string len arg))) |
| @@ -920,8 +918,7 @@ is a list of CCL-BLOCKs." | |||
| 920 | (error "CCL: Invalid number of arguments: %s" cmd)) | 918 | (error "CCL: Invalid number of arguments: %s" cmd)) |
| 921 | (let ((RRR (nth 1 cmd)) | 919 | (let ((RRR (nth 1 cmd)) |
| 922 | (rrr (nth 2 cmd)) | 920 | (rrr (nth 2 cmd)) |
| 923 | (map (nth 3 cmd)) | 921 | (map (nth 3 cmd))) |
| 924 | id) | ||
| 925 | (ccl-check-register rrr cmd) | 922 | (ccl-check-register rrr cmd) |
| 926 | (ccl-check-register RRR cmd) | 923 | (ccl-check-register RRR cmd) |
| 927 | (ccl-embed-extended-command 'map-single rrr RRR 0) | 924 | (ccl-embed-extended-command 'map-single rrr RRR 0) |
| @@ -962,10 +959,11 @@ is a list of CCL-BLOCKs." | |||
| 962 | (defvar ccl-code) | 959 | (defvar ccl-code) |
| 963 | 960 | ||
| 964 | ;;;###autoload | 961 | ;;;###autoload |
| 965 | (defun ccl-dump (ccl-code) | 962 | (defun ccl-dump (code) |
| 966 | "Disassemble compiled CCL-CODE." | 963 | "Disassemble compiled CCL-code CODE." |
| 967 | (let ((len (length ccl-code)) | 964 | (let* ((ccl-code code) |
| 968 | (buffer-mag (aref ccl-code 0))) | 965 | (len (length ccl-code)) |
| 966 | (buffer-mag (aref ccl-code 0))) | ||
| 969 | (cond ((= buffer-mag 0) | 967 | (cond ((= buffer-mag 0) |
| 970 | (insert (substitute-command-keys "Don't output anything.\n"))) | 968 | (insert (substitute-command-keys "Don't output anything.\n"))) |
| 971 | ((= buffer-mag 1) | 969 | ((= buffer-mag 1) |
| @@ -1005,7 +1003,7 @@ is a list of CCL-BLOCKs." | |||
| 1005 | (defun ccl-dump-set-short-const (rrr cc) | 1003 | (defun ccl-dump-set-short-const (rrr cc) |
| 1006 | (insert (format "r%d = %d\n" rrr cc))) | 1004 | (insert (format "r%d = %d\n" rrr cc))) |
| 1007 | 1005 | ||
| 1008 | (defun ccl-dump-set-const (rrr ignore) | 1006 | (defun ccl-dump-set-const (rrr _ignore) |
| 1009 | (insert (format "r%d = %d\n" rrr (ccl-get-next-code)))) | 1007 | (insert (format "r%d = %d\n" rrr (ccl-get-next-code)))) |
| 1010 | 1008 | ||
| 1011 | (defun ccl-dump-set-array (rrr cc) | 1009 | (defun ccl-dump-set-array (rrr cc) |
| @@ -1019,7 +1017,7 @@ is a list of CCL-BLOCKs." | |||
| 1019 | (setq i (1+ i))) | 1017 | (setq i (1+ i))) |
| 1020 | (insert "\n"))) | 1018 | (insert "\n"))) |
| 1021 | 1019 | ||
| 1022 | (defun ccl-dump-jump (ignore cc &optional address) | 1020 | (defun ccl-dump-jump (_ignore cc &optional address) |
| 1023 | (insert (format "jump to %d(" (+ (or address ccl-current-ic) cc))) | 1021 | (insert (format "jump to %d(" (+ (or address ccl-current-ic) cc))) |
| 1024 | (if (>= cc 0) | 1022 | (if (>= cc 0) |
| 1025 | (insert "+")) | 1023 | (insert "+")) |
| @@ -1042,13 +1040,13 @@ is a list of CCL-BLOCKs." | |||
| 1042 | (defun ccl-extract-arith-op (cc) | 1040 | (defun ccl-extract-arith-op (cc) |
| 1043 | (aref ccl-arith-table (ash cc -6))) | 1041 | (aref ccl-arith-table (ash cc -6))) |
| 1044 | 1042 | ||
| 1045 | (defun ccl-dump-write-expr-const (ignore cc) | 1043 | (defun ccl-dump-write-expr-const (_ignore cc) |
| 1046 | (insert (format "write (r%d %s %d)\n" | 1044 | (insert (format "write (r%d %s %d)\n" |
| 1047 | (logand cc 7) | 1045 | (logand cc 7) |
| 1048 | (ccl-extract-arith-op cc) | 1046 | (ccl-extract-arith-op cc) |
| 1049 | (ccl-get-next-code)))) | 1047 | (ccl-get-next-code)))) |
| 1050 | 1048 | ||
| 1051 | (defun ccl-dump-write-expr-register (ignore cc) | 1049 | (defun ccl-dump-write-expr-register (_ignore cc) |
| 1052 | (insert (format "write (r%d %s r%d)\n" | 1050 | (insert (format "write (r%d %s r%d)\n" |
| 1053 | (logand cc 7) | 1051 | (logand cc 7) |
| 1054 | (ccl-extract-arith-op cc) | 1052 | (ccl-extract-arith-op cc) |
| @@ -1059,7 +1057,7 @@ is a list of CCL-BLOCKs." | |||
| 1059 | ((= cc ?\n) (insert " \"^J\"")) | 1057 | ((= cc ?\n) (insert " \"^J\"")) |
| 1060 | (t (insert (format " \"%c\"" cc))))) | 1058 | (t (insert (format " \"%c\"" cc))))) |
| 1061 | 1059 | ||
| 1062 | (defun ccl-dump-write-const-jump (ignore cc) | 1060 | (defun ccl-dump-write-const-jump (_ignore cc) |
| 1063 | (let ((address ccl-current-ic)) | 1061 | (let ((address ccl-current-ic)) |
| 1064 | (insert "write char") | 1062 | (insert "write char") |
| 1065 | (ccl-dump-insert-char (ccl-get-next-code)) | 1063 | (ccl-dump-insert-char (ccl-get-next-code)) |
| @@ -1075,7 +1073,7 @@ is a list of CCL-BLOCKs." | |||
| 1075 | (ccl-get-next-code) ; Skip dummy READ-JUMP | 1073 | (ccl-get-next-code) ; Skip dummy READ-JUMP |
| 1076 | )) | 1074 | )) |
| 1077 | 1075 | ||
| 1078 | (defun ccl-dump-write-string-jump (ignore cc) | 1076 | (defun ccl-dump-write-string-jump (_ignore cc) |
| 1079 | (let ((address ccl-current-ic) | 1077 | (let ((address ccl-current-ic) |
| 1080 | (len (ccl-get-next-code)) | 1078 | (len (ccl-get-next-code)) |
| 1081 | (i 0)) | 1079 | (i 0)) |
| @@ -1125,7 +1123,7 @@ is a list of CCL-BLOCKs." | |||
| 1125 | (defun ccl-dump-write-register (rrr cc) | 1123 | (defun ccl-dump-write-register (rrr cc) |
| 1126 | (insert (format "write r%d (%d remaining)\n" rrr cc))) | 1124 | (insert (format "write r%d (%d remaining)\n" rrr cc))) |
| 1127 | 1125 | ||
| 1128 | (defun ccl-dump-call (ignore cc) | 1126 | (defun ccl-dump-call (_ignore _cc) |
| 1129 | (let ((subroutine (car (ccl-get-next-code)))) | 1127 | (let ((subroutine (car (ccl-get-next-code)))) |
| 1130 | (insert (format-message "call subroutine `%s'\n" subroutine)))) | 1128 | (insert (format-message "call subroutine `%s'\n" subroutine)))) |
| 1131 | 1129 | ||
| @@ -1160,7 +1158,7 @@ is a list of CCL-BLOCKs." | |||
| 1160 | (setq i (1+ i))) | 1158 | (setq i (1+ i))) |
| 1161 | (insert "\n"))) | 1159 | (insert "\n"))) |
| 1162 | 1160 | ||
| 1163 | (defun ccl-dump-end (&rest ignore) | 1161 | (defun ccl-dump-end (&rest _ignore) |
| 1164 | (insert "end\n")) | 1162 | (insert "end\n")) |
| 1165 | 1163 | ||
| 1166 | (defun ccl-dump-set-assign-expr-const (rrr cc) | 1164 | (defun ccl-dump-set-assign-expr-const (rrr cc) |
| @@ -1213,9 +1211,10 @@ is a list of CCL-BLOCKs." | |||
| 1213 | (insert (format "read r%d, " rrr)) | 1211 | (insert (format "read r%d, " rrr)) |
| 1214 | (ccl-dump-jump-cond-expr-register rrr cc)) | 1212 | (ccl-dump-jump-cond-expr-register rrr cc)) |
| 1215 | 1213 | ||
| 1216 | (defun ccl-dump-binary (ccl-code) | 1214 | (defun ccl-dump-binary (code) |
| 1217 | (let ((len (length ccl-code)) | 1215 | (let* ((ccl-code code) |
| 1218 | (i 2)) | 1216 | (len (length ccl-code)) |
| 1217 | (i 2)) | ||
| 1219 | (while (< i len) | 1218 | (while (< i len) |
| 1220 | (let ((code (aref ccl-code i)) | 1219 | (let ((code (aref ccl-code i)) |
| 1221 | (j 27)) | 1220 | (j 27)) |
| @@ -1235,28 +1234,28 @@ is a list of CCL-BLOCKs." | |||
| 1235 | (insert (format "<%s> " ex-op)) | 1234 | (insert (format "<%s> " ex-op)) |
| 1236 | (funcall (get ex-op 'ccl-dump-function) rrr RRR Rrr))) | 1235 | (funcall (get ex-op 'ccl-dump-function) rrr RRR Rrr))) |
| 1237 | 1236 | ||
| 1238 | (defun ccl-dump-read-multibyte-character (rrr RRR Rrr) | 1237 | (defun ccl-dump-read-multibyte-character (rrr RRR _Rrr) |
| 1239 | (insert (format "read-multibyte-character r%d r%d\n" RRR rrr))) | 1238 | (insert (format "read-multibyte-character r%d r%d\n" RRR rrr))) |
| 1240 | 1239 | ||
| 1241 | (defun ccl-dump-write-multibyte-character (rrr RRR Rrr) | 1240 | (defun ccl-dump-write-multibyte-character (rrr RRR _Rrr) |
| 1242 | (insert (format "write-multibyte-character r%d r%d\n" RRR rrr))) | 1241 | (insert (format "write-multibyte-character r%d r%d\n" RRR rrr))) |
| 1243 | 1242 | ||
| 1244 | (defun ccl-dump-translate-character (rrr RRR Rrr) | 1243 | (defun ccl-dump-translate-character (rrr RRR Rrr) |
| 1245 | (insert (format "translation table(r%d) r%d r%d\n" Rrr RRR rrr))) | 1244 | (insert (format "translation table(r%d) r%d r%d\n" Rrr RRR rrr))) |
| 1246 | 1245 | ||
| 1247 | (defun ccl-dump-translate-character-const-tbl (rrr RRR Rrr) | 1246 | (defun ccl-dump-translate-character-const-tbl (rrr RRR _Rrr) |
| 1248 | (let ((tbl (ccl-get-next-code))) | 1247 | (let ((tbl (ccl-get-next-code))) |
| 1249 | (insert (format "translation table(%S) r%d r%d\n" tbl RRR rrr)))) | 1248 | (insert (format "translation table(%S) r%d r%d\n" tbl RRR rrr)))) |
| 1250 | 1249 | ||
| 1251 | (defun ccl-dump-lookup-int-const-tbl (rrr RRR Rrr) | 1250 | (defun ccl-dump-lookup-int-const-tbl (rrr RRR _Rrr) |
| 1252 | (let ((tbl (ccl-get-next-code))) | 1251 | (let ((tbl (ccl-get-next-code))) |
| 1253 | (insert (format "hash table(%S) r%d r%d\n" tbl RRR rrr)))) | 1252 | (insert (format "hash table(%S) r%d r%d\n" tbl RRR rrr)))) |
| 1254 | 1253 | ||
| 1255 | (defun ccl-dump-lookup-char-const-tbl (rrr RRR Rrr) | 1254 | (defun ccl-dump-lookup-char-const-tbl (rrr RRR _Rrr) |
| 1256 | (let ((tbl (ccl-get-next-code))) | 1255 | (let ((tbl (ccl-get-next-code))) |
| 1257 | (insert (format "hash table(%S) r%d r%d\n" tbl RRR rrr)))) | 1256 | (insert (format "hash table(%S) r%d r%d\n" tbl RRR rrr)))) |
| 1258 | 1257 | ||
| 1259 | (defun ccl-dump-iterate-multiple-map (rrr RRR Rrr) | 1258 | (defun ccl-dump-iterate-multiple-map (rrr RRR _Rrr) |
| 1260 | (let ((notbl (ccl-get-next-code)) | 1259 | (let ((notbl (ccl-get-next-code)) |
| 1261 | (i 0) id) | 1260 | (i 0) id) |
| 1262 | (insert (format "iterate-multiple-map r%d r%d\n" RRR rrr)) | 1261 | (insert (format "iterate-multiple-map r%d r%d\n" RRR rrr)) |
| @@ -1267,7 +1266,7 @@ is a list of CCL-BLOCKs." | |||
| 1267 | (setq i (1+ i))) | 1266 | (setq i (1+ i))) |
| 1268 | (insert "]\n"))) | 1267 | (insert "]\n"))) |
| 1269 | 1268 | ||
| 1270 | (defun ccl-dump-map-multiple (rrr RRR Rrr) | 1269 | (defun ccl-dump-map-multiple (rrr RRR _Rrr) |
| 1271 | (let ((notbl (ccl-get-next-code)) | 1270 | (let ((notbl (ccl-get-next-code)) |
| 1272 | (i 0) id) | 1271 | (i 0) id) |
| 1273 | (insert (format "map-multiple r%d r%d\n" RRR rrr)) | 1272 | (insert (format "map-multiple r%d r%d\n" RRR rrr)) |
| @@ -1280,7 +1279,7 @@ is a list of CCL-BLOCKs." | |||
| 1280 | (setq i (1+ i))) | 1279 | (setq i (1+ i))) |
| 1281 | (insert "]\n"))) | 1280 | (insert "]\n"))) |
| 1282 | 1281 | ||
| 1283 | (defun ccl-dump-map-single (rrr RRR Rrr) | 1282 | (defun ccl-dump-map-single (rrr RRR _Rrr) |
| 1284 | (let ((id (ccl-get-next-code))) | 1283 | (let ((id (ccl-get-next-code))) |
| 1285 | (insert (format "map-single r%d r%d map(%S)\n" RRR rrr id)))) | 1284 | (insert (format "map-single r%d r%d map(%S)\n" RRR rrr id)))) |
| 1286 | 1285 | ||
diff --git a/lisp/json.el b/lisp/json.el index e2c7cc77222..b23d12ad0ed 100644 --- a/lisp/json.el +++ b/lisp/json.el | |||
| @@ -358,7 +358,7 @@ Please see the documentation of `json-object-type'." | |||
| 358 | (cond ((eq json-object-type 'hash-table) | 358 | (cond ((eq json-object-type 'hash-table) |
| 359 | (make-hash-table :test 'equal)) | 359 | (make-hash-table :test 'equal)) |
| 360 | (t | 360 | (t |
| 361 | (list)))) | 361 | ()))) |
| 362 | 362 | ||
| 363 | (defun json-add-to-object (object key value) | 363 | (defun json-add-to-object (object key value) |
| 364 | "Add a new KEY -> VALUE association to OBJECT. | 364 | "Add a new KEY -> VALUE association to OBJECT. |
diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 6a315496fe0..5748e88bbca 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el | |||
| @@ -1501,7 +1501,7 @@ If CHARSET is nil then use UTF-8." | |||
| 1501 | (setq start (point) | 1501 | (setq start (point) |
| 1502 | title (plist-get bookmark :title)) | 1502 | title (plist-get bookmark :title)) |
| 1503 | (when (> (length title) width) | 1503 | (when (> (length title) width) |
| 1504 | (setq title (substring title 0 width))) | 1504 | (setq title (truncate-string-to-width title width))) |
| 1505 | (insert (format format title (plist-get bookmark :url)) "\n") | 1505 | (insert (format format title (plist-get bookmark :url)) "\n") |
| 1506 | (put-text-property start (1+ start) 'eww-bookmark bookmark)) | 1506 | (put-text-property start (1+ start) 'eww-bookmark bookmark)) |
| 1507 | (goto-char (point-min)))) | 1507 | (goto-char (point-min)))) |
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 5910d1fd3a4..c0a6b6afa6d 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el | |||
| @@ -649,8 +649,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 649 | (directory &optional full match nosort) | 649 | (directory &optional full match nosort) |
| 650 | "Like `directory-files' for Tramp files." | 650 | "Like `directory-files' for Tramp files." |
| 651 | (let ((result (mapcar 'directory-file-name | 651 | (let ((result (mapcar 'directory-file-name |
| 652 | (file-name-all-completions "" directory))) | 652 | (file-name-all-completions "" directory)))) |
| 653 | res) | ||
| 654 | ;; Discriminate with regexp. | 653 | ;; Discriminate with regexp. |
| 655 | (when match | 654 | (when match |
| 656 | (setq result | 655 | (setq result |
| @@ -665,9 +664,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 665 | result))) | 664 | result))) |
| 666 | ;; Sort them if necessary. | 665 | ;; Sort them if necessary. |
| 667 | (unless nosort (setq result (sort result 'string-lessp))) | 666 | (unless nosort (setq result (sort result 'string-lessp))) |
| 668 | ;; Remove double entries. | 667 | (delete-dups result))) |
| 669 | (dolist (elt result res) | ||
| 670 | (add-to-list 'res elt 'append)))) | ||
| 671 | 668 | ||
| 672 | (defun tramp-smb-handle-expand-file-name (name &optional dir) | 669 | (defun tramp-smb-handle-expand-file-name (name &optional dir) |
| 673 | "Like `expand-file-name' for Tramp files." | 670 | "Like `expand-file-name' for Tramp files." |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 30a7269240e..2f811bb73ca 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -4043,6 +4043,7 @@ Return the local name of the temporary file." | |||
| 4043 | 'tramp-delete-temp-file-function))) | 4043 | 'tramp-delete-temp-file-function))) |
| 4044 | 4044 | ||
| 4045 | ;;; Auto saving to a special directory: | 4045 | ;;; Auto saving to a special directory: |
| 4046 | (defvar auto-save-file-name-transforms) | ||
| 4046 | 4047 | ||
| 4047 | (defun tramp-handle-make-auto-save-file-name () | 4048 | (defun tramp-handle-make-auto-save-file-name () |
| 4048 | "Like `make-auto-save-file-name' for Tramp files. | 4049 | "Like `make-auto-save-file-name' for Tramp files. |
diff --git a/lisp/obsolete/vc-arch.el b/lisp/obsolete/vc-arch.el index bdb69757d35..e6540ce74d9 100644 --- a/lisp/obsolete/vc-arch.el +++ b/lisp/obsolete/vc-arch.el | |||
| @@ -310,6 +310,10 @@ Only the value `maybe' can be trusted :-(." | |||
| 310 | 'up-to-date | 310 | 'up-to-date |
| 311 | 'edited))))))))) | 311 | 'edited))))))))) |
| 312 | 312 | ||
| 313 | ;; dir-status-files called from vc-dir, which loads vc, | ||
| 314 | ;; which loads vc-dispatcher. | ||
| 315 | (declare-function vc-exec-after "vc-dispatcher" (code)) | ||
| 316 | |||
| 313 | (defun vc-arch-dir-status-files (dir _files callback) | 317 | (defun vc-arch-dir-status-files (dir _files callback) |
| 314 | "Run `tla inventory' for DIR and pass results to CALLBACK. | 318 | "Run `tla inventory' for DIR and pass results to CALLBACK. |
| 315 | CALLBACK expects (ENTRIES &optional MORE-TO-COME); see | 319 | CALLBACK expects (ENTRIES &optional MORE-TO-COME); see |
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 45afafc2381..0b13759b9bc 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el | |||
| @@ -3410,18 +3410,24 @@ There might be text before point." | |||
| 3410 | "A `prettify-symbols-alist' usable for (La)TeX modes.") | 3410 | "A `prettify-symbols-alist' usable for (La)TeX modes.") |
| 3411 | 3411 | ||
| 3412 | (defun tex--prettify-symbols-compose-p (_start end _match) | 3412 | (defun tex--prettify-symbols-compose-p (_start end _match) |
| 3413 | (let* ((after-char (char-after end)) | 3413 | (or |
| 3414 | (after-syntax (char-syntax after-char))) | 3414 | ;; If the matched symbol doesn't end in a word character, then we |
| 3415 | (not (or | 3415 | ;; simply allow composition. The symbol is probably something like |
| 3416 | ;; Don't compose \alpha@foo. | 3416 | ;; \|, \(, etc. |
| 3417 | (eq after-char ?@) | 3417 | (not (eq ?w (char-syntax (char-before end)))) |
| 3418 | ;; The \alpha in \alpha2 or \alpha-\beta may be composed but | 3418 | ;; Else we look at what follows the match in order to decide. |
| 3419 | ;; of course \alphax may not. | 3419 | (let* ((after-char (char-after end)) |
| 3420 | (and (eq after-syntax ?w) | 3420 | (after-syntax (char-syntax after-char))) |
| 3421 | (not (memq after-char | 3421 | (not (or |
| 3422 | '(?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9 ?+ ?- ?' ?\")))) | 3422 | ;; Don't compose \alpha@foo. |
| 3423 | ;; Don't compose inside verbatim blocks. | 3423 | (eq after-char ?@) |
| 3424 | (eq 2 (nth 7 (syntax-ppss))))))) | 3424 | ;; The \alpha in \alpha2 or \alpha-\beta may be composed but |
| 3425 | ;; of course \alphax may not. | ||
| 3426 | (and (eq after-syntax ?w) | ||
| 3427 | (not (memq after-char | ||
| 3428 | '(?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9 ?+ ?- ?' ?\")))) | ||
| 3429 | ;; Don't compose inside verbatim blocks. | ||
| 3430 | (eq 2 (nth 7 (syntax-ppss)))))))) | ||
| 3425 | 3431 | ||
| 3426 | (run-hooks 'tex-mode-load-hook) | 3432 | (run-hooks 'tex-mode-load-hook) |
| 3427 | 3433 | ||
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el index 40f251654f2..9b2711d8146 100644 --- a/lisp/vc/vc-bzr.el +++ b/lisp/vc/vc-bzr.el | |||
| @@ -331,6 +331,7 @@ in the repository root directory of FILE." | |||
| 331 | "Value of `compilation-error-regexp-alist' in *vc-bzr* buffers.") | 331 | "Value of `compilation-error-regexp-alist' in *vc-bzr* buffers.") |
| 332 | 332 | ||
| 333 | ;; To be called via vc-pull from vc.el, which requires vc-dispatcher. | 333 | ;; To be called via vc-pull from vc.el, which requires vc-dispatcher. |
| 334 | (declare-function vc-exec-after "vc-dispatcher" (code)) | ||
| 334 | (declare-function vc-set-async-update "vc-dispatcher" (process-buffer)) | 335 | (declare-function vc-set-async-update "vc-dispatcher" (process-buffer)) |
| 335 | (declare-function vc-compilation-mode "vc-dispatcher" (backend)) | 336 | (declare-function vc-compilation-mode "vc-dispatcher" (backend)) |
| 336 | 337 | ||
diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el index c0a199dc078..5f5807fb3c6 100644 --- a/lisp/vc/vc-cvs.el +++ b/lisp/vc/vc-cvs.el | |||
| @@ -543,6 +543,8 @@ Will fail unless you have administrative privileges on the repo." | |||
| 543 | ;;; | 543 | ;;; |
| 544 | 544 | ||
| 545 | (declare-function vc-rcs-print-log-cleanup "vc-rcs" ()) | 545 | (declare-function vc-rcs-print-log-cleanup "vc-rcs" ()) |
| 546 | ;; Follows vc-cvs-command, which uses vc-do-command from vc-dispatcher. | ||
| 547 | (declare-function vc-exec-after "vc-dispatcher" (code)) | ||
| 546 | 548 | ||
| 547 | (defun vc-cvs-print-log (files buffer &optional _shortlog _start-revision limit) | 549 | (defun vc-cvs-print-log (files buffer &optional _shortlog _start-revision limit) |
| 548 | "Print commit log associated with FILES into specified BUFFER. | 550 | "Print commit log associated with FILES into specified BUFFER. |
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 0e33896a715..27898a991a0 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el | |||
| @@ -461,6 +461,8 @@ or an empty string if none." | |||
| 461 | 461 | ||
| 462 | ;; Follows vc-git-command (or vc-do-async-command), which uses vc-do-command | 462 | ;; Follows vc-git-command (or vc-do-async-command), which uses vc-do-command |
| 463 | ;; from vc-dispatcher. | 463 | ;; from vc-dispatcher. |
| 464 | (declare-function vc-exec-after "vc-dispatcher" (code)) | ||
| 465 | ;; Follows vc-exec-after. | ||
| 464 | (declare-function vc-set-async-update "vc-dispatcher" (process-buffer)) | 466 | (declare-function vc-set-async-update "vc-dispatcher" (process-buffer)) |
| 465 | 467 | ||
| 466 | (defun vc-git-dir-status-goto-stage (stage files update-function) | 468 | (defun vc-git-dir-status-goto-stage (stage files update-function) |
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index c4d6092d100..f9957c1afff 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el | |||
| @@ -259,6 +259,14 @@ highlighting the Log View buffer." | |||
| 259 | (defvar vc-hg-log-graph nil | 259 | (defvar vc-hg-log-graph nil |
| 260 | "If non-nil, use `--graph' in the short log output.") | 260 | "If non-nil, use `--graph' in the short log output.") |
| 261 | 261 | ||
| 262 | (defvar vc-hg-log-format (concat "changeset: {rev}:{node|short}\n" | ||
| 263 | "{tags % 'tag: {tag}\n'}" | ||
| 264 | "{if(parents, 'parents: {parents}\n')}" | ||
| 265 | "user: {author}\n" | ||
| 266 | "Date: {date|date}\n" | ||
| 267 | "summary: {desc|tabindent}\n\n") | ||
| 268 | "Mercurial log template for `vc-hg-print-log' long format.") | ||
| 269 | |||
| 262 | (defun vc-hg-print-log (files buffer &optional shortlog start-revision limit) | 270 | (defun vc-hg-print-log (files buffer &optional shortlog start-revision limit) |
| 263 | "Print commit log associated with FILES into specified BUFFER. | 271 | "Print commit log associated with FILES into specified BUFFER. |
| 264 | If SHORTLOG is non-nil, use a short format based on `vc-hg-root-log-format'. | 272 | If SHORTLOG is non-nil, use a short format based on `vc-hg-root-log-format'. |
| @@ -276,9 +284,11 @@ If LIMIT is non-nil, show no more than this many entries." | |||
| 276 | (nconc | 284 | (nconc |
| 277 | (when start-revision (list (format "-r%s:0" start-revision))) | 285 | (when start-revision (list (format "-r%s:0" start-revision))) |
| 278 | (when limit (list "-l" (format "%s" limit))) | 286 | (when limit (list "-l" (format "%s" limit))) |
| 279 | (when shortlog `(,@(if vc-hg-log-graph '("--graph")) | 287 | (if shortlog |
| 280 | "--template" | 288 | `(,@(if vc-hg-log-graph '("--graph")) |
| 281 | ,(car vc-hg-root-log-format))) | 289 | "--template" |
| 290 | ,(car vc-hg-root-log-format)) | ||
| 291 | `("--template" ,vc-hg-log-format)) | ||
| 282 | vc-hg-log-switches))))) | 292 | vc-hg-log-switches))))) |
| 283 | 293 | ||
| 284 | (defvar log-view-message-re) | 294 | (defvar log-view-message-re) |
| @@ -295,6 +305,7 @@ If LIMIT is non-nil, show no more than this many entries." | |||
| 295 | (if (eq vc-log-view-type 'short) | 305 | (if (eq vc-log-view-type 'short) |
| 296 | (cadr vc-hg-root-log-format) | 306 | (cadr vc-hg-root-log-format) |
| 297 | "^changeset:[ \t]*\\([0-9]+\\):\\(.+\\)")) | 307 | "^changeset:[ \t]*\\([0-9]+\\):\\(.+\\)")) |
| 308 | (set (make-local-variable 'tab-width) 2) | ||
| 298 | ;; Allow expanding short log entries | 309 | ;; Allow expanding short log entries |
| 299 | (when (eq vc-log-view-type 'short) | 310 | (when (eq vc-log-view-type 'short) |
| 300 | (setq truncate-lines t) | 311 | (setq truncate-lines t) |
| @@ -345,7 +356,7 @@ If LIMIT is non-nil, show no more than this many entries." | |||
| 345 | 356 | ||
| 346 | (defun vc-hg-expanded-log-entry (revision) | 357 | (defun vc-hg-expanded-log-entry (revision) |
| 347 | (with-temp-buffer | 358 | (with-temp-buffer |
| 348 | (vc-hg-command t nil nil "log" "-r" revision) | 359 | (vc-hg-command t nil nil "log" "-r" revision "--template" vc-hg-log-format) |
| 349 | (goto-char (point-min)) | 360 | (goto-char (point-min)) |
| 350 | (unless (eobp) | 361 | (unless (eobp) |
| 351 | ;; Indent the expanded log entry. | 362 | ;; Indent the expanded log entry. |
| @@ -620,6 +631,8 @@ REV is the revision to check out into WORKFILE." | |||
| 620 | 631 | ||
| 621 | ;; Follows vc-hg-command (or vc-do-async-command), which uses vc-do-command | 632 | ;; Follows vc-hg-command (or vc-do-async-command), which uses vc-do-command |
| 622 | ;; from vc-dispatcher. | 633 | ;; from vc-dispatcher. |
| 634 | (declare-function vc-exec-after "vc-dispatcher" (code)) | ||
| 635 | ;; Follows vc-exec-after. | ||
| 623 | (declare-function vc-set-async-update "vc-dispatcher" (process-buffer)) | 636 | (declare-function vc-set-async-update "vc-dispatcher" (process-buffer)) |
| 624 | 637 | ||
| 625 | (defun vc-hg-dir-status-files (dir files update-function) | 638 | (defun vc-hg-dir-status-files (dir files update-function) |
diff --git a/lisp/vc/vc-mtn.el b/lisp/vc/vc-mtn.el index 3197d606061..b56a08f2a9e 100644 --- a/lisp/vc/vc-mtn.el +++ b/lisp/vc/vc-mtn.el | |||
| @@ -138,6 +138,10 @@ switches." | |||
| 138 | ((match-end 2) (push (list (match-string 3) 'added) result)))) | 138 | ((match-end 2) (push (list (match-string 3) 'added) result)))) |
| 139 | (funcall update-function result))) | 139 | (funcall update-function result))) |
| 140 | 140 | ||
| 141 | ;; dir-status-files called from vc-dir, which loads vc, | ||
| 142 | ;; which loads vc-dispatcher. | ||
| 143 | (declare-function vc-exec-after "vc-dispatcher" (code)) | ||
| 144 | |||
| 141 | (defun vc-mtn-dir-status-files (dir _files update-function) | 145 | (defun vc-mtn-dir-status-files (dir _files update-function) |
| 142 | (vc-mtn-command (current-buffer) 'async dir "status") | 146 | (vc-mtn-command (current-buffer) 'async dir "status") |
| 143 | (vc-run-delayed | 147 | (vc-run-delayed |
diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el index 2ec65a1ad07..4ef63a23db5 100644 --- a/lisp/vc/vc-svn.el +++ b/lisp/vc/vc-svn.el | |||
| @@ -208,6 +208,10 @@ switches." | |||
| 208 | (setq result (cons (list filename state) result))))) | 208 | (setq result (cons (list filename state) result))))) |
| 209 | (funcall callback result))) | 209 | (funcall callback result))) |
| 210 | 210 | ||
| 211 | ;; dir-status-files called from vc-dir, which loads vc, | ||
| 212 | ;; which loads vc-dispatcher. | ||
| 213 | (declare-function vc-exec-after "vc-dispatcher" (code)) | ||
| 214 | |||
| 211 | (autoload 'vc-expand-dirs "vc") | 215 | (autoload 'vc-expand-dirs "vc") |
| 212 | 216 | ||
| 213 | (defun vc-svn-dir-status-files (_dir files callback) | 217 | (defun vc-svn-dir-status-files (_dir files callback) |