diff options
author | Anders Lindgren <andlind@gmail.com> | 2015-10-28 12:09:51 +0100 |
---|---|---|
committer | Anders Lindgren <andlind@gmail.com> | 2015-10-28 12:09:51 +0100 |
commit | cc587a3539612d250d222363b18d15258e33f82a (patch) | |
tree | 00c74927ef3da99c7226cbaf586d439e0236b85c /lisp | |
parent | 590449f3d87f8f43eb0a852233e8945ecbe1c6aa (diff) | |
parent | 64c2bfbc4f5daba2ee55acb58a2929070a846b6e (diff) | |
download | emacs-cc587a3539612d250d222363b18d15258e33f82a.tar.gz emacs-cc587a3539612d250d222363b18d15258e33f82a.tar.bz2 emacs-cc587a3539612d250d222363b18d15258e33f82a.zip |
Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/emacs
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 ;; Since we watch a directory, a file name must be returned. (cl-assert (stringp file)) (when (eq action 'renamed) (cl-assert (stringp file1))) - ;; Loop over all buffers, in order to find the intended one. - (cl-dolist (buffer buffers) - (when (buffer-live-p buffer) - (with-current-buffer buffer - (when (or - ;; A buffer associated with a file. - (and (stringp buffer-file-name) - (or - (and (memq action '(attribute-changed changed created)) - (string-equal - (file-name-nondirectory file) - (file-name-nondirectory buffer-file-name))) - (and (eq action 'renamed) - (string-equal - (file-name-nondirectory file1) - (file-name-nondirectory buffer-file-name))))) - ;; A buffer w/o a file, like dired. - (and (null buffer-file-name) - (memq action '(created renamed deleted)))) - ;; Mark buffer modified. - (setq auto-revert-notify-modified-p t) - - ;; Revert the buffer now if we're not locked out. - (when (/= auto-revert-buffers-counter-lockedout - auto-revert-buffers-counter) - (auto-revert-handler) - (setq auto-revert-buffers-counter-lockedout - auto-revert-buffers-counter)) - - ;; No need to check other buffers. - (cl-return)))))))) + + (if (eq action 'stopped) + ;; File notification has stopped. Continue with polling. + (cl-dolist (buffer buffers) + (with-current-buffer buffer + (when (or + ;; A buffer associated with a file. + (and (stringp buffer-file-name) + (string-equal + (file-name-nondirectory file) + (file-name-nondirectory buffer-file-name))) + ;; A buffer w/o a file, like dired. + (null buffer-file-name)) + (auto-revert-notify-rm-watch) + (setq-local auto-revert-use-notify nil)))) + + ;; Loop over all buffers, in order to find the intended one. + (cl-dolist (buffer buffers) + (when (buffer-live-p buffer) + (with-current-buffer buffer + (when (or + ;; A buffer associated with a file. + (and (stringp buffer-file-name) + (or + (and (memq + action '(attribute-changed changed created)) + (string-equal + (file-name-nondirectory file) + (file-name-nondirectory buffer-file-name))) + (and (eq action 'renamed) + (string-equal + (file-name-nondirectory file1) + (file-name-nondirectory buffer-file-name))))) + ;; A buffer w/o a file, like dired. + (and (null buffer-file-name) + (memq action '(created renamed deleted)))) + ;; Mark buffer modified. + (setq auto-revert-notify-modified-p t) + + ;; Revert the buffer now if we're not locked out. + (when (/= auto-revert-buffers-counter-lockedout + auto-revert-buffers-counter) + (auto-revert-handler) + (setq auto-revert-buffers-counter-lockedout + auto-revert-buffers-counter)) + + ;; No need to check other buffers. + (cl-return))))))))) (defun auto-revert-active-p () "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." ;; Check for warnings. (with-current-buffer b (goto-char (point-min)) - (when (re-search-forward "Error\\|Warning" nil t) + (when (re-search-forward "Error\\|Warning\\|invalid" nil t) (error "Output:\n%S" (buffer-string)))) b)) @@ -186,12 +186,14 @@ If a database already exists, then just update it." (let ((root (cedet-gnu-global-root dir))) (if root (setq dir root)) (let ((default-directory dir)) - (cedet-gnu-global-gtags-call - (when root - '("-u");; Incremental update flag. - )) - ) - )) + (if root + ;; Incremental update. This can be either "gtags -i" or + ;; "global -u"; the gtags manpage says it's better to use + ;; "global -u". + (cedet-gnu-global-call (list "-u")) + (cedet-gnu-global-gtags-call nil) + ) + ))) (provide 'cedet-global) 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 (ede-generic-new-autoloader "generic-cvs" "Generic CVS" "CVS" 'ede-generic-vc-project) (ede-generic-new-autoloader "generic-mtn" "Generic Monotone" - "_MTN/options" 'ede-generic-vc-project) + "_MTN" 'ede-generic-vc-project) ;; Take advantage of existing 'projectile' based projects. ;; @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 @@ (require 'ewoc) (require 'find-func) (require 'help) - +(require 'pp) ;;; UI customization options. @@ -1300,7 +1300,8 @@ EXPECTEDP specifies whether the result was expected." (defun ert--pp-with-indentation-and-newline (object) "Pretty-print OBJECT, indenting it to the current column of point. Ensures a final newline is inserted." - (let ((begin (point))) + (let ((begin (point)) + (pp-escape-newlines nil)) (pp object (current-buffer)) (unless (bolp) (insert "\n")) (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 @@ (require 'seq) (pcase-defmacro map (&rest args) - "pcase pattern matching map elements. + "Build a `pcase' pattern matching map elements. -Matches if the object is a map (list, hash-table or array), and -each PATTERN matches the corresponding elements of the map. +The `pcase' pattern will match each element of PATTERN against +the corresponding elements of the map. -Supernumerary elements of the map are ignored if fewer ARGS are +Extra elements of the map are ignored if fewer ARGS are given, and the match does not fail. 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." (t (error "Unsupported map: %s" ,map-var))))) (defun map-elt (map key &optional default) - "Perform a lookup in MAP of KEY and return its associated value. + "Lookup KEY in MAP and return its associated value. If KEY is not found, return DEFAULT which defaults to nil. If MAP is a list, `eql' is used to lookup KEY. @@ -122,7 +122,7 @@ MAP can be a list, hash-table or array." default))) (defmacro map-put (map key value) - "In MAP, associate KEY with VALUE and return MAP. + "Associate KEY with VALUE in MAP and return MAP. If KEY is already present in MAP, replace the associated value with VALUE. @@ -133,8 +133,9 @@ MAP can be a list, hash-table or array." ,map))) (defmacro map-delete (map key) - "In MAP, delete the key KEY if present and return MAP. -If MAP is an array, store nil at the index KEY. + "Delete KEY from MAP and return MAP. +No error is signaled if KEY is not a key of MAP. If MAP is an +array, store nil at the index KEY. MAP can be a list, hash-table or array." (declare (debug t)) @@ -245,7 +246,7 @@ MAP can be a list, hash-table or array." (arrayp map))) (defun map-empty-p (map) - "Return non-nil is MAP is empty. + "Return non-nil if MAP is empty. MAP can be a list, hash-table or array." (map--dispatch map @@ -254,7 +255,7 @@ MAP can be a list, hash-table or array." :hash-table (zerop (hash-table-count map)))) (defun map-contains-key (map key &optional testfn) - "Return non-nil if MAP contain the key KEY, nil otherwise. + "Return non-nil if MAP contain KEY, nil otherwise. Equality is defined by TESTFN if non-nil or by `equal' if nil. MAP can be a list, hash-table or array." @@ -284,7 +285,7 @@ MAP can be a list, hash-table or array." t)) (defun map-merge (type &rest maps) - "Merge into a map of type TYPE all the key/value pairs in the maps MAPS. + "Merge into a map of type TYPE all the key/value pairs in MAPS. MAP can be a list, hash-table or array." (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 @@ (defmacro seq-doseq (spec &rest body) "Loop over a sequence. -Similar to `dolist' but can be applied to lists, strings, and vectors. +Evaluate BODY with VAR bound to each element of SEQUENCE, in turn. -Evaluate BODY with VAR bound to each element of SEQ, in turn. +Similar to `dolist' but can be applied to lists, strings, and vectors. -\(fn (VAR SEQ) BODY...)" +\(fn (VAR SEQUENCE) BODY...)" (declare (indent 1) (debug ((symbolp form &optional form) body))) `(seq-do (lambda (,(car spec)) ,@body) ,(cadr spec))) (pcase-defmacro seq (&rest patterns) - "pcase pattern matching sequence elements. + "Build a `pcase' pattern that matches elements of SEQUENCE. -Matches if the object is a sequence (list, string or vector), and -each PATTERN matches the corresponding element of the sequence. +The `pcase' pattern will match each element of PATTERNS against the +corresponding element of SEQUENCE. -Supernumerary elements of the sequence are ignored if fewer -PATTERNS are given, and the match does not fail." +Extra elements of the sequence are ignored if fewer PATTERNS are +given, and the match does not fail." `(and (pred seq-p) ,@(seq--make-pcase-bindings patterns))) -(defmacro seq-let (args seq &rest body) - "Bind the variables in ARGS to the elements of SEQ then evaluate BODY. +(defmacro seq-let (args sequence &rest body) + "Bind the variables in ARGS to the elements of SEQUENCE, then evaluate BODY. ARGS can also include the `&rest' marker followed by a variable -name to be bound to the rest of SEQ." +name to be bound to the rest of SEQUENCE." (declare (indent 2) (debug t)) - `(pcase-let ((,(seq--make-pcase-patterns args) ,seq)) + `(pcase-let ((,(seq--make-pcase-patterns args) ,sequence)) ,@body)) -;;; Basic seq functions that have to be implemented by new seq types -(cl-defgeneric seq-elt (seq n) - "Return the element of SEQ at index N." - (elt seq n)) +;;; Basic seq functions that have to be implemented by new sequence types +(cl-defgeneric seq-elt (sequence n) + "Return Nth element of SEQUENCE." + (elt sequence n)) ;; Default gv setters for `seq-elt'. ;; It can be a good idea for new sequence implementations to provide a ;; "gv-setter" for `seq-elt'. -(cl-defmethod (setf seq-elt) (store (seq array) n) - (aset seq n store)) +(cl-defmethod (setf seq-elt) (store (sequence array) n) + (aset sequence n store)) -(cl-defmethod (setf seq-elt) (store (seq cons) n) - (setcar (nthcdr n seq) store)) +(cl-defmethod (setf seq-elt) (store (sequence cons) n) + (setcar (nthcdr n sequence) store)) -(cl-defgeneric seq-length (seq) - "Return the length of the sequence SEQ." - (length seq)) +(cl-defgeneric seq-length (sequence) + "Return the number of elements of SEQUENCE." + (length sequence)) -(cl-defgeneric seq-do (function seq) - "Apply FUNCTION to each element of SEQ, presumably for side effects. -Return SEQ." - (mapc function seq)) +(cl-defgeneric seq-do (function sequence) + "Apply FUNCTION to each element of SEQUENCE, presumably for side effects. +Return SEQUENCE." + (mapc function sequence)) (defalias 'seq-each #'seq-do) -(cl-defgeneric seq-p (seq) - "Return non-nil if SEQ is a sequence, nil otherwise." - (sequencep seq)) +(cl-defgeneric seq-p (sequence) + "Return non-nil if SEQUENCE is a sequence, nil otherwise." + (sequencep sequence)) -(cl-defgeneric seq-copy (seq) - "Return a shallow copy of SEQ." - (copy-sequence seq)) +(cl-defgeneric seq-copy (sequence) + "Return a shallow copy of SEQUENCE." + (copy-sequence sequence)) -(cl-defgeneric seq-subseq (seq start &optional end) - "Return the subsequence of SEQ from START to END. -If END is omitted, it defaults to the length of the sequence. -If START or END is negative, it counts from the end. -Signal an error if START or END are outside of the sequence (i.e -too large if positive or too small if negative)." - (cl-subseq seq start end)) +(cl-defgeneric seq-subseq (sequence start &optional end) + "Return the sequence of elements of SEQUENCE from START to END. +END is inclusive. + +If END is omitted, it defaults to the length of the sequence. If +START or END is negative, it counts from the end. Signal an +error if START or END are outside of the sequence (i.e too large +if positive or too small if negative)." + (cl-subseq sequence start end)) -(cl-defgeneric seq-map (function seq) - "Return the result of applying FUNCTION to each element of SEQ." +(cl-defgeneric seq-map (function sequence) + "Return the result of applying FUNCTION to each element of SEQUENCE." (let (result) (seq-do (lambda (elt) (push (funcall function elt) result)) - seq) + sequence) (nreverse result))) ;; faster implementation for sequences (sequencep) -(cl-defmethod seq-map (function (seq sequence)) - (mapcar function seq)) +(cl-defmethod seq-map (function (sequence sequence)) + (mapcar function sequence)) -(cl-defgeneric seq-drop (seq n) - "Return a subsequence of SEQ without its first N elements. -The result is a sequence of the same type as SEQ. +(cl-defgeneric seq-drop (sequence n) + "Remove the first N elements of SEQUENCE and return the result. +The result is a sequence of the same type as SEQUENCE. -If N is a negative integer or zero, SEQ is returned." +If N is a negative integer or zero, SEQUENCE is returned." (if (<= n 0) - seq - (let ((length (seq-length seq))) - (seq-subseq seq (min n length) length)))) + sequence + (let ((length (seq-length sequence))) + (seq-subseq sequence (min n length) length)))) -(cl-defgeneric seq-take (seq n) - "Return a subsequence of SEQ with its first N elements. -The result is a sequence of the same type as SEQ. +(cl-defgeneric seq-take (sequence n) + "Take the first N elements of SEQUENCE and return the result. +The result is a sequence of the same type as SEQUENCE. If N is a negative integer or zero, an empty sequence is returned." - (seq-subseq seq 0 (min (max n 0) (seq-length seq)))) - -(cl-defgeneric seq-drop-while (pred seq) - "Return a sequence from the first element for which (PRED element) is nil in SEQ. -The result is a sequence of the same type as SEQ." - (seq-drop seq (seq--count-successive pred seq))) - -(cl-defgeneric seq-take-while (pred seq) - "Return the successive elements for which (PRED element) is non-nil in SEQ. -The result is a sequence of the same type as SEQ." - (seq-take seq (seq--count-successive pred seq))) - -(cl-defgeneric seq-empty-p (seq) - "Return non-nil if the sequence SEQ is empty, nil otherwise." - (= 0 (seq-length seq))) - -(cl-defgeneric seq-sort (pred seq) - "Return a sorted sequence comparing using PRED the elements of SEQ. -The result is a sequence of the same type as SEQ." - (let ((result (seq-sort pred (append seq nil)))) - (seq-into result (type-of seq)))) + (seq-subseq sequence 0 (min (max n 0) (seq-length sequence)))) + +(cl-defgeneric seq-drop-while (pred sequence) + "Remove the successive elements of SEQUENCE for which PRED returns non-nil. +PRED is a function of one argument. The result is a sequence of +the same type as SEQUENCE." + (seq-drop sequence (seq--count-successive pred sequence))) + +(cl-defgeneric seq-take-while (pred sequence) + "Take the successive elements of SEQUENCE for which PRED returns non-nil. +PRED is a function of one argument. The result is a sequence of +the same type as SEQUENCE." + (seq-take sequence (seq--count-successive pred sequence))) + +(cl-defgeneric seq-empty-p (sequence) + "Return non-nil if the SEQUENCE is empty, nil otherwise." + (= 0 (seq-length sequence))) + +(cl-defgeneric seq-sort (pred sequence) + "Sort SEQUENCE using PRED as comparison function. +The result is a sequence of the same type as SEQUENCE." + (let ((result (seq-sort pred (append sequence nil)))) + (seq-into result (type-of sequence)))) (cl-defmethod seq-sort (pred (list list)) (sort (seq-copy list) pred)) -(cl-defgeneric seq-reverse (seq) - "Return the reversed shallow copy of SEQ." +(cl-defgeneric seq-reverse (sequence) + "Return a sequence with elements of SEQUENCE in reverse order." (let ((result '())) (seq-map (lambda (elt) (push elt result)) - seq) - (seq-into result (type-of seq)))) + sequence) + (seq-into result (type-of sequence)))) ;; faster implementation for sequences (sequencep) -(cl-defmethod seq-reverse ((seq sequence)) - (reverse seq)) +(cl-defmethod seq-reverse ((sequence sequence)) + (reverse sequence)) -(cl-defgeneric seq-concatenate (type &rest seqs) - "Concatenate, into a sequence of type TYPE, the sequences SEQS. +(cl-defgeneric seq-concatenate (type &rest sequences) + "Concatenate SEQUENCES into a single sequence of type TYPE. TYPE must be one of following symbols: vector, string or list. \n(fn TYPE SEQUENCE...)" - (apply #'cl-concatenate type (seq-map #'seq-into-sequence seqs))) + (apply #'cl-concatenate type (seq-map #'seq-into-sequence sequences))) -(cl-defgeneric seq-into-sequence (seq) - "Convert SEQ into a sequence. +(cl-defgeneric seq-into-sequence (sequence) + "Convert SEQUENCE into a sequence. -The default implementation is to signal an error if SEQ is not a +The default implementation is to signal an error if SEQUENCE is not a sequence, specific functions should be implemented for new types -of seq." - (unless (sequencep seq) - (error "Cannot convert %S into a sequence" seq)) - seq) - -(cl-defgeneric seq-into (seq type) - "Convert the sequence SEQ into a sequence of type TYPE. -TYPE can be one of the following symbols: vector, string or list." +of sequence." + (unless (sequencep sequence) + (error "Cannot convert %S into a sequence" sequence)) + sequence) + +(cl-defgeneric seq-into (sequence type) + "Concatenate the elements of SEQUENCE into a sequence of type TYPE. +TYPE can be one of the following symbols: vector, string or +list." (pcase type - (`vector (vconcat seq)) - (`string (concat seq)) - (`list (append seq nil)) + (`vector (vconcat sequence)) + (`string (concat sequence)) + (`list (append sequence nil)) (_ (error "Not a sequence type name: %S" type)))) -(cl-defgeneric seq-filter (pred seq) - "Return a list of all the elements for which (PRED element) is non-nil in SEQ." +(cl-defgeneric seq-filter (pred sequence) + "Return a list of all the elements for which (PRED element) is non-nil in SEQUENCE." (let ((exclude (make-symbol "exclude"))) (delq exclude (seq-map (lambda (elt) (if (funcall pred elt) elt exclude)) - seq)))) + sequence)))) -(cl-defgeneric seq-remove (pred seq) - "Return a list of all the elements for which (PRED element) is nil in SEQ." +(cl-defgeneric seq-remove (pred sequence) + "Return a list of all the elements for which (PRED element) is nil in SEQUENCE." (seq-filter (lambda (elt) (not (funcall pred elt))) - seq)) + sequence)) -(cl-defgeneric seq-reduce (function seq initial-value) - "Reduce the function FUNCTION across SEQ, starting with INITIAL-VALUE. +(cl-defgeneric seq-reduce (function sequence initial-value) + "Reduce the function FUNCTION across SEQUENCE, starting with INITIAL-VALUE. Return the result of calling FUNCTION with INITIAL-VALUE and the -first element of SEQ, then calling FUNCTION with that result and -the second element of SEQ, then with that result and the third -element of SEQ, etc. +first element of SEQUENCE, then calling FUNCTION with that result and +the second element of SEQUENCE, then with that result and the third +element of SEQUENCE, etc. -If SEQ is empty, return INITIAL-VALUE and FUNCTION is not called." - (if (seq-empty-p seq) +If SEQUENCE is empty, return INITIAL-VALUE and FUNCTION is not called." + (if (seq-empty-p sequence) initial-value (let ((acc initial-value)) - (seq-doseq (elt seq) + (seq-doseq (elt sequence) (setq acc (funcall function acc elt))) acc))) -(cl-defgeneric seq-every-p (pred seq) - "Return non-nil if (PRED element) is non-nil for all elements of the sequence SEQ." +(cl-defgeneric seq-every-p (pred sequence) + "Return non-nil if (PRED element) is non-nil for all elements of SEQUENCE." (catch 'seq--break - (seq-doseq (elt seq) + (seq-doseq (elt sequence) (or (funcall pred elt) (throw 'seq--break nil))) t)) -(cl-defgeneric seq-some (pred seq) - "Return the first value for which if (PRED element) is non-nil for in SEQ." +(cl-defgeneric seq-some (pred sequence) + "Return the first value for which if (PRED element) is non-nil for in SEQUENCE." (catch 'seq--break - (seq-doseq (elt seq) + (seq-doseq (elt sequence) (let ((result (funcall pred elt))) (when result (throw 'seq--break result)))) nil)) -(cl-defgeneric seq-find (pred seq &optional default) - "Return the first element for which (PRED element) is non-nil in SEQ. +(cl-defgeneric seq-find (pred sequence &optional default) + "Return the first element for which (PRED element) is non-nil in SEQUENCE. If no element is found, return DEFAULT. Note that `seq-find' has an ambiguity if the found element is identical to DEFAULT, as it cannot be known if an element was found or not." (catch 'seq--break - (seq-doseq (elt seq) + (seq-doseq (elt sequence) (when (funcall pred elt) (throw 'seq--break elt))) default)) -(cl-defgeneric seq-count (pred seq) - "Return the number of elements for which (PRED element) is non-nil in SEQ." +(cl-defgeneric seq-count (pred sequence) + "Return the number of elements for which (PRED element) is non-nil in SEQUENCE." (let ((count 0)) - (seq-doseq (elt seq) + (seq-doseq (elt sequence) (when (funcall pred elt) (setq count (+ 1 count)))) count)) -(cl-defgeneric seq-contains (seq elt &optional testfn) - "Return the first element in SEQ that is equal to ELT. +(cl-defgeneric seq-contains (sequence elt &optional testfn) + "Return the first element in SEQUENCE that is equal to ELT. Equality is defined by TESTFN if non-nil or by `equal' if nil." (seq-some (lambda (e) (funcall (or testfn #'equal) elt e)) - seq)) + sequence)) -(cl-defgeneric seq-position (seq elt &optional testfn) - "Return the index of the first element in SEQ that is equal to ELT. +(cl-defgeneric seq-position (sequence elt &optional testfn) + "Return the index of the first element in SEQUENCE that is equal to ELT. Equality is defined by TESTFN if non-nil or by `equal' if nil." (let ((index 0)) (catch 'seq--break - (seq-doseq (e seq) + (seq-doseq (e sequence) (when (funcall (or testfn #'equal) e elt) (throw 'seq--break index)) (setq index (1+ index))) nil))) -(cl-defgeneric seq-uniq (seq &optional testfn) - "Return a list of the elements of SEQ with duplicates removed. +(cl-defgeneric seq-uniq (sequence &optional testfn) + "Return a list of the elements of SEQUENCE with duplicates removed. TESTFN is used to compare elements, or `equal' if TESTFN is nil." (let ((result '())) - (seq-doseq (elt seq) + (seq-doseq (elt sequence) (unless (seq-contains result elt testfn) (setq result (cons elt result)))) (nreverse result))) -(cl-defgeneric seq-mapcat (function seq &optional type) - "Concatenate the result of applying FUNCTION to each element of SEQ. +(cl-defgeneric seq-mapcat (function sequence &optional type) + "Concatenate the result of applying FUNCTION to each element of SEQUENCE. The result is a sequence of type TYPE, or a list if TYPE is nil." (apply #'seq-concatenate (or type 'list) - (seq-map function seq))) + (seq-map function sequence))) -(cl-defgeneric seq-partition (seq n) - "Return a list of the elements of SEQ grouped into sub-sequences of length N. +(cl-defgeneric seq-partition (sequence n) + "Return a list of the elements of SEQUENCE grouped into sub-sequences of length N. The last sequence may contain less than N elements. If N is a negative integer or 0, nil is returned." (unless (< n 1) (let ((result '())) - (while (not (seq-empty-p seq)) - (push (seq-take seq n) result) - (setq seq (seq-drop seq n))) + (while (not (seq-empty-p sequence)) + (push (seq-take sequence n) result) + (setq sequence (seq-drop sequence n))) (nreverse result)))) -(cl-defgeneric seq-intersection (seq1 seq2 &optional testfn) - "Return a list of the elements that appear in both SEQ1 and SEQ2. +(cl-defgeneric seq-intersection (sequence1 sequence2 &optional testfn) + "Return a list of the elements that appear in both SEQUENCE1 and SEQUENCE2. Equality is defined by TESTFN if non-nil or by `equal' if nil." (seq-reduce (lambda (acc elt) - (if (seq-contains seq2 elt testfn) + (if (seq-contains sequence2 elt testfn) (cons elt acc) acc)) - (seq-reverse seq1) + (seq-reverse sequence1) '())) -(cl-defgeneric seq-difference (seq1 seq2 &optional testfn) - "Return a list of the elements that appear in SEQ1 but not in SEQ2. +(cl-defgeneric seq-difference (sequence1 sequence2 &optional testfn) + "Return a list of the elements that appear in SEQUENCE1 but not in SEQUENCE2. Equality is defined by TESTFN if non-nil or by `equal' if nil." (seq-reduce (lambda (acc elt) - (if (not (seq-contains seq2 elt testfn)) + (if (not (seq-contains sequence2 elt testfn)) (cons elt acc) acc)) - (seq-reverse seq1) + (seq-reverse sequence1) '())) -(cl-defgeneric seq-group-by (function seq) - "Apply FUNCTION to each element of SEQ. -Separate the elements of SEQ into an alist using the results as +(cl-defgeneric seq-group-by (function sequence) + "Apply FUNCTION to each element of SEQUENCE. +Separate the elements of SEQUENCE into an alist using the results as keys. Keys are compared using `equal'." (seq-reduce (lambda (acc elt) @@ -369,25 +374,25 @@ keys. Keys are compared using `equal'." (setcdr cell (push elt (cdr cell))) (push (list key elt) acc)) acc)) - (seq-reverse seq) + (seq-reverse sequence) nil)) -(cl-defgeneric seq-min (seq) - "Return the smallest element of SEQ. -SEQ must be a sequence of numbers or markers." - (apply #'min (seq-into seq 'list))) +(cl-defgeneric seq-min (sequence) + "Return the smallest element of SEQUENCE. +SEQUENCE must be a sequence of numbers or markers." + (apply #'min (seq-into sequence 'list))) -(cl-defgeneric seq-max (seq) - "Return the largest element of SEQ. -SEQ must be a sequence of numbers or markers." - (apply #'max (seq-into seq 'list))) +(cl-defgeneric seq-max (sequence) + "Return the largest element of SEQUENCE. +SEQUENCE must be a sequence of numbers or markers." + (apply #'max (seq-into sequence 'list))) -(defun seq--count-successive (pred seq) - "Return the number of successive elements for which (PRED element) is non-nil in SEQ." +(defun seq--count-successive (pred sequence) + "Return the number of successive elements for which (PRED element) is non-nil in SEQUENCE." (let ((n 0) - (len (seq-length seq))) + (len (seq-length sequence))) (while (and (< n len) - (funcall pred (seq-elt seq n))) + (funcall pred (seq-elt sequence n))) (setq n (+ 1 n))) n)) @@ -419,10 +424,10 @@ SEQ must be a sequence of numbers or markers." args))) ;; TODO: make public? -(defun seq--elt-safe (seq n) - "Return element of SEQ at the index N. +(defun seq--elt-safe (sequence n) + "Return element of SEQUENCE at the index N. If no element is found, return nil." - (ignore-errors (seq-elt seq n))) + (ignore-errors (seq-elt sequence n))) ;;; 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 @@ ,forced (unless ,forced (setf ,val (progn ,@body)) - (setf ,forced t))) - ,val)))) + (setf ,forced t)) + ,val))))) (defun thunk-force (delayed) "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 Several values for a given DIR happen only for `inotify', when different files from the same directory are watched.") -(defun file-notify--rm-descriptor (descriptor) +(defun file-notify--rm-descriptor (descriptor &optional what) "Remove DESCRIPTOR from `file-notify-descriptors'. DESCRIPTOR should be an object returned by `file-notify-add-watch'. -If it is registered in `file-notify-descriptors', a stopped event is sent." +If it is registered in `file-notify-descriptors', a stopped event is sent. +WHAT is a file or directory name to be removed, needed just for `inotify'." (let* ((desc (if (consp descriptor) (car descriptor) descriptor)) (file (if (consp descriptor) (cdr descriptor))) (registered (gethash desc file-notify-descriptors)) (dir (car registered))) - (when (consp registered) + (when (and (consp registered) (or (null what) (string-equal dir what))) ;; Send `stopped' event. (dolist (entry (cdr registered)) - (funcall (cdr entry) - `(,(file-notify--descriptor desc) stopped - ,(or (and (stringp (car entry)) - (expand-file-name (car entry) dir)) - dir)))) + (funcall (cdr entry) + `(,(file-notify--descriptor desc) stopped + ,(or (and (stringp (car entry)) + (expand-file-name (car entry) dir)) + dir)))) ;; Modify `file-notify-descriptors'. (if (not file) - (remhash desc file-notify-descriptors) - (setcdr registered - (delete (assoc file (cdr registered)) (cdr registered))) - (if (null (cdr registered)) - (remhash desc file-notify-descriptors) - (puthash desc registered file-notify-descriptors)))))) + (remhash desc file-notify-descriptors) + (setcdr registered + (delete (assoc file (cdr registered)) (cdr registered))) + (if (null (cdr registered)) + (remhash desc file-notify-descriptors) + (puthash desc registered file-notify-descriptors)))))) ;; This function is used by `gfilenotify', `inotify' and `w32notify' events. ;;;###autoload @@ -85,6 +86,7 @@ If EVENT is a filewatch event, call its callback. It has the format Otherwise, signal a `file-notify-error'." (interactive "e") + ;;(message "file-notify-handle-event %S" event) (if (and (eq (car event) 'file-notify) (>= (length event) 3)) (funcall (nth 2 event) (nth 1 event)) @@ -224,6 +226,7 @@ EVENT is the cadr of the event in `file-notify-handle-event' (setq pending-event nil)) ;; Check for stopped. + ;;(message "file-notify-callback %S %S" file registered) (setq stopped (or @@ -232,7 +235,9 @@ EVENT is the cadr of the event in `file-notify-handle-event' (memq action '(deleted renamed)) (= (length (cdr registered)) 1) (string-equal - (or (file-name-nondirectory file) "") (car (cadr registered)))))) + (file-name-nondirectory file) + (or (file-name-nondirectory (car registered)) + (car (cadr registered))))))) ;; Apply callback. (when (and action @@ -257,7 +262,7 @@ EVENT is the cadr of the event in `file-notify-handle-event' ;; Modify `file-notify-descriptors'. (when stopped - (file-notify--rm-descriptor (file-notify--descriptor desc)))))) + (file-notify--rm-descriptor (file-notify--descriptor desc) file))))) ;; `gfilenotify' and `w32notify' return a unique descriptor for every ;; `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." (setq desc (funcall handler 'file-notify-add-watch dir flags callback)) - ;; Check, whether Emacs has been compiled with file - ;; notification support. + ;; Check, whether Emacs has been compiled with file notification + ;; support. (unless file-notify--library (signal 'file-notify-error '("No file notification package available"))) @@ -344,7 +349,8 @@ FILE is the name of the file whose event is being reported." (setq l-flags (cond - ((eq file-notify--library 'inotify) '(create modify move delete)) + ((eq file-notify--library 'inotify) + '(create delete delete-self modify move-self move)) ((eq file-notify--library 'w32notify) '(file-name directory-name size last-write-time))))) (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." (all-entries entries) (point-max (point-max)) (unread 0) - (topic (car type)) info entry end active tick) ;; Insert any sub-topics. (while topicl @@ -586,7 +585,7 @@ articles in the topic and its subtopics." (goto-char end) unread)) -(defun gnus-topic-remove-topic (&optional insert total-remove hide in-level) +(defun gnus-topic-remove-topic (&optional insert total-remove _hide in-level) "Remove the current topic." (let ((topic (gnus-group-topic-name)) (level (gnus-group-topic-level)) @@ -631,6 +630,8 @@ articles in the topic and its subtopics." (or insert (not (gnus-topic-visible-p))) nil nil 9) (gnus-topic-enter-dribble))))))) +(defvar gnus-tmp-header) + (defun gnus-topic-insert-topic-line (name visiblep shownp level entries &optional unread) (let* ((visible (if visiblep "" "...")) @@ -694,8 +695,7 @@ articles in the topic and its subtopics." (let* ((topic (gnus-group-topic group)) (groups (cdr (assoc topic gnus-topic-alist))) (g (cdr (member group groups))) - (unfound t) - entry) + (unfound t)) ;; Try to jump to a visible group. (while (and g (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." (funcall (if unmark 'gnus-group-remove-mark 'gnus-group-set-mark) (gnus-info-group (nth 2 (pop groups))))))))) -(defun gnus-topic-unmark-topic (topic &optional dummy non-recursive) +(defun gnus-topic-unmark-topic (topic &optional _dummy non-recursive) "Remove the process mark from all groups in the TOPIC. If NON-RECURSIVE (which is the prefix) is t, don't unmark its subtopics." (interactive (list (gnus-group-topic-name) @@ -1488,15 +1488,14 @@ If NON-RECURSIVE (which is the prefix) is t, don't unmark its subtopics." (gnus-group-mark-regexp regexp) (gnus-topic-move-group nil topic copyp)) -(defun gnus-topic-copy-matching (regexp topic &optional copyp) +(defun gnus-topic-copy-matching (regexp topic &optional _copyp) "Copy all groups that match REGEXP to some topic." (interactive - (let (topic) + (let ((topic (gnus-completing-read "Copy to topic" + (mapcar #'car gnus-topic-alist) t))) (nreverse - (list - (setq topic (gnus-completing-read "Copy to topic" - (mapcar 'car gnus-topic-alist) t)) - (read-string (format "Copy to %s (regexp): " topic)))))) + (list topic + (read-string (format "Copy to %s (regexp): " topic)))))) (gnus-topic-move-matching regexp topic t)) (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 ...)\"." (if (string-match "\n?\n\\'" docstring) (if (< (- (match-end 0) (match-beginning 0)) 2) "\n" "") "\n\n") - (if (and (stringp arglist) - (string-match "\\`([^ ]+\\(.*\\))\\'" arglist)) - (concat "(fn" (match-string 1 arglist) ")") + (if (stringp arglist) + (if (string-match "\\`[^ ]+\\(.*\\))\\'" arglist) + (concat "(fn" (match-string 1 arglist) ")") + (error "Unrecognized usage format")) (help--make-usage-docstring 'fn arglist))))) (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 @@ -;;; ccl.el --- CCL (Code Conversion Language) compiler +;;; ccl.el --- CCL (Code Conversion Language) compiler -*- lexical-binding:t -*- ;; Copyright (C) 1997-1998, 2001-2015 Free Software Foundation, Inc. ;; 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 (let ((condition (nth 1 cmd)) (true-cmds (nth 2 cmd)) (false-cmds (nth 3 cmd)) - jump-cond-address - false-ic) + jump-cond-address) (if (and (listp condition) (listp (car condition))) ;; If CONDITION is a nested expression, the inner expression @@ -678,8 +677,7 @@ is a list of CCL-BLOCKs." (ccl-embed-code 'write-const-jump 0 ccl-loop-head) (ccl-embed-data arg)) ((stringp arg) - (let ((len (length arg)) - (i 0)) + (let ((len (length arg))) (ccl-embed-code 'write-string-jump 0 ccl-loop-head) (ccl-embed-data len) (ccl-embed-string len arg))) @@ -920,8 +918,7 @@ is a list of CCL-BLOCKs." (error "CCL: Invalid number of arguments: %s" cmd)) (let ((RRR (nth 1 cmd)) (rrr (nth 2 cmd)) - (map (nth 3 cmd)) - id) + (map (nth 3 cmd))) (ccl-check-register rrr cmd) (ccl-check-register RRR cmd) (ccl-embed-extended-command 'map-single rrr RRR 0) @@ -962,10 +959,11 @@ is a list of CCL-BLOCKs." (defvar ccl-code) ;;;###autoload -(defun ccl-dump (ccl-code) - "Disassemble compiled CCL-CODE." - (let ((len (length ccl-code)) - (buffer-mag (aref ccl-code 0))) +(defun ccl-dump (code) + "Disassemble compiled CCL-code CODE." + (let* ((ccl-code code) + (len (length ccl-code)) + (buffer-mag (aref ccl-code 0))) (cond ((= buffer-mag 0) (insert (substitute-command-keys "Don't output anything.\n"))) ((= buffer-mag 1) @@ -1005,7 +1003,7 @@ is a list of CCL-BLOCKs." (defun ccl-dump-set-short-const (rrr cc) (insert (format "r%d = %d\n" rrr cc))) -(defun ccl-dump-set-const (rrr ignore) +(defun ccl-dump-set-const (rrr _ignore) (insert (format "r%d = %d\n" rrr (ccl-get-next-code)))) (defun ccl-dump-set-array (rrr cc) @@ -1019,7 +1017,7 @@ is a list of CCL-BLOCKs." (setq i (1+ i))) (insert "\n"))) -(defun ccl-dump-jump (ignore cc &optional address) +(defun ccl-dump-jump (_ignore cc &optional address) (insert (format "jump to %d(" (+ (or address ccl-current-ic) cc))) (if (>= cc 0) (insert "+")) @@ -1042,13 +1040,13 @@ is a list of CCL-BLOCKs." (defun ccl-extract-arith-op (cc) (aref ccl-arith-table (ash cc -6))) -(defun ccl-dump-write-expr-const (ignore cc) +(defun ccl-dump-write-expr-const (_ignore cc) (insert (format "write (r%d %s %d)\n" (logand cc 7) (ccl-extract-arith-op cc) (ccl-get-next-code)))) -(defun ccl-dump-write-expr-register (ignore cc) +(defun ccl-dump-write-expr-register (_ignore cc) (insert (format "write (r%d %s r%d)\n" (logand cc 7) (ccl-extract-arith-op cc) @@ -1059,7 +1057,7 @@ is a list of CCL-BLOCKs." ((= cc ?\n) (insert " \"^J\"")) (t (insert (format " \"%c\"" cc))))) -(defun ccl-dump-write-const-jump (ignore cc) +(defun ccl-dump-write-const-jump (_ignore cc) (let ((address ccl-current-ic)) (insert "write char") (ccl-dump-insert-char (ccl-get-next-code)) @@ -1075,7 +1073,7 @@ is a list of CCL-BLOCKs." (ccl-get-next-code) ; Skip dummy READ-JUMP )) -(defun ccl-dump-write-string-jump (ignore cc) +(defun ccl-dump-write-string-jump (_ignore cc) (let ((address ccl-current-ic) (len (ccl-get-next-code)) (i 0)) @@ -1125,7 +1123,7 @@ is a list of CCL-BLOCKs." (defun ccl-dump-write-register (rrr cc) (insert (format "write r%d (%d remaining)\n" rrr cc))) -(defun ccl-dump-call (ignore cc) +(defun ccl-dump-call (_ignore _cc) (let ((subroutine (car (ccl-get-next-code)))) (insert (format-message "call subroutine `%s'\n" subroutine)))) @@ -1160,7 +1158,7 @@ is a list of CCL-BLOCKs." (setq i (1+ i))) (insert "\n"))) -(defun ccl-dump-end (&rest ignore) +(defun ccl-dump-end (&rest _ignore) (insert "end\n")) (defun ccl-dump-set-assign-expr-const (rrr cc) @@ -1213,9 +1211,10 @@ is a list of CCL-BLOCKs." (insert (format "read r%d, " rrr)) (ccl-dump-jump-cond-expr-register rrr cc)) -(defun ccl-dump-binary (ccl-code) - (let ((len (length ccl-code)) - (i 2)) +(defun ccl-dump-binary (code) + (let* ((ccl-code code) + (len (length ccl-code)) + (i 2)) (while (< i len) (let ((code (aref ccl-code i)) (j 27)) @@ -1235,28 +1234,28 @@ is a list of CCL-BLOCKs." (insert (format "<%s> " ex-op)) (funcall (get ex-op 'ccl-dump-function) rrr RRR Rrr))) -(defun ccl-dump-read-multibyte-character (rrr RRR Rrr) +(defun ccl-dump-read-multibyte-character (rrr RRR _Rrr) (insert (format "read-multibyte-character r%d r%d\n" RRR rrr))) -(defun ccl-dump-write-multibyte-character (rrr RRR Rrr) +(defun ccl-dump-write-multibyte-character (rrr RRR _Rrr) (insert (format "write-multibyte-character r%d r%d\n" RRR rrr))) (defun ccl-dump-translate-character (rrr RRR Rrr) (insert (format "translation table(r%d) r%d r%d\n" Rrr RRR rrr))) -(defun ccl-dump-translate-character-const-tbl (rrr RRR Rrr) +(defun ccl-dump-translate-character-const-tbl (rrr RRR _Rrr) (let ((tbl (ccl-get-next-code))) (insert (format "translation table(%S) r%d r%d\n" tbl RRR rrr)))) -(defun ccl-dump-lookup-int-const-tbl (rrr RRR Rrr) +(defun ccl-dump-lookup-int-const-tbl (rrr RRR _Rrr) (let ((tbl (ccl-get-next-code))) (insert (format "hash table(%S) r%d r%d\n" tbl RRR rrr)))) -(defun ccl-dump-lookup-char-const-tbl (rrr RRR Rrr) +(defun ccl-dump-lookup-char-const-tbl (rrr RRR _Rrr) (let ((tbl (ccl-get-next-code))) (insert (format "hash table(%S) r%d r%d\n" tbl RRR rrr)))) -(defun ccl-dump-iterate-multiple-map (rrr RRR Rrr) +(defun ccl-dump-iterate-multiple-map (rrr RRR _Rrr) (let ((notbl (ccl-get-next-code)) (i 0) id) (insert (format "iterate-multiple-map r%d r%d\n" RRR rrr)) @@ -1267,7 +1266,7 @@ is a list of CCL-BLOCKs." (setq i (1+ i))) (insert "]\n"))) -(defun ccl-dump-map-multiple (rrr RRR Rrr) +(defun ccl-dump-map-multiple (rrr RRR _Rrr) (let ((notbl (ccl-get-next-code)) (i 0) id) (insert (format "map-multiple r%d r%d\n" RRR rrr)) @@ -1280,7 +1279,7 @@ is a list of CCL-BLOCKs." (setq i (1+ i))) (insert "]\n"))) -(defun ccl-dump-map-single (rrr RRR Rrr) +(defun ccl-dump-map-single (rrr RRR _Rrr) (let ((id (ccl-get-next-code))) (insert (format "map-single r%d r%d map(%S)\n" RRR rrr id)))) 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'." (cond ((eq json-object-type 'hash-table) (make-hash-table :test 'equal)) (t - (list)))) + ()))) (defun json-add-to-object (object key value) "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." (setq start (point) title (plist-get bookmark :title)) (when (> (length title) width) - (setq title (substring title 0 width))) + (setq title (truncate-string-to-width title width))) (insert (format format title (plist-get bookmark :url)) "\n") (put-text-property start (1+ start) 'eww-bookmark bookmark)) (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." (directory &optional full match nosort) "Like `directory-files' for Tramp files." (let ((result (mapcar 'directory-file-name - (file-name-all-completions "" directory))) - res) + (file-name-all-completions "" directory)))) ;; Discriminate with regexp. (when match (setq result @@ -665,9 +664,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." result))) ;; Sort them if necessary. (unless nosort (setq result (sort result 'string-lessp))) - ;; Remove double entries. - (dolist (elt result res) - (add-to-list 'res elt 'append)))) + (delete-dups result))) (defun tramp-smb-handle-expand-file-name (name &optional dir) "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." 'tramp-delete-temp-file-function))) ;;; Auto saving to a special directory: +(defvar auto-save-file-name-transforms) (defun tramp-handle-make-auto-save-file-name () "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 :-(." 'up-to-date 'edited))))))))) +;; dir-status-files called from vc-dir, which loads vc, +;; which loads vc-dispatcher. +(declare-function vc-exec-after "vc-dispatcher" (code)) + (defun vc-arch-dir-status-files (dir _files callback) "Run `tla inventory' for DIR and pass results to CALLBACK. 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." "A `prettify-symbols-alist' usable for (La)TeX modes.") (defun tex--prettify-symbols-compose-p (_start end _match) - (let* ((after-char (char-after end)) - (after-syntax (char-syntax after-char))) - (not (or - ;; Don't compose \alpha@foo. - (eq after-char ?@) - ;; The \alpha in \alpha2 or \alpha-\beta may be composed but - ;; of course \alphax may not. - (and (eq after-syntax ?w) - (not (memq after-char - '(?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9 ?+ ?- ?' ?\")))) - ;; Don't compose inside verbatim blocks. - (eq 2 (nth 7 (syntax-ppss))))))) + (or + ;; If the matched symbol doesn't end in a word character, then we + ;; simply allow composition. The symbol is probably something like + ;; \|, \(, etc. + (not (eq ?w (char-syntax (char-before end)))) + ;; Else we look at what follows the match in order to decide. + (let* ((after-char (char-after end)) + (after-syntax (char-syntax after-char))) + (not (or + ;; Don't compose \alpha@foo. + (eq after-char ?@) + ;; The \alpha in \alpha2 or \alpha-\beta may be composed but + ;; of course \alphax may not. + (and (eq after-syntax ?w) + (not (memq after-char + '(?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9 ?+ ?- ?' ?\")))) + ;; Don't compose inside verbatim blocks. + (eq 2 (nth 7 (syntax-ppss)))))))) (run-hooks 'tex-mode-load-hook) 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." "Value of `compilation-error-regexp-alist' in *vc-bzr* buffers.") ;; To be called via vc-pull from vc.el, which requires vc-dispatcher. +(declare-function vc-exec-after "vc-dispatcher" (code)) (declare-function vc-set-async-update "vc-dispatcher" (process-buffer)) (declare-function vc-compilation-mode "vc-dispatcher" (backend)) 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." ;;; (declare-function vc-rcs-print-log-cleanup "vc-rcs" ()) +;; Follows vc-cvs-command, which uses vc-do-command from vc-dispatcher. +(declare-function vc-exec-after "vc-dispatcher" (code)) (defun vc-cvs-print-log (files buffer &optional _shortlog _start-revision limit) "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." ;; Follows vc-git-command (or vc-do-async-command), which uses vc-do-command ;; from vc-dispatcher. +(declare-function vc-exec-after "vc-dispatcher" (code)) +;; Follows vc-exec-after. (declare-function vc-set-async-update "vc-dispatcher" (process-buffer)) (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." (defvar vc-hg-log-graph nil "If non-nil, use `--graph' in the short log output.") +(defvar vc-hg-log-format (concat "changeset: {rev}:{node|short}\n" + "{tags % 'tag: {tag}\n'}" + "{if(parents, 'parents: {parents}\n')}" + "user: {author}\n" + "Date: {date|date}\n" + "summary: {desc|tabindent}\n\n") + "Mercurial log template for `vc-hg-print-log' long format.") + (defun vc-hg-print-log (files buffer &optional shortlog start-revision limit) "Print commit log associated with FILES into specified BUFFER. 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." (nconc (when start-revision (list (format "-r%s:0" start-revision))) (when limit (list "-l" (format "%s" limit))) - (when shortlog `(,@(if vc-hg-log-graph '("--graph")) - "--template" - ,(car vc-hg-root-log-format))) + (if shortlog + `(,@(if vc-hg-log-graph '("--graph")) + "--template" + ,(car vc-hg-root-log-format)) + `("--template" ,vc-hg-log-format)) vc-hg-log-switches))))) (defvar log-view-message-re) @@ -295,6 +305,7 @@ If LIMIT is non-nil, show no more than this many entries." (if (eq vc-log-view-type 'short) (cadr vc-hg-root-log-format) "^changeset:[ \t]*\\([0-9]+\\):\\(.+\\)")) + (set (make-local-variable 'tab-width) 2) ;; Allow expanding short log entries (when (eq vc-log-view-type 'short) (setq truncate-lines t) @@ -345,7 +356,7 @@ If LIMIT is non-nil, show no more than this many entries." (defun vc-hg-expanded-log-entry (revision) (with-temp-buffer - (vc-hg-command t nil nil "log" "-r" revision) + (vc-hg-command t nil nil "log" "-r" revision "--template" vc-hg-log-format) (goto-char (point-min)) (unless (eobp) ;; Indent the expanded log entry. @@ -620,6 +631,8 @@ REV is the revision to check out into WORKFILE." ;; Follows vc-hg-command (or vc-do-async-command), which uses vc-do-command ;; from vc-dispatcher. +(declare-function vc-exec-after "vc-dispatcher" (code)) +;; Follows vc-exec-after. (declare-function vc-set-async-update "vc-dispatcher" (process-buffer)) (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." ((match-end 2) (push (list (match-string 3) 'added) result)))) (funcall update-function result))) +;; dir-status-files called from vc-dir, which loads vc, +;; which loads vc-dispatcher. +(declare-function vc-exec-after "vc-dispatcher" (code)) + (defun vc-mtn-dir-status-files (dir _files update-function) (vc-mtn-command (current-buffer) 'async dir "status") (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." (setq result (cons (list filename state) result))))) (funcall callback result))) +;; dir-status-files called from vc-dir, which loads vc, +;; which loads vc-dispatcher. +(declare-function vc-exec-after "vc-dispatcher" (code)) + (autoload 'vc-expand-dirs "vc") (defun vc-svn-dir-status-files (_dir files callback) |