From fff138eb3d88e6933a0456a49d38f2850e048f53 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 16 Feb 2021 14:21:52 +0100 Subject: Do interactive mode tagging for info.el --- lisp/info.el | 79 ++++++++++++++++++++++++++++++++---------------------------- 1 file changed, 42 insertions(+), 37 deletions(-) (limited to 'lisp/info.el') diff --git a/lisp/info.el b/lisp/info.el index 7f169f4b556..e7324efa2f9 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -1972,7 +1972,8 @@ If DIRECTION is `backward', search in the reverse direction." (format-prompt "Regexp search%s" (car Info-search-history) (if case-fold-search "" " case-sensitively")) - nil 'Info-search-history))) + nil 'Info-search-history)) + Info-mode) (when (equal regexp "") (setq regexp (car Info-search-history))) (when regexp @@ -2080,13 +2081,13 @@ If DIRECTION is `backward', search in the reverse direction." (defun Info-search-case-sensitively () "Search for a regexp case-sensitively." - (interactive) + (interactive nil Info-mode) (let ((case-fold-search nil)) (call-interactively 'Info-search))) (defun Info-search-next () "Search for next regexp from a previous `Info-search' command." - (interactive) + (interactive nil Info-mode) (let ((case-fold-search Info-search-case-fold)) (if Info-search-history (Info-search (car Info-search-history)) @@ -2098,7 +2099,8 @@ If DIRECTION is `backward', search in the reverse direction." (format-prompt "Regexp search%s backward" (car Info-search-history) (if case-fold-search "" " case-sensitively")) - nil 'Info-search-history))) + nil 'Info-search-history)) + Info-mode) (Info-search regexp bound noerror count 'backward)) (defun Info-isearch-search () @@ -2235,7 +2237,7 @@ End of submatch 0, 1, and 3 are the same, so you can safely concat." (defun Info-next () "Go to the \"next\" node, staying on the same hierarchical level. This command doesn't descend into sub-nodes, like \\\\[Info-forward-node] does." - (interactive) + (interactive nil Info-mode) ;; In case another window is currently selected (save-window-excursion (or (derived-mode-p 'Info-mode) (switch-to-buffer "*info*")) @@ -2244,7 +2246,7 @@ This command doesn't descend into sub-nodes, like \\\\[Info-forwa (defun Info-prev () "Go to the \"previous\" node, staying on the same hierarchical level. This command doesn't go up to the parent node, like \\\\[Info-backward-node] does." - (interactive) + (interactive nil Info-mode) ;; In case another window is currently selected (save-window-excursion (or (derived-mode-p 'Info-mode) (switch-to-buffer "*info*")) @@ -2253,7 +2255,7 @@ This command doesn't go up to the parent node, like \\\\[Info-bac (defun Info-up (&optional same-file) "Go to the superior node of this node. If SAME-FILE is non-nil, do not move to a different Info file." - (interactive) + (interactive nil Info-mode) ;; In case another window is currently selected (save-window-excursion (or (derived-mode-p 'Info-mode) (switch-to-buffer "*info*")) @@ -2284,7 +2286,7 @@ If SAME-FILE is non-nil, do not move to a different Info file." (defun Info-history-back () "Go back in the history to the last node visited." - (interactive) + (interactive nil Info-mode) (or Info-history (user-error "This is the first Info node you looked at")) (let ((history-forward @@ -2304,7 +2306,7 @@ If SAME-FILE is non-nil, do not move to a different Info file." (defun Info-history-forward () "Go forward in the history of visited nodes." - (interactive) + (interactive nil Info-mode) (or Info-history-forward (user-error "This is the last Info node you looked at")) (let ((history-forward (cdr Info-history-forward)) @@ -2378,7 +2380,7 @@ If SAME-FILE is non-nil, do not move to a different Info file." (defun Info-history () "Go to a node with a menu of visited nodes." - (interactive) + (interactive nil Info-mode) (Info-find-node "*History*" "Top") (Info-next-reference) (Info-next-reference)) @@ -2415,7 +2417,7 @@ If SAME-FILE is non-nil, do not move to a different Info file." (defun Info-toc () "Go to a node with table of contents of the current Info file. Table of contents is created from the tree structure of menus." - (interactive) + (interactive nil Info-mode) (Info-find-node Info-current-file "*TOC*") (let ((prev-node (nth 1 (car Info-history))) p) (goto-char (point-min)) @@ -2587,7 +2589,8 @@ new buffer." (list (if (equal input "") default input) current-prefix-arg)) - (user-error "No cross-references in this node")))) + (user-error "No cross-references in this node"))) + Info-mode) (unless footnotename (error "No reference was specified")) @@ -2789,7 +2792,8 @@ new buffer." (completing-read (format-prompt "Menu item" default) #'Info-complete-menu-item nil t nil nil default)))) - (list item current-prefix-arg)))) + (list item current-prefix-arg))) + Info-mode) ;; there is a problem here in that if several menu items have the same ;; name you can only go to the node of the first with this command. (Info-goto-node (Info-extract-menu-item menu-item) @@ -2833,19 +2837,19 @@ new buffer." (defun Info-nth-menu-item () "Go to the node of the Nth menu item. N is the digit argument used to invoke this command." - (interactive) + (interactive nil Info-mode) (Info-goto-node (Info-extract-menu-counting (- (aref (this-command-keys) (1- (length (this-command-keys)))) ?0)))) (defun Info-top-node () "Go to the Top node of this file." - (interactive) + (interactive nil Info-mode) (Info-goto-node "Top")) (defun Info-final-node () "Go to the final node in this file." - (interactive) + (interactive nil Info-mode) (Info-goto-node "Top") (let ((Info-history nil) (case-fold-search t)) @@ -2869,7 +2873,7 @@ to the parent node. When called from Lisp, NOT-DOWN non-nil means don't descend into sub-nodes, NOT-UP non-nil means don't go to parent nodes, and NO-ERROR non-nil means don't signal a user-error if there's no node to go to." - (interactive) + (interactive nil Info-mode) (goto-char (point-min)) (forward-line 1) (let ((case-fold-search t)) @@ -2906,7 +2910,7 @@ don't signal a user-error if there's no node to go to." "Go backward one node, considering all nodes as forming one sequence. If the current node has a \"previous\" node, go to it, descending into its last sub-node, if any; otherwise go \"up\" to the parent node." - (interactive) + (interactive nil Info-mode) (let ((prevnode (Info-extract-pointer "prev[ious]*" t)) (upnode (Info-extract-pointer "up" t)) (case-fold-search t)) @@ -2935,7 +2939,7 @@ last sub-node, if any; otherwise go \"up\" to the parent node." (defun Info-next-menu-item () "Go to the node of the next menu item." - (interactive) + (interactive nil Info-mode) ;; Bind this in case the user sets it to nil. (let* ((case-fold-search t) (node @@ -2949,7 +2953,7 @@ last sub-node, if any; otherwise go \"up\" to the parent node." (defun Info-last-menu-item () "Go to the node of the previous menu item." - (interactive) + (interactive nil Info-mode) (save-excursion (forward-line 1) ;; Bind this in case the user sets it to nil. @@ -2968,7 +2972,7 @@ last sub-node, if any; otherwise go \"up\" to the parent node." (defun Info-next-preorder () "Go to the next subnode or the next node, or go up a level." - (interactive) + (interactive nil Info-mode) (cond ((Info-no-error (Info-next-menu-item))) ((Info-no-error (Info-next))) ((Info-no-error (Info-up t)) @@ -2987,7 +2991,7 @@ last sub-node, if any; otherwise go \"up\" to the parent node." (defun Info-last-preorder () "Go to the last node, popping up a level if there is none." - (interactive) + (interactive nil Info-mode) (cond ((and Info-scroll-prefer-subnodes (Info-no-error (Info-last-menu-item) @@ -3039,7 +3043,7 @@ the menu of a node, it moves to subnode indicated by the following menu item. (That case won't normally result from this command, but can happen in other ways.)" - (interactive) + (interactive nil Info-mode) (if (or (< (window-start) (point-min)) (> (window-start) (point-max))) (set-window-start (selected-window) (point))) @@ -3061,7 +3065,7 @@ in other ways.)" (defun Info-mouse-scroll-up (e) "Scroll one screenful forward in Info, using the mouse. See `Info-scroll-up'." - (interactive "e") + (interactive "e" Info-mode) (save-selected-window (if (eventp e) (select-window (posn-window (event-start e)))) @@ -3073,7 +3077,7 @@ If point is within the menu of a node, and `Info-scroll-prefer-subnodes' is non-nil, this goes to its last subnode. When you scroll past the beginning of a node, that goes to the previous node or back up to the parent node." - (interactive) + (interactive nil Info-mode) (if (or (< (window-start) (point-min)) (> (window-start) (point-max))) (set-window-start (selected-window) (point))) @@ -3093,7 +3097,7 @@ parent node." (defun Info-mouse-scroll-down (e) "Scroll one screenful backward in Info, using the mouse. See `Info-scroll-down'." - (interactive "e") + (interactive "e" Info-mode) (save-selected-window (if (eventp e) (select-window (posn-window (event-start e)))) @@ -3139,7 +3143,7 @@ Return the new position of point, or nil." "Move cursor to the next cross-reference or menu item in the node. If COUNT is non-nil (interactively with a prefix arg), jump over COUNT cross-references." - (interactive "i\np") + (interactive "i\np" Info-mode) (unless count (setq count 1)) (if (< count 0) @@ -3167,7 +3171,7 @@ COUNT cross-references." "Move cursor to the previous cross-reference or menu item in the node. If COUNT is non-nil (interactively with a prefix arg), jump over COUNT cross-references." - (interactive "i\np") + (interactive "i\np" Info-mode) (unless count (setq count 1)) (if (< count 0) @@ -3365,7 +3369,7 @@ Give an empty topic name to go to the Index node itself." (defun Info-index-next (num) "Go to the next matching index item from the last \\\\[Info-index] command." - (interactive "p") + (interactive "p" Info-mode) (or Info-index-alternatives (user-error "No previous `i' command")) (while (< num 0) @@ -3487,7 +3491,8 @@ search results." (with-current-buffer Info-complete-menu-buffer (Info-goto-index) (completing-read "Index topic: " #'Info-complete-menu-item)) - (kill-buffer Info-complete-menu-buffer))))) + (kill-buffer Info-complete-menu-buffer)))) + Info-mode) (if (equal topic "") (Info-find-node Info-current-file "*Index*") (unless (assoc (cons Info-current-file topic) Info-virtual-index-nodes) @@ -3793,7 +3798,7 @@ with a list of packages that contain all specified keywords." (defun Info-undefined () "Make command be undefined in Info." - (interactive) + (interactive nil Info-mode) (ding)) (defun Info-help () @@ -3870,7 +3875,7 @@ ERRORSTRING optional fourth argument, controls action on no match: "\\Follow a node reference near point. Like \\[Info-menu], \\[Info-follow-reference], \\[Info-next], \\[Info-prev] or \\[Info-up] command, depending on where you click. At end of the node's text, moves to the next node, or up if none." - (interactive "e") + (interactive "e" Info-mode) (mouse-set-point click) (and (not (Info-follow-nearest-node)) (save-excursion (forward-line 1) (eobp)) @@ -3884,7 +3889,7 @@ if point is in a menu item description, follow that menu item. If FORK is non-nil (interactively with a prefix arg), show the node in a new Info buffer. If FORK is a string, it is the name to use for the new buffer." - (interactive "P") + (interactive "P" Info-mode) (or (Info-try-follow-nearest-node fork) (when (save-excursion (search-backward "\n* menu:" nil t)) @@ -3954,7 +3959,7 @@ If FORK is non-nil, it is passed to `Info-goto-node'." (defun Info-mouse-follow-link (click) "Follow a link where you click." - (interactive "@e") + (interactive "@e" Info-mode) (let* ((position (event-start click)) (posn-string (and position (posn-string position))) (link-args (if posn-string @@ -4158,12 +4163,12 @@ If FORK is non-nil, it is passed to `Info-goto-node'." (defun Info-history-back-menu (e) "Pop up the menu with a list of previously visited Info nodes." - (interactive "e") + (interactive "e" Info-mode) (Info-history-menu e "Back in history" Info-history 'Info-history-back)) (defun Info-history-forward-menu (e) "Pop up the menu with a list of Info nodes visited with ‘Info-history-back’." - (interactive "e") + (interactive "e" Info-mode) (Info-history-menu e "Forward in history" Info-history-forward 'Info-history-forward)) (defvar Info-menu-last-node nil) @@ -4237,7 +4242,7 @@ If FORK is non-nil, it is passed to `Info-goto-node'." "Put the name of the current Info node into the kill ring. The name of the Info file is prepended to the node name in parentheses. With a zero prefix arg, put the name inside a function call to `info'." - (interactive "P") + (interactive "P" Info-mode) (unless Info-current-node (user-error "No current Info node")) (let ((node (if (stringp Info-current-file) -- cgit v1.2.3 From 27b8638409138a02577d2dd43e4cb59540f9174f Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 11 Mar 2021 17:50:02 +0100 Subject: Re-fix previous Info-fontify-node change * lisp/info.el (Info-fontify-node): Re-fix previous fix here (bug#34661) by fixing an off-by-one error in the `looking-back'. --- lisp/info.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp/info.el') diff --git a/lisp/info.el b/lisp/info.el index e7324efa2f9..dd7e16f8704 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -4797,10 +4797,10 @@ first line or header line, and for breadcrumb links.") (skip-syntax-backward " (")) (setq other-tag (cond ((save-match-data (looking-back "\\(^\\| \\)see" - (- (point) 3))) + (- (point) 4))) "") ((save-match-data (looking-back "\\(^\\| \\)in" - (- (point) 2))) + (- (point) 3))) "") ((memq (char-before) '(nil ?\. ?! ??)) "See ") -- cgit v1.2.3 From 0a4dc70830f5e8286b47120cabc750cca07a75c1 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 19 Apr 2021 12:21:01 +0200 Subject: ; Normalize and add missing first and last lines --- admin/charsets/eucjp-ms.awk | 2 +- admin/charsets/mule-charsets.el | 2 +- admin/unidata/unidata-gen.el | 6 +++--- etc/themes/manoj-dark-theme.el | 2 +- leim/leim-ext.el | 2 +- lisp/allout-widgets.el | 4 +++- lisp/calc/calc-menu.el | 2 ++ lisp/calc/calc-nlfit.el | 2 ++ lisp/cus-theme.el | 6 +++--- lisp/dframe.el | 2 +- lisp/dos-w32.el | 2 +- lisp/emacs-lisp/check-declare.el | 2 +- lisp/emacs-lisp/eieio-custom.el | 2 +- lisp/emacs-lisp/eieio-opt.el | 2 +- lisp/emacs-lisp/eieio-speedbar.el | 2 +- lisp/emacs-lisp/eieio.el | 2 +- lisp/emacs-lisp/tcover-ses.el | 4 ++-- lisp/emacs-lisp/testcover.el | 4 ++-- lisp/emacs-lisp/text-property-search.el | 2 ++ lisp/emacs-lisp/unsafep.el | 2 +- lisp/erc/erc-button.el | 2 +- lisp/erc/erc-desktop-notifications.el | 2 +- lisp/erc/erc-goodies.el | 2 +- lisp/erc/erc-imenu.el | 2 +- lisp/erc/erc-menu.el | 2 +- lisp/erc/erc-page.el | 2 +- lisp/erc/erc-replace.el | 2 +- lisp/erc/erc-ring.el | 2 +- lisp/gnus/gnus-notifications.el | 2 +- lisp/gnus/legacy-gnus-agent.el | 2 +- lisp/gnus/mm-archive.el | 2 +- lisp/gnus/spam-report.el | 2 +- lisp/info.el | 2 +- lisp/language/burmese.el | 2 ++ lisp/language/cham.el | 2 ++ lisp/language/khmer.el | 2 +- lisp/language/sinhala.el | 2 +- lisp/language/tai-viet.el | 2 ++ lisp/language/thai-word.el | 4 ++-- lisp/language/tv-util.el | 3 ++- lisp/leim/quail/croatian.el | 2 +- lisp/leim/quail/hebrew.el | 2 +- lisp/leim/quail/persian.el | 2 +- lisp/mail/rmail-spam-filter.el | 2 +- lisp/mail/uudecode.el | 2 +- lisp/mh-e/mh-search.el | 4 ++-- lisp/net/newst-ticker.el | 2 +- lisp/net/secrets.el | 2 ++ lisp/net/sieve-manage.el | 2 +- lisp/net/sieve-mode.el | 2 +- lisp/net/sieve.el | 2 +- lisp/notifications.el | 2 ++ lisp/nxml/rng-cmpct.el | 2 +- lisp/obsolete/info-edit.el | 2 +- lisp/obsolete/old-emacs-lock.el | 4 ++-- lisp/obsolete/otodo-mode.el | 4 ++-- lisp/obsolete/sb-image.el | 2 +- lisp/org/ob-hledger.el | 2 +- lisp/org/ob-mscgen.el | 4 ++-- lisp/org/ol-eshell.el | 2 +- lisp/org/org-ctags.el | 4 ++-- lisp/org/ox-man.el | 2 +- lisp/progmodes/bug-reference.el | 2 +- lisp/progmodes/cc-awk.el | 2 +- lisp/progmodes/idlw-shell.el | 2 +- lisp/progmodes/idlwave.el | 2 +- lisp/progmodes/js.el | 2 +- lisp/progmodes/sql.el | 4 ++-- lisp/ses.el | 2 +- lisp/speedbar.el | 4 ++-- lisp/term/konsole.el | 2 +- lisp/term/linux.el | 4 +++- lisp/term/lk201.el | 2 +- lisp/term/screen.el | 2 +- lisp/term/st.el | 2 +- lisp/term/tmux.el | 2 +- lisp/term/w32console.el | 2 +- lisp/textmodes/remember.el | 2 +- lisp/url/url-mailto.el | 2 +- lisp/vc/vc-dispatcher.el | 2 +- lisp/vc/vc-filewise.el | 2 ++ test/lisp/autorevert-tests.el | 2 +- test/lisp/calendar/icalendar-tests.el | 2 +- test/lisp/calendar/parse-time-tests.el | 2 +- test/lisp/cedet/srecode-utest-template.el | 2 +- test/lisp/custom-resources/custom--test-theme.el | 2 +- test/lisp/descr-text-tests.el | 2 +- test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el | 2 +- test/lisp/emacs-lisp/eieio-tests/eieio-tests.el | 2 +- test/lisp/eshell/em-hist-tests.el | 2 +- test/lisp/eshell/em-ls-tests.el | 2 +- test/lisp/eshell/esh-opt-tests.el | 2 +- test/lisp/eshell/eshell-tests.el | 2 +- test/lisp/gnus/message-tests.el | 2 +- test/lisp/info-xref-tests.el | 2 +- test/lisp/international/ucs-normalize-tests.el | 2 +- test/lisp/net/nsm-tests.el | 2 +- test/lisp/net/shr-tests.el | 2 +- test/lisp/play/cookie1-tests.el | 2 +- test/lisp/progmodes/cperl-mode-tests.el | 2 +- test/lisp/progmodes/perl-mode-tests.el | 2 +- test/lisp/simple-tests.el | 2 +- test/lisp/textmodes/fill-tests.el | 2 +- test/lisp/textmodes/tildify-tests.el | 2 +- test/lisp/thingatpt-tests.el | 2 +- test/lisp/vc/vc-bzr-tests.el | 2 +- test/lisp/xml-tests.el | 2 +- test/manual/cedet/semantic-tests.el | 2 +- test/manual/image-size-tests.el | 2 +- test/manual/image-transforms-tests.el | 2 +- test/manual/scroll-tests.el | 2 +- test/misc/test-custom-noloads.el | 4 ++-- test/src/character-tests.el | 2 +- test/src/editfns-tests.el | 2 +- test/src/emacs-module-tests.el | 2 +- test/src/fileio-tests.el | 2 +- test/src/thread-tests.el | 2 +- test/src/timefns-tests.el | 2 +- 118 files changed, 147 insertions(+), 124 deletions(-) (limited to 'lisp/info.el') diff --git a/admin/charsets/eucjp-ms.awk b/admin/charsets/eucjp-ms.awk index ca9a317611b..033b37f5ede 100644 --- a/admin/charsets/eucjp-ms.awk +++ b/admin/charsets/eucjp-ms.awk @@ -38,7 +38,7 @@ BEGIN { JISX0208_FROM2 = "/xf5/xa1"; JISX0212_FROM = "/x8f/xf3/xf3"; - print ";;; eucjp-ms.el -- translation table for eucJP-ms -*- lexical-binding:t -*-"; + print ";;; eucjp-ms.el --- translation table for eucJP-ms -*- lexical-binding:t -*-"; print ";;; Automatically generated from /usr/share/i18n/charmaps/EUC-JP-MS.gz"; print "(let ((map"; print " '(;JISEXT<->UNICODE"; diff --git a/admin/charsets/mule-charsets.el b/admin/charsets/mule-charsets.el index 99a8c60d880..7bcceb39b23 100644 --- a/admin/charsets/mule-charsets.el +++ b/admin/charsets/mule-charsets.el @@ -1,4 +1,4 @@ -;; mule-charsets.el -- Generate Mule-original charset maps. -*- lexical-binding: t -*- +;;; mule-charsets.el --- Generate Mule-original charset maps. -*- lexical-binding: t -*- ;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) ;; Registration Number H13PRO009 diff --git a/admin/unidata/unidata-gen.el b/admin/unidata/unidata-gen.el index 221c9b104e0..abd41e34a48 100644 --- a/admin/unidata/unidata-gen.el +++ b/admin/unidata/unidata-gen.el @@ -1,4 +1,4 @@ -;; unidata-gen.el -- Create files containing character property data -*- lexical-binding:t -*- +;;; unidata-gen.el --- Create files containing character property data -*- lexical-binding:t -*- ;; Copyright (C) 2008-2021 Free Software Foundation, Inc. @@ -1446,7 +1446,7 @@ Property value is a symbol `o' (Open), `c' (Close), or `n' (None)." ";; no-byte-compile: t\n" ";; no-update-autoloads: t\n" ";; End:\n\n" - (format ";; %s ends here\n" basename))))) + (format ";;; %s ends here\n" basename))))) (or noninteractive (message "Generating %s...done" file))) (defun unidata-gen-charprop (&optional charprop-file) @@ -1470,7 +1470,7 @@ Property value is a symbol `o' (Open), `c' (Close), or `n' (None)." ";; no-byte-compile: t\n" ";; no-update-autoloads: t\n" ";; End:\n\n" - (format ";; %s ends here\n" + (format ";;; %s ends here\n" (file-name-nondirectory charprop-file))))) diff --git a/etc/themes/manoj-dark-theme.el b/etc/themes/manoj-dark-theme.el index 1f4891c3168..5a527111d35 100644 --- a/etc/themes/manoj-dark-theme.el +++ b/etc/themes/manoj-dark-theme.el @@ -1,4 +1,4 @@ -;;; manoj-dark.el --- A dark theme from Manoj -*- lexical-binding:t -*- +;;; manoj-dark-theme.el --- A dark theme from Manoj -*- lexical-binding:t -*- ;; Copyright (C) 2011-2021 Free Software Foundation, Inc. diff --git a/leim/leim-ext.el b/leim/leim-ext.el index 687379db9f0..904675c0c52 100644 --- a/leim/leim-ext.el +++ b/leim/leim-ext.el @@ -1,4 +1,4 @@ -;; leim-ext.el -- extra leim configuration -*- lexical-binding: t; -*- +;;; leim-ext.el --- extra leim configuration -*- lexical-binding: t; -*- ;; Copyright (C) 2004-2021 Free Software Foundation, Inc. ;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 diff --git a/lisp/allout-widgets.el b/lisp/allout-widgets.el index 90f3f61b363..0e127040886 100644 --- a/lisp/allout-widgets.el +++ b/lisp/allout-widgets.el @@ -1,4 +1,4 @@ -;; allout-widgets.el --- Visually highlight allout outline structure. -*- lexical-binding: t; -*- +;;; allout-widgets.el --- Visually highlight allout outline structure. -*- lexical-binding: t; -*- ;; Copyright (C) 2005-2021 Free Software Foundation, Inc. @@ -2296,3 +2296,5 @@ The elements of LIST are not copied, just the list structure itself." ;;;_ , Local variables: ;;;_ , allout-layout: (-1 : 0) ;;;_ , End: + +;;; allout-widgets.el ends here diff --git a/lisp/calc/calc-menu.el b/lisp/calc/calc-menu.el index ac14e36c63c..516f62d7b63 100644 --- a/lisp/calc/calc-menu.el +++ b/lisp/calc/calc-menu.el @@ -1669,3 +1669,5 @@ ["Quit" calc-quit])) (provide 'calc-menu) + +;;; calc-menu.el ends here diff --git a/lisp/calc/calc-nlfit.el b/lisp/calc/calc-nlfit.el index 11867f15e5b..f676b098e58 100644 --- a/lisp/calc/calc-nlfit.el +++ b/lisp/calc/calc-nlfit.el @@ -819,3 +819,5 @@ (calc-record traillist "parm"))))) (provide 'calc-nlfit) + +;;; calc-nlfit.el ends here diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el index a702fedd245..13fb9f34fa0 100644 --- a/lisp/cus-theme.el +++ b/lisp/cus-theme.el @@ -1,7 +1,7 @@ -;;; cus-theme.el -- custom theme creation user interface -*- lexical-binding: t -*- -;; +;;; cus-theme.el --- custom theme creation user interface -*- lexical-binding: t -*- + ;; Copyright (C) 2001-2021 Free Software Foundation, Inc. -;; + ;; Author: Alex Schroeder ;; Maintainer: emacs-devel@gnu.org ;; Keywords: help, faces diff --git a/lisp/dframe.el b/lisp/dframe.el index f4208f3755a..1ddf11a8aac 100644 --- a/lisp/dframe.el +++ b/lisp/dframe.el @@ -1,4 +1,4 @@ -;;; dframe --- dedicate frame support modes -*- lexical-binding:t -*- +;;; dframe.el --- dedicate frame support modes -*- lexical-binding:t -*- ;; Copyright (C) 1996-2021 Free Software Foundation, Inc. diff --git a/lisp/dos-w32.el b/lisp/dos-w32.el index cf753214624..45daaad8eff 100644 --- a/lisp/dos-w32.el +++ b/lisp/dos-w32.el @@ -1,4 +1,4 @@ -;; dos-w32.el --- Functions shared among MS-DOS and W32 (NT/95) platforms -*- lexical-binding: t; -*- +;;; dos-w32.el --- Functions shared among MS-DOS and W32 (NT/95) platforms -*- lexical-binding: t; -*- ;; Copyright (C) 1996, 2001-2021 Free Software Foundation, Inc. diff --git a/lisp/emacs-lisp/check-declare.el b/lisp/emacs-lisp/check-declare.el index 7c2b23b4ec4..bec4ad92503 100644 --- a/lisp/emacs-lisp/check-declare.el +++ b/lisp/emacs-lisp/check-declare.el @@ -328,4 +328,4 @@ Returns non-nil if any false statements are found." (provide 'check-declare) -;;; check-declare.el ends here. +;;; check-declare.el ends here diff --git a/lisp/emacs-lisp/eieio-custom.el b/lisp/emacs-lisp/eieio-custom.el index 184b99fdac6..8257f7a4bae 100644 --- a/lisp/emacs-lisp/eieio-custom.el +++ b/lisp/emacs-lisp/eieio-custom.el @@ -1,4 +1,4 @@ -;;; eieio-custom.el -- eieio object customization -*- lexical-binding:t -*- +;;; eieio-custom.el --- eieio object customization -*- lexical-binding:t -*- ;; Copyright (C) 1999-2001, 2005, 2007-2021 Free Software Foundation, ;; Inc. diff --git a/lisp/emacs-lisp/eieio-opt.el b/lisp/emacs-lisp/eieio-opt.el index e65f424cbab..08a6debc203 100644 --- a/lisp/emacs-lisp/eieio-opt.el +++ b/lisp/emacs-lisp/eieio-opt.el @@ -1,4 +1,4 @@ -;;; eieio-opt.el -- eieio optional functions (debug, printing, speedbar) -*- lexical-binding: t; -*- +;;; eieio-opt.el --- eieio optional functions (debug, printing, speedbar) -*- lexical-binding: t; -*- ;; Copyright (C) 1996, 1998-2003, 2005, 2008-2021 Free Software ;; Foundation, Inc. diff --git a/lisp/emacs-lisp/eieio-speedbar.el b/lisp/emacs-lisp/eieio-speedbar.el index 8bf77e20dfa..c25ea8acee9 100644 --- a/lisp/emacs-lisp/eieio-speedbar.el +++ b/lisp/emacs-lisp/eieio-speedbar.el @@ -1,4 +1,4 @@ -;;; eieio-speedbar.el -- Classes for managing speedbar displays. -*- lexical-binding:t -*- +;;; eieio-speedbar.el --- Classes for managing speedbar displays. -*- lexical-binding:t -*- ;; Copyright (C) 1999-2002, 2005, 2007-2021 Free Software Foundation, ;; Inc. diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el index 910023b841b..31b6b0945bb 100644 --- a/lisp/emacs-lisp/eieio.el +++ b/lisp/emacs-lisp/eieio.el @@ -981,4 +981,4 @@ of `eq'." (provide 'eieio) -;;; eieio ends here +;;; eieio.el ends here diff --git a/lisp/emacs-lisp/tcover-ses.el b/lisp/emacs-lisp/tcover-ses.el index d9db1d3cdc9..4460fef97bd 100644 --- a/lisp/emacs-lisp/tcover-ses.el +++ b/lisp/emacs-lisp/tcover-ses.el @@ -1,4 +1,4 @@ -;;;; testcover-ses.el -- Example use of `testcover' to test "SES" -*- lexical-binding: t; -*- +;;; tcover-ses.el --- Example use of `testcover' to test "SES" -*- lexical-binding: t; -*- ;; Copyright (C) 2002-2021 Free Software Foundation, Inc. @@ -716,4 +716,4 @@ spreadsheet files with invalid formatting." ;;Could do this here: (testcover-end "ses.el") (message "Done")) -;;; testcover-ses.el ends here. +;;; tcover-ses.el ends here diff --git a/lisp/emacs-lisp/testcover.el b/lisp/emacs-lisp/testcover.el index 75b27d08e56..e75f15140aa 100644 --- a/lisp/emacs-lisp/testcover.el +++ b/lisp/emacs-lisp/testcover.el @@ -1,4 +1,4 @@ -;;;; testcover.el -- Visual code-coverage tool -*- lexical-binding:t -*- +;;; testcover.el --- Visual code-coverage tool -*- lexical-binding:t -*- ;; Copyright (C) 2002-2021 Free Software Foundation, Inc. @@ -675,4 +675,4 @@ The list is 1valued if all of its constituent elements are also 1valued." (testcover-analyze-coverage (cadr form))) (t (testcover-analyze-coverage-backquote form)))) -;; testcover.el ends here. +;;; testcover.el ends here diff --git a/lisp/emacs-lisp/text-property-search.el b/lisp/emacs-lisp/text-property-search.el index e909e4bf760..69943a83f1c 100644 --- a/lisp/emacs-lisp/text-property-search.el +++ b/lisp/emacs-lisp/text-property-search.el @@ -214,3 +214,5 @@ and if a matching region is found, place point at its end." (funcall predicate value prop-value)) (provide 'text-property-search) + +;;; text-property-search.el ends here diff --git a/lisp/emacs-lisp/unsafep.el b/lisp/emacs-lisp/unsafep.el index d52a6c796db..fa4e0583ed3 100644 --- a/lisp/emacs-lisp/unsafep.el +++ b/lisp/emacs-lisp/unsafep.el @@ -1,4 +1,4 @@ -;;;; unsafep.el -- Determine whether a Lisp form is safe to evaluate -*- lexical-binding: t; -*- +;;; unsafep.el --- Determine whether a Lisp form is safe to evaluate -*- lexical-binding: t; -*- ;; Copyright (C) 2002-2021 Free Software Foundation, Inc. diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el index 044776c2363..cb9af92ba12 100644 --- a/lisp/erc/erc-button.el +++ b/lisp/erc/erc-button.el @@ -1,4 +1,4 @@ -;; erc-button.el --- A way of buttonizing certain things in ERC buffers -*- lexical-binding:t -*- +;;; erc-button.el --- A way of buttonizing certain things in ERC buffers -*- lexical-binding:t -*- ;; Copyright (C) 1996-2004, 2006-2021 Free Software Foundation, Inc. diff --git a/lisp/erc/erc-desktop-notifications.el b/lisp/erc/erc-desktop-notifications.el index 990f013cd2a..9838b239537 100644 --- a/lisp/erc/erc-desktop-notifications.el +++ b/lisp/erc/erc-desktop-notifications.el @@ -1,4 +1,4 @@ -;; erc-desktop-notifications.el -- Send notification on PRIVMSG or mentions -*- lexical-binding:t -*- +;;; erc-desktop-notifications.el --- Send notification on PRIVMSG or mentions -*- lexical-binding:t -*- ;; Copyright (C) 2012-2021 Free Software Foundation, Inc. diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el index 1143faa1e26..fc9a8d39ef4 100644 --- a/lisp/erc/erc-goodies.el +++ b/lisp/erc/erc-goodies.el @@ -1,4 +1,4 @@ -;; erc-goodies.el --- Collection of ERC modules -*- lexical-binding: t; -*- +;;; erc-goodies.el --- Collection of ERC modules -*- lexical-binding: t; -*- ;; Copyright (C) 2001-2021 Free Software Foundation, Inc. diff --git a/lisp/erc/erc-imenu.el b/lisp/erc/erc-imenu.el index b2a2dc588e5..dcf6db7407a 100644 --- a/lisp/erc/erc-imenu.el +++ b/lisp/erc/erc-imenu.el @@ -1,4 +1,4 @@ -;;; erc-imenu.el -- Imenu support for ERC -*- lexical-binding: t; -*- +;;; erc-imenu.el --- Imenu support for ERC -*- lexical-binding: t; -*- ;; Copyright (C) 2001-2002, 2004, 2006-2021 Free Software Foundation, ;; Inc. diff --git a/lisp/erc/erc-menu.el b/lisp/erc/erc-menu.el index 0dc819fbbbe..1bee6ff2a67 100644 --- a/lisp/erc/erc-menu.el +++ b/lisp/erc/erc-menu.el @@ -1,4 +1,4 @@ -;; erc-menu.el -- Menu-bar definitions for ERC -*- lexical-binding: t; -*- +;;; erc-menu.el --- Menu-bar definitions for ERC -*- lexical-binding: t; -*- ;; Copyright (C) 2001-2002, 2004-2021 Free Software Foundation, Inc. diff --git a/lisp/erc/erc-page.el b/lisp/erc/erc-page.el index 4c244b7984d..457e8cd4684 100644 --- a/lisp/erc/erc-page.el +++ b/lisp/erc/erc-page.el @@ -1,4 +1,4 @@ -;; erc-page.el - CTCP PAGE support for ERC -*- lexical-binding: t; -*- +;;; erc-page.el --- CTCP PAGE support for ERC -*- lexical-binding: t; -*- ;; Copyright (C) 2002, 2004, 2006-2021 Free Software Foundation, Inc. diff --git a/lisp/erc/erc-replace.el b/lisp/erc/erc-replace.el index d08d9850c10..3f69c4cb9cc 100644 --- a/lisp/erc/erc-replace.el +++ b/lisp/erc/erc-replace.el @@ -1,4 +1,4 @@ -;; erc-replace.el -- wash and massage messages inserted into the buffer -*- lexical-binding: t; -*- +;;; erc-replace.el --- wash and massage messages inserted into the buffer -*- lexical-binding: t; -*- ;; Copyright (C) 2001-2002, 2004, 2006-2021 Free Software Foundation, ;; Inc. diff --git a/lisp/erc/erc-ring.el b/lisp/erc/erc-ring.el index 28299ae46c3..666fd585926 100644 --- a/lisp/erc/erc-ring.el +++ b/lisp/erc/erc-ring.el @@ -1,4 +1,4 @@ -;; erc-ring.el -- Command history handling for erc using ring.el -*- lexical-binding: t; -*- +;;; erc-ring.el --- Command history handling for erc using ring.el -*- lexical-binding: t; -*- ;; Copyright (C) 2001-2004, 2006-2021 Free Software Foundation, Inc. diff --git a/lisp/gnus/gnus-notifications.el b/lisp/gnus/gnus-notifications.el index a4d198b46e4..8646904637c 100644 --- a/lisp/gnus/gnus-notifications.el +++ b/lisp/gnus/gnus-notifications.el @@ -1,4 +1,4 @@ -;; gnus-notifications.el -- Send notification on new message in Gnus -*- lexical-binding: t; -*- +;;; gnus-notifications.el --- Send notification on new message in Gnus -*- lexical-binding: t; -*- ;; Copyright (C) 2012-2021 Free Software Foundation, Inc. diff --git a/lisp/gnus/legacy-gnus-agent.el b/lisp/gnus/legacy-gnus-agent.el index 091e3899c26..4f800891b2b 100644 --- a/lisp/gnus/legacy-gnus-agent.el +++ b/lisp/gnus/legacy-gnus-agent.el @@ -1,4 +1,4 @@ -;;; gnus-agent.el --- Legacy unplugged support for Gnus -*- lexical-binding: t; -*- +;;; legacy-gnus-agent.el --- Legacy unplugged support for Gnus -*- lexical-binding: t; -*- ;; Copyright (C) 2004-2021 Free Software Foundation, Inc. diff --git a/lisp/gnus/mm-archive.el b/lisp/gnus/mm-archive.el index 1ecceeedeb7..fdc83e1de6e 100644 --- a/lisp/gnus/mm-archive.el +++ b/lisp/gnus/mm-archive.el @@ -108,4 +108,4 @@ (provide 'mm-archive) -;; mm-archive.el ends here +;;; mm-archive.el ends here diff --git a/lisp/gnus/spam-report.el b/lisp/gnus/spam-report.el index 7d93f8a5550..a4234f84001 100644 --- a/lisp/gnus/spam-report.el +++ b/lisp/gnus/spam-report.el @@ -378,4 +378,4 @@ Process queued spam reports." (provide 'spam-report) -;;; spam-report.el ends here. +;;; spam-report.el ends here diff --git a/lisp/info.el b/lisp/info.el index dd7e16f8704..5efac6f25f1 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -1,4 +1,4 @@ -;; info.el --- Info package for Emacs -*- lexical-binding:t -*- +;;; info.el --- Info package for Emacs -*- lexical-binding:t -*- ;; Copyright (C) 1985-1986, 1992-2021 Free Software Foundation, Inc. diff --git a/lisp/language/burmese.el b/lisp/language/burmese.el index 373f25ac5ca..ade3566717b 100644 --- a/lisp/language/burmese.el +++ b/lisp/language/burmese.el @@ -55,3 +55,5 @@ (vector "." 0 #'font-shape-gstring)))) (set-char-table-range composition-function-table '(#x1000 . #x107F) elt) (set-char-table-range composition-function-table '(#xAA60 . #xAA7B) elt)) + +;;; burmese.el ends here diff --git a/lisp/language/cham.el b/lisp/language/cham.el index 3aac986b437..cbb35565af2 100644 --- a/lisp/language/cham.el +++ b/lisp/language/cham.el @@ -43,3 +43,5 @@ an Austronesian language spoken by some 245,000 Chams in Vietnam and Cambodia."))) (provide 'cham) + +;;; cham.el ends here diff --git a/lisp/language/khmer.el b/lisp/language/khmer.el index 6f08e60d601..471af401656 100644 --- a/lisp/language/khmer.el +++ b/lisp/language/khmer.el @@ -35,4 +35,4 @@ (set-char-table-range composition-function-table '(#x1780 . #x17FF) val) (set-char-table-range composition-function-table '(#x19E0 . #x19FF) val)) -;; khmer.el ends here +;;; khmer.el ends here diff --git a/lisp/language/sinhala.el b/lisp/language/sinhala.el index 99a104ec339..89392ad6c50 100644 --- a/lisp/language/sinhala.el +++ b/lisp/language/sinhala.el @@ -45,4 +45,4 @@ "[\u0D80-\u0DFF]") 0 #'font-shape-gstring))) -;; sinhala.el ends here +;;; sinhala.el ends here diff --git a/lisp/language/tai-viet.el b/lisp/language/tai-viet.el index 4549b111a3d..366c39202d3 100644 --- a/lisp/language/tai-viet.el +++ b/lisp/language/tai-viet.el @@ -56,3 +56,5 @@ The language name is spelled as \"ꪁꪫꪱꪣ ꪼꪕ\", and the script name is spelled as \"ꪎꪳ ꪼꪕ\"."))) (provide 'tai-viet) + +;;; tai-viet.el ends here diff --git a/lisp/language/thai-word.el b/lisp/language/thai-word.el index 7a09bc3a24a..5d0389c28df 100644 --- a/lisp/language/thai-word.el +++ b/lisp/language/thai-word.el @@ -1,4 +1,4 @@ -;;; thai-word.el -- find Thai word boundaries -*- lexical-binding: t; -*- +;;; thai-word.el --- find Thai word boundaries -*- lexical-binding: t; -*- ;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) @@ -11074,4 +11074,4 @@ With argument, do this that many times." ;; coding: utf-8 ;; End: -;; thai-word.el ends here +;;; thai-word.el ends here diff --git a/lisp/language/tv-util.el b/lisp/language/tv-util.el index 1a530d350f2..207d76f47c1 100644 --- a/lisp/language/tv-util.el +++ b/lisp/language/tv-util.el @@ -136,5 +136,6 @@ (if (looking-at tai-viet-re) (tai-viet-compose-region from (match-end 0))))) -;; (provide 'tai-viet-util) + +;;; tv-util.el ends here diff --git a/lisp/leim/quail/croatian.el b/lisp/leim/quail/croatian.el index 08f1e47b6f3..7402b81a8cc 100644 --- a/lisp/leim/quail/croatian.el +++ b/lisp/leim/quail/croatian.el @@ -1,4 +1,4 @@ -;;; croatian.el -- Quail package for inputting Croatian -*-coding: utf-8; lexical-binding:t -*- +;;; croatian.el --- Quail package for inputting Croatian -*-coding: utf-8; lexical-binding:t -*- ;; Copyright (C) 2003-2021 Free Software Foundation, Inc. diff --git a/lisp/leim/quail/hebrew.el b/lisp/leim/quail/hebrew.el index fc6bb80596b..28b2eb34367 100644 --- a/lisp/leim/quail/hebrew.el +++ b/lisp/leim/quail/hebrew.el @@ -1,4 +1,4 @@ -;; hebrew.el --- Quail package for inputting Hebrew characters -*- coding: utf-8; lexical-binding: t -*- +;;; hebrew.el --- Quail package for inputting Hebrew characters -*- coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, ;; 2008, 2009, 2010, 2011 diff --git a/lisp/leim/quail/persian.el b/lisp/leim/quail/persian.el index 4157f886704..cb1f6e3c78b 100644 --- a/lisp/leim/quail/persian.el +++ b/lisp/leim/quail/persian.el @@ -1,4 +1,4 @@ -;;; persian.el --- Quail package for inputting Persian/Farsi keyboard -*- coding: utf-8; lexical-binding: t -*- +;;; persian.el --- Quail package for inputting Persian/Farsi keyboard -*- coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 2011-2021 Free Software Foundation, Inc. diff --git a/lisp/mail/rmail-spam-filter.el b/lisp/mail/rmail-spam-filter.el index d833685a8d4..fbac9e0cc0c 100644 --- a/lisp/mail/rmail-spam-filter.el +++ b/lisp/mail/rmail-spam-filter.el @@ -555,4 +555,4 @@ checks to see if the old format is used, and updates it if necessary." (provide 'rmail-spam-filter) -;;; rmail-spam-filter ends here +;;; rmail-spam-filter.el ends here diff --git a/lisp/mail/uudecode.el b/lisp/mail/uudecode.el index fdd402e0fa0..026356efe97 100644 --- a/lisp/mail/uudecode.el +++ b/lisp/mail/uudecode.el @@ -1,4 +1,4 @@ -;;; uudecode.el -- elisp native uudecode -*- lexical-binding:t -*- +;;; uudecode.el --- elisp native uudecode -*- lexical-binding:t -*- ;; Copyright (C) 1998-2021 Free Software Foundation, Inc. diff --git a/lisp/mh-e/mh-search.el b/lisp/mh-e/mh-search.el index 9df7c326564..b3a250bf13a 100644 --- a/lisp/mh-e/mh-search.el +++ b/lisp/mh-e/mh-search.el @@ -1,4 +1,4 @@ -;;; mh-search --- MH-Search mode -*- lexical-binding: t; -*- +;;; mh-search.el --- MH-Search mode -*- lexical-binding: t; -*- ;; Copyright (C) 1993, 1995, 2001-2021 Free Software Foundation, Inc. @@ -1943,4 +1943,4 @@ folder buffer." ;; sentence-end-double-space: nil ;; End: -;;; mh-search ends here +;;; mh-search.el ends here diff --git a/lisp/net/newst-ticker.el b/lisp/net/newst-ticker.el index 2f764708701..8cfafb5bfe4 100644 --- a/lisp/net/newst-ticker.el +++ b/lisp/net/newst-ticker.el @@ -1,4 +1,4 @@ -;; newst-ticker.el --- mode line ticker for newsticker. -*- lexical-binding: t; -*- +;;; newst-ticker.el --- mode line ticker for newsticker. -*- lexical-binding: t; -*- ;; Copyright (C) 2003-2021 Free Software Foundation, Inc. diff --git a/lisp/net/secrets.el b/lisp/net/secrets.el index 94db318c1b0..4102b9d322a 100644 --- a/lisp/net/secrets.el +++ b/lisp/net/secrets.el @@ -957,3 +957,5 @@ to their attributes." ;; * Check, whether the dh-ietf1024-aes128-cbc-pkcs7 algorithm can be ;; used for the transfer of the secrets. Currently, we use the ;; plain algorithm. + +;;; secrets.el ends here diff --git a/lisp/net/sieve-manage.el b/lisp/net/sieve-manage.el index c4d6ec4b6cc..5dad5f446ac 100644 --- a/lisp/net/sieve-manage.el +++ b/lisp/net/sieve-manage.el @@ -580,4 +580,4 @@ to local variable `sieve-manage-capability'." (provide 'sieve-manage) -;; sieve-manage.el ends here +;;; sieve-manage.el ends here diff --git a/lisp/net/sieve-mode.el b/lisp/net/sieve-mode.el index 966f0f056bd..0e8fdc0a905 100644 --- a/lisp/net/sieve-mode.el +++ b/lisp/net/sieve-mode.el @@ -206,4 +206,4 @@ Turning on Sieve mode runs `sieve-mode-hook'." (provide 'sieve-mode) -;; sieve-mode.el ends here +;;; sieve-mode.el ends here diff --git a/lisp/net/sieve.el b/lisp/net/sieve.el index 595d63331a4..6d571a0a30f 100644 --- a/lisp/net/sieve.el +++ b/lisp/net/sieve.el @@ -379,4 +379,4 @@ Used to bracket operations which move point in the sieve-buffer." (provide 'sieve) -;; sieve.el ends here +;;; sieve.el ends here diff --git a/lisp/notifications.el b/lisp/notifications.el index b439d822317..ebd74dd3ef2 100644 --- a/lisp/notifications.el +++ b/lisp/notifications.el @@ -420,3 +420,5 @@ version this library is compliant with." notifications-get-server-information-method))) (provide 'notifications) + +;;; notifications.el ends here diff --git a/lisp/nxml/rng-cmpct.el b/lisp/nxml/rng-cmpct.el index 3d4b9f87414..1314ade9e31 100644 --- a/lisp/nxml/rng-cmpct.el +++ b/lisp/nxml/rng-cmpct.el @@ -922,4 +922,4 @@ Current token after parse is token following ]." (provide 'rng-cmpct) -;;; rng-cmpct.el +;;; rng-cmpct.el ends here diff --git a/lisp/obsolete/info-edit.el b/lisp/obsolete/info-edit.el index c53616d80e7..19958979a85 100644 --- a/lisp/obsolete/info-edit.el +++ b/lisp/obsolete/info-edit.el @@ -1,4 +1,4 @@ -;; info-edit.el --- Editing info files -*- lexical-binding:t -*- +;;; info-edit.el --- Editing info files -*- lexical-binding:t -*- ;; Copyright (C) 1985-1986, 1992-2021 Free Software Foundation, Inc. diff --git a/lisp/obsolete/old-emacs-lock.el b/lisp/obsolete/old-emacs-lock.el index 90ff93e03b1..ce4c60e6a17 100644 --- a/lisp/obsolete/old-emacs-lock.el +++ b/lisp/obsolete/old-emacs-lock.el @@ -1,4 +1,4 @@ -;;; emacs-lock.el --- prevents you from exiting Emacs if a buffer is locked -*- lexical-binding: t; -*- +;;; old-emacs-lock.el --- prevents you from exiting Emacs if a buffer is locked -*- lexical-binding: t; -*- ;; Copyright (C) 1994, 1997, 2001-2021 Free Software Foundation, Inc. @@ -99,4 +99,4 @@ If the buffer is locked, signal error and display its name." (provide 'emacs-lock) -;;; emacs-lock.el ends here +;;; old-emacs-lock.el ends here diff --git a/lisp/obsolete/otodo-mode.el b/lisp/obsolete/otodo-mode.el index add17b265b4..47f5089452f 100644 --- a/lisp/obsolete/otodo-mode.el +++ b/lisp/obsolete/otodo-mode.el @@ -1,4 +1,4 @@ -;;; todo-mode.el --- major mode for editing TODO list files -*- lexical-binding: t; -*- +;;; otodo-mode.el --- major mode for editing TODO list files -*- lexical-binding: t; -*- ;; Copyright (C) 1997, 1999, 2001-2021 Free Software Foundation, Inc. @@ -963,4 +963,4 @@ If INCLUDE-SEP is non-nil, return point after the separator." (provide 'todo-mode) -;;; todo-mode.el ends here +;;; otodo-mode.el ends here diff --git a/lisp/obsolete/sb-image.el b/lisp/obsolete/sb-image.el index e9a507f0086..fc9e03eae6e 100644 --- a/lisp/obsolete/sb-image.el +++ b/lisp/obsolete/sb-image.el @@ -1,4 +1,4 @@ -;;; sb-image --- Image management for speedbar -*- lexical-binding: t; -*- +;;; sb-image.el --- Image management for speedbar -*- lexical-binding: t; -*- ;; Copyright (C) 1999-2003, 2005-2019, 2021 Free Software Foundation, ;; Inc. diff --git a/lisp/org/ob-hledger.el b/lisp/org/ob-hledger.el index 3d2f46cdce2..48dcb8cea1a 100644 --- a/lisp/org/ob-hledger.el +++ b/lisp/org/ob-hledger.el @@ -1,4 +1,4 @@ -;; ob-hledger.el --- Babel Functions for hledger -*- lexical-binding: t; -*- +;;; ob-hledger.el --- Babel Functions for hledger -*- lexical-binding: t; -*- ;; Copyright (C) 2010-2021 Free Software Foundation, Inc. diff --git a/lisp/org/ob-mscgen.el b/lisp/org/ob-mscgen.el index 999d4f4140b..79c9f8702eb 100644 --- a/lisp/org/ob-mscgen.el +++ b/lisp/org/ob-mscgen.el @@ -1,4 +1,4 @@ -;;; ob-msc.el --- Babel Functions for Mscgen -*- lexical-binding: t; -*- +;;; ob-mscgen.el --- Babel Functions for Mscgen -*- lexical-binding: t; -*- ;; Copyright (C) 2010-2021 Free Software Foundation, Inc. @@ -78,4 +78,4 @@ mscgen supported formats." (provide 'ob-mscgen) -;;; ob-msc.el ends here +;;; ob-mscgen.el ends here diff --git a/lisp/org/ol-eshell.el b/lisp/org/ol-eshell.el index 769e7ee5225..8920e0afb0d 100644 --- a/lisp/org/ol-eshell.el +++ b/lisp/org/ol-eshell.el @@ -1,4 +1,4 @@ -;;; ol-eshell.el - Links to Working Directories in Eshell -*- lexical-binding: t; -*- +;;; ol-eshell.el --- Links to Working Directories in Eshell -*- lexical-binding: t; -*- ;; Copyright (C) 2011-2021 Free Software Foundation, Inc. diff --git a/lisp/org/org-ctags.el b/lisp/org/org-ctags.el index 1fca873c159..dc2b3be6326 100644 --- a/lisp/org/org-ctags.el +++ b/lisp/org/org-ctags.el @@ -1,5 +1,5 @@ -;;; org-ctags.el - Integrate Emacs "tags" Facility with Org -*- lexical-binding: t; -*- -;; +;;; org-ctags.el --- Integrate Emacs "tags" Facility with Org -*- lexical-binding: t; -*- + ;; Copyright (C) 2007-2021 Free Software Foundation, Inc. ;; Author: Paul Sexton diff --git a/lisp/org/ox-man.el b/lisp/org/ox-man.el index 6cace7e6989..27d2dedb8ed 100644 --- a/lisp/org/ox-man.el +++ b/lisp/org/ox-man.el @@ -1,4 +1,4 @@ -;; ox-man.el --- Man Back-End for Org Export Engine -*- lexical-binding: t; -*- +;;; ox-man.el --- Man Back-End for Org Export Engine -*- lexical-binding: t; -*- ;; Copyright (C) 2011-2021 Free Software Foundation, Inc. diff --git a/lisp/progmodes/bug-reference.el b/lisp/progmodes/bug-reference.el index e467d98303e..0c5837cae7e 100644 --- a/lisp/progmodes/bug-reference.el +++ b/lisp/progmodes/bug-reference.el @@ -1,4 +1,4 @@ -;; bug-reference.el --- buttonize bug references -*- lexical-binding: t; -*- +;;; bug-reference.el --- buttonize bug references -*- lexical-binding: t; -*- ;; Copyright (C) 2008-2021 Free Software Foundation, Inc. diff --git a/lisp/progmodes/cc-awk.el b/lisp/progmodes/cc-awk.el index 84cc5b115e7..334e82114fc 100644 --- a/lisp/progmodes/cc-awk.el +++ b/lisp/progmodes/cc-awk.el @@ -1227,4 +1227,4 @@ comment at the start of cc-engine.el for more info." ;; indent-tabs-mode: t ;; tab-width: 8 ;; End: -;;; awk-mode.el ends here +;;; cc-awk.el ends here diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el index 134a6c6e497..ad8feb988f5 100644 --- a/lisp/progmodes/idlw-shell.el +++ b/lisp/progmodes/idlw-shell.el @@ -1,4 +1,4 @@ -;; idlw-shell.el --- run IDL as an inferior process of Emacs. -*- lexical-binding:t -*- +;;; idlw-shell.el --- run IDL as an inferior process of Emacs. -*- lexical-binding:t -*- ;; Copyright (C) 1999-2021 Free Software Foundation, Inc. diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index 75f2016fc24..b55a98af0b3 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -1,4 +1,4 @@ -;; idlwave.el --- IDL editing mode for GNU Emacs -*- lexical-binding: t; -*- +;;; idlwave.el --- IDL editing mode for GNU Emacs -*- lexical-binding: t; -*- ;; Copyright (C) 1999-2021 Free Software Foundation, Inc. diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 6d6063d783c..a942235f474 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -4655,4 +4655,4 @@ one of the aforementioned options instead of using this mode." (provide 'js) -;; js.el ends here +;;; js.el ends here diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index 6e53a04f72d..65a4094d70d 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -5606,7 +5606,7 @@ The default value disables the internal pager." (provide 'sql) -;;; sql.el ends here - ; LocalWords: sql SQL SQLite sqlite Sybase Informix MySQL ; LocalWords: Postgres SQLServer SQLi + +;;; sql.el ends here diff --git a/lisp/ses.el b/lisp/ses.el index 6058d48ed19..98785b6b938 100644 --- a/lisp/ses.el +++ b/lisp/ses.el @@ -1,4 +1,4 @@ -;;; ses.el -- Simple Emacs Spreadsheet -*- lexical-binding:t -*- +;;; ses.el --- Simple Emacs Spreadsheet -*- lexical-binding:t -*- ;; Copyright (C) 2002-2021 Free Software Foundation, Inc. diff --git a/lisp/speedbar.el b/lisp/speedbar.el index 118c7260769..4666026f357 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el @@ -1,4 +1,4 @@ -;;; speedbar --- quick access to files and tags in a frame -*- lexical-binding: t; -*- +;;; speedbar.el --- quick access to files and tags in a frame -*- lexical-binding: t; -*- ;; Copyright (C) 1996-2021 Free Software Foundation, Inc. @@ -4057,4 +4057,4 @@ this version is not backward compatible to 0.14 or earlier.") (run-hooks 'speedbar-load-hook) -;;; speedbar ends here +;;; speedbar.el ends here diff --git a/lisp/term/konsole.el b/lisp/term/konsole.el index e38a5d34e75..1f65a46011c 100644 --- a/lisp/term/konsole.el +++ b/lisp/term/konsole.el @@ -9,4 +9,4 @@ (provide 'term/konsole) -;; konsole.el ends here +;;; konsole.el ends here diff --git a/lisp/term/linux.el b/lisp/term/linux.el index 35bd3ac0acb..c6d84ab96c3 100644 --- a/lisp/term/linux.el +++ b/lisp/term/linux.el @@ -1,4 +1,6 @@ -;; The Linux console handles Latin-1 by default. -*- lexical-binding:t -*- +;;; linux.el -*- lexical-binding:t -*- + +;; The Linux console handles Latin-1 by default. (declare-function gpm-mouse-enable "t-mouse" ()) diff --git a/lisp/term/lk201.el b/lisp/term/lk201.el index 3bcaa2ecd18..c2802477670 100644 --- a/lisp/term/lk201.el +++ b/lisp/term/lk201.el @@ -1,4 +1,4 @@ -;; Define function key sequences for DEC terminals. -*- lexical-binding: t -*- +;;; lk201.el --- Define function key sequences for DEC terminals. -*- lexical-binding: t -*- (defvar lk201-function-map (let ((map (make-sparse-keymap))) diff --git a/lisp/term/screen.el b/lisp/term/screen.el index 04481e8358b..9655f41b6c1 100644 --- a/lisp/term/screen.el +++ b/lisp/term/screen.el @@ -22,4 +22,4 @@ it runs, which can change when the screen session is moved to another tty." (provide 'term/screen) -;; screen.el ends here +;;; screen.el ends here diff --git a/lisp/term/st.el b/lisp/term/st.el index 08432c414af..9a1c0646f89 100644 --- a/lisp/term/st.el +++ b/lisp/term/st.el @@ -17,4 +17,4 @@ (provide 'term/st) -;; st.el ends here +;;; st.el ends here diff --git a/lisp/term/tmux.el b/lisp/term/tmux.el index aa0c98364f3..4ea6f416c8c 100644 --- a/lisp/term/tmux.el +++ b/lisp/term/tmux.el @@ -22,4 +22,4 @@ it runs, which can change when the tmux session is moved to another tty." (provide 'term/tmux) -;; tmux.el ends here +;;; tmux.el ends here diff --git a/lisp/term/w32console.el b/lisp/term/w32console.el index 4a925cd84c3..1a5dc05783e 100644 --- a/lisp/term/w32console.el +++ b/lisp/term/w32console.el @@ -1,4 +1,4 @@ -;;; w32console.el -- Setup w32 console keys and colors. -*- lexical-binding: t; -*- +;;; w32console.el --- Setup w32 console keys and colors. -*- lexical-binding: t; -*- ;; Copyright (C) 2007-2021 Free Software Foundation, Inc. diff --git a/lisp/textmodes/remember.el b/lisp/textmodes/remember.el index 8a0436afc64..4acdc9f4d87 100644 --- a/lisp/textmodes/remember.el +++ b/lisp/textmodes/remember.el @@ -1,4 +1,4 @@ -;;; remember --- a mode for quickly jotting down things to remember -*- lexical-binding: t; -*- +;;; remember.el --- a mode for quickly jotting down things to remember -*- lexical-binding: t; -*- ;; Copyright (C) 1999-2001, 2003-2021 Free Software Foundation, Inc. diff --git a/lisp/url/url-mailto.el b/lisp/url/url-mailto.el index c6901d99200..29c2780121a 100644 --- a/lisp/url/url-mailto.el +++ b/lisp/url/url-mailto.el @@ -1,4 +1,4 @@ -;;; url-mail.el --- Mail Uniform Resource Locator retrieval code -*- lexical-binding: t; -*- +;;; url-mailto.el --- Mail Uniform Resource Locator retrieval code -*- lexical-binding: t; -*- ;; Copyright (C) 1996-1999, 2004-2021 Free Software Foundation, Inc. diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el index 2b477dff0a3..87ca542f1c2 100644 --- a/lisp/vc/vc-dispatcher.el +++ b/lisp/vc/vc-dispatcher.el @@ -1,4 +1,4 @@ -;;; vc-dispatcher.el -- generic command-dispatcher facility. -*- lexical-binding: t -*- +;;; vc-dispatcher.el --- generic command-dispatcher facility. -*- lexical-binding: t -*- ;; Copyright (C) 2008-2021 Free Software Foundation, Inc. diff --git a/lisp/vc/vc-filewise.el b/lisp/vc/vc-filewise.el index e1b042a7424..254e47933d6 100644 --- a/lisp/vc/vc-filewise.el +++ b/lisp/vc/vc-filewise.el @@ -82,3 +82,5 @@ If the file is not registered, or the master name is not known, return nil." nil)))) ; Not registered (provide 'vc-filewise) + +;;; vc-filewise.el ends here diff --git a/test/lisp/autorevert-tests.el b/test/lisp/autorevert-tests.el index 5f27c2e38a6..3e97e9cfa5b 100644 --- a/test/lisp/autorevert-tests.el +++ b/test/lisp/autorevert-tests.el @@ -1,4 +1,4 @@ -;;; auto-revert-tests.el --- Tests of auto-revert -*- lexical-binding: t -*- +;;; autorevert-tests.el --- Tests of auto-revert -*- lexical-binding: t -*- ;; Copyright (C) 2015-2021 Free Software Foundation, Inc. diff --git a/test/lisp/calendar/icalendar-tests.el b/test/lisp/calendar/icalendar-tests.el index 61d3c11f6df..6973f7e5c95 100644 --- a/test/lisp/calendar/icalendar-tests.el +++ b/test/lisp/calendar/icalendar-tests.el @@ -1,4 +1,4 @@ -;; icalendar-tests.el --- Test suite for icalendar.el -*- lexical-binding:t -*- +;;; icalendar-tests.el --- Test suite for icalendar.el -*- lexical-binding:t -*- ;; Copyright (C) 2005, 2008-2021 Free Software Foundation, Inc. diff --git a/test/lisp/calendar/parse-time-tests.el b/test/lisp/calendar/parse-time-tests.el index b90fe0bd85b..b706b73570d 100644 --- a/test/lisp/calendar/parse-time-tests.el +++ b/test/lisp/calendar/parse-time-tests.el @@ -1,4 +1,4 @@ -;; parse-time-tests.el --- Test suite for parse-time.el -*- lexical-binding:t -*- +;;; parse-time-tests.el --- Test suite for parse-time.el -*- lexical-binding:t -*- ;; Copyright (C) 2016-2021 Free Software Foundation, Inc. diff --git a/test/lisp/cedet/srecode-utest-template.el b/test/lisp/cedet/srecode-utest-template.el index f97ff18320e..087dcfd8996 100644 --- a/test/lisp/cedet/srecode-utest-template.el +++ b/test/lisp/cedet/srecode-utest-template.el @@ -1,4 +1,4 @@ -;;; srecode/test.el --- SRecode Core Template tests. -*- lexical-binding:t -*- +;;; srecode-utest-template.el --- SRecode Core Template tests. -*- lexical-binding:t -*- ;; Copyright (C) 2008-2021 Free Software Foundation, Inc. diff --git a/test/lisp/custom-resources/custom--test-theme.el b/test/lisp/custom-resources/custom--test-theme.el index 4ced98a50bc..122bd795692 100644 --- a/test/lisp/custom-resources/custom--test-theme.el +++ b/test/lisp/custom-resources/custom--test-theme.el @@ -1,4 +1,4 @@ -;;; custom--test-theme.el -- A test theme. -*- lexical-binding:t -*- +;;; custom--test-theme.el --- A test theme. -*- lexical-binding:t -*- (deftheme custom--test "A test theme.") diff --git a/test/lisp/descr-text-tests.el b/test/lisp/descr-text-tests.el index 6ba455b50d4..2052dc0e38c 100644 --- a/test/lisp/descr-text-tests.el +++ b/test/lisp/descr-text-tests.el @@ -1,4 +1,4 @@ -;;; descr-text-test.el --- ERT tests for descr-text.el -*- lexical-binding: t -*- +;;; descr-text-tests.el --- ERT tests for descr-text.el -*- lexical-binding: t -*- ;; Copyright (C) 2014, 2016-2021 Free Software Foundation, Inc. diff --git a/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el b/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el index 285616a7806..9f9bb73133c 100644 --- a/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el +++ b/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el @@ -1,4 +1,4 @@ -;;; eieio-testsinvoke.el -- eieio tests for method invocation -*- lexical-binding:t -*- +;;; eieio-test-methodinvoke.el --- eieio tests for method invocation -*- lexical-binding:t -*- ;; Copyright (C) 2005, 2008, 2010, 2013-2021 Free Software Foundation, ;; Inc. diff --git a/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el b/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el index a47fb8053b9..11ffc115f7e 100644 --- a/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el +++ b/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el @@ -1,4 +1,4 @@ -;;; eieio-tests.el -- eieio test routines -*- lexical-binding: t -*- +;;; eieio-tests.el --- eieio test routines -*- lexical-binding: t -*- ;; Copyright (C) 1999-2003, 2005-2010, 2012-2021 Free Software ;; Foundation, Inc. diff --git a/test/lisp/eshell/em-hist-tests.el b/test/lisp/eshell/em-hist-tests.el index ec65397fd63..31967a61c3c 100644 --- a/test/lisp/eshell/em-hist-tests.el +++ b/test/lisp/eshell/em-hist-tests.el @@ -1,4 +1,4 @@ -;;; tests/em-hist-tests.el --- em-hist test suite -*- lexical-binding:t -*- +;;; em-hist-tests.el --- em-hist test suite -*- lexical-binding:t -*- ;; Copyright (C) 2017-2021 Free Software Foundation, Inc. diff --git a/test/lisp/eshell/em-ls-tests.el b/test/lisp/eshell/em-ls-tests.el index fc2cd9c8e14..5d1742b76fd 100644 --- a/test/lisp/eshell/em-ls-tests.el +++ b/test/lisp/eshell/em-ls-tests.el @@ -1,4 +1,4 @@ -;;; tests/em-ls-tests.el --- em-ls test suite -*- lexical-binding:t -*- +;;; em-ls-tests.el --- em-ls test suite -*- lexical-binding:t -*- ;; Copyright (C) 2017-2021 Free Software Foundation, Inc. diff --git a/test/lisp/eshell/esh-opt-tests.el b/test/lisp/eshell/esh-opt-tests.el index 0c99da64b2e..e2a0ea59d1c 100644 --- a/test/lisp/eshell/esh-opt-tests.el +++ b/test/lisp/eshell/esh-opt-tests.el @@ -1,4 +1,4 @@ -;;; tests/esh-opt-tests.el --- esh-opt test suite -*- lexical-binding:t -*- +;;; esh-opt-tests.el --- esh-opt test suite -*- lexical-binding:t -*- ;; Copyright (C) 2018-2021 Free Software Foundation, Inc. diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el index 4dac7024f41..4f0cc9b6785 100644 --- a/test/lisp/eshell/eshell-tests.el +++ b/test/lisp/eshell/eshell-tests.el @@ -1,4 +1,4 @@ -;;; tests/eshell-tests.el --- Eshell test suite -*- lexical-binding:t -*- +;;; eshell-tests.el --- Eshell test suite -*- lexical-binding:t -*- ;; Copyright (C) 1999-2021 Free Software Foundation, Inc. diff --git a/test/lisp/gnus/message-tests.el b/test/lisp/gnus/message-tests.el index 8650053b682..36ec8c51d15 100644 --- a/test/lisp/gnus/message-tests.el +++ b/test/lisp/gnus/message-tests.el @@ -1,4 +1,4 @@ -;;; message-mode-tests.el --- Tests for message-mode -*- lexical-binding: t; -*- +;;; message-tests.el --- Tests for message-mode -*- lexical-binding: t; -*- ;; Copyright (C) 2015-2021 Free Software Foundation, Inc. diff --git a/test/lisp/info-xref-tests.el b/test/lisp/info-xref-tests.el index 95af21fb591..ecba86146f1 100644 --- a/test/lisp/info-xref-tests.el +++ b/test/lisp/info-xref-tests.el @@ -1,4 +1,4 @@ -;;; info-xref.el --- tests for info-xref.el -*- lexical-binding:t -*- +;;; info-xref-tests.el --- tests for info-xref.el -*- lexical-binding:t -*- ;; Copyright (C) 2013-2021 Free Software Foundation, Inc. diff --git a/test/lisp/international/ucs-normalize-tests.el b/test/lisp/international/ucs-normalize-tests.el index a2da73767bc..51f4ed3a80e 100644 --- a/test/lisp/international/ucs-normalize-tests.el +++ b/test/lisp/international/ucs-normalize-tests.el @@ -1,4 +1,4 @@ -;;; ucs-normalize --- tests for international/ucs-normalize.el -*- lexical-binding: t -*- +;;; ucs-normalize-tests.el --- tests for international/ucs-normalize.el -*- lexical-binding: t -*- ;; Copyright (C) 2002-2021 Free Software Foundation, Inc. diff --git a/test/lisp/net/nsm-tests.el b/test/lisp/net/nsm-tests.el index ff453319b37..1a35ec34cb9 100644 --- a/test/lisp/net/nsm-tests.el +++ b/test/lisp/net/nsm-tests.el @@ -1,4 +1,4 @@ -;;; network-stream-tests.el --- tests for network security manager -*- lexical-binding: t; -*- +;;; nsm-tests.el --- tests for network security manager -*- lexical-binding: t; -*- ;; Copyright (C) 2019-2021 Free Software Foundation, Inc. diff --git a/test/lisp/net/shr-tests.el b/test/lisp/net/shr-tests.el index a06e31a4f88..ed532af657a 100644 --- a/test/lisp/net/shr-tests.el +++ b/test/lisp/net/shr-tests.el @@ -1,4 +1,4 @@ -;;; network-stream-tests.el --- tests for network processes -*- lexical-binding: t; -*- +;;; shr-tests.el --- tests for shr.el -*- lexical-binding: t; -*- ;; Copyright (C) 2016-2021 Free Software Foundation, Inc. diff --git a/test/lisp/play/cookie1-tests.el b/test/lisp/play/cookie1-tests.el index d63ecb972aa..75dea4e5ef0 100644 --- a/test/lisp/play/cookie1-tests.el +++ b/test/lisp/play/cookie1-tests.el @@ -1,4 +1,4 @@ -;;; fortune-tests.el --- Tests for fortune.el -*- lexical-binding: t -*- +;;; cookie1-tests.el --- Tests for cookie1.el -*- lexical-binding: t -*- ;; Copyright (C) 2021 Free Software Foundation, Inc. diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el index 14bc48b92fd..107b359dc32 100644 --- a/test/lisp/progmodes/cperl-mode-tests.el +++ b/test/lisp/progmodes/cperl-mode-tests.el @@ -1,4 +1,4 @@ -;;; cperl-mode-tests --- Test for cperl-mode -*- lexical-binding: t -*- +;;; cperl-mode-tests.el --- Test for cperl-mode -*- lexical-binding: t -*- ;; Copyright (C) 2020-2021 Free Software Foundation, Inc. diff --git a/test/lisp/progmodes/perl-mode-tests.el b/test/lisp/progmodes/perl-mode-tests.el index 9f6800ccd63..f63f8ad7253 100644 --- a/test/lisp/progmodes/perl-mode-tests.el +++ b/test/lisp/progmodes/perl-mode-tests.el @@ -1,4 +1,4 @@ -;;; perl-mode-tests --- Test for perl-mode -*- lexical-binding: t -*- +;;; perl-mode-tests.el --- Test for perl-mode -*- lexical-binding: t -*- ;; Copyright (C) 2020-2021 Free Software Foundation, Inc. diff --git a/test/lisp/simple-tests.el b/test/lisp/simple-tests.el index 601eca6cd49..4b153d117f0 100644 --- a/test/lisp/simple-tests.el +++ b/test/lisp/simple-tests.el @@ -1,4 +1,4 @@ -;;; simple-test.el --- Tests for simple.el -*- lexical-binding: t; -*- +;;; simple-tests.el --- Tests for simple.el -*- lexical-binding: t; -*- ;; Copyright (C) 2015-2021 Free Software Foundation, Inc. diff --git a/test/lisp/textmodes/fill-tests.el b/test/lisp/textmodes/fill-tests.el index 21efe620999..a4c7f447b59 100644 --- a/test/lisp/textmodes/fill-tests.el +++ b/test/lisp/textmodes/fill-tests.el @@ -1,4 +1,4 @@ -;;; fill-test.el --- ERT tests for fill.el -*- lexical-binding: t -*- +;;; fill-tests.el --- ERT tests for fill.el -*- lexical-binding: t -*- ;; Copyright (C) 2017-2021 Free Software Foundation, Inc. diff --git a/test/lisp/textmodes/tildify-tests.el b/test/lisp/textmodes/tildify-tests.el index 59c23943304..3ee3cd6fb17 100644 --- a/test/lisp/textmodes/tildify-tests.el +++ b/test/lisp/textmodes/tildify-tests.el @@ -1,4 +1,4 @@ -;;; tildify-test.el --- ERT tests for tildify.el -*- lexical-binding: t -*- +;;; tildify-tests.el --- ERT tests for tildify.el -*- lexical-binding: t -*- ;; Copyright (C) 2014-2021 Free Software Foundation, Inc. diff --git a/test/lisp/thingatpt-tests.el b/test/lisp/thingatpt-tests.el index 62a27f09cbd..07eb8bb250e 100644 --- a/test/lisp/thingatpt-tests.el +++ b/test/lisp/thingatpt-tests.el @@ -1,4 +1,4 @@ -;;; thingatpt.el --- tests for thing-at-point. -*- lexical-binding:t -*- +;;; thingatpt-tests.el --- tests for thing-at-point. -*- lexical-binding:t -*- ;; Copyright (C) 2013-2021 Free Software Foundation, Inc. diff --git a/test/lisp/vc/vc-bzr-tests.el b/test/lisp/vc/vc-bzr-tests.el index aeab51ec261..b02dce8f707 100644 --- a/test/lisp/vc/vc-bzr-tests.el +++ b/test/lisp/vc/vc-bzr-tests.el @@ -1,4 +1,4 @@ -;;; vc-bzr.el --- tests for vc/vc-bzr.el -*- lexical-binding: t -*- +;;; vc-bzr-tests.el --- tests for vc/vc-bzr.el -*- lexical-binding: t -*- ;; Copyright (C) 2011-2021 Free Software Foundation, Inc. diff --git a/test/lisp/xml-tests.el b/test/lisp/xml-tests.el index cd3e1138f4b..b00b58acfc5 100644 --- a/test/lisp/xml-tests.el +++ b/test/lisp/xml-tests.el @@ -1,4 +1,4 @@ -;;; xml-parse-tests.el --- Test suite for XML parsing. -*- lexical-binding:t -*- +;;; xml-tests.el --- Test suite for XML parsing. -*- lexical-binding:t -*- ;; Copyright (C) 2012-2021 Free Software Foundation, Inc. diff --git a/test/manual/cedet/semantic-tests.el b/test/manual/cedet/semantic-tests.el index 7169c78bea0..1561c18dd68 100644 --- a/test/manual/cedet/semantic-tests.el +++ b/test/manual/cedet/semantic-tests.el @@ -1,4 +1,4 @@ -;;; semantic-utest.el --- Miscellaneous Semantic tests. -*- lexical-binding: t; -*- +;;; semantic-tests.el --- Miscellaneous Semantic tests. -*- lexical-binding: t; -*- ;; Copyright (C) 2003-2021 Free Software Foundation, Inc. diff --git a/test/manual/image-size-tests.el b/test/manual/image-size-tests.el index f7c2bf7fc0d..44846a7a67a 100644 --- a/test/manual/image-size-tests.el +++ b/test/manual/image-size-tests.el @@ -1,4 +1,4 @@ -;;; image-size-tests.el -- tests for image scaling -*- lexical-binding: t; -*- +;;; image-size-tests.el --- tests for image scaling -*- lexical-binding: t; -*- ;; Copyright (C) 2017-2021 Free Software Foundation, Inc. diff --git a/test/manual/image-transforms-tests.el b/test/manual/image-transforms-tests.el index 5342b5edcae..debb74f2edb 100644 --- a/test/manual/image-transforms-tests.el +++ b/test/manual/image-transforms-tests.el @@ -1,4 +1,4 @@ -;;; image-transform-tests.el --- Test suite for image transforms. -*- lexical-binding: t -*- +;;; image-transforms-tests.el --- Test suite for image transforms. -*- lexical-binding: t -*- ;; Copyright (C) 2019-2021 Free Software Foundation, Inc. diff --git a/test/manual/scroll-tests.el b/test/manual/scroll-tests.el index 2f40b2bb696..dd15d54fa88 100644 --- a/test/manual/scroll-tests.el +++ b/test/manual/scroll-tests.el @@ -1,4 +1,4 @@ -;;; scroll-tests.el -- tests for scrolling -*- lexical-binding: t -*- +;;; scroll-tests.el --- tests for scrolling -*- lexical-binding: t -*- ;; Copyright (C) 2017-2021 Free Software Foundation, Inc. diff --git a/test/misc/test-custom-noloads.el b/test/misc/test-custom-noloads.el index 6fa6a6c90d7..5e95e7d7740 100644 --- a/test/misc/test-custom-noloads.el +++ b/test/misc/test-custom-noloads.el @@ -1,4 +1,4 @@ -;;; test-custom-deps.el --- Test custom noloads -*- lexical-binding:t -*- +;;; test-custom-noloads.el --- Test custom noloads -*- lexical-binding:t -*- ;; Copyright (C) 2021 Free Software Foundation, Inc. @@ -42,4 +42,4 @@ (cus-test-noloads) (should-not cus-test-vars-not-cus-loaded)) -;;; test-custom-deps.el ends here +;;; test-custom-noloads.el ends here diff --git a/test/src/character-tests.el b/test/src/character-tests.el index 10fc4dbf353..f630b32a5ee 100644 --- a/test/src/character-tests.el +++ b/test/src/character-tests.el @@ -1,4 +1,4 @@ -;;; character-tests.el -- tests for character.c -*- lexical-binding:t -*- +;;; character-tests.el --- tests for character.c -*- lexical-binding:t -*- ;; Copyright (C) 2021 Free Software Foundation, Inc. diff --git a/test/src/editfns-tests.el b/test/src/editfns-tests.el index ea80da4819c..a731a95ccf0 100644 --- a/test/src/editfns-tests.el +++ b/test/src/editfns-tests.el @@ -1,4 +1,4 @@ -;;; editfns-tests.el -- tests for editfns.c -*- lexical-binding:t -*- +;;; editfns-tests.el --- tests for editfns.c -*- lexical-binding:t -*- ;; Copyright (C) 2016-2021 Free Software Foundation, Inc. diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el index af5bc2a0baf..0a68d51e3eb 100644 --- a/test/src/emacs-module-tests.el +++ b/test/src/emacs-module-tests.el @@ -1,4 +1,4 @@ -;;; emacs-module-tests --- Test GNU Emacs modules. -*- lexical-binding: t; -*- +;;; emacs-module-tests.el --- Test GNU Emacs modules. -*- lexical-binding: t; -*- ;; Copyright 2015-2021 Free Software Foundation, Inc. diff --git a/test/src/fileio-tests.el b/test/src/fileio-tests.el index 7f193d4eeab..b989c97fe6b 100644 --- a/test/src/fileio-tests.el +++ b/test/src/fileio-tests.el @@ -1,4 +1,4 @@ -;;; unit tests for src/fileio.c -*- lexical-binding: t; -*- +;;; fileio-tests.el --- unit tests for src/fileio.c -*- lexical-binding: t; -*- ;; Copyright 2017-2021 Free Software Foundation, Inc. diff --git a/test/src/thread-tests.el b/test/src/thread-tests.el index 0e1ca76fd9c..fc7bc7441b7 100644 --- a/test/src/thread-tests.el +++ b/test/src/thread-tests.el @@ -1,4 +1,4 @@ -;;; threads.el --- tests for threads. -*- lexical-binding: t -*- +;;; thread-tests.el --- tests for threads. -*- lexical-binding: t -*- ;; Copyright (C) 2012-2021 Free Software Foundation, Inc. diff --git a/test/src/timefns-tests.el b/test/src/timefns-tests.el index e55bd1eb4ee..0a450a7573f 100644 --- a/test/src/timefns-tests.el +++ b/test/src/timefns-tests.el @@ -1,4 +1,4 @@ -;;; timefns-tests.el -- tests for timefns.c -*- lexical-binding: t -*- +;;; timefns-tests.el --- tests for timefns.c -*- lexical-binding: t -*- ;; Copyright (C) 2016-2021 Free Software Foundation, Inc. -- cgit v1.2.3 From cecfbf076e4862555409cb9caa3db832316c16b4 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 21 Apr 2021 18:19:46 +0200 Subject: Improve error message for missing Info manual * lisp/info.el (Info-find-file): Improve error message for missing Info manual. (Bug#46236) Fix suggested by Eli Zaretskii . --- lisp/info.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lisp/info.el') diff --git a/lisp/info.el b/lisp/info.el index 5efac6f25f1..82f0eb37ae9 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -916,7 +916,8 @@ find a node." (when (and (not no-pop-to-dir) (not Info-current-file)) (Info-directory)) - (user-error "Info file %s does not exist" filename))) + (user-error "Info file `%s' does not exist; consider installing it" + filename))) filename)))) (defun Info-find-node (filename nodename &optional no-going-back strict-case) -- cgit v1.2.3 From a9f4ee3d3d69a91fde905684e5e9838a18ab855c Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Wed, 5 May 2021 16:58:35 +0200 Subject: Don't bug out in `Info-goto-node' completion * lisp/info.el (Info-read-node-name-1): Don't bug out in the middle of completion, but return nil instead (and issue a message) (bug#47771). --- lisp/info.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lisp/info.el') diff --git a/lisp/info.el b/lisp/info.el index 82f0eb37ae9..67d27c78988 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -1855,7 +1855,8 @@ See `completing-read' for a description of arguments and usage." (lambda (string pred action) (complete-with-action action - (Info-build-node-completions (Info-find-file file1 nil t)) + (when-let ((file2 (Info-find-file file1 'noerror t))) + (Info-build-node-completions file2)) string pred)) nodename predicate code)))) ;; Otherwise use Info-read-node-completion-table. -- cgit v1.2.3 From f0648fef35e1923f477aef44b2d75e41e3d15d92 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 6 May 2021 11:24:39 +0200 Subject: Make Info completion more robust * lisp/info.el (Info-build-node-completions): Don't signal an error if there are no nodes in the file we're computing completions over (bug#47771). --- lisp/info.el | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'lisp/info.el') diff --git a/lisp/info.el b/lisp/info.el index 67d27c78988..2757ed57826 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -1882,10 +1882,17 @@ the Top node in FILENAME." (or (cdr (assoc filename Info-file-completions)) (with-temp-buffer (Info-mode) - (Info-goto-node (format "(%s)Top" filename)) - (Info-build-node-completions-1) - (push (cons filename Info-current-file-completions) Info-file-completions) - Info-current-file-completions)) + (condition-case nil + (Info-goto-node (format "(%s)Top" filename)) + ;; `Info-goto-node' signals a `user-error' when there + ;; are no nodes in the file in question (for instance, + ;; if it's not actually an Info file). + (user-error nil) + (:success + (Info-build-node-completions-1) + (push (cons filename Info-current-file-completions) + Info-file-completions) + Info-current-file-completions)))) (or Info-current-file-completions (Info-build-node-completions-1)))) -- cgit v1.2.3 From de4dcd8d108ac8f7855d55c7ba0ae4a10c853633 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 18 May 2021 18:13:28 -0400 Subject: * lisp/info.el (Info-isearch-push-state): Use proper closures --- lisp/info.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lisp/info.el') diff --git a/lisp/info.el b/lisp/info.el index 2757ed57826..cdf339ff6fb 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -2148,8 +2148,10 @@ If DIRECTION is `backward', search in the reverse direction." (goto-char (if isearch-forward (point-min) (point-max))))) (defun Info-isearch-push-state () - `(lambda (cmd) - (Info-isearch-pop-state cmd ',Info-current-file ',Info-current-node))) + (let ((file Info-current-file) + (node Info-current-node)) + (lambda (cmd) + (Info-isearch-pop-state cmd file node)))) (defun Info-isearch-pop-state (_cmd file node) (or (and (equal Info-current-file file) -- cgit v1.2.3 From 089e0c4c55dcf72f9cf2f6f04b8a52fc7355499c Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 3 Jun 2021 11:55:45 +0200 Subject: Make the `i' command in Info-mode remove duplicate matches * lisp/info.el (Info-index): Weed out duplicate matched (bug#3692). --- lisp/info.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lisp/info.el') diff --git a/lisp/info.el b/lisp/info.el index cdf339ff6fb..83a9bfbc235 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -3375,7 +3375,13 @@ Give an empty topic name to go to the Index node itself." (setq exact (cons found exact) matches (delq found matches))) (setq Info-history-list ohist-list) - (setq Info-index-alternatives (nconc exact (nreverse matches))) + (setq Info-index-alternatives + ;; Weed out index entries that refer to the same line. + (seq-uniq + (nconc exact (nreverse matches)) + (lambda (m1 m2) + (and (equal (nth 1 m1) (nth 1 m2)) + (equal (nth 3 m1) (nth 3 m2)))))) (Info-index-next 0))))) (defun Info-index-next (num) -- cgit v1.2.3 From 6d1d048d65d35c217e9d505ebe3e76a202553c97 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 4 Jun 2021 10:48:16 +0200 Subject: Revert "Make the `i' command in Info-mode remove duplicate matches" This reverts commit 089e0c4c55dcf72f9cf2f6f04b8a52fc7355499c. There were no duplicate entries -- there were two entries for different things that referred to the same line. --- lisp/info.el | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'lisp/info.el') diff --git a/lisp/info.el b/lisp/info.el index 83a9bfbc235..cdf339ff6fb 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -3375,13 +3375,7 @@ Give an empty topic name to go to the Index node itself." (setq exact (cons found exact) matches (delq found matches))) (setq Info-history-list ohist-list) - (setq Info-index-alternatives - ;; Weed out index entries that refer to the same line. - (seq-uniq - (nconc exact (nreverse matches)) - (lambda (m1 m2) - (and (equal (nth 1 m1) (nth 1 m2)) - (equal (nth 3 m1) (nth 3 m2)))))) + (setq Info-index-alternatives (nconc exact (nreverse matches))) (Info-index-next 0))))) (defun Info-index-next (num) -- cgit v1.2.3 From 69f1bd38f0628503dac935b2b38dca430d80266b Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 6 Jul 2021 18:56:51 +0200 Subject: Warn when wrapping index matches with `,' after `i' in Info * lisp/info.el (Info--current-index-alternative): New internal variable. (Info-warn-on-index-alternatives-wrap): New user option (bug#24282). (Info-index-next): Use the new user option. --- etc/NEWS | 10 ++++++++ lisp/info.el | 83 +++++++++++++++++++++++++++++++++++++++--------------------- 2 files changed, 64 insertions(+), 29 deletions(-) (limited to 'lisp/info.el') diff --git a/etc/NEWS b/etc/NEWS index b1ab6941d03..7bf8c1d8f56 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1185,6 +1185,16 @@ can provide a better overview in a long list of available bindings. In previous Emacs versions, the "*Help*" buffer was killed instead when clicking the "X" icon in the tool bar. +** Info + +--- +*** New user option 'Info-warn-on-index-alternatives-wrap'. +This option affects what happens when using the ',' command after +looking up an entry with 'i' in info buffers. If non-nil (the +default), the ',' command will now warn you when proceeding beyond the +final entry, and tapping ',' once more will then take you to the +first entry. + +++ ** New command 'lossage-size'. It allows users to set the maximum number of keystrokes and commands diff --git a/lisp/info.el b/lisp/info.el index cdf339ff6fb..b65728ba41b 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -391,6 +391,14 @@ where SUPPORTS-INDEX-COOKIES can be either t or nil.") (defvar-local Info-index-alternatives nil "List of possible matches for last `Info-index' command.") +(defvar-local Info--current-index-alternative 0 + "Current displayed index alternative.") + +(defcustom Info-warn-on-index-alternatives-wrap t + "Warn when wrapping to the beginning/end when displaying index alternatives." + :type 'boolean + :version "28.1") + (defvar Info-point-loc nil "Point location within a selected node. If string, the point is moved to the proper occurrence of the @@ -3375,39 +3383,56 @@ Give an empty topic name to go to the Index node itself." (setq exact (cons found exact) matches (delq found matches))) (setq Info-history-list ohist-list) - (setq Info-index-alternatives (nconc exact (nreverse matches))) + (setq Info-index-alternatives (nconc exact (nreverse matches)) + Info--current-index-alternative 0) (Info-index-next 0))))) (defun Info-index-next (num) - "Go to the next matching index item from the last \\\\[Info-index] command." + "Go to the next matching index item from the last \\\\[Info-index] command. +If given a numeric prefix, skip that many index items forward (or +backward). + +Also see the `Info-warn-on-index-alternatives-wrap' user option." (interactive "p" Info-mode) - (or Info-index-alternatives - (user-error "No previous `i' command")) - (while (< num 0) - (setq num (+ num (length Info-index-alternatives)))) - (while (> num 0) - (setq Info-index-alternatives - (nconc (cdr Info-index-alternatives) - (list (car Info-index-alternatives))) - num (1- num))) - (Info-goto-node (nth 1 (car Info-index-alternatives))) - (if (> (nth 3 (car Info-index-alternatives)) 0) - ;; Forward 2 lines less because `Info-find-node-2' initially - ;; puts point to the 2nd line. - (forward-line (- (nth 3 (car Info-index-alternatives)) 2)) - (forward-line 3) ; don't search in headers - (let ((name (car (car Info-index-alternatives)))) - (Info-find-index-name name))) - (message "Found `%s' in %s. %s" - (car (car Info-index-alternatives)) - (nth 2 (car Info-index-alternatives)) - (if (cdr Info-index-alternatives) - (format-message - "(%s total; use `%s' for next)" - (length Info-index-alternatives) - (key-description (where-is-internal - 'Info-index-next overriding-local-map t))) - "(Only match)"))) + (unless Info-index-alternatives + (user-error "No previous `i' command")) + (let ((index (+ Info--current-index-alternative num)) + (total (length Info-index-alternatives)) + (next-key (key-description (where-is-internal + 'Info-index-next overriding-local-map t)))) + (if (and Info-warn-on-index-alternatives-wrap + (> total 1) + (cond + ((< index 0) + (setq Info--current-index-alternative (- total 2)) + (message + "No previous matches, use `%s' to continue from end of list" + next-key) + t) + ((>= index total) + (setq Info--current-index-alternative -1) + (message + "No previous matches, use `%s' to continue from start of list" + next-key) + t))) + () ; Do nothing + (setq index (mod index total) + Info--current-index-alternative index) + (let ((entry (nth index Info-index-alternatives))) + (Info-goto-node (nth 1 entry)) + (if (> (nth 3 entry) 0) + ;; Forward 2 lines less because `Info-find-node-2' initially + ;; puts point to the 2nd line. + (forward-line (- (nth 3 entry) 2)) + (forward-line 3) ; don't search in headers + (Info-find-index-name (car entry))) + (message "Found `%s' in %s. %s" + (car entry) + (nth 2 entry) + (if (> total 1) + (format-message + "(%s total; use `%s' for next)" total next-key) + "(Only match)")))))) (defun Info-find-index-name (name) "Move point to the place within the current node where NAME is defined." -- cgit v1.2.3 From 292e6261be8d4b7b08f87e70eb8490e31b3e9a4f Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Tue, 20 Jul 2021 23:48:43 +0300 Subject: Add new mode context-menu-mode and use it in info.el and goto-addr.el * lisp/mouse.el (context-menu-functions): New defcustom. (context-menu-overriding-function): New function. (context-menu-filter-function): New defcustom. (context-menu-map): New function. (context-menu-undo, context-menu-region): New menu functions. (context-menu-mode): New mode. * lisp/info.el (Info-context-menu): New function. (Info-mode): Add Info-context-menu to context-menu-functions. * lisp/net/goto-addr.el (goto-address-context-menu): New function. (goto-address-at-click): New command. (goto-address-mode): Add goto-address-context-menu to context-menu-functions. --- lisp/info.el | 32 ++++++++++++++ lisp/mouse.el | 118 ++++++++++++++++++++++++++++++++++++++++++++++++++ lisp/net/goto-addr.el | 23 ++++++++-- 3 files changed, 170 insertions(+), 3 deletions(-) (limited to 'lisp/info.el') diff --git a/lisp/info.el b/lisp/info.el index b65728ba41b..226ec76eb67 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -4146,6 +4146,37 @@ If FORK is non-nil, it is passed to `Info-goto-node'." "---" ["Exit" quit-window :help "Stop reading Info"])) +(defun Info-context-menu (menu) + (when (mouse-posn-property (event-start last-input-event) 'mouse-face) + (bindings--define-key menu [Info-mouse-follow-nearest-node] + '(menu-item "Follow link" Info-mouse-follow-nearest-node + :help "Follow a link where you click"))) + + (bindings--define-key menu [Info-history-back] + '(menu-item "Back in history" Info-history-back :visible Info-history + :help "Go back in history to the last node you were at")) + (bindings--define-key menu [Info-history-forward] + '(menu-item "Forward in history" Info-history-forward :visible Info-history-forward + :help "Go forward in history")) + + (bindings--define-key menu [Info-up] + '(menu-item "Up" Info-up :visible (Info-check-pointer "up") + :help "Go up in the Info tree")) + (bindings--define-key menu [Info-next] + '(menu-item "Next" Info-next :visible (Info-check-pointer "next") + :help "Go to the next node")) + (bindings--define-key menu [Info-prev] + '(menu-item "Previous" Info-prev :visible (Info-check-pointer "prev[ious]*") + :help "Go to the previous node")) + (bindings--define-key menu [Info-backward-node] + '(menu-item "Backward" Info-backward-node + :help "Go backward one node, considering all as a sequence")) + (bindings--define-key menu [Info-forward-node] + '(menu-item "Forward" Info-forward-node + :help "Go forward one node, considering all as a sequence")) + + (define-key menu [Info-separator] menu-bar-separator) + menu) (defvar info-tool-bar-map (let ((map (make-sparse-keymap))) @@ -4446,6 +4477,7 @@ Advanced commands: (add-hook 'clone-buffer-hook 'Info-clone-buffer nil t) (add-hook 'change-major-mode-hook 'font-lock-defontify nil t) (add-hook 'isearch-mode-hook 'Info-isearch-start nil t) + (add-hook 'context-menu-functions 'Info-context-menu nil t) (when Info-standalone (add-hook 'quit-window-hook 'save-buffers-kill-emacs nil t)) (setq-local isearch-search-fun-function #'Info-isearch-search) diff --git a/lisp/mouse.el b/lisp/mouse.el index 89e5d7c48a3..580fe8eb352 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -276,6 +276,124 @@ not it is actually displayed." local-menu minor-mode-menus))) + +;; Context menus. + +(defcustom context-menu-functions '(context-menu-undo context-menu-region) + "List of functions that produce the contents of the context menu." + :type 'hook + :version "28.1") + +(defvar context-menu-overriding-function nil + "Function that can override the list produced by `context-menu-functions'.") + +(defcustom context-menu-filter-function nil + "Function that can filter the list produced by `context-menu-functions'." + :type 'function + :version "28.1") + +(defun context-menu-map () + (let ((menu (make-sparse-keymap "Context Menu"))) + (if (functionp context-menu-overriding-function) + (setq menu (funcall context-menu-overriding-function menu)) + (run-hook-wrapped 'context-menu-functions + (lambda (fun) + (setq menu (funcall fun menu)) + nil))) + (setq menu (cons (car menu) (nreverse (cdr menu)))) + (when (functionp context-menu-filter-function) + (setq menu (funcall context-menu-filter-function menu))) + menu)) + +(defun context-menu-undo (menu) + (bindings--define-key menu [undo] + '(menu-item "Undo" undo + :visible (and (not buffer-read-only) + (not (eq t buffer-undo-list)) + (if (eq last-command 'undo) + (listp pending-undo-list) + (consp buffer-undo-list))) + :help "Undo last edits")) + (bindings--define-key menu [undo-redo] + '(menu-item "Redo" undo-redo + :visible (and (not buffer-read-only) + (undo--last-change-was-undo-p buffer-undo-list)) + :help "Redo last undone edits")) + menu) + +(defun context-menu-region (menu) + (bindings--define-key menu [cut] + '(menu-item "Cut" kill-region + :visible (and mark-active (not buffer-read-only)) + :help + "Cut (kill) text in region between mark and current position")) + (bindings--define-key menu [copy] + ;; ns-win.el said: Substitute a Copy function that works better + ;; under X (for GNUstep). + `(menu-item "Copy" ,(if (featurep 'ns) + 'ns-copy-including-secondary + 'kill-ring-save) + :visible mark-active + :help "Copy text in region between mark and current position" + :keys ,(if (featurep 'ns) + "\\[ns-copy-including-secondary]" + "\\[kill-ring-save]"))) + (bindings--define-key menu [paste] + `(menu-item "Paste" mouse-yank-primary + :visible (funcall + ',(lambda () + (and (or + (gui-backend-selection-exists-p 'CLIPBOARD) + (if (featurep 'ns) ; like paste-from-menu + (cdr yank-menu) + kill-ring)) + (not buffer-read-only)))) + :help "Paste (yank) text most recently cut/copied")) + (bindings--define-key menu (if (featurep 'ns) [select-paste] + [paste-from-menu]) + ;; ns-win.el said: Change text to be more consistent with + ;; surrounding menu items `paste', etc." + `(menu-item ,(if (featurep 'ns) "Select and Paste" "Paste from Kill Menu") + yank-menu + :visible (and (cdr yank-menu) (not buffer-read-only)) + :help "Choose a string from the kill ring and paste it")) + (bindings--define-key menu [clear] + '(menu-item "Clear" delete-active-region + :visible (and mark-active + (not buffer-read-only)) + :help + "Delete the text in region between mark and current position")) + (bindings--define-key menu [mark-whole-buffer] + '(menu-item "Select All" mark-whole-buffer + :help "Mark the whole buffer for a subsequent cut/copy")) + menu) + +(defvar context-menu--old-down-mouse-3 nil) +(defvar context-menu--old-mouse-3 nil) + +(define-minor-mode context-menu-mode + "Toggle Context Menu mode. + +When Context Menu mode is enabled, clicking the mouse button down-mouse-3 +activates the menu whose contents depends on its surrounding context." + :global t :group 'mouse + (cond + (context-menu-mode + (setq context-menu--old-mouse-3 (global-key-binding [mouse-3])) + (global-unset-key [mouse-3]) + (setq context-menu--old-down-mouse-3 (global-key-binding [down-mouse-3])) + (global-set-key [down-mouse-3] + '(menu-item "Context Menu" ignore + :filter (lambda (_) (context-menu-map))))) + (t + (if (not context-menu--old-down-mouse-3) + (global-unset-key [down-mouse-3]) + (global-set-key [down-mouse-3] context-menu--old-down-mouse-3) + (setq context-menu--old-down-mouse-3 nil)) + (when context-menu--old-mouse-3 + (global-set-key [mouse-3] context-menu--old-mouse-3) + (setq context-menu--old-mouse-3 nil))))) + ;; Commands that operate on windows. diff --git a/lisp/net/goto-addr.el b/lisp/net/goto-addr.el index 8992ef736a6..1e8a3cda157 100644 --- a/lisp/net/goto-addr.el +++ b/lisp/net/goto-addr.el @@ -124,6 +124,14 @@ will have no effect.") m) "Keymap to hold goto-addr's mouse key defs under highlighted URLs.") +(defun goto-address-context-menu (menu) + (when (mouse-posn-property (event-start last-input-event) 'goto-address) + (bindings--define-key menu [goto-address-at-click] + '(menu-item "Follow link" goto-address-at-click + :help "Follow a link where you click")) + (define-key menu [goto-address-separator] menu-bar-separator)) + menu) + (defcustom goto-address-url-face 'link "Face to use for URLs." :type 'face) @@ -245,6 +253,11 @@ address. If no e-mail address found, return nil." (goto-char (match-beginning 0)))) (match-string-no-properties 0))) +(defun goto-address-at-click (click) + "Send to the e-mail address or load the URL at click." + (interactive "e") + (goto-address-at-point click)) + ;;;###autoload (defun goto-address () "Sets up goto-address functionality in the current buffer. @@ -264,12 +277,16 @@ Also fontifies the buffer appropriately (see `goto-address-fontify-p' and (define-minor-mode goto-address-mode "Minor mode to buttonize URLs and e-mail addresses in the current buffer." :lighter "" - (if goto-address-mode - (jit-lock-register #'goto-address-fontify-region) + (cond + (goto-address-mode + (jit-lock-register #'goto-address-fontify-region) + (add-hook 'context-menu-functions 'goto-address-context-menu -10 t)) + (t (jit-lock-unregister #'goto-address-fontify-region) (save-restriction (widen) - (goto-address-unfontify (point-min) (point-max))))) + (goto-address-unfontify (point-min) (point-max))) + (remove-hook 'context-menu-functions 'goto-address-context-menu t)))) (defun goto-addr-mode--turn-on () (when (not goto-address-mode) -- cgit v1.2.3 From 1493145e3048e057d8ac9e8c9c56d1f99a97eb53 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 21 Jul 2021 21:40:11 +0300 Subject: Change the order of context-menu-functions and add more context menus. * lisp/mouse.el (context-menu-functions): Update default list. (context-menu-overriding-function): Remove variable. (context-menu-map): Reverse the order. (context-menu-global, context-menu-local, context-menu-minor): New functions. (context-menu-undo, context-menu-region): Add separators. Use define-key-after instead of bindings--define-key. (context-menu-entry): New variable. (context-menu-mode): Use it. * lisp/dired.el (dired-context-menu): New function. (dired-mode): Add it to context-menu-functions. * lisp/info.el (Info-context-menu): Reorder. * lisp/net/goto-addr.el (goto-address-at-mouse): Rename from goto-address-at-click. (goto-address-context-menu): Use goto-address-at-mouse. * lisp/progmodes/prog-mode.el (prog-context-menu): New function. (prog-mode): Add it to context-menu-functions. --- lisp/dired.el | 17 ++++++++ lisp/info.el | 53 +++++++++++-------------- lisp/mouse.el | 94 ++++++++++++++++++++++++++++++++++----------- lisp/net/goto-addr.el | 14 +++---- lisp/progmodes/prog-mode.el | 17 ++++++++ 5 files changed, 134 insertions(+), 61 deletions(-) (limited to 'lisp/info.el') diff --git a/lisp/dired.el b/lisp/dired.el index 28448be06ce..5e44f524f6b 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2194,6 +2194,22 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST." ["Delete Image Tag..." image-dired-delete-tag :help "Delete image tag from current or marked files"])) +(defun dired-context-menu (menu) + (when (mouse-posn-property (event-start last-input-event) 'dired-filename) + (define-key menu [dired-separator-1] menu-bar-separator) + (let ((easy-menu (make-sparse-keymap "Immediate"))) + (easy-menu-define nil easy-menu nil + '("Immediate" + ["Find This File" dired-mouse-find-file + :help "Edit file at mouse click"] + ["Find in Other Window" dired-mouse-find-file-other-window + :help "Edit file at mouse click in other window"])) + (dolist (item (reverse (lookup-key easy-menu [menu-bar immediate]))) + (when (consp item) + (define-key menu (vector (car item)) (cdr item))))) + (define-key menu [dired-separator-2] menu-bar-separator)) + menu) + ;;; Dired mode @@ -2293,6 +2309,7 @@ Keybindings: (append dired-dnd-protocol-alist dnd-protocol-alist))) (add-hook 'file-name-at-point-functions #'dired-file-name-at-point nil t) (add-hook 'isearch-mode-hook #'dired-isearch-filenames-setup nil t) + (add-hook 'context-menu-functions 'dired-context-menu 5 t) (run-mode-hooks 'dired-mode-hook)) diff --git a/lisp/info.el b/lisp/info.el index 226ec76eb67..a8848a94758 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -4117,9 +4117,9 @@ If FORK is non-nil, it is passed to `Info-goto-node'." :help "Search for another occurrence of regular expression"] "---" ("History" - ["Back in history" Info-history-back :active Info-history + ["Back in History" Info-history-back :active Info-history :help "Go back in history to the last node you were at"] - ["Forward in history" Info-history-forward :active Info-history-forward + ["Forward in History" Info-history-forward :active Info-history-forward :help "Go forward in history"] ["Show History" Info-history :active Info-history-list :help "Go to menu of visited nodes"]) @@ -4148,34 +4148,25 @@ If FORK is non-nil, it is passed to `Info-goto-node'." (defun Info-context-menu (menu) (when (mouse-posn-property (event-start last-input-event) 'mouse-face) - (bindings--define-key menu [Info-mouse-follow-nearest-node] - '(menu-item "Follow link" Info-mouse-follow-nearest-node - :help "Follow a link where you click"))) - - (bindings--define-key menu [Info-history-back] - '(menu-item "Back in history" Info-history-back :visible Info-history - :help "Go back in history to the last node you were at")) - (bindings--define-key menu [Info-history-forward] - '(menu-item "Forward in history" Info-history-forward :visible Info-history-forward - :help "Go forward in history")) - - (bindings--define-key menu [Info-up] - '(menu-item "Up" Info-up :visible (Info-check-pointer "up") - :help "Go up in the Info tree")) - (bindings--define-key menu [Info-next] - '(menu-item "Next" Info-next :visible (Info-check-pointer "next") - :help "Go to the next node")) - (bindings--define-key menu [Info-prev] - '(menu-item "Previous" Info-prev :visible (Info-check-pointer "prev[ious]*") - :help "Go to the previous node")) - (bindings--define-key menu [Info-backward-node] - '(menu-item "Backward" Info-backward-node - :help "Go backward one node, considering all as a sequence")) - (bindings--define-key menu [Info-forward-node] - '(menu-item "Forward" Info-forward-node - :help "Go forward one node, considering all as a sequence")) - - (define-key menu [Info-separator] menu-bar-separator) + (define-key menu [Info-separator-link-1] menu-bar-separator) + (define-key menu [Info-mouse-follow-nearest-node] + '(menu-item "Follow Link" Info-mouse-follow-nearest-node + :help "Follow a link where you click")) + (define-key menu [Info-separator-link-2] menu-bar-separator)) + + (define-key-after menu [Info-separator-1] menu-bar-separator) + (let ((easy-menu (make-sparse-keymap "Info"))) + (easy-menu-define nil easy-menu nil + '("Info" + ["Back in History" Info-history-back :visible Info-history + :help "Go back in history to the last node you were at"] + ["Forward in History" Info-history-forward :visible Info-history-forward + :help "Go forward in history"])) + (dolist (item (lookup-key easy-menu [menu-bar info])) + (when (consp item) + (define-key-after menu (vector (car item)) (cdr item))))) + (define-key-after menu [Info-separator-2] menu-bar-separator) + menu) (defvar info-tool-bar-map @@ -4477,7 +4468,7 @@ Advanced commands: (add-hook 'clone-buffer-hook 'Info-clone-buffer nil t) (add-hook 'change-major-mode-hook 'font-lock-defontify nil t) (add-hook 'isearch-mode-hook 'Info-isearch-start nil t) - (add-hook 'context-menu-functions 'Info-context-menu nil t) + (add-hook 'context-menu-functions 'Info-context-menu 5 t) (when Info-standalone (add-hook 'quit-window-hook 'save-buffers-kill-emacs nil t)) (setq-local isearch-search-fun-function #'Info-isearch-search) diff --git a/lisp/mouse.el b/lisp/mouse.el index 580fe8eb352..7a564f989c2 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -279,34 +279,77 @@ not it is actually displayed." ;; Context menus. -(defcustom context-menu-functions '(context-menu-undo context-menu-region) +(defcustom context-menu-functions '(context-menu-undo + context-menu-region + context-menu-local + context-menu-minor) "List of functions that produce the contents of the context menu." :type 'hook + :options '(context-menu-undo + context-menu-region + context-menu-global + context-menu-local + context-menu-minor) :version "28.1") -(defvar context-menu-overriding-function nil - "Function that can override the list produced by `context-menu-functions'.") - (defcustom context-menu-filter-function nil "Function that can filter the list produced by `context-menu-functions'." :type 'function :version "28.1") (defun context-menu-map () + "Return composite menu map." (let ((menu (make-sparse-keymap "Context Menu"))) - (if (functionp context-menu-overriding-function) - (setq menu (funcall context-menu-overriding-function menu)) - (run-hook-wrapped 'context-menu-functions - (lambda (fun) - (setq menu (funcall fun menu)) - nil))) - (setq menu (cons (car menu) (nreverse (cdr menu)))) + (run-hook-wrapped 'context-menu-functions + (lambda (fun) + (setq menu (funcall fun menu)) + nil)) (when (functionp context-menu-filter-function) (setq menu (funcall context-menu-filter-function menu))) menu)) +(defun context-menu-global (menu) + "Global submenus." + (run-hooks 'activate-menubar-hook 'menu-bar-update-hook) + (define-key-after menu [separator-global-1] menu-bar-separator) + (dolist (item (lookup-key global-map [menu-bar])) + (when (consp item) + (define-key-after menu (vector (car item)) + (if (consp (cdr item)) + (copy-sequence (cdr item)) + (cdr item))))) + (define-key-after menu [separator-global-2] menu-bar-separator) + menu) + +(defun context-menu-local (menu) + "Major mode submenus." + (run-hooks 'activate-menubar-hook 'menu-bar-update-hook) + (define-key-after menu [separator-local-1] menu-bar-separator) + (dolist (item (local-key-binding [menu-bar])) + (when (consp item) + (define-key-after menu (vector (car item)) + (if (consp (cdr item)) + (copy-sequence (cdr item)) + (cdr item))))) + (define-key-after menu [separator-local-2] menu-bar-separator) + menu) + +(defun context-menu-minor (menu) + "Minor mode submenus." + (run-hooks 'activate-menubar-hook 'menu-bar-update-hook) + (define-key-after menu [separator-minor-1] menu-bar-separator) + (dolist (item (minor-mode-key-binding [menu-bar])) + (when (and (consp item) (symbol-value (car item))) + (define-key-after menu (vector (cadr item)) + (if (consp (cddr item)) + (copy-sequence (cddr item)) + (cddr item))))) + (define-key-after menu [separator-minor-2] menu-bar-separator) + menu) + (defun context-menu-undo (menu) - (bindings--define-key menu [undo] + (define-key-after menu [separator-undo-1] menu-bar-separator) + (define-key-after menu [undo] '(menu-item "Undo" undo :visible (and (not buffer-read-only) (not (eq t buffer-undo-list)) @@ -314,20 +357,22 @@ not it is actually displayed." (listp pending-undo-list) (consp buffer-undo-list))) :help "Undo last edits")) - (bindings--define-key menu [undo-redo] + (define-key-after menu [undo-redo] '(menu-item "Redo" undo-redo :visible (and (not buffer-read-only) (undo--last-change-was-undo-p buffer-undo-list)) :help "Redo last undone edits")) + (define-key-after menu [separator-undo-2] menu-bar-separator) menu) (defun context-menu-region (menu) - (bindings--define-key menu [cut] + (define-key-after menu [separator-region-1] menu-bar-separator) + (define-key-after menu [cut] '(menu-item "Cut" kill-region :visible (and mark-active (not buffer-read-only)) :help "Cut (kill) text in region between mark and current position")) - (bindings--define-key menu [copy] + (define-key-after menu [copy] ;; ns-win.el said: Substitute a Copy function that works better ;; under X (for GNUstep). `(menu-item "Copy" ,(if (featurep 'ns) @@ -338,7 +383,7 @@ not it is actually displayed." :keys ,(if (featurep 'ns) "\\[ns-copy-including-secondary]" "\\[kill-ring-save]"))) - (bindings--define-key menu [paste] + (define-key-after menu [paste] `(menu-item "Paste" mouse-yank-primary :visible (funcall ',(lambda () @@ -349,25 +394,30 @@ not it is actually displayed." kill-ring)) (not buffer-read-only)))) :help "Paste (yank) text most recently cut/copied")) - (bindings--define-key menu (if (featurep 'ns) [select-paste] - [paste-from-menu]) + (define-key-after menu (if (featurep 'ns) [select-paste] + [paste-from-menu]) ;; ns-win.el said: Change text to be more consistent with ;; surrounding menu items `paste', etc." `(menu-item ,(if (featurep 'ns) "Select and Paste" "Paste from Kill Menu") yank-menu :visible (and (cdr yank-menu) (not buffer-read-only)) :help "Choose a string from the kill ring and paste it")) - (bindings--define-key menu [clear] + (define-key-after menu [clear] '(menu-item "Clear" delete-active-region :visible (and mark-active (not buffer-read-only)) :help "Delete the text in region between mark and current position")) - (bindings--define-key menu [mark-whole-buffer] + (define-key-after menu [mark-whole-buffer] '(menu-item "Select All" mark-whole-buffer :help "Mark the whole buffer for a subsequent cut/copy")) + (define-key-after menu [separator-region-2] menu-bar-separator) menu) +(defvar context-menu-entry + `(menu-item ,(purecopy "Context Menu") ignore + :filter (lambda (_) (context-menu-map)))) + (defvar context-menu--old-down-mouse-3 nil) (defvar context-menu--old-mouse-3 nil) @@ -382,9 +432,7 @@ activates the menu whose contents depends on its surrounding context." (setq context-menu--old-mouse-3 (global-key-binding [mouse-3])) (global-unset-key [mouse-3]) (setq context-menu--old-down-mouse-3 (global-key-binding [down-mouse-3])) - (global-set-key [down-mouse-3] - '(menu-item "Context Menu" ignore - :filter (lambda (_) (context-menu-map))))) + (global-set-key [down-mouse-3] context-menu-entry)) (t (if (not context-menu--old-down-mouse-3) (global-unset-key [down-mouse-3]) diff --git a/lisp/net/goto-addr.el b/lisp/net/goto-addr.el index 1e8a3cda157..2c43d0f7532 100644 --- a/lisp/net/goto-addr.el +++ b/lisp/net/goto-addr.el @@ -126,10 +126,10 @@ will have no effect.") (defun goto-address-context-menu (menu) (when (mouse-posn-property (event-start last-input-event) 'goto-address) - (bindings--define-key menu [goto-address-at-click] - '(menu-item "Follow link" goto-address-at-click - :help "Follow a link where you click")) - (define-key menu [goto-address-separator] menu-bar-separator)) + (define-key menu [goto-address-separator] menu-bar-separator) + (define-key menu [goto-address-at-mouse] + '(menu-item "Follow Link" goto-address-at-mouse + :help "Follow a link where you click"))) menu) (defcustom goto-address-url-face 'link @@ -253,8 +253,8 @@ address. If no e-mail address found, return nil." (goto-char (match-beginning 0)))) (match-string-no-properties 0))) -(defun goto-address-at-click (click) - "Send to the e-mail address or load the URL at click." +(defun goto-address-at-mouse (click) + "Send to the e-mail address or load the URL at mouse click." (interactive "e") (goto-address-at-point click)) @@ -280,7 +280,7 @@ Also fontifies the buffer appropriately (see `goto-address-fontify-p' and (cond (goto-address-mode (jit-lock-register #'goto-address-fontify-region) - (add-hook 'context-menu-functions 'goto-address-context-menu -10 t)) + (add-hook 'context-menu-functions 'goto-address-context-menu 10 t)) (t (jit-lock-unregister #'goto-address-fontify-region) (save-restriction diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el index 19de7545bf3..ad1b13f4bda 100644 --- a/lisp/progmodes/prog-mode.el +++ b/lisp/progmodes/prog-mode.el @@ -43,6 +43,22 @@ display-line-numbers-mode prettify-symbols-mode)) +(defun prog-context-menu (menu) + (when (featurep 'xref) + (define-key-after menu [prog-separator-1] menu-bar-separator) + (define-key-after menu [xref-find-def] + '(menu-item "Find Definition" xref-find-definitions-at-mouse + :visible (save-excursion + (mouse-set-point last-input-event) + (xref-backend-identifier-at-point (xref-find-backend))) + :help "Find definition of function or variable")) + (define-key-after menu [xref-pop] + '(menu-item "Back Definition" xref-pop-marker-stack + :visible (not (xref-marker-stack-empty-p)) + :help "Back to the position of the last search")) + (define-key-after menu [prog-separator-2] menu-bar-separator)) + menu) + (defvar prog-mode-map (let ((map (make-sparse-keymap))) (define-key map [?\C-\M-q] 'prog-indent-sexp) @@ -249,6 +265,7 @@ support it." "Major mode for editing programming language source code." (setq-local require-final-newline mode-require-final-newline) (setq-local parse-sexp-ignore-comments t) + (add-hook 'context-menu-functions 'prog-context-menu 10 t) ;; Any programming language is always written left to right. (setq bidi-paragraph-direction 'left-to-right)) -- cgit v1.2.3 From ebac285d0ee567ed86e14b871cf0bac2de8655db Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 21 Jul 2021 23:34:59 +0300 Subject: Improve docstring of context-menu-functions and add eww-context-menu * lisp/mouse.el (context-menu-functions): Explain function args in docstring. * lisp/net/eww.el (eww-context-menu): New function. (eww-mode): Add it to context-menu-functions. * lisp/info.el (Info-context-menu): Move history items higher. * lisp/progmodes/prog-mode.el (prog-context-menu): Add menu items in the middle of the menu after the region menu items. --- lisp/dired.el | 4 ++-- lisp/info.el | 20 +++++++++----------- lisp/mouse.el | 4 +++- lisp/net/eww.el | 31 +++++++++++++++++++++++++++++++ lisp/net/goto-addr.el | 5 +++-- lisp/progmodes/prog-mode.el | 12 ++++++++---- 6 files changed, 56 insertions(+), 20 deletions(-) (limited to 'lisp/info.el') diff --git a/lisp/dired.el b/lisp/dired.el index 5e44f524f6b..e16df189a76 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2196,7 +2196,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST." (defun dired-context-menu (menu) (when (mouse-posn-property (event-start last-input-event) 'dired-filename) - (define-key menu [dired-separator-1] menu-bar-separator) + (define-key menu [dired-separator-2] menu-bar-separator) (let ((easy-menu (make-sparse-keymap "Immediate"))) (easy-menu-define nil easy-menu nil '("Immediate" @@ -2207,7 +2207,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST." (dolist (item (reverse (lookup-key easy-menu [menu-bar immediate]))) (when (consp item) (define-key menu (vector (car item)) (cdr item))))) - (define-key menu [dired-separator-2] menu-bar-separator)) + (define-key menu [dired-separator-1] menu-bar-separator)) menu) diff --git a/lisp/info.el b/lisp/info.el index a8848a94758..14dc299295f 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -4147,14 +4147,7 @@ If FORK is non-nil, it is passed to `Info-goto-node'." ["Exit" quit-window :help "Stop reading Info"])) (defun Info-context-menu (menu) - (when (mouse-posn-property (event-start last-input-event) 'mouse-face) - (define-key menu [Info-separator-link-1] menu-bar-separator) - (define-key menu [Info-mouse-follow-nearest-node] - '(menu-item "Follow Link" Info-mouse-follow-nearest-node - :help "Follow a link where you click")) - (define-key menu [Info-separator-link-2] menu-bar-separator)) - - (define-key-after menu [Info-separator-1] menu-bar-separator) + (define-key menu [Info-separator-2] menu-bar-separator) (let ((easy-menu (make-sparse-keymap "Info"))) (easy-menu-define nil easy-menu nil '("Info" @@ -4162,10 +4155,15 @@ If FORK is non-nil, it is passed to `Info-goto-node'." :help "Go back in history to the last node you were at"] ["Forward in History" Info-history-forward :visible Info-history-forward :help "Go forward in history"])) - (dolist (item (lookup-key easy-menu [menu-bar info])) + (dolist (item (reverse (lookup-key easy-menu [menu-bar info]))) (when (consp item) - (define-key-after menu (vector (car item)) (cdr item))))) - (define-key-after menu [Info-separator-2] menu-bar-separator) + (define-key menu (vector (car item)) (cdr item))))) + + (when (mouse-posn-property (event-start last-input-event) 'mouse-face) + (define-key menu [Info-mouse-follow-nearest-node] + '(menu-item "Follow Link" Info-mouse-follow-nearest-node + :help "Follow a link where you click"))) + (define-key menu [Info-separator-1] menu-bar-separator) menu) diff --git a/lisp/mouse.el b/lisp/mouse.el index 7a564f989c2..37721e60823 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -283,7 +283,9 @@ not it is actually displayed." context-menu-region context-menu-local context-menu-minor) - "List of functions that produce the contents of the context menu." + "List of functions that produce the contents of the context menu. +Each function receives the menu as its argument and should return +the same menu with changes such as added new menu items." :type 'hook :options '(context-menu-undo context-menu-region diff --git a/lisp/net/eww.el b/lisp/net/eww.el index eec3ec7ba8b..b8761029864 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -1021,6 +1021,36 @@ the like." ["Toggle Paragraph Direction" eww-toggle-paragraph-direction])) map)) +(defun eww-context-menu (menu) + (define-key menu [eww-separator-2] menu-bar-separator) + (let ((easy-menu (make-sparse-keymap "Eww"))) + (easy-menu-define nil easy-menu nil + '("Eww" + ["Back to previous page" eww-back-url + :visible (not (zerop (length eww-history)))] + ["Forward to next page" eww-forward-url + :visible (not (zerop eww-history-position))] + ["Reload" eww-reload t])) + (dolist (item (reverse (lookup-key easy-menu [menu-bar eww]))) + (when (consp item) + (define-key menu (vector (car item)) (cdr item))))) + + (when (or (mouse-posn-property (event-start last-input-event) 'shr-url) + (mouse-posn-property (event-start last-input-event) 'image-url)) + (define-key menu [shr-mouse-browse-url-new-window] + `(menu-item "Follow URL in new window" ,(if browse-url-new-window-flag + 'shr-mouse-browse-url + 'shr-mouse-browse-url-new-window) + :help "Browse the URL under the mouse cursor in a new window")) + (define-key menu [shr-mouse-browse-url] + `(menu-item "Follow URL" ,(if browse-url-new-window-flag + 'shr-mouse-browse-url-new-window + 'shr-mouse-browse-url) + :help "Browse the URL under the mouse cursor"))) + (define-key menu [eww-separator-1] menu-bar-separator) + + menu) + (defvar eww-tool-bar-map (let ((map (make-sparse-keymap))) (dolist (tool-bar-item @@ -1044,6 +1074,7 @@ the like." (setq-local eww-data (list :title "")) (setq-local browse-url-browser-function #'eww-browse-url) (add-hook 'after-change-functions #'eww-process-text-input nil t) + (add-hook 'context-menu-functions 'eww-context-menu 5 t) (setq-local eww-history nil) (setq-local eww-history-position 0) (when (boundp 'tool-bar-map) diff --git a/lisp/net/goto-addr.el b/lisp/net/goto-addr.el index 2c43d0f7532..c270cf53cbf 100644 --- a/lisp/net/goto-addr.el +++ b/lisp/net/goto-addr.el @@ -126,10 +126,11 @@ will have no effect.") (defun goto-address-context-menu (menu) (when (mouse-posn-property (event-start last-input-event) 'goto-address) - (define-key menu [goto-address-separator] menu-bar-separator) + (define-key menu [goto-address-separator-2] menu-bar-separator) (define-key menu [goto-address-at-mouse] '(menu-item "Follow Link" goto-address-at-mouse - :help "Follow a link where you click"))) + :help "Follow a link where you click")) + (define-key menu [goto-address-separator-1] menu-bar-separator)) menu) (defcustom goto-address-url-face 'link diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el index ad1b13f4bda..a10291a9c7d 100644 --- a/lisp/progmodes/prog-mode.el +++ b/lisp/progmodes/prog-mode.el @@ -45,18 +45,22 @@ (defun prog-context-menu (menu) (when (featurep 'xref) - (define-key-after menu [prog-separator-1] menu-bar-separator) + (define-key-after menu [prog-separator-1] menu-bar-separator + 'separator-region-2) (define-key-after menu [xref-find-def] '(menu-item "Find Definition" xref-find-definitions-at-mouse :visible (save-excursion (mouse-set-point last-input-event) (xref-backend-identifier-at-point (xref-find-backend))) - :help "Find definition of function or variable")) + :help "Find definition of function or variable") + 'prog-separator-1) (define-key-after menu [xref-pop] '(menu-item "Back Definition" xref-pop-marker-stack :visible (not (xref-marker-stack-empty-p)) - :help "Back to the position of the last search")) - (define-key-after menu [prog-separator-2] menu-bar-separator)) + :help "Back to the position of the last search") + 'xref-find-def) + (define-key-after menu [prog-separator-2] menu-bar-separator + 'xref-pop)) menu) (defvar prog-mode-map -- cgit v1.2.3 From 2c2baa9d1231ad9e642e3a80fb1c641fdde71b33 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Tue, 27 Jul 2021 23:48:07 +0300 Subject: Add new context-menu options for menus "File At Point" and "Version Control". * lisp/mouse.el (context-menu-functions): Add more options. (context-menu-global, context-menu-local): Fix separators. (context-menu-minor): Rewrite to support list of submenus. (context-menu-vc, context-menu-ffap): New functions. (context-menu-undo, context-menu-region): Fix separators. * lisp/dired.el (dired-context-menu): * lisp/info.el (Info-context-menu): * lisp/net/goto-addr.el (goto-address-context-menu): * lisp/net/eww.el (eww-context-menu): * lisp/progmodes/prog-mode.el (prog-context-menu): Fix separators. --- lisp/dired.el | 5 ++--- lisp/info.el | 3 +-- lisp/mouse.el | 51 ++++++++++++++++++++++++++++++--------------- lisp/net/eww.el | 3 +-- lisp/net/goto-addr.el | 5 ++--- lisp/progmodes/prog-mode.el | 10 ++++----- 6 files changed, 44 insertions(+), 33 deletions(-) (limited to 'lisp/info.el') diff --git a/lisp/dired.el b/lisp/dired.el index e16df189a76..4e82d57e216 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2196,7 +2196,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST." (defun dired-context-menu (menu) (when (mouse-posn-property (event-start last-input-event) 'dired-filename) - (define-key menu [dired-separator-2] menu-bar-separator) + (define-key menu [dired-separator] menu-bar-separator) (let ((easy-menu (make-sparse-keymap "Immediate"))) (easy-menu-define nil easy-menu nil '("Immediate" @@ -2206,8 +2206,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST." :help "Edit file at mouse click in other window"])) (dolist (item (reverse (lookup-key easy-menu [menu-bar immediate]))) (when (consp item) - (define-key menu (vector (car item)) (cdr item))))) - (define-key menu [dired-separator-1] menu-bar-separator)) + (define-key menu (vector (car item)) (cdr item)))))) menu) diff --git a/lisp/info.el b/lisp/info.el index 14dc299295f..0b3a9e4bf5d 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -4147,7 +4147,7 @@ If FORK is non-nil, it is passed to `Info-goto-node'." ["Exit" quit-window :help "Stop reading Info"])) (defun Info-context-menu (menu) - (define-key menu [Info-separator-2] menu-bar-separator) + (define-key menu [Info-separator] menu-bar-separator) (let ((easy-menu (make-sparse-keymap "Info"))) (easy-menu-define nil easy-menu nil '("Info" @@ -4163,7 +4163,6 @@ If FORK is non-nil, it is passed to `Info-goto-node'." (define-key menu [Info-mouse-follow-nearest-node] '(menu-item "Follow Link" Info-mouse-follow-nearest-node :help "Follow a link where you click"))) - (define-key menu [Info-separator-1] menu-bar-separator) menu) diff --git a/lisp/mouse.el b/lisp/mouse.el index 37721e60823..60c4f4b85c5 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -291,7 +291,9 @@ the same menu with changes such as added new menu items." context-menu-region context-menu-global context-menu-local - context-menu-minor) + context-menu-minor + context-menu-vc + context-menu-ffap) :version "28.1") (defcustom context-menu-filter-function nil @@ -313,44 +315,50 @@ the same menu with changes such as added new menu items." (defun context-menu-global (menu) "Global submenus." (run-hooks 'activate-menubar-hook 'menu-bar-update-hook) - (define-key-after menu [separator-global-1] menu-bar-separator) + (define-key-after menu [separator-global] menu-bar-separator) (dolist (item (lookup-key global-map [menu-bar])) (when (consp item) (define-key-after menu (vector (car item)) (if (consp (cdr item)) (copy-sequence (cdr item)) (cdr item))))) - (define-key-after menu [separator-global-2] menu-bar-separator) menu) (defun context-menu-local (menu) "Major mode submenus." (run-hooks 'activate-menubar-hook 'menu-bar-update-hook) - (define-key-after menu [separator-local-1] menu-bar-separator) + (define-key-after menu [separator-local] menu-bar-separator) (dolist (item (local-key-binding [menu-bar])) (when (consp item) (define-key-after menu (vector (car item)) (if (consp (cdr item)) (copy-sequence (cdr item)) (cdr item))))) - (define-key-after menu [separator-local-2] menu-bar-separator) menu) (defun context-menu-minor (menu) "Minor mode submenus." (run-hooks 'activate-menubar-hook 'menu-bar-update-hook) - (define-key-after menu [separator-minor-1] menu-bar-separator) - (dolist (item (minor-mode-key-binding [menu-bar])) - (when (and (consp item) (symbol-value (car item))) - (define-key-after menu (vector (cadr item)) - (if (consp (cddr item)) - (copy-sequence (cddr item)) - (cddr item))))) - (define-key-after menu [separator-minor-2] menu-bar-separator) + (define-key-after menu [separator-minor] menu-bar-separator) + (dolist (mode (minor-mode-key-binding [menu-bar])) + (when (and (consp mode) (symbol-value (car mode))) + (dolist (item (cdr mode)) + (when (consp item) + (define-key-after menu (vector (car item)) + (if (consp (cdr item)) + (copy-sequence (cdr item)) + (cdr item))))))) + menu) + +(defun context-menu-vc (menu) + "Version Control menu." + (define-key-after menu [separator-vc] menu-bar-separator) + (define-key-after menu [vc-menu] vc-menu-entry) menu) (defun context-menu-undo (menu) - (define-key-after menu [separator-undo-1] menu-bar-separator) + (when (cddr menu) + (define-key-after menu [separator-undo] menu-bar-separator)) (define-key-after menu [undo] '(menu-item "Undo" undo :visible (and (not buffer-read-only) @@ -364,11 +372,11 @@ the same menu with changes such as added new menu items." :visible (and (not buffer-read-only) (undo--last-change-was-undo-p buffer-undo-list)) :help "Redo last undone edits")) - (define-key-after menu [separator-undo-2] menu-bar-separator) menu) (defun context-menu-region (menu) - (define-key-after menu [separator-region-1] menu-bar-separator) + (when (cddr menu) + (define-key-after menu [separator-region] menu-bar-separator)) (define-key-after menu [cut] '(menu-item "Cut" kill-region :visible (and mark-active (not buffer-read-only)) @@ -413,7 +421,16 @@ the same menu with changes such as added new menu items." (define-key-after menu [mark-whole-buffer] '(menu-item "Select All" mark-whole-buffer :help "Mark the whole buffer for a subsequent cut/copy")) - (define-key-after menu [separator-region-2] menu-bar-separator) + menu) + +(defun context-menu-ffap (menu) + (save-excursion + (mouse-set-point last-input-event) + (when (ffap-guess-file-name-at-point) + (define-key menu [ffap-separator] menu-bar-separator) + (define-key menu [ffap-at-mouse] + '(menu-item "Find File or URL" ffap-at-mouse + :help "Find file or URL guessed from text around mouse click")))) menu) (defvar context-menu-entry diff --git a/lisp/net/eww.el b/lisp/net/eww.el index b8761029864..5c46ccfe001 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -1022,7 +1022,7 @@ the like." map)) (defun eww-context-menu (menu) - (define-key menu [eww-separator-2] menu-bar-separator) + (define-key menu [eww-separator] menu-bar-separator) (let ((easy-menu (make-sparse-keymap "Eww"))) (easy-menu-define nil easy-menu nil '("Eww" @@ -1047,7 +1047,6 @@ the like." 'shr-mouse-browse-url-new-window 'shr-mouse-browse-url) :help "Browse the URL under the mouse cursor"))) - (define-key menu [eww-separator-1] menu-bar-separator) menu) diff --git a/lisp/net/goto-addr.el b/lisp/net/goto-addr.el index c270cf53cbf..2c43d0f7532 100644 --- a/lisp/net/goto-addr.el +++ b/lisp/net/goto-addr.el @@ -126,11 +126,10 @@ will have no effect.") (defun goto-address-context-menu (menu) (when (mouse-posn-property (event-start last-input-event) 'goto-address) - (define-key menu [goto-address-separator-2] menu-bar-separator) + (define-key menu [goto-address-separator] menu-bar-separator) (define-key menu [goto-address-at-mouse] '(menu-item "Follow Link" goto-address-at-mouse - :help "Follow a link where you click")) - (define-key menu [goto-address-separator-1] menu-bar-separator)) + :help "Follow a link where you click"))) menu) (defcustom goto-address-url-face 'link diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el index a10291a9c7d..a8b608b018a 100644 --- a/lisp/progmodes/prog-mode.el +++ b/lisp/progmodes/prog-mode.el @@ -45,22 +45,20 @@ (defun prog-context-menu (menu) (when (featurep 'xref) - (define-key-after menu [prog-separator-1] menu-bar-separator - 'separator-region-2) + (define-key-after menu [prog-separator] menu-bar-separator + 'mark-whole-buffer) (define-key-after menu [xref-find-def] '(menu-item "Find Definition" xref-find-definitions-at-mouse :visible (save-excursion (mouse-set-point last-input-event) (xref-backend-identifier-at-point (xref-find-backend))) :help "Find definition of function or variable") - 'prog-separator-1) + 'prog-separator) (define-key-after menu [xref-pop] '(menu-item "Back Definition" xref-pop-marker-stack :visible (not (xref-marker-stack-empty-p)) :help "Back to the position of the last search") - 'xref-find-def) - (define-key-after menu [prog-separator-2] menu-bar-separator - 'xref-pop)) + 'xref-find-def)) menu) (defvar prog-mode-map -- 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/info.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 From 3b7b181bded1bddb2505eda1224a5631cbf04c1b Mon Sep 17 00:00:00 2001 From: Mattias Engdegård Date: Mon, 9 Aug 2021 11:20:00 +0200 Subject: Use string-search instead of string-match[-p] `string-search` is easier to understand, less error-prone, much faster, does not pollute the regexp cache, and does not mutate global state. Use it where applicable and obviously safe (erring on the conservative side). * admin/authors.el (authors-canonical-file-name) (authors-scan-change-log): * lisp/apropos.el (apropos-command) (apropos-documentation-property, apropos-symbols-internal): * lisp/arc-mode.el (archive-arc-summarize) (archive-zoo-summarize): * lisp/calc/calc-aent.el (math-read-factor): * lisp/calc/calc-ext.el (math-read-big-expr) (math-format-nice-expr, math-format-number-fancy): * lisp/calc/calc-forms.el (math-read-angle-brackets): * lisp/calc/calc-graph.el (calc-graph-set-range): * lisp/calc/calc-keypd.el (calc-keypad-press): * lisp/calc/calc-lang.el (tex, latex, math-read-big-rec): * lisp/calc/calc-prog.el (calc-fix-token-name) (calc-user-define-permanent, math-define-exp): * lisp/calc/calc.el (calc-record, calcDigit-key) (calc-count-lines): * lisp/calc/calcalg2.el (calc-solve-for, calc-poly-roots) (math-do-integral): * lisp/calc/calcalg3.el (calc-find-root, calc-find-minimum) (calc-get-fit-variables): * lisp/cedet/ede/speedbar.el (ede-tag-expand): * lisp/cedet/semantic/java.el (semantic-java-expand-tag): * lisp/cedet/semantic/sb.el (semantic-sb-show-extra) (semantic-sb-expand-group): * lisp/cedet/semantic/wisent/python.el (semantic-python-instance-variable-p): * lisp/cus-edit.el (get): * lisp/descr-text.el (describe-text-sexp): * lisp/dired-aux.el (dired-compress-file): * lisp/dired-x.el (dired-make-relative-symlink): * lisp/dired.el (dired-glob-regexp): * lisp/dos-fns.el (dos-convert-standard-filename, dos-8+3-filename): * lisp/edmacro.el (edmacro-format-keys): * lisp/emacs-lisp/eieio-opt.el (eieio-sb-expand): * lisp/emacs-lisp/eieio-speedbar.el (eieio-speedbar-object-expand): * lisp/emacs-lisp/lisp-mnt.el (lm-keywords-list): * lisp/emacs-lisp/warnings.el (display-warning): * lisp/emulation/viper-ex.el (viper-ex-read-file-name) (ex-print-display-lines): * lisp/env.el (read-envvar-name, setenv): * lisp/epa-mail.el (epa-mail-encrypt): * lisp/epg.el (epg--start): * lisp/erc/erc-backend.el (erc-parse-server-response): * lisp/erc/erc-dcc.el (erc-dcc-member): * lisp/erc/erc-speedbar.el (erc-speedbar-expand-server) (erc-speedbar-expand-channel, erc-speedbar-expand-user): * lisp/erc/erc.el (erc-send-input): * lisp/eshell/em-glob.el (eshell-glob-entries): * lisp/eshell/esh-proc.el (eshell-needs-pipe-p): * lisp/eshell/esh-util.el (eshell-convert): * lisp/eshell/esh-var.el (eshell-envvar-names): * lisp/faces.el (x-resolve-font-name): * lisp/ffap.el (ffap-file-at-point): * lisp/files.el (wildcard-to-regexp, shell-quote-wildcard-pattern): * lisp/forms.el (forms--update): * lisp/frameset.el (frameset-filter-unshelve-param): * lisp/gnus/gnus-art.el (article-decode-charset): * lisp/gnus/gnus-kill.el (gnus-kill-parse-rn-kill-file): * lisp/gnus/gnus-mlspl.el (gnus-group-split-fancy): * lisp/gnus/gnus-msg.el (gnus-summary-resend-message-insert-gcc) (gnus-inews-insert-gcc): * lisp/gnus/gnus-rfc1843.el (rfc1843-decode-article-body): * lisp/gnus/gnus-search.el (gnus-search-indexed-parse-output) (gnus-search--complete-key-data): * lisp/gnus/gnus-spec.el (gnus-parse-simple-format): * lisp/gnus/gnus-sum.el (gnus-summary-refer-article): * lisp/gnus/gnus-util.el (gnus-extract-address-components) (gnus-newsgroup-directory-form): * lisp/gnus/gnus-uu.el (gnus-uu-grab-view): * lisp/gnus/gnus.el (gnus-group-native-p, gnus-short-group-name): * lisp/gnus/message.el (message-check-news-header-syntax) (message-make-message-id, message-user-mail-address) (message-make-fqdn, message-get-reply-headers, message-followup): * lisp/gnus/mm-decode.el (mm-dissect-buffer): * lisp/gnus/nnheader.el (nnheader-insert): * lisp/gnus/nnimap.el (nnimap-process-quirk) (nnimap-imap-ranges-to-gnus-ranges): * lisp/gnus/nnmaildir.el (nnmaildir--ensure-suffix): * lisp/gnus/nnmairix.el (nnmairix-determine-original-group-from-path): * lisp/gnus/nnrss.el (nnrss-match-macro): * lisp/gnus/nntp.el (nntp-find-group-and-number): * lisp/help-fns.el (help--symbol-completion-table-affixation): * lisp/help.el (help-function-arglist): * lisp/hippie-exp.el (he-concat-directory-file-name): * lisp/htmlfontify.el (hfy-relstub): * lisp/ido.el (ido-make-prompt, ido-complete, ido-copy-current-word) (ido-exhibit): * lisp/image/image-converter.el (image-convert-p): * lisp/info-xref.el (info-xref-docstrings): * lisp/info.el (Info-toc-build, Info-follow-reference) (Info-backward-node, Info-finder-find-node) (Info-speedbar-expand-node): * lisp/international/mule-diag.el (print-fontset-element): * lisp/language/korea-util.el (default-korean-keyboard): * lisp/linum.el (linum-after-change): * lisp/mail/ietf-drums.el (ietf-drums-parse-address): * lisp/mail/mail-utils.el (mail-dont-reply-to): * lisp/mail/rfc2047.el (rfc2047-encode-1, rfc2047-decode-string): * lisp/mail/rfc2231.el (rfc2231-parse-string): * lisp/mail/rmailkwd.el (rmail-set-label): * lisp/mail/rmailsum.el (rmail-header-summary): * lisp/mail/smtpmail.el (smtpmail-maybe-append-domain) (smtpmail-user-mail-address): * lisp/mail/uce.el (uce-reply-to-uce): * lisp/man.el (Man-default-man-entry): * lisp/mh-e/mh-alias.el (mh-alias-gecos-name) (mh-alias-minibuffer-confirm-address): * lisp/mh-e/mh-comp.el (mh-forwarded-letter-subject): * lisp/mh-e/mh-speed.el (mh-speed-parse-flists-output): * lisp/mh-e/mh-utils.el (mh-collect-folder-names-filter) (mh-folder-completion-function): * lisp/minibuffer.el (completion--make-envvar-table) (completion-file-name-table, completion-flex-try-completion) (completion-flex-all-completions): * lisp/mpc.el (mpc--proc-quote-string, mpc-cmd-special-tag-p) (mpc-constraints-tag-lookup): * lisp/net/ange-ftp.el (ange-ftp-send-cmd) (ange-ftp-allow-child-lookup): * lisp/net/mailcap.el (mailcap-mime-types): * lisp/net/mairix.el (mairix-search-thread-this-article): * lisp/net/pop3.el (pop3-open-server): * lisp/net/soap-client.el (soap-decode-xs-complex-type): * lisp/net/socks.el (socks-filter): * lisp/nxml/nxml-outln.el (nxml-highlighted-qname): * lisp/nxml/rng-cmpct.el (rng-c-expand-name, rng-c-expand-datatype): * lisp/nxml/rng-uri.el (rng-uri-file-name-1): * lisp/obsolete/complete.el (partial-completion-mode) (PC-do-completion): * lisp/obsolete/longlines.el (longlines-encode-string): * lisp/obsolete/nnir.el (nnir-compose-result): * lisp/obsolete/terminal.el (te-quote-arg-for-sh): * lisp/obsolete/tpu-edt.el (tpu-check-search-case): * lisp/obsolete/url-ns.el (isPlainHostName): * lisp/pcmpl-unix.el (pcomplete/scp): * lisp/play/dunnet.el (dun-listify-string2, dun-get-path) (dun-unix-parse, dun-doassign, dun-cat, dun-batch-unix-interface): * lisp/progmodes/ebnf2ps.el: (ebnf-eps-header-footer-comment): * lisp/progmodes/gdb-mi.el (gdb-var-delete) (gdb-speedbar-expand-node, gdbmi-bnf-incomplete-record-result): * lisp/progmodes/gud.el (gud-find-expr): * lisp/progmodes/idlw-help.el (idlwave-do-context-help1): * lisp/progmodes/idlw-shell.el (idlwave-shell-mode) (idlwave-shell-filter-hidden-output, idlwave-shell-filter): * lisp/progmodes/idlwave.el (idlwave-skip-label-or-case) (idlwave-routine-info): * lisp/progmodes/octave.el (inferior-octave-completion-at-point): * lisp/progmodes/sh-script.el (sh-add-completer): * lisp/progmodes/sql.el (defun): * lisp/progmodes/xscheme.el (xscheme-process-filter): * lisp/replace.el (query-replace-compile-replacement) (map-query-replace-regexp): * lisp/shell.el (shell--command-completion-data) (shell-environment-variable-completion): * lisp/simple.el (display-message-or-buffer): * lisp/speedbar.el (speedbar-dired, speedbar-tag-file) (speedbar-tag-expand): * lisp/subr.el (split-string-and-unquote): * lisp/tar-mode.el (tar-extract): * lisp/term.el (term-command-hook, serial-read-name): * lisp/textmodes/bibtex.el (bibtex-print-help-message): * lisp/textmodes/ispell.el (ispell-lookup-words, ispell-filter) (ispell-parse-output, ispell-buffer-local-parsing): * lisp/textmodes/reftex-cite.el (reftex-do-citation): * lisp/textmodes/reftex-parse.el (reftex-notice-new): * lisp/textmodes/reftex-ref.el (reftex-show-entry): * lisp/textmodes/reftex.el (reftex-compile-variables): * lisp/textmodes/tex-mode.el (tex-send-command) (tex-start-tex, tex-append): * lisp/thingatpt.el (thing-at-point-url-at-point): * lisp/tmm.el (tmm-add-one-shortcut): * lisp/transient.el (transient-format-key): * lisp/url/url-auth.el (url-basic-auth) (url-digest-auth-directory-id-assoc): * lisp/url/url-news.el (url-news): * lisp/url/url-util.el (url-parse-query-string): * lisp/vc/vc-cvs.el (vc-cvs-parse-entry): * lisp/wid-browse.el (widget-browse-sexp): * lisp/woman.el (woman-parse-colon-path, woman-mini-help) (WoMan-getpage-in-background, woman-negative-vertical-space): * lisp/xml.el: * test/lisp/emacs-lisp/check-declare-tests.el (check-declare-tests-warn): * test/lisp/files-tests.el (files-tests-file-name-non-special-dired-compress-handler): * test/lisp/net/network-stream-tests.el (server-process-filter): * test/src/coding-tests.el (ert-test-unibyte-buffer-dos-eol-decode): Use `string-search` instead of `string-match` and `string-match-p`. --- admin/authors.el | 4 ++-- lisp/apropos.el | 8 ++++---- lisp/arc-mode.el | 4 ++-- lisp/calc/calc-aent.el | 4 ++-- lisp/calc/calc-ext.el | 6 +++--- lisp/calc/calc-forms.el | 2 +- lisp/calc/calc-graph.el | 2 +- lisp/calc/calc-keypd.el | 2 +- lisp/calc/calc-lang.el | 8 ++++---- lisp/calc/calc-prog.el | 8 ++++---- lisp/calc/calc.el | 6 +++--- lisp/calc/calcalg2.el | 6 +++--- lisp/calc/calcalg3.el | 6 +++--- lisp/cedet/ede/speedbar.el | 4 ++-- lisp/cedet/semantic/java.el | 2 +- lisp/cedet/semantic/sb.el | 8 ++++---- lisp/cedet/semantic/wisent/python.el | 2 +- lisp/cus-edit.el | 2 +- lisp/descr-text.el | 2 +- lisp/dired-aux.el | 2 +- lisp/dired-x.el | 6 +++--- lisp/dired.el | 2 +- lisp/dos-fns.el | 12 ++++++------ lisp/edmacro.el | 2 +- lisp/emacs-lisp/eieio-opt.el | 4 ++-- lisp/emacs-lisp/eieio-speedbar.el | 4 ++-- lisp/emacs-lisp/lisp-mnt.el | 2 +- lisp/emacs-lisp/warnings.el | 2 +- lisp/emulation/viper-ex.el | 6 +++--- lisp/env.el | 4 ++-- lisp/epa-mail.el | 2 +- lisp/epg.el | 2 +- lisp/erc/erc-backend.el | 10 +++++----- lisp/erc/erc-dcc.el | 2 +- lisp/erc/erc-speedbar.el | 12 ++++++------ lisp/erc/erc.el | 2 +- lisp/eshell/em-glob.el | 2 +- lisp/eshell/esh-proc.el | 2 +- lisp/eshell/esh-util.el | 2 +- lisp/eshell/esh-var.el | 2 +- lisp/faces.el | 2 +- lisp/ffap.el | 2 +- lisp/files.el | 4 ++-- lisp/forms.el | 2 +- lisp/frameset.el | 2 +- lisp/gnus/gnus-art.el | 2 +- lisp/gnus/gnus-kill.el | 2 +- lisp/gnus/gnus-mlspl.el | 2 +- lisp/gnus/gnus-msg.el | 10 +++++----- lisp/gnus/gnus-rfc1843.el | 2 +- lisp/gnus/gnus-search.el | 4 ++-- lisp/gnus/gnus-spec.el | 2 +- lisp/gnus/gnus-sum.el | 2 +- lisp/gnus/gnus-util.el | 4 ++-- lisp/gnus/gnus-uu.el | 2 +- lisp/gnus/gnus.el | 8 ++++---- lisp/gnus/message.el | 26 +++++++++++++------------- lisp/gnus/mm-decode.el | 2 +- lisp/gnus/nnheader.el | 2 +- lisp/gnus/nnimap.el | 4 ++-- lisp/gnus/nnmaildir.el | 2 +- lisp/gnus/nnmairix.el | 2 +- lisp/gnus/nnrss.el | 2 +- lisp/gnus/nntp.el | 4 ++-- lisp/help-fns.el | 2 +- lisp/help.el | 2 +- lisp/hippie-exp.el | 4 ++-- lisp/htmlfontify.el | 2 +- lisp/ido.el | 10 +++++----- lisp/image/image-converter.el | 2 +- lisp/info-xref.el | 2 +- lisp/info.el | 12 ++++++------ lisp/international/mule-diag.el | 4 ++-- lisp/language/korea-util.el | 2 +- lisp/linum.el | 2 +- lisp/mail/ietf-drums.el | 2 +- lisp/mail/mail-utils.el | 2 +- lisp/mail/rfc2047.el | 4 ++-- lisp/mail/rfc2231.el | 6 +++--- lisp/mail/rmailkwd.el | 2 +- lisp/mail/rmailsum.el | 2 +- lisp/mail/smtpmail.el | 4 ++-- lisp/mail/uce.el | 8 ++++---- lisp/man.el | 2 +- lisp/mh-e/mh-alias.el | 6 +++--- lisp/mh-e/mh-comp.el | 4 ++-- lisp/mh-e/mh-speed.el | 2 +- lisp/mh-e/mh-utils.el | 4 ++-- lisp/minibuffer.el | 8 ++++---- lisp/mpc.el | 6 +++--- lisp/net/ange-ftp.el | 6 +++--- lisp/net/mailcap.el | 2 +- lisp/net/mairix.el | 2 +- lisp/net/pop3.el | 4 ++-- lisp/net/soap-client.el | 2 +- lisp/net/socks.el | 2 +- lisp/nxml/nxml-outln.el | 2 +- lisp/nxml/rng-cmpct.el | 4 ++-- lisp/nxml/rng-uri.el | 4 ++-- lisp/obsolete/complete.el | 4 ++-- lisp/obsolete/longlines.el | 4 ++-- lisp/obsolete/nnir.el | 2 +- lisp/obsolete/terminal.el | 2 +- lisp/obsolete/tpu-edt.el | 6 +++--- lisp/obsolete/url-ns.el | 2 +- lisp/pcmpl-unix.el | 2 +- lisp/play/dunnet.el | 18 +++++++++--------- lisp/progmodes/ebnf2ps.el | 2 +- lisp/progmodes/gdb-mi.el | 8 ++++---- lisp/progmodes/gud.el | 2 +- lisp/progmodes/idlw-help.el | 2 +- lisp/progmodes/idlw-shell.el | 10 +++++----- lisp/progmodes/idlwave.el | 8 ++++---- lisp/progmodes/octave.el | 2 +- lisp/progmodes/sh-script.el | 2 +- lisp/progmodes/sql.el | 2 +- lisp/progmodes/xscheme.el | 4 ++-- lisp/replace.el | 8 ++++---- lisp/shell.el | 4 ++-- lisp/simple.el | 4 ++-- lisp/speedbar.el | 12 ++++++------ lisp/subr.el | 2 +- lisp/tar-mode.el | 2 +- lisp/term.el | 6 +++--- lisp/textmodes/bibtex.el | 2 +- lisp/textmodes/ispell.el | 10 +++++----- lisp/textmodes/reftex-cite.el | 2 +- lisp/textmodes/reftex-parse.el | 2 +- lisp/textmodes/reftex-ref.el | 2 +- lisp/textmodes/reftex.el | 2 +- lisp/textmodes/tex-mode.el | 6 +++--- lisp/thingatpt.el | 2 +- lisp/tmm.el | 2 +- lisp/transient.el | 2 +- lisp/url/url-auth.el | 8 ++++---- lisp/url/url-news.el | 2 +- lisp/url/url-util.el | 2 +- lisp/vc/vc-cvs.el | 2 +- lisp/wid-browse.el | 2 +- lisp/woman.el | 10 +++++----- lisp/xml.el | 4 ++-- test/lisp/emacs-lisp/check-declare-tests.el | 10 +++++----- test/lisp/files-tests.el | 2 +- test/lisp/net/network-stream-tests.el | 2 +- test/src/coding-tests.el | 2 +- 145 files changed, 299 insertions(+), 299 deletions(-) (limited to 'lisp/info.el') diff --git a/admin/authors.el b/admin/authors.el index a400b1327af..b4e6c934b67 100644 --- a/admin/authors.el +++ b/admin/authors.el @@ -1330,7 +1330,7 @@ to print a message if FILE is not found." (unless (or valid (member file authors-ignored-files) (authors-obsolete-file-p file) - (string-match "[*]" file) + (string-search "*" file) (string-match "^[0-9.]+$" file) laxlog) (setq authors-invalid-file-names @@ -1465,7 +1465,7 @@ Suggested\\|Trivial\\|Version\\|Originally\\|From:\\|Patch[ \t]+[Bb]y\\)"))) ((looking-at "^[ \t]+\\*") (let ((line (buffer-substring-no-properties (match-end 0) (line-end-position)))) - (while (and (not (string-match ":" line)) + (while (and (not (string-search ":" line)) (forward-line 1) (not (looking-at ":\\|^[ \t]*$"))) (setq line (concat line diff --git a/lisp/apropos.el b/lisp/apropos.el index 376c1b2cbc5..a1470537d9a 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el @@ -616,7 +616,7 @@ while a list of strings is used as a word list." (if (eq doc 'error) "(documentation error)" (setq score (+ score (apropos-score-doc doc))) - (substring doc 0 (string-match "\n" doc))) + (substring doc 0 (string-search "\n" doc))) "(not documented)"))) (and var-predicate (funcall var-predicate symbol) @@ -625,7 +625,7 @@ while a list of strings is used as a word list." (progn (setq score (+ score (apropos-score-doc doc))) (substring doc 0 - (string-match "\n" doc))))))) + (string-search "\n" doc))))))) (setcar (cdr (car p)) score) (setq p (cdr p)))) (and (let ((apropos-multi-type do-all)) @@ -639,7 +639,7 @@ while a list of strings is used as a word list." "Like (documentation-property SYMBOL PROPERTY RAW) but handle errors." (condition-case () (let ((doc (documentation-property symbol property raw))) - (if doc (substring doc 0 (string-match "\n" doc)) + (if doc (substring doc 0 (string-search "\n" doc)) "(not documented)")) (error "(error retrieving documentation)"))) @@ -767,7 +767,7 @@ the output includes key-bindings of commands." "(alias for undefined function)") (error "(can't retrieve function documentation)"))) - (substring doc 0 (string-match "\n" doc)) + (substring doc 0 (string-search "\n" doc)) "(not documented)")) (when (boundp symbol) (apropos-documentation-property diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index 83c516100ab..71ad7bd0c5d 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el @@ -1707,7 +1707,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself." (= (get-byte p) ?\C-z) (> (get-byte (1+ p)) 0)) (let* ((namefld (buffer-substring (+ p 2) (+ p 2 13))) - (fnlen (or (string-match "\0" namefld) 13)) + (fnlen (or (string-search "\0" namefld) 13)) (efnname (decode-coding-string (substring namefld 0 fnlen) archive-file-name-coding-system)) (csize (archive-l-e (+ p 15) 4)) @@ -2089,7 +2089,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself." (dirtype (get-byte (+ p 4))) (lfnlen (if (= dirtype 2) (get-byte (+ p 56)) 0)) (ldirlen (if (= dirtype 2) (get-byte (+ p 57)) 0)) - (fnlen (or (string-match "\0" namefld) 13)) + (fnlen (or (string-search "\0" namefld) 13)) (efnname (let ((str (concat (if (> ldirlen 0) diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index 1e31c3cadc0..db4751a9fbb 100644 --- a/lisp/calc/calc-aent.el +++ b/lisp/calc/calc-aent.el @@ -1139,7 +1139,7 @@ If the current Calc language does not use placeholders, return nil." 0) (setq sym (intern (substring (symbol-name sym) 1)))) - (or (string-match "-" (symbol-name sym)) + (or (string-search "-" (symbol-name sym)) (setq sym (intern (concat "calcFunc-" (symbol-name sym)))))) @@ -1149,7 +1149,7 @@ If the current Calc language does not use placeholders, return nil." (let ((val (list 'var (intern (math-remove-dashes (symbol-name sym))) - (if (string-match "-" (symbol-name sym)) + (if (string-search "-" (symbol-name sym)) sym (intern (concat "var-" (symbol-name sym))))))) diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index e85ecf03906..45337e187be 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -3088,7 +3088,7 @@ If X is not an error form, return 1." (math-read-big-err-msg nil) math-read-big-baseline math-read-big-h2 new-pos p) - (while (setq new-pos (string-match "\n" str pos)) + (while (setq new-pos (string-search "\n" str pos)) (setq math-read-big-lines (cons (substring str pos new-pos) math-read-big-lines) pos (1+ new-pos))) @@ -3249,7 +3249,7 @@ If X is not an error form, return 1." (t (let ((str (math-format-flat-expr x 0)) (pos 0) p) - (or (string-match "\"" str) + (or (string-search "\"" str) (while (<= (setq p (+ pos w)) (length str)) (while (and (> (setq p (1- p)) pos) (not (= (aref str p) ? )))) @@ -3278,7 +3278,7 @@ If X is not an error form, return 1." (math-format-radix-float a prec)) (format "%d#%s" calc-number-radix (math-format-radix-float a prec))))) - (if (and prec (> prec 191) (string-match "\\*" str)) + (if (and prec (> prec 191) (string-search "*" str)) (concat "(" str ")") str)))) ((eq (car a) 'frac) diff --git a/lisp/calc/calc-forms.el b/lisp/calc/calc-forms.el index ee53b94cd64..ac57011da04 100644 --- a/lisp/calc/calc-forms.el +++ b/lisp/calc/calc-forms.el @@ -2238,7 +2238,7 @@ and ends on the last Sunday of October at 2 a.m." (if (eq (car-safe str2) 'error) str2 (append '(calcFunc-lambda) (cdr str1) (list str2))))) - (if (string-match "#" str) + (if (string-search "#" str) (let ((calc-hashes-used 0)) (and (setq str (math-read-expr str)) (if (eq (car-safe str) 'error) diff --git a/lisp/calc/calc-graph.el b/lisp/calc/calc-graph.el index 423d1e64126..9ac24bf1889 100644 --- a/lisp/calc/calc-graph.el +++ b/lisp/calc/calc-graph.el @@ -1025,7 +1025,7 @@ This \"dumb\" driver will be present in Gnuplot 3.0." (calc-pop-stack 1)))) (if (string-match "\\[.+\\]" range) (setq range (substring range 1 -1))) - (if (and (not (string-match ":" range)) + (if (and (not (string-search ":" range)) (or (string-match "," range) (string-match " " range))) (aset range (match-beginning 0) ?\:)) diff --git a/lisp/calc/calc-keypd.el b/lisp/calc/calc-keypd.el index 1902a4f3f29..acbef27a1da 100644 --- a/lisp/calc/calc-keypd.el +++ b/lisp/calc/calc-keypd.el @@ -481,7 +481,7 @@ ":" (if (and (equal cmd "e") (or (not input) - (string-match + (string-search "#" input)) (> radix 14)) (format "*%d.^" radix) diff --git a/lisp/calc/calc-lang.el b/lisp/calc/calc-lang.el index 0117f449dd5..aef3173f5c0 100644 --- a/lisp/calc/calc-lang.el +++ b/lisp/calc/calc-lang.el @@ -660,7 +660,7 @@ (setq math-exp-pos (match-end 0) math-exp-token 'punc math-expr-data "[") - (let ((right (string-match "}" math-exp-str math-exp-pos))) + (let ((right (string-search "}" math-exp-str math-exp-pos))) (and right (setq math-exp-str (copy-sequence math-exp-str)) (aset math-exp-str right ?\])))))))))) @@ -899,7 +899,7 @@ (setq math-exp-pos (match-end 0) math-exp-token 'punc math-expr-data "[") - (let ((right (string-match "}" math-exp-str math-exp-pos))) + (let ((right (string-search "}" math-exp-str math-exp-pos))) (and right (setq math-exp-str (copy-sequence math-exp-str)) (aset math-exp-str right ?\])))))))))) @@ -2342,7 +2342,7 @@ order to Calc's." (math-read-big-emptyp math-rb-h1 (1+ v) h math-rb-v2 nil t) (if (= (math-read-big-char widest v) ?\() (progn - (setq line (if (string-match "-" p) + (setq line (if (string-search "-" p) (intern p) (intern (concat "calcFunc-" p))) h (1+ widest) @@ -2362,7 +2362,7 @@ order to Calc's." (setq p (cons line (nreverse p)))) (setq p (list 'var (intern (math-remove-dashes p)) - (if (string-match "-" p) + (if (string-search "-" p) (intern p) (intern (concat "var-" p))))))) diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el index 6f1e5c782df..f9dd9eb98a9 100644 --- a/lisp/calc/calc-prog.el +++ b/lisp/calc/calc-prog.el @@ -604,7 +604,7 @@ ((equal name "#") (search-backward "#") (error "Token `#' is reserved")) - ((and unquoted (string-match "#" name)) + ((and unquoted (string-search "#" name)) (error "Tokens containing `#' must be quoted")) ((not (string-match "[^ ]" name)) (search-backward "\"" nil t) @@ -1068,7 +1068,7 @@ Redefine the corresponding command." (insert (setq str (prin1-to-string (cons 'defun (cons cmd (cdr fcmd))))) "\n") - (or (and (string-match "\"" str) (not q-ok)) + (or (and (string-search "\"" str) (not q-ok)) (fill-region pt (point))) (indent-rigidly pt (point) 2) (delete-region pt (1+ pt)) @@ -1087,7 +1087,7 @@ Redefine the corresponding command." (cons 'defun (cons func (cdr ffunc))))) "\n") - (or (and (string-match "\"" str) (not q-ok)) + (or (and (string-search "\"" str) (not q-ok)) (fill-region pt (point))) (indent-rigidly pt (point) 2) (delete-region pt (1+ pt)) @@ -2132,7 +2132,7 @@ Redefine the corresponding command." (cdr prim)) ((memq exp math-exp-env) exp) - ((string-match "-" name) + ((string-search "-" name) exp) (t (intern (concat "var-" name)))))) diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 1e7d5e7766c..a10b3178302 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -2126,7 +2126,7 @@ the United States." (goto-char (point-max)) (cond ((null prefix) (insert " ")) ((and (> (length prefix) 4) - (string-match " " prefix 4)) + (string-search " " prefix 4)) (insert (substring prefix 0 4) " ")) (t (insert (format "%4s " prefix)))) (insert fval "\n") @@ -2469,7 +2469,7 @@ the United States." (calc-minibuffer-contains "[-+]?\\(.*\\+/- *\\|.*mod *\\)?\\([0-9]+\\.?0*[@oh] *\\)?\\([0-9]+\\.?0*['m] *\\)?[0-9]*\\(\\.?[0-9]*\\(e[-+]?[0-3]?[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?\\)?\\|[0-9]:\\([0-9]+:\\)?[0-9]*\\)?[\"s]?\\'")) (if (and (memq last-command-event '(?@ ?o ?h ?\' ?m)) - (string-match " " calc-hms-format)) + (string-search " " calc-hms-format)) (insert " ")) (if (and (memq last-command '(calcDigit-start calcDigit-key)) (eq last-command-event ?.)) @@ -3059,7 +3059,7 @@ the United States." (defun calc-count-lines (s) (let ((pos 0) (num 1)) - (while (setq pos (string-match "\n" s pos)) + (while (setq pos (string-search "\n" s pos)) (setq pos (1+ pos) num (1+ num))) num)) diff --git a/lisp/calc/calcalg2.el b/lisp/calc/calcalg2.el index 94b99aa29d8..8d93ae987a1 100644 --- a/lisp/calc/calcalg2.el +++ b/lisp/calc/calcalg2.el @@ -158,7 +158,7 @@ (calc-top-n 2) (calc-top-n 1))) (let ((var (if (and (string-match ",\\|[^ ] +[^ ]" var) - (not (string-match "\\[" var))) + (not (string-search "[" var))) (math-read-expr (concat "[" var "]")) (math-read-expr var)))) (if (eq (car-safe var) 'error) @@ -175,7 +175,7 @@ (calc-top-n 2) (calc-top-n 1))) (let ((var (if (and (string-match ",\\|[^ ] +[^ ]" var) - (not (string-match "\\[" var))) + (not (string-search "[" var))) (math-read-expr (concat "[" var "]")) (math-read-expr var)))) (if (eq (car-safe var) 'error) @@ -1028,7 +1028,7 @@ (fset 'calcFunc-integ math-old-integ)))) ;; See if the function is a symbolic derivative. - (and (string-match "'" (symbol-name (car expr))) + (and (string-search "'" (symbol-name (car expr))) (let ((name (symbol-name (car expr))) (p expr) (n 0) (which nil) (bad nil)) (while (setq n (1+ n) p (cdr p)) diff --git a/lisp/calc/calcalg3.el b/lisp/calc/calcalg3.el index ee3ae0a4c1f..3cb1886f3bd 100644 --- a/lisp/calc/calcalg3.el +++ b/lisp/calc/calcalg3.el @@ -56,7 +56,7 @@ (calc-top-n 1) (calc-top-n 2))) (let ((var (if (and (string-match ",\\|[^ ] +[^ ]" var) - (not (string-match "\\[" var))) + (not (string-search "[" var))) (math-read-expr (concat "[" var "]")) (math-read-expr var)))) (if (eq (car-safe var) 'error) @@ -81,7 +81,7 @@ (calc-top-n 1) (calc-top-n 2))) (let ((var (if (and (string-match ",\\|[^ ] +[^ ]" var) - (not (string-match "\\[" var))) + (not (string-search "[" var))) (math-read-expr (concat "[" var "]")) (math-read-expr var)))) (if (eq (car-safe var) 'error) @@ -490,7 +490,7 @@ defc) ","))))) (coefs nil)) - (setq vars (if (string-match "\\[" vars) + (setq vars (if (string-search "[" vars) (math-read-expr vars) (math-read-expr (concat "[" vars "]")))) (if (eq (car-safe vars) 'error) diff --git a/lisp/cedet/ede/speedbar.el b/lisp/cedet/ede/speedbar.el index 01d4f943df5..b321cb637bc 100644 --- a/lisp/cedet/ede/speedbar.el +++ b/lisp/cedet/ede/speedbar.el @@ -276,7 +276,7 @@ INDENT is the current indentation level." Etags does not support this feature. TEXT will be the button string. TOKEN will be the list, and INDENT is the current indentation level." - (cond ((string-match "\\+" text) ;we have to expand this file + (cond ((string-search "+" text) ;we have to expand this file (speedbar-change-expand-button-char ?-) (speedbar-with-writable (save-excursion @@ -284,7 +284,7 @@ level." (speedbar-insert-generic-list indent token 'ede-tag-expand 'ede-tag-find)))) - ((string-match "-" text) ;we have to contract this node + ((string-search "-" text) ;we have to contract this node (speedbar-change-expand-button-char ?+) (speedbar-delete-subblock indent)) (t (error "Ooops... not sure what to do"))) diff --git a/lisp/cedet/semantic/java.el b/lisp/cedet/semantic/java.el index f48b835fe39..0c2fb843f0b 100644 --- a/lisp/cedet/semantic/java.el +++ b/lisp/cedet/semantic/java.el @@ -141,7 +141,7 @@ corresponding compound declaration." (semantic-tag-put-attribute clone :dereference (+ dim0 (cdr dim))) (semantic-tag-set-bounds clone start end))) - ((and (eq class 'type) (string-match "\\." (semantic-tag-name tag))) + ((and (eq class 'type) (string-search "." (semantic-tag-name tag))) ;; javap outputs files where the package name is stuck onto the class or interface ;; name. To make this more regular, we extract the package name into a package statement, ;; then make the class name regular. diff --git a/lisp/cedet/semantic/sb.el b/lisp/cedet/semantic/sb.el index debdfd1dc04..fe981d34fb7 100644 --- a/lisp/cedet/semantic/sb.el +++ b/lisp/cedet/semantic/sb.el @@ -279,7 +279,7 @@ Optional MODIFIERS is additional text needed for variables." (defun semantic-sb-show-extra (text token indent) "Display additional information about the token as an expansion. TEXT TOKEN and INDENT are the details." - (cond ((string-match "\\+" text) ;we have to expand this file + (cond ((string-search "+" text) ;we have to expand this file (speedbar-change-expand-button-char ?-) (speedbar-with-writable (save-excursion @@ -288,7 +288,7 @@ TEXT TOKEN and INDENT are the details." (narrow-to-region (point) (point)) ;; Add in stuff specific to this type of token. (semantic-sb-insert-details token (1+ indent)))))) - ((string-match "-" text) ;we have to contract this node + ((string-search "-" text) ;we have to contract this node (speedbar-change-expand-button-char ?+) (speedbar-delete-subblock indent)) (t (error "Ooops... not sure what to do"))) @@ -325,7 +325,7 @@ TEXT TOKEN and INDENT are the details." (defun semantic-sb-expand-group (text token indent) "Expand a group which has semantic tokens. TEXT TOKEN and INDENT are the details." - (cond ((string-match "\\+" text) ;we have to expand this file + (cond ((string-search "+" text) ;we have to expand this file (speedbar-change-expand-button-char ?-) (speedbar-with-writable (save-excursion @@ -333,7 +333,7 @@ TEXT TOKEN and INDENT are the details." (save-restriction (narrow-to-region (point-min) (point)) (semantic-sb-buttons-plain (1+ indent) token))))) - ((string-match "-" text) ;we have to contract this node + ((string-search "-" text) ;we have to contract this node (speedbar-change-expand-button-char ?+) (speedbar-delete-subblock indent)) (t (error "Ooops... not sure what to do"))) diff --git a/lisp/cedet/semantic/wisent/python.el b/lisp/cedet/semantic/wisent/python.el index 9ac4ed9f518..fb878dde712 100644 --- a/lisp/cedet/semantic/wisent/python.el +++ b/lisp/cedet/semantic/wisent/python.el @@ -555,7 +555,7 @@ SELF or the instance name \"self\" if SELF is nil." (rx-to-string `(seq string-start ,(or self "self") ".")) name) - (not (string-match "\\." (substring name 5))))))) + (not (string-search "." (substring name 5))))))) (defun semantic-python-docstring-p (tag) "Return non-nil, when TAG is a Python documentation string." diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 980a1cc7179..7eae2e416bb 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -1910,7 +1910,7 @@ item in another window.\n\n")) (widget-put (get 'editable-field 'widget-type) :custom-show (lambda (_widget value) (let ((pp (pp-to-string value))) - (cond ((string-match-p "\n" pp) + (cond ((string-search "\n" pp) nil) ((> (length pp) 40) nil) diff --git a/lisp/descr-text.el b/lisp/descr-text.el index 85017de5d5e..f5e467d37e7 100644 --- a/lisp/descr-text.el +++ b/lisp/descr-text.el @@ -50,7 +50,7 @@ (when (string-match-p "\n\\'" pp) (setq pp (substring pp 0 (1- (length pp))))) - (if (and (not (string-match-p "\n" pp)) + (if (and (not (string-search "\n" pp)) (<= (length pp) (- (window-width) (current-column)))) (insert pp) (insert-text-button diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 5dbd55849e9..0b8c693b29f 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -1288,7 +1288,7 @@ Return nil if no change in files." nil t) nil t))) ;; We found an uncompression rule. - (let ((match (string-match " " command)) + (let ((match (string-search " " command)) (msg (concat "Uncompressing " file))) (unless (if match (dired-check-process msg diff --git a/lisp/dired-x.el b/lisp/dired-x.el index a990bd3fec3..380e47786fc 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -1044,11 +1044,11 @@ results in len2 (length file2)) ;; Find common initial file name components: (let (next) - (while (and (setq next (string-match "/" file1 index)) + (while (and (setq next (string-search "/" file1 index)) (< (setq next (1+ next)) (min len1 len2)) ;; For the comparison, both substrings must end in ;; `/', so NEXT is *one plus* the result of the - ;; string-match. + ;; string-search. ;; E.g., consider the case of linking "/tmp/a/abc" ;; to "/tmp/abc" erroneously giving "/tmp/a" instead ;; of "/tmp/" as common initial component @@ -1066,7 +1066,7 @@ results in (start 0) (count 0)) ;; Count number of slashes we must compensate for ... - (while (setq start (string-match "/" tem start)) + (while (setq start (string-search "/" tem start)) (setq count (1+ count) start (1+ start))) ;; ... and prepend a "../" for each slash found: diff --git a/lisp/dired.el b/lisp/dired.el index 816b8b69881..ff822506bf1 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2909,7 +2909,7 @@ dired-buffers." (if (= (aref pattern (1+ set-start)) ?^) (+ 3 set-start) (+ 2 set-start))) - (set-end (string-match-p "]" pattern set-cont)) + (set-end (string-search "]" pattern set-cont)) (set (substring pattern set-start (1+ set-end)))) (setq regexp (concat regexp set)) (setq matched-in-pattern (1+ set-end)))) diff --git a/lisp/dos-fns.el b/lisp/dos-fns.el index 255edd0f371..e0a533c637a 100644 --- a/lisp/dos-fns.el +++ b/lisp/dos-fns.el @@ -86,7 +86,7 @@ sure to obey the 8.3 limitations." ;; close to the beginning, change that to a period. This ;; is so we could salvage more characters of the original ;; name by pushing them into the extension. - (if (and (not (string-match "\\." string)) + (if (and (not (string-search "." string)) (> (length string) 8) ;; We don't gain anything if we put the period closer ;; than 5 chars from the beginning (5 + 3 = 8). @@ -100,21 +100,21 @@ sure to obey the 8.3 limitations." ;; If we don't have a period in the first 8 chars, insert one. ;; This enables having 3 more characters from the original ;; name in the extension. - (if (> (or (string-match "\\." string) (length string)) + (if (> (or (string-search "." string) (length string)) 8) (setq string (concat (substring string 0 8) "." (substring string 8)))) - (setq firstdot (or (string-match "\\." string) + (setq firstdot (or (string-search "." string) (1- (length string)))) ;; Truncate to 3 chars after the first period. (if (> (length string) (+ firstdot 4)) (setq string (substring string 0 (+ firstdot 4)))) ;; Change all periods except the first one into underscores. ;; (DOS doesn't allow more than one period.) - (while (string-match "\\." string (1+ firstdot)) - (setq i (string-match "\\." string (1+ firstdot))) + (while (string-search "." string (1+ firstdot)) + (setq i (string-search "." string (1+ firstdot))) (aset string i ?_)) ;; If the last character of the original filename was `~' or `#', ;; make sure the munged name ends with it also. This is so that @@ -160,7 +160,7 @@ sure to obey the 8.3 limitations." (strlen (length string)) (lastchar (aref string (1- strlen))) firstdot) - (setq firstdot (string-match "\\." string)) + (setq firstdot (string-search "." string)) (cond (firstdot ;; Truncate the extension to 3 characters. diff --git a/lisp/edmacro.el b/lisp/edmacro.el index 84de69a2ce1..9e4a71c336e 100644 --- a/lisp/edmacro.el +++ b/lisp/edmacro.el @@ -559,7 +559,7 @@ doubt, use whitespace." (or fkey key) " ")))) (if prefix (setq desc (concat (edmacro-sanitize-for-string prefix) desc))) - (unless (string-match " " desc) + (unless (string-search " " desc) (let ((times 1) (pos bind-len)) (while (not (cl-mismatch rest-mac rest-mac :start1 0 :end1 bind-len diff --git a/lisp/emacs-lisp/eieio-opt.el b/lisp/emacs-lisp/eieio-opt.el index 08a6debc203..9c842f46829 100644 --- a/lisp/emacs-lisp/eieio-opt.el +++ b/lisp/emacs-lisp/eieio-opt.el @@ -323,7 +323,7 @@ current expansion depth." (defun eieio-sb-expand (text class indent) "For button TEXT, expand CLASS at the current location. Argument INDENT is the depth of indentation." - (cond ((string-match "\\+" text) ;we have to expand this file + (cond ((string-search "+" text) ;we have to expand this file (speedbar-change-expand-button-char ?-) (speedbar-with-writable (save-excursion @@ -332,7 +332,7 @@ Argument INDENT is the depth of indentation." (while subclasses (eieio-class-button (car subclasses) (1+ indent)) (setq subclasses (cdr subclasses))))))) - ((string-match "-" text) ;we have to contract this node + ((string-search "-" text) ;we have to contract this node (speedbar-change-expand-button-char ?+) (speedbar-delete-subblock indent)) (t (error "Ooops... not sure what to do"))) diff --git a/lisp/emacs-lisp/eieio-speedbar.el b/lisp/emacs-lisp/eieio-speedbar.el index 3f2a6537ab8..86b22cad73b 100644 --- a/lisp/emacs-lisp/eieio-speedbar.el +++ b/lisp/emacs-lisp/eieio-speedbar.el @@ -344,14 +344,14 @@ The object is at indentation level INDENT." (defun eieio-speedbar-object-expand (text token indent) "Expand object represented by TEXT. TOKEN is the object. INDENT is the current indentation level." - (cond ((string-match "\\+" text) ;we have to expand this file + (cond ((string-search "+" text) ;we have to expand this file (speedbar-change-expand-button-char ?-) (oset token expanded t) (speedbar-with-writable (save-excursion (end-of-line) (forward-char 1) (eieio-speedbar-expand token (1+ indent))))) - ((string-match "-" text) ;we have to contract this node + ((string-search "-" text) ;we have to contract this node (speedbar-change-expand-button-char ?+) (oset token expanded nil) (speedbar-delete-subblock indent)) diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el index 83da495edf0..d6a6a5f0442 100644 --- a/lisp/emacs-lisp/lisp-mnt.el +++ b/lisp/emacs-lisp/lisp-mnt.el @@ -458,7 +458,7 @@ each line." "Return list of keywords given in file FILE." (let ((keywords (lm-keywords file))) (if keywords - (if (string-match-p "," keywords) + (if (string-search "," keywords) (split-string keywords ",[ \t\n]*" t "[ ]+") (split-string keywords "[ \t\n]+" t "[ ]+"))))) diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el index 67de690e67d..36b275e2d3c 100644 --- a/lisp/emacs-lisp/warnings.el +++ b/lisp/emacs-lisp/warnings.el @@ -307,7 +307,7 @@ entirely by setting `warning-suppress-types' or 'type 'warning-suppress-log-warning 'warning-type type)) (funcall newline) - (when (and warning-fill-prefix (not (string-match "\n" message))) + (when (and warning-fill-prefix (not (string-search "\n" message))) (let ((fill-prefix warning-fill-prefix) (fill-column warning-fill-column)) (fill-region start (point)))) diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el index 5b2fa048a09..55930e7e6bc 100644 --- a/lisp/emulation/viper-ex.el +++ b/lisp/emulation/viper-ex.el @@ -1100,7 +1100,7 @@ reversed." (setq viper-keep-reading-filename nil val (read-file-name (concat prompt str) nil default-directory)) (setq val (expand-file-name val)) - (if (and (string-match " " val) + (if (and (string-search " " val) (ex-cmd-accepts-multiple-files-p ex-token)) (setq val (concat "\"" val "\""))) (setq str (concat str (if (equal val "") "" " ") @@ -2300,10 +2300,10 @@ Type `mak ' (including the space) to run make with no args." (defun ex-print-display-lines (lines) (cond ;; String doesn't contain a newline. - ((not (string-match "\n" lines)) + ((not (string-search "\n" lines)) (message "%s" lines)) ;; String contains only one newline at the end. Strip it off. - ((= (string-match "\n" lines) (1- (length lines))) + ((= (string-search "\n" lines) (1- (length lines))) (message "%s" (substring lines 0 -1))) ;; String spans more than one line. Use a temporary buffer. (t diff --git a/lisp/env.el b/lisp/env.el index 51247f1ff84..83f43d1006b 100644 --- a/lisp/env.el +++ b/lisp/env.el @@ -44,7 +44,7 @@ If it is also not t, RET does not exit if it does non-null completion." (completing-read prompt (mapcar (lambda (enventry) (let ((str (substring enventry 0 - (string-match "=" enventry)))) + (string-search "=" enventry)))) (if (multibyte-string-p str) (decode-coding-string str locale-coding-system t) @@ -184,7 +184,7 @@ a side-effect." (setq variable (encode-coding-string variable locale-coding-system))) (if (and value (multibyte-string-p value)) (setq value (encode-coding-string value locale-coding-system))) - (if (string-match-p "=" variable) + (if (string-search "=" variable) (error "Environment variable name `%s' contains `='" variable)) (if (string-equal "TZ" variable) (set-time-zone-rule value)) diff --git a/lisp/epa-mail.el b/lisp/epa-mail.el index bed0c065aea..b9dd437ed12 100644 --- a/lisp/epa-mail.el +++ b/lisp/epa-mail.el @@ -219,7 +219,7 @@ If no one is selected, symmetric encryption will be performed. " (epa-mail--find-usable-key (epg-list-keys (epg-make-context epa-protocol) - (if (string-match "@" recipient) + (if (string-search "@" recipient) (concat "<" recipient ">") recipient)) 'encrypt))) diff --git a/lisp/epg.el b/lisp/epg.el index 36515ef4e5f..9d6295594fd 100644 --- a/lisp/epg.el +++ b/lisp/epg.el @@ -573,7 +573,7 @@ callback data (if any)." "--status-fd" "1" "--yes") (if (and (not (eq (epg-context-protocol context) 'CMS)) - (string-match ":" (or agent-info ""))) + (string-search ":" (or agent-info ""))) '("--use-agent")) (if (and (not (eq (epg-context-protocol context) 'CMS)) (epg-context-progress-callback context)) diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 7a17ee233fd..6d84665873e 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -950,15 +950,15 @@ PROCs `process-buffer' is `current-buffer' when this function is called." (unless (string= string "") ;; Ignore empty strings (save-match-data (let* ((tag-list (when (eq (aref string 0) ?@) - (substring string 1 (string-match " " string)))) + (substring string 1 (string-search " " string)))) (msg (make-erc-response :unparsed string :tags (when tag-list (erc-parse-tags tag-list)))) (string (if tag-list - (substring string (+ 1 (string-match " " string))) + (substring string (+ 1 (string-search " " string))) string)) (posn (if (eq (aref string 0) ?:) - (string-match " " string) + (string-search " " string) 0))) (setf (erc-response.sender msg) @@ -968,7 +968,7 @@ PROCs `process-buffer' is `current-buffer' when this function is called." (setf (erc-response.command msg) (let* ((bposn (string-match "[^ \n]" string posn)) - (eposn (string-match " " string bposn))) + (eposn (string-search " " string bposn))) (setq posn (and eposn (string-match "[^ \n]" string eposn))) (substring string bposn eposn))) @@ -976,7 +976,7 @@ PROCs `process-buffer' is `current-buffer' when this function is called." (while (and posn (not (eq (aref string posn) ?:))) (push (let* ((bposn posn) - (eposn (string-match " " string bposn))) + (eposn (string-search " " string bposn))) (setq posn (and eposn (string-match "[^ \n]" string eposn))) (substring string bposn eposn)) diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el index fcdb8df2032..de72624aaa1 100644 --- a/lisp/erc/erc-dcc.el +++ b/lisp/erc/erc-dcc.el @@ -187,7 +187,7 @@ compared with `erc-nick-equal-p' which is IRC case-insensitive." (plist-get elt prop))) ;; if the property exists and is equal, we continue, else, try the ;; next element of the list - (or (and (eq prop :nick) (string-match "!" val) + (or (and (eq prop :nick) (string-search "!" val) test (string-equal test val)) (and (eq prop :nick) test val diff --git a/lisp/erc/erc-speedbar.el b/lisp/erc/erc-speedbar.el index bb858445235..e61e741302d 100644 --- a/lisp/erc/erc-speedbar.el +++ b/lisp/erc/erc-speedbar.el @@ -139,7 +139,7 @@ This will add a speedbar major display mode." t)))) (defun erc-speedbar-expand-server (text server indent) - (cond ((string-match "\\+" text) + (cond ((string-search "+" text) (speedbar-change-expand-button-char ?-) (if (speedbar-with-writable (save-excursion @@ -147,7 +147,7 @@ This will add a speedbar major display mode." (erc-speedbar-channel-buttons nil (1+ indent) server))) (speedbar-change-expand-button-char ?-) (speedbar-change-expand-button-char ??))) - ((string-match "-" text) ;we have to contract this node + ((string-search "-" text) ;we have to contract this node (speedbar-change-expand-button-char ?+) (speedbar-delete-subblock indent)) (t (error "Ooops... not sure what to do"))) @@ -184,7 +184,7 @@ This will add a speedbar major display mode." "For the line matching TEXT, in CHANNEL, expand or contract a line. INDENT is the current indentation level." (cond - ((string-match "\\+" text) + ((string-search "+" text) (speedbar-change-expand-button-char ?-) (speedbar-with-writable (save-excursion @@ -233,7 +233,7 @@ INDENT is the current indentation level." (speedbar-with-writable (dolist (entry names) (erc-speedbar-insert-user entry ?+ (1+ indent)))))))))) - ((string-match "-" text) + ((string-search "-" text) (speedbar-change-expand-button-char ?+) (speedbar-delete-subblock indent)) (t (error "Ooops... not sure what to do"))) @@ -284,7 +284,7 @@ The update is only done when the channel is actually expanded already." (erc-speedbar-expand-channel "+" buffer 1))))) (defun erc-speedbar-expand-user (text token indent) - (cond ((string-match "\\+" text) + (cond ((string-search "+" text) (speedbar-change-expand-button-char ?-) (speedbar-with-writable (save-excursion @@ -307,7 +307,7 @@ The update is only done when the channel is actually expanded already." nil nil nil nil info nil nil nil (1+ indent))))))) - ((string-match "-" text) + ((string-search "-" text) (speedbar-change-expand-button-char ?+) (speedbar-delete-subblock indent)) (t (error "Ooops... not sure what to do"))) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index c66b03d2e4e..73202016ba7 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -5587,7 +5587,7 @@ This returns non-nil only if we actually send anything." (when (and (erc-input-sendp state) erc-send-this) (let ((string (erc-input-string state))) - (if (or (string-match "\n" string) + (if (or (string-search "\n" string) (not (string-match erc-command-regexp string))) (mapc (lambda (line) diff --git a/lisp/eshell/em-glob.el b/lisp/eshell/em-glob.el index 316094b17e4..e36f2d0c7fe 100644 --- a/lisp/eshell/em-glob.el +++ b/lisp/eshell/em-glob.el @@ -291,7 +291,7 @@ the form: (let ((index 1)) (setq incl glob) (while (and (eq incl glob) - (setq index (string-match "~" glob index))) + (setq index (string-search "~" glob index))) (if (or (get-text-property index 'escaped glob) (or (= (1+ index) len))) (setq index (1+ index)) diff --git a/lisp/eshell/esh-proc.el b/lisp/eshell/esh-proc.el index 96c9a60deab..7a0b26a0658 100644 --- a/lisp/eshell/esh-proc.el +++ b/lisp/eshell/esh-proc.el @@ -266,7 +266,7 @@ See `eshell-needs-pipe'." ;; neither 'first nor 'last? See bug#1388 discussion. (catch 'found (dolist (exe eshell-needs-pipe) - (if (string-equal exe (if (string-match "/" exe) + (if (string-equal exe (if (string-search "/" exe) command (file-name-nondirectory command))) (throw 'found t)))))) diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el index 30104816f07..72de6b13e2e 100644 --- a/lisp/eshell/esh-util.el +++ b/lisp/eshell/esh-util.el @@ -204,7 +204,7 @@ then quoting is done by a backslash, rather than a doubled delimiter." string (if (eq (aref string (1- len)) ?\n) (setq string (substring string 0 (1- len)))) - (if (string-match "\n" string) + (if (string-search "\n" string) (split-string string "\n") (if (and eshell-convert-numeric-arguments (string-match diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index 9fccc6b1c9d..5dc6a193050 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el @@ -381,7 +381,7 @@ This function is explicit for adding to `eshell-parse-argument-hook'." (defun eshell-envvar-names (&optional environment) "Return a list of currently visible environment variable names." (mapcar (lambda (x) - (substring x 0 (string-match "=" x))) + (substring x 0 (string-search "=" x))) (or environment process-environment))) (defun eshell-environment-variables () diff --git a/lisp/faces.el b/lisp/faces.el index 4bb3a2b00fc..a3a6f1b78dd 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -3062,7 +3062,7 @@ also the same size as FACE on FRAME, or fail." (let ((fonts (x-list-fonts pattern face frame 1))) (or fonts (if face - (if (string-match-p "\\*" pattern) + (if (string-search "*" pattern) (if (null (face-font face)) (error "No matching fonts are the same height as the frame default font") (error "No matching fonts are the same height as face `%s'" face)) diff --git a/lisp/ffap.el b/lisp/ffap.el index 9be9c2906ea..0069af25974 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1418,7 +1418,7 @@ which may actually result in an URL rather than a filename." (string (ffap-string-at-point)) ; uses mode alist (name (or (condition-case nil - (and (not (string-match "//" string)) ; foo.com://bar + (and (not (string-search "//" string)) ; foo.com://bar (substitute-in-file-name string)) (error nil)) string)) diff --git a/lisp/files.el b/lisp/files.el index 54d0b919e1d..6c366177ce8 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -6979,7 +6979,7 @@ by `sh' are supported." (prog1 ; copy everything upto next `]'. (substring wildcard i - (setq j (string-match + (setq j (string-search "]" wildcard i))) (setq i (if j (1- j) (1- len))))))) ((eq ch ?.) "\\.") @@ -7105,7 +7105,7 @@ need to be passed verbatim to shell commands." ;; DOS/Windows don't allow `"' in file names. So if the ;; argument has quotes, we can safely assume it is already ;; quoted by the caller. - (if (or (string-match "[\"]" pattern) + (if (or (string-search "\"" pattern) ;; We quote [&()#$`'] in case their shell is a port of a ;; Unixy shell. We quote [,=+] because stock DOS and ;; Windows shells require that in some cases, such as diff --git a/lisp/forms.el b/lisp/forms.el index 8696aea98ee..46f4df9b6c4 100644 --- a/lisp/forms.el +++ b/lisp/forms.el @@ -1576,7 +1576,7 @@ As a side effect: sets `forms--the-record-list'." (forms--trans the-record "\n" forms-multi-line)) ;; A final sanity check before updating. - (if (string-match-p "\n" the-record) + (if (string-search "\n" the-record) (error "Multi-line fields in this record - update refused")) (with-current-buffer forms--file-buffer diff --git a/lisp/frameset.el b/lisp/frameset.el index e698d5401db..6aa94f8be5a 100644 --- a/lisp/frameset.el +++ b/lisp/frameset.el @@ -636,7 +636,7 @@ see `frameset-filter-alist'." (not (frameset-switch-to-gui-p parameters)) (let* ((prefix:p (symbol-name (car current))) (p (intern (substring prefix:p - (1+ (string-match-p ":" prefix:p))))) + (1+ (string-search ":" prefix:p))))) (val (cdr current)) (found (assq p filtered))) (if (not found) diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index d65e75e44c2..3c1403e1551 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -2519,7 +2519,7 @@ If PROMPT (the prefix), prompt for a coding system to use." format (and ctl (mail-content-type-get ctl 'format))) (when cte (setq cte (mail-header-strip-cte cte))) - (if (and ctl (not (string-match "/" (car ctl)))) + (if (and ctl (not (string-search "/" (car ctl)))) (setq ctl nil)) (goto-char (point-max))) (forward-line 1) diff --git a/lisp/gnus/gnus-kill.el b/lisp/gnus/gnus-kill.el index f73627a6480..525823e72ce 100644 --- a/lisp/gnus/gnus-kill.el +++ b/lisp/gnus/gnus-kill.el @@ -435,7 +435,7 @@ Returns the number of articles marked as read." ;; The "f:+" command marks everything *but* the matches as read, ;; so we simply first match everything as read, and then unmark ;; PATTERN later. - (when (string-match "\\+" commands) + (when (string-search "+" commands) (gnus-kill "from" ".") (setq commands "m")) diff --git a/lisp/gnus/gnus-mlspl.el b/lisp/gnus/gnus-mlspl.el index 664027f0164..6adda2ed147 100644 --- a/lisp/gnus/gnus-mlspl.el +++ b/lisp/gnus/gnus-mlspl.el @@ -169,7 +169,7 @@ Calling (gnus-group-split-fancy nil nil \"mail.others\") returns: (when (not (null params)) (let ((split-spec (assoc 'split-spec params)) group-clean) ;; Remove backend from group name - (setq group-clean (string-match ":" group)) + (setq group-clean (string-search ":" group)) (setq group-clean (if group-clean (substring group (1+ group-clean)) diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index db54237a767..ef89e6e9fcb 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@ -1323,7 +1323,7 @@ For the \"inline\" alternatives, also see the variable ((stringp self) (insert "Gcc: " (encode-coding-string - (if (string-match " " self) + (if (string-search " " self) (concat "\"" self "\"") self) (gnus-group-name-charset (gnus-inews-group-method self) @@ -1681,7 +1681,7 @@ this is a reply." (gnus-group-find-parameter group 'gcc-self t))) (gcc-self-get (lambda (gcc-self-val group) (if (stringp gcc-self-val) - (if (string-match " " gcc-self-val) + (if (string-search " " gcc-self-val) (concat "\"" gcc-self-val "\"") gcc-self-val) ;; In nndoc groups, we use the parent group name @@ -1689,7 +1689,7 @@ this is a reply." (let ((group (or (gnus-group-find-parameter gnus-newsgroup-name 'parent-group) group))) - (if (string-match " " group) + (if (string-search " " group) (concat "\"" group "\"") group))))) result @@ -1752,11 +1752,11 @@ this is a reply." (gnus-delete-line))) ;; Use the list of groups. (while (setq name (pop groups)) - (let ((str (if (string-match ":" name) + (let ((str (if (string-search ":" name) name (gnus-group-prefixed-name name gnus-message-archive-method)))) - (insert (if (string-match " " str) + (insert (if (string-search " " str) (concat "\"" str "\"") str))) (when groups diff --git a/lisp/gnus/gnus-rfc1843.el b/lisp/gnus/gnus-rfc1843.el index 5697c870888..c135ecea369 100644 --- a/lisp/gnus/gnus-rfc1843.el +++ b/lisp/gnus/gnus-rfc1843.el @@ -44,7 +44,7 @@ (case-fold-search t) (ct (message-fetch-field "Content-Type" t)) (ctl (and ct (mail-header-parse-content-type ct)))) - (if (and ctl (not (string-match "/" (car ctl)))) + (if (and ctl (not (string-search "/" (car ctl)))) (setq ctl nil)) (goto-char (point-max)) (widen) diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 59b8efaa3ac..2a8069d400c 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -1392,7 +1392,7 @@ Returns a list of [group article score] vectors." (if (string-match-p "\\`[[:digit:]]+\\'" article) (string-to-number article) (nnmaildir-base-name-to-article-number - (substring article 0 (string-match ":" article)) + (substring article 0 (string-search ":" article)) group (string-remove-prefix "nnmaildir:" server)))) (when (and (numberp article) (or (null groups) @@ -2136,7 +2136,7 @@ article came from is also searched." ;; If the value contains spaces, make sure it's ;; quoted. (when (and (memql status '(exact finished)) - (or (string-match-p " " str) + (or (string-search " " str) in-string)) (unless (looking-at-p "\\s\"") (insert "\"")) diff --git a/lisp/gnus/gnus-spec.el b/lisp/gnus/gnus-spec.el index cb60108ea9c..59c6956ac2f 100644 --- a/lisp/gnus/gnus-spec.el +++ b/lisp/gnus/gnus-spec.el @@ -582,7 +582,7 @@ or to characters when given a pad value." ((string= fstring "") nil) ;; Not a format string. - ((not (string-match "%" fstring)) + ((not (string-search "%" fstring)) (list fstring)) ;; A format string with just a single string spec. ((string= fstring "%s") diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index dc004927b67..856e95c0ba0 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -9199,7 +9199,7 @@ specified by the `gnus-refer-thread-limit' variable." (unless (string-match ">$" message-id) (setq message-id (concat message-id ">"))) ;; People often post MIDs from URLs, so unhex it: - (unless (string-match "@" message-id) + (unless (string-search "@" message-id) (setq message-id (gnus-url-unhex-string message-id))) (let* ((header (gnus-id-to-header message-id)) (sparse (and header diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index 7a5e00c5ec9..70ae81d95ea 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -154,7 +154,7 @@ is slower." (and (string-match "(.+)" from) (setq name (substring from (1+ (match-beginning 0)) (1- (match-end 0))))) - (and (string-match "()" from) + (and (string-search "()" from) (setq name address)) ;; XOVER might not support folded From headers. (and (string-match "(.*" from) @@ -265,7 +265,7 @@ If END is non-nil, use the end of the span instead." (defun gnus-newsgroup-directory-form (newsgroup) "Make hierarchical directory name from NEWSGROUP name." (let* ((newsgroup (gnus-newsgroup-savable-name newsgroup)) - (idx (string-match ":" newsgroup))) + (idx (string-search ":" newsgroup))) (concat (if idx (substring newsgroup 0 idx)) (if idx "/") diff --git a/lisp/gnus/gnus-uu.el b/lisp/gnus/gnus-uu.el index ceb2ebcdcb1..6c926384c97 100644 --- a/lisp/gnus/gnus-uu.el +++ b/lisp/gnus/gnus-uu.el @@ -1434,7 +1434,7 @@ When called interactively, prompt for REGEXP." "View FILE using the gnus-uu methods." (let ((action (gnus-uu-get-action file))) (gnus-execute-command - (if (string-match "%" action) + (if (string-search "%" action) (format action file) (concat action " " file)) (eq gnus-view-pseudos 'not-confirm)))) diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index 8b93accccad..d52bd26a2cb 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -3526,7 +3526,7 @@ You should probably use `gnus-find-method-for-group' instead." (defun gnus-group-native-p (group) "Say whether the group is native or not." - (not (string-match ":" group))) + (not (string-search ":" group))) (defun gnus-group-secondary-p (group) "Say whether the group is secondary or not." @@ -3742,13 +3742,13 @@ just the host name." ;; Separate foreign select method from group name and collapse. ;; If method contains a server, collapse to non-domain server name, ;; otherwise collapse to select method. - (let* ((colon (string-match ":" group)) + (let* ((colon (string-search ":" group)) (server (and colon (substring group 0 colon))) - (plus (and server (string-match "\\+" server)))) + (plus (and server (string-search "+" server)))) (when server (if plus (setq foreign (substring server (+ 1 plus) - (string-match "\\." server)) + (string-search "." server)) group (substring group (+ 1 colon))) (setq foreign server group (substring group (+ 1 colon)))) diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index a3ffaec3ff3..bff1b2a60d9 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -5340,7 +5340,7 @@ Otherwise, generate and save a value for `canlock-password' first." (followup-to (message-fetch-field "followup-to")) to) (when (and newsgroups - (string-match "," newsgroups) + (string-search "," newsgroups) (not followup-to) (not (zerop @@ -5371,11 +5371,11 @@ Otherwise, generate and save a value for `canlock-password' first." (message-id (message-fetch-field "message-id" t))) (or (not message-id) ;; Is there an @ in the ID? - (and (string-match "@" message-id) + (and (string-search "@" message-id) ;; Is there a dot in the ID? (string-match "@[^.]*\\." message-id) ;; Does the ID end with a dot? - (not (string-match "\\.>" message-id))) + (not (string-search ".>" message-id))) (y-or-n-p (format "The Message-ID looks strange: \"%s\". Really post? " message-id))))) @@ -5497,8 +5497,8 @@ Otherwise, generate and save a value for `canlock-password' first." "@[^\\.]*\\." (setq ad (nth 1 (mail-extract-address-components from))))) ;larsi@ifi - (string-match "\\.\\." ad) ;larsi@ifi..uio - (string-match "@\\." ad) ;larsi@.ifi.uio + (string-search ".." ad) ;larsi@ifi..uio + (string-search "@." ad) ;larsi@.ifi.uio (string-match "\\.$" ad) ;larsi@ifi.uio. (not (string-match "^[^@]+@[^@]+$" ad)) ;larsi.ifi.uio (string-match "(.*).*(.*)" from)) ;(lars) (lars) @@ -5523,7 +5523,7 @@ Otherwise, generate and save a value for `canlock-password' first." (cond ((not reply-to) t) - ((string-match "," reply-to) + ((string-search "," reply-to) (y-or-n-p (format "Multiple Reply-To addresses: \"%s\". Really post? " reply-to))) @@ -5531,8 +5531,8 @@ Otherwise, generate and save a value for `canlock-password' first." "@[^\\.]*\\." (setq ad (nth 1 (mail-extract-address-components reply-to))))) ;larsi@ifi - (string-match "\\.\\." ad) ;larsi@ifi..uio - (string-match "@\\." ad) ;larsi@.ifi.uio + (string-search ".." ad) ;larsi@ifi..uio + (string-search "@." ad) ;larsi@.ifi.uio (string-match "\\.$" ad) ;larsi@ifi.uio. (not (string-match "^[^@]+@[^@]+$" ad)) ;larsi.ifi.uio (string-match "(.*).*(.*)" reply-to)) ;(lars) (lars) @@ -5806,7 +5806,7 @@ In posting styles use `(\"Expires\" (make-expires-date 30))'." (mail-header-subject message-reply-headers)) (message-strip-subject-re psubject)))) (and psupersedes - (string-match "_-_@" psupersedes))) + (string-search "_-_@" psupersedes))) "_-_" "")) "@" (message-make-fqdn) ">")) @@ -6022,7 +6022,7 @@ give as trustworthy answer as possible." "Return the pertinent part of `user-mail-address'." (when (and user-mail-address (string-match "@.*\\." user-mail-address)) - (if (string-match " " user-mail-address) + (if (string-search " " user-mail-address) (nth 1 (mail-extract-address-components user-mail-address)) user-mail-address))) @@ -6053,7 +6053,7 @@ give as trustworthy answer as possible." message-user-fqdn) ;; A system name without any dots is unlikely to be a good fully ;; qualified domain name. - ((and (string-match "[.]" sysname) + ((and (string-search "." sysname) (not (string-match message-bogus-system-names sysname))) ;; `system-name' returned the right result. sysname) @@ -7053,7 +7053,7 @@ article, it has the value of " mft " -which directs your response to " (if (string-match "," mft) +which directs your response to " (if (string-search "," mft) "the specified addresses" "that address only") ". @@ -7357,7 +7357,7 @@ want to get rid of this query permanently.")) You should normally obey the Followup-To: header. `Followup-To: " followup-to "' -directs your response to " (if (string-match "," followup-to) +directs your response to " (if (string-search "," followup-to) "the specified newsgroups" "that newsgroup only") ". diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index 02cd6af0c98..82d1de25f3d 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -649,7 +649,7 @@ MIME-Version header before proceeding." (setq description (mail-decode-encoded-word-string description))))) (if (or (not ctl) - (not (string-match "/" (car ctl)))) + (not (string-search "/" (car ctl)))) (mm-dissect-singlepart (list mm-dissect-default-type) (and cte (intern (downcase (mail-header-strip-cte cte)))) diff --git a/lisp/gnus/nnheader.el b/lisp/gnus/nnheader.el index 708887cb9c7..c35e89289a2 100644 --- a/lisp/gnus/nnheader.el +++ b/lisp/gnus/nnheader.el @@ -803,7 +803,7 @@ If FORMAT isn't a format string, it and all ARGS will be inserted without formatting." (with-current-buffer nntp-server-buffer (erase-buffer) - (if (string-match "%" format) + (if (string-search "%" format) (insert (apply #'format format args)) (apply #'insert format args)) t)) diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 3cf65453f3b..8a48cd87dba 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -1299,7 +1299,7 @@ If LIMIT, first try to limit the search to the N last articles." (when (and (nnimap-greeting nnimap-object) (string-match greeting-match (nnimap-greeting nnimap-object)) (eq type 'append) - (string-match "\000" data)) + (string-search "\000" data)) (let ((choice (gnus-multiple-choice "Message contains NUL characters. Delete, continue, abort? " '((?d "Delete NUL characters") @@ -1761,7 +1761,7 @@ If LIMIT, first try to limit the search to the N last articles." (let ((result nil)) (dolist (elem (split-string irange ",")) (push - (if (string-match ":" elem) + (if (string-search ":" elem) (let ((numbers (split-string elem ":"))) (cons (string-to-number (car numbers)) (string-to-number (cadr numbers)))) diff --git a/lisp/gnus/nnmaildir.el b/lisp/gnus/nnmaildir.el index 372df64e2e5..171f0813b38 100644 --- a/lisp/gnus/nnmaildir.el +++ b/lisp/gnus/nnmaildir.el @@ -87,7 +87,7 @@ See `nnmaildir-flag-mark-mapping'." (defun nnmaildir--ensure-suffix (filename) "Ensure that FILENAME contains the suffix \":2,\"." - (if (string-match-p ":2," filename) + (if (string-search ":2," filename) filename (concat filename ":2,"))) diff --git a/lisp/gnus/nnmairix.el b/lisp/gnus/nnmairix.el index c6aaf460ece..92944887f44 100644 --- a/lisp/gnus/nnmairix.el +++ b/lisp/gnus/nnmairix.el @@ -1629,7 +1629,7 @@ SERVER." (while (string-match "[<>]" mid) (setq mid (replace-match "" t t mid))) ;; mairix somehow does not like '$' in message-id - (when (string-match "\\$" mid) + (when (string-search "$" mid) (setq mid (concat mid "="))) (while (string-match "\\$" mid) (setq mid (replace-match "=," t t mid))) diff --git a/lisp/gnus/nnrss.el b/lisp/gnus/nnrss.el index 8cd8cbe84f1..0f12ee0e9d2 100644 --- a/lisp/gnus/nnrss.el +++ b/lisp/gnus/nnrss.el @@ -849,7 +849,7 @@ DATA should be the output of `xml-parse-region'." (defmacro nnrss-match-macro (base-uri item onsite-list offsite-list) `(cond ((or (string-match (concat "^" ,base-uri) ,item) - (not (string-match "://" ,item))) + (not (string-search "://" ,item))) (setq ,onsite-list (append ,onsite-list (list ,item)))) (t (setq ,offsite-list (append ,offsite-list (list ,item)))))) diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el index 1fd2ed06eba..615a3c931bf 100644 --- a/lisp/gnus/nntp.el +++ b/lisp/gnus/nntp.el @@ -1697,7 +1697,7 @@ If SEND-IF-FORCE, only send authinfo to the server if the ;; article comes from that group, I'd say. ((and (setq newsgroups (mail-fetch-field "newsgroups")) - (not (string-match "," newsgroups))) + (not (string-search "," newsgroups))) newsgroups) ;; If there is more than one group in the ;; Newsgroups header, then the Xref header should @@ -1725,7 +1725,7 @@ If SEND-IF-FORCE, only send authinfo to the server if the number (string-to-number (match-string 2 xref)))) ((and (setq newsgroups (mail-fetch-field "newsgroups")) - (not (string-match "," newsgroups))) + (not (string-search "," newsgroups))) (setq group newsgroups)) (group) (t (setq group "")))) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index d7fb038f45a..2c7956d9680 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -154,7 +154,7 @@ with the current prefix. The files are chosen according to (mapcar (lambda (c) (let* ((s (intern c)) (doc (condition-case nil (documentation s) (error nil))) - (doc (and doc (substring doc 0 (string-match "\n" doc))))) + (doc (and doc (substring doc 0 (string-search "\n" doc))))) (list c (propertize (format "%-4s" (help--symbol-class s)) 'face 'completions-annotations) diff --git a/lisp/help.el b/lisp/help.el index ba27fc5810f..29ae3404813 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -1912,7 +1912,7 @@ the same names as used in the original source code, when possible." (let ((name (symbol-name arg))) (if (eq (aref name 0) ?&) (memq arg '(&rest &optional)) - (not (string-match "\\." name))))) + (not (string-search "." name))))) (setq valid nil))) (when valid arglist))) (let* ((arity (func-arity def)) diff --git a/lisp/hippie-exp.el b/lisp/hippie-exp.el index cbb69b206d4..4fadbbe4180 100644 --- a/lisp/hippie-exp.el +++ b/lisp/hippie-exp.el @@ -507,8 +507,8 @@ otherwise." "Try to slam together two parts of a file specification, system dependently." (cond ((null dir-part) name-part) ((eq system-type 'ms-dos) - (if (and (string-match "\\\\" dir-part) - (not (string-match "/" dir-part)) + (if (and (string-search "\\" dir-part) + (not (string-search "/" dir-part)) (= (aref name-part (1- (length name-part))) ?/)) (aset name-part (1- (length name-part)) ?\\)) (concat dir-part name-part)) diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el index b453061388f..3b961989e3e 100644 --- a/lisp/htmlfontify.el +++ b/lisp/htmlfontify.el @@ -1902,7 +1902,7 @@ tree depth, as determined from FILE (a filename). START is the offset at which to start looking for the / character in FILE." ;;(message "hfy-relstub");;DBUG (let ((c "")) - (while (setq start (string-match "/" file start)) + (while (setq start (string-search "/" file start)) (setq start (1+ start)) (setq c (concat c "../"))) c)) diff --git a/lisp/ido.el b/lisp/ido.el index ea5ff32b8d7..b81a9db5eb9 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -1770,7 +1770,7 @@ is enabled then some keybindings are changed in the keymap." (let ((l (length dirname))) (if (and max-width (> max-width 0) (> l max-width)) (let* ((s (substring dirname (- max-width))) - (i (string-match "/" s))) + (i (string-search "/" s))) (concat "..." (if i (substring s i) s))) dirname))))) (t prompt))) @@ -2516,7 +2516,7 @@ If cursor is not at the end of the user input, move to end of input." ;; Do nothing ) ((and (memq ido-cur-item '(file dir)) - (string-match "[$]" ido-text)) + (string-search "$" ido-text)) (let ((evar (substitute-in-file-name (concat ido-current-directory ido-text)))) (if (not (file-exists-p (file-name-directory evar))) (message "Expansion generates non-existing directory name") @@ -3089,7 +3089,7 @@ If repeated, insert text from buffer instead." (setq ido-text-init word ido-try-merged-list nil ido-exit 'chdir)) - ((string-match "/" word) + ((string-search "/" word) (setq ido-text-init (concat ido-current-directory word) ido-try-merged-list nil ido-exit 'chdir)) @@ -4559,7 +4559,7 @@ For details of keybindings, see `ido-find-file'." (setq try-single-dir-match t)))) ((and (string-equal (substring contents -2 -1) "/") - (not (string-match "[$]" contents))) + (not (string-search "$" contents))) (ido-set-current-directory (cond ((= (length contents) 2) @@ -4656,7 +4656,7 @@ For details of keybindings, see `ido-find-file'." (memq ido-cur-item '(file dir)) (not (ido-is-root-directory)) (> (length contents) 1) - (not (string-match "[$]" contents)) + (not (string-search "$" contents)) (not ido-directory-nonreadable) (not ido-directory-too-big)) (ido-trace "merge?") diff --git a/lisp/image/image-converter.el b/lisp/image/image-converter.el index 97bf1ac058c..75d2e6692c0 100644 --- a/lisp/image/image-converter.el +++ b/lisp/image/image-converter.el @@ -78,7 +78,7 @@ is a string, it should be a MIME format string like (string-match image-converter-regexp source)) (and data-p (symbolp data-p) - (string-match "/" (symbol-name data-p)) + (string-search "/" (symbol-name data-p)) (string-match image-converter-regexp (concat "foo." (image-converter--mime-type data-p))))) diff --git a/lisp/info-xref.el b/lisp/info-xref.el index 538a017f3c0..e2e3e30ca21 100644 --- a/lisp/info-xref.el +++ b/lisp/info-xref.el @@ -547,7 +547,7 @@ the sources handy." ;; skip nodes with "%" as probably `format' strings such as in ;; info-look.el - (unless (string-match "%" node) + (unless (string-search "%" node) ;; "(emacs)" is the default manual for docstring hyperlinks, ;; per `help-make-xrefs' diff --git a/lisp/info.el b/lisp/info.el index 1c477a7082f..3718a1eb83f 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -2483,7 +2483,7 @@ Table of contents is created from the tree structure of menus." (match-string-no-properties 1))) (section "Top") menu-items) - (when (and upnode (string-match "(" upnode)) (setq upnode nil)) + (when (and upnode (string-search "(" upnode)) (setq upnode nil)) (when (and (not (Info-index-node nodename file)) (re-search-forward "^\\* Menu:" bound t)) (forward-line 1) @@ -2616,7 +2616,7 @@ new buffer." (let (target i (str (concat "\\*note " (regexp-quote footnotename))) (case-fold-search t)) - (while (setq i (string-match " " str i)) + (while (setq i (string-search " " str i)) (setq str (concat (substring str 0 i) "[ \t\n]+" (substring str (1+ i)))) (setq i (+ i 6))) (save-excursion @@ -2933,7 +2933,7 @@ last sub-node, if any; otherwise go \"up\" to the parent node." (let ((prevnode (Info-extract-pointer "prev[ious]*" t)) (upnode (Info-extract-pointer "up" t)) (case-fold-search t)) - (cond ((and upnode (string-match "(" upnode)) + (cond ((and upnode (string-search "(" upnode)) (user-error "First node in file")) ((and upnode (or (null prevnode) ;; Use string-equal, not equal, @@ -3778,7 +3778,7 @@ Build a menu of the possible matches." "The following packages match the keyword ‘" nodename "’:\n\n") (insert "* Menu:\n\n") (let ((keywords - (mapcar #'intern (if (string-match-p "," nodename) + (mapcar #'intern (if (string-search "," nodename) (split-string nodename ",[ \t\n]*" t) (list nodename)))) hits desc) @@ -5244,7 +5244,7 @@ The INDENT level is ignored." TEXT is the text of the button we clicked on, a + or - item. TOKEN is data related to this node (NAME . FILE). INDENT is the current indentation depth." - (cond ((string-match "\\+" text) ;we have to expand this file + (cond ((string-search "+" text) ;we have to expand this file (speedbar-change-expand-button-char ?-) (if (speedbar-with-writable (save-excursion @@ -5252,7 +5252,7 @@ INDENT is the current indentation depth." (Info-speedbar-hierarchy-buttons nil (1+ indent) token))) (speedbar-change-expand-button-char ?-) (speedbar-change-expand-button-char ??))) - ((string-match "-" text) ;we have to contract this node + ((string-search "-" text) ;we have to contract this node (speedbar-change-expand-button-char ?+) (speedbar-delete-subblock indent)) (t (error "Ooops... not sure what to do"))) diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el index 2d3cd25b4a4..02169ceb689 100644 --- a/lisp/international/mule-diag.el +++ b/lisp/international/mule-diag.el @@ -905,13 +905,13 @@ The IGNORED argument is ignored." (setq family "*-*") (if (symbolp family) (setq family (symbol-name family))) - (or (string-match "-" family) + (or (string-search "-" family) (setq family (concat "*-" family)))) (if (not registry) (setq registry "*-*") (if (symbolp registry) (setq registry (symbol-name registry))) - (or (string-match "-" registry) + (or (string-search "-" registry) (= (aref registry (1- (length registry))) ?*) (setq registry (concat registry "*")))) (insert (format"\n -%s-%s-%s-%s-%s-*-*-*-*-*-*-%s" diff --git a/lisp/language/korea-util.el b/lisp/language/korea-util.el index b999eff662f..121a4c542e7 100644 --- a/lisp/language/korea-util.el +++ b/lisp/language/korea-util.el @@ -29,7 +29,7 @@ ;;;###autoload (defvar default-korean-keyboard - (purecopy (if (string-match "3" (or (getenv "HANGUL_KEYBOARD_TYPE") "")) + (purecopy (if (string-search "3" (or (getenv "HANGUL_KEYBOARD_TYPE") "")) "3" "")) "The kind of Korean keyboard for Korean (Hangul) input method. diff --git a/lisp/linum.el b/lisp/linum.el index b0281d366cd..c78f596d768 100644 --- a/lisp/linum.el +++ b/lisp/linum.el @@ -219,7 +219,7 @@ Linum mode is a buffer-local minor mode." ;; update overlays on deletions, and after newlines are inserted (when (or (= beg end) (= end (point-max)) - (string-match-p "\n" (buffer-substring-no-properties beg end))) + (string-search "\n" (buffer-substring-no-properties beg end))) (linum-update-current))) (defun linum-after-scroll (win _start) diff --git a/lisp/mail/ietf-drums.el b/lisp/mail/ietf-drums.el index 2d683574743..b1682cf78a2 100644 --- a/lisp/mail/ietf-drums.el +++ b/lisp/mail/ietf-drums.el @@ -236,7 +236,7 @@ If DECODE, the DISPLAY-NAME will have RFC2047 decoding performed (setq display-string (ietf-drums-get-comment string))) (if (not mailbox) (when (and display-string - (string-match "@" display-string)) + (string-search "@" display-string)) (cons (mapconcat #'identity (nreverse display-name) "") (ietf-drums-get-comment string))) diff --git a/lisp/mail/mail-utils.el b/lisp/mail/mail-utils.el index bb1f8f13bac..3eb3ccb93de 100644 --- a/lisp/mail/mail-utils.el +++ b/lisp/mail/mail-utils.el @@ -252,7 +252,7 @@ comma-separated list, and return the pruned list." (setq cur-pos (string-match "[,\"]" destinations cur-pos)) (if (and cur-pos (equal (match-string 0 destinations) "\"")) ;; Search for matching quote. - (let ((next-pos (string-match "\"" destinations (1+ cur-pos)))) + (let ((next-pos (string-search "\"" destinations (1+ cur-pos)))) (if next-pos (setq cur-pos (1+ next-pos)) ;; If the open-quote has no close-quote, diff --git a/lisp/mail/rfc2047.el b/lisp/mail/rfc2047.el index 5b08713949f..c442913d282 100644 --- a/lisp/mail/rfc2047.el +++ b/lisp/mail/rfc2047.el @@ -612,7 +612,7 @@ should not change this value.") (setq next prev prev nil) (if (or (< index limit) - (<= (+ len (or (string-match "\n" tail) + (<= (+ len (or (string-search "\n" tail) (length tail))) rfc2047-encode-max-chars)) (setq prev next @@ -1111,7 +1111,7 @@ strings are stripped." "Decode MIME-encoded STRING and return the result. If ADDRESS-MIME is non-nil, strip backslashes which precede characters other than `\"' and `\\' in quoted strings." - (if (string-match "=\\?" string) + (if (string-search "=?" string) (with-temp-buffer ;; We used to only call mm-enable-multibyte if `m' is non-nil, ;; but this can't be the right criterion. Don't just revert this diff --git a/lisp/mail/rfc2231.el b/lisp/mail/rfc2231.el index db34fd2cb9e..a398ce0e9cc 100644 --- a/lisp/mail/rfc2231.el +++ b/lisp/mail/rfc2231.el @@ -61,12 +61,12 @@ must never cause a Lisp error." ;; make it parsable. Let's try... (error (let (mod) - (when (and (string-match "\\\\\"" string) + (when (and (string-search "\\\"" string) (not (string-match "\\`\"\\|[^\\]\"" string))) (setq string (string-replace "\\\"" "\"" string) mod t)) - (when (and (string-match "\\\\(" string) - (string-match "\\\\)" string) + (when (and (string-search "\\(" string) + (string-search "\\)" string) (not (string-match "\\`(\\|[^\\][()]" string))) (setq string (replace-regexp-in-string "\\\\\\([()]\\)" "\\1" string) diff --git a/lisp/mail/rmailkwd.el b/lisp/mail/rmailkwd.el index acbb5880b5c..58a8eb7a370 100644 --- a/lisp/mail/rmailkwd.el +++ b/lisp/mail/rmailkwd.el @@ -93,7 +93,7 @@ according to the choice made, and returns a symbol." "Set LABEL as present or absent according to STATE in message MSG. LABEL may be a symbol or string." (or (stringp label) (setq label (symbol-name label))) - (if (string-match "," label) + (if (string-search "," label) (error "More than one label specified")) (with-current-buffer rmail-buffer (rmail-maybe-set-message-counters) diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el index ac933b9706d..9dd9573a9fc 100644 --- a/lisp/mail/rmailsum.el +++ b/lisp/mail/rmailsum.el @@ -759,7 +759,7 @@ the message being processed." ;; If there are multiple lines in FROM, ;; discard up to the last newline in it. (while (and (stringp from) - (setq newline (string-match "\n" from))) + (setq newline (string-search "\n" from))) (setq from (substring from (1+ newline)))) (if (or (null from) (string-match diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el index 8e3927cdcf2..ec9f340db86 100644 --- a/lisp/mail/smtpmail.el +++ b/lisp/mail/smtpmail.el @@ -516,7 +516,7 @@ for `smtpmail-try-auth-method'.") (defun smtpmail-maybe-append-domain (recipient) (if (or (not smtpmail-sendto-domain) - (string-match "@" recipient)) + (string-search "@" recipient)) recipient (concat recipient "@" smtpmail-sendto-domain))) @@ -700,7 +700,7 @@ Returns an error if the server cannot be contacted." (let ((parts (split-string user-mail-address "@"))) (and (= (length parts) 2) ;; There's a dot in the domain name. - (string-match "\\." (cadr parts)) + (string-search "." (cadr parts)) user-mail-address)))) (defun smtpmail-via-smtp (recipient smtpmail-text-buffer diff --git a/lisp/mail/uce.el b/lisp/mail/uce.el index 9ebffef2e59..b07004de38c 100644 --- a/lisp/mail/uce.el +++ b/lisp/mail/uce.el @@ -246,10 +246,10 @@ You might need to set `uce-mail-reader' before using this." (if reply-to (setq to (format "%s, %s" to (mail-strip-quoted-names reply-to)))) (let (first-at-sign end-of-hostname sender-host) - (setq first-at-sign (string-match "@" to) + (setq first-at-sign (string-search "@" to) end-of-hostname (string-match "[ ,>]" to first-at-sign) sender-host (substring to first-at-sign end-of-hostname)) - (if (string-match "\\." sender-host) + (if (string-search "." sender-host) (setq to (format "%s, postmaster%s, abuse%s" to sender-host sender-host)))) (setq mail-send-actions nil) @@ -291,7 +291,7 @@ You might need to set `uce-mail-reader' before using this." (search-forward " ") (forward-char -1) ;; And add its postmaster to the list of addresses. - (if (string-match "\\." (buffer-substring temp (point))) + (if (string-search "." (buffer-substring temp (point))) (setq to (format "%s, postmaster@%s" to (buffer-substring temp (point))))) ;; Also look at the message-id, it helps *very* often. @@ -302,7 +302,7 @@ You might need to set `uce-mail-reader' before using this." (setq temp (point)) (search-forward ">") (forward-char -1) - (if (string-match "\\." (buffer-substring temp (point))) + (if (string-search "." (buffer-substring temp (point))) (setq to (format "%s, postmaster@%s" to (buffer-substring temp (point))))))) (when (eq uce-mail-reader 'gnus) diff --git a/lisp/man.el b/lisp/man.el index 54b6ffe9836..6009a319198 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -801,7 +801,7 @@ POS defaults to `point'." ;; doesn't include a hyphen, we consider the hyphen to be ;; added by troff, and remove it. (or (not (eq (string-to-char (substring 1st-part -1)) ?-)) - (string-match-p "-" (substring 1st-part 0 -1)) + (string-search "-" (substring 1st-part 0 -1)) (setq word (string-replace "-" "" word)))) ;; Make sure the section number gets included by the code below. (goto-char (match-end 1))) diff --git a/lisp/mh-e/mh-alias.el b/lisp/mh-e/mh-alias.el index 415e9848258..37fdb166011 100644 --- a/lisp/mh-e/mh-alias.el +++ b/lisp/mh-e/mh-alias.el @@ -111,10 +111,10 @@ COMMA-SEPARATOR is non-nil." (string-match "^\\([^,]+\\)," res)) (setq res (match-string 1 res))) ;; Replace "&" with capitalized username - (if (string-match "&" res) + (if (string-search "&" res) (setq res (mh-replace-regexp-in-string "&" (capitalize username) res))) ;; Remove " character - (if (string-match "\"" res) + (if (string-search "\"" res) (setq res (mh-replace-regexp-in-string "\"" "" res))) ;; If empty string, use username instead (if (string-equal "" res) @@ -285,7 +285,7 @@ Blind aliases or users from /etc/passwd are not expanded." (message "%s -> %s" the-name (mh-alias-expand the-name)) ;; Check if it was a single word likely to be an alias (if (and (equal mh-alias-flash-on-comma 1) - (not (string-match " " the-name))) + (not (string-search " " the-name))) (message "No alias for %s" the-name)))))) (self-insert-command 1)) diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el index b64bbfb6f3b..4fae69defaf 100644 --- a/lisp/mh-e/mh-comp.el +++ b/lisp/mh-e/mh-comp.el @@ -637,8 +637,8 @@ See also `mh-compose-forward-as-mime-flag', (defun mh-forwarded-letter-subject (from subject) "Return a Subject suitable for a forwarded message. Original message has headers FROM and SUBJECT." - (let ((addr-start (string-match "<" from)) - (comment (string-match "(" from))) + (let ((addr-start (string-search "<" from)) + (comment (string-search "(" from))) (cond ((and addr-start (> addr-start 0)) ;; Full Name (setq from (substring from 0 (1- addr-start)))) diff --git a/lisp/mh-e/mh-speed.el b/lisp/mh-e/mh-speed.el index 3af840c3a31..76ef990d825 100644 --- a/lisp/mh-e/mh-speed.el +++ b/lisp/mh-e/mh-speed.el @@ -441,7 +441,7 @@ be handled next." (position 0) line-end line folder unseen total) (unwind-protect - (while (setq line-end (string-match "\n" output position)) + (while (setq line-end (string-search "\n" output position)) (setq line (format "%s%s" mh-speed-partial-line (substring output position line-end)) diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el index 8e900dc0113..bbce17013b1 100644 --- a/lisp/mh-e/mh-utils.el +++ b/lisp/mh-e/mh-utils.el @@ -378,7 +378,7 @@ names and the function is called when OUTPUT is available." (prevailing-match-data (match-data)) line-end folder) (unwind-protect - (while (setq line-end (string-match "\n" output position)) + (while (setq line-end (string-search "\n" output position)) (setq folder (format "+%s%s" mh-flists-partial-line (substring output position line-end))) @@ -702,7 +702,7 @@ See Info node `(elisp) Programmed Completion' for details." (let ((slash (mh-search-from-end ?/ orig-name))) (if slash (1+ slash) (if (string-match "\\`\\+" orig-name) 1 0))) - (if (cdr flag) (string-match "/" (cdr flag))))) + (if (cdr flag) (string-search "/" (cdr flag))))) ((eq flag nil) (let ((try-res (try-completion diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 2c6340e1c3e..9f327df28f5 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -2741,7 +2741,7 @@ Useful to give the user default values that won't be substituted." (defun completion--make-envvar-table () (mapcar (lambda (enventry) - (substring enventry 0 (string-match-p "=" enventry))) + (substring enventry 0 (string-search "=" enventry))) process-environment)) (defconst completion--embedded-envvar-re @@ -2810,7 +2810,7 @@ same as `substitute-in-file-name'." pred action)) ((eq (car-safe action) 'boundaries) (let ((start (length (file-name-directory string))) - (end (string-match-p "/" (cdr action)))) + (end (string-search "/" (cdr action)))) `(boundaries ;; if `string' is "C:" in w32, (file-name-directory string) ;; returns "C:/", so `start' is 3 rather than 2. @@ -3988,7 +3988,7 @@ which is at the core of flex logic. The extra (defun completion-flex-try-completion (string table pred point) "Try to flex-complete STRING in TABLE given PRED and POINT." - (unless (and completion-flex-nospace (string-match-p " " string)) + (unless (and completion-flex-nospace (string-search " " string)) (pcase-let ((`(,all ,pattern ,prefix ,suffix ,_carbounds) (completion-substring--all-completions string table pred point @@ -4005,7 +4005,7 @@ which is at the core of flex logic. The extra (defun completion-flex-all-completions (string table pred point) "Get flex-completions of STRING in TABLE, given PRED and POINT." - (unless (and completion-flex-nospace (string-match-p " " string)) + (unless (and completion-flex-nospace (string-search " " string)) (pcase-let ((`(,all ,pattern ,prefix ,_suffix ,_carbounds) (completion-substring--all-completions string table pred point diff --git a/lisp/mpc.el b/lisp/mpc.el index e04ffa49747..029f0ca8f42 100644 --- a/lisp/mpc.el +++ b/lisp/mpc.el @@ -305,7 +305,7 @@ defaults to 6600 and HOST defaults to localhost." (defun mpc--proc-quote-string (s) (if (numberp s) (number-to-string s) (setq s (replace-regexp-in-string "[\"\\]" "\\\\\\&" s)) - (if (string-match " " s) (concat "\"" s "\"") s))) + (if (string-search " " s) (concat "\"" s "\"") s))) (defconst mpc--proc-alist-to-alists-starters '(file directory)) @@ -611,7 +611,7 @@ Any call to `mpc-status-refresh' may cause it to be restarted." (defun mpc-cmd-special-tag-p (tag) (or (memq tag '(Playlist Search Directory)) - (string-match "|" (symbol-name tag)))) + (string-search "|" (symbol-name tag)))) (defun mpc-cmd-find (tag value) "Return a list of all songs whose tag TAG has value VALUE. @@ -1438,7 +1438,7 @@ when constructing the set of constraints." (let (res) (dolist (constraint constraints) (when (or (eq (car constraint) buffer-tag) - (and (string-match "|" (symbol-name buffer-tag)) + (and (string-search "|" (symbol-name buffer-tag)) (member (symbol-name (car constraint)) (split-string (symbol-name buffer-tag) "|")))) (setq res (cdr constraint)))) diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 3f3a3df8e55..e302aa89f30 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -2296,7 +2296,7 @@ and NOWAIT." ;; If the dir name contains a space, some ftp servers will ;; refuse to list it. We instead change directory to the ;; directory in question and ls ".". - (when (string-match " " cmd1) + (when (string-search " " cmd1) ;; Keep the result. In case of failure, we will (see below) ;; short-circuit CMD and return this result directly. (setq result (ange-ftp-cd host user (nth 1 cmd) 'noerror)) @@ -2881,13 +2881,13 @@ NO-ERROR, if a listing for DIRECTORY cannot be obtained." (or ;; No dots in dir names in vms. (and (eq host-type 'vms) - (string-match "\\." efile)) + (string-search "." efile)) ;; No subdirs in mts of cms. (and (memq host-type '(mts cms)) (not (string-equal "/" (nth 2 parsed)))) ;; No dots in pseudo-dir names in bs2000. (and (eq host-type 'bs2000) - (string-match "\\." efile)))))) + (string-search "." efile)))))) (defun ange-ftp-file-entry-p (name) "Given NAME, return whether there is a file entry for it." diff --git a/lisp/net/mailcap.el b/lisp/net/mailcap.el index aeeb9bd8d3b..5473ba7e697 100644 --- a/lisp/net/mailcap.el +++ b/lisp/net/mailcap.el @@ -1075,7 +1075,7 @@ For instance, \"foo.png\" will result in \"image/png\"." (dolist (data mailcap--computed-mime-data) (dolist (info (cdr data)) (setq type (cdr (assq 'type (cdr info)))) - (unless (string-match-p "\\*" type) + (unless (string-search "*" type) (push type res)))) (nreverse res))))) diff --git a/lisp/net/mairix.el b/lisp/net/mairix.el index e1d35c2a85a..727aa55de58 100644 --- a/lisp/net/mairix.el +++ b/lisp/net/mairix.el @@ -422,7 +422,7 @@ with m:msgid of the current article and enabled threads." (while (string-match "[<>]" mid) (setq mid (replace-match "" t t mid))) ;; mairix somehow does not like '$' in message-id - (when (string-match "\\$" mid) + (when (string-search "$" mid) (setq mid (concat mid "="))) (while (string-match "\\$" mid) (setq mid (replace-match "=," t t mid))) diff --git a/lisp/net/pop3.el b/lisp/net/pop3.el index cb49f75c81d..a267ac319b6 100644 --- a/lisp/net/pop3.el +++ b/lisp/net/pop3.el @@ -551,8 +551,8 @@ Returns the process associated with the connection." (when result (let ((response (plist-get (cdr result) :greeting))) (setq pop3-timestamp - (substring response (or (string-match "<" response) 0) - (+ 1 (or (string-match ">" response) -1))))) + (substring response (or (string-search "<" response) 0) + (+ 1 (or (string-search ">" response) -1))))) (set-process-query-on-exit-flag (car result) nil) (erase-buffer) (car result))))) diff --git a/lisp/net/soap-client.el b/lisp/net/soap-client.el index f5480afb698..de1cd9d320f 100644 --- a/lisp/net/soap-client.el +++ b/lisp/net/soap-client.el @@ -1938,7 +1938,7 @@ This is a specialization of `soap-decode-type' for (e-name (soap-xs-element-name element)) ;; Heuristic: guess if we need to decode using local ;; namespaces. - (use-fq-names (string-match ":" (symbol-name (car node)))) + (use-fq-names (string-search ":" (symbol-name (car node)))) (children (if e-name (if use-fq-names ;; Find relevant children diff --git a/lisp/net/socks.el b/lisp/net/socks.el index 1da1d31d678..78a261fd83e 100644 --- a/lisp/net/socks.el +++ b/lisp/net/socks.el @@ -277,7 +277,7 @@ (setq version (process-get proc 'socks-server-protocol)) (cond ((equal version 'http) - (if (not (string-match "\r\n\r\n" string)) + (if (not (string-search "\r\n\r\n" string)) nil ; Need to spin some more (process-put proc 'socks-state socks-state-connected) (process-put proc 'socks-reply 0) diff --git a/lisp/nxml/nxml-outln.el b/lisp/nxml/nxml-outln.el index 6dca34a80f2..c265b19cf05 100644 --- a/lisp/nxml/nxml-outln.el +++ b/lisp/nxml/nxml-outln.el @@ -633,7 +633,7 @@ non-transparent child section." tag-qnames)))) (defun nxml-highlighted-qname (qname) - (let ((colon (string-match ":" qname))) + (let ((colon (string-search ":" qname))) (if colon (concat (propertize (substring qname 0 colon) 'face diff --git a/lisp/nxml/rng-cmpct.el b/lisp/nxml/rng-cmpct.el index d820d1b99b5..dd3000773fd 100644 --- a/lisp/nxml/rng-cmpct.el +++ b/lisp/nxml/rng-cmpct.el @@ -179,7 +179,7 @@ Return a pattern." (setq rng-c-default-namespace rng-c-inherit-namespace))) (defun rng-c-expand-name (prefixed-name) - (let ((i (string-match ":" prefixed-name))) + (let ((i (string-search ":" prefixed-name))) (rng-make-name (rng-c-lookup-prefix (substring prefixed-name 0 i)) @@ -222,7 +222,7 @@ and URI is a symbol.") (cdr binding))) (defun rng-c-expand-datatype (prefixed-name) - (let ((i (string-match ":" prefixed-name))) + (let ((i (string-search ":" prefixed-name))) (rng-make-datatype (rng-c-lookup-datatype-prefix (substring prefixed-name 0 i)) (substring prefixed-name (+ i 1))))) diff --git a/lisp/nxml/rng-uri.el b/lisp/nxml/rng-uri.el index fda481fa281..24f4d2ec443 100644 --- a/lisp/nxml/rng-uri.el +++ b/lisp/nxml/rng-uri.el @@ -93,7 +93,7 @@ Signal an error if URI is not a valid file URL." (rng-uri-error "`?' not escaped in file URI `%s'" uri)) (when fragment-id (rng-uri-error "URI `%s' has a fragment identifier" uri)) - (when (string-match ";" path) + (when (string-search ";" path) (rng-uri-error "`;' not escaped in URI `%s'" uri)) (when (string-match "%2[fF]" path) ;; 2f is hex code of slash (rng-uri-error "Escaped slash in URI `%s'" uri)) @@ -110,7 +110,7 @@ Signal an error if URI is not a valid file URL." (rng-uri-unescape-unibyte-replace path 2)) (t (rng-uri-unescape-unibyte path)))) - (when (string-match "\000" path) + (when (string-search "\000" path) (rng-uri-error "URI `%s' has NUL character in path" uri)) (when (eq pattern 'match) (setq path diff --git a/lisp/obsolete/complete.el b/lisp/obsolete/complete.el index 1c1167db89b..2d3be2dd9a4 100644 --- a/lisp/obsolete/complete.el +++ b/lisp/obsolete/complete.el @@ -243,7 +243,7 @@ second TAB brings up the `*Completions*' buffer." (when (and partial-completion-mode (null PC-env-vars-alist)) (setq PC-env-vars-alist (mapcar (lambda (string) - (let ((d (string-match "=" string))) + (let ((d (string-search "=" string))) (cons (concat "$" (substring string 0 d)) (and d (substring string (1+ d)))))) process-environment)))) @@ -575,7 +575,7 @@ GOTO-END is non-nil, however, it instead replaces up to END." p (+ p (length PC-ndelims-regex) 1))))) (setq p 0) (if filename - (while (setq p (string-match "\\\\\\*" regex p)) + (while (setq p (string-search "\\*" regex p)) (setq regex (concat (substring regex 0 p) "[^/]*" (substring regex (+ p 2)))))) diff --git a/lisp/obsolete/longlines.el b/lisp/obsolete/longlines.el index 9676d6b28e9..9bf68456826 100644 --- a/lisp/obsolete/longlines.el +++ b/lisp/obsolete/longlines.el @@ -393,11 +393,11 @@ compatibility with `format-alist', and is ignored." "Return a copy of STRING with each soft newline replaced by a space. Hard newlines are left intact." (let* ((str (copy-sequence string)) - (pos (string-match "\n" str))) + (pos (string-search "\n" str))) (while pos (if (null (get-text-property pos 'hard str)) (aset str pos ? )) - (setq pos (string-match "\n" str (1+ pos)))) + (setq pos (string-search "\n" str (1+ pos)))) str)) ;;; Auto wrap diff --git a/lisp/obsolete/nnir.el b/lisp/obsolete/nnir.el index caeca988810..9aab1e7c9f5 100644 --- a/lisp/obsolete/nnir.el +++ b/lisp/obsolete/nnir.el @@ -509,7 +509,7 @@ construct the vector entries." (vector (gnus-group-full-name group server) (if (string-match "\\`nnmaildir:" (gnus-group-server server)) (nnmaildir-base-name-to-article-number - (substring article 0 (string-match ":" article)) + (substring article 0 (string-search ":" article)) group nil) (string-to-number article)) (string-to-number score))))) diff --git a/lisp/obsolete/terminal.el b/lisp/obsolete/terminal.el index dbfc79bf913..0167a00066b 100644 --- a/lisp/obsolete/terminal.el +++ b/lisp/obsolete/terminal.el @@ -1222,7 +1222,7 @@ of the terminal-emulator" (cond ((string-match "\\`[-a-zA-Z0-9+=_.@/:]+\\'" string) string) - ((not (string-match "[$]" string)) + ((not (string-search "$" string)) ;; "[\"\\]" are special to sh and the lisp reader in the same way (prin1-to-string string)) (t diff --git a/lisp/obsolete/tpu-edt.el b/lisp/obsolete/tpu-edt.el index 1340618f055..e0e89c390ea 100644 --- a/lisp/obsolete/tpu-edt.el +++ b/lisp/obsolete/tpu-edt.el @@ -1415,9 +1415,9 @@ If an argument is specified, don't set the search direction." ;; if using regexp, eliminate upper case forms (\B \W \S.) (if tpu-regexp-p (let ((pat (copy-sequence string)) (case-fold-search nil) (pos 0)) - (while (setq pos (string-match "\\\\\\\\" pat)) (aset pat (+ 1 pos) ?.)) - (while (setq pos (string-match "\\\\B" pat)) (aset pat (+ 1 pos) ?.)) - (while (setq pos (string-match "\\\\W" pat)) (aset pat (+ 1 pos) ?.)) + (while (setq pos (string-search "\\\\" pat)) (aset pat (+ 1 pos) ?.)) + (while (setq pos (string-search "\\B" pat)) (aset pat (+ 1 pos) ?.)) + (while (setq pos (string-search "\\W" pat)) (aset pat (+ 1 pos) ?.)) (while (setq pos (string-match "\\\\S." pat)) (aset pat (+ 1 pos) ?.) (aset pat (+ 2 pos) ?.)) (string-equal pat (downcase pat))) diff --git a/lisp/obsolete/url-ns.el b/lisp/obsolete/url-ns.el index b62ad829990..6cd6693fc43 100644 --- a/lisp/obsolete/url-ns.el +++ b/lisp/obsolete/url-ns.el @@ -31,7 +31,7 @@ ;;;###autoload (defun isPlainHostName (host) - (not (string-match "\\." host))) + (not (string-search "." host))) ;;;###autoload (defun dnsDomainIs (host dom) diff --git a/lisp/pcmpl-unix.el b/lisp/pcmpl-unix.el index e1d104f74ff..49dc2d2fc6c 100644 --- a/lisp/pcmpl-unix.el +++ b/lisp/pcmpl-unix.el @@ -214,7 +214,7 @@ Includes files as well as host names followed by a colon." (list string) (completion-table-subvert (pcomplete-all-entries) "" "/ssh:"))) - ((string-match "/" string) ; Local file name. + ((string-search "/" string) ; Local file name. (pcomplete-all-entries)) (t ;Host name or local file name. (append (all-completions string (pcomplete-all-entries)) diff --git a/lisp/play/dunnet.el b/lisp/play/dunnet.el index 3bb8bf0c82b..9d5ee261976 100644 --- a/lisp/play/dunnet.el +++ b/lisp/play/dunnet.el @@ -2170,7 +2170,7 @@ other words." (let (pos ret-list end-pos) (setq pos 0) (setq ret-list nil) - (while (setq end-pos (string-match " " (substring strin pos))) + (while (setq end-pos (string-search " " (substring strin pos))) (setq end-pos (+ end-pos pos)) (if (not (= end-pos pos)) (setq ret-list (append ret-list (list @@ -2269,7 +2269,7 @@ except for the verb." startlist (if (string= (substring dirstring 0 1) "/") (dun-get-path (substring dirstring 1) (append startlist (list "/"))) - (if (not (setq slash (string-match "/" dirstring))) + (if (not (setq slash (string-search "/" dirstring))) (append startlist (list dirstring)) (dun-get-path (substring dirstring (1+ slash)) (append startlist @@ -2348,7 +2348,7 @@ Also prints current score to let user know he has scored." (princ dun-line) (if (eq (dun-parse2 nil dun-unix-verbs dun-line) -1) (progn - (if (setq esign (string-match "=" dun-line)) + (if (setq esign (string-search "=" dun-line)) (dun-doassign dun-line esign) (dun-mprinc (car dun-line-list)) (dun-mprincl ": not found."))))) @@ -2380,21 +2380,21 @@ Also prints current score to let user know he has scored." (dun-mprinc line) (dun-mprincl " : not found.")) - (if (not (setq epoint (string-match ")" line))) + (if (not (setq epoint (string-search ")" line))) (if (string= (substring line (1+ esign) (+ esign 2)) "\"") (progn (setq afterq (substring line (+ esign 2))) (setq epoint (+ - (string-match "\"" afterq) + (string-search "\"" afterq) (+ esign 3)))) - (if (not (setq epoint (string-match " " line))) + (if (not (setq epoint (string-search " " line))) (setq epoint (length line)))) (setq epoint (1+ epoint)) (while (and (not (= epoint (length line))) - (setq i (string-match ")" (substring line epoint)))) + (setq i (string-search ")" (substring line epoint)))) (setq epoint (+ epoint i 1)))) (setq value (substring line (1+ esign) epoint)) (dun-eval varname value))))) @@ -2788,7 +2788,7 @@ drwxr-xr-x 3 root staff 2048 Jan 1 1970 ..") (cond ((null (setq args (car args))) (dun-mprincl "Usage: cat ")) - ((string-match-p "/" args) + ((string-search "/" args) (dun-mprincl "cat: only files in current directory allowed.")) ((and (> dun-cdroom 0) (string= args "description")) (dun-mprincl (car (nth dun-cdroom dun-rooms)))) @@ -3110,7 +3110,7 @@ File not found"))) (setq dun-line (downcase (dun-read-line))) (if (eq (dun-parse2 nil dun-unix-verbs dun-line) -1) (let (esign) - (if (setq esign (string-match "=" dun-line)) + (if (setq esign (string-search "=" dun-line)) (dun-doassign dun-line esign) (dun-mprinc (car dun-line-list)) (dun-mprincl ": not found."))))) diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el index a00440d898c..884104a16f7 100644 --- a/lisp/progmodes/ebnf2ps.el +++ b/lisp/progmodes/ebnf2ps.el @@ -4337,7 +4337,7 @@ end (let ((len (1- (length str))) (index 0) new start fmt) - (while (setq start (string-match "%" str index)) + (while (setq start (string-search "%" str index)) (setq fmt (if (< start len) (aref str (1+ start)) ?\?) new (concat new (substring str index start) diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 97596d0d278..67ad39b7f46 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -1382,7 +1382,7 @@ With arg, enter name of variable to be watched in the minibuffer." (string-match "\\(\\S-+\\)" text) (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list)) (varnum (car var))) - (if (string-match "\\." (car var)) + (if (string-search "." (car var)) (message-box "Can only delete a root expression") (gdb-var-delete-1 var varnum))))) @@ -1479,14 +1479,14 @@ With arg, enter name of variable to be watched in the minibuffer." TEXT is the text of the button we clicked on, a + or - item. TOKEN is data related to this node. INDENT is the current indentation depth." - (cond ((string-match "\\+" text) ;expand this node + (cond ((string-search "+" text) ;expand this node (let* ((var (assoc token gdb-var-list)) (expr (nth 1 var)) (children (nth 2 var))) (if (or (<= (string-to-number children) gdb-max-children) (y-or-n-p (format "%s has %s children. Continue? " expr children))) (gdb-var-list-children token)))) - ((string-match "-" text) ;contract this node + ((string-search "-" text) ;contract this node (dolist (var gdb-var-list) (if (string-match (concat token "\\.") (car var)) (setq gdb-var-list (delq var gdb-var-list)))) @@ -2416,7 +2416,7 @@ rule from an incomplete data stream. The parser will stay in this state until the end of the current result or async record is reached." (when (< gdbmi-bnf-offset (length gud-marker-acc)) ;; Search the data stream for the end of the current record: - (let* ((newline-pos (string-match "\n" gud-marker-acc gdbmi-bnf-offset)) + (let* ((newline-pos (string-search "\n" gud-marker-acc gdbmi-bnf-offset)) (is-progressive (equal (cdr class-command) 'progressive)) (is-complete (not (null newline-pos))) result-str) diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 05ad82acc4a..08814ebcaaa 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -3150,7 +3150,7 @@ Obeying it means displaying in another window the specified file and line." (buffer-substring (region-beginning) (region-end)) (apply gud-find-expr-function args)))) (save-match-data - (if (string-match "\n" expr) + (if (string-search "\n" expr) (error "Expression must not include a newline")) (with-current-buffer gud-comint-buffer (save-excursion diff --git a/lisp/progmodes/idlw-help.el b/lisp/progmodes/idlw-help.el index db76df96a56..c53b9a4775c 100644 --- a/lisp/progmodes/idlw-help.el +++ b/lisp/progmodes/idlw-help.el @@ -495,7 +495,7 @@ It collects and prints the diagnostics messages." ((and (memq cw '(function-keyword procedure-keyword)) (stringp this-word) (string-match "\\S-" this-word) - (not (string-match "!" this-word))) + (not (string-search "!" this-word))) (cond ((or (= (char-before beg) ?/) (save-excursion (goto-char end) (looking-at "[ \t]*="))) diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el index ad8feb988f5..eb88f25dfd6 100644 --- a/lisp/progmodes/idlw-shell.el +++ b/lisp/progmodes/idlw-shell.el @@ -967,7 +967,7 @@ IDL has currently stepped.") ;; Strip those pesky ctrl-m's. (add-hook 'comint-output-filter-functions (lambda (string) - (when (string-match "\r" string) + (when (string-search "\r" string) (let ((pmark (process-mark (get-buffer-process (current-buffer))))) (save-excursion @@ -1409,7 +1409,7 @@ Remove everything to the first newline, and all lines with % in front of them, with optional follow-on lines starting with two spaces. This works well enough, since any print output typically arrives before error messages, etc." - (setq output (substring output (string-match "\n" output))) + (setq output (substring output (string-search "\n" output))) (while (string-match "\\(\n\\|\\`\\)%.*\\(\n .*\\)*" output) (setq output (replace-match "" nil t output))) (unless @@ -1431,12 +1431,12 @@ and then calls `idlwave-shell-send-command' for any pending commands." (unwind-protect (progn ;; Ring the bell if necessary - (while (setq p (string-match "\C-G" string)) + (while (setq p (string-search "\C-G" string)) (ding) (aset string p ?\C-j )) (if idlwave-shell-hide-output (save-excursion - (while (setq p (string-match "\C-M" string)) + (while (setq p (string-search "\C-M" string)) (aset string p ?\ )) (set-buffer (get-buffer-create idlwave-shell-hidden-output-buffer)) @@ -1445,7 +1445,7 @@ and then calls `idlwave-shell-send-command' for any pending commands." (comint-output-filter proc string)) ;; Watch for magic - need to accumulate the current line ;; since it may not be sent all at once. - (if (string-match "\n" string) + (if (string-search "\n" string) (progn (if idlwave-shell-use-input-mode-magic (idlwave-shell-input-mode-magic diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index b55a98af0b3..55e712dd77d 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -2547,7 +2547,7 @@ If there is no label point is not moved and nil is returned." (end (idlwave-find-key ":" 1 'nomark eos))) (if (and end (= (nth 0 (parse-partial-sexp start end)) 0) - (not (string-match "\\?" (buffer-substring start end))) + (not (string-search "?" (buffer-substring start end))) (not (string-match "^::" (buffer-substring end eos)))) (progn (forward-char) @@ -7677,9 +7677,9 @@ arg, the class property is cleared out." (interactive "P") (idlwave-routines) - (if (string-match "->" (buffer-substring - (max (point-min) (1- (point))) - (min (+ 2 (point)) (point-max)))) + (if (string-search "->" (buffer-substring + (max (point-min) (1- (point))) + (min (+ 2 (point)) (point-max)))) ;; Cursor is on an arrow (if (get-text-property (point) 'idlwave-class) ;; arrow has class property diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index aff3066c698..b1a5f301587 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el @@ -895,7 +895,7 @@ startup file, `~/.emacs-octave'." (defun inferior-octave-completion-at-point () "Return the data to complete the Octave symbol at point." ;; https://debbugs.gnu.org/14300 - (unless (string-match-p "/" (or (comint--match-partial-filename) "")) + (unless (string-search "/" (or (comint--match-partial-filename) "")) (let ((beg (save-excursion (skip-syntax-backward "w_" (comint-line-beginning-position)) (point))) diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 91db4ae21cb..2f98b9c53c1 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -2672,7 +2672,7 @@ t means to return a list of all possible completions of STRING. (or sh-shell-variables-initialized (sh-shell-initialize-variables)) (nconc (mapcar (lambda (var) - (substring var 0 (string-match "=" var))) + (substring var 0 (string-search "=" var))) process-environment) sh-shell-variables)))) (complete-with-action code vars string predicate))) diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index b9012166a52..d144d68b571 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -1573,7 +1573,7 @@ statement. The format of variable should be a valid face))) (defun sql-regexp-abbrev (keyword) - (let ((brk (string-match "[~]" keyword)) + (let ((brk (string-search "~" keyword)) (len (length keyword)) (sep "\\(?:") re i) diff --git a/lisp/progmodes/xscheme.el b/lisp/progmodes/xscheme.el index 613863dd613..70763319840 100644 --- a/lisp/progmodes/xscheme.el +++ b/lisp/progmodes/xscheme.el @@ -936,7 +936,7 @@ the remaining input.") (setq call-noexcursion nil) (with-current-buffer (process-buffer proc) (cond ((eq xscheme-process-filter-state 'idle) - (let ((start (string-match "\e" xscheme-filter-input))) + (let ((start (string-search "\e" xscheme-filter-input))) (if start (progn (xscheme-process-filter-output @@ -960,7 +960,7 @@ the remaining input.") (xscheme-process-filter-output ?\e char) (setq xscheme-process-filter-state 'idle))))))) ((eq xscheme-process-filter-state 'reading-string) - (let ((start (string-match "\e" xscheme-filter-input))) + (let ((start (string-search "\e" xscheme-filter-input))) (if start (let ((string (concat xscheme-string-accumulator diff --git a/lisp/replace.el b/lisp/replace.el index c67877efd5d..1d6f091dc71 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -310,7 +310,7 @@ the original string if not." ;; but not after (quote foo). (and (eq (car-safe (car pos)) 'quote) (not (= ?\( (aref to 0))))) - (eq (string-match " " to (cdr pos)) + (eq (string-search " " to (cdr pos)) (cdr pos))) (1+ (cdr pos)) (cdr pos)))) @@ -633,13 +633,13 @@ Arguments REGEXP, START, END, and REGION-NONCONTIGUOUS-P are passed to (if (listp to-strings) (setq replacements to-strings) (while (/= (length to-strings) 0) - (if (string-match " " to-strings) + (if (string-search " " to-strings) (setq replacements (append replacements (list (substring to-strings 0 - (string-match " " to-strings)))) + (string-search " " to-strings)))) to-strings (substring to-strings - (1+ (string-match " " to-strings)))) + (1+ (string-search " " to-strings)))) (setq replacements (append replacements (list to-strings)) to-strings "")))) (perform-replace regexp replacements t t nil n nil start end nil region-noncontiguous-p))) diff --git a/lisp/shell.el b/lisp/shell.el index 5aab80d1031..292f267d2e1 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -1252,7 +1252,7 @@ Returns t if successful." (list start end (lambda (string pred action) - (if (string-match "/" string) + (if (string-search "/" string) (completion-file-name-table string pred action) (complete-with-action action completions string pred))) :exit-function @@ -1328,7 +1328,7 @@ Returns non-nil if successful." (looking-at "\\$?[({]*") (match-end 0))) (variables (mapcar (lambda (x) - (substring x 0 (string-match "=" x))) + (substring x 0 (string-search "=" x))) process-environment)) (suffix (pcase (char-before start) (?\{ "}") (?\( ")") (_ "")))) (list start end variables diff --git a/lisp/simple.el b/lisp/simple.el index 3ad8634975f..985beb06fc9 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4272,11 +4272,11 @@ the contents are inserted into the buffer anyway. Optional arguments ACTION and FRAME are as for `display-buffer', and are used only if a pop-up buffer is displayed." - (cond ((and (stringp message) (not (string-match "\n" message))) + (cond ((and (stringp message) (not (string-search "\n" message))) ;; Trivial case where we can use the echo area (message "%s" message)) ((and (stringp message) - (= (string-match "\n" message) (1- (length message)))) + (= (string-search "\n" message) (1- (length message)))) ;; Trivial case where we can just remove single trailing newline (message "%s" (substring message 0 (1- (length message))))) (t diff --git a/lisp/speedbar.el b/lisp/speedbar.el index 34fbec9c218..3cc3e276067 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el @@ -3270,7 +3270,7 @@ Handles end-of-sublist smartly." Clicking this button expands or contracts a directory. TEXT is the button clicked which has either a + or -. TOKEN is the directory to be expanded. INDENT is the current indentation level." - (cond ((string-match "\\+" text) ;we have to expand this dir + (cond ((string-search "+" text) ;we have to expand this dir (setq speedbar-shown-directories (cons (expand-file-name (concat (speedbar-line-directory indent) token "/")) @@ -3283,7 +3283,7 @@ expanded. INDENT is the current indentation level." (speedbar-default-directory-list (concat (speedbar-line-directory indent) token "/") (1+ indent))))) - ((string-match "-" text) ;we have to contract this node + ((string-search "-" text) ;we have to contract this node (speedbar-reset-scanners) (let ((oldl speedbar-shown-directories) (newl nil) @@ -3317,7 +3317,7 @@ INDENT is the current indentation level and is unused." The parameter TEXT and TOKEN are required, where TEXT is the button clicked, and TOKEN is the file to expand. INDENT is the current indentation level." - (cond ((string-match "\\+" text) ;we have to expand this file + (cond ((string-search "+" text) ;we have to expand this file (let* ((fn (expand-file-name (concat (speedbar-line-directory indent) token))) (lst (speedbar-fetch-dynamic-tags fn))) @@ -3329,7 +3329,7 @@ indentation level." (save-excursion (end-of-line) (forward-char 1) (funcall (car lst) indent (cdr lst))))))) - ((string-match "-" text) ;we have to contract this node + ((string-search "-" text) ;we have to contract this node (speedbar-change-expand-button-char ?+) (speedbar-delete-subblock indent)) (t (error "Ooops... not sure what to do"))) @@ -3358,14 +3358,14 @@ INDENT is the current indentation level." "Expand a tag sublist. Imenu will return sub-lists of specialized tag types. Etags does not support this feature. TEXT will be the button string. TOKEN will be the list, and INDENT is the current indentation level." - (cond ((string-match "\\+" text) ;we have to expand this file + (cond ((string-search "+" text) ;we have to expand this file (speedbar-change-expand-button-char ?-) (speedbar-with-writable (save-excursion (end-of-line) (forward-char 1) (speedbar-insert-generic-list indent token 'speedbar-tag-expand 'speedbar-tag-find)))) - ((string-match "-" text) ;we have to contract this node + ((string-search "-" text) ;we have to contract this node (speedbar-change-expand-button-char ?+) (speedbar-delete-subblock indent)) (t (error "Ooops... not sure what to do"))) diff --git a/lisp/subr.el b/lisp/subr.el index 87298b5cfde..1cae3ee1a60 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4808,7 +4808,7 @@ It understands Emacs Lisp quoting within STRING, such that (split-string-and-unquote (combine-and-quote-strings strs)) == strs The SEPARATOR regexp defaults to \"\\s-+\"." (let ((sep (or separator "\\s-+")) - (i (string-match "\"" string))) + (i (string-search "\"" string))) (if (null i) (split-string string sep t) ; no quoting: easy (append (unless (eq i 0) (split-string (substring string 0 i) sep t)) diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el index 3f0cca0ab7a..411c71cd8c4 100644 --- a/lisp/tar-mode.el +++ b/lisp/tar-mode.el @@ -962,7 +962,7 @@ return nil. Otherwise point is returned." (new-buffer-file-name (expand-file-name ;; `:' is not allowed on Windows (concat tarname "!" - (if (string-match "/" name) + (if (string-search "/" name) name ;; Make sure `name' contains a / ;; so set-auto-mode doesn't try diff --git a/lisp/term.el b/lisp/term.el index 27f0bb1be3b..b3870a814d2 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -3488,9 +3488,9 @@ The top-most line is line 0." ((= (aref string 0) ?\032) ;; gdb (when invoked with -fullname) prints: ;; \032\032FULLFILENAME:LINENUMBER:CHARPOS:BEG_OR_MIDDLE:PC\n - (let* ((first-colon (string-match ":" string 1)) + (let* ((first-colon (string-search ":" string 1)) (second-colon - (string-match ":" string (1+ first-colon))) + (string-search ":" string (1+ first-colon))) (filename (substring string 1 first-colon)) (fileline (string-to-number (substring string (1+ first-colon) second-colon)))) @@ -4307,7 +4307,7 @@ well as the newer ports COM10 and higher." (when (or (null x) (and (stringp x) (zerop (length x)))) (error "No serial port selected")) (when (not (or (serial-port-is-file-p) - (string-match "\\\\" x))) + (string-search "\\" x))) (setq x (concat "\\\\.\\" x))) x)) diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index 31186fb4fac..5cece1aa3c6 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -3962,7 +3962,7 @@ Optional arg COMMA is as in `bibtex-enclosing-field'. It is t for interactive calls." (interactive (list nil t)) (unless field (setq field (car (bibtex-find-text-internal nil nil comma)))) - (if (string-match "@" field) + (if (string-search "@" field) (cond ((bibtex-string= field "@string") (message "String definition")) ((bibtex-string= field "@preamble") diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 4c64531ea35..67852998f42 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -2497,7 +2497,7 @@ if defined." "Customize `ispell-alternate-dictionary' to set yours."))) (let* ((process-connection-type ispell-use-ptys-p) - (wild-p (string-match "\\*" word)) + (wild-p (string-search "*" word)) (look-p (and ispell-look-p ; Only use look for an exact match. (or ispell-have-new-look (not wild-p)))) (prog (if look-p ispell-look-command ispell-grep-command)) @@ -2560,7 +2560,7 @@ if defined." (continue t) end) (while continue - (setq end (string-match "\n" output start)) ; get text up to the newline. + (setq end (string-search "\n" output start)) ; get text up to the newline. ;; If we get out of sync and ispell-filter-continue is asserted when we ;; are not continuing, treat the next item as a separate list. When ;; ispell-filter-continue is asserted, ispell-filter *should* always be a @@ -2732,11 +2732,11 @@ Optional third arg SHIFT is an offset to apply based on previous corrections." (if (eq type ?#) (setq count 0) ; no misses for type # (setq count (string-to-number output) ; get number of misses. - output (substring output (1+ (string-match " " output 1))))) + output (substring output (1+ (string-search " " output 1))))) (setq offset (string-to-number output)) (setq output (if (eq type ?#) ; No miss or guess list. nil - (substring output (1+ (string-match " " output 1))))) + (substring output (1+ (string-search " " output 1))))) (while output (let ((end (string-match ", \\|\\($\\)" output))) ; end of miss/guess. (setq cur-count (1+ cur-count)) @@ -4077,7 +4077,7 @@ Includes LaTeX/Nroff modes and extended character mode." (ispell-send-string "+\n~tex\n")) ((string-match "nroff-mode" string) (ispell-send-string "-\n~nroff\n")) - ((string-match "~" string) ; Set extended character mode. + ((string-search "~" string) ; Set extended character mode. (ispell-send-string (concat string "\n"))) (t (message "Invalid Ispell Parsing argument!") (sit-for 2)))))))) diff --git a/lisp/textmodes/reftex-cite.el b/lisp/textmodes/reftex-cite.el index 650d11d4aca..895064b82f3 100644 --- a/lisp/textmodes/reftex-cite.el +++ b/lisp/textmodes/reftex-cite.el @@ -718,7 +718,7 @@ While entering the regexp, completion on knows citation keys is possible. (insert string)) ;; Reposition cursor? - (when (string-match "\\?" string) + (when (string-search "?" string) (search-backward "?") (delete-char 1)) diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el index 0157f8443aa..9def10cee05 100644 --- a/lisp/textmodes/reftex-parse.el +++ b/lisp/textmodes/reftex-parse.el @@ -757,7 +757,7 @@ if the information is exact (t) or approximate (nil)." (while (and (setq tail (memq (assq 'toc (cdr tail)) tail)) (setq entry (car tail)) (>= (nth 5 entry) level)) - (setq star (string-match "\\*" (nth 6 entry)) + (setq star (string-search "*" (nth 6 entry)) context (nth 2 entry) section-number (reftex-section-number (nth 5 entry) star)) diff --git a/lisp/textmodes/reftex-ref.el b/lisp/textmodes/reftex-ref.el index 611102ecbac..19081825931 100644 --- a/lisp/textmodes/reftex-ref.el +++ b/lisp/textmodes/reftex-ref.el @@ -798,7 +798,7 @@ When called with 2 C-u prefix args, disable magic word recognition." (push (cons (current-buffer) buffer-invisibility-spec) reftex-buffers-with-changed-invisibility) (setq buffer-invisibility-spec nil)) - ((string-match "\r" (buffer-substring beg end)) + ((string-search "\r" (buffer-substring beg end)) ;; Invisible with selective display. We need to copy it. (let ((string (buffer-substring-no-properties beg end))) (switch-to-buffer "*RefTeX Context Copy*") diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el index c732299361c..1cb2cf40c3b 100644 --- a/lisp/textmodes/reftex.el +++ b/lisp/textmodes/reftex.el @@ -813,7 +813,7 @@ This enforces rescanning the buffer on next use." (setq wordlist (nthcdr 4 entry))) (if (and (stringp fmt) - (string-match "@" fmt)) + (string-search "@" fmt)) ;; Special syntax for specifying a label format (setq fmt (split-string fmt "@+")) (setq fmt (list "\\label{%s}" fmt))) diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index d9d8059f960..5169377c136 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -2072,7 +2072,7 @@ Return the process in which TeX is running." (let* ((cmd (eval command t)) (proc (tex-shell-proc)) (buf (process-buffer proc)) - (star (string-match "\\*" cmd)) + (star (string-search "*" cmd)) (string (concat (if (null file) @@ -2474,7 +2474,7 @@ Only applies the FSPEC to the args part of FORMAT." (defun tex-start-tex (command file &optional dir) "Start a TeX run, using COMMAND on FILE." - (let* ((star (string-match "\\*" command)) + (let* ((star (string-search "*" command)) (compile-command (if star (concat (substring command 0 star) @@ -2773,7 +2773,7 @@ so normally SUFFIX starts with one." ;; Not found, so split on first period. (concat (file-name-directory file-name) (substring file 0 - (string-match "\\." file)) + (string-search "." file)) suffix))) " ")) diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el index 5bbf1a85b36..66bbfb0f9f6 100644 --- a/lisp/thingatpt.el +++ b/lisp/thingatpt.el @@ -492,7 +492,7 @@ looks like an email address, \"ftp://\" if it starts with (and (string-match "\\`[[:alnum:]]+\\'" str) (eq (char-before (car bounds)) ?<) (eq (char-after (cdr bounds)) ?>) - (not (string-match "~" (expand-file-name (concat "~" str)))) + (not (string-search "~" (expand-file-name (concat "~" str)))) (setq str (concat "mailto:" str))) ;; If it looks like news.example.com, treat it as news. (if (thing-at-point-newsgroup-p str) diff --git a/lisp/tmm.el b/lisp/tmm.el index 2040f522700..71082bd2f4b 100644 --- a/lisp/tmm.el +++ b/lisp/tmm.el @@ -268,7 +268,7 @@ Stores a list of all the shortcuts in the free variable `tmm-short-cuts'." (cdr elt))) (t (let* ((str (car elt)) - (paren (string-match "(" str)) + (paren (string-search "(" str)) (pos 0) (word 0) char) (catch 'done ; ??? is this slow? (while (and (or (not tmm-shortcut-words) ; no limit on words diff --git a/lisp/transient.el b/lisp/transient.el index 4087a0c68a6..5f441e80ddd 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -3073,7 +3073,7 @@ Optional support for popup buttons is also implemented here." ;; 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) + (unless (string-search " " key) (setq pre (string-replace " " "" pre)) (setq suf (string-replace " " "" suf))) (concat (propertize pre 'face 'default) diff --git a/lisp/url/url-auth.el b/lisp/url/url-auth.el index f291414e81b..06cfacc99d6 100644 --- a/lisp/url/url-auth.el +++ b/lisp/url/url-auth.el @@ -102,10 +102,10 @@ instead of the filename inheritance method." (byserv (setq retval (cdr-safe (assoc file byserv))) (if (and (not retval) - (string-match "/" file)) + (string-search "/" file)) (while (and byserv (not retval)) (setq data (car (car byserv))) - (if (or (not (string-match "/" data)) ; It's a realm - take it! + (if (or (not (string-search "/" data)) ; It's a realm - take it! (and (>= (length file) (length data)) (string= data (substring file 0 (length data))))) @@ -251,12 +251,12 @@ a match." (assoc dirkey keylist) ;; No exact match found. Continue to look for partial match if ;; dirkey is not a realm. - (and (string-match "/" dirkey) + (and (string-search "/" dirkey) (let (match) (while (and (null match) keylist) (if (or ;; Any realm candidate matches. Why? - (not (string-match "/" (caar keylist))) + (not (string-search "/" (caar keylist))) ;; Parent directory matches. (string-prefix-p (caar keylist) dirkey)) (setq match (car keylist)) diff --git a/lisp/url/url-news.el b/lisp/url/url-news.el index 49cc587590e..4fe909cadbc 100644 --- a/lisp/url/url-news.el +++ b/lisp/url/url-news.el @@ -106,7 +106,7 @@ (article (url-unhex-string (url-filename url)))) (url-news-open-host host port (url-user url) (url-password url)) (cond - ((string-match "@" article) ; Its a specific article + ((string-search "@" article) ; Its a specific article (setq buf (url-news-fetch-message-id host article))) ((string= article "") ; List all newsgroups (gnus)) diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el index 8b79736d004..113ac2833bc 100644 --- a/lisp/url/url-util.el +++ b/lisp/url/url-util.el @@ -252,7 +252,7 @@ Will not do anything if `url-show-status' is nil." (while pairs (setq cur (car pairs) pairs (cdr pairs)) - (unless (string-match "=" cur) + (unless (string-search "=" cur) (setq cur (concat cur "="))) (when (string-match "=" cur) diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el index ef607133e86..c8f36fb76ec 100644 --- a/lisp/vc/vc-cvs.el +++ b/lisp/vc/vc-cvs.el @@ -1173,7 +1173,7 @@ is non-nil." (mtime (file-attribute-modification-time (file-attributes file))) (parsed-time (progn (require 'parse-time) (parse-time-string (concat time " +0000"))))) - (cond ((and (not (string-match "\\+" time)) + (cond ((and (not (string-search "+" time)) (decoded-time-second parsed-time) ;; Compare just the seconds part of the file time, ;; since CVS file time stamp resolution is just 1 second. diff --git a/lisp/wid-browse.el b/lisp/wid-browse.el index 54b71c9f9f6..7ce0633b40b 100644 --- a/lisp/wid-browse.el +++ b/lisp/wid-browse.el @@ -218,7 +218,7 @@ Nothing is assumed about value." (error (prin1-to-string signal))))) (when (string-match "\n\\'" pp) (setq pp (substring pp 0 (1- (length pp))))) - (if (cond ((string-match "\n" pp) + (if (cond ((string-search "\n" pp) nil) ((> (length pp) (- (window-width) (current-column))) nil) diff --git a/lisp/woman.el b/lisp/woman.el index 0bc992d8f7f..fe9f8969c3e 100644 --- a/lisp/woman.el +++ b/lisp/woman.el @@ -418,7 +418,7 @@ As a special case, if PATHS is nil then replace it by calling (if (memq system-type '(windows-nt ms-dos)) (cond ((null paths) (mapcar #'woman-Cyg-to-Win (woman-parse-man.conf))) - ((string-match-p ";" paths) + ((string-search ";" paths) ;; Assume DOS-style path-list... (mapcan ; splice list into list (lambda (x) @@ -1939,12 +1939,12 @@ Optional argument REDRAW, if non-nil, forces mode line to be updated." (setq symbol (car p)) ; 1. name (if (functionp symbol) ; 2. command doc (if (setq doc (documentation symbol t)) - (substring doc 0 (string-match "\n" doc)) + (substring doc 0 (string-search "\n" doc)) "(not documented)")) (if (custom-variable-p symbol) ; 3. variable doc (if (setq doc (documentation-property symbol 'variable-documentation t)) - (substring doc 0 (string-match "\n" doc)))))) + (substring doc 0 (string-search "\n" doc)))))) (setq p (cdr p)))) ;; Output the result: (and (apropos-print t nil) @@ -1955,7 +1955,7 @@ Optional argument REDRAW, if non-nil, forces mode line to be updated." (defun WoMan-getpage-in-background (topic) "Use TOPIC to start WoMan from `Man-follow-manual-reference'." ;; topic is a string, generally of the form "section topic" - (let ((s (string-match " " topic))) + (let ((s (string-search " " topic))) (if s (setq topic (substring topic (1+ s)))) (woman topic))) @@ -3840,7 +3840,7 @@ Leave 1 blank line. Format paragraphs upto TO." ((eolp) ; extend line ;; Insert character INCLUDING TEXT PROPERTIES: ;; (insert (substring overlap i (1+ i))) - (let ((eol (string-match "\n" overlap i))) + (let ((eol (string-search "\n" overlap i))) (insert (substring overlap i eol)) (setq i (or eol imax))) ) diff --git a/lisp/xml.el b/lisp/xml.el index 4e2dd13ecbd..1b2d6557388 100644 --- a/lisp/xml.el +++ b/lisp/xml.el @@ -922,11 +922,11 @@ references and parameter-entity references." (progn (setq elem (match-string-no-properties 1 string) modifier (match-string-no-properties 2 string)) - (if (string-match-p "|" elem) + (if (string-search "|" elem) (setq elem (cons 'choice (mapcar 'xml-parse-elem-type (split-string elem "|")))) - (if (string-match-p "," elem) + (if (string-search "," elem) (setq elem (cons 'seq (mapcar 'xml-parse-elem-type (split-string elem ","))))))) diff --git a/test/lisp/emacs-lisp/check-declare-tests.el b/test/lisp/emacs-lisp/check-declare-tests.el index 9552bf0e397..276530fb4d3 100644 --- a/test/lisp/emacs-lisp/check-declare-tests.el +++ b/test/lisp/emacs-lisp/check-declare-tests.el @@ -106,11 +106,11 @@ (let ((res (buffer-string))) ;; Don't care too much about the format of the output, but ;; check that key information is present. - (should (string-match-p "foo-file" res)) - (should (string-match-p "foo-fun" res)) - (should (string-match-p "bar-file" res)) - (should (string-match-p "it wasn't" res)) - (should (string-match-p "999" res)))))) + (should (string-search "foo-file" res)) + (should (string-search "foo-fun" res)) + (should (string-search "bar-file" res)) + (should (string-search "it wasn't" res)) + (should (string-search "999" res)))))) (provide 'check-declare-tests) ;;; check-declare-tests.el ends here diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el index db93250b17b..fb24b98595b 100644 --- a/test/lisp/files-tests.el +++ b/test/lisp/files-tests.el @@ -610,7 +610,7 @@ unquoted file names." (ert-deftest files-tests-file-name-non-special-dired-compress-handler () ;; `dired-compress-file' can get confused by filenames with ":" in ;; them, which causes this to fail on `windows-nt' systems. - (when (string-match-p ":" (expand-file-name temporary-file-directory)) + (when (string-search ":" (expand-file-name temporary-file-directory)) (ert-skip "FIXME: `dired-compress-file' unreliable when filenames contain `:'.")) (files-tests--with-temp-non-special (tmpfile nospecial) (let ((compressed (dired-compress-file nospecial))) diff --git a/test/lisp/net/network-stream-tests.el b/test/lisp/net/network-stream-tests.el index 1a4cc744f0c..4a0b23dd26f 100644 --- a/test/lisp/net/network-stream-tests.el +++ b/test/lisp/net/network-stream-tests.el @@ -128,7 +128,7 @@ (when prev (setq string (concat prev string)) (process-put proc 'previous-string nil))) - (if (and (not (string-match "\n" string)) + (if (and (not (string-search "\n" string)) (> (length string) 0)) (process-put proc 'previous-string string)) (let ((command (split-string string))) diff --git a/test/src/coding-tests.el b/test/src/coding-tests.el index 0309b2b1ad6..134f5676709 100644 --- a/test/src/coding-tests.el +++ b/test/src/coding-tests.el @@ -56,7 +56,7 @@ (set-buffer-multibyte nil) (insert (encode-coding-string "あ" 'euc-jp) "\xd" "\n") (decode-coding-region (point-min) (point-max) 'euc-jp-dos) - (should-not (string-match-p "\^M" (buffer-string))))) + (should-not (string-search "\^M" (buffer-string))))) ;; Return the contents (specified by CONTENT-TYPE; ascii, latin, or ;; binary) of a test file. -- cgit v1.2.3