From ff16c897eadab9bebc58bd0ca0fb5c8e1c237a15 Mon Sep 17 00:00:00 2001 From: Protesilaos Stavrou Date: Tue, 9 Feb 2021 06:49:05 +0200 Subject: Refine use of vc-dir faces; apply to all backends * lisp/vc/vc-dir.el (vc-default-dir-printer): Add check for the "ignored" status and make 'vc-dir-status-edited' the default face. Also extend condition for more states that qualify as "warnings". (vc-dir-ignored, vc-dir-status-ignored): Rename face for consistency. * lisp/vc/vc-git.el (vc-git-dir-printer): Use the 'vc-dir-status-edited' as the default for the Git backend. And reference the renamed face. Also stop treating the empty stash differently from other header values. * lisp/vc/vc-bzr.el (vc-bzr-dir-extra-headers): Implement new faces. * lisp/vc/vc-cvs.el (vc-cvs-dir-extra-headers): Same. * lisp/vc/vc-hg.el (vc-hg-dir-extra-headers): Same. * lisp/vc/vc-svn.el (vc-svn-dir-extra-headers): Same. This follows from the discussion in bug#46358. --- lisp/vc/vc-hg.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp/vc/vc-hg.el') diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 1d163a64ab2..adb0fce8759 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -1403,8 +1403,8 @@ This runs the command \"hg summary\"." (cons (capitalize (match-string 1)) (match-string 2)) (cons "" (buffer-substring (point) (line-end-position)))))) (concat - (propertize (format "%-11s: " (car entry)) 'face 'font-lock-type-face) - (propertize (cdr entry) 'face 'font-lock-variable-name-face))) + (propertize (format "%-11s: " (car entry)) 'face 'vc-dir-header) + (propertize (cdr entry) 'face 'vc-dir-header-value))) result) (forward-line)) (nreverse result)) -- cgit v1.2.3 From 99340ad17a826c61895b3e1ed6928b36fbfeac60 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 26 Feb 2021 16:51:15 -0500 Subject: lisp/vc/*.el: Use lexical-bindings in all the files Also remove some redundant `:group` arguments. * lisp/vc/vc.el (vc-ignore): Autoload. * lisp/vc/pcvs-util.el (cvs-every, cvs-union, cvs-map): Delete functions. * lisp/vc/cvs-status.el: Require `cl-lib` at runtime. (cvs-tree-tags-insert): Use `cl-mapcar` and `cl-every` instead. * lisp/vc/pcvs.el: Require `cl-lib` at runtime. (cvs-do-removal): Use `cl-every` instead. * lisp/vc/ediff-init.el: Require `ediff-util` (for `ediff-cleanup-mess` and `ediff-default-suspend-function`). * lisp/vc/pcvs-info.el (cvs-fileinfo<): Remove unused vars `subtypea` and `subtypeb`. * lisp/vc/vc-git.el: * lisp/vc/vc-bzr.el: Require `vc-dispatcher` at runtime for `vc-do-async-command`. --- lisp/vc/add-log.el | 83 ++++++++++---------------- lisp/vc/compare-w.el | 26 +++------ lisp/vc/cvs-status.el | 16 ++--- lisp/vc/diff-mode.el | 12 ++-- lisp/vc/diff.el | 12 ++-- lisp/vc/ediff-diff.el | 2 +- lisp/vc/ediff-help.el | 2 +- lisp/vc/ediff-init.el | 8 ++- lisp/vc/ediff-merg.el | 2 +- lisp/vc/ediff-mult.el | 49 ++++++++-------- lisp/vc/ediff-util.el | 148 +++++++++++++++++++++++------------------------ lisp/vc/ediff-wind.el | 6 +- lisp/vc/ediff.el | 52 ++++++++--------- lisp/vc/emerge.el | 69 ++++++++-------------- lisp/vc/pcvs-defs.el | 19 +----- lisp/vc/pcvs-info.el | 6 +- lisp/vc/pcvs-parse.el | 2 +- lisp/vc/pcvs-util.el | 30 ++-------- lisp/vc/pcvs.el | 14 ++--- lisp/vc/vc-annotate.el | 24 ++++---- lisp/vc/vc-bzr.el | 73 +++++++++++------------ lisp/vc/vc-cvs.el | 49 +++++++--------- lisp/vc/vc-dav.el | 22 +++---- lisp/vc/vc-dir.el | 124 +++++++++++++++++++-------------------- lisp/vc/vc-dispatcher.el | 12 ++-- lisp/vc/vc-filewise.el | 2 +- lisp/vc/vc-git.el | 63 ++++++++++---------- lisp/vc/vc-hg.el | 55 ++++++++---------- lisp/vc/vc-hooks.el | 72 ++++++++++------------- lisp/vc/vc-mtn.el | 20 +++---- lisp/vc/vc-rcs.el | 28 ++++----- lisp/vc/vc-sccs.el | 36 +++++------- lisp/vc/vc-src.el | 21 +++---- lisp/vc/vc-svn.el | 78 ++++++++++++------------- lisp/vc/vc.el | 1 + 35 files changed, 549 insertions(+), 689 deletions(-) (limited to 'lisp/vc/vc-hg.el') diff --git a/lisp/vc/add-log.el b/lisp/vc/add-log.el index 19765e0da34..fafd7f9c467 100644 --- a/lisp/vc/add-log.el +++ b/lisp/vc/add-log.el @@ -1,4 +1,4 @@ -;;; add-log.el --- change log maintenance commands for Emacs +;;; add-log.el --- change log maintenance commands for Emacs -*- lexical-binding: t; -*- ;; Copyright (C) 1985-1986, 1988, 1993-1994, 1997-1998, 2000-2021 Free ;; Software Foundation, Inc. @@ -49,15 +49,13 @@ (defcustom change-log-default-name nil "Name of a change log file for \\[add-change-log-entry]." :type '(choice (const :tag "default" nil) - string) - :group 'change-log) + string)) ;;;###autoload -(put 'change-log-default-name 'safe-local-variable 'string-or-null-p) +(put 'change-log-default-name 'safe-local-variable #'string-or-null-p) (defcustom change-log-mode-hook nil "Normal hook run by `change-log-mode'." - :type 'hook - :group 'change-log) + :type 'hook) ;; Many modes set this variable, so avoid warnings. ;;;###autoload @@ -66,16 +64,14 @@ It is called by `add-log-current-defun' with no argument, and should return the function's name as a string, or nil if point is outside a function." - :type '(choice (const nil) function) - :group 'change-log) + :type '(choice (const nil) function)) ;;;###autoload (defcustom add-log-full-name nil "Full name of user, for inclusion in ChangeLog daily headers. This defaults to the value returned by the function `user-full-name'." :type '(choice (const :tag "Default" nil) - string) - :group 'change-log) + string)) ;;;###autoload (defcustom add-log-mailing-address nil @@ -86,8 +82,7 @@ will be recognized as referring to the same user; when creating a new ChangeLog entry, one element will be chosen at random." :type '(choice (const :tag "Default" nil) (string :tag "String") - (repeat :tag "List of Strings" string)) - :group 'change-log) + (repeat :tag "List of Strings" string))) (defcustom add-log-time-format 'add-log-iso8601-time-string "Function that defines the time format. @@ -98,8 +93,7 @@ and `current-time-string' are two valid values." add-log-iso8601-time-string) (const :tag "Old format, as returned by `current-time-string'" current-time-string) - (function :tag "Other")) - :group 'change-log) + (function :tag "Other"))) (defcustom add-log-keep-changes-together nil "If non-nil, normally keep day's log entries for one file together. @@ -130,14 +124,12 @@ and in the former: The NEW-ENTRY arg to `add-change-log-entry' can override the effect of this variable." :version "20.3" - :type 'boolean - :group 'change-log) + :type 'boolean) (defcustom add-log-always-start-new-record nil "If non-nil, `add-change-log-entry' will always start a new record." :version "22.1" - :type 'boolean - :group 'change-log) + :type 'boolean) (defvar add-log-buffer-file-name-function 'buffer-file-name "If non-nil, function to call to identify the full filename of a buffer. @@ -149,15 +141,13 @@ use `buffer-file-name'.") This function is called with one argument, the value of variable `buffer-file-name' in that buffer. If this is nil, the default is to use the file's name relative to the directory of the change log file." - :type '(choice (const nil) function) - :group 'change-log) + :type '(choice (const nil) function)) (defcustom change-log-version-info-enabled nil "If non-nil, enable recording version numbers with the changes." :version "21.1" - :type 'boolean - :group 'change-log) + :type 'boolean) (defcustom change-log-version-number-regexp-list (let ((re "\\([0-9]+\\.[0-9.]+\\)")) @@ -170,64 +160,54 @@ use the file's name relative to the directory of the change log file." The version number must be in group 1. Note: The search is conducted only within 10%, at the beginning of the file." :version "21.1" - :type '(repeat regexp) - :group 'change-log) + :type '(repeat regexp)) (defcustom change-log-directory-files '(".bzr" ".git" ".hg" ".svn") "List of files that cause `find-change-log' to stop in containing directory. This applies if no pre-existing ChangeLog is found. If nil, then in such a case simply use the directory containing the changed file." :version "26.1" - :type '(repeat file) - :group 'change-log) + :type '(repeat file)) (defface change-log-date '((t (:inherit font-lock-string-face))) "Face used to highlight dates in date lines." - :version "21.1" - :group 'change-log) + :version "21.1") (defface change-log-name '((t (:inherit font-lock-constant-face))) "Face for highlighting author names." - :version "21.1" - :group 'change-log) + :version "21.1") (defface change-log-email '((t (:inherit font-lock-variable-name-face))) "Face for highlighting author email addresses." - :version "21.1" - :group 'change-log) + :version "21.1") (defface change-log-file '((t (:inherit font-lock-function-name-face))) "Face for highlighting file names." - :version "21.1" - :group 'change-log) + :version "21.1") (defface change-log-list '((t (:inherit font-lock-keyword-face))) "Face for highlighting parenthesized lists of functions or variables." - :version "21.1" - :group 'change-log) + :version "21.1") (defface change-log-conditionals '((t (:inherit font-lock-variable-name-face))) "Face for highlighting conditionals of the form `[...]'." - :version "21.1" - :group 'change-log) + :version "21.1") (defface change-log-function '((t (:inherit font-lock-variable-name-face))) "Face for highlighting items of the form `<....>'." - :version "21.1" - :group 'change-log) + :version "21.1") (defface change-log-acknowledgment '((t (:inherit font-lock-comment-face))) "Face for highlighting acknowledgments." - :version "21.1" - :group 'change-log) + :version "21.1") (define-obsolete-face-alias 'change-log-acknowledgement 'change-log-acknowledgment "24.3") @@ -519,7 +499,7 @@ try to visit the file for the change under `point' instead." change-log-find-tail) (setq change-log-find-tail (condition-case nil - (apply 'change-log-goto-source-1 + (apply #'change-log-goto-source-1 (append change-log-find-head change-log-find-tail)) (error (format-message @@ -556,7 +536,7 @@ try to visit the file for the change under `point' instead." file (find-file-noselect file))) (condition-case nil (setq change-log-find-tail - (apply 'change-log-goto-source-1 change-log-find-head)) + (apply #'change-log-goto-source-1 change-log-find-head)) (error (format-message "Cannot find matches for tag `%s' in file `%s'" tag file))))))))) @@ -569,7 +549,7 @@ Compatibility function for \\[next-error] invocations." (count (abs argp)) ; how many cycles (down (< argp 0)) ; are we going down? (is argp negative?) (up (not down)) - (search-function (if up 're-search-forward 're-search-backward))) + (search-function (if up #'re-search-forward #'re-search-backward))) ;; set the starting position (goto-char (cond (reset (point-min)) @@ -591,10 +571,10 @@ Compatibility function for \\[next-error] invocations." (defvar change-log-mode-map (let ((map (make-sparse-keymap)) (menu-map (make-sparse-keymap))) - (define-key map [?\C-c ?\C-p] 'add-log-edit-prev-comment) - (define-key map [?\C-c ?\C-n] 'add-log-edit-next-comment) - (define-key map [?\C-c ?\C-f] 'change-log-find-file) - (define-key map [?\C-c ?\C-c] 'change-log-goto-source) + (define-key map [?\C-c ?\C-p] #'add-log-edit-prev-comment) + (define-key map [?\C-c ?\C-n] #'add-log-edit-next-comment) + (define-key map [?\C-c ?\C-f] #'change-log-find-file) + (define-key map [?\C-c ?\C-c] #'change-log-goto-source) (define-key map [menu-bar changelog] (cons "ChangeLog" menu-map)) (define-key menu-map [gs] '(menu-item "Go To Source" change-log-goto-source @@ -814,7 +794,7 @@ means to put log entries in a suitably named buffer." :type 'boolean :version "27.1") -(put 'add-log-dont-create-changelog-file 'safe-local-variable 'booleanp) +(put 'add-log-dont-create-changelog-file 'safe-local-variable #'booleanp) (defun add-log--pseudo-changelog-buffer-name (changelog-file-name) "Compute a suitable name for a non-file visiting ChangeLog buffer. @@ -1220,8 +1200,7 @@ file were isearch was started." "Heuristic regexp used by `add-log-current-defun' for unknown major modes. The regexp's first submatch is placed in the ChangeLog entry, in parentheses." - :type 'regexp - :group 'change-log) + :type 'regexp) (declare-function c-cpp-define-name "cc-cmds" ()) (declare-function c-defun-name "cc-cmds" ()) diff --git a/lisp/vc/compare-w.el b/lisp/vc/compare-w.el index 932dcd78920..4c1d9eaad55 100644 --- a/lisp/vc/compare-w.el +++ b/lisp/vc/compare-w.el @@ -1,4 +1,4 @@ -;;; compare-w.el --- compare text between windows for Emacs +;;; compare-w.el --- compare text between windows for Emacs -*- lexical-binding: t; -*- ;; Copyright (C) 1986, 1989, 1993, 1997, 2001-2021 Free Software ;; Foundation, Inc. @@ -52,19 +52,16 @@ any text before that point. If the function returns the same value for both windows, then the whitespace is considered to match, and is skipped." :version "24.4" ; added \240 - :type '(choice regexp function) - :group 'compare-windows) + :type '(choice regexp function)) (defcustom compare-ignore-whitespace nil "Non-nil means command `compare-windows' ignores whitespace." :type 'boolean - :group 'compare-windows :version "22.1") (defcustom compare-ignore-case nil "Non-nil means command `compare-windows' ignores case differences." - :type 'boolean - :group 'compare-windows) + :type 'boolean) (defcustom compare-windows-sync 'compare-windows-sync-default-function "Function or regexp that is used to synchronize points in two @@ -92,7 +89,6 @@ If the value of this variable is nil (option \"No sync\"), then no synchronization is performed, and the function `ding' is called to beep or flash the screen when points are mismatched." :type '(choice function regexp (const :tag "No sync" nil)) - :group 'compare-windows :version "22.1") (defcustom compare-windows-sync-string-size 32 @@ -104,7 +100,6 @@ difference regions more coarse-grained. The default value 32 is good for the most cases." :type 'integer - :group 'compare-windows :version "22.1") (defcustom compare-windows-recenter nil @@ -115,7 +110,6 @@ matching points side-by-side. The value `(-1 0)' is useful if windows are split vertically, and the value `((4) (4))' for horizontally split windows." :type '(list sexp sexp) - :group 'compare-windows :version "22.1") (defcustom compare-windows-highlight t @@ -127,19 +121,16 @@ out all highlighting later with the command `compare-windows-dehighlight'." :type '(choice (const :tag "No highlighting" nil) (const :tag "Persistent highlighting" persistent) (other :tag "Highlight until next command" t)) - :group 'compare-windows :version "22.1") (defface compare-windows-removed '((t :inherit diff-removed)) "Face for highlighting `compare-windows' differing regions in the other window." - :group 'compare-windows :version "25.1") (defface compare-windows-added '((t :inherit diff-added)) "Face for highlighting `compare-windows' differing regions in current window." - :group 'compare-windows :version "25.1") (define-obsolete-face-alias 'compare-windows 'compare-windows-added "25.1") @@ -159,7 +150,6 @@ out all highlighting later with the command `compare-windows-dehighlight'." (function-item :tag "Next window" compare-windows-get-next-window) (function :tag "Your function")) - :group 'compare-windows :version "25.1") (defun compare-windows-get-recent-window () @@ -389,7 +379,7 @@ on third call it again advances points to the next difference and so on." (setq p1 (1+ p1))))) (when p12s ;; use closest matching points (i.e. points with minimal sum) - (setq p12 (cdr (assq (apply 'min (mapcar 'car p12s)) p12s))) + (setq p12 (cdr (assq (apply #'min (mapcar #'car p12s)) p12s))) (goto-char (car p12)) (compare-windows-highlight op1 (car p12) (current-buffer) w1 op2 (cadr p12) b2 w2)) @@ -416,7 +406,7 @@ on third call it again advances points to the next difference and so on." (overlay-put compare-windows-overlay2 'window w2) (if (not (eq compare-windows-highlight 'persistent)) ;; Remove highlighting before next command is executed - (add-hook 'pre-command-hook 'compare-windows-dehighlight) + (add-hook 'pre-command-hook #'compare-windows-dehighlight) (when compare-windows-overlay1 (push (copy-overlay compare-windows-overlay1) compare-windows-overlays1) (delete-overlay compare-windows-overlay1)) @@ -427,9 +417,9 @@ on third call it again advances points to the next difference and so on." (defun compare-windows-dehighlight () "Remove highlighting created by function `compare-windows-highlight'." (interactive) - (remove-hook 'pre-command-hook 'compare-windows-dehighlight) - (mapc 'delete-overlay compare-windows-overlays1) - (mapc 'delete-overlay compare-windows-overlays2) + (remove-hook 'pre-command-hook #'compare-windows-dehighlight) + (mapc #'delete-overlay compare-windows-overlays1) + (mapc #'delete-overlay compare-windows-overlays2) (and compare-windows-overlay1 (delete-overlay compare-windows-overlay1)) (and compare-windows-overlay2 (delete-overlay compare-windows-overlay2))) diff --git a/lisp/vc/cvs-status.el b/lisp/vc/cvs-status.el index 26fb6206c80..63b886362ba 100644 --- a/lisp/vc/cvs-status.el +++ b/lisp/vc/cvs-status.el @@ -28,7 +28,7 @@ ;;; Code: -(eval-when-compile (require 'cl-lib)) +(require 'cl-lib) (require 'pcvs-util) ;;; @@ -169,7 +169,7 @@ name type) -(defsubst cvs-status-vl-to-str (vl) (mapconcat 'number-to-string vl ".")) +(defsubst cvs-status-vl-to-str (vl) (mapconcat #'number-to-string vl ".")) (defun cvs-tag->string (tag) (if (stringp tag) tag @@ -283,7 +283,7 @@ BEWARE: because of stability issues, this is not a symmetric operation." tree1 (list (cons (cvs-tag-make (butlast vl2)) tree2))))))))) (defun cvs-tag-make-tag (tag) - (let ((vl (mapcar 'string-to-number (split-string (nth 2 tag) "\\.")))) + (let ((vl (mapcar #'string-to-number (split-string (nth 2 tag) "\\.")))) (cvs-tag-make vl (nth 0 tag) (intern (nth 1 tag))))) (defun cvs-tags->tree (tags) @@ -450,10 +450,10 @@ Optional prefix ARG chooses between two representations." (tags nil) (cvs-tree-nomerge (if arg (not cvs-tree-nomerge) cvs-tree-nomerge))) (while (listp (setq tags (cvs-status-get-tags))) - (let ((tags (mapcar 'cvs-tag-make-tag tags)) + (let ((tags (mapcar #'cvs-tag-make-tag tags)) ;;(pt (save-excursion (forward-line -1) (point))) ) - (setq tags (sort tags 'cvs-tag-lessp)) + (setq tags (sort tags #'cvs-tag-lessp)) (let* ((first (car tags)) (prev (if (cvs-tag-p first) (list (car (cvs-tag->vlist first))) nil))) @@ -472,7 +472,7 @@ Optional prefix ARG chooses between two representations." (nprev (if (and cvs-tree-nomerge next (equal vlist (cvs-tag->vlist next))) prev vlist))) - (cvs-map (lambda (v _p) v) nprev prev))) + (cl-mapcar (lambda (v _p) v) nprev prev))) (after (save-excursion (newline) (cvs-tree-tags-insert (cdr tags) nprev))) @@ -484,7 +484,7 @@ Optional prefix ARG chooses between two representations." (as after (cdr as))) ((and (null as) (null vs) (null ps)) (let ((revname (cvs-status-vl-to-str vlist))) - (if (cvs-every 'identity (cvs-map 'equal prev vlist)) + (if (cl-every #'identity (cl-mapcar #'equal prev vlist)) (insert (make-string (+ 4 (length revname)) ? ) (or (cvs-tag->name tag) "")) (insert " " revname ": " (or (cvs-tag->name tag) ""))))) @@ -500,7 +500,7 @@ Optional prefix ARG chooses between two representations." (if next-eq (cons nil cvs-tree-char-space) (cons t cvs-tree-char-eob)) (cons nil (if (and (eq (cvs-tag->type tag) 'branch) - (cvs-every 'null as)) + (cl-every #'null as)) cvs-tree-char-space cvs-tree-char-hbar)))))) (insert (cdr na+char)) diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 7a474201811..8bbab467af3 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -739,7 +739,7 @@ start and end positions." "Restrict the view to the current hunk. If the prefix ARG is given, restrict the view to the current file instead." (interactive "P") - (apply 'narrow-to-region + (apply #'narrow-to-region (if arg (diff-bounds-of-file) (diff-bounds-of-hunk))) (setq-local diff-narrowed-to (if arg 'file 'hunk))) @@ -770,7 +770,7 @@ If the prefix ARG is given, restrict the view to the current file instead." file-bounds hunk-bounds)) (inhibit-read-only t)) - (apply 'kill-region bounds) + (apply #'kill-region bounds) (goto-char (car bounds)) (ignore-errors (diff-beginning-of-hunk t))))) @@ -828,7 +828,7 @@ data such as \"Index: ...\" and such." (error "No hunks") (diff-beginning-of-hunk t) (let ((inhibit-read-only t)) - (apply 'kill-region (diff-bounds-of-file))) + (apply #'kill-region (diff-bounds-of-file))) (ignore-errors (diff-beginning-of-hunk t)))) (defun diff-kill-junk () @@ -1810,7 +1810,7 @@ Whitespace differences are ignored." (if (> (- (car forw) orig) (- orig (car back))) back forw) (or back forw)))) -(define-obsolete-function-alias 'diff-xor 'xor "27.1") +(define-obsolete-function-alias 'diff-xor #'xor "27.1") (defun diff-find-source-location (&optional other-file reverse noprompt) "Find current diff location within the source file. @@ -1984,7 +1984,7 @@ With a prefix argument, try to REVERSE the hunk." (diff-hunk-kill) (diff-hunk-next))))) -(defalias 'diff-mouse-goto-source 'diff-goto-source) +(defalias 'diff-mouse-goto-source #'diff-goto-source) (defun diff-goto-source (&optional other-file event) "Jump to the corresponding source line. @@ -2080,7 +2080,7 @@ For use in `add-log-current-defun-function'." (write-region (concat lead (car new)) nil file2 nil 'nomessage) (with-temp-buffer (let ((status - (apply 'call-process + (apply #'call-process `(,diff-command nil t nil ,@opts ,file1 ,file2)))) (pcase status diff --git a/lisp/vc/diff.el b/lisp/vc/diff.el index 7c4931b4b89..7bb1151602c 100644 --- a/lisp/vc/diff.el +++ b/lisp/vc/diff.el @@ -45,14 +45,12 @@ This variable is also used in the `vc-diff' command (and related commands) if the backend-specific diff switch variable isn't set (`vc-git-diff-switches' for git, for instance), and `vc-diff-switches' isn't set." - :type '(choice string (repeat string)) - :group 'diff) + :type '(choice string (repeat string))) ;;;###autoload (defcustom diff-command (purecopy "diff") "The command to use to run diff." - :type 'string - :group 'diff) + :type 'string) ;; prompt if prefix arg present (defun diff-switches () @@ -60,7 +58,7 @@ set (`vc-git-diff-switches' for git, for instance), and (read-string "Diff switches: " (if (stringp diff-switches) diff-switches - (mapconcat 'identity diff-switches " "))))) + (mapconcat #'identity diff-switches " "))))) (defun diff-sentinel (code &optional old-temp-file new-temp-file) "Code run when the diff process exits. @@ -165,7 +163,7 @@ returns the buffer used." (let* ((old-alt (diff-file-local-copy old)) (new-alt (diff-file-local-copy new)) (command - (mapconcat 'identity + (mapconcat #'identity `(,diff-command ;; Use explicitly specified switches ,@switches @@ -200,7 +198,7 @@ returns the buffer used." (if (and (not no-async) (fboundp 'make-process)) (let ((proc (start-process "Diff" buf shell-file-name shell-command-switch command))) - (set-process-filter proc 'diff-process-filter) + (set-process-filter proc #'diff-process-filter) (set-process-sentinel proc (lambda (proc _msg) (with-current-buffer (process-buffer proc) diff --git a/lisp/vc/ediff-diff.el b/lisp/vc/ediff-diff.el index fde9d4338f3..b93dfc814c0 100644 --- a/lisp/vc/ediff-diff.el +++ b/lisp/vc/ediff-diff.el @@ -87,7 +87,7 @@ options after the default ones. This variable is not for customizing the look of the differences produced by the command \\[ediff-show-diff-output]. Use the variable `ediff-custom-diff-options' for that." - :set 'ediff-set-diff-options + :set #'ediff-set-diff-options :type 'string) (ediff-defvar-local ediff-ignore-case nil diff --git a/lisp/vc/ediff-help.el b/lisp/vc/ediff-help.el index 84bf063aedf..a5bb953b6d4 100644 --- a/lisp/vc/ediff-help.el +++ b/lisp/vc/ediff-help.el @@ -156,7 +156,7 @@ the value of this variable and the variables `ediff-help-message-*' in ;; the keymap that defines clicks over the quick help regions (defvar ediff-help-region-map (make-sparse-keymap)) -(define-key ediff-help-region-map [mouse-2] 'ediff-help-for-quick-help) +(define-key ediff-help-region-map [mouse-2] #'ediff-help-for-quick-help) ;; runs in the control buffer (defun ediff-set-help-overlays () diff --git a/lisp/vc/ediff-init.el b/lisp/vc/ediff-init.el index 3f33e6aae2e..17c4202d647 100644 --- a/lisp/vc/ediff-init.el +++ b/lisp/vc/ediff-init.el @@ -25,6 +25,7 @@ ;;; Code: (require 'cl-lib) +(require 'ediff-util) ;; Start compiler pacifier (defvar ediff-metajob-name) @@ -1181,8 +1182,8 @@ this variable represents.") (put ediff-fine-diff-face-Ancestor 'ediff-help-echo "A `refinement' of the current difference region") -(add-hook 'ediff-quit-hook 'ediff-cleanup-mess) -(add-hook 'ediff-suspend-hook 'ediff-default-suspend-function) +(add-hook 'ediff-quit-hook #'ediff-cleanup-mess) +(add-hook 'ediff-suspend-hook #'ediff-default-suspend-function) ;;; Overlays @@ -1312,7 +1313,8 @@ This default should work without changes." (defun ediff-paint-background-regions-in-one-buffer (buf-type unhighlight) (let ((diff-vector (eval (ediff-get-symbol-from-alist - buf-type ediff-difference-vector-alist))) + buf-type ediff-difference-vector-alist) + t)) overl diff-num) (mapcar (lambda (rec) (setq overl (ediff-get-diff-overlay-from-diff-record rec) diff --git a/lisp/vc/ediff-merg.el b/lisp/vc/ediff-merg.el index 826cad9cc1b..ad4ef473f84 100644 --- a/lisp/vc/ediff-merg.el +++ b/lisp/vc/ediff-merg.el @@ -194,7 +194,7 @@ Buffer B." (defun ediff-set-merge-mode () (normal-mode t) - (remove-hook 'write-file-functions 'ediff-set-merge-mode t)) + (remove-hook 'write-file-functions #'ediff-set-merge-mode t)) ;; Go over all diffs starting with DIFF-NUM and copy regions into buffer C diff --git a/lisp/vc/ediff-mult.el b/lisp/vc/ediff-mult.el index d32c18be8fd..49b2890a160 100644 --- a/lisp/vc/ediff-mult.el +++ b/lisp/vc/ediff-mult.el @@ -147,15 +147,15 @@ Useful commands (type ? to hide them and free up screen): (defvar ediff-dir-diffs-buffer-map (let ((map (make-sparse-keymap))) (suppress-keymap map) - (define-key map "q" 'ediff-bury-dir-diffs-buffer) - (define-key map " " 'next-line) - (define-key map "n" 'next-line) - (define-key map "\C-?" 'previous-line) - (define-key map "p" 'previous-line) - (define-key map "C" 'ediff-dir-diff-copy-file) - (define-key map [mouse-2] 'ediff-dir-diff-copy-file) - (define-key map [delete] 'previous-line) - (define-key map [backspace] 'previous-line) + (define-key map "q" #'ediff-bury-dir-diffs-buffer) + (define-key map " " #'next-line) + (define-key map "n" #'next-line) + (define-key map "\C-?" #'previous-line) + (define-key map "p" #'previous-line) + (define-key map "C" #'ediff-dir-diff-copy-file) + (define-key map [mouse-2] #'ediff-dir-diff-copy-file) + (define-key map [delete] #'previous-line) + (define-key map [backspace] #'previous-line) map) "The keymap to be installed in the buffer showing differences between directories.") @@ -413,12 +413,11 @@ Toggled by ediff-toggle-verbose-help-meta-buffer" ) '(menu-item "Show Manual" ediff-documentation :help "Display Ediff's manual")) - (or (ediff-one-filegroup-metajob) - (progn - (define-key ediff-meta-buffer-map "=" nil) - (define-key ediff-meta-buffer-map "==" 'ediff-meta-mark-equal-files) - (define-key ediff-meta-buffer-map "=m" 'ediff-meta-mark-equal-files) - (define-key ediff-meta-buffer-map "=h" 'ediff-meta-mark-equal-files))) + (unless (ediff-one-filegroup-metajob) + (define-key ediff-meta-buffer-map "=" nil) + (define-key ediff-meta-buffer-map "==" #'ediff-meta-mark-equal-files) + (define-key ediff-meta-buffer-map "=m" #'ediff-meta-mark-equal-files) + (define-key ediff-meta-buffer-map "=h" #'ediff-meta-mark-equal-files)) (define-key menu-map [ediff-next-meta-item] @@ -430,7 +429,7 @@ Toggled by ediff-toggle-verbose-help-meta-buffer" ) (if ediff-no-emacs-help-in-control-buffer - (define-key ediff-meta-buffer-map "\C-h" 'ediff-previous-meta-item)) + (define-key ediff-meta-buffer-map "\C-h" #'ediff-previous-meta-item)) (define-key ediff-meta-buffer-map [mouse-2] ediff-meta-action-function) (use-local-map ediff-meta-buffer-map) @@ -633,7 +632,7 @@ behavior." difflist (delete "." difflist) ;; copying is needed because sort sorts via side effects difflist (sort (ediff-copy-list (delete ".." difflist)) - 'string-lessp)) + #'string-lessp)) (setq difflist (mapcar (lambda (elt) (cons elt 1)) difflist)) @@ -837,14 +836,14 @@ behavior." (ediff-draw-dir-diffs ediff-dir-difference-list)) (define-key ediff-meta-buffer-map "h" 'ediff-mark-for-hiding-at-pos) - (define-key ediff-meta-buffer-map "x" 'ediff-hide-marked-sessions) + (define-key ediff-meta-buffer-map "x" #'ediff-hide-marked-sessions) (define-key - ediff-meta-buffer-map "m" 'ediff-mark-for-operation-at-pos) + ediff-meta-buffer-map "m" #'ediff-mark-for-operation-at-pos) (define-key ediff-meta-buffer-map "u" nil) (define-key - ediff-meta-buffer-map "um" 'ediff-unmark-all-for-operation) + ediff-meta-buffer-map "um" #'ediff-unmark-all-for-operation) (define-key - ediff-meta-buffer-map "uh" 'ediff-unmark-all-for-hiding) + ediff-meta-buffer-map "uh" #'ediff-unmark-all-for-hiding) (define-key ediff-meta-buffer-map [menu-bar ediff-meta-mode ediff-hide-marked-sessions] @@ -877,7 +876,7 @@ behavior." '(menu-item "Collect diffs" ediff-collect-custom-diffs :help "Collect custom diffs of marked sessions in buffer `*Ediff Multifile Diffs*'")) (define-key - ediff-meta-buffer-map "P" 'ediff-collect-custom-diffs)) + ediff-meta-buffer-map "P" #'ediff-collect-custom-diffs)) ((ediff-patch-metajob jobname) (define-key ediff-meta-buffer-map [menu-bar ediff-meta-mode ediff-meta-show-patch] @@ -885,8 +884,8 @@ behavior." :help "Show the multi-file patch associated with this group session")) (define-key ediff-meta-buffer-map "P" 'ediff-meta-show-patch))) - (define-key ediff-meta-buffer-map "^" 'ediff-up-meta-hierarchy) - (define-key ediff-meta-buffer-map "D" 'ediff-show-dir-diffs) + (define-key ediff-meta-buffer-map "^" #'ediff-up-meta-hierarchy) + (define-key ediff-meta-buffer-map "D" #'ediff-show-dir-diffs) (define-key ediff-meta-buffer-map [menu-bar ediff-meta-mode ediff-up-meta-hierarchy] @@ -2128,7 +2127,7 @@ all marked sessions must be active." )) ;;;###autoload -(defalias 'eregistry 'ediff-show-registry) +(defalias 'eregistry #'ediff-show-registry) ;; If meta-buf doesn't exist, it is created. In that case, id doesn't have a ;; parent meta-buf diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el index 9909dcd5424..fc6dcf68a43 100644 --- a/lisp/vc/ediff-util.el +++ b/lisp/vc/ediff-util.el @@ -123,106 +123,106 @@ to invocation.") (setq ediff-mode-map (make-sparse-keymap)) (suppress-keymap ediff-mode-map) - (define-key ediff-mode-map [mouse-2] 'ediff-help-for-quick-help) - (define-key ediff-mode-map "\C-m" 'ediff-help-for-quick-help) + (define-key ediff-mode-map [mouse-2] #'ediff-help-for-quick-help) + (define-key ediff-mode-map "\C-m" #'ediff-help-for-quick-help) - (define-key ediff-mode-map "p" 'ediff-previous-difference) - (define-key ediff-mode-map "\C-?" 'ediff-previous-difference) - (define-key ediff-mode-map [delete] 'ediff-previous-difference) + (define-key ediff-mode-map "p" #'ediff-previous-difference) + (define-key ediff-mode-map "\C-?" #'ediff-previous-difference) + (define-key ediff-mode-map [delete] #'ediff-previous-difference) (define-key ediff-mode-map "\C-h" (if ediff-no-emacs-help-in-control-buffer - 'ediff-previous-difference nil)) - (define-key ediff-mode-map [backspace] 'ediff-previous-difference) - (define-key ediff-mode-map [?\S-\ ] 'ediff-previous-difference) - (define-key ediff-mode-map "n" 'ediff-next-difference) - (define-key ediff-mode-map " " 'ediff-next-difference) - (define-key ediff-mode-map "j" 'ediff-jump-to-difference) + #'ediff-previous-difference nil)) + (define-key ediff-mode-map [backspace] #'ediff-previous-difference) + (define-key ediff-mode-map [?\S-\ ] #'ediff-previous-difference) + (define-key ediff-mode-map "n" #'ediff-next-difference) + (define-key ediff-mode-map " " #'ediff-next-difference) + (define-key ediff-mode-map "j" #'ediff-jump-to-difference) (define-key ediff-mode-map "g" nil) - (define-key ediff-mode-map "ga" 'ediff-jump-to-difference-at-point) - (define-key ediff-mode-map "gb" 'ediff-jump-to-difference-at-point) - (define-key ediff-mode-map "q" 'ediff-quit) - (define-key ediff-mode-map "D" 'ediff-show-diff-output) - (define-key ediff-mode-map "z" 'ediff-suspend) - (define-key ediff-mode-map "\C-l" 'ediff-recenter) - (define-key ediff-mode-map "|" 'ediff-toggle-split) - (define-key ediff-mode-map "h" 'ediff-toggle-hilit) + (define-key ediff-mode-map "ga" #'ediff-jump-to-difference-at-point) + (define-key ediff-mode-map "gb" #'ediff-jump-to-difference-at-point) + (define-key ediff-mode-map "q" #'ediff-quit) + (define-key ediff-mode-map "D" #'ediff-show-diff-output) + (define-key ediff-mode-map "z" #'ediff-suspend) + (define-key ediff-mode-map "\C-l" #'ediff-recenter) + (define-key ediff-mode-map "|" #'ediff-toggle-split) + (define-key ediff-mode-map "h" #'ediff-toggle-hilit) (or ediff-word-mode - (define-key ediff-mode-map "@" 'ediff-toggle-autorefine)) + (define-key ediff-mode-map "@" #'ediff-toggle-autorefine)) (if ediff-narrow-job - (define-key ediff-mode-map "%" 'ediff-toggle-narrow-region)) - (define-key ediff-mode-map "~" 'ediff-swap-buffers) - (define-key ediff-mode-map "v" 'ediff-scroll-vertically) - (define-key ediff-mode-map "\C-v" 'ediff-scroll-vertically) - (define-key ediff-mode-map "^" 'ediff-scroll-vertically) - (define-key ediff-mode-map "\M-v" 'ediff-scroll-vertically) - (define-key ediff-mode-map "V" 'ediff-scroll-vertically) - (define-key ediff-mode-map "<" 'ediff-scroll-horizontally) - (define-key ediff-mode-map ">" 'ediff-scroll-horizontally) - (define-key ediff-mode-map "i" 'ediff-status-info) - (define-key ediff-mode-map "E" 'ediff-documentation) - (define-key ediff-mode-map "?" 'ediff-toggle-help) - (define-key ediff-mode-map "!" 'ediff-update-diffs) - (define-key ediff-mode-map "M" 'ediff-show-current-session-meta-buffer) - (define-key ediff-mode-map "R" 'ediff-show-registry) + (define-key ediff-mode-map "%" #'ediff-toggle-narrow-region)) + (define-key ediff-mode-map "~" #'ediff-swap-buffers) + (define-key ediff-mode-map "v" #'ediff-scroll-vertically) + (define-key ediff-mode-map "\C-v" #'ediff-scroll-vertically) + (define-key ediff-mode-map "^" #'ediff-scroll-vertically) + (define-key ediff-mode-map "\M-v" #'ediff-scroll-vertically) + (define-key ediff-mode-map "V" #'ediff-scroll-vertically) + (define-key ediff-mode-map "<" #'ediff-scroll-horizontally) + (define-key ediff-mode-map ">" #'ediff-scroll-horizontally) + (define-key ediff-mode-map "i" #'ediff-status-info) + (define-key ediff-mode-map "E" #'ediff-documentation) + (define-key ediff-mode-map "?" #'ediff-toggle-help) + (define-key ediff-mode-map "!" #'ediff-update-diffs) + (define-key ediff-mode-map "M" #'ediff-show-current-session-meta-buffer) + (define-key ediff-mode-map "R" #'ediff-show-registry) (or ediff-word-mode - (define-key ediff-mode-map "*" 'ediff-make-or-kill-fine-diffs)) + (define-key ediff-mode-map "*" #'ediff-make-or-kill-fine-diffs)) (define-key ediff-mode-map "a" nil) (define-key ediff-mode-map "b" nil) (define-key ediff-mode-map "r" nil) (cond (ediff-merge-job ;; Will barf if no ancestor - (define-key ediff-mode-map "/" 'ediff-toggle-show-ancestor) + (define-key ediff-mode-map "/" #'ediff-toggle-show-ancestor) ;; In merging, we allow only A->C and B->C copying. - (define-key ediff-mode-map "a" 'ediff-copy-A-to-C) - (define-key ediff-mode-map "b" 'ediff-copy-B-to-C) - (define-key ediff-mode-map "r" 'ediff-restore-diff-in-merge-buffer) - (define-key ediff-mode-map "s" 'ediff-shrink-window-C) - (define-key ediff-mode-map "+" 'ediff-combine-diffs) + (define-key ediff-mode-map "a" #'ediff-copy-A-to-C) + (define-key ediff-mode-map "b" #'ediff-copy-B-to-C) + (define-key ediff-mode-map "r" #'ediff-restore-diff-in-merge-buffer) + (define-key ediff-mode-map "s" #'ediff-shrink-window-C) + (define-key ediff-mode-map "+" #'ediff-combine-diffs) (define-key ediff-mode-map "$" nil) - (define-key ediff-mode-map "$$" 'ediff-toggle-show-clashes-only) - (define-key ediff-mode-map "$*" 'ediff-toggle-skip-changed-regions) - (define-key ediff-mode-map "&" 'ediff-re-merge)) + (define-key ediff-mode-map "$$" #'ediff-toggle-show-clashes-only) + (define-key ediff-mode-map "$*" #'ediff-toggle-skip-changed-regions) + (define-key ediff-mode-map "&" #'ediff-re-merge)) (ediff-3way-comparison-job - (define-key ediff-mode-map "ab" 'ediff-copy-A-to-B) - (define-key ediff-mode-map "ba" 'ediff-copy-B-to-A) - (define-key ediff-mode-map "ac" 'ediff-copy-A-to-C) - (define-key ediff-mode-map "bc" 'ediff-copy-B-to-C) + (define-key ediff-mode-map "ab" #'ediff-copy-A-to-B) + (define-key ediff-mode-map "ba" #'ediff-copy-B-to-A) + (define-key ediff-mode-map "ac" #'ediff-copy-A-to-C) + (define-key ediff-mode-map "bc" #'ediff-copy-B-to-C) (define-key ediff-mode-map "c" nil) - (define-key ediff-mode-map "ca" 'ediff-copy-C-to-A) - (define-key ediff-mode-map "cb" 'ediff-copy-C-to-B) - (define-key ediff-mode-map "ra" 'ediff-restore-diff) - (define-key ediff-mode-map "rb" 'ediff-restore-diff) - (define-key ediff-mode-map "rc" 'ediff-restore-diff) - (define-key ediff-mode-map "C" 'ediff-toggle-read-only)) + (define-key ediff-mode-map "ca" #'ediff-copy-C-to-A) + (define-key ediff-mode-map "cb" #'ediff-copy-C-to-B) + (define-key ediff-mode-map "ra" #'ediff-restore-diff) + (define-key ediff-mode-map "rb" #'ediff-restore-diff) + (define-key ediff-mode-map "rc" #'ediff-restore-diff) + (define-key ediff-mode-map "C" #'ediff-toggle-read-only)) (t ; 2-way comparison - (define-key ediff-mode-map "a" 'ediff-copy-A-to-B) - (define-key ediff-mode-map "b" 'ediff-copy-B-to-A) - (define-key ediff-mode-map "ra" 'ediff-restore-diff) - (define-key ediff-mode-map "rb" 'ediff-restore-diff)) + (define-key ediff-mode-map "a" #'ediff-copy-A-to-B) + (define-key ediff-mode-map "b" #'ediff-copy-B-to-A) + (define-key ediff-mode-map "ra" #'ediff-restore-diff) + (define-key ediff-mode-map "rb" #'ediff-restore-diff)) ) ; cond - (define-key ediff-mode-map "G" 'ediff-submit-report) + (define-key ediff-mode-map "G" #'ediff-submit-report) (define-key ediff-mode-map "#" nil) - (define-key ediff-mode-map "#h" 'ediff-toggle-regexp-match) - (define-key ediff-mode-map "#f" 'ediff-toggle-regexp-match) - (define-key ediff-mode-map "#c" 'ediff-toggle-ignore-case) + (define-key ediff-mode-map "#h" #'ediff-toggle-regexp-match) + (define-key ediff-mode-map "#f" #'ediff-toggle-regexp-match) + (define-key ediff-mode-map "#c" #'ediff-toggle-ignore-case) (or ediff-word-mode - (define-key ediff-mode-map "##" 'ediff-toggle-skip-similar)) + (define-key ediff-mode-map "##" #'ediff-toggle-skip-similar)) (define-key ediff-mode-map "o" nil) - (define-key ediff-mode-map "A" 'ediff-toggle-read-only) - (define-key ediff-mode-map "B" 'ediff-toggle-read-only) + (define-key ediff-mode-map "A" #'ediff-toggle-read-only) + (define-key ediff-mode-map "B" #'ediff-toggle-read-only) (define-key ediff-mode-map "w" nil) - (define-key ediff-mode-map "wa" 'ediff-save-buffer) - (define-key ediff-mode-map "wb" 'ediff-save-buffer) - (define-key ediff-mode-map "wd" 'ediff-save-buffer) - (define-key ediff-mode-map "=" 'ediff-inferior-compare-regions) + (define-key ediff-mode-map "wa" #'ediff-save-buffer) + (define-key ediff-mode-map "wb" #'ediff-save-buffer) + (define-key ediff-mode-map "wd" #'ediff-save-buffer) + (define-key ediff-mode-map "=" #'ediff-inferior-compare-regions) (if (and (fboundp 'ediff-show-patch-diagnostics) (ediff-patch-job)) - (define-key ediff-mode-map "P" 'ediff-show-patch-diagnostics)) + (define-key ediff-mode-map "P" #'ediff-show-patch-diagnostics)) (if ediff-3way-job (progn - (define-key ediff-mode-map "wc" 'ediff-save-buffer) - (define-key ediff-mode-map "gc" 'ediff-jump-to-difference-at-point) + (define-key ediff-mode-map "wc" #'ediff-save-buffer) + (define-key ediff-mode-map "gc" #'ediff-jump-to-difference-at-point) )) - (define-key ediff-mode-map "m" 'ediff-toggle-wide-display) + (define-key ediff-mode-map "m" #'ediff-toggle-wide-display) ;; Allow ediff-mode-map to be referenced indirectly (fset 'ediff-mode-map ediff-mode-map) diff --git a/lisp/vc/ediff-wind.el b/lisp/vc/ediff-wind.el index 47ef37a19ee..fc6ea944ae1 100644 --- a/lisp/vc/ediff-wind.el +++ b/lisp/vc/ediff-wind.el @@ -1043,8 +1043,8 @@ create a new splittable frame if none is found." (with-current-buffer ctl-buffer (let* ((frame-A (window-frame ediff-window-A)) (frame-A-parameters (frame-parameters frame-A)) - (frame-A-top (eval (cdr (assoc 'top frame-A-parameters)))) - (frame-A-left (eval (cdr (assoc 'left frame-A-parameters)))) + (frame-A-top (eval (cdr (assoc 'top frame-A-parameters)) t)) + (frame-A-left (eval (cdr (assoc 'left frame-A-parameters)) t)) (frame-A-width (frame-width frame-A)) (ctl-frame ediff-control-frame) horizontal-adjustment upward-adjustment @@ -1105,7 +1105,7 @@ It assumes that it is called from within the control buffer." (cw (frame-char-width frame-A)) (wd (- (/ (display-pixel-width) cw) 5))) (setq ediff-wide-display-orig-parameters - (list (cons 'left (max 0 (eval (cdr (assoc 'left frame-A-params))))) + (list (cons 'left (max 0 (eval (cdr (assoc 'left frame-A-params)) t))) (cons 'width (cdr (assoc 'width frame-A-params)))) ediff-wide-display-frame frame-A) (modify-frame-parameters diff --git a/lisp/vc/ediff.el b/lisp/vc/ediff.el index ed375738b47..3536cbf7381 100644 --- a/lisp/vc/ediff.el +++ b/lisp/vc/ediff.el @@ -264,7 +264,7 @@ arguments after setting up the Ediff buffers." 'ediff-files3)) ;;;###autoload -(defalias 'ediff3 'ediff-files3) +(defalias 'ediff3 #'ediff-files3) (defvar-local ediff--magic-file-name nil "Name of file where buffer's content was saved. @@ -359,7 +359,7 @@ has been saved (if not in `buffer-file-name')." (declare-function diff-latest-backup-file "diff" (fn)) ;;;###autoload -(defalias 'ediff 'ediff-files) +(defalias 'ediff #'ediff-files) ;;;###autoload (defun ediff-current-file () @@ -442,7 +442,7 @@ symbol describing the Ediff job type; it defaults to (ediff-buffers-internal buffer-A buffer-B nil startup-hooks job-name)) ;;;###autoload -(defalias 'ebuffers 'ediff-buffers) +(defalias 'ebuffers #'ediff-buffers) ;;;###autoload @@ -479,7 +479,7 @@ symbol describing the Ediff job type; it defaults to (ediff-buffers-internal buffer-A buffer-B buffer-C startup-hooks job-name)) ;;;###autoload -(defalias 'ebuffers3 'ediff-buffers3) +(defalias 'ebuffers3 #'ediff-buffers3) @@ -556,7 +556,7 @@ the same name in both. The third argument, REGEXP, is nil or a regular expression; only file names that match the regexp are considered." (interactive (let ((dir-A (ediff-get-default-directory-name)) - (default-regexp (eval ediff-default-filtering-regexp)) + (default-regexp (eval ediff-default-filtering-regexp t)) f) (list (setq f (read-directory-name "Directory A to compare: " dir-A nil 'must-match)) @@ -570,14 +570,14 @@ expression; only file names that match the regexp are considered." default-regexp) nil 'ediff-filtering-regexp-history - (eval ediff-default-filtering-regexp)) + (eval ediff-default-filtering-regexp t)) ))) (ediff-directories-internal dir1 dir2 nil regexp #'ediff-files 'ediff-directories )) ;;;###autoload -(defalias 'edirs 'ediff-directories) +(defalias 'edirs #'ediff-directories) ;;;###autoload @@ -587,7 +587,7 @@ The second argument, REGEXP, is a regular expression that filters the file names. Only the files that are under revision control are taken into account." (interactive (let ((dir-A (ediff-get-default-directory-name)) - (default-regexp (eval ediff-default-filtering-regexp)) + (default-regexp (eval ediff-default-filtering-regexp t)) ) (list (read-directory-name "Directory to compare with revision:" dir-A nil 'must-match) @@ -596,14 +596,14 @@ names. Only the files that are under revision control are taken into account." "Filter filenames through regular expression" default-regexp) nil 'ediff-filtering-regexp-history - (eval ediff-default-filtering-regexp)) + (eval ediff-default-filtering-regexp t)) ))) (ediff-directory-revisions-internal - dir1 regexp 'ediff-revision 'ediff-directory-revisions + dir1 regexp #'ediff-revision 'ediff-directory-revisions )) ;;;###autoload -(defalias 'edir-revisions 'ediff-directory-revisions) +(defalias 'edir-revisions #'ediff-directory-revisions) ;;;###autoload @@ -614,7 +614,7 @@ regular expression; only file names that match the regexp are considered." (interactive (let ((dir-A (ediff-get-default-directory-name)) - (default-regexp (eval ediff-default-filtering-regexp)) + (default-regexp (eval ediff-default-filtering-regexp t)) f) (list (setq f (read-directory-name "Directory A to compare:" dir-A nil)) (setq f (read-directory-name "Directory B to compare:" @@ -632,14 +632,14 @@ regular expression; only file names that match the regexp are considered." default-regexp) nil 'ediff-filtering-regexp-history - (eval ediff-default-filtering-regexp)) + (eval ediff-default-filtering-regexp t)) ))) (ediff-directories-internal dir1 dir2 dir3 regexp #'ediff-files3 'ediff-directories3 )) ;;;###autoload -(defalias 'edirs3 'ediff-directories3) +(defalias 'edirs3 #'ediff-directories3) ;;;###autoload (defun ediff-merge-directories (dir1 dir2 regexp &optional merge-autostore-dir) @@ -649,7 +649,7 @@ expression; only file names that match the regexp are considered. MERGE-AUTOSTORE-DIR is the directory in which to store merged files." (interactive (let ((dir-A (ediff-get-default-directory-name)) - (default-regexp (eval ediff-default-filtering-regexp)) + (default-regexp (eval ediff-default-filtering-regexp t)) f) (list (setq f (read-directory-name "Directory A to merge:" dir-A nil 'must-match)) @@ -663,7 +663,7 @@ MERGE-AUTOSTORE-DIR is the directory in which to store merged files." default-regexp) nil 'ediff-filtering-regexp-history - (eval ediff-default-filtering-regexp)) + (eval ediff-default-filtering-regexp t)) ))) (ediff-directories-internal dir1 dir2 nil regexp #'ediff-merge-files 'ediff-merge-directories @@ -671,7 +671,7 @@ MERGE-AUTOSTORE-DIR is the directory in which to store merged files." )) ;;;###autoload -(defalias 'edirs-merge 'ediff-merge-directories) +(defalias 'edirs-merge #'ediff-merge-directories) ;;;###autoload (defun ediff-merge-directories-with-ancestor (dir1 dir2 ancestor-dir regexp @@ -685,7 +685,7 @@ only file names that match the regexp are considered. MERGE-AUTOSTORE-DIR is the directory in which to store merged files." (interactive (let ((dir-A (ediff-get-default-directory-name)) - (default-regexp (eval ediff-default-filtering-regexp)) + (default-regexp (eval ediff-default-filtering-regexp t)) f) (list (setq f (read-directory-name "Directory A to merge:" dir-A nil)) (setq f (read-directory-name "Directory B to merge:" @@ -703,7 +703,7 @@ MERGE-AUTOSTORE-DIR is the directory in which to store merged files." default-regexp) nil 'ediff-filtering-regexp-history - (eval ediff-default-filtering-regexp)) + (eval ediff-default-filtering-regexp t)) ))) (ediff-directories-internal dir1 dir2 ancestor-dir regexp @@ -720,7 +720,7 @@ names. Only the files that are under revision control are taken into account. MERGE-AUTOSTORE-DIR is the directory in which to store merged files." (interactive (let ((dir-A (ediff-get-default-directory-name)) - (default-regexp (eval ediff-default-filtering-regexp)) + (default-regexp (eval ediff-default-filtering-regexp t)) ) (list (read-directory-name "Directory to merge with revisions:" dir-A nil 'must-match) @@ -729,15 +729,15 @@ MERGE-AUTOSTORE-DIR is the directory in which to store merged files." default-regexp) nil 'ediff-filtering-regexp-history - (eval ediff-default-filtering-regexp)) + (eval ediff-default-filtering-regexp t)) ))) (ediff-directory-revisions-internal - dir1 regexp 'ediff-merge-revisions 'ediff-merge-directory-revisions + dir1 regexp #'ediff-merge-revisions 'ediff-merge-directory-revisions nil merge-autostore-dir )) ;;;###autoload -(defalias 'edir-merge-revisions 'ediff-merge-directory-revisions) +(defalias 'edir-merge-revisions #'ediff-merge-directory-revisions) ;;;###autoload (defun ediff-merge-directory-revisions-with-ancestor (dir1 regexp @@ -749,7 +749,7 @@ names. Only the files that are under revision control are taken into account. MERGE-AUTOSTORE-DIR is the directory in which to store merged files." (interactive (let ((dir-A (ediff-get-default-directory-name)) - (default-regexp (eval ediff-default-filtering-regexp)) + (default-regexp (eval ediff-default-filtering-regexp t)) ) (list (read-directory-name "Directory to merge with revisions and ancestors:" @@ -759,10 +759,10 @@ MERGE-AUTOSTORE-DIR is the directory in which to store merged files." default-regexp) nil 'ediff-filtering-regexp-history - (eval ediff-default-filtering-regexp)) + (eval ediff-default-filtering-regexp t)) ))) (ediff-directory-revisions-internal - dir1 regexp 'ediff-merge-revisions-with-ancestor + dir1 regexp #'ediff-merge-revisions-with-ancestor 'ediff-merge-directory-revisions-with-ancestor nil merge-autostore-dir )) diff --git a/lisp/vc/emerge.el b/lisp/vc/emerge.el index d2d419ac786..8f7affeea4e 100644 --- a/lisp/vc/emerge.el +++ b/lisp/vc/emerge.el @@ -79,90 +79,75 @@ but can be invoked directly in `fast' mode." ;; way they number lines of a file. (defcustom emerge-diff-program "diff" "Name of the program which compares two files." - :type 'string - :group 'emerge) + :type 'string) (defcustom emerge-diff3-program "diff3" "Name of the program which compares three files. Its arguments are the ancestor file and the two variant files." - :type 'string - :group 'emerge) + :type 'string) (defcustom emerge-diff-options "" "Options to pass to `emerge-diff-program' and `emerge-diff3-program'." - :type 'string - :group 'emerge) + :type 'string) (defcustom emerge-match-diff-line (let ((x "\\([0-9]+\\)\\(\\|,\\([0-9]+\\)\\)")) (concat "^" x "\\([acd]\\)" x "$")) "Pattern to match lines produced by diff that describe differences. This is as opposed to lines from the source files." - :type 'regexp - :group 'emerge) + :type 'regexp) (defcustom emerge-diff-ok-lines-regexp "^\\([0-9,]+[acd][0-9,]+$\\|[<>] \\|---\\)" "Regexp that matches normal output lines from `emerge-diff-program'. Lines that do not match are assumed to be error messages." - :type 'regexp - :group 'emerge) + :type 'regexp) (defcustom emerge-diff3-ok-lines-regexp "^\\([1-3]:\\|====\\| \\)" "Regexp that matches normal output lines from `emerge-diff3-program'. Lines that do not match are assumed to be error messages." - :type 'regexp - :group 'emerge) + :type 'regexp) (defcustom emerge-rcs-ci-program "ci" "Name of the program that checks in RCS revisions." - :type 'string - :group 'emerge) + :type 'string) (defcustom emerge-rcs-co-program "co" "Name of the program that checks out RCS revisions." - :type 'string - :group 'emerge) + :type 'string) (defcustom emerge-process-local-variables nil "Non-nil if Emerge should process local-variables lists in merge buffers. \(You can explicitly request processing the local-variables by executing `(hack-local-variables)'.)" - :type 'boolean - :group 'emerge) + :type 'boolean) (defcustom emerge-execute-line-deletions nil "If non-nil: `emerge-execute-line' makes no output if an input was deleted. It concludes that an input version has been deleted when an ancestor entry is present, only one A or B entry is present, and an output entry is present. If nil: In such circumstances, the A or B file that is present will be copied to the designated output file." - :type 'boolean - :group 'emerge) + :type 'boolean) (defcustom emerge-before-flag "vvvvvvvvvvvvvvvvvvvv\n" "Flag placed above the highlighted block of code. Must end with newline. Must be set before Emerge is loaded, or emerge-new-flags must be run after setting." - :type 'string - :group 'emerge) + :type 'string) (defcustom emerge-after-flag "^^^^^^^^^^^^^^^^^^^^\n" "Flag placed below the highlighted block of code. Must end with newline. Must be set before Emerge is loaded, or emerge-new-flags must be run after setting." - :type 'string - :group 'emerge) + :type 'string) ;; Hook variables (defcustom emerge-startup-hook nil "Hook to run in the merge buffer after the merge has been set up." - :type 'hook - :group 'emerge) + :type 'hook) (defcustom emerge-select-hook nil "Hook to run after a difference has been selected. The variable `n' holds the (internal) number of the difference." - :type 'hook - :group 'emerge) + :type 'hook) (defcustom emerge-unselect-hook nil "Hook to run after a difference has been unselected. The variable `n' holds the (internal) number of the difference." - :type 'hook - :group 'emerge) + :type 'hook) ;; Variables to control the default directories of the arguments to ;; Emerge commands. @@ -171,8 +156,7 @@ The variable `n' holds the (internal) number of the difference." "If nil, default dir for filenames in emerge is `default-directory'. If non-nil, filenames complete in the directory of the last argument of the same type to an `emerge-files...' command." - :type 'boolean - :group 'emerge) + :type 'boolean) (defvar emerge-last-dir-A nil "Last directory for the first file of an `emerge-files...' command.") @@ -235,15 +219,13 @@ depend on the flags." (defcustom emerge-min-visible-lines 3 "Number of lines that we want to show above and below the flags when we are displaying a difference." - :type 'integer - :group 'emerge) + :type 'integer) (defcustom emerge-temp-file-prefix (expand-file-name "emerge" temporary-file-directory) "Prefix to put on Emerge temporary file names. Do not start with `~/' or `~USERNAME/'." - :type 'string - :group 'emerge) + :type 'string) (make-obsolete-variable 'emerge-temp-file-prefix "customize `temporary-file-directory' instead." @@ -251,8 +233,7 @@ Do not start with `~/' or `~USERNAME/'." (defcustom emerge-temp-file-mode 384 ; u=rw only "Mode for Emerge temporary files." - :type 'integer - :group 'emerge) + :type 'integer) (make-obsolete-variable 'emerge-temp-file-mode "it has no effect, temporary files are always private." @@ -268,8 +249,7 @@ The template is inserted as a string, with the following interpolations: Don't forget to end the template with a newline. Note that this variable can be made local to a particular merge buffer by giving a prefix argument to `emerge-set-combine-versions-template'." - :type 'string - :group 'emerge) + :type 'string) ;; Build keymaps @@ -294,8 +274,7 @@ Makes Emerge commands directly available.") (defcustom emerge-command-prefix "\C-c\C-c" "Command prefix for Emerge commands in `edit' mode. Must be set before Emerge is loaded." - :type 'string - :group 'emerge) + :type 'string) ;; This function sets up the fixed keymaps. It is executed when the first ;; Emerge is done to allow the user maximum time to set up the global keymap. @@ -1245,8 +1224,7 @@ Otherwise, the A or B file present is copied to the output file." (defcustom emerge-merge-directories-filename-regexp "[^.]" "Regexp describing files to be processed by `emerge-merge-directories'." - :type 'regexp - :group 'emerge) + :type 'regexp) ;;;###autoload (defun emerge-merge-directories (a-dir b-dir ancestor-dir output-dir) @@ -3070,8 +3048,7 @@ See also `auto-save-file-name-p'." (defcustom emerge-metachars nil "No longer used. Emerge now uses `shell-quote-argument'." - :type '(choice (const nil) regexp) - :group 'emerge) + :type '(choice (const nil) regexp)) (make-obsolete-variable 'emerge-metachars nil "26.1") (provide 'emerge) diff --git a/lisp/vc/pcvs-defs.el b/lisp/vc/pcvs-defs.el index 2ee3da70274..54ef06960f9 100644 --- a/lisp/vc/pcvs-defs.el +++ b/lisp/vc/pcvs-defs.el @@ -1,4 +1,4 @@ -;;; pcvs-defs.el --- variable definitions for PCL-CVS +;;; pcvs-defs.el --- variable definitions for PCL-CVS -*- lexical-binding: t; -*- ;; Copyright (C) 1991-2021 Free Software Foundation, Inc. @@ -71,7 +71,6 @@ versions, such as the one in SunOS-4.") (defcustom cvs-cvsrc-file (convert-standard-filename "~/.cvsrc") "Path to your cvsrc file." - :group 'pcl-cvs :type '(file)) (defvar cvs-shared-start 4 @@ -96,24 +95,20 @@ If t, they will be removed from the *cvs* buffer after every command. If `delayed', they will be removed from the *cvs* buffer before every command. If `status', they will only be removed after a `cvs-mode-status' command. Else, they will never be automatically removed from the *cvs* buffer." - :group 'pcl-cvs :type '(choice (const nil) (const status) (const delayed) (const t))) (defcustom cvs-auto-remove-directories 'handled "If `all', directory entries will never be shown. If `handled', only non-handled directories will be shown. If `empty', only non-empty directories will be shown." - :group 'pcl-cvs :type '(choice (const :tag "No" nil) (const all) (const handled) (const empty))) (defcustom cvs-auto-revert t "Non-nil if changed files should automatically be reverted." - :group 'pcl-cvs :type '(boolean)) (defcustom cvs-sort-ignore-file t "Non-nil if `cvs-mode-ignore' should sort the .cvsignore automatically." - :group 'pcl-cvs :type '(boolean)) (defcustom cvs-force-dir-tag t @@ -121,7 +116,6 @@ If `empty', only non-empty directories will be shown." Tagging should generally be applied a directory at a time, but sometimes it is useful to be able to tag a single file. The normal way to do that is to use `cvs-mode-force-command' so as to temporarily override the restrictions." - :group 'pcl-cvs :type '(boolean)) (defcustom cvs-default-ignore-marks nil @@ -130,7 +124,6 @@ Normally they run on the files that are marked (with `cvs-mode-mark'), or the file under the cursor if no files are marked. If this variable is set to a non-nil value they will by default run on the file on the current line. See also `cvs-invert-ignore-marks'." - :group 'pcl-cvs :type '(boolean)) (defcustom cvs-invert-ignore-marks @@ -143,7 +136,6 @@ current line. See also `cvs-invert-ignore-marks'." "List of cvs commands that invert the default ignore-mark behavior. Commands in this set will use the opposite default from the one set in `cvs-default-ignore-marks'." - :group 'pcl-cvs :type '(set (const "diff") (const "tag") (const "ignore"))) @@ -154,7 +146,6 @@ Non-nil means that PCL-CVS will ask confirmation before removing files except for files whose content can readily be recovered from the repository. A value of `list' means that the list of files to be deleted will be displayed when asking for confirmation." - :group 'pcl-cvs :type '(choice (const list) (const t) (const nil))) @@ -162,7 +153,6 @@ displayed when asking for confirmation." (defcustom cvs-add-default-message nil "Default message to use when adding files. If set to nil, `cvs-mode-add' will always prompt for a message." - :group 'pcl-cvs :type '(choice (const :tag "Prompt" nil) (string))) @@ -171,7 +161,6 @@ If set to nil, `cvs-mode-add' will always prompt for a message." If non-nil, `cvs-mode-find-file' will place the cursor at the beginning of the modified area. If the file is not locally modified, this will obviously have no effect." - :group 'pcl-cvs :type '(boolean)) (defcustom cvs-buffer-name-alist @@ -193,7 +182,6 @@ POSTPROC is a function that should be executed when the command terminates The CMD used for `cvs-mode-commit' is \"message\". For that special case, POSTPROC is called just after MODE with special arguments." - :group 'pcl-cvs :type '(repeat (list (choice (const "diff") (const "status") @@ -236,7 +224,6 @@ Output from cvs is placed here for asynchronous commands.") '(cvs-ediff-diff . cvs-ediff-merge) '(cvs-emerge-diff . cvs-emerge-merge)) "Pair of functions to be used for resp. diff'ing and merg'ing interactively." - :group 'pcl-cvs :type '(choice (const :tag "Ediff" (cvs-ediff-diff . cvs-ediff-merge)) (const :tag "Emerge" (cvs-emerge-diff . cvs-emerge-merge)))) @@ -255,7 +242,6 @@ Alternatives are: `samedir': reuse any cvs buffer displaying the same directory `subdir': or reuse any cvs buffer displaying any sub- or super- directory `always': reuse any cvs buffer." - :group 'pcl-cvs :type '(choice (const always) (const subdir) (const samedir) (const current))) (defvar cvs-temp-buffer nil @@ -424,8 +410,7 @@ This variable is buffer local and only used in the *cvs* buffer.") (defcustom cvs-minor-mode-prefix "\C-xc" "Prefix key for the `cvs-mode' bindings in `cvs-minor-mode'." - :type 'string - :group 'pcl-cvs) + :type 'string) (easy-mmode-defmap cvs-minor-mode-map `((,cvs-minor-mode-prefix . cvs-mode-map) diff --git a/lisp/vc/pcvs-info.el b/lisp/vc/pcvs-info.el index e1197176af2..21fe98dacab 100644 --- a/lisp/vc/pcvs-info.el +++ b/lisp/vc/pcvs-info.el @@ -1,4 +1,4 @@ -;;; pcvs-info.el --- internal representation of a fileinfo entry +;;; pcvs-info.el --- internal representation of a fileinfo entry -*- lexical-binding: t; -*- ;; Copyright (C) 1991-2021 Free Software Foundation, Inc. @@ -384,8 +384,8 @@ For use by the ewoc package." The ordering defined by this function is such that directories are sorted alphabetically, and inside every directory the DIRCHANGE fileinfo will appear first, followed by all files (alphabetically)." - (let ((subtypea (cvs-fileinfo->subtype a)) - (subtypeb (cvs-fileinfo->subtype b))) + (let ( ;; (subtypea (cvs-fileinfo->subtype a)) + ) ;; (subtypeb (cvs-fileinfo->subtype b)) (cond ;; Sort according to directories. ((string< (cvs-fileinfo->dir a) (cvs-fileinfo->dir b)) t) diff --git a/lisp/vc/pcvs-parse.el b/lisp/vc/pcvs-parse.el index a95ea0d99da..d0b2e898b07 100644 --- a/lisp/vc/pcvs-parse.el +++ b/lisp/vc/pcvs-parse.el @@ -186,7 +186,7 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'." (let ((type (if (consp type) (car type) type)) (subtype (if (consp type) (cdr type)))) (when dir (setq cvs-current-dir dir)) - (apply 'cvs-create-fileinfo type + (apply #'cvs-create-fileinfo type (concat cvs-current-subdir (or dir cvs-current-dir)) file (cvs-parse-msg) :subtype subtype keys)))) diff --git a/lisp/vc/pcvs-util.el b/lisp/vc/pcvs-util.el index 57da7bf730e..75d9fe9bee1 100644 --- a/lisp/vc/pcvs-util.el +++ b/lisp/vc/pcvs-util.el @@ -1,4 +1,4 @@ -;;; pcvs-util.el --- utility functions for PCL-CVS +;;; pcvs-util.el --- utility functions for PCL-CVS -*- lexical-binding: t; -*- ;; Copyright (C) 1991-2021 Free Software Foundation, Inc. @@ -33,27 +33,9 @@ ;;;; (defsubst cvs-car (x) (if (consp x) (car x) x)) -(defalias 'cvs-cdr 'cdr-safe) +(defalias 'cvs-cdr #'cdr-safe) (defsubst cvs-append (&rest xs) - (apply 'append (mapcar (lambda (x) (if (listp x) x (list x))) xs))) - -(defsubst cvs-every (-cvs-every-f -cvs-every-l) - (while (consp -cvs-every-l) - (unless (funcall -cvs-every-f (pop -cvs-every-l)) - (setq -cvs-every-l t))) - (not -cvs-every-l)) - -(defun cvs-union (xs ys) - (let ((zs ys)) - (dolist (x xs zs) - (unless (member x ys) (push x zs))))) - -(defun cvs-map (-cvs-map-f &rest -cvs-map-ls) - (let ((accum ())) - (while (not (cvs-every 'null -cvs-map-ls)) - (push (apply -cvs-map-f (mapcar 'car -cvs-map-ls)) accum) - (setq -cvs-map-ls (mapcar 'cdr -cvs-map-ls))) - (nreverse accum))) + (apply #'append (mapcar (lambda (x) (if (listp x) x (list x))) xs))) (defun cvs-first (l &optional n) (if (null n) (car l) @@ -146,7 +128,7 @@ If NOREUSE is non-nil, always return a new buffer." "Insert a list of STRINGS into the current buffer. Uses columns to keep the listing readable but compact." (when (consp strings) - (let* ((length (apply 'max (mapcar 'length strings))) + (let* ((length (apply #'max (mapcar #'length strings))) (wwidth (1- (window-width))) (columns (min ;; At least 2 columns; at least 2 spaces between columns. @@ -174,7 +156,7 @@ arguments. If ARGS is not a list, no argument will be passed." (condition-case nil (with-temp-buffer (if args - (apply 'call-process + (apply #'call-process file nil t nil (when (listp args) args)) (insert-file-contents file)) (goto-char (point-min)) @@ -182,7 +164,7 @@ arguments. If ARGS is not a list, no argument will be passed." (if oneline (line-end-position) (point-max)))) (file-error nil))) -(define-obsolete-function-alias 'cvs-string-prefix-p 'string-prefix-p "24.3") +(define-obsolete-function-alias 'cvs-string-prefix-p #'string-prefix-p "24.3") ;;;; ;;;; file names diff --git a/lisp/vc/pcvs.el b/lisp/vc/pcvs.el index 1a42c67cb1c..6e039cc6256 100644 --- a/lisp/vc/pcvs.el +++ b/lisp/vc/pcvs.el @@ -115,7 +115,7 @@ ;;; Code: -(eval-when-compile (require 'cl-lib)) +(require 'cl-lib) (require 'ewoc) ;Ewoc was once cookie (require 'pcvs-defs) (require 'pcvs-util) @@ -513,7 +513,7 @@ If non-nil, NEW means to create a new buffer no matter what." (let* ((dir+files+rest (if (or (null fis) (not single-dir)) ;; not single-dir mode: just process the whole thing - (list "" (mapcar 'cvs-fileinfo->full-name fis) nil) + (list "" (mapcar #'cvs-fileinfo->full-name fis) nil) ;; single-dir mode: extract the same-dir-elements (let ((dir (cvs-fileinfo->dir (car fis)))) ;; output the concerned dir so the parser can translate paths @@ -2135,11 +2135,11 @@ Returns a list of FIS that should be `cvs remove'd." (eq (cvs-fileinfo->type fi) 'UNKNOWN)) (cvs-mode-marked filter cmd)))) (silent (or (not cvs-confirm-removals) - (cvs-every (lambda (fi) - (or (not (file-exists-p - (cvs-fileinfo->full-name fi))) - (cvs-applicable-p fi 'safe-rm))) - files))) + (cl-every (lambda (fi) + (or (not (file-exists-p + (cvs-fileinfo->full-name fi))) + (cvs-applicable-p fi 'safe-rm))) + files))) (tmpbuf (cvs-temp-buffer))) (when (and (not silent) (equal cvs-confirm-removals 'list)) (with-current-buffer tmpbuf diff --git a/lisp/vc/vc-annotate.el b/lisp/vc/vc-annotate.el index b0435ab53ee..07b2800c2dc 100644 --- a/lisp/vc/vc-annotate.el +++ b/lisp/vc/vc-annotate.el @@ -164,18 +164,18 @@ List of factors, used to expand/compress the time scale. See `vc-annotate'." (defvar vc-annotate-mode-map (let ((m (make-sparse-keymap))) - (define-key m "a" 'vc-annotate-revision-previous-to-line) - (define-key m "d" 'vc-annotate-show-diff-revision-at-line) - (define-key m "=" 'vc-annotate-show-diff-revision-at-line) - (define-key m "D" 'vc-annotate-show-changeset-diff-revision-at-line) - (define-key m "f" 'vc-annotate-find-revision-at-line) - (define-key m "j" 'vc-annotate-revision-at-line) - (define-key m "l" 'vc-annotate-show-log-revision-at-line) - (define-key m "n" 'vc-annotate-next-revision) - (define-key m "p" 'vc-annotate-prev-revision) - (define-key m "w" 'vc-annotate-working-revision) - (define-key m "v" 'vc-annotate-toggle-annotation-visibility) - (define-key m "\C-m" 'vc-annotate-goto-line) + (define-key m "a" #'vc-annotate-revision-previous-to-line) + (define-key m "d" #'vc-annotate-show-diff-revision-at-line) + (define-key m "=" #'vc-annotate-show-diff-revision-at-line) + (define-key m "D" #'vc-annotate-show-changeset-diff-revision-at-line) + (define-key m "f" #'vc-annotate-find-revision-at-line) + (define-key m "j" #'vc-annotate-revision-at-line) + (define-key m "l" #'vc-annotate-show-log-revision-at-line) + (define-key m "n" #'vc-annotate-next-revision) + (define-key m "p" #'vc-annotate-prev-revision) + (define-key m "w" #'vc-annotate-working-revision) + (define-key m "v" #'vc-annotate-toggle-annotation-visibility) + (define-key m "\C-m" #'vc-annotate-goto-line) m) "Local keymap used for VC-Annotate mode.") diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el index d1385ea7784..de5a90dc602 100644 --- a/lisp/vc/vc-bzr.el +++ b/lisp/vc/vc-bzr.el @@ -45,9 +45,9 @@ ;;; Code: +(require 'vc-dispatcher) (eval-when-compile (require 'cl-lib) - (require 'vc-dispatcher) (require 'vc-dir)) ; vc-dir-at-event (declare-function vc-deduce-fileset "vc" @@ -66,7 +66,6 @@ (defcustom vc-bzr-program "bzr" "Name of the bzr command (excluding any arguments)." - :group 'vc-bzr :type 'string) (defcustom vc-bzr-diff-switches nil @@ -75,8 +74,7 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." :type '(choice (const :tag "Unspecified" nil) (const :tag "None" t) (string :tag "Argument String") - (repeat :tag "Argument List" :value ("") string)) - :group 'vc-bzr) + (repeat :tag "Argument List" :value ("") string))) (defcustom vc-bzr-annotate-switches nil "String or list of strings specifying switches for bzr annotate under VC. @@ -85,15 +83,13 @@ If nil, use the value of `vc-annotate-switches'. If t, use no switches." (const :tag "None" t) (string :tag "Argument String") (repeat :tag "Argument List" :value ("") string)) - :version "25.1" - :group 'vc-bzr) + :version "25.1") (defcustom vc-bzr-log-switches nil "String or list of strings specifying switches for bzr log under VC." :type '(choice (const :tag "None" nil) (string :tag "Argument String") - (repeat :tag "Argument List" :value ("") string)) - :group 'vc-bzr) + (repeat :tag "Argument List" :value ("") string))) (defcustom vc-bzr-status-switches (ignore-errors @@ -108,7 +104,6 @@ The option \"--no-classify\" should be present if your bzr supports it." :type '(choice (const :tag "None" nil) (string :tag "Argument String") (repeat :tag "Argument List" :value ("") string)) - :group 'vc-bzr :version "24.1") ;; since v0.9, bzr supports removing the progress indicators @@ -122,7 +117,7 @@ prepends `vc-bzr-status-switches' to ARGS." `("BZR_PROGRESS_BAR=none" ; Suppress progress output (bzr >=0.9) "LC_MESSAGES=C" ; Force English output ,@process-environment))) - (apply 'vc-do-command (or buffer "*vc*") okstatus vc-bzr-program + (apply #'vc-do-command (or buffer "*vc*") okstatus vc-bzr-program file-or-list bzr-command (if (and (string-equal "status" bzr-command) vc-bzr-status-switches) @@ -144,7 +139,7 @@ Use the current Bzr root directory as the ROOT argument to ,@process-environment)) (root (vc-bzr-root default-directory)) (buffer (format "*vc-bzr : %s*" (expand-file-name root)))) - (apply 'vc-do-async-command buffer root + (apply #'vc-do-async-command buffer root vc-bzr-program bzr-command args) buffer)) @@ -267,7 +262,8 @@ in the repository root directory of FILE." ;; If there is no parent, this must be a new repo. ;; If file is in dirstate, can only be added (b#8025). ((or (not (match-beginning 4)) - (eq (char-after (match-beginning 4)) ?a)) 'added) + (eq (char-after (match-beginning 4)) ?a)) + 'added) ((or (and (eql (string-to-number (match-string 3)) (file-attribute-size (file-attributes file))) (equal (match-string 5) @@ -280,7 +276,7 @@ in the repository root directory of FILE." (memq ?x (mapcar - 'identity + #'identity (file-attribute-modes (file-attributes file)))))) (if (eq (char-after (match-beginning 7)) @@ -374,13 +370,13 @@ If PROMPT is non-nil, prompt for the Bzr command to run." command (cadr args) args (cddr args))) (require 'vc-dispatcher) - (let ((buf (apply 'vc-bzr-async-command command args))) + (let ((buf (apply #'vc-bzr-async-command command args))) (with-current-buffer buf (vc-run-delayed (vc-compilation-mode 'bzr) (setq-local compile-command (concat vc-bzr-program " " command " " - (if args (mapconcat 'identity args " ") ""))))) + (if args (mapconcat #'identity args " ") ""))))) (vc-set-async-update buf)))) (defun vc-bzr-pull (prompt) @@ -424,7 +420,7 @@ default if it is available." (vc-bzr-program (car cmd)) (command (cadr cmd)) (args (cddr cmd))) - (let ((buf (apply 'vc-bzr-async-command command args))) + (let ((buf (apply #'vc-bzr-async-command command args))) (with-current-buffer buf (vc-run-delayed (vc-compilation-mode 'bzr))) (vc-set-async-update buf)))) @@ -512,7 +508,7 @@ in the branch repository (or whose status not be determined)." (unless (re-search-forward "^<<<<<<< " nil t) (vc-bzr-command "resolve" nil 0 buffer-file-name) ;; Remove the hook so that it is not called multiple times. - (remove-hook 'after-save-hook 'vc-bzr-resolve-when-done t)))) + (remove-hook 'after-save-hook #'vc-bzr-resolve-when-done t)))) (defun vc-bzr-find-file-hook () (when (and buffer-file-name @@ -529,7 +525,7 @@ in the branch repository (or whose status not be determined)." ;; but the one in `bzr pull' isn't, so it would be good to provide an ;; elisp function to remerge from the .BASE/OTHER/THIS files. (smerge-start-session) - (add-hook 'after-save-hook 'vc-bzr-resolve-when-done nil t) + (add-hook 'after-save-hook #'vc-bzr-resolve-when-done nil t) (vc-message-unresolved-conflicts buffer-file-name))) (defun vc-bzr-version-dirstate (dir) @@ -643,7 +639,7 @@ Returns nil if unable to find this information." ;; Could run `bzr status' in the directory and see if it succeeds, but ;; that's relatively expensive. -(defalias 'vc-bzr-responsible-p 'vc-bzr-root +(defalias 'vc-bzr-responsible-p #'vc-bzr-root "Return non-nil if FILE is (potentially) controlled by bzr. The criterion is that there is a `.bzr' directory in the same or a superior directory.") @@ -664,7 +660,7 @@ or a superior directory.") (defun vc-bzr-checkin (files comment &optional _rev) "Check FILES in to bzr with log message COMMENT." - (apply 'vc-bzr-command "commit" nil 0 files + (apply #'vc-bzr-command "commit" nil 0 files (cons "-m" (log-edit-extract-headers `(("Author" . ,(vc-bzr--sanitize-header "--author")) ("Date" . ,(vc-bzr--sanitize-header "--commit-time")) @@ -699,7 +695,7 @@ or a superior directory.") (defvar log-view-expanded-log-entry-function) (define-derived-mode vc-bzr-log-view-mode log-view-mode "Bzr-Log-View" - (remove-hook 'log-view-mode-hook 'vc-bzr-log-view-mode) ;Deactivate the hack. + (remove-hook 'log-view-mode-hook #'vc-bzr-log-view-mode) ;Deactivate the hack. (require 'add-log) (setq-local log-view-per-file-logs nil) (setq-local log-view-file-re regexp-unmatchable) @@ -745,7 +741,7 @@ If LIMIT is non-nil, show no more than this many entries." ;; the log display may not what the user wants - but I see no other ;; way of getting the above regexps working. (with-current-buffer buffer - (apply 'vc-bzr-command "log" buffer 'async files + (apply #'vc-bzr-command "log" buffer 'async files (append (if shortlog '("--line") '("--long")) ;; The extra complications here when start-revision and limit @@ -761,7 +757,8 @@ If LIMIT is non-nil, show no more than this many entries." ;; This means we don't have to use --no-aliases. ;; Is -c any different to -r in this case? "-r%s" - "-r..%s") start-revision))) + "-r..%s") + start-revision))) (if (eq vc-log-view-type 'with-diff) (list "-p")) (when limit (list "-l" (format "%s" limit))) ;; There is no sensible way to combine --limit and --forward, @@ -782,7 +779,7 @@ If LIMIT is non-nil, show no more than this many entries." (defun vc-bzr-expanded-log-entry (revision) (with-temp-buffer - (apply 'vc-bzr-command "log" t nil nil + (apply #'vc-bzr-command "log" t nil nil (append (list "--long" (format "-r%s" revision)) (if (stringp vc-bzr-log-switches) @@ -795,11 +792,11 @@ If LIMIT is non-nil, show no more than this many entries." (buffer-substring (match-end 0) (point-max))))) (defun vc-bzr-log-incoming (buffer remote-location) - (apply 'vc-bzr-command "missing" buffer 'async nil + (apply #'vc-bzr-command "missing" buffer 'async nil (list "--theirs-only" (unless (string= remote-location "") remote-location)))) (defun vc-bzr-log-outgoing (buffer remote-location) - (apply 'vc-bzr-command "missing" buffer 'async nil + (apply #'vc-bzr-command "missing" buffer 'async nil (list "--mine-only" (unless (string= remote-location "") remote-location)))) (defun vc-bzr-show-log-entry (revision) @@ -830,7 +827,7 @@ If LIMIT is non-nil, show no more than this many entries." (append ;; Only add --diff-options if there are any diff switches. (unless (zerop (length switches)) - (list "--diff-options" (mapconcat 'identity switches " "))) + (list "--diff-options" (mapconcat #'identity switches " "))) ;; This `when' is just an optimization because bzr-1.2 is *much* ;; faster when the revision argument is not given. (when (or rev1 rev2) @@ -995,7 +992,7 @@ stream. Standard error output is discarded." (defun vc-bzr-dir-status-files (dir files update-function) "Return a list of conses (file . state) for DIR." - (apply 'vc-bzr-command "status" (current-buffer) 'async dir "-v" "-S" files) + (apply #'vc-bzr-command "status" (current-buffer) 'async dir "-v" "-S" files) (vc-run-delayed (vc-bzr-after-dir-status update-function ;; "bzr status" results are relative to @@ -1010,15 +1007,15 @@ stream. Standard error output is discarded." (defvar vc-bzr-shelve-map (let ((map (make-sparse-keymap))) ;; Turn off vc-dir marking - (define-key map [mouse-2] 'ignore) - - (define-key map [down-mouse-3] 'vc-bzr-shelve-menu) - (define-key map "\C-k" 'vc-bzr-shelve-delete-at-point) - (define-key map "=" 'vc-bzr-shelve-show-at-point) - (define-key map "\C-m" 'vc-bzr-shelve-show-at-point) - (define-key map "A" 'vc-bzr-shelve-apply-and-keep-at-point) - (define-key map "P" 'vc-bzr-shelve-apply-at-point) - (define-key map "S" 'vc-bzr-shelve-snapshot) + (define-key map [mouse-2] #'ignore) + + (define-key map [down-mouse-3] #'vc-bzr-shelve-menu) + (define-key map "\C-k" #'vc-bzr-shelve-delete-at-point) + (define-key map "=" #'vc-bzr-shelve-show-at-point) + (define-key map "\C-m" #'vc-bzr-shelve-show-at-point) + (define-key map "A" #'vc-bzr-shelve-apply-and-keep-at-point) + (define-key map "P" #'vc-bzr-shelve-apply-at-point) + (define-key map "S" #'vc-bzr-shelve-snapshot) map)) (defvar vc-bzr-shelve-menu-map @@ -1211,7 +1208,7 @@ stream. Standard error output is discarded." (let ((vc-bzr-revisions '()) (default-directory (file-name-directory (car files)))) (with-temp-buffer - (apply 'vc-bzr-command "log" t 0 files + (apply #'vc-bzr-command "log" t 0 files (append '("--line") (if (stringp vc-bzr-log-switches) (list vc-bzr-log-switches) diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el index 0adb5328bc2..ef607133e86 100644 --- a/lisp/vc/vc-cvs.el +++ b/lisp/vc/vc-cvs.el @@ -76,8 +76,7 @@ (repeat :tag "Argument List" :value ("") string)) - :version "22.1" - :group 'vc-cvs) + :version "22.1") (defcustom vc-cvs-register-switches nil "Switches for registering a file into CVS. @@ -88,8 +87,7 @@ If t, use no switches." (const :tag "None" t) (string :tag "Argument String") (repeat :tag "Argument List" :value ("") string)) - :version "21.1" - :group 'vc-cvs) + :version "21.1") (defcustom vc-cvs-diff-switches nil "String or list of strings specifying switches for CVS diff under VC. @@ -98,8 +96,7 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." (const :tag "None" t) (string :tag "Argument String") (repeat :tag "Argument List" :value ("") string)) - :version "21.1" - :group 'vc-cvs) + :version "21.1") (defcustom vc-cvs-annotate-switches nil "String or list of strings specifying switches for cvs annotate under VC. @@ -109,22 +106,19 @@ switches." (const :tag "None" t) (string :tag "Argument String") (repeat :tag "Argument List" :value ("") string)) - :version "25.1" - :group 'vc-cvs) + :version "25.1") (defcustom vc-cvs-header '("$Id\ $") "Header keywords to be inserted by `vc-insert-headers'." :version "24.1" ; no longer consult the obsolete vc-header-alist - :type '(repeat string) - :group 'vc-cvs) + :type '(repeat string)) (defcustom vc-cvs-use-edit t "Non-nil means to use `cvs edit' to \"check out\" a file. This is only meaningful if you don't use the implicit checkout model \(i.e. if you have $CVSREAD set)." :type 'boolean - :version "21.1" - :group 'vc-cvs) + :version "21.1") (defcustom vc-cvs-stay-local 'only-file "Non-nil means use local operations when possible for remote repositories. @@ -151,16 +145,14 @@ except for hosts matched by these regular expressions." (regexp :format " stay local,\n%t: %v" :tag "if it matches") (repeat :format "%v%i\n" :inline t (regexp :tag "or")))) - :version "23.1" - :group 'vc-cvs) + :version "23.1") (defcustom vc-cvs-sticky-date-format-string "%c" "Format string for mode-line display of sticky date. Format is according to `format-time-string'. Only used if `vc-cvs-sticky-tag-display' is t." :type '(string) - :version "22.1" - :group 'vc-cvs) + :version "22.1") (defcustom vc-cvs-sticky-tag-display t "Specify the mode-line display of sticky tags. @@ -198,8 +190,7 @@ displayed. Date and time is displayed for sticky dates. See also variable `vc-cvs-sticky-date-format-string'." :type '(choice boolean function) - :version "22.1" - :group 'vc-cvs) + :version "22.1") ;;; ;;; Internal variables @@ -310,7 +301,7 @@ to the CVS command." (vc-cvs-could-register file) (push (directory-file-name (file-name-directory file)) dirs))) (if dirs (vc-cvs-register dirs))) - (apply 'vc-cvs-command nil 0 files + (apply #'vc-cvs-command nil 0 files "add" (and comment (string-match "[^\t\n ]" comment) (concat "-m" comment)) @@ -346,12 +337,12 @@ its parents." (error "%s is not a valid symbolic tag name" rev) ;; If the input revision is a valid symbolic tag name, we create it ;; as a branch, commit and switch to it. - (apply 'vc-cvs-command nil 0 files "tag" "-b" (list rev)) - (apply 'vc-cvs-command nil 0 files "update" "-r" (list rev)) + (apply #'vc-cvs-command nil 0 files "tag" "-b" (list rev)) + (apply #'vc-cvs-command nil 0 files "update" "-r" (list rev)) (mapc (lambda (file) (vc-file-setprop file 'vc-cvs-sticky-tag rev)) files))) (let ((status (apply - 'vc-cvs-command nil 1 files + #'vc-cvs-command nil 1 files "ci" (if rev (concat "-r" rev)) (concat "-m" (car (log-edit-extract-headers nil comment))) (vc-switches 'CVS 'checkin)))) @@ -378,7 +369,7 @@ its parents." (vc-file-setprop (car files) 'vc-working-revision (vc-parse-buffer "^\\(new\\|initial\\) revision: \\([0-9.]+\\)" 2)) - (mapc 'vc-file-clearprops files)) + (mapc #'vc-file-clearprops files)) ;; Anyway, forget the checkout model of the file, because we might have ;; guessed wrong when we found the file. After commit, we can ;; tell it from the permissions of the file (see @@ -391,7 +382,7 @@ its parents." (vc-cvs-command nil 0 files "update" "-A")))) (defun vc-cvs-find-revision (file rev buffer) - (apply 'vc-cvs-command + (apply #'vc-cvs-command buffer 0 file "-Q" ; suppress diagnostic output "update" @@ -416,7 +407,7 @@ REV is the revision to check out." (if (equal file buffer-file-name) (read-only-mode -1)))) ;; Check out a particular revision (or recreate the file). (vc-file-setprop file 'vc-working-revision nil) - (apply 'vc-cvs-command nil 0 file + (apply #'vc-cvs-command nil 0 file "-w" "update" (when rev @@ -600,7 +591,7 @@ Remaining arguments are ignored." ;; This used to append diff-switches and vc-diff-switches, ;; which was consistent with the vc-diff-switches doc at that ;; time, but not with the actual behavior of any other VC diff. - (apply 'vc-do-command (or buffer "*vc-diff*") 1 "diff" nil + (apply #'vc-do-command (or buffer "*vc-diff*") 1 "diff" nil ;; Not a CVS diff, does not use vc-cvs-diff-switches. (append (vc-switches nil 'diff) (list (file-relative-name file-oldvers) @@ -608,7 +599,7 @@ Remaining arguments are ignored." (setq status 0)) (push file invoke-cvs-diff-list))))) (when invoke-cvs-diff-list - (setq status (apply 'vc-cvs-command (or buffer "*vc-diff*") + (setq status (apply #'vc-cvs-command (or buffer "*vc-diff*") (if async 'async 1) invoke-cvs-diff-list "diff" (and oldvers (concat "-r" oldvers)) @@ -787,7 +778,7 @@ If UPDATE is non-nil, then update (resynch) any affected buffers." "A wrapper around `vc-do-command' for use in vc-cvs.el. The difference to vc-do-command is that this function always invokes `cvs', and that it passes `vc-cvs-global-switches' to it before FLAGS." - (apply 'vc-do-command (or buffer "*vc*") okstatus "cvs" files + (apply #'vc-do-command (or buffer "*vc*") okstatus "cvs" files (if (stringp vc-cvs-global-switches) (cons vc-cvs-global-switches flags) (append vc-cvs-global-switches @@ -816,7 +807,7 @@ individually should stay local." (setq default nil stay-local (cdr stay-local))) (when (consp stay-local) (setq stay-local - (mapconcat 'identity stay-local "\\|"))) + (mapconcat #'identity stay-local "\\|"))) (if (if (string-match stay-local hostname) default (not default)) 'yes 'no)))))))))))) diff --git a/lisp/vc/vc-dav.el b/lisp/vc/vc-dav.el index 88f46eff059..5fd8d8e5036 100644 --- a/lisp/vc/vc-dav.el +++ b/lisp/vc/vc-dav.el @@ -1,4 +1,4 @@ -;;; vc-dav.el --- vc.el support for WebDAV +;;; vc-dav.el --- vc.el support for WebDAV -*- lexical-binding: t; -*- ;; Copyright (C) 2001, 2004-2021 Free Software Foundation, Inc. @@ -64,7 +64,7 @@ For a list of possible values, see `vc-state'." 'edited (cdr (car locks))))))) -(defun vc-dav-checkout-model (url) +(defun vc-dav-checkout-model (_url) "Indicate whether URL needs to be \"checked out\" before it can be edited. See `vc-checkout-model' for a list of possible values." ;; The only thing we can support with webdav is 'locking @@ -72,21 +72,21 @@ See `vc-checkout-model' for a list of possible values." ;; This should figure out the version # of the file somehow. What is ;; the most appropriate property in WebDAV to look at for this? -(defun vc-dav-workfile-version (url) +(defun vc-dav-workfile-version (_url) "Return the current workfile version of URL." "Unknown") -(defun vc-dav-register (url &optional _comment) +(defun vc-dav-register (_url &optional _comment) "Register URL in the DAV backend." ;; Do we need to do anything here? FIXME? ) -(defun vc-dav-checkin (url comment &optional _rev) +(defun vc-dav-checkin (_url _comment &optional _rev) "Commit changes in URL to WebDAV. COMMENT is used as a check-in comment." ;; This should PUT the resource and release any locks that we hold. ) -(defun vc-dav-checkout (url &optional rev destfile) +(defun vc-dav-checkout (_url &optional _rev _destfile) "Check out revision REV of URL into the working area. If EDITABLE is non-nil URL should be writable by the user and if @@ -101,7 +101,7 @@ write the contents to. ;; This should LOCK the resource. ) -(defun vc-dav-revert (url &optional contents-done) +(defun vc-dav-revert (_url &optional _contents-done) "Revert URL back to the current workfile version. If optional arg CONTENTS-DONE is non-nil, then the contents of FILE @@ -112,11 +112,11 @@ only needs to update the status of URL within the backend. ;; Should UNLOCK the file. ) -(defun vc-dav-print-log (url) +(defun vc-dav-print-log (_url) "Insert the revision log of URL into the *vc* buffer." ) -(defun vc-dav-diff (url &optional rev1 rev2 buffer async) +(defun vc-dav-diff (_url &optional _rev1 _rev2 _buffer _async) "Insert the diff for URL into the *vc-diff* buffer. If REV1 and REV2 are non-nil report differences from REV1 to REV2. If REV1 is nil, use the current workfile version as the older version. @@ -135,11 +135,11 @@ It should return a status of either 0 (no differences found), or ;; This should use url-dav-get-properties with a depth of `1' to get ;; all the properties. -(defun vc-dav-dir-state (url) +(defun vc-dav-dir-state (_url) "find the version control state of all files in DIR in a fast way." ) -(defun vc-dav-responsible-p (url) +(defun vc-dav-responsible-p (_url) "Return non-nil if DAV considers itself `responsible' for URL." ;; Check for DAV support on the web server. t) diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index 46fbf448616..eb8cf8192c1 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -302,67 +302,67 @@ See `run-hooks'." (defvar vc-dir-mode-map (let ((map (make-sparse-keymap))) ;; VC commands - (define-key map "v" 'vc-next-action) ;; C-x v v - (define-key map "=" 'vc-diff) ;; C-x v = - (define-key map "D" 'vc-root-diff) ;; C-x v D - (define-key map "i" 'vc-register) ;; C-x v i - (define-key map "+" 'vc-update) ;; C-x v + + (define-key map "v" #'vc-next-action) ;; C-x v v + (define-key map "=" #'vc-diff) ;; C-x v = + (define-key map "D" #'vc-root-diff) ;; C-x v D + (define-key map "i" #'vc-register) ;; C-x v i + (define-key map "+" #'vc-update) ;; C-x v + ;; I'd prefer some kind of symmetry with vc-update: - (define-key map "P" 'vc-push) ;; C-x v P - (define-key map "l" 'vc-print-log) ;; C-x v l - (define-key map "L" 'vc-print-root-log) ;; C-x v L - (define-key map "I" 'vc-log-incoming) ;; C-x v I - (define-key map "O" 'vc-log-outgoing) ;; C-x v O + (define-key map "P" #'vc-push) ;; C-x v P + (define-key map "l" #'vc-print-log) ;; C-x v l + (define-key map "L" #'vc-print-root-log) ;; C-x v L + (define-key map "I" #'vc-log-incoming) ;; C-x v I + (define-key map "O" #'vc-log-outgoing) ;; C-x v O ;; More confusing than helpful, probably - ;;(define-key map "R" 'vc-revert) ;; u is taken by vc-dir-unmark. - ;;(define-key map "A" 'vc-annotate) ;; g is taken by revert-buffer + ;;(define-key map "R" #'vc-revert) ;; u is taken by vc-dir-unmark. + ;;(define-key map "A" #'vc-annotate) ;; g is taken by revert-buffer ;; bound by `special-mode'. ;; Marking. - (define-key map "m" 'vc-dir-mark) - (define-key map "d" 'vc-dir-clean-files) - (define-key map "M" 'vc-dir-mark-all-files) - (define-key map "u" 'vc-dir-unmark) - (define-key map "U" 'vc-dir-unmark-all-files) - (define-key map "\C-?" 'vc-dir-unmark-file-up) - (define-key map "\M-\C-?" 'vc-dir-unmark-all-files) + (define-key map "m" #'vc-dir-mark) + (define-key map "d" #'vc-dir-clean-files) + (define-key map "M" #'vc-dir-mark-all-files) + (define-key map "u" #'vc-dir-unmark) + (define-key map "U" #'vc-dir-unmark-all-files) + (define-key map "\C-?" #'vc-dir-unmark-file-up) + (define-key map "\M-\C-?" #'vc-dir-unmark-all-files) ;; Movement. - (define-key map "n" 'vc-dir-next-line) - (define-key map " " 'vc-dir-next-line) - (define-key map "\t" 'vc-dir-next-directory) - (define-key map "p" 'vc-dir-previous-line) - (define-key map [?\S-\ ] 'vc-dir-previous-line) - (define-key map [backtab] 'vc-dir-previous-directory) + (define-key map "n" #'vc-dir-next-line) + (define-key map " " #'vc-dir-next-line) + (define-key map "\t" #'vc-dir-next-directory) + (define-key map "p" #'vc-dir-previous-line) + (define-key map [?\S-\ ] #'vc-dir-previous-line) + (define-key map [backtab] #'vc-dir-previous-directory) ;;; Rebind paragraph-movement commands. - (define-key map "\M-}" 'vc-dir-next-directory) - (define-key map "\M-{" 'vc-dir-previous-directory) - (define-key map [C-down] 'vc-dir-next-directory) - (define-key map [C-up] 'vc-dir-previous-directory) + (define-key map "\M-}" #'vc-dir-next-directory) + (define-key map "\M-{" #'vc-dir-previous-directory) + (define-key map [C-down] #'vc-dir-next-directory) + (define-key map [C-up] #'vc-dir-previous-directory) ;; The remainder. - (define-key map "f" 'vc-dir-find-file) - (define-key map "e" 'vc-dir-find-file) ; dired-mode compatibility - (define-key map "\C-m" 'vc-dir-find-file) - (define-key map "o" 'vc-dir-find-file-other-window) - (define-key map "\C-o" 'vc-dir-display-file) - (define-key map "\C-c\C-c" 'vc-dir-kill-dir-status-process) - (define-key map [down-mouse-3] 'vc-dir-menu) + (define-key map "f" #'vc-dir-find-file) + (define-key map "e" #'vc-dir-find-file) ; dired-mode compatibility + (define-key map "\C-m" #'vc-dir-find-file) + (define-key map "o" #'vc-dir-find-file-other-window) + (define-key map "\C-o" #'vc-dir-display-file) + (define-key map "\C-c\C-c" #'vc-dir-kill-dir-status-process) + (define-key map [down-mouse-3] #'vc-dir-menu) (define-key map [follow-link] 'mouse-face) - (define-key map "x" 'vc-dir-hide-up-to-date) - (define-key map [?\C-k] 'vc-dir-kill-line) - (define-key map "S" 'vc-dir-search) ;; FIXME: Maybe use A like dired? - (define-key map "Q" 'vc-dir-query-replace-regexp) - (define-key map (kbd "M-s a C-s") 'vc-dir-isearch) - (define-key map (kbd "M-s a M-C-s") 'vc-dir-isearch-regexp) - (define-key map "G" 'vc-dir-ignore) + (define-key map "x" #'vc-dir-hide-up-to-date) + (define-key map [?\C-k] #'vc-dir-kill-line) + (define-key map "S" #'vc-dir-search) ;; FIXME: Maybe use A like dired? + (define-key map "Q" #'vc-dir-query-replace-regexp) + (define-key map (kbd "M-s a C-s") #'vc-dir-isearch) + (define-key map (kbd "M-s a M-C-s") #'vc-dir-isearch-regexp) + (define-key map "G" #'vc-dir-ignore) (let ((branch-map (make-sparse-keymap))) (define-key map "B" branch-map) - (define-key branch-map "c" 'vc-create-tag) - (define-key branch-map "l" 'vc-print-branch-log) - (define-key branch-map "s" 'vc-retrieve-tag)) + (define-key branch-map "c" #'vc-create-tag) + (define-key branch-map "l" #'vc-print-branch-log) + (define-key branch-map "s" #'vc-retrieve-tag)) (let ((mark-map (make-sparse-keymap))) (define-key map "*" mark-map) - (define-key mark-map "r" 'vc-dir-mark-registered-files)) + (define-key mark-map "r" #'vc-dir-mark-registered-files)) ;; Hook up the menu. (define-key map [menu-bar vc-dir-mode] @@ -506,7 +506,7 @@ If NOINSERT, ignore elements on ENTRIES which are not in the ewoc." (t (unless noinsert (ewoc-enter-before vc-ewoc node - (apply 'vc-dir-create-fileinfo entry))) + (apply #'vc-dir-create-fileinfo entry))) (setq entries (cdr entries)) (setq entry (car entries)))))) (t @@ -522,7 +522,7 @@ If NOINSERT, ignore elements on ENTRIES which are not in the ewoc." vc-ewoc node (vc-dir-create-fileinfo rd nil nil nil entrydir)))) ;; Now insert the node itself. (ewoc-enter-before vc-ewoc node - (apply 'vc-dir-create-fileinfo entry))) + (apply #'vc-dir-create-fileinfo entry))) (setq entries (cdr entries) entry (car entries)))))) ;; We're past the last node, all remaining entries go to the end. (unless (or node noinsert) @@ -538,10 +538,10 @@ If NOINSERT, ignore elements on ENTRIES which are not in the ewoc." vc-ewoc (vc-dir-create-fileinfo rd nil nil nil entrydir)))) ;; Now insert the node itself. (ewoc-enter-last vc-ewoc - (apply 'vc-dir-create-fileinfo entry)))))) + (apply #'vc-dir-create-fileinfo entry)))))) (when to-remove (let ((inhibit-read-only t)) - (apply 'ewoc-delete vc-ewoc (nreverse to-remove))))))) + (apply #'ewoc-delete vc-ewoc (nreverse to-remove))))))) (defun vc-dir-busy () (and (buffer-live-p vc-dir-process-buffer) @@ -882,7 +882,7 @@ system; see `vc-dir-delete-file'." The files will also be marked as deleted in the version control system." (interactive) - (mapc 'vc-delete-file (or (vc-dir-marked-files) + (mapc #'vc-delete-file (or (vc-dir-marked-files) (list (vc-dir-current-file))))) (defun vc-dir-find-file () @@ -912,13 +912,13 @@ system." "Search for a string through all marked buffers using Isearch." (interactive) (multi-isearch-files - (mapcar 'car (vc-dir-marked-only-files-and-states)))) + (mapcar #'car (vc-dir-marked-only-files-and-states)))) (defun vc-dir-isearch-regexp () "Search for a regexp through all marked buffers using Isearch." (interactive) (multi-isearch-files-regexp - (mapcar 'car (vc-dir-marked-only-files-and-states)))) + (mapcar #'car (vc-dir-marked-only-files-and-states)))) (defun vc-dir-search (regexp) "Search through all marked files for a match for REGEXP. @@ -943,13 +943,13 @@ with the command \\[tags-loop-continue]." (query-replace-read-args "Query replace regexp in marked files" t t))) (list (nth 0 common) (nth 1 common) (nth 2 common)))) - (dolist (file (mapcar 'car (vc-dir-marked-only-files-and-states))) + (dolist (file (mapcar #'car (vc-dir-marked-only-files-and-states))) (let ((buffer (get-file-buffer file))) (if (and buffer (with-current-buffer buffer buffer-read-only)) (error "File `%s' is visited read-only" file)))) (fileloop-initialize-replace - from to (mapcar 'car (vc-dir-marked-only-files-and-states)) + from to (mapcar #'car (vc-dir-marked-only-files-and-states)) (if (equal from (downcase from)) nil 'default) delimited) (fileloop-continue)) @@ -1161,7 +1161,7 @@ the *vc-dir* buffer. (add-to-list 'vc-dir-buffers (current-buffer)) ;; Make sure that if the directory buffer is killed, the update ;; process running in the background is also killed. - (add-hook 'kill-buffer-query-functions 'vc-dir-kill-query nil t) + (add-hook 'kill-buffer-query-functions #'vc-dir-kill-query nil t) (hack-dir-local-variables-non-file-buffer) (vc-dir-refresh))) @@ -1276,7 +1276,7 @@ Throw an error if another update process is in progress." vc-ewoc 'vc-dir-fileinfo->needs-update))) (if remaining (vc-dir-refresh-files - (mapcar 'vc-dir-fileinfo->name remaining)) + (mapcar #'vc-dir-fileinfo->name remaining)) (setq mode-line-process nil) (run-hooks 'vc-dir-refresh-hook)))))))))))) @@ -1330,7 +1330,7 @@ state of item at point, if any." (ewoc-delete vc-ewoc crt)) (setq crt prev))))) -(defalias 'vc-dir-hide-up-to-date 'vc-dir-hide-state) +(defalias 'vc-dir-hide-up-to-date #'vc-dir-hide-state) (defun vc-dir-kill-line () "Remove the current line from display." @@ -1366,7 +1366,7 @@ state of item at point, if any." (unless (vc-compatible-state (cdr crt) state) (error "When applying VC operations to multiple files, the files are required\nto be in similar VC states.\n%s in state %s clashes with %s in state %s" (car crt) (cdr crt) (caar only-files-list) state))) - (setq only-files-list (mapcar 'car only-files-list)) + (setq only-files-list (mapcar #'car only-files-list)) (when (and state (not (eq state 'unregistered))) (setq model (vc-checkout-model vc-dir-backend only-files-list)))) (list vc-dir-backend files only-files-list state model))) @@ -1437,13 +1437,13 @@ These are the commands available for use in the file status buffer: (defvar vc-dir-status-mouse-map (let ((map (make-sparse-keymap))) - (define-key map [mouse-2] 'vc-dir-toggle-mark) + (define-key map [mouse-2] #'vc-dir-toggle-mark) map) "Local keymap for toggling mark.") (defvar vc-dir-filename-mouse-map (let ((map (make-sparse-keymap))) - (define-key map [mouse-2] 'vc-dir-find-file-other-window) + (define-key map [mouse-2] #'vc-dir-find-file-other-window) map) "Local keymap for visiting a file.") diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el index 2573964c42c..2b477dff0a3 100644 --- a/lisp/vc/vc-dispatcher.el +++ b/lisp/vc/vc-dispatcher.el @@ -242,7 +242,7 @@ CODE should be a function of no arguments." ((or (null proc) (eq (process-status proc) 'exit)) ;; Make sure we've read the process's output before going further. (when proc (accept-process-output proc)) - (if (functionp code) (funcall code) (eval code))) + (if (functionp code) (funcall code) (eval code t))) ;; If a process is running, add CODE to the sentinel ((eq (process-status proc) 'run) (vc-set-mode-line-busy-indicator) @@ -267,7 +267,7 @@ and is passed 3 arguments: the COMMAND, the FILES and the FLAGS.") (defun vc-delistify (filelist) "Smash a FILELIST into a file list string suitable for info messages." ;; FIXME what about file names with spaces? - (if (not filelist) "." (mapconcat 'identity filelist " "))) + (if (not filelist) "." (mapconcat #'identity filelist " "))) (defcustom vc-tor nil "If non-nil, communicate with the repository site via Tor. @@ -331,7 +331,7 @@ case, and the process object in the asynchronous case." ;; Run asynchronously. (let ((proc (let ((process-connection-type nil)) - (apply 'start-file-process command (current-buffer) + (apply #'start-file-process command (current-buffer) command squeezed)))) (when vc-command-messages (let ((inhibit-message (eq (selected-window) (active-minibuffer-window)))) @@ -339,7 +339,7 @@ case, and the process object in the asynchronous case." ;; Get rid of the default message insertion, in case we don't ;; set a sentinel explicitly. (set-process-sentinel proc #'ignore) - (set-process-filter proc 'vc-process-filter) + (set-process-filter proc #'vc-process-filter) (setq status proc) (when vc-command-messages (vc-run-delayed @@ -351,7 +351,7 @@ case, and the process object in the asynchronous case." (let ((inhibit-message (eq (selected-window) (active-minibuffer-window)))) (message "Running in foreground: %s" full-command))) (let ((buffer-undo-list t)) - (setq status (apply 'process-file command nil t nil squeezed))) + (setq status (apply #'process-file command nil t nil squeezed))) (when (and (not (eq t okstatus)) (or (not (integerp status)) (and okstatus (< okstatus status)))) @@ -394,7 +394,7 @@ Display the buffer in some window, but don't select it." (insert "\"...\n") ;; Run in the original working directory. (let ((default-directory dir)) - (apply 'vc-do-command t 'async command nil args))) + (apply #'vc-do-command t 'async command nil args))) (setq window (display-buffer buffer)) (if window (set-window-start window new-window-start)) diff --git a/lisp/vc/vc-filewise.el b/lisp/vc/vc-filewise.el index ee73aa6f938..e1b042a7424 100644 --- a/lisp/vc/vc-filewise.el +++ b/lisp/vc/vc-filewise.el @@ -1,4 +1,4 @@ -;;; vc-filewise.el --- common functions for file-oriented back ends. +;;; vc-filewise.el --- common functions for file-oriented back ends. -*- lexical-binding: t; -*- ;; Copyright (C) 1992-1996, 1998-2021 Free Software Foundation, Inc. diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 25ae26d746a..465ed8735c2 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -106,6 +106,7 @@ ;;; Code: (require 'cl-lib) +(require 'vc-dispatcher) (eval-when-compile (require 'subr-x) ; for string-trim-right (require 'vc) @@ -658,29 +659,29 @@ or an empty string if none." (defvar vc-git-stash-shared-map (let ((map (make-sparse-keymap))) - (define-key map "S" 'vc-git-stash-snapshot) - (define-key map "C" 'vc-git-stash) + (define-key map "S" #'vc-git-stash-snapshot) + (define-key map "C" #'vc-git-stash) map)) (defvar vc-git-stash-map (let ((map (make-sparse-keymap))) (set-keymap-parent map vc-git-stash-shared-map) ;; Turn off vc-dir marking - (define-key map [mouse-2] 'ignore) - - (define-key map [down-mouse-3] 'vc-git-stash-menu) - (define-key map "\C-k" 'vc-git-stash-delete-at-point) - (define-key map "=" 'vc-git-stash-show-at-point) - (define-key map "\C-m" 'vc-git-stash-show-at-point) - (define-key map "A" 'vc-git-stash-apply-at-point) - (define-key map "P" 'vc-git-stash-pop-at-point) + (define-key map [mouse-2] #'ignore) + + (define-key map [down-mouse-3] #'vc-git-stash-menu) + (define-key map "\C-k" #'vc-git-stash-delete-at-point) + (define-key map "=" #'vc-git-stash-show-at-point) + (define-key map "\C-m" #'vc-git-stash-show-at-point) + (define-key map "A" #'vc-git-stash-apply-at-point) + (define-key map "P" #'vc-git-stash-pop-at-point) map)) (defvar vc-git-stash-button-map (let ((map (make-sparse-keymap))) (set-keymap-parent map vc-git-stash-shared-map) - (define-key map [mouse-2] 'push-button) - (define-key map "\C-m" 'push-button) + (define-key map [mouse-2] #'push-button) + (define-key map "\C-m" #'push-button) map)) (defconst vc-git-stash-shared-help @@ -871,7 +872,7 @@ The car of the list is the current branch." (when dlist (vc-git-command nil 0 dlist "add")))) -(defalias 'vc-git-responsible-p 'vc-git-root) +(defalias 'vc-git-responsible-p #'vc-git-root) (defun vc-git-unregister (file) (vc-git-command nil 0 file "rm" "-f" "--cached" "--")) @@ -905,9 +906,9 @@ If toggling on, also insert its message into the buffer." (defvar vc-git-log-edit-mode-map (let ((map (make-sparse-keymap "Git-Log-Edit"))) - (define-key map "\C-c\C-s" 'vc-git-log-edit-toggle-signoff) - (define-key map "\C-c\C-n" 'vc-git-log-edit-toggle-no-verify) - (define-key map "\C-c\C-e" 'vc-git-log-edit-toggle-amend) + (define-key map "\C-c\C-s" #'vc-git-log-edit-toggle-signoff) + (define-key map "\C-c\C-n" #'vc-git-log-edit-toggle-no-verify) + (define-key map "\C-c\C-e" #'vc-git-log-edit-toggle-amend) map)) (define-derived-mode vc-git-log-edit-mode log-edit-mode "Log-Edit/git" @@ -941,7 +942,7 @@ It is based on `log-edit-mode', and has Git-specific extensions.") (lambda (value) (when (equal value "yes") (list argument))))) ;; When operating on the whole tree, better pass "-a" than ".", since "." ;; fails when we're committing a merge. - (apply 'vc-git-command nil 0 (if only files) + (apply #'vc-git-command nil 0 (if only files) (nconc (if msg-file (list "commit" "-F" (file-local-name msg-file)) (list "commit" "-m")) @@ -1024,13 +1025,13 @@ If PROMPT is non-nil, prompt for the Git command to run." args (cddr args))) (setq args (nconc args extra-args)) (require 'vc-dispatcher) - (apply 'vc-do-async-command buffer root git-program command args) + (apply #'vc-do-async-command buffer root git-program command args) (with-current-buffer buffer (vc-run-delayed (vc-compilation-mode 'git) (setq-local compile-command (concat git-program " " command " " - (mapconcat 'identity args " "))) + (mapconcat #'identity args " "))) (setq-local compilation-directory root) ;; Either set `compilation-buffer-name-function' locally to nil ;; or use `compilation-arguments' to set `name-function'. @@ -1068,7 +1069,7 @@ This prompts for a branch to merge from." branches (cons "FETCH_HEAD" branches)) nil t))) - (apply 'vc-do-async-command buffer root vc-git-program "merge" + (apply #'vc-do-async-command buffer root vc-git-program "merge" (list merge-source)) (with-current-buffer buffer (vc-run-delayed (vc-compilation-mode 'git))) (vc-set-async-update buffer))) @@ -1115,7 +1116,7 @@ This prompts for a branch to merge from." (vc-git-command nil 0 nil "reset")) (vc-resynch-buffer buffer-file-name t t) ;; Remove the hook so that it is not called multiple times. - (remove-hook 'after-save-hook 'vc-git-resolve-when-done t)))) + (remove-hook 'after-save-hook #'vc-git-resolve-when-done t)))) (defun vc-git-find-file-hook () "Activate `smerge-mode' if there is a conflict." @@ -1126,7 +1127,7 @@ This prompts for a branch to merge from." (re-search-forward "^<<<<<<< " nil 'noerror))) (smerge-start-session) (when vc-git-resolve-conflicts - (add-hook 'after-save-hook 'vc-git-resolve-when-done nil 'local)) + (add-hook 'after-save-hook #'vc-git-resolve-when-done nil 'local)) (vc-message-unresolved-conflicts buffer-file-name))) ;;; HISTORY FUNCTIONS @@ -1154,7 +1155,7 @@ If LIMIT is a revision string, use it as an end-revision." ;; read-only. (let ((inhibit-read-only t)) (with-current-buffer buffer - (apply 'vc-git-command buffer + (apply #'vc-git-command buffer 'async files (append '("log" "--no-color") @@ -1224,11 +1225,11 @@ log entries." (read-shell-command "Search log with command: " (format "%s %s" vc-git-program - (mapconcat 'identity args " ")) + (mapconcat #'identity args " ")) 'vc-git-history) " " t)))) (vc-setup-buffer buffer) - (apply 'vc-git-command buffer 'async nil args))) + (apply #'vc-git-command buffer 'async nil args))) (defun vc-git-mergebase (rev1 &optional rev2) (unless rev2 (setq rev2 "HEAD")) @@ -1299,7 +1300,7 @@ or BRANCH^ (where \"^\" can be repeated)." (defun vc-git-expanded-log-entry (revision) (with-temp-buffer - (apply 'vc-git-command t nil nil (list "log" revision "-1" "--")) + (apply #'vc-git-command t nil nil (list "log" revision "-1" "--")) (goto-char (point-min)) (unless (eobp) ;; Indent the expanded log entry. @@ -1415,7 +1416,7 @@ This requires git 1.8.4 or later, for the \"-L\" option of \"git log\"." (vc-git-command (or buffer "*vc-diff*") 1 files "difftool" "--exit-code" "--no-prompt" "-x" (concat "diff " - (mapconcat 'identity + (mapconcat #'identity (vc-switches nil 'diff) " ")) rev1 rev2 "--")))) @@ -1776,7 +1777,7 @@ The difference to vc-do-command is that this function always invokes ,@(when revert-buffer-in-progress-p '("GIT_OPTIONAL_LOCKS=0"))) process-environment))) - (apply 'vc-do-command (or buffer "*vc*") okstatus vc-git-program + (apply #'vc-do-command (or buffer "*vc*") okstatus vc-git-program ;; https://debbugs.gnu.org/16897 (unless (and (not (cdr-safe file-or-list)) (let ((file (or (car-safe file-or-list) @@ -1810,10 +1811,10 @@ The difference to vc-do-command is that this function always invokes ,@(when revert-buffer-in-progress-p '("GIT_OPTIONAL_LOCKS=0"))) process-environment))) - (apply 'process-file vc-git-program nil buffer nil "--no-pager" command args))) + (apply #'process-file vc-git-program nil buffer nil "--no-pager" command args))) (defun vc-git--out-ok (command &rest args) - (zerop (apply 'vc-git--call '(t nil) command args))) + (zerop (apply #'vc-git--call '(t nil) command args))) (defun vc-git--run-command-string (file &rest args) "Run a git command on FILE and return its output as string. @@ -1821,7 +1822,7 @@ FILE can be nil." (let* ((ok t) (str (with-output-to-string (with-current-buffer standard-output - (unless (apply 'vc-git--out-ok + (unless (apply #'vc-git--out-ok (if file (append args (list (file-relative-name file))) diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index adb0fce8759..9faed10f383 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -124,8 +124,7 @@ :type '(choice (const :tag "None" nil) (string :tag "Argument String") (repeat :tag "Argument List" :value ("") string)) - :version "22.2" - :group 'vc-hg) + :version "22.2") (defcustom vc-hg-diff-switches t ; Hg doesn't support common args like -u "String or list of strings specifying switches for Hg diff under VC. @@ -134,8 +133,7 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." (const :tag "None" t) (string :tag "Argument String") (repeat :tag "Argument List" :value ("") string)) - :version "23.1" - :group 'vc-hg) + :version "23.1") (defcustom vc-hg-annotate-switches '("-u" "--follow") "String or list of strings specifying switches for hg annotate under VC. @@ -145,8 +143,7 @@ switches." (const :tag "None" t) (string :tag "Argument String") (repeat :tag "Argument List" :value ("") string)) - :version "25.1" - :group 'vc-hg) + :version "25.1") (defcustom vc-hg-revert-switches nil "String or list of strings specifying switches for hg revert @@ -154,13 +151,11 @@ under VC." :type '(choice (const :tag "None" nil) (string :tag "Argument String") (repeat :tag "Argument List" :value ("") string)) - :version "27.1" - :group 'vc-hg) + :version "27.1") (defcustom vc-hg-program "hg" "Name of the Mercurial executable (excluding any arguments)." - :type 'string - :group 'vc-hg) + :type 'string) (defcustom vc-hg-root-log-format `(,(concat "{rev}:{ifeq(branch, 'default','', '{branch}')}" @@ -183,7 +178,6 @@ REGEXP is a regular expression matching the resulting Mercurial output, and KEYWORDS is a list of `font-lock-keywords' for highlighting the Log View buffer." :type '(list string regexp (repeat sexp)) - :group 'vc-hg :version "24.5") (defcustom vc-hg-create-bookmark t @@ -311,8 +305,7 @@ If no list entry produces a useful revision, return `nil'." (const :tag "Active bookmark" builtin-active-bookmark) (string :tag "Hg template") (function :tag "Custom"))) - :version "26.1" - :group 'vc-hg) + :version "26.1") (defcustom vc-hg-use-file-version-for-mode-line-version nil "When enabled, the modeline contains revision information for the visited file. @@ -320,8 +313,7 @@ When not, the revision in the modeline is for the repository working copy. `nil' is the much faster setting for large repositories." :type 'boolean - :version "26.1" - :group 'vc-hg) + :version "26.1") (defun vc-hg--active-bookmark-internal (rev) (when (equal rev ".") @@ -413,8 +405,7 @@ specific file to query." "String or list of strings specifying switches for hg log under VC." :type '(choice (const :tag "None" nil) (string :tag "Argument String") - (repeat :tag "Argument List" :value ("") string)) - :group 'vc-hg) + (repeat :tag "Argument List" :value ("") string))) (autoload 'vc-setup-buffer "vc-dispatcher") @@ -442,7 +433,7 @@ If LIMIT is non-nil, show no more than this many entries." (let ((inhibit-read-only t)) (with-current-buffer buffer - (apply 'vc-hg-command buffer 'async files "log" + (apply #'vc-hg-command buffer 'async files "log" (nconc (when start-revision (list (format "-r%s:0" start-revision))) (when limit (list "-l" (format "%s" limit))) @@ -666,8 +657,7 @@ directly instead of always running Mercurial. We try to be safe against Mercurial data structure format changes and always fall back to running Mercurial directly." :type 'boolean - :version "26.1" - :group 'vc-hg) + :version "26.1") (defsubst vc-hg--read-u8 () "Read and advance over an unsigned byte. @@ -1177,7 +1167,7 @@ hg binary." "Create a new Mercurial repository." (vc-hg-command nil 0 nil "init")) -(defalias 'vc-hg-responsible-p 'vc-hg-root) +(defalias 'vc-hg-responsible-p #'vc-hg-root) (defun vc-hg-unregister (file) "Unregister FILE from hg." @@ -1200,7 +1190,7 @@ If toggling on, also insert its message into the buffer." (defvar vc-hg-log-edit-mode-map (let ((map (make-sparse-keymap "Hg-Log-Edit"))) - (define-key map "\C-c\C-e" 'vc-hg-log-edit-toggle-amend) + (define-key map "\C-c\C-e" #'vc-hg-log-edit-toggle-amend) map)) (define-derived-mode vc-hg-log-edit-mode log-edit-mode "Log-Edit/hg" @@ -1214,7 +1204,7 @@ REV is ignored." (lambda (value) (when (equal value "yes") (list "--amend"))))) - (apply 'vc-hg-command nil 0 files + (apply #'vc-hg-command nil 0 files (nconc (list "commit" "-m") (log-edit-extract-headers `(("Author" . "--user") ("Date" . "--date") @@ -1252,7 +1242,7 @@ REV is the revision to check out into WORKFILE." (unless (re-search-forward "^<<<<<<< " nil t) (vc-hg-command nil 0 buffer-file-name "resolve" "-m") ;; Remove the hook so that it is not called multiple times. - (remove-hook 'after-save-hook 'vc-hg-resolve-when-done t)))) + (remove-hook 'after-save-hook #'vc-hg-resolve-when-done t)))) (defun vc-hg-find-file-hook () (when (and buffer-file-name @@ -1268,7 +1258,7 @@ REV is the revision to check out into WORKFILE." ;; Hg may not recognize "conflict" as a state, but we can do better. (vc-file-setprop buffer-file-name 'vc-state 'conflict) (smerge-start-session) - (add-hook 'after-save-hook 'vc-hg-resolve-when-done nil t) + (add-hook 'after-save-hook #'vc-hg-resolve-when-done nil t) (vc-message-unresolved-conflicts buffer-file-name))) @@ -1443,7 +1433,7 @@ commands, which only operated on marked files." (apply #'vc-hg-command nil 0 nil command - (apply 'nconc + (apply #'nconc (mapcar (lambda (arg) (list "-r" arg)) marked-list))) (let* ((root (vc-hg-root default-directory)) (buffer (format "*vc-hg : %s*" (expand-file-name root))) @@ -1463,18 +1453,18 @@ commands, which only operated on marked files." (setq hg-program (car args) command (cadr args) args (cddr args))) - (apply 'vc-do-async-command buffer root hg-program command args) + (apply #'vc-do-async-command buffer root hg-program command args) (with-current-buffer buffer (vc-run-delayed (dolist (cmd post-processing) - (apply 'vc-do-command buffer nil hg-program nil cmd)) + (apply #'vc-do-command buffer nil hg-program nil cmd)) (vc-compilation-mode 'hg) (setq-local compile-command (concat hg-program " " command " " - (mapconcat 'identity args " ") + (mapconcat #'identity args " ") (mapconcat (lambda (args) (concat " && " hg-program " " - (mapconcat 'identity + (mapconcat #'identity args " "))) post-processing ""))) (setq-local compilation-directory root) @@ -1525,7 +1515,7 @@ This runs the command \"hg merge\"." ;; Disable pager. (process-environment (cons "HGPLAIN=1" process-environment)) (branch (vc-read-revision "Revision to merge: "))) - (apply 'vc-do-async-command buffer root vc-hg-program + (apply #'vc-do-async-command buffer root vc-hg-program (append '("--config" "ui.report_untrusted=0" "merge") (unless (string= branch "") (list branch)))) (with-current-buffer buffer (vc-run-delayed (vc-compilation-mode 'hg))) @@ -1540,7 +1530,8 @@ This function differs from vc-do-command in that it invokes ;; Disable pager. (let ((process-environment (cons "HGPLAIN=1" process-environment)) (flags (append '("--config" "ui.report_untrusted=0") flags))) - (apply 'vc-do-command (or buffer "*vc*") okstatus vc-hg-program file-or-list + (apply #'vc-do-command (or buffer "*vc*") + okstatus vc-hg-program file-or-list (if (stringp vc-hg-global-switches) (cons vc-hg-global-switches flags) (append vc-hg-global-switches diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index f910f9d5496..4b3c829a2c6 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -50,50 +50,42 @@ (defface vc-up-to-date-state '((default :inherit vc-state-base)) "Face for VC modeline state when the file is up to date." - :version "25.1" - :group 'vc-faces) + :version "25.1") (defface vc-needs-update-state '((default :inherit vc-state-base)) "Face for VC modeline state when the file needs update." - :version "25.1" - :group 'vc-faces) + :version "25.1") (defface vc-locked-state '((default :inherit vc-state-base)) "Face for VC modeline state when the file locked." - :version "25.1" - :group 'vc-faces) + :version "25.1") (defface vc-locally-added-state '((default :inherit vc-state-base)) "Face for VC modeline state when the file is locally added." - :version "25.1" - :group 'vc-faces) + :version "25.1") (defface vc-conflict-state '((default :inherit vc-state-base)) "Face for VC modeline state when the file contains merge conflicts." - :version "25.1" - :group 'vc-faces) + :version "25.1") (defface vc-removed-state '((default :inherit vc-state-base)) "Face for VC modeline state when the file was removed from the VC system." - :version "25.1" - :group 'vc-faces) + :version "25.1") (defface vc-missing-state '((default :inherit vc-state-base)) "Face for VC modeline state when the file is missing from the file system." - :version "25.1" - :group 'vc-faces) + :version "25.1") (defface vc-edited-state '((default :inherit vc-state-base)) "Face for VC modeline state when the file is edited." - :version "25.1" - :group 'vc-faces) + :version "25.1") ;; Customization Variables (the rest is in vc.el) @@ -871,31 +863,31 @@ In the latter case, VC mode is deactivated for this buffer." ;; (autoload 'vc-prefix-map "vc" nil nil 'keymap) (defvar vc-prefix-map (let ((map (make-sparse-keymap))) - (define-key map "a" 'vc-update-change-log) - (define-key map "b" 'vc-switch-backend) - (define-key map "d" 'vc-dir) - (define-key map "g" 'vc-annotate) - (define-key map "G" 'vc-ignore) - (define-key map "h" 'vc-region-history) - (define-key map "i" 'vc-register) - (define-key map "l" 'vc-print-log) - (define-key map "L" 'vc-print-root-log) - (define-key map "I" 'vc-log-incoming) - (define-key map "O" 'vc-log-outgoing) - (define-key map "ML" 'vc-log-mergebase) - (define-key map "MD" 'vc-diff-mergebase) - (define-key map "m" 'vc-merge) - (define-key map "r" 'vc-retrieve-tag) - (define-key map "s" 'vc-create-tag) - (define-key map "u" 'vc-revert) - (define-key map "v" 'vc-next-action) - (define-key map "+" 'vc-update) + (define-key map "a" #'vc-update-change-log) + (define-key map "b" #'vc-switch-backend) + (define-key map "d" #'vc-dir) + (define-key map "g" #'vc-annotate) + (define-key map "G" #'vc-ignore) + (define-key map "h" #'vc-region-history) + (define-key map "i" #'vc-register) + (define-key map "l" #'vc-print-log) + (define-key map "L" #'vc-print-root-log) + (define-key map "I" #'vc-log-incoming) + (define-key map "O" #'vc-log-outgoing) + (define-key map "ML" #'vc-log-mergebase) + (define-key map "MD" #'vc-diff-mergebase) + (define-key map "m" #'vc-merge) + (define-key map "r" #'vc-retrieve-tag) + (define-key map "s" #'vc-create-tag) + (define-key map "u" #'vc-revert) + (define-key map "v" #'vc-next-action) + (define-key map "+" #'vc-update) ;; I'd prefer some kind of symmetry with vc-update: - (define-key map "P" 'vc-push) - (define-key map "=" 'vc-diff) - (define-key map "D" 'vc-root-diff) - (define-key map "~" 'vc-revision-other-window) - (define-key map "x" 'vc-delete-file) + (define-key map "P" #'vc-push) + (define-key map "=" #'vc-diff) + (define-key map "D" #'vc-root-diff) + (define-key map "~" #'vc-revision-other-window) + (define-key map "x" #'vc-delete-file) map)) (fset 'vc-prefix-map vc-prefix-map) (define-key ctl-x-map "v" 'vc-prefix-map) diff --git a/lisp/vc/vc-mtn.el b/lisp/vc/vc-mtn.el index 3b610a1e4fe..ea69893071a 100644 --- a/lisp/vc/vc-mtn.el +++ b/lisp/vc/vc-mtn.el @@ -46,8 +46,7 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." (const :tag "None" t) (string :tag "Argument String") (repeat :tag "Argument List" :value ("") string)) - :version "23.1" - :group 'vc-mtn) + :version "23.1") (defcustom vc-mtn-annotate-switches nil "String or list of strings specifying switches for mtn annotate under VC. @@ -57,13 +56,11 @@ switches." (const :tag "None" t) (string :tag "Argument String") (repeat :tag "Argument List" :value ("") string)) - :version "25.1" - :group 'vc-mtn) + :version "25.1") (defcustom vc-mtn-program "mtn" "Name of the monotone executable." - :type 'string - :group 'vc-mtn) + :type 'string) ;; Clear up the cache to force vc-call to check again and discover ;; new functions when we reload this file. @@ -115,7 +112,7 @@ switches." (let ((process-environment ;; Avoid localization of messages so we can parse the output. (cons "LC_MESSAGES=C" process-environment))) - (apply 'vc-do-command (or buffer "*vc*") okstatus vc-mtn-program + (apply #'vc-do-command (or buffer "*vc*") okstatus vc-mtn-program files flags))) (defun vc-mtn-state (file) @@ -176,8 +173,7 @@ switches." '(("\\`[^:/#]*[:/#]" . "")) ;Drop the host part. "Rewrite rules to shorten Mtn's revision names on the mode-line." :type '(repeat (cons regexp string)) - :version "22.2" - :group 'vc-mtn) + :version "22.2") (defun vc-mtn-mode-line-string (file) "Return a string for `vc-mode-line' to put in the mode line for FILE." @@ -203,7 +199,7 @@ switches." (declare-function log-edit-extract-headers "log-edit" (headers string)) (defun vc-mtn-checkin (files comment &optional _rev) - (apply 'vc-mtn-command nil 0 files + (apply #'vc-mtn-command nil 0 files (nconc (list "commit" "-m") (log-edit-extract-headers '(("Author" . "--author") ("Date" . "--date")) @@ -227,7 +223,7 @@ switches." _SHORTLOG is ignored. If START-REVISION is non-nil, it is the newest revision to show. If LIMIT is non-nil, show no more than this many entries." - (apply 'vc-mtn-command buffer 0 files "log" + (apply #'vc-mtn-command buffer 0 files "log" (append (when start-revision (list "--from" (format "%s" start-revision))) (when limit (list "--last" (format "%s" limit)))))) @@ -258,7 +254,7 @@ If LIMIT is non-nil, show no more than this many entries." (defun vc-mtn-diff (files &optional rev1 rev2 buffer _async) "Get a difference report using monotone between two revisions of FILES." - (apply 'vc-mtn-command (or buffer "*vc-diff*") + (apply #'vc-mtn-command (or buffer "*vc-diff*") 1 ; bug#21969 files "diff" (append diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el index 8d64ee5cc57..6ffc1a8a2ff 100644 --- a/lisp/vc/vc-rcs.el +++ b/lisp/vc/vc-rcs.el @@ -58,8 +58,7 @@ If nil, VC itself computes this value when it is first needed." :type '(choice (const :tag "Auto" nil) (string :tag "Specified") - (const :tag "Unknown" unknown)) - :group 'vc-rcs) + (const :tag "Unknown" unknown))) (defcustom vc-rcs-register-switches nil "Switches for registering a file in RCS. @@ -70,8 +69,7 @@ If t, use no switches." (const :tag "None" t) (string :tag "Argument String") (repeat :tag "Argument List" :value ("") string)) - :version "21.1" - :group 'vc-rcs) + :version "21.1") (defcustom vc-rcs-diff-switches nil "String or list of strings specifying switches for RCS diff under VC. @@ -80,21 +78,18 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." (const :tag "None" t) (string :tag "Argument String") (repeat :tag "Argument List" :value ("") string)) - :version "21.1" - :group 'vc-rcs) + :version "21.1") (defcustom vc-rcs-header '("$Id\ $") "Header keywords to be inserted by `vc-insert-headers'." :type '(repeat string) - :version "24.1" ; no longer consult the obsolete vc-header-alist - :group 'vc-rcs) + :version "24.1") ; no longer consult the obsolete vc-header-alist (defcustom vc-rcsdiff-knows-brief nil "Indicates whether rcsdiff understands the --brief option. The value is either `yes', `no', or nil. If it is nil, VC tries to use --brief and sets this variable to remember whether it worked." - :type '(choice (const :tag "Work out" nil) (const yes) (const no)) - :group 'vc-rcs) + :type '(choice (const :tag "Work out" nil) (const yes) (const no))) ;; This needs to be autoloaded because vc-rcs-registered uses it (via ;; vc-default-registered), and vc-hooks needs to be able to check @@ -109,8 +104,7 @@ For a description of possible values, see `vc-check-master-templates'." (repeat :tag "User-specified" (choice string function))) - :version "21.1" - :group 'vc-rcs) + :version "21.1") ;;; Properties of the backend @@ -379,7 +373,7 @@ whether to remove it." "Retrieve a copy of a saved version of FILE. If FILE is a directory, attempt the checkout for all registered files beneath it." (if (file-directory-p file) - (mapc 'vc-rcs-checkout (vc-expand-dirs (list file) 'RCS)) + (mapc #'vc-rcs-checkout (vc-expand-dirs (list file) 'RCS)) (let ((file-buffer (get-file-buffer file)) switches) (message "Checking out %s..." file) @@ -445,7 +439,7 @@ attempt the checkout for all registered files beneath it." "Revert FILE to the version it was based on. If FILE is a directory, revert all registered files beneath it." (if (file-directory-p file) - (mapc 'vc-rcs-revert (vc-expand-dirs (list file) 'RCS)) + (mapc #'vc-rcs-revert (vc-expand-dirs (list file) 'RCS)) (vc-do-command "*vc*" 0 "co" (vc-master-name file) "-f" (concat (if (eq (vc-state file) 'edited) "-u" "-r") (vc-working-revision file))))) @@ -488,7 +482,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION." If FILE is a directory, steal the lock on all registered files beneath it. Needs RCS 5.6.2 or later for -M." (if (file-directory-p file) - (mapc 'vc-rcs-steal-lock (vc-expand-dirs (list file) 'RCS)) + (mapc #'vc-rcs-steal-lock (vc-expand-dirs (list file) 'RCS)) (vc-do-command "*vc*" 0 "rcs" (vc-master-name file) "-M" (concat "-u" rev)) ;; Do a real checkout after stealing the lock, so that we see ;; expanded headers. @@ -539,7 +533,7 @@ Remaining arguments are ignored. If FILE is a directory the operation is applied to all registered files beneath it." (vc-do-command (or buffer "*vc*") 0 "rlog" - (mapcar 'vc-master-name (vc-expand-dirs files 'RCS))) + (mapcar #'vc-master-name (vc-expand-dirs files 'RCS))) (with-current-buffer (or buffer "*vc*") (vc-rcs-print-log-cleanup)) (when limit 'limit-unsupported)) @@ -1344,7 +1338,7 @@ The `:insn' key is a keyword to distinguish it as a vc-rcs.el extension." (push `(,(to-eol) ,(k-semi 'date (lambda () - (let ((ls (mapcar 'string-to-number + (let ((ls (mapcar #'string-to-number (split-string (buffer-substring-no-properties b e) diff --git a/lisp/vc/vc-sccs.el b/lisp/vc/vc-sccs.el index 3d3f4048052..92cce5f13a8 100644 --- a/lisp/vc/vc-sccs.el +++ b/lisp/vc/vc-sccs.el @@ -55,8 +55,7 @@ If t, use no switches." (const :tag "None" t) (string :tag "Argument String") (repeat :tag "Argument List" :value ("") string)) - :version "21.1" - :group 'vc-sccs) + :version "21.1") (defcustom vc-sccs-diff-switches nil "String or list of strings specifying switches for SCCS diff under VC. @@ -65,14 +64,12 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." (const :tag "None" t) (string :tag "Argument String") (repeat :tag "Argument List" :value ("") string)) - :version "21.1" - :group 'vc-sccs) + :version "21.1") (defcustom vc-sccs-header '("%W%") "Header keywords to be inserted by `vc-insert-headers'." :type '(repeat string) - :version "24.1" ; no longer consult the obsolete vc-header-alist - :group 'vc-sccs) + :version "24.1") ; no longer consult the obsolete vc-header-alist ;; This needs to be autoloaded because vc-sccs-registered uses it (via ;; vc-default-registered), and vc-hooks needs to be able to check @@ -87,8 +84,7 @@ For a description of possible values, see `vc-check-master-templates'." (repeat :tag "User-specified" (choice string function))) - :version "21.1" - :group 'vc-sccs) + :version "21.1") ;;; @@ -163,7 +159,7 @@ For a description of possible values, see `vc-check-master-templates'." "Write the SCCS version of input file FILE to output file OUTFILE. Optional string REV is a revision." (with-temp-buffer - (apply 'vc-sccs-do-command t 0 "get" (vc-master-name file) + (apply #'vc-sccs-do-command t 0 "get" (vc-master-name file) (append '("-s" "-p" "-k") ; -k: no keyword expansion (if rev (list (concat "-r" rev))))) (write-region nil nil outfile nil 'silent))) @@ -185,7 +181,7 @@ Optional string REV is a revision." (defun vc-sccs-do-command (buffer okstatus command file-or-list &rest flags) ;; (let ((load-path (append vc-sccs-path load-path))) ;; (apply 'vc-do-command buffer okstatus command file-or-list flags)) - (apply 'vc-do-command (or buffer "*vc*") okstatus "sccs" file-or-list command flags)) + (apply #'vc-do-command (or buffer "*vc*") okstatus "sccs" file-or-list command flags)) (defun vc-sccs-create-repo () "Create a new SCCS repository." @@ -207,7 +203,7 @@ to the SCCS command." (let ((vc-master-name (or project-file (format (car vc-sccs-master-templates) dirname basename)))) - (apply 'vc-sccs-do-command nil 0 "admin" vc-master-name + (apply #'vc-sccs-do-command nil 0 "admin" vc-master-name "-fb" (concat "-i" (file-relative-name file)) (and comment (concat "-y" comment)) @@ -225,14 +221,14 @@ to the SCCS command." (defun vc-sccs-checkin (files comment &optional rev) "SCCS-specific version of `vc-backend-checkin'." (dolist (file (vc-expand-dirs files 'SCCS)) - (apply 'vc-sccs-do-command nil 0 "delta" (vc-master-name file) + (apply #'vc-sccs-do-command nil 0 "delta" (vc-master-name file) (if rev (concat "-r" rev)) (concat "-y" comment) (vc-switches 'SCCS 'checkin)) (vc-sccs-do-command nil 0 "get" (vc-master-name file)))) (defun vc-sccs-find-revision (file rev buffer) - (apply 'vc-sccs-do-command + (apply #'vc-sccs-do-command buffer 0 "get" (vc-master-name file) "-s" ;; suppress diagnostic output "-p" @@ -247,7 +243,7 @@ If FILE is a directory, all version-controlled files beneath are checked out. EDITABLE non-nil means that the file should be writable and locked. REV is the revision to check out." (if (file-directory-p file) - (mapc 'vc-sccs-checkout (vc-expand-dirs (list file) 'SCCS)) + (mapc #'vc-sccs-checkout (vc-expand-dirs (list file) 'SCCS)) (let ((file-buffer (get-file-buffer file)) switches) (message "Checking out %s..." file) @@ -267,7 +263,7 @@ locked. REV is the revision to check out." (and rev (or (string= rev "") (not (stringp rev))) (setq rev nil)) - (apply 'vc-sccs-do-command nil 0 "get" (vc-master-name file) + (apply #'vc-sccs-do-command nil 0 "get" (vc-master-name file) "-e" (and rev (concat "-r" (vc-sccs-lookup-triple file rev))) switches)))) @@ -277,7 +273,7 @@ locked. REV is the revision to check out." "Revert FILE to the version it was based on. If FILE is a directory, revert all subfiles." (if (file-directory-p file) - (mapc 'vc-sccs-revert (vc-expand-dirs (list file) 'SCCS)) + (mapc #'vc-sccs-revert (vc-expand-dirs (list file) 'SCCS)) (vc-sccs-do-command nil 0 "unget" (vc-master-name file)) (vc-sccs-do-command nil 0 "get" (vc-master-name file)) ;; Checking out explicit revisions is not supported under SCCS, yet. @@ -288,7 +284,7 @@ revert all subfiles." (defun vc-sccs-steal-lock (file &optional rev) "Steal the lock on the current workfile for FILE and revision REV." (if (file-directory-p file) - (mapc 'vc-sccs-steal-lock (vc-expand-dirs (list file) 'SCCS)) + (mapc #'vc-sccs-steal-lock (vc-expand-dirs (list file) 'SCCS)) (vc-sccs-do-command nil 0 "unget" (vc-master-name file) "-n" (if rev (concat "-r" rev))) (vc-sccs-do-command nil 0 "get" @@ -309,7 +305,7 @@ revert all subfiles." "Print commit log associated with FILES into specified BUFFER. Remaining arguments are ignored." (setq files (vc-expand-dirs files 'SCCS)) - (vc-sccs-do-command buffer 0 "prs" (mapcar 'vc-master-name files)) + (vc-sccs-do-command buffer 0 "prs" (mapcar #'vc-master-name files)) (when limit 'limit-unsupported)) (autoload 'vc-setup-buffer "vc-dispatcher") @@ -338,7 +334,7 @@ Remaining arguments are ignored." (fake-command (format "diff%s %s" (if fake-flags - (concat " " (mapconcat 'identity fake-flags " ")) + (concat " " (mapconcat #'identity fake-flags " ")) "") (vc-delistify files))) (status 0) @@ -362,7 +358,7 @@ Remaining arguments are ignored." (cons "LC_MESSAGES=C" process-environment)) (w32-quote-process-args t) (this-status - (apply 'process-file "diff" nil t nil + (apply #'process-file "diff" nil t nil (append (vc-switches 'SCCS 'diff) (list (file-local-name oldfile) (or newfile diff --git a/lisp/vc/vc-src.el b/lisp/vc/vc-src.el index 201d69d79a1..faba5bce2b7 100644 --- a/lisp/vc/vc-src.el +++ b/lisp/vc/vc-src.el @@ -97,13 +97,11 @@ If nil, VC itself computes this value when it is first needed." :type '(choice (const :tag "Auto" nil) (string :tag "Specified") - (const :tag "Unknown" unknown)) - :group 'vc-src) + (const :tag "Unknown" unknown))) (defcustom vc-src-program "src" "Name of the SRC executable (excluding any arguments)." - :type 'string - :group 'vc-src) + :type 'string) (defcustom vc-src-diff-switches nil "String or list of strings specifying switches for SRC diff under VC. @@ -111,8 +109,7 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." :type '(choice (const :tag "Unspecified" nil) (const :tag "None" t) (string :tag "Argument String") - (repeat :tag "Argument List" :value ("") string)) - :group 'vc-src) + (repeat :tag "Argument List" :value ("") string))) ;; This needs to be autoloaded because vc-src-registered uses it (via ;; vc-default-registered), and vc-hooks needs to be able to check @@ -126,8 +123,7 @@ For a description of possible values, see `vc-check-master-templates'." '("%s.src/%s,v")) (repeat :tag "User-specified" (choice string - function))) - :group 'vc-src) + function)))) ;;; Properties of the backend @@ -221,7 +217,7 @@ This function differs from vc-do-command in that it invokes `vc-src-program'." (setq file-list (list "--" file-or-list))) (file-or-list (setq file-list (cons "--" file-or-list)))) - (apply 'vc-do-command (or buffer "*vc*") 0 vc-src-program file-list flags))) + (apply #'vc-do-command (or buffer "*vc*") 0 vc-src-program file-list flags))) (defun vc-src-working-revision (file) "SRC-specific version of `vc-working-revision'." @@ -275,7 +271,7 @@ REV is the revision to check out into WORKFILE." "Revert FILE to the version it was based on. If FILE is a directory, revert all registered files beneath it." (if (file-directory-p file) - (mapc 'vc-src-revert (vc-expand-dirs (list file) 'SRC)) + (mapc #'vc-src-revert (vc-expand-dirs (list file) 'SRC)) (vc-src-command nil file "co"))) (defun vc-src-modify-change-comment (files rev comment) @@ -290,8 +286,7 @@ directory the operation is applied to all registered files beneath it." "String or list of strings specifying switches for src log under VC." :type '(choice (const :tag "None" nil) (string :tag "Argument String") - (repeat :tag "Argument List" :value ("") string)) - :group 'vc-src) + (repeat :tag "Argument List" :value ("") string))) (defun vc-src-print-log (files buffer &optional shortlog _start-revision limit) "Print commit log associated with FILES into specified BUFFER. @@ -307,7 +302,7 @@ If LIMIT is non-nil, show no more than this many entries." (let ((inhibit-read-only t)) (with-current-buffer buffer - (apply 'vc-src-command buffer files (if shortlog "list" "log") + (apply #'vc-src-command buffer files (if shortlog "list" "log") (nconc ;;(when start-revision (list (format "%s-1" start-revision))) (when limit (list "-l" (format "%s" limit))) diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el index 22becc91cd1..c30920dd157 100644 --- a/lisp/vc/vc-svn.el +++ b/lisp/vc/vc-svn.el @@ -47,8 +47,7 @@ ;; FIXME there is also svnadmin. (defcustom vc-svn-program "svn" "Name of the SVN executable." - :type 'string - :group 'vc-svn) + :type 'string) ;; Might be nice if svn defaulted to non-interactive if stdin not tty. ;; https://svn.haxx.se/dev/archive-2008-05/0762.shtml @@ -64,8 +63,7 @@ hanging while prompting for authorization." (repeat :tag "Argument List" :value ("") string)) - :version "24.4" - :group 'vc-svn) + :version "24.4") (defcustom vc-svn-register-switches nil "Switches for registering a file into SVN. @@ -76,8 +74,7 @@ If t, use no switches." (const :tag "None" t) (string :tag "Argument String") (repeat :tag "Argument List" :value ("") string)) - :version "22.1" - :group 'vc-svn) + :version "22.1") (defcustom vc-svn-diff-switches t ;`svn' doesn't support common args like -c or -b. @@ -92,8 +89,7 @@ If you want to force an empty list of arguments, use t." (repeat :tag "Argument List" :value ("") string)) - :version "22.1" - :group 'vc-svn) + :version "22.1") (defcustom vc-svn-annotate-switches nil "String or list of strings specifying switches for svn annotate under VC. @@ -103,14 +99,12 @@ switches." (const :tag "None" t) (string :tag "Argument String") (repeat :tag "Argument List" :value ("") string)) - :version "25.1" - :group 'vc-svn) + :version "25.1") (defcustom vc-svn-header '("$Id\ $") "Header keywords to be inserted by `vc-insert-headers'." :version "24.1" ; no longer consult the obsolete vc-header-alist - :type '(repeat string) - :group 'vc-svn) + :type '(repeat string)) ;; We want to autoload it for use by the autoloaded version of ;; vc-svn-registered, but we want the value to be compiled at startup, not @@ -305,19 +299,19 @@ RESULT is a list of conses (FILE . STATE) for directory DIR." The COMMENT argument is ignored This does an add but not a commit. Passes either `vc-svn-register-switches' or `vc-register-switches' to the SVN command." - (apply 'vc-svn-command nil 0 files "add" (vc-switches 'SVN 'register))) + (apply #'vc-svn-command nil 0 files "add" (vc-switches 'SVN 'register))) (defun vc-svn-root (file) (vc-find-root file vc-svn-admin-directory)) -(defalias 'vc-svn-responsible-p 'vc-svn-root) +(defalias 'vc-svn-responsible-p #'vc-svn-root) (declare-function log-edit-extract-headers "log-edit" (headers string)) (defun vc-svn-checkin (files comment &optional _extra-args-ignored) "SVN-specific version of `vc-backend-checkin'." (let ((status (apply - 'vc-svn-command nil 1 files "ci" + #'vc-svn-command nil 1 files "ci" (nconc (cons "-m" (log-edit-extract-headers nil comment)) (vc-switches 'SVN 'checkin))))) (set-buffer "*vc*") @@ -345,7 +339,7 @@ to the SVN command." (defun vc-svn-find-revision (file rev buffer) "SVN-specific retrieval of a specified version into a buffer." (let (process-file-side-effects) - (apply 'vc-svn-command + (apply #'vc-svn-command buffer 0 file "cat" (and rev (not (string= rev "")) @@ -391,7 +385,7 @@ DIRECTORY or absolute." nil ;; Check out a particular version (or recreate the file). (vc-file-setprop file 'vc-working-revision nil) - (apply 'vc-svn-command nil 0 file + (apply #'vc-svn-command nil 0 file "update" (cond ((null rev) "-rBASE") @@ -563,27 +557,27 @@ If LIMIT is non-nil, show no more than this many entries." (goto-char (point-min)) (if files (dolist (file files) - (insert "Working file: " file "\n") - (apply - 'vc-svn-command - buffer - 'async - (list file) - "log" - (append - (list - (if start-revision - (format "-r%s:1" start-revision) - ;; By default Subversion only shows the log up to the - ;; working revision, whereas we also want the log of the - ;; subsequent commits. At least that's what the - ;; vc-cvs.el code does. - "-rHEAD:0")) - (if (eq vc-log-view-type 'with-diff) - (list "--diff")) - (when limit (list "--limit" (format "%s" limit)))))) + (insert "Working file: " file "\n") + (apply + #'vc-svn-command + buffer + 'async + (list file) + "log" + (append + (list + (if start-revision + (format "-r%s:1" start-revision) + ;; By default Subversion only shows the log up to the + ;; working revision, whereas we also want the log of the + ;; subsequent commits. At least that's what the + ;; vc-cvs.el code does. + "-rHEAD:0")) + (if (eq vc-log-view-type 'with-diff) + (list "--diff")) + (when limit (list "--limit" (format "%s" limit)))))) ;; Dump log for the entire directory. - (apply 'vc-svn-command buffer 0 nil "log" + (apply #'vc-svn-command buffer 0 nil "log" (append (list (if start-revision (format "-r%s" start-revision) "-rHEAD:0")) @@ -611,8 +605,8 @@ If LIMIT is non-nil, show no more than this many entries." (if vc-svn-diff-switches (vc-switches 'SVN 'diff) (list (concat "--diff-cmd=" diff-command) "-x" - (mapconcat 'identity (vc-switches nil 'diff) " "))))) - (apply 'vc-svn-command buffer + (mapconcat #'identity (vc-switches nil 'diff) " "))))) + (apply #'vc-svn-command buffer (if async 'async 0) files "diff" (append @@ -671,7 +665,7 @@ NAME is assumed to be a URL." "A wrapper around `vc-do-command' for use in vc-svn.el. The difference to vc-do-command is that this function always invokes `svn', and that it passes `vc-svn-global-switches' to it before FLAGS." - (apply 'vc-do-command (or buffer "*vc*") okstatus vc-svn-program file-or-list + (apply #'vc-do-command (or buffer "*vc*") okstatus vc-svn-program file-or-list (if (stringp vc-svn-global-switches) (cons vc-svn-global-switches flags) (append vc-svn-global-switches flags)))) @@ -683,7 +677,7 @@ and that it passes `vc-svn-global-switches' to it before FLAGS." (unless (re-search-forward "^<<<<<<< " nil t) (vc-svn-command nil 0 buffer-file-name "resolved") ;; Remove the hook so that it is not called multiple times. - (remove-hook 'after-save-hook 'vc-svn-resolve-when-done t)))) + (remove-hook 'after-save-hook #'vc-svn-resolve-when-done t)))) ;; Inspired by vc-arch-find-file-hook. (defun vc-svn-find-file-hook () @@ -696,7 +690,7 @@ and that it passes `vc-svn-global-switches' to it before FLAGS." ;; There are conflict markers. (progn (smerge-start-session) - (add-hook 'after-save-hook 'vc-svn-resolve-when-done nil t)) + (add-hook 'after-save-hook #'vc-svn-resolve-when-done nil t)) ;; There are no conflict markers. This is problematic: maybe it means ;; the conflict has been resolved and we should immediately call "svn ;; resolved", or it means that the file's type does not allow Svn to diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 00976a07d42..b926c3819dd 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1425,6 +1425,7 @@ first backend that could register the file is used." (let ((vc-handled-backends (list backend))) (call-interactively 'vc-register))) +;;;###autoload (defun vc-ignore (file &optional directory remove) "Ignore FILE under the VCS of DIRECTORY. -- cgit v1.2.3 From 49cbf2392ba51c2ebd866b062dbf7908c595466f Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 30 Mar 2021 15:46:57 +0200 Subject: Delete empty "History" sections * lisp/bs.el: * lisp/calendar/timeclock.el: * lisp/cedet/semantic/bovine/grammar.el: * lisp/cedet/semantic/grammar.el: * lisp/cedet/semantic/wisent.el: * lisp/cedet/semantic/wisent/comp.el: * lisp/cedet/semantic/wisent/java-tags.el: * lisp/cedet/semantic/wisent/wisent.el: * lisp/erc/erc.el: * lisp/net/newst-treeview.el: * lisp/recentf.el: * lisp/ruler-mode.el: * lisp/textmodes/remember.el: * lisp/thumbs.el: * lisp/tree-widget.el: * lisp/vc/vc-hg.el: Delete empty "History" sections. * lisp/cedet/semantic/grammar.el (semantic-grammar-header-template): Don't add "History" section to generated file. --- lisp/bs.el | 2 -- lisp/calendar/timeclock.el | 2 -- lisp/cedet/semantic/bovine/grammar.el | 3 +-- lisp/cedet/semantic/grammar.el | 6 ------ lisp/cedet/semantic/wisent.el | 5 +---- lisp/cedet/semantic/wisent/comp.el | 3 --- lisp/cedet/semantic/wisent/java-tags.el | 3 --- lisp/cedet/semantic/wisent/wisent.el | 3 --- lisp/erc/erc.el | 3 --- lisp/net/newst-treeview.el | 4 ---- lisp/recentf.el | 3 --- lisp/ruler-mode.el | 3 --- lisp/textmodes/remember.el | 2 -- lisp/thumbs.el | 3 --- lisp/tree-widget.el | 4 +--- lisp/vc/vc-hg.el | 3 --- 16 files changed, 3 insertions(+), 49 deletions(-) (limited to 'lisp/vc/vc-hg.el') diff --git a/lisp/bs.el b/lisp/bs.el index 9ed0ee5f0ae..154e3599f33 100644 --- a/lisp/bs.el +++ b/lisp/bs.el @@ -120,8 +120,6 @@ ;; can cycle through all file buffers and *scratch* although your current ;; configuration perhaps is "files" which ignores buffer *scratch*. -;;; History: - ;;; Code: ;; ---------------------------------------------------------------------- diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el index 0bbaa1e1ed6..4a4b65d3745 100644 --- a/lisp/calendar/timeclock.el +++ b/lisp/calendar/timeclock.el @@ -69,8 +69,6 @@ ;; your average working time, and will make sure that the various ;; display functions return the correct value. -;;; History: - ;;; Code: (require 'cl-lib) diff --git a/lisp/cedet/semantic/bovine/grammar.el b/lisp/cedet/semantic/bovine/grammar.el index e3df7b12ab6..a5b9873445e 100644 --- a/lisp/cedet/semantic/bovine/grammar.el +++ b/lisp/cedet/semantic/bovine/grammar.el @@ -25,9 +25,8 @@ ;; ;; Major mode for editing Bovine's input grammar (.by) files. -;;; History: - ;;; Code: + (require 'semantic) (require 'semantic/grammar) (require 'semantic/find) diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el index 8d8faac9c49..ce30603bf82 100644 --- a/lisp/cedet/semantic/grammar.el +++ b/lisp/cedet/semantic/grammar.el @@ -23,9 +23,6 @@ ;; ;; Major mode framework for editing Semantic's input grammar files. -;;; History: -;; - ;;; Code: (require 'semantic) @@ -600,9 +597,6 @@ Typically a DEFINE expression should look like this: ;; PLEASE DO NOT MANUALLY EDIT THIS FILE! It is automatically ;; generated from the grammar file " gram ". -;;; History: -;; - ;;; Code: (require 'semantic/lex) diff --git a/lisp/cedet/semantic/wisent.el b/lisp/cedet/semantic/wisent.el index f498e7edcc2..f5f381d4079 100644 --- a/lisp/cedet/semantic/wisent.el +++ b/lisp/cedet/semantic/wisent.el @@ -22,13 +22,10 @@ ;; along with GNU Emacs. If not, see . ;;; Commentary: -;; + ;; Here are functions necessary to use the Wisent LALR parser from ;; Semantic environment. -;;; History: -;; - ;;; Code: (require 'semantic) diff --git a/lisp/cedet/semantic/wisent/comp.el b/lisp/cedet/semantic/wisent/comp.el index 6addc134edb..3c7cc286b2a 100644 --- a/lisp/cedet/semantic/wisent/comp.el +++ b/lisp/cedet/semantic/wisent/comp.el @@ -35,9 +35,6 @@ ;; ;; For more details on Wisent itself read the Wisent manual. -;;; History: -;; - ;;; Code: (require 'semantic/wisent) (eval-when-compile (require 'cl-lib)) diff --git a/lisp/cedet/semantic/wisent/java-tags.el b/lisp/cedet/semantic/wisent/java-tags.el index b4a87be62a0..90dd40c51a0 100644 --- a/lisp/cedet/semantic/wisent/java-tags.el +++ b/lisp/cedet/semantic/wisent/java-tags.el @@ -24,9 +24,6 @@ ;;; Commentary: ;; -;;; History: -;; - ;;; Code: (require 'semantic/wisent) diff --git a/lisp/cedet/semantic/wisent/wisent.el b/lisp/cedet/semantic/wisent/wisent.el index d205c0e6043..62d99ef6972 100644 --- a/lisp/cedet/semantic/wisent/wisent.el +++ b/lisp/cedet/semantic/wisent/wisent.el @@ -34,9 +34,6 @@ ;; ;; For more details on Wisent itself read the Wisent manual. -;;; History: -;; - ;;; Code: (defgroup wisent nil diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index b6dea95bb2b..2f6e48dce1a 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -50,9 +50,6 @@ ;; After you are connected to a server, you can use C-h m or have a look at ;; the ERC menu. -;;; History: -;; - ;;; Code: (load "erc-loaddefs" nil t) diff --git a/lisp/net/newst-treeview.el b/lisp/net/newst-treeview.el index 29c92d52dd8..d524e6dd173 100644 --- a/lisp/net/newst-treeview.el +++ b/lisp/net/newst-treeview.el @@ -30,10 +30,6 @@ ;; See newsticker.el -;; ====================================================================== -;;; History: -;; - ;; ====================================================================== ;;; Code: (require 'cl-lib) diff --git a/lisp/recentf.el b/lisp/recentf.el index 48b8e2b6719..c819397a33d 100644 --- a/lisp/recentf.el +++ b/lisp/recentf.el @@ -33,9 +33,6 @@ ;; To enable this package, add the following to your .emacs: ;; (recentf-mode 1) -;;; History: -;; - ;;; Code: (require 'tree-widget) (require 'timer) diff --git a/lisp/ruler-mode.el b/lisp/ruler-mode.el index fc9196caf96..11226fda020 100644 --- a/lisp/ruler-mode.el +++ b/lisp/ruler-mode.el @@ -100,10 +100,7 @@ ;; To automatically display the ruler in specific major modes use: ;; ;; (add-hook '-hook 'ruler-mode) -;; -;;; History: -;; ;;; Code: (eval-when-compile diff --git a/lisp/textmodes/remember.el b/lisp/textmodes/remember.el index b731c124421..3affb462011 100644 --- a/lisp/textmodes/remember.el +++ b/lisp/textmodes/remember.el @@ -176,8 +176,6 @@ ;; ;; 2003.08.12 Sacha's birthday -;;; History: - ;;; Code: (defconst remember-version "2.0" diff --git a/lisp/thumbs.el b/lisp/thumbs.el index 3e7c9124e2d..5710b8c353b 100644 --- a/lisp/thumbs.el +++ b/lisp/thumbs.el @@ -51,9 +51,6 @@ ;; In thumbs-mode, pressing on an image will bring you in image view ;; mode for that image. C-h m will give you a list of available keybinding. -;;; History: -;; - ;;; Code: (require 'dired) diff --git a/lisp/tree-widget.el b/lisp/tree-widget.el index 44b29bffe87..d40a628b994 100644 --- a/lisp/tree-widget.el +++ b/lisp/tree-widget.el @@ -110,10 +110,8 @@ ;; `tree-widget-themes-directory', and `tree-widget-theme' options for ;; more details. -;;; History: -;; - ;;; Code: + (require 'wid-edit) ;;; Customization diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 9faed10f383..2bc6ae3524b 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -97,9 +97,6 @@ ;; without even using `hg' (this way even if you don't have `hg' installed, ;; Emacs is able to tell you this file is under mercurial's control). -;;; History: -;; - ;;; Code: (require 'cl-lib) -- cgit v1.2.3 From d47706c552eb8a8cd8caff03622201fcd78639c8 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 3 Apr 2021 12:13:52 +0200 Subject: ; Remove some redundant installation instructions --- lisp/textmodes/artist.el | 7 ------- lisp/vc/vc-git.el | 8 -------- lisp/vc/vc-hg.el | 2 -- 3 files changed, 17 deletions(-) (limited to 'lisp/vc/vc-hg.el') diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el index dc45a7306d8..22ade15921d 100644 --- a/lisp/textmodes/artist.el +++ b/lisp/textmodes/artist.el @@ -106,13 +106,6 @@ ;; If you add a new drawing mode, send it to me, and I would gladly ;; include in the next release! -;;; Installation: - -;; To use artist, put this in your .emacs: -;; -;; (autoload 'artist-mode "artist" "Enter artist-mode" t) - - ;;; Requirements: ;; Artist requires the `rect' package (which comes with Emacs) to be diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index fda8605c679..e37c09df7c2 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -27,14 +27,6 @@ ;; system. ;; -;;; Installation: - -;; To install: put this file on the load-path and add Git to the list -;; of supported backends in `vc-handled-backends'; the following line, -;; placed in your init file, will accomplish this: -;; -;; (add-to-list 'vc-handled-backends 'Git) - ;;; Todo: ;; - check if more functions could use vc-git-command instead ;; of start-process. diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 2bc6ae3524b..a054a7c3176 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -30,8 +30,6 @@ ;;; Bugs: -;;; Installation: - ;;; Todo: ;; 1) Implement the rest of the vc interface. See the comment at the -- cgit v1.2.3 From 289ec2d911c0a723c0c131ac9cf3407c71a4b15c Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 16 Apr 2021 14:28:10 +0200 Subject: ; Remove some useless comments --- lisp/align.el | 2 -- lisp/allout-widgets.el | 1 - lisp/allout.el | 1 - lisp/autorevert.el | 1 - lisp/bs.el | 1 - lisp/cus-edit.el | 2 -- lisp/cus-face.el | 2 -- lisp/custom.el | 2 -- lisp/emacs-lisp/faceup.el | 5 ----- lisp/emacs-lisp/lisp-mnt.el | 5 ----- lisp/emacs-lisp/ring.el | 2 -- lisp/expand.el | 1 - lisp/filecache.el | 4 ---- lisp/filenotify.el | 1 - lisp/gnus/gnus-cus.el | 2 -- lisp/gnus/gnus-diary.el | 5 ----- lisp/gnus/gnus-registry.el | 2 -- lisp/gnus/nnselect.el | 1 - lisp/icomplete.el | 1 - lisp/language/thai-word.el | 2 +- lisp/mh-e/mh-acros.el | 2 -- lisp/mh-e/mh-alias.el | 2 -- lisp/mh-e/mh-buffers.el | 2 -- lisp/mh-e/mh-comp.el | 2 -- lisp/mh-e/mh-compat.el | 2 -- lisp/mh-e/mh-folder.el | 2 -- lisp/mh-e/mh-funcs.el | 2 -- lisp/mh-e/mh-gnus.el | 2 -- lisp/mh-e/mh-identity.el | 2 -- lisp/mh-e/mh-inc.el | 2 -- lisp/mh-e/mh-junk.el | 2 -- lisp/mh-e/mh-letter.el | 2 -- lisp/mh-e/mh-limit.el | 2 -- lisp/mh-e/mh-mime.el | 2 -- lisp/mh-e/mh-print.el | 2 -- lisp/mh-e/mh-scan.el | 2 -- lisp/mh-e/mh-search.el | 2 -- lisp/mh-e/mh-seq.el | 2 -- lisp/mh-e/mh-show.el | 2 -- lisp/mh-e/mh-speed.el | 2 -- lisp/mh-e/mh-thread.el | 2 -- lisp/mh-e/mh-tool-bar.el | 2 -- lisp/mh-e/mh-utils.el | 2 -- lisp/mh-e/mh-xface.el | 2 -- lisp/net/ange-ftp.el | 4 ---- lisp/obsolete/fast-lock.el | 2 -- lisp/obsolete/lazy-lock.el | 2 -- lisp/obsolete/nnir.el | 1 - lisp/obsolete/sregex.el | 4 +--- lisp/progmodes/glasses.el | 4 ---- lisp/progmodes/meta-mode.el | 3 --- lisp/progmodes/python.el | 2 -- lisp/speedbar.el | 1 - lisp/textmodes/bibtex-style.el | 1 - lisp/textmodes/bibtex.el | 3 --- lisp/textmodes/makeinfo.el | 1 - lisp/textmodes/page.el | 2 -- lisp/textmodes/tex-mode.el | 1 - lisp/textmodes/texinfmt.el | 6 ++---- lisp/textmodes/texnfo-upd.el | 2 -- lisp/textmodes/tildify.el | 2 -- lisp/uniquify.el | 2 -- lisp/vc/vc-hg.el | 4 ---- lisp/widget.el | 2 -- test/manual/cedet/tests/test.el | 3 --- 65 files changed, 4 insertions(+), 139 deletions(-) (limited to 'lisp/vc/vc-hg.el') diff --git a/lisp/align.el b/lisp/align.el index 7ae067f8c53..a0b626a5c43 100644 --- a/lisp/align.el +++ b/lisp/align.el @@ -1587,8 +1587,6 @@ aligner would have dealt with are." (if report (message "Aligning...done")))) -;; Provide: - (provide 'align) (run-hooks 'align-load-hook) diff --git a/lisp/allout-widgets.el b/lisp/allout-widgets.el index 931dfbc961e..90f3f61b363 100644 --- a/lisp/allout-widgets.el +++ b/lisp/allout-widgets.el @@ -2290,7 +2290,6 @@ The elements of LIST are not copied, just the list structure itself." (define-obsolete-function-alias 'allout-frame-property #'frame-parameter "28.1") -;;;_ : provide (provide 'allout-widgets) ;;;_ . Local emacs vars. diff --git a/lisp/allout.el b/lisp/allout.el index f50f5fd4b2c..1605ce2ce33 100644 --- a/lisp/allout.el +++ b/lisp/allout.el @@ -6457,7 +6457,6 @@ If BEG is bigger than END we return 0." (isearch-repeat 'forward) (isearch-mode t))) -;;;_ #11 Provide (provide 'allout) ;;;_* Local emacs vars. diff --git a/lisp/autorevert.el b/lisp/autorevert.el index 1bb40c90ff5..edd4c7e5e45 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -937,7 +937,6 @@ the timer when no buffers need to be checked." (cancel-timer auto-revert-timer)) (setq auto-revert-timer nil))))) -;; The end: (provide 'autorevert) (run-hooks 'auto-revert-load-hook) diff --git a/lisp/bs.el b/lisp/bs.el index 154e3599f33..494bc426188 100644 --- a/lisp/bs.el +++ b/lisp/bs.el @@ -1504,7 +1504,6 @@ name of buffer configuration." ;; continue standard unloading nil) -;; Now provide feature bs (provide 'bs) ;;; bs.el ends here diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index dde6e8997bf..7627930c4c8 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -5155,8 +5155,6 @@ if that value is non-nil." (put 'Custom-mode 'mode-class 'special) -;;; The End. - (provide 'cus-edit) ;;; cus-edit.el ends here diff --git a/lisp/cus-face.el b/lisp/cus-face.el index 21fe89c6214..6c0052bf860 100644 --- a/lisp/cus-face.el +++ b/lisp/cus-face.el @@ -395,8 +395,6 @@ This means reset FACE to its value in FROM-THEME." (define-obsolete-function-alias 'custom-facep #'facep "28.1") -;;; The End. - (provide 'cus-face) ;;; cus-face.el ends here diff --git a/lisp/custom.el b/lisp/custom.el index 85e5d65ffb2..2c9eadbd479 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -1623,8 +1623,6 @@ If a choice with the same tag already exists, no action is taken." (put variable 'custom-type (append choices (list choice)))))) -;;; The End. - (provide 'custom) ;;; custom.el ends here diff --git a/lisp/emacs-lisp/faceup.el b/lisp/emacs-lisp/faceup.el index 6c3931f9829..162c39634ed 100644 --- a/lisp/emacs-lisp/faceup.el +++ b/lisp/emacs-lisp/faceup.el @@ -1170,11 +1170,6 @@ Intended to be called when a file is loaded." ;; File is being evaluated using, for example, `eval-buffer'. default-directory))) - -;; ---------------------------------------------------------------------- -;; The end -;; - (provide 'faceup) ;;; faceup.el ends here diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el index 6d9c8c32794..73a33a553fb 100644 --- a/lisp/emacs-lisp/lisp-mnt.el +++ b/lisp/emacs-lisp/lisp-mnt.el @@ -109,11 +109,6 @@ ;; * Footer line --- marks end-of-file so it can be distinguished from ;; an expanded formfeed or the results of truncation. -;;; Change Log: - -;; Tue Jul 14 23:44:17 1992 ESR -;; * Created. - ;;; Code: ;;; Variables: diff --git a/lisp/emacs-lisp/ring.el b/lisp/emacs-lisp/ring.el index 96894655b45..ea27bb3c31b 100644 --- a/lisp/emacs-lisp/ring.el +++ b/lisp/emacs-lisp/ring.el @@ -248,8 +248,6 @@ If SEQ is already a ring, return it." (ring-insert-at-beginning ring (elt seq count)))) ring))) -;;; provide ourself: - (provide 'ring) ;;; ring.el ends here diff --git a/lisp/expand.el b/lisp/expand.el index d11ae7c5263..1b722014f89 100644 --- a/lisp/expand.el +++ b/lisp/expand.el @@ -484,7 +484,6 @@ This is used only in conjunction with `expand-add-abbrevs'." (provide 'expand) -;; run load hooks (run-hooks 'expand-load-hook) ;;; expand.el ends here diff --git a/lisp/filecache.el b/lisp/filecache.el index 67d2939dd3c..62184e1a0ae 100644 --- a/lisp/filecache.el +++ b/lisp/filecache.el @@ -674,10 +674,6 @@ match REGEXP." (insert (nth 1 item) (nth 0 item) "\n")) (pop-to-buffer buf)))) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Keybindings -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - (provide 'filecache) ;;; filecache.el ends here diff --git a/lisp/filenotify.el b/lisp/filenotify.el index 07871bb0b64..4fc7f0a8ec0 100644 --- a/lisp/filenotify.el +++ b/lisp/filenotify.el @@ -505,7 +505,6 @@ DESCRIPTOR should be an object returned by `file-notify-add-watch'." ;; due to the way events are propagated during idle time. Note: This ;; may be perfectly acceptable. -;; The end: (provide 'filenotify) ;;; filenotify.el ends here diff --git a/lisp/gnus/gnus-cus.el b/lisp/gnus/gnus-cus.el index 0852f8e1264..e7af94ff509 100644 --- a/lisp/gnus/gnus-cus.el +++ b/lisp/gnus/gnus-cus.el @@ -1102,8 +1102,6 @@ articles in the thread. (widget-setup) (buffer-enable-undo)))) -;;; The End: - (provide 'gnus-cus) ;;; gnus-cus.el ends here diff --git a/lisp/gnus/gnus-diary.el b/lisp/gnus/gnus-diary.el index 64eb639f61c..e2cbca9007d 100644 --- a/lisp/gnus/gnus-diary.el +++ b/lisp/gnus/gnus-diary.el @@ -32,11 +32,6 @@ ;; gnus-diary is a utility toolkit used on top of the nndiary back end. It is ;; now fully documented in the Gnus manual. - -;; Bugs / Todo: -;; =========== - - ;;; Code: (require 'nndiary) diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el index 6ac646fbeac..11b6f7ddf07 100644 --- a/lisp/gnus/gnus-registry.el +++ b/lisp/gnus/gnus-registry.el @@ -1298,8 +1298,6 @@ from your existing entries." (gnus-registry-insert db k newv))) (registry-reindex db)))) -;; TODO: a few things - (provide 'gnus-registry) ;;; gnus-registry.el ends here diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el index e314e1d8d10..5ac4c3a64e1 100644 --- a/lisp/gnus/nnselect.el +++ b/lisp/gnus/nnselect.el @@ -968,7 +968,6 @@ Pass NO-PARSE on to the search engine." (gnus-group-make-search-group no-parse spec))) -;; The end. (provide 'nnselect) ;;; nnselect.el ends here diff --git a/lisp/icomplete.el b/lisp/icomplete.el index d5b6f76d7b2..91bbb600136 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -837,7 +837,6 @@ matches exist." ;;;###autoload (make-obsolete 'iswitchb-mode ;;;###autoload "use `icomplete-mode' or `ido-mode' instead." "24.4")) -;;;_* Provide (provide 'icomplete) ;;_* Local emacs vars. diff --git a/lisp/language/thai-word.el b/lisp/language/thai-word.el index ff1e80298ba..7a09bc3a24a 100644 --- a/lisp/language/thai-word.el +++ b/lisp/language/thai-word.el @@ -11074,4 +11074,4 @@ With argument, do this that many times." ;; coding: utf-8 ;; End: -;; end of thai-word.el +;; thai-word.el ends here diff --git a/lisp/mh-e/mh-acros.el b/lisp/mh-e/mh-acros.el index dd953ee9df7..8fdcf3c62b4 100644 --- a/lisp/mh-e/mh-acros.el +++ b/lisp/mh-e/mh-acros.el @@ -36,8 +36,6 @@ ;; because it's pointless to compile a file full of macros. But we ;; kept the name. -;;; Change Log: - ;;; Code: (require 'cl-lib) diff --git a/lisp/mh-e/mh-alias.el b/lisp/mh-e/mh-alias.el index 67c019aa179..415e9848258 100644 --- a/lisp/mh-e/mh-alias.el +++ b/lisp/mh-e/mh-alias.el @@ -24,8 +24,6 @@ ;;; Commentary: -;;; Change Log: - ;;; Code: (require 'mh-e) diff --git a/lisp/mh-e/mh-buffers.el b/lisp/mh-e/mh-buffers.el index a32f61c82eb..ef21fdb2f95 100644 --- a/lisp/mh-e/mh-buffers.el +++ b/lisp/mh-e/mh-buffers.el @@ -24,8 +24,6 @@ ;;; Commentary: -;;; Change Log: - ;;; Code: ;; The names of ephemeral buffers have a " *mh-" prefix (so that they diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el index c1cd6c1a9e2..b64bbfb6f3b 100644 --- a/lisp/mh-e/mh-comp.el +++ b/lisp/mh-e/mh-comp.el @@ -29,8 +29,6 @@ ;; that are used to send the mail. Other that those, functions that ;; are needed in mh-letter.el should be found there. -;;; Change Log: - ;;; Code: (require 'mh-e) diff --git a/lisp/mh-e/mh-compat.el b/lisp/mh-e/mh-compat.el index 0363c5aadac..ade80e8b95e 100644 --- a/lisp/mh-e/mh-compat.el +++ b/lisp/mh-e/mh-compat.el @@ -23,8 +23,6 @@ ;;; Commentary: -;;; Change Log: - ;;; Code: ;; This is a good place to gather code that is used for compatibility diff --git a/lisp/mh-e/mh-folder.el b/lisp/mh-e/mh-folder.el index 2e288064f16..ce77f9c0971 100644 --- a/lisp/mh-e/mh-folder.el +++ b/lisp/mh-e/mh-folder.el @@ -25,8 +25,6 @@ ;; Mode for browsing folders -;;; Change Log: - ;;; Code: (require 'mh-e) diff --git a/lisp/mh-e/mh-funcs.el b/lisp/mh-e/mh-funcs.el index 38ba43188da..0e5ffc9a42c 100644 --- a/lisp/mh-e/mh-funcs.el +++ b/lisp/mh-e/mh-funcs.el @@ -30,8 +30,6 @@ ;; small support routines are needed, place them with the function; ;; otherwise, create a separate section for them. -;;; Change Log: - ;;; Code: (require 'mh-e) diff --git a/lisp/mh-e/mh-gnus.el b/lisp/mh-e/mh-gnus.el index ac46cc63fcc..cc60f7b6640 100644 --- a/lisp/mh-e/mh-gnus.el +++ b/lisp/mh-e/mh-gnus.el @@ -24,8 +24,6 @@ ;;; Commentary: -;;; Change Log: - ;;; Code: (require 'mh-e) diff --git a/lisp/mh-e/mh-identity.el b/lisp/mh-e/mh-identity.el index aeab0497562..ceede0d07cb 100644 --- a/lisp/mh-e/mh-identity.el +++ b/lisp/mh-e/mh-identity.el @@ -33,8 +33,6 @@ ;; in MH-Letter mode. The command `mh-insert-identity' can be used ;; to manually insert an identity. -;;; Change Log: - ;;; Code: (require 'mh-e) diff --git a/lisp/mh-e/mh-inc.el b/lisp/mh-e/mh-inc.el index 6a29195afbb..83cfe4f99f1 100644 --- a/lisp/mh-e/mh-inc.el +++ b/lisp/mh-e/mh-inc.el @@ -28,8 +28,6 @@ ;; inc can also be used to incorporate mail from multiple spool files ;; into separate folders. See "C-h v mh-inc-spool-list". -;;; Change Log: - ;;; Code: (require 'mh-e) diff --git a/lisp/mh-e/mh-junk.el b/lisp/mh-e/mh-junk.el index 5a407947a0b..e50bf8df50c 100644 --- a/lisp/mh-e/mh-junk.el +++ b/lisp/mh-e/mh-junk.el @@ -26,8 +26,6 @@ ;; Spam handling in MH-E. -;;; Change Log: - ;;; Code: (require 'mh-e) diff --git a/lisp/mh-e/mh-letter.el b/lisp/mh-e/mh-letter.el index 59790181c4d..ae5b80d5807 100644 --- a/lisp/mh-e/mh-letter.el +++ b/lisp/mh-e/mh-letter.el @@ -31,8 +31,6 @@ ;; mh-utils.el. That will help prevent the loading of this file until ;; a message is actually composed. -;;; Change Log: - ;;; Code: (require 'mh-e) diff --git a/lisp/mh-e/mh-limit.el b/lisp/mh-e/mh-limit.el index 08f1b4093f1..39cf7c5d271 100644 --- a/lisp/mh-e/mh-limit.el +++ b/lisp/mh-e/mh-limit.el @@ -25,8 +25,6 @@ ;; "Poor man's threading" by psg. -;;; Change Log: - ;;; Code: (require 'mh-e) diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el index fec2293ff1f..ef702525b7b 100644 --- a/lisp/mh-e/mh-mime.el +++ b/lisp/mh-e/mh-mime.el @@ -36,8 +36,6 @@ ;; MIME option to mh-forward command to move to content-description ;; insertion point. -;;; Change Log: - ;;; Code: (require 'mh-e) diff --git a/lisp/mh-e/mh-print.el b/lisp/mh-e/mh-print.el index d084cf63e97..2074ff6f8f3 100644 --- a/lisp/mh-e/mh-print.el +++ b/lisp/mh-e/mh-print.el @@ -24,8 +24,6 @@ ;;; Commentary: -;;; Change Log: - ;;; Code: (require 'mh-e) diff --git a/lisp/mh-e/mh-scan.el b/lisp/mh-e/mh-scan.el index f00ab22958a..15049793adf 100644 --- a/lisp/mh-e/mh-scan.el +++ b/lisp/mh-e/mh-scan.el @@ -27,8 +27,6 @@ ;; This file contains constants and a few functions for interpreting ;; scan lines. -;;; Change Log: - ;;; Code: (require 'mh-e) diff --git a/lisp/mh-e/mh-search.el b/lisp/mh-e/mh-search.el index cb8f8e34558..9df7c326564 100644 --- a/lisp/mh-e/mh-search.el +++ b/lisp/mh-e/mh-search.el @@ -39,8 +39,6 @@ ;; documentation will direct you to the specific instructions for ;; your particular searcher. -;;; Change Log: - ;;; Code: (require 'mh-e) diff --git a/lisp/mh-e/mh-seq.el b/lisp/mh-e/mh-seq.el index 9b9675c78e1..9cdf39f7f1e 100644 --- a/lisp/mh-e/mh-seq.el +++ b/lisp/mh-e/mh-seq.el @@ -26,8 +26,6 @@ ;; Sequences are stored in the alist `mh-seq-list' in the form: ;; ((seq-name msgs ...) (seq-name msgs ...) ...) -;;; Change Log: - ;;; Code: (require 'mh-e) diff --git a/lisp/mh-e/mh-show.el b/lisp/mh-e/mh-show.el index cb9819f17c7..6134e8350c8 100644 --- a/lisp/mh-e/mh-show.el +++ b/lisp/mh-e/mh-show.el @@ -26,8 +26,6 @@ ;; Mode for showing messages. -;;; Change Log: - ;;; Code: (require 'mh-e) diff --git a/lisp/mh-e/mh-speed.el b/lisp/mh-e/mh-speed.el index b2deacf6a74..3af840c3a31 100644 --- a/lisp/mh-e/mh-speed.el +++ b/lisp/mh-e/mh-speed.el @@ -26,8 +26,6 @@ ;; Future versions should only use flists. -;;; Change Log: - ;;; Code: (require 'mh-e) diff --git a/lisp/mh-e/mh-thread.el b/lisp/mh-e/mh-thread.el index 01b6863038b..89b0dbd9798 100644 --- a/lisp/mh-e/mh-thread.el +++ b/lisp/mh-e/mh-thread.el @@ -69,8 +69,6 @@ ;; (5) Better canonicalizing for message identifier and subject ;; strings. -;;; Change Log: - ;;; Code: (require 'mh-e) diff --git a/lisp/mh-e/mh-tool-bar.el b/lisp/mh-e/mh-tool-bar.el index 40a430b9641..94aa8dd4a92 100644 --- a/lisp/mh-e/mh-tool-bar.el +++ b/lisp/mh-e/mh-tool-bar.el @@ -24,8 +24,6 @@ ;;; Commentary: -;;; Change Log: - ;;; Code: (require 'mh-e) diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el index e73c1db9e45..8e900dc0113 100644 --- a/lisp/mh-e/mh-utils.el +++ b/lisp/mh-e/mh-utils.el @@ -24,8 +24,6 @@ ;;; Commentary: -;;; Change Log: - ;;; Code: (require 'mh-e) diff --git a/lisp/mh-e/mh-xface.el b/lisp/mh-e/mh-xface.el index 0b53829b056..d4d5c5c3784 100644 --- a/lisp/mh-e/mh-xface.el +++ b/lisp/mh-e/mh-xface.el @@ -23,8 +23,6 @@ ;;; Commentary: -;;; Change Log: - ;;; Code: (require 'mh-e) diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 86b5d449872..04ea8091277 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -6258,10 +6258,6 @@ be recognized automatically (they are all valid BS2000 hosts too)." ;; ange-ftp-bs2000-file-name-as-directory ;; ange-ftp-bs2000-make-compressed-filename ;; ange-ftp-bs2000-file-name-sans-versions - -;;;; ------------------------------------------------------------ -;;;; Finally provide package. -;;;; ------------------------------------------------------------ (provide 'ange-ftp) diff --git a/lisp/obsolete/fast-lock.el b/lisp/obsolete/fast-lock.el index baed8be7663..960233d5627 100644 --- a/lisp/obsolete/fast-lock.el +++ b/lisp/obsolete/fast-lock.el @@ -752,8 +752,6 @@ See `fast-lock-get-face-properties'." (unless (assq 'fast-lock-mode minor-mode-alist) (setq minor-mode-alist (append minor-mode-alist '((fast-lock-mode nil))))) -;; Provide ourselves: - (provide 'fast-lock) ;;; fast-lock.el ends here diff --git a/lisp/obsolete/lazy-lock.el b/lisp/obsolete/lazy-lock.el index 34bf85f864c..13f14aad6d1 100644 --- a/lisp/obsolete/lazy-lock.el +++ b/lisp/obsolete/lazy-lock.el @@ -1016,8 +1016,6 @@ verbosity is controlled via the variable `lazy-lock-stealth-verbose'." (unless (assq 'lazy-lock-mode minor-mode-alist) (setq minor-mode-alist (append minor-mode-alist '((lazy-lock-mode nil))))) -;; Provide ourselves: - (provide 'lazy-lock) ;; Local Variables: diff --git a/lisp/obsolete/nnir.el b/lisp/obsolete/nnir.el index f2ea5c67ceb..40a8ec57b98 100644 --- a/lisp/obsolete/nnir.el +++ b/lisp/obsolete/nnir.el @@ -1339,7 +1339,6 @@ Query for the specs, or use SPECS." (define-obsolete-function-alias 'nnir-get-active #'gnus-server-get-active "28.1") -;; The end. (provide 'nnir) ;;; nnir.el ends here diff --git a/lisp/obsolete/sregex.el b/lisp/obsolete/sregex.el index 96d6b7aebf0..371dcbf8498 100644 --- a/lisp/obsolete/sregex.el +++ b/lisp/obsolete/sregex.el @@ -208,7 +208,7 @@ ;; This is a "trapdoor" for including ordinary regular expression ;; strings in the result. Some regular expressions are clearer when ;; written the old way: "[a-z]" vs. (sregexq (char (?a . ?z))), for -;; instance. However, see the note under "Bugs," below. +;; instance. ;; Each CHAR-CLAUSE that is passed to (char ...) and (not-char ...) ;; has one of the following forms: @@ -236,8 +236,6 @@ ;; - add support for non-greedy operators *? and +? ;; - bug: (sregexq (opt (opt ?a))) returns "a??" which is a non-greedy "a?" -;;; Bugs: - ;;; Code: (eval-when-compile (require 'cl-lib)) diff --git a/lisp/progmodes/glasses.el b/lisp/progmodes/glasses.el index a0f5d36bb65..cd92175bd61 100644 --- a/lisp/progmodes/glasses.el +++ b/lisp/progmodes/glasses.el @@ -321,10 +321,6 @@ separators (like underscores) at places they belong to." (remove-hook 'write-file-functions 'glasses-convert-to-unreadable t))))) - -;;; Announce - (provide 'glasses) - ;;; glasses.el ends here diff --git a/lisp/progmodes/meta-mode.el b/lisp/progmodes/meta-mode.el index a59014827e8..50268446025 100644 --- a/lisp/progmodes/meta-mode.el +++ b/lisp/progmodes/meta-mode.el @@ -942,9 +942,6 @@ The environment marked is the one that contains point or follows point." (list (list "\\<\\(\\sw+\\)" 1 'meta-symbol-list) (list "" 'ispell-complete-word)))) - -;;; Just in case ... - (provide 'meta-mode) (run-hooks 'meta-mode-load-hook) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 30721c7a577..20ec339fffb 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -247,8 +247,6 @@ ;; I'd recommend the first one since you'll get the same behavior for ;; all modes out-of-the-box. -;;; TODO: - ;;; Code: (require 'ansi-color) diff --git a/lisp/speedbar.el b/lisp/speedbar.el index 12e57b11082..118c7260769 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el @@ -4055,7 +4055,6 @@ this version is not backward compatible to 0.14 or earlier.") (provide 'speedbar) -;; run load-time hooks (run-hooks 'speedbar-load-hook) ;;; speedbar ends here diff --git a/lisp/textmodes/bibtex-style.el b/lisp/textmodes/bibtex-style.el index 6d01871bc52..27b2e0e3331 100644 --- a/lisp/textmodes/bibtex-style.el +++ b/lisp/textmodes/bibtex-style.el @@ -24,7 +24,6 @@ ;; Done: font-lock, imenu, outline, commenting, indentation. ;; Todo: tab-completion. -;; Bugs: ;;; Code: diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index f01c66b1584..31186fb4fac 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -5608,8 +5608,5 @@ If APPEND is non-nil, append ENTRIES to those already displayed." (setq buffer-read-only t) (goto-char (point-min))) - -;; Make BibTeX a Feature - (provide 'bibtex) ;;; bibtex.el ends here diff --git a/lisp/textmodes/makeinfo.el b/lisp/textmodes/makeinfo.el index 8152f4b89c8..653540ad415 100644 --- a/lisp/textmodes/makeinfo.el +++ b/lisp/textmodes/makeinfo.el @@ -284,7 +284,6 @@ line LINE of the window, or centered if LINE is nil." (pop-to-buffer old-buffer) ))) -;;; Place `provide' at end of file. (provide 'makeinfo) ;;; makeinfo.el ends here diff --git a/lisp/textmodes/page.el b/lisp/textmodes/page.el index e1d7fb7431c..b86a2f149de 100644 --- a/lisp/textmodes/page.el +++ b/lisp/textmodes/page.el @@ -170,8 +170,6 @@ point, respectively." (interactive) (apply #'message (cons "Page %d, line %d" (page--what-page)))) - -;;; Place `provide' at end of file. (provide 'page) ;;; page.el ends here diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index fb57b9b0f23..8d7f459190b 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -28,7 +28,6 @@ ;;; Code: -;; Pacify the byte-compiler (eval-when-compile (require 'compare-w) (require 'cl-lib) diff --git a/lisp/textmodes/texinfmt.el b/lisp/textmodes/texinfmt.el index a797df9193f..5ce39da7968 100644 --- a/lisp/textmodes/texinfmt.el +++ b/lisp/textmodes/texinfmt.el @@ -23,10 +23,10 @@ ;;; Commentary: -;;; Code: - ;;; Emacs lisp functions to convert Texinfo files to Info files. +;;; Code: + (defvar texinfmt-version "2.42 of 7 Jul 2006") (make-obsolete-variable 'texinfmt-version 'emacs-version "28.1") @@ -4310,8 +4310,6 @@ For example, invoke (setq error 1)))) (kill-emacs error)))) - -;;; Place `provide' at end of file. (provide 'texinfmt) ;;; texinfmt.el ends here diff --git a/lisp/textmodes/texnfo-upd.el b/lisp/textmodes/texnfo-upd.el index 27807a95e60..03004548302 100644 --- a/lisp/textmodes/texnfo-upd.el +++ b/lisp/textmodes/texnfo-upd.el @@ -2112,8 +2112,6 @@ chapter." (message "Multiple files updated.")) - -;; Place `provide' at end of file. (provide 'texnfo-upd) ;;; texnfo-upd.el ends here diff --git a/lisp/textmodes/tildify.el b/lisp/textmodes/tildify.el index 163978b4315..01e2ad72d88 100644 --- a/lisp/textmodes/tildify.el +++ b/lisp/textmodes/tildify.el @@ -503,8 +503,6 @@ variable will be set to the representation." (remove-hook 'post-self-insert-hook #'tildify-space t))) -;;; *** Announce *** - (provide 'tildify) ;;; tildify.el ends here diff --git a/lisp/uniquify.el b/lisp/uniquify.el index 1d513d60376..7cc01687f49 100644 --- a/lisp/uniquify.el +++ b/lisp/uniquify.el @@ -498,8 +498,6 @@ For use on `kill-buffer-hook'." (file-name-directory filename) retval))) retval)) -;;; The End - (defun uniquify-unload-function () "Unload the uniquify library." (save-current-buffer diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index a054a7c3176..c9c1e91d483 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -26,10 +26,6 @@ ;; This is a mercurial version control backend -;;; Thanks: - -;;; Bugs: - ;;; Todo: ;; 1) Implement the rest of the vc interface. See the comment at the diff --git a/lisp/widget.el b/lisp/widget.el index 401b4cf298f..d258e6fae2b 100644 --- a/lisp/widget.el +++ b/lisp/widget.el @@ -94,8 +94,6 @@ The third argument DOC is a documentation string for the widget." ;; This is used by external widget code (in W3, at least). (define-obsolete-function-alias 'widget-plist-member #'plist-member "26.1") -;;; The End. - (provide 'widget) ;;; widget.el ends here diff --git a/test/manual/cedet/tests/test.el b/test/manual/cedet/tests/test.el index a54c253be68..d1d0d1602f4 100644 --- a/test/manual/cedet/tests/test.el +++ b/test/manual/cedet/tests/test.el @@ -153,7 +153,4 @@ (defvar-mode-local emacs-lisp-mode a-mode-local-def "some value") - -;;; Provide -;; (provide 'test) -- cgit v1.2.3 From 051434fdefd6418bf1f0cd28c087b31cb3921f48 Mon Sep 17 00:00:00 2001 From: Mattias Engdegård Date: Sun, 8 Aug 2021 18:58:46 +0200 Subject: Use string-replace instead of replace-regexp-in-string `string-replace` is easier to understand, less error-prone, much faster, and results in shorter Lisp and byte code. Use it where applicable and obviously safe (erring on the conservative side). * admin/authors.el (authors-scan-change-log): * lisp/autoinsert.el (auto-insert-alist): * lisp/calc/calc-prog.el (calc-edit-macro-combine-alg-ent) (calc-edit-macro-combine-ext-command) (calc-edit-macro-combine-var-name): * lisp/calc/calc-units.el (math-make-unit-string): * lisp/calendar/cal-html.el (cal-html-comment): * lisp/calendar/cal-tex.el (cal-tex-comment): * lisp/calendar/icalendar.el (icalendar--convert-string-for-export) (icalendar--convert-string-for-import): * lisp/calendar/iso8601.el (iso8601--concat-regexps) (iso8601--full-time-match, iso8601--combined-match): * lisp/calendar/time-date.el (format-seconds): * lisp/calendar/todo-mode.el (todo-filter-items-filename): * lisp/cedet/cedet-files.el (cedet-directory-name-to-file-name) (cedet-file-name-to-directory-name): * lisp/comint.el (comint-watch-for-password-prompt): * lisp/dired-aux.el (dired-do-chmod): * lisp/dired-x.el (dired-man): * lisp/dired.el (dired-insert-directory, dired-goto-file-1): * lisp/emacs-lisp/comp.el (comp-c-func-name): * lisp/emacs-lisp/re-builder.el (reb-copy): * lisp/erc/erc-dcc.el (erc-dcc-unquote-filename): * lisp/erc/erc.el (erc-quit-reason-zippy, erc-part-reason-zippy) (erc-update-mode-line-buffer, erc-message-english-PART): * lisp/files.el (make-backup-file-name-1, files--transform-file-name) (read-file-modes): * lisp/fringe.el (fringe-mode): * lisp/gnus/gnus-art.el (gnus-button-handle-info-url): * lisp/gnus/gnus-group.el (gnus-group-completing-read): * lisp/gnus/gnus-icalendar.el (gnus-icalendar-event-from-ical): * lisp/gnus/gnus-mlspl.el (gnus-group-split-fancy): * lisp/gnus/gnus-search.el (gnus-search-query-parse-date) (gnus-search-transform-expression, gnus-search-run-search): * lisp/gnus/gnus-start.el (gnus-dribble-enter): * lisp/gnus/gnus-sum.el (gnus-summary-refer-article): * lisp/gnus/gnus-util.el (gnus-mode-string-quote): * lisp/gnus/message.el (message-put-addresses-in-ecomplete) (message-parse-mailto-url, message-mailto-1): * lisp/gnus/mml-sec.el (mml-secure-epg-sign): * lisp/gnus/mml-smime.el (mml-smime-epg-verify): * lisp/gnus/mml2015.el (mml2015-epg-verify): * lisp/gnus/nnmaildir.el (nnmaildir--system-name) (nnmaildir-request-list, nnmaildir-retrieve-groups) (nnmaildir-request-group, nnmaildir-retrieve-headers): * lisp/gnus/nnrss.el (nnrss-node-text): * lisp/gnus/spam-report.el (spam-report-gmane-internal) (spam-report-user-mail-address): * lisp/ibuffer.el (name): * lisp/image-dired.el (image-dired-pngnq-thumb) (image-dired-pngcrush-thumb, image-dired-optipng-thumb) (image-dired-create-thumb-1): * lisp/info.el (Info-set-mode-line): * lisp/international/mule-cmds.el (describe-language-environment): * lisp/mail/rfc2231.el (rfc2231-parse-string): * lisp/mail/rfc2368.el (rfc2368-parse-mailto-url): * lisp/mail/rmail.el (rmail-insert-inbox-text) (rmail-simplified-subject-regexp): * lisp/mail/rmailout.el (rmail-output-body-to-file): * lisp/mail/undigest.el (rmail-digest-rfc1153): * lisp/man.el (Man-default-man-entry): * lisp/mouse.el (minor-mode-menu-from-indicator): * lisp/mpc.el (mpc--debug): * lisp/net/browse-url.el (browse-url-mail): * lisp/net/eww.el (eww-update-header-line-format): * lisp/net/newst-backend.el (newsticker-save-item): * lisp/net/rcirc.el (rcirc-sentinel): * lisp/net/soap-client.el (soap-decode-date-time): * lisp/nxml/rng-cmpct.el (rng-c-literal-2-re): * lisp/nxml/xmltok.el (let*): * lisp/obsolete/nnir.el (nnir-run-swish-e, nnir-run-hyrex) (nnir-run-find-grep): * lisp/play/dunnet.el (dun-doassign): * lisp/play/handwrite.el (handwrite): * lisp/proced.el (proced-format-args): * lisp/profiler.el (profiler-report-header-line-format): * lisp/progmodes/gdb-mi.el (gdb-mi-quote): * lisp/progmodes/make-mode.el (makefile-bsdmake-rule-action-regex) (makefile-make-font-lock-keywords): * lisp/progmodes/prolog.el (prolog-guess-fill-prefix): * lisp/progmodes/ruby-mode.el (ruby-toggle-string-quotes): * lisp/progmodes/sql.el (sql-remove-tabs-filter, sql-str-literal): * lisp/progmodes/which-func.el (which-func-current): * lisp/replace.el (query-replace-read-from) (occur-engine, replace-quote): * lisp/select.el (xselect--encode-string): * lisp/ses.el (ses-export-tab): * lisp/subr.el (shell-quote-argument): * lisp/term/pc-win.el (msdos-show-help): * lisp/term/w32-win.el (w32--set-selection): * lisp/term/xterm.el (gui-backend-set-selection): * lisp/textmodes/picture.el (picture-tab-search): * lisp/thumbs.el (thumbs-call-setroot-command): * lisp/tooltip.el (tooltip-show-help-non-mode): * lisp/transient.el (transient-format-key): * lisp/url/url-mailto.el (url-mailto): * lisp/vc/log-edit.el (log-edit-changelog-ours-p): * lisp/vc/vc-bzr.el (vc-bzr-status): * lisp/vc/vc-hg.el (vc-hg--glob-to-pcre): * lisp/vc/vc-svn.el (vc-svn-after-dir-status): * lisp/xdg.el (xdg-desktop-strings): * test/lisp/electric-tests.el (defun): * test/lisp/term-tests.el (term-simple-lines): * test/lisp/time-stamp-tests.el (formatz-mod-del-colons): * test/lisp/wdired-tests.el (wdired-test-bug32173-01) (wdired-test-unfinished-edit-01): * test/src/json-tests.el (json-parse-with-custom-null-and-false-objects): Use `string-replace` instead of `replace-regexp-in-string`. --- admin/authors.el | 2 +- lisp/autoinsert.el | 4 ++-- lisp/calc/calc-prog.el | 8 ++++---- lisp/calc/calc-units.el | 2 +- lisp/calendar/cal-html.el | 2 +- lisp/calendar/cal-tex.el | 2 +- lisp/calendar/icalendar.el | 12 ++++++------ lisp/calendar/iso8601.el | 6 +++--- lisp/calendar/time-date.el | 2 +- lisp/calendar/todo-mode.el | 2 +- lisp/cedet/cedet-files.el | 4 ++-- lisp/comint.el | 2 +- lisp/dired-aux.el | 2 +- lisp/dired-x.el | 2 +- lisp/dired.el | 14 +++++++------- lisp/emacs-lisp/comp.el | 2 +- lisp/emacs-lisp/re-builder.el | 2 +- lisp/erc/erc-dcc.el | 4 ++-- lisp/erc/erc.el | 8 ++++---- lisp/files.el | 6 +++--- lisp/fringe.el | 2 +- lisp/gnus/gnus-art.el | 2 +- lisp/gnus/gnus-group.el | 2 +- lisp/gnus/gnus-icalendar.el | 8 ++++---- lisp/gnus/gnus-mlspl.el | 2 +- lisp/gnus/gnus-search.el | 10 +++++----- lisp/gnus/gnus-start.el | 2 +- lisp/gnus/gnus-sum.el | 2 +- lisp/gnus/gnus-util.el | 2 +- lisp/gnus/message.el | 8 ++++---- lisp/gnus/mml-sec.el | 2 +- lisp/gnus/mml-smime.el | 2 +- lisp/gnus/mml2015.el | 2 +- lisp/gnus/nnmaildir.el | 18 ++++++++---------- lisp/gnus/nnrss.el | 2 +- lisp/gnus/spam-report.el | 4 ++-- lisp/ibuffer.el | 2 +- lisp/image-dired.el | 8 ++++---- lisp/info.el | 4 ++-- lisp/international/mule-cmds.el | 2 +- lisp/mail/rfc2231.el | 2 +- lisp/mail/rfc2368.el | 2 +- lisp/mail/rmail.el | 4 ++-- lisp/mail/rmailout.el | 4 ++-- lisp/mail/undigest.el | 2 +- lisp/man.el | 2 +- lisp/mouse.el | 2 +- lisp/mpc.el | 4 ++-- lisp/net/browse-url.el | 2 +- lisp/net/eww.el | 2 +- lisp/net/newst-backend.el | 2 +- lisp/net/rcirc.el | 2 +- lisp/net/soap-client.el | 2 +- lisp/nxml/rng-cmpct.el | 2 +- lisp/nxml/xmltok.el | 2 +- lisp/obsolete/nnir.el | 12 ++++++------ lisp/play/dunnet.el | 2 +- lisp/play/handwrite.el | 2 +- lisp/proced.el | 2 +- lisp/profiler.el | 2 +- lisp/progmodes/gdb-mi.el | 2 +- lisp/progmodes/make-mode.el | 7 +++---- lisp/progmodes/prolog.el | 2 +- lisp/progmodes/ruby-mode.el | 4 ++-- lisp/progmodes/sql.el | 4 ++-- lisp/progmodes/which-func.el | 2 +- lisp/replace.el | 14 ++++++-------- lisp/select.el | 2 +- lisp/ses.el | 2 +- lisp/subr.el | 2 +- lisp/term/pc-win.el | 2 +- lisp/term/w32-win.el | 2 +- lisp/term/xterm.el | 5 ++--- lisp/textmodes/picture.el | 4 ++-- lisp/thumbs.el | 6 +++--- lisp/tooltip.el | 2 +- lisp/transient.el | 12 ++++++------ lisp/url/url-mailto.el | 2 +- lisp/vc/log-edit.el | 4 ++-- lisp/vc/vc-bzr.el | 2 +- lisp/vc/vc-hg.el | 4 ++-- lisp/vc/vc-svn.el | 2 +- lisp/xdg.el | 4 ++-- test/lisp/electric-tests.el | 2 +- test/lisp/term-tests.el | 2 +- test/lisp/time-stamp-tests.el | 2 +- test/lisp/wdired-tests.el | 4 ++-- test/src/json-tests.el | 2 +- 88 files changed, 164 insertions(+), 170 deletions(-) (limited to 'lisp/vc/vc-hg.el') diff --git a/admin/authors.el b/admin/authors.el index 6c81c7872fc..a400b1327af 100644 --- a/admin/authors.el +++ b/admin/authors.el @@ -1475,7 +1475,7 @@ Suggested\\|Trivial\\|Version\\|Originally\\|From:\\|Patch[ \t]+[Bb]y\\)"))) (when (string-match ":" line) (setq line (substring line 0 (match-beginning 0))) (setq line (replace-regexp-in-string "[[(<{].*$" "" line)) - (setq line (replace-regexp-in-string "," "" line)) + (setq line (string-replace "," "" line)) (dolist (file (split-string line)) (when (setq file (authors-canonical-file-name file log-file pos (car authors))) (dolist (author authors) diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el index 0392903c332..995d9e2e0fe 100644 --- a/lisp/autoinsert.el +++ b/lisp/autoinsert.el @@ -93,8 +93,8 @@ If this contains a %s, that will be replaced by the matching rule." '((("\\.\\([Hh]\\|hh\\|hpp\\|hxx\\|h\\+\\+\\)\\'" . "C / C++ header") (replace-regexp-in-string "[^A-Z0-9]" "_" - (replace-regexp-in-string - "\\+" "P" + (string-replace + "+" "P" (upcase (file-name-nondirectory buffer-file-name)))) "#ifndef " str \n "#define " str "\n\n" diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el index 4e27d7671e2..6f1e5c782df 100644 --- a/lisp/calc/calc-prog.el +++ b/lisp/calc/calc-prog.el @@ -802,8 +802,8 @@ (when match (kill-line 1) (setq line (concat line (substring curline 0 match)))) - (setq line (replace-regexp-in-string "SPC" " SPC " - (replace-regexp-in-string " " "" line))) + (setq line (string-replace "SPC" " SPC " + (string-replace " " "" line))) (insert line "\t\t\t") (if (> (current-column) 24) (delete-char -1)) @@ -830,7 +830,7 @@ (when match (kill-line 1) (setq line (concat line (substring curline 0 match)))) - (setq line (replace-regexp-in-string " " "" line)) + (setq line (string-replace " " "" line)) (insert cmdbeg " " line "\t\t\t") (if (> (current-column) 24) (delete-char -1)) @@ -857,7 +857,7 @@ (when match (kill-line 1) (setq line (concat line (substring curline 0 match)))) - (setq line (replace-regexp-in-string " " "" line)) + (setq line (string-replace " " "" line)) (insert line "\t\t\t") (if (> (current-column) 24) (delete-char -1)) diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index c3adc3db02a..8b6f0637035 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -406,7 +406,7 @@ Entries are (SYMBOL EXPR DOC-STRING TEMP-TYPE BASE-UNITS).") If EXPR is nil, return nil." (if expr (let ((cexpr (math-compose-expr expr 0))) - (replace-regexp-in-string + (string-replace " / " "/" (if (stringp cexpr) cexpr diff --git a/lisp/calendar/cal-html.el b/lisp/calendar/cal-html.el index e5810c3f027..58a5a0f83a5 100644 --- a/lisp/calendar/cal-html.el +++ b/lisp/calendar/cal-html.el @@ -151,7 +151,7 @@ (defun cal-html-comment (string) "Return STRING as html comment." (format "\n" - (replace-regexp-in-string "--" "++" string))) + (string-replace "--" "++" string))) (defun cal-html-href (link string) "Return a hyperlink to url LINK with text STRING." diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el index f5932014dd9..3830024ef3d 100644 --- a/lisp/calendar/cal-tex.el +++ b/lisp/calendar/cal-tex.el @@ -1755,7 +1755,7 @@ current contents." COMMENT may contain newlines, which are prefixed by \"% \" in the output." (insert (format "%% %s\n" (if comment - (replace-regexp-in-string "\n" "\n% " comment) + (string-replace "\n" "\n% " comment) "")))) (defun cal-tex-banner (comment) diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el index d18ec5e798f..cf37331394c 100644 --- a/lisp/calendar/icalendar.el +++ b/lisp/calendar/icalendar.el @@ -998,15 +998,15 @@ TIMESTRING and has the same result as \"9:00\"." (defun icalendar--convert-string-for-export (string) "Escape comma and other critical characters in STRING." - (replace-regexp-in-string "," "\\\\," string)) + (string-replace "," "\\," string)) (defun icalendar--convert-string-for-import (string) "Remove escape chars for comma, semicolon etc. from STRING." - (replace-regexp-in-string - "\\\\n" "\n " (replace-regexp-in-string - "\\\\\"" "\"" (replace-regexp-in-string - "\\\\;" ";" (replace-regexp-in-string - "\\\\," "," string))))) + (string-replace + "\\n" "\n " (string-replace + "\\\"" "\"" (string-replace + "\\;" ";" (string-replace + "\\," "," string))))) ;; ====================================================================== ;; Export -- convert emacs-diary to iCalendar diff --git a/lisp/calendar/iso8601.el b/lisp/calendar/iso8601.el index f22f060e205..1de1796a054 100644 --- a/lisp/calendar/iso8601.el +++ b/lisp/calendar/iso8601.el @@ -57,7 +57,7 @@ (defun iso8601--concat-regexps (regexps) (mapconcat (lambda (regexp) (concat "\\(?:" - (replace-regexp-in-string "(" "(?:" regexp) + (string-replace "(" "(?:" regexp) "\\)")) regexps "\\|")) @@ -92,13 +92,13 @@ "\\(Z\\|\\([+-]\\)\\([0-9][0-9]\\):?\\([0-9][0-9]\\)?\\)") (defconst iso8601--full-time-match - (concat "\\(" (replace-regexp-in-string "(" "(?:" iso8601--time-match) "\\)" + (concat "\\(" (string-replace "(" "(?:" iso8601--time-match) "\\)" "\\(" iso8601--zone-match "\\)?")) (defconst iso8601--combined-match (concat "\\(" iso8601--date-match "\\)" "\\(?:T\\(" - (replace-regexp-in-string "(" "(?:" iso8601--time-match) + (string-replace "(" "(?:" iso8601--time-match) "\\)" "\\(" iso8601--zone-match "\\)?\\)?")) diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el index 1c169b78fd6..0aa38166bc1 100644 --- a/lisp/calendar/time-date.el +++ b/lisp/calendar/time-date.el @@ -357,7 +357,7 @@ is output until the first non-zero unit is encountered." (format " %s%s" name (if (= num 1) "" "s")))) t t string)))))) - (replace-regexp-in-string "%%" "%" string)) + (string-replace "%%" "%" string)) (defvar seconds-to-string (list (list 1 "ms" 0.001) diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el index 680beb85aff..371d10631c5 100644 --- a/lisp/calendar/todo-mode.el +++ b/lisp/calendar/todo-mode.el @@ -4546,7 +4546,7 @@ its priority has changed, and `same' otherwise." (let ((bufname (buffer-name))) (string-match "\"\\([^\"]+\\)\"" bufname) (let* ((filename-str (substring bufname (match-beginning 1) (match-end 1))) - (filename-base (replace-regexp-in-string ", " "-" filename-str)) + (filename-base (string-replace ", " "-" filename-str)) (top-priorities (string-match "top priorities" bufname)) (diary-items (string-match "diary items" bufname)) (regexp-items (string-match "regexp items" bufname))) diff --git a/lisp/cedet/cedet-files.el b/lisp/cedet/cedet-files.el index c9d557f5974..f540fb5540f 100644 --- a/lisp/cedet/cedet-files.el +++ b/lisp/cedet/cedet-files.el @@ -59,7 +59,7 @@ to the file's truename, and dodging platform tricks." ;; doubling `!'s in the original name... (setq file (subst-char-in-string ?/ ?! - (replace-regexp-in-string "!" "!!" file))) + (string-replace "!" "!!" file))) file)) (defun cedet-file-name-to-directory-name (referencefile &optional testmode) @@ -71,7 +71,7 @@ specific conversions during tests." ;; Replace the ! with / (setq file (subst-char-in-string ?! ?/ file)) ;; Occurrences of // meant there was once a single !. - (setq file (replace-regexp-in-string "//" "!" file)) + (setq file (string-replace "//" "!" file)) ;; Handle Windows special cases (when (or (memq system-type '(windows-nt ms-dos)) testmode) diff --git a/lisp/comint.el b/lisp/comint.el index 40f58f2da7b..7af8e8fd2a5 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -2439,7 +2439,7 @@ carriage returns (\\r) in STRING. This function could be in the list `comint-output-filter-functions'." (when (let ((case-fold-search t)) (string-match comint-password-prompt-regexp - (replace-regexp-in-string "\r" "" string))) + (string-replace "\r" "" string))) (let ((comint--prompt-recursion-depth (1+ comint--prompt-recursion-depth))) (if (> comint--prompt-recursion-depth 10) (message "Password prompt recursion too deep") diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 060f3a84111..72969dd96e2 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -508,7 +508,7 @@ has no effect on MS-Windows." (default (and (stringp modestr) (string-match "^.\\(...\\)\\(...\\)\\(...\\)$" modestr) - (replace-regexp-in-string + (string-replace "-" "" (format "u=%s,g=%s,o=%s" (match-string 1 modestr) diff --git a/lisp/dired-x.el b/lisp/dired-x.el index a7bfae759ed..a990bd3fec3 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -1193,7 +1193,7 @@ NOSELECT the files are merely found but not selected." (interactive) (require 'man) (let* ((file (dired-get-filename)) - (manual-program (replace-regexp-in-string "\\*" "%s" + (manual-program (string-replace "*" "%s" (dired-guess-shell-command "Man command: " (list file))))) (Man-getpage-in-background file))) diff --git a/lisp/dired.el b/lisp/dired.el index 28448be06ce..e577df510ad 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -1587,8 +1587,8 @@ see `dired-use-ls-dired' for more details.") ;; because newlines in dirnames are uncommon, and people may ;; have gotten used to seeing unescaped "\" in the headers. ;; Note: adjust dired-build-subdir-alist if you change this. - (setq dir (replace-regexp-in-string "\\\\" "\\\\" dir nil t) - dir (replace-regexp-in-string "\n" "\\n" dir nil t))) + (setq dir (string-replace "\\" "\\\\" dir) + dir (string-replace "\n" "\\n" dir))) ;; If we used --dired and it worked, the lines are already indented. ;; Otherwise, indent them. (unless (save-excursion @@ -3167,15 +3167,15 @@ the quoted forms of those characters. FULL-NAME specifies the actual file name the listing must have, as returned by `dired-get-filename'. LIMIT is the search limit." (let (str) - (setq str (replace-regexp-in-string "\^m" "\\^m" file nil t)) - (setq str (replace-regexp-in-string "\\\\" "\\\\" str nil t)) + (setq str (string-replace "\^m" "\\^m" file)) + (setq str (string-replace "\\" "\\\\" str)) (and (dired-switches-escape-p dired-actual-switches) (string-match-p "[ \t\n]" str) ;; FIXME: to fix this for embedded control characters etc, we ;; should escape everything that `ls -b' does. - (setq str (replace-regexp-in-string " " "\\ " str nil t) - str (replace-regexp-in-string "\t" "\\t" str nil t) - str (replace-regexp-in-string "\n" "\\n" str nil t))) + (setq str (string-replace " " "\\ " str) + str (string-replace "\t" "\\t" str) + str (string-replace "\n" "\\n" str))) (let ((found nil) ;; filenames are preceded by SPC, this makes the search faster ;; (e.g. for the filename "-"). diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index a04413b6f00..ed75bf2bfa9 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -1171,7 +1171,7 @@ clashes." do (aset str j (aref byte 0)) (aset str (1+ j) (aref byte 1)) finally return str)) - (human-readable (replace-regexp-in-string + (human-readable (string-replace "-" "_" orig-name)) (human-readable (replace-regexp-in-string (rx (not (any "0-9a-z_"))) "" human-readable))) diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el index 396949d59a2..aec438ed994 100644 --- a/lisp/emacs-lisp/re-builder.el +++ b/lisp/emacs-lisp/re-builder.el @@ -436,7 +436,7 @@ provided in the Commentary section of this library." (let ((re (with-output-to-string (print (reb-target-binding reb-regexp))))) (setq re (substring re 1 (1- (length re)))) - (setq re (replace-regexp-in-string "\n" "\\n" re nil t)) + (setq re (string-replace "\n" "\\n" re)) (kill-new re) (message "Copied regexp `%s' to kill-ring" re))) diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el index 219af3741fa..fcdb8df2032 100644 --- a/lisp/erc/erc-dcc.el +++ b/lisp/erc/erc-dcc.el @@ -630,8 +630,8 @@ that subcommand." (define-inline erc-dcc-unquote-filename (filename) (inline-quote - (replace-regexp-in-string "\\\\\\\\" "\\" - (replace-regexp-in-string "\\\\\"" "\"" ,filename t t) t t))) + (string-replace "\\\\" "\\" + (string-replace "\\\"" "\"" ,filename)))) (defun erc-dcc-handle-ctcp-send (proc query nick login host to) "This is called if a CTCP DCC SEND subcommand is sent to the client. diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 026c6f84164..c66b03d2e4e 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -3597,7 +3597,7 @@ If S is non-nil, it will be used as the quit reason." If S is non-nil, it will be used as the quit reason." (or s (if (fboundp 'yow) - (replace-regexp-in-string "\n" "" (yow)) + (string-replace "\n" "" (yow)) (erc-quit/part-reason-default)))) (make-obsolete 'erc-quit-reason-zippy "it will be removed." "24.4") @@ -3624,7 +3624,7 @@ If S is non-nil, it will be used as the part reason." If S is non-nil, it will be used as the quit reason." (or s (if (fboundp 'yow) - (replace-regexp-in-string "\n" "" (yow)) + (string-replace "\n" "" (yow)) (erc-quit/part-reason-default)))) (make-obsolete 'erc-part-reason-zippy "it will be removed." "24.4") @@ -6528,7 +6528,7 @@ if `erc-away' is non-nil." (fill-region (point-min) (point-max)) (buffer-string)))) (setq header-line-format - (replace-regexp-in-string + (string-replace "%" "%%" (if face @@ -6804,7 +6804,7 @@ functions." nick user host channel (if (not (string= reason "")) (format ": %s" - (replace-regexp-in-string "%" "%%" reason)) + (string-replace "%" "%%" reason)) ""))))) diff --git a/lisp/files.el b/lisp/files.el index 89ee13eb686..54d0b919e1d 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -5201,7 +5201,7 @@ The function `find-backup-file-name' also uses this." (expand-file-name (subst-char-in-string ?/ ?! - (replace-regexp-in-string "!" "!!" file)) + (string-replace "!" "!!" file)) backup-directory)) (expand-file-name (file-name-nondirectory file) (file-name-as-directory abs-backup-directory)))))) @@ -6876,7 +6876,7 @@ the resulting file name, and SUFFIX is appended." (file-name-directory result) (subst-char-in-string ?/ ?! - (replace-regexp-in-string + (string-replace "!" "!!" filename)))) (t result)))) (setq result @@ -7989,7 +7989,7 @@ based on existing mode bits, as in \"og+rX-w\"." (default (and (stringp modestr) (string-match "^.\\(...\\)\\(...\\)\\(...\\)$" modestr) - (replace-regexp-in-string + (string-replace "-" "" (format "u=%s,g=%s,o=%s" (match-string 1 modestr) diff --git a/lisp/fringe.el b/lisp/fringe.el index d73aae0459e..82cfacc6b6f 100644 --- a/lisp/fringe.el +++ b/lisp/fringe.el @@ -189,7 +189,7 @@ fringes." :type `(choice ,@ (mapcar (lambda (style) (let ((name - (replace-regexp-in-string "-" " " (car style)))) + (string-replace "-" " " (car style)))) `(const :tag ,(concat (capitalize (substring name 0 1)) (substring name 1)) diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index fb0295d0703..d65e75e44c2 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -8288,7 +8288,7 @@ url is put as the `gnus-button-url' overlay property on the button." ")" (gnus-url-unhex-string (match-string 2 url))))) ((string-match "([^)\"]+)[^\"]+" url) (setq url - (replace-regexp-in-string + (string-replace "\"" "" (replace-regexp-in-string "[\n\t ]+" " " url))) (gnus-info-find-node url)) (t (error "Can't parse %s" url)))) diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 6202567344f..b1134397e55 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -2186,7 +2186,7 @@ handle COLLECTION as a list, hash table, or vector." require-match initial-input (or hist 'gnus-group-history) def))) - (replace-regexp-in-string "\n" "" group))) + (string-replace "\n" "" group))) ;;;###autoload (defun gnus-fetch-group (group &optional articles) diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el index 1b2743c1484..56f4fdf6d33 100644 --- a/lisp/gnus/gnus-icalendar.el +++ b/lisp/gnus/gnus-icalendar.el @@ -252,10 +252,10 @@ ;; ugly, but cannot get ;;replace-regexp-in-string work with "\\" as ;;REP, plus we should also handle "\\;" - (replace-regexp-in-string - "\\\\," "," - (replace-regexp-in-string - "\\\\n" "\n" (substring-no-properties value)))))) + (string-replace + "\\," "," + (string-replace + "\\n" "\n" (substring-no-properties value)))))) (accumulate-args (mapping) (cl-destructuring-bind (slot . ical-property) mapping diff --git a/lisp/gnus/gnus-mlspl.el b/lisp/gnus/gnus-mlspl.el index d42f0971259..664027f0164 100644 --- a/lisp/gnus/gnus-mlspl.el +++ b/lisp/gnus/gnus-mlspl.el @@ -209,7 +209,7 @@ Calling (gnus-group-split-fancy nil nil \"mail.others\") returns: "\\)")) ;; Now create the new SPLIT (let ((split-regexp-with-list-ids - (replace-regexp-in-string "@" "[@.]" split-regexp t t)) + (string-replace "@" "[@.]" split-regexp)) (exclude ;; Generate RESTRICTs for SPLIT-EXCLUDEs. (if (listp split-exclude) diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 8182630dfed..59b8efaa3ac 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -572,7 +572,7 @@ nil. If VALUE is a relative time, interpret it as relative to REL-DATE, or (current-time) if REL-DATE is nil." ;; Time parsing doesn't seem to work with slashes. - (let ((value (replace-regexp-in-string "/" "-" value)) + (let ((value (string-replace "/" "-" value)) (now (append '(0 0 0) (seq-subseq (decode-time (or rel-date (current-time))) @@ -1669,7 +1669,7 @@ cross our fingers for the rest of it." Mairix negation requires a \"~\" preceding string search terms, and \"-\" before marks." (let ((next (gnus-search-transform-expression engine (cadr expr)))) - (replace-regexp-in-string + (string-replace ":" (if (eql (caadr expr) 'mark) ":-" @@ -1863,9 +1863,9 @@ Assume \"size\" key is equal to \"larger\"." group (if (file-directory-p (setq group - (replace-regexp-in-string - "\\." "/" - group nil t))) + (string-replace + "." "/" + group))) group)))))) (unless group (signal 'gnus-search-config-error diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index 44e97d54846..02bbe19e7fe 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el @@ -854,7 +854,7 @@ If REGEXP is given, lines that match it will be deleted." (goto-char (point-max)) ;; Make sure that each dribble entry is a single line, so that ;; the "remove" code above works. - (insert (replace-regexp-in-string "\n" "\\\\n" string) "\n") + (insert (string-replace "\n" "\\n" string) "\n") (bury-buffer gnus-dribble-buffer) (with-current-buffer gnus-group-buffer (gnus-group-set-mode-line))))) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 4bdc2023eb4..dc004927b67 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -9191,7 +9191,7 @@ specified by the `gnus-refer-thread-limit' variable." (interactive "sMessage-ID: " gnus-summary-mode) (when (and (stringp message-id) (not (zerop (length message-id)))) - (setq message-id (replace-regexp-in-string " " "" message-id)) + (setq message-id (string-replace " " "" message-id)) ;; Construct the correct Message-ID if necessary. ;; Suggested by tale@pawl.rpi.edu. (unless (string-match "^<" message-id) diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index be0284515dc..7a5e00c5ec9 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -408,7 +408,7 @@ Cache the result as a text property stored in DATE." (defun gnus-mode-string-quote (string) "Quote all \"%\"'s in STRING." - (replace-regexp-in-string "%" "%%" string)) + (string-replace "%" "%%" string)) (defsubst gnus-make-hashtable (&optional size) "Make a hash table of SIZE, testing on `equal'." diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index bcbf7476715..a3ffaec3ff3 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -8599,7 +8599,7 @@ From headers in the original article." (let ((value (message-field-value header))) (dolist (string (mail-header-parse-addresses value 'raw)) (setq string - (replace-regexp-in-string + (string-replace "\n" "" (replace-regexp-in-string "^ +\\| +$" "" string))) (ecomplete-add-item 'mail (car (mail-header-parse-address string)) @@ -8889,7 +8889,7 @@ used to take the screenshot." (defun message-parse-mailto-url (url) "Parse a mailto: url." - (setq url (replace-regexp-in-string "\n" " " url)) + (setq url (string-replace "\n" " " url)) (when (string-match "mailto:/*\\(.*\\)" url) (setq url (substring url (match-beginning 1) nil))) (setq url (if (string-match "^\\?" url) @@ -8931,9 +8931,9 @@ will then start up Emacs ready to compose mail. For emacsclient use (dolist (arg args) (unless (equal (car arg) "body") (message-position-on-field (capitalize (car arg))) - (insert (replace-regexp-in-string + (insert (string-replace "\r\n" "\n" - (mapconcat #'identity (reverse (cdr arg)) ", ") nil t)))) + (mapconcat #'identity (reverse (cdr arg)) ", "))))) (when (assoc "body" args) (message-goto-body) (dolist (body (cdr (assoc "body" args))) diff --git a/lisp/gnus/mml-sec.el b/lisp/gnus/mml-sec.el index 15157e6fbc8..b49793509fc 100644 --- a/lisp/gnus/mml-sec.el +++ b/lisp/gnus/mml-sec.el @@ -1022,7 +1022,7 @@ Returns non-nil if the user has chosen to use SENDER." (if (eq 'OpenPGP protocol) (epg-sign-string context (buffer-string) mode) (epg-sign-string context - (replace-regexp-in-string + (string-replace "\n" "\r\n" (buffer-string)) t)) mml-secure-secret-key-id-list nil) diff --git a/lisp/gnus/mml-smime.el b/lisp/gnus/mml-smime.el index 5c133e680af..959de0902e2 100644 --- a/lisp/gnus/mml-smime.el +++ b/lisp/gnus/mml-smime.el @@ -404,7 +404,7 @@ Content-Disposition: attachment; filename=smime.p7m nil t))))) (mm-sec-error 'gnus-info "Corrupted") (throw 'error handle)) - (setq part (replace-regexp-in-string "\n" "\r\n" part) + (setq part (string-replace "\n" "\r\n" part) context (epg-make-context 'CMS)) (condition-case error ;; (setq plain diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el index 1af7d10d055..8c40fc79f00 100644 --- a/lisp/gnus/mml2015.el +++ b/lisp/gnus/mml2015.el @@ -863,7 +863,7 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." nil t)))) (mm-sec-error 'gnus-info "Corrupted") (throw 'error handle)) - (setq part (replace-regexp-in-string "\n" "\r\n" part) + (setq part (string-replace "\n" "\r\n" part) signature (mm-get-part signature) context (epg-make-context)) (condition-case error diff --git a/lisp/gnus/nnmaildir.el b/lisp/gnus/nnmaildir.el index 4867455393a..372df64e2e5 100644 --- a/lisp/gnus/nnmaildir.el +++ b/lisp/gnus/nnmaildir.el @@ -637,13 +637,11 @@ This variable is set by `nnmaildir-request-article'.") (funcall func (cdr entry))))))) (defun nnmaildir--system-name () - (replace-regexp-in-string + (string-replace ":" "\\072" - (replace-regexp-in-string + (string-replace "/" "\\057" - (replace-regexp-in-string "\\\\" "\\134" (system-name) nil 'literal) - nil 'literal) - nil 'literal)) + (string-replace "\\" "\\134" (system-name))))) (defun nnmaildir-request-type (_group &optional _article) 'mail) @@ -937,9 +935,9 @@ This variable is set by `nnmaildir-request-article'.") (setq pgname (nnmaildir--pgname nnmaildir--cur-server gname) ro (nnmaildir--param pgname 'read-only)) - (insert (replace-regexp-in-string + (insert (string-replace " " "\\ " - (nnmaildir--grp-name group) nil t) + (nnmaildir--grp-name group)) " ") (princ (nnmaildir--group-maxnum nnmaildir--cur-server group) nntp-server-buffer) @@ -968,7 +966,7 @@ This variable is set by `nnmaildir-request-article'.") (princ (nnmaildir--group-maxnum nnmaildir--cur-server group) nntp-server-buffer) (insert " " - (replace-regexp-in-string " " "\\ " gname nil t) + (string-replace " " "\\ " gname) "\n"))))) 'group) @@ -1098,7 +1096,7 @@ This variable is set by `nnmaildir-request-article'.") (insert " ") (princ (nnmaildir--group-maxnum nnmaildir--cur-server group) nntp-server-buffer) - (insert " " (replace-regexp-in-string " " "\\ " gname nil t) "\n") + (insert " " (string-replace " " "\\ " gname) "\n") t)))) (defun nnmaildir-request-create-group (gname &optional server _args) @@ -1262,7 +1260,7 @@ This variable is set by `nnmaildir-request-article'.") (insert "\t" (nnmaildir--nov-get-beg nov) "\t" (nnmaildir--art-msgid article) "\t" (nnmaildir--nov-get-mid nov) "\tXref: nnmaildir " - (replace-regexp-in-string " " "\\ " gname nil t) ":") + (string-replace " " "\\ " gname) ":") (princ num nntp-server-buffer) (insert "\t" (nnmaildir--nov-get-end nov) "\n")))) (catch 'return diff --git a/lisp/gnus/nnrss.el b/lisp/gnus/nnrss.el index a40fa88631f..8cd8cbe84f1 100644 --- a/lisp/gnus/nnrss.el +++ b/lisp/gnus/nnrss.el @@ -785,7 +785,7 @@ It is useful when `(setq nnrss-use-local t)'." (nnrss-node-just-text node) node)) (cleaned-text (if text - (replace-regexp-in-string + (string-replace "\r\n" "\n" (replace-regexp-in-string "^[\000-\037\177]+\\|^ +\\| +$" "" diff --git a/lisp/gnus/spam-report.el b/lisp/gnus/spam-report.el index a4234f84001..5fa280ea058 100644 --- a/lisp/gnus/spam-report.el +++ b/lisp/gnus/spam-report.el @@ -159,7 +159,7 @@ submitted at once. Internal variable.") rpt-host (concat "/" - (replace-regexp-in-string + (string-replace "/" ":" (replace-regexp-in-string "^.*article.gmane.org/" "" @@ -224,7 +224,7 @@ the function specified by `spam-report-url-ping-function'." (defcustom spam-report-user-mail-address (and (stringp user-mail-address) - (replace-regexp-in-string "@" "" user-mail-address)) + (string-replace "@" "" user-mail-address)) "Mail address of this user used for spam reports to Gmane. This is initialized based on `user-mail-address'." :type '(choice string diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 9088f31053b..6c0180590b9 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -1719,7 +1719,7 @@ If point is on a group name, this function operates on that group." (ibuffer-buffer-name-face buffer mark)))) (if (not (seq-position string ?\n)) string - (replace-regexp-in-string + (string-replace "\n" (propertize "^J" 'font-lock-face 'escape-glyph) string)))) (define-ibuffer-column size diff --git a/lisp/image-dired.el b/lisp/image-dired.el index 2509ecf8f82..74985b9e56d 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el @@ -704,7 +704,7 @@ Increase at own risk.") (thumb (cdr (assq ?t spec)))) (rename-file nq8 thumb t))) (message "command %S %s" (process-command process) - (replace-regexp-in-string "\n" "" status))))) + (string-replace "\n" "" status))))) process)) (defun image-dired-pngcrush-thumb (spec) @@ -726,7 +726,7 @@ Increase at own risk.") (unless (and (eq (process-status process) 'exit) (zerop (process-exit-status process))) (message "command %S %s" (process-command process) - (replace-regexp-in-string "\n" "" status))) + (string-replace "\n" "" status))) (when (memq (process-status process) '(exit signal)) (let ((temp (cdr (assq ?q spec)))) (delete-file temp))))) @@ -744,7 +744,7 @@ Increase at own risk.") (unless (and (eq (process-status process) 'exit) (zerop (process-exit-status process))) (message "command %S %s" (process-command process) - (replace-regexp-in-string "\n" "" status))))) + (string-replace "\n" "" status))))) process)) (defun image-dired-create-thumb-1 (original-file thumbnail-file) @@ -794,7 +794,7 @@ Increase at own risk.") (zerop (process-exit-status process)))) (message "Thumb could not be created for %s: %s" (abbreviate-file-name original-file) - (replace-regexp-in-string "\n" "" status)) + (string-replace "\n" "" status)) (set-file-modes thumbnail-file #o600) (clear-image-cache thumbnail-file) ;; PNG thumbnail has been created since we are diff --git a/lisp/info.el b/lisp/info.el index b65728ba41b..1c477a7082f 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -1732,14 +1732,14 @@ escaped (\\\",\\\\)." (concat " (" (if (stringp Info-current-file) - (replace-regexp-in-string + (string-replace "%" "%%" (file-name-sans-extension (file-name-nondirectory Info-current-file))) (format "*%S*" Info-current-file)) ") " (if Info-current-node - (propertize (replace-regexp-in-string + (propertize (string-replace "%" "%%" Info-current-node) 'face 'mode-line-buffer-id 'help-echo diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 55accf5beee..71e2653ffe9 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -2166,7 +2166,7 @@ See `set-language-info-alist' for use in programs." (let ((str (eval (get-language-info language-name 'sample-text)))) (if (stringp str) (insert "Sample text:\n " - (replace-regexp-in-string "\n" "\n " str) + (string-replace "\n" "\n " str) "\n\n"))) (error nil)) (let ((input-method (get-language-info language-name 'input-method)) diff --git a/lisp/mail/rfc2231.el b/lisp/mail/rfc2231.el index 6fb4502b23b..db34fd2cb9e 100644 --- a/lisp/mail/rfc2231.el +++ b/lisp/mail/rfc2231.el @@ -63,7 +63,7 @@ must never cause a Lisp error." (let (mod) (when (and (string-match "\\\\\"" string) (not (string-match "\\`\"\\|[^\\]\"" string))) - (setq string (replace-regexp-in-string "\\\\\"" "\"" string) + (setq string (string-replace "\\\"" "\"" string) mod t)) (when (and (string-match "\\\\(" string) (string-match "\\\\)" string) diff --git a/lisp/mail/rfc2368.el b/lisp/mail/rfc2368.el index 553f3cc3a54..b96f15d3e68 100644 --- a/lisp/mail/rfc2368.el +++ b/lisp/mail/rfc2368.el @@ -91,7 +91,7 @@ Note: make sure MAILTO-URL has been \"unhtmlized\" (e.g., & -> &), before calling this function." (let ((case-fold-search t) prequery query headers-alist) - (setq mailto-url (replace-regexp-in-string "\n" " " mailto-url)) + (setq mailto-url (string-replace "\n" " " mailto-url)) (if (string-match rfc2368-mailto-regexp mailto-url) (progn (setq prequery diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index e479a8e9b4a..8a38337773e 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -1960,7 +1960,7 @@ Value is the size of the newly read mail after conversion." (file-name-nondirectory (if (memq system-type '(windows-nt cygwin ms-dos)) ;; cannot have colons in file name - (replace-regexp-in-string ":" "-" file) + (string-replace ":" "-" file) file))) ;; Use the directory of this rmail file ;; because it's a nuisance to use the homedir @@ -3374,7 +3374,7 @@ The idea is to match it against simplified subjects of other messages." ;; Hide commas so it will work ok if parsed as a comma-separated list ;; of regexps. (setq subject - (replace-regexp-in-string "," "\054" subject t t)) + (string-replace "," "\054" subject)) (concat "\\`" subject "\\'"))) (defun rmail-next-same-subject (n) diff --git a/lisp/mail/rmailout.el b/lisp/mail/rmailout.el index eb8590f1f73..4c23686909c 100644 --- a/lisp/mail/rmailout.el +++ b/lisp/mail/rmailout.el @@ -678,9 +678,9 @@ than appending to it. Deletes the message after writing if (or (mail-fetch-field "Subject") rmail-default-body-file))) (setq default-file - (replace-regexp-in-string ":" "-" default-file)) + (string-replace ":" "-" default-file)) (setq default-file - (replace-regexp-in-string " " "-" default-file)) + (string-replace " " "-" default-file)) (list (setq rmail-default-body-file (read-file-name "Output message body to file: " diff --git a/lisp/mail/undigest.el b/lisp/mail/undigest.el index bf57ed6fa6f..0760a477296 100644 --- a/lisp/mail/undigest.el +++ b/lisp/mail/undigest.el @@ -125,7 +125,7 @@ See rmail-digest-methods." ;; Undo masking of separators inside digestified messages (goto-char (point-min)) (while (search-forward - (replace-regexp-in-string "\n-" "\n " separator) nil t) + (string-replace "\n-" "\n " separator) nil t) (replace-match separator)) ;; Return the list of marker pairs (nreverse result)))))) diff --git a/lisp/man.el b/lisp/man.el index 9b941a2b3d2..54b6ffe9836 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -802,7 +802,7 @@ POS defaults to `point'." ;; added by troff, and remove it. (or (not (eq (string-to-char (substring 1st-part -1)) ?-)) (string-match-p "-" (substring 1st-part 0 -1)) - (setq word (replace-regexp-in-string "-" "" word)))) + (setq word (string-replace "-" "" word)))) ;; Make sure the section number gets included by the code below. (goto-char (match-end 1))) (when (string-match "[-._‐]+$" word) diff --git a/lisp/mouse.el b/lisp/mouse.el index 89e5d7c48a3..cf7c17be28f 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -180,7 +180,7 @@ items `Turn Off' and `Help'." `(keymap ,(format "%s - %s" indicator (capitalize - (replace-regexp-in-string + (string-replace "-" " " (format "%S" minor-mode)))) (turn-off menu-item "Turn off minor mode" ,mm-fun) (help menu-item "Help for minor mode" diff --git a/lisp/mpc.el b/lisp/mpc.el index ab572aa539a..e04ffa49747 100644 --- a/lisp/mpc.el +++ b/lisp/mpc.el @@ -214,8 +214,8 @@ defaults to 6600 and HOST defaults to localhost." (with-current-buffer "*MPC-debug*" (goto-char (point-max)) (insert-before-markers ;So it scrolls. - (replace-regexp-in-string "\n" "\n " - (apply #'format-message format args)) + (string-replace "\n" "\n " + (apply #'format-message format args)) "\n")))) (defun mpc--proc-filter (proc string) diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 6d64100be17..f739cd72cc3 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -1644,7 +1644,7 @@ used instead of `browse-url-new-window-flag'." (insert "\n")) (goto-char (prog1 (point) - (insert (replace-regexp-in-string "\r\n" "\n" body)) + (insert (string-replace "\r\n" "\n" body)) (unless (bolp) (insert "\n")))))))) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index eec3ec7ba8b..2a81d2e0c8c 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -779,7 +779,7 @@ Currently this means either text/html or application/xhtml+xml." (propertize "...: " 'face 'variable-pitch)))) (propertize "..." 'face 'variable-pitch))))))) - (replace-regexp-in-string + (string-replace "%" "%%" (format-spec eww-header-line-format diff --git a/lisp/net/newst-backend.el b/lisp/net/newst-backend.el index e623dab26df..dc541943587 100644 --- a/lisp/net/newst-backend.el +++ b/lisp/net/newst-backend.el @@ -610,7 +610,7 @@ This does NOT start the retrieval timers." (interactive) (let ((filename (read-string "Filename: " (concat feed ":_" - (replace-regexp-in-string + (string-replace " " "_" (newsticker--title item)) ".html")))) (with-temp-buffer diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index f11f36e8096..e7aec505b0b 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -800,7 +800,7 @@ When 0, do not auto-reconnect." (defun rcirc-sentinel (process sentinel) "Called when PROCESS receives SENTINEL." - (let ((sentinel (replace-regexp-in-string "\n" "" sentinel))) + (let ((sentinel (string-replace "\n" "" sentinel))) (rcirc-debug process (format "SENTINEL: %S %S\n" process sentinel)) (with-rcirc-process-buffer process (dolist (buffer (cons nil (mapcar 'cdr rcirc-buffer-alist))) diff --git a/lisp/net/soap-client.el b/lisp/net/soap-client.el index 821ef4af8e0..f5480afb698 100644 --- a/lisp/net/soap-client.el +++ b/lisp/net/soap-client.el @@ -659,7 +659,7 @@ representing leap seconds." (if second (if second-fraction (let* ((second-fraction-significand - (replace-regexp-in-string "\\." "" second-fraction)) + (string-replace "." "" second-fraction)) (hertz (expt 10 (length second-fraction-significand))) (ticks (+ (* hertz (string-to-number second)) diff --git a/lisp/nxml/rng-cmpct.el b/lisp/nxml/rng-cmpct.el index 1314ade9e31..d820d1b99b5 100644 --- a/lisp/nxml/rng-cmpct.el +++ b/lisp/nxml/rng-cmpct.el @@ -100,7 +100,7 @@ Return a pattern." "Regular expression to match a single-quoted literal.") (defconst rng-c-literal-2-re - (replace-regexp-in-string "'" "\"" rng-c-literal-1-re) + (string-replace "'" "\"" rng-c-literal-1-re) "Regular expression to match a double-quoted literal.") (defconst rng-c-ncname-re "\\w+") diff --git a/lisp/nxml/xmltok.el b/lisp/nxml/xmltok.el index 9824eebbd8b..38bc2e141e6 100644 --- a/lisp/nxml/xmltok.el +++ b/lisp/nxml/xmltok.el @@ -479,7 +479,7 @@ and VALUE-END, otherwise a STRING giving the value." "[^<'&\r\n\t]*" (xmltok-g complex1 "[&\r\n\t][^<']*") opt "'")) - (lit2 (cons (replace-regexp-in-string "'" "\"" (car lit1)) + (lit2 (cons (string-replace "'" "\"" (car lit1)) '(complex2))) (literal (xmltok-g literal lit1 or lit2)) (name (xmltok+ open (xmltok-g xmlns "xmlns") or ncname close diff --git a/lisp/obsolete/nnir.el b/lisp/obsolete/nnir.el index 40a8ec57b98..caeca988810 100644 --- a/lisp/obsolete/nnir.el +++ b/lisp/obsolete/nnir.el @@ -920,10 +920,10 @@ Tested with swish-e-2.0.1 on Windows NT 4.0." ;; eliminate all ".", "/", "\" from beginning. Always matches. (string-match "^[./\\]*\\(.*\\)$" dirnam) ;; "/" -> "." - (setq group (replace-regexp-in-string + (setq group (string-replace "/" "." (match-string 1 dirnam))) ;; Windows "\\" -> "." - (setq group (replace-regexp-in-string "\\\\" "." group)) + (setq group (string-replace "\\" "." group)) (push (vector (gnus-group-full-name group server) (string-to-number artno) @@ -996,7 +996,7 @@ Tested with swish-e-2.0.1 on Windows NT 4.0." (when (string-match prefix dirnam) (setq dirnam (replace-match "" t t dirnam))) (push (vector (gnus-group-full-name - (replace-regexp-in-string "/" "." dirnam) server) + (string-replace "/" "." dirnam) server) (string-to-number artno) (string-to-number score)) artlist)) @@ -1205,9 +1205,9 @@ construct path: search terms (see the variable group (if (file-directory-p (setq group - (replace-regexp-in-string - "\\." "/" - group nil t))) + (string-replace + "." "/" + group))) group)))))) (unless group (error "Cannot locate directory for group")) diff --git a/lisp/play/dunnet.el b/lisp/play/dunnet.el index c3be029a658..3bb8bf0c82b 100644 --- a/lisp/play/dunnet.el +++ b/lisp/play/dunnet.el @@ -2373,7 +2373,7 @@ Also prints current score to let user know he has scored." (dun-mprincl "Incorrect."))) (let (varname epoint afterq i value) - (setq varname (replace-regexp-in-string " " "" (substring line 0 esign))) + (setq varname (string-replace " " "" (substring line 0 esign))) (if (or (= (length varname) 0) (< (- (length line) esign) 2)) (progn diff --git a/lisp/play/handwrite.el b/lisp/play/handwrite.el index cc058230751..2aec408e11b 100644 --- a/lisp/play/handwrite.el +++ b/lisp/play/handwrite.el @@ -200,7 +200,7 @@ Variables: `handwrite-linespace' (default 12) (concat "\\\\" (cdr trans)) line))) (switch-to-buffer ps-buf-name) - (insert (replace-regexp-in-string "\n" "" line)) + (insert (string-replace "\n" "" line)) (message "write write write...") (setq ps-ypos (+ ps-ypos handwrite-linespace)) (end-of-line) diff --git a/lisp/proced.el b/lisp/proced.el index d1a243df8e0..2fafdcc58e5 100644 --- a/lisp/proced.el +++ b/lisp/proced.el @@ -1389,7 +1389,7 @@ The return string is always 6 characters wide." (defun proced-format-args (args) "Format attribute ARGS. Replace newline characters by \"^J\" (two characters)." - (replace-regexp-in-string "\n" "^J" args)) + (string-replace "\n" "^J" args)) (defun proced-format (process-alist format) "Display PROCESS-ALIST using FORMAT." diff --git a/lisp/profiler.el b/lisp/profiler.el index 8145e51d75d..4c427692cb8 100644 --- a/lisp/profiler.el +++ b/lisp/profiler.el @@ -499,7 +499,7 @@ RET: expand or collapse")) (defun profiler-report-header-line-format (fmt &rest args) (let* ((header (apply #'profiler-format fmt args)) - (escaped (replace-regexp-in-string "%" "%%" header))) + (escaped (string-replace "%" "%%" header))) (concat (propertize " " 'display '(space :align-to 0) diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index b9c8305bed0..97596d0d278 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -1963,7 +1963,7 @@ commands to be prefixed by \"-interpreter-exec console\".") The string is enclosed in double quotes. All embedded quotes, newlines, and backslashes are preceded with a backslash." (setq string (replace-regexp-in-string "\\([\"\\]\\)" "\\\\\\&" string)) - (setq string (replace-regexp-in-string "\n" "\\n" string t t)) + (setq string (string-replace "\n" "\\n" string)) (concat "\"" string "\"")) (defun gdb-input (command handler-function &optional trigger-name) diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el index 4d277755aeb..df17b87c013 100644 --- a/lisp/progmodes/make-mode.el +++ b/lisp/progmodes/make-mode.el @@ -257,7 +257,7 @@ not be enclosed in { } or ( )." "Regex used to highlight makepp rule action lines in font lock mode.") (defconst makefile-bsdmake-rule-action-regex - (replace-regexp-in-string "-@" "-+@" makefile-rule-action-regex) + (string-replace "-@" "-+@" makefile-rule-action-regex) "Regex used to highlight BSD rule action lines in font lock mode.") ;; Note that the first and second subexpression is used by font lock. Note @@ -358,11 +358,10 @@ not be enclosed in { } or ( )." ,@(if keywords ;; Fontify conditionals and includes. `((,(concat "^\\(?: [ \t]*\\)?" - (replace-regexp-in-string + (string-replace " " "[ \t]+" (if (eq (car keywords) t) - (replace-regexp-in-string "-" "[_-]" - (regexp-opt (cdr keywords) t)) + (string-replace "-" "[_-]" (regexp-opt (cdr keywords) t)) (regexp-opt keywords t))) "\\>[ \t]*\\([^: \t\n#]*\\)") (1 font-lock-keyword-face) (2 font-lock-variable-name-face)))) diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el index 0b520e39074..2e23c2e2cab 100644 --- a/lisp/progmodes/prolog.el +++ b/lisp/progmodes/prolog.el @@ -2277,7 +2277,7 @@ between them)." ;(goto-char beg) (if (search-forward-regexp "^[ \t]*\\(%+\\|\\*+\\|/\\*+\\)[ \t]*" end t) - (replace-regexp-in-string "/" " " (buffer-substring beg (point))) + (string-replace "/" " " (buffer-substring beg (point))) (beginning-of-line) (when (search-forward-regexp "^[ \t]+" end t) (buffer-substring beg (point))))))))) diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 01fb044161b..74b48ca4bde 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -1788,8 +1788,8 @@ If the result is do-end block, it will always be multiline." (buffer-substring-no-properties (1+ min) (1- max)))) (setq content (if (equal string-quote "'") - (replace-regexp-in-string "\\\\\"" "\"" (replace-regexp-in-string "\\(\\`\\|[^\\]\\)'" "\\1\\\\'" content)) - (replace-regexp-in-string "\\\\'" "'" (replace-regexp-in-string "\\(\\`\\|[^\\]\\)\"" "\\1\\\\\"" content)))) + (string-replace "\\\"" "\"" (replace-regexp-in-string "\\(\\`\\|[^\\]\\)'" "\\1\\\\'" content)) + (string-replace "\\'" "'" (replace-regexp-in-string "\\(\\`\\|[^\\]\\)\"" "\\1\\\\\"" content)))) (let ((orig-point (point))) (delete-region min max) (insert diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index f144549cf6d..b9012166a52 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -3843,7 +3843,7 @@ to avoid deleting non-prompt output." (defun sql-remove-tabs-filter (str) "Replace tab characters with spaces." - (replace-regexp-in-string "\t" " " str nil t)) + (string-replace "\t" " " str)) (defun sql-toggle-pop-to-buffer-after-send-region (&optional value) "Toggle `sql-pop-to-buffer-after-send-region'. @@ -3864,7 +3864,7 @@ If given the optional parameter VALUE, sets "If non-nil, display messages related to the use of redirection.") (defun sql-str-literal (s) - (concat "'" (replace-regexp-in-string "[']" "''" s) "'")) + (concat "'" (string-replace "[']" "''" s) "'")) (defun sql-redirect (sqlbuf command &optional outbuf save-prior) "Execute the SQL command and send output to OUTBUF. diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el index 02a8d72758c..eb170baa5d8 100644 --- a/lisp/progmodes/which-func.el +++ b/lisp/progmodes/which-func.el @@ -175,7 +175,7 @@ and you want to simplify them for the mode line (defvar which-func-table (make-hash-table :test 'eq :weakness 'key)) (defconst which-func-current - '(:eval (replace-regexp-in-string + '(:eval (string-replace "%" "%%" (or (gethash (selected-window) which-func-table) which-func-unknown)))) diff --git a/lisp/replace.el b/lisp/replace.el index ee46286a75f..c67877efd5d 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -213,7 +213,7 @@ wants to replace FROM with TO." (when query-replace-from-to-separator ;; Check if the first non-whitespace char is displayable (if (char-displayable-p - (string-to-char (replace-regexp-in-string + (string-to-char (string-replace " " "" query-replace-from-to-separator))) query-replace-from-to-separator " -> "))) @@ -2101,7 +2101,7 @@ See also `multi-occur'." ;; Add non-numeric prefix to all non-first lines ;; of multi-line matches. (concat - (replace-regexp-in-string + (string-replace "\n" (if prefix-face (propertize @@ -2506,12 +2506,10 @@ a string, it is first passed through `prin1-to-string' with the `noescape' argument set. `match-data' is preserved across the call." - (save-match-data - (replace-regexp-in-string "\\\\" "\\\\" - (if (stringp replacement) - replacement - (prin1-to-string replacement t)) - t t))) + (string-replace "\\" "\\\\" + (if (stringp replacement) + replacement + (prin1-to-string replacement t)))) (defun replace-loop-through-replacements (data count) ;; DATA is a vector containing the following values: diff --git a/lisp/select.el b/lisp/select.el index eaa74cebd80..15e171c13f9 100644 --- a/lisp/select.el +++ b/lisp/select.el @@ -496,7 +496,7 @@ two markers or an overlay. Otherwise, it is nil." (error "Unknown selection type: %S" type))))) ;; Most programs are unable to handle NUL bytes in strings. - (setq str (replace-regexp-in-string "\0" "\\0" str t t)) + (setq str (string-replace "\0" "\\0" str)) (setq next-selection-coding-system nil) (cons type str)))) diff --git a/lisp/ses.el b/lisp/ses.el index ca515f829dc..81c27144a54 100644 --- a/lisp/ses.el +++ b/lisp/ses.el @@ -3357,7 +3357,7 @@ is non-nil. Newlines and tabs in the export text are escaped." (push "'" result) (setq item (cadr item))) (setq item (ses-prin1 item)) - (setq item (replace-regexp-in-string "\t" "\\\\t" item)) + (setq item (string-replace "\t" "\\t" item)) (push item result) (cond ((< col maxcol) diff --git a/lisp/subr.el b/lisp/subr.el index b8286600664..87298b5cfde 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3681,7 +3681,7 @@ See Info node `(elisp)Security Considerations'." "''" ;; Quote everything except POSIX filename characters. ;; This should be safe enough even for really weird shells. - (replace-regexp-in-string + (string-replace "\n" "'\n'" (replace-regexp-in-string "[^-0-9a-zA-Z_./\n]" "\\\\\\&" argument)))) )) diff --git a/lisp/term/pc-win.el b/lisp/term/pc-win.el index 8cff2ceaeec..9e7b360b9c6 100644 --- a/lisp/term/pc-win.el +++ b/lisp/term/pc-win.el @@ -290,7 +290,7 @@ This is used by `msdos-show-help'.") (not cursor-in-echo-area)) ;Don't overwrite a prompt. (cond ((stringp help) - (setq help (replace-regexp-in-string "\n" ", " help)) + (setq help (string-replace "\n" ", " help)) (unless (or msdos-previous-message (string-equal help (current-message)) (and (stringp msdos-last-help-message) diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el index 6b849164aec..80afcb36040 100644 --- a/lisp/term/w32-win.el +++ b/lisp/term/w32-win.el @@ -410,7 +410,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") ;;; Fix interface to (X-specific) mouse.el (defun w32--set-selection (type value) (if (eq type 'CLIPBOARD) - (w32-set-clipboard-data (replace-regexp-in-string "\0" "\\0" value t t)) + (w32-set-clipboard-data (string-replace "\0" "\\0" value)) (put 'x-selections (or type 'PRIMARY) value))) (defun w32--get-selection (&optional type data-type) diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index 8bcae37afe4..868b33ea9c5 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -1015,10 +1015,9 @@ hitting screen's max DCS length." 'terminal-init-screen)) (bytes (encode-coding-string data 'utf-8-unix)) (base-64 (if screen - (replace-regexp-in-string + (string-replace "\n" "\e\\\eP" - (base64-encode-string bytes) - :fixedcase :literal) + (base64-encode-string bytes)) (base64-encode-string bytes :no-line-break))) (length (length base-64))) (if (> length xterm-max-cut-length) diff --git a/lisp/textmodes/picture.el b/lisp/textmodes/picture.el index 1368af01bac..1d5d1caeabc 100644 --- a/lisp/textmodes/picture.el +++ b/lisp/textmodes/picture.el @@ -449,8 +449,8 @@ If no such character is found, move to beginning of line." (progn (beginning-of-line) (skip-chars-backward - (concat "^" (replace-regexp-in-string - "\\\\" "\\\\" picture-tab-chars nil t)) + (concat "^" (string-replace + "\\" "\\\\" picture-tab-chars)) (point-min)) (not (bobp)))) (move-to-column target)) diff --git a/lisp/thumbs.el b/lisp/thumbs.el index 5710b8c353b..4c863883ba4 100644 --- a/lisp/thumbs.el +++ b/lisp/thumbs.el @@ -434,10 +434,10 @@ Open another window." (defun thumbs-call-setroot-command (img) "Call the setroot program for IMG." (run-hooks 'thumbs-before-setroot-hook) - (shell-command (replace-regexp-in-string - "\\*" + (shell-command (string-replace + "*" (shell-quote-argument (expand-file-name img)) - thumbs-setroot-command nil t)) + thumbs-setroot-command)) (run-hooks 'thumbs-after-setroot-hook)) (defun thumbs-set-image-at-point-to-root-window () diff --git a/lisp/tooltip.el b/lisp/tooltip.el index 03d9f54ea6c..23b67ee2cab 100644 --- a/lisp/tooltip.el +++ b/lisp/tooltip.el @@ -346,7 +346,7 @@ It is also called if Tooltip mode is on, for text-only displays." (not cursor-in-echo-area)) ;Don't overwrite a prompt. (cond ((stringp help) - (setq help (replace-regexp-in-string "\n" ", " help)) + (setq help (string-replace "\n" ", " help)) (unless (or tooltip-previous-message (equal-including-properties help (current-message)) (and (stringp tooltip-help-message) diff --git a/lisp/transient.el b/lisp/transient.el index 5f66a13094b..4087a0c68a6 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -3064,18 +3064,18 @@ Optional support for popup buttons is also implemented here." ((equal (seq-take seq len) transient--redisplay-key) (let ((pre (key-description (vconcat (seq-take seq len)))) (suf (key-description (vconcat (seq-drop seq len))))) - (setq pre (replace-regexp-in-string "RET" "C-m" pre t)) - (setq pre (replace-regexp-in-string "TAB" "C-i" pre t)) - (setq suf (replace-regexp-in-string "RET" "C-m" suf t)) - (setq suf (replace-regexp-in-string "TAB" "C-i" suf t)) + (setq pre (string-replace "RET" "C-m" pre)) + (setq pre (string-replace "TAB" "C-i" pre)) + (setq suf (string-replace "RET" "C-m" suf)) + (setq suf (string-replace "TAB" "C-i" suf)) ;; We use e.g. "-k" instead of the more correct "- k", ;; because the former is prettier. If we did that in ;; the definition, then we want to drop the space that ;; is reinserted above. False-positives are possible ;; for silly bindings like "-C-c C-c". (unless (string-match-p " " key) - (setq pre (replace-regexp-in-string " " "" pre)) - (setq suf (replace-regexp-in-string " " "" suf))) + (setq pre (string-replace " " "" pre)) + (setq suf (string-replace " " "" suf))) (concat (propertize pre 'face 'default) (and (string-prefix-p (concat pre " ") key) " ") (transient--colorize-key suf cmd) diff --git a/lisp/url/url-mailto.el b/lisp/url/url-mailto.el index 29c2780121a..4fd631d2955 100644 --- a/lisp/url/url-mailto.el +++ b/lisp/url/url-mailto.el @@ -105,7 +105,7 @@ (goto-char (point-max))) (insert (mapconcat (lambda (string) - (replace-regexp-in-string "\r\n" "\n" string)) + (string-replace "\r\n" "\n" string)) (cdar args) "\n"))) (url-mail-goto-field (caar args)) ;; (setq func (intern-soft (concat "mail-" (caar args)))) diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el index 4a44787bb03..46e9c97eb0a 100644 --- a/lisp/vc/log-edit.el +++ b/lisp/vc/log-edit.el @@ -974,8 +974,8 @@ Return non-nil if it is." (not (looking-at (format ".+ .+ <%s>" (regexp-quote mail)))) (looking-at ".+ \\(.+ <.+>\\) *\\((tiny change)\\)?")) - (let ((author (replace-regexp-in-string " " " " - (match-string 1)))) + (let ((author (string-replace " " " " + (match-string 1)))) (unless (and log-edit-author (string-match (regexp-quote author) (car log-edit-author))) diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el index de5a90dc602..5144b5d0bbb 100644 --- a/lisp/vc/vc-bzr.el +++ b/lisp/vc/vc-bzr.el @@ -467,7 +467,7 @@ in the branch repository (or whose status not be determined)." ;; Erase the status text that matched. (delete-region (match-beginning 0) (match-end 0)) (setq status - (intern (replace-regexp-in-string " " "" statusword))))) + (intern (string-replace " " "" statusword))))) (when status (goto-char (point-min)) (skip-chars-forward " \n\t") ;Throw away spaces. diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index c9c1e91d483..4a64caa36b8 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -851,8 +851,8 @@ if we don't understand a construct, we signal (push "\\[" parts)) (t (let ((x (substring glob i j))) - (setf x (replace-regexp-in-string - "\\\\" "\\\\" x t t)) + (setf x (string-replace + "\\" "\\\\" x)) (setf i (1+ j)) (cond ((eq (aref x 0) ?!) (setf (aref x 0) ?^)) diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el index c30920dd157..544a6c769fc 100644 --- a/lisp/vc/vc-svn.el +++ b/lisp/vc/vc-svn.el @@ -192,7 +192,7 @@ switches." (let ((state (cdr (assq (aref (match-string 1) 0) state-map))) (propstat (cdr (assq (aref (match-string 2) 0) state-map))) (filename (if (memq system-type '(windows-nt ms-dos)) - (replace-regexp-in-string "\\\\" "/" (match-string 4)) + (string-replace "\\" "/" (match-string 4)) (match-string 4)))) (and (memq propstat '(conflict edited)) (not (eq state 'conflict)) ; conflict always wins diff --git a/lisp/xdg.el b/lisp/xdg.el index 0bdfd114c48..e5165bbd86a 100644 --- a/lisp/xdg.el +++ b/lisp/xdg.el @@ -208,8 +208,8 @@ Optional argument GROUP defaults to the string \"Desktop Entry\"." "Partition VALUE into elements delimited by unescaped semicolons." (let (res) (setq value (string-trim-left value)) - (dolist (x (split-string (replace-regexp-in-string "\\\\;" "\0" value) ";")) - (push (replace-regexp-in-string "\0" ";" x) res)) + (dolist (x (split-string (string-replace "\\;" "\0" value) ";")) + (push (string-replace "\0" ";" x) res)) (when (null (string-match-p "[^[:blank:]]" (car res))) (pop res)) (nreverse res))) diff --git a/test/lisp/electric-tests.el b/test/lisp/electric-tests.el index 235c02f8e8b..ea856ab311c 100644 --- a/test/lisp/electric-tests.el +++ b/test/lisp/electric-tests.el @@ -146,7 +146,7 @@ The buffer's contents should %s: "") char (if (string= fixture expected-string) "stay" "become") - (replace-regexp-in-string "\n" "\\\\n" expected-string) + (string-replace "\n" "\\n" expected-string) expected-point))) `(ert-deftest ,(intern (format "electric-pair-%s-at-point-%s-in-%s%s" name diff --git a/test/lisp/term-tests.el b/test/lisp/term-tests.el index 503cb5d7aab..50ac370b5b5 100644 --- a/test/lisp/term-tests.el +++ b/test/lisp/term-tests.el @@ -56,7 +56,7 @@ first line\r next line\r\n")) (should (equal (term-test-screen-from-input 40 12 str) - (replace-regexp-in-string "\r" "" str))))) + (string-replace "\r" "" str))))) (ert-deftest term-carriage-return () (skip-unless (not (memq system-type '(windows-nt ms-dos)))) diff --git a/test/lisp/time-stamp-tests.el b/test/lisp/time-stamp-tests.el index 0d64320496d..4e6fbbba923 100644 --- a/test/lisp/time-stamp-tests.el +++ b/test/lisp/time-stamp-tests.el @@ -849,7 +849,7 @@ The functions in `pattern-mod' are composed left to right." (defun formatz-mod-del-colons (string) "Returns STRING with any colons removed." - (replace-regexp-in-string ":" "" string)) + (string-replace ":" "" string)) (defun formatz-mod-add-00 (string) "Returns STRING with \"00\" appended." diff --git a/test/lisp/wdired-tests.el b/test/lisp/wdired-tests.el index ba276e24d96..96a01fc2c7b 100644 --- a/test/lisp/wdired-tests.el +++ b/test/lisp/wdired-tests.el @@ -31,7 +31,7 @@ Partially modifying a file name should succeed." (let* ((test-dir (make-temp-file "test-dir-" t)) (test-file (concat (file-name-as-directory test-dir) "foo.c")) (replace "bar") - (new-file (replace-regexp-in-string "foo" replace test-file)) + (new-file (string-replace "foo" replace test-file)) (wdired-use-interactive-rename t)) (write-region "" nil test-file nil 'silent) (advice-add 'dired-query ; Don't ask confirmation to overwrite a file. @@ -109,7 +109,7 @@ wdired-mode." (let* ((test-dir (make-temp-file "test-dir-" t)) (test-file (concat (file-name-as-directory test-dir) "foo.c")) (replace "bar") - (new-file (replace-regexp-in-string "foo" replace test-file))) + (new-file (string-replace "foo" replace test-file))) (write-region "" nil test-file nil 'silent) (let ((buf (find-file-noselect test-dir))) (unwind-protect diff --git a/test/src/json-tests.el b/test/src/json-tests.el index 908945fcb08..8dc0a744aa0 100644 --- a/test/src/json-tests.el +++ b/test/src/json-tests.el @@ -252,7 +252,7 @@ Test with both unibyte and multibyte strings." (let* ((input "{ \"abc\" : [9, false] , \"def\" : null }") (output - (replace-regexp-in-string " " "" input))) + (string-replace " " "" input))) (should (equal (json-parse-string input :object-type 'plist :null-object :json-null -- cgit v1.2.3