From ce35760b19315b634e62e2c64988018189dcdbdc Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 8 Feb 2021 09:03:27 +0100 Subject: ; Minor license statement fixes --- lisp/gnus/gnus-search.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lisp/gnus/gnus-search.el') diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 21602f825c1..4538370584b 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -4,18 +4,20 @@ ;; Author: Eric Abrahamsen -;; This program is free software; you can redistribute it and/or modify +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. -;; This program is distributed in the hope that it will be useful, +;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . +;; along with GNU Emacs. If not, see . ;;; Commentary: -- cgit v1.2.3 From 1b0e6a16d3ae32576a642898c39695a3affd2fd7 Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Mon, 8 Feb 2021 12:27:04 -0800 Subject: Run Gnus group names through regexp-quote when matching results * lisp/gnus/gnus-search.el (gnus-search-indexed-parse-output): Be more careful about making sure group names will match search results correctly. --- lisp/gnus/gnus-search.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'lisp/gnus/gnus-search.el') diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 4538370584b..d7b1c06114b 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -1348,12 +1348,14 @@ Returns a list of [group article score] vectors." (let ((prefix (slot-value engine 'remove-prefix)) (group-regexp (when groups (mapconcat - (lambda (x) - (replace-regexp-in-string - ;; Accept any of [.\/] as path separators. - "[.\\/]" "[.\\\\/]" - (gnus-group-real-name x))) - groups "\\|"))) + (lambda (group-name) + (mapconcat #'regexp-quote + (split-string + (gnus-group-real-name group-name) + "[.\\/]") + "[.\\\\/]")) + groups + "\\|"))) artlist vectors article group) (goto-char (point-min)) (while (not (eobp)) -- cgit v1.2.3 From de15ca7d0065c5f77c88a90f4f14569886be3617 Mon Sep 17 00:00:00 2001 From: Mattias Engdegård Date: Thu, 18 Feb 2021 16:41:36 +0100 Subject: Fix typos * doc/lispref/display.texi (Size of Displayed Text): * doc/lispref/windows.texi (Buffer Display Action Functions): * etc/NEWS: * etc/ORG-NEWS (Org-Attach has been refactored and extended): * lisp/battery.el (display-battery-mode, battery--upower-subsribe): * lisp/calendar/parse-time.el: * lisp/dired-x.el: * lisp/emacs-lisp/chart.el (chart-sequece, chart-bar-quickie): * lisp/emacs-lisp/eldoc.el (eldoc-echo-area-use-multiline-p) (eldoc-documentation-strategy): * lisp/emacs-lisp/pcase.el (pcase--split-pred, pcase--u1): * lisp/gnus/gnus-search.el (gnus-search-expandable-keys) (gnus-search-parse-query, gnus-search-query-return-string) (gnus-search-imap, gnus-search-imap-search-command) (gnus-search-transform-expression): * lisp/gnus/nnselect.el: * lisp/isearch.el (isearch-lazy-count-format): * lisp/mh-e/mh-show.el (mh-show-msg): * lisp/net/dictionary-connection.el (dictionary-connection-open): * lisp/net/dictionary.el (dictionary-default-popup-strategy) (dictionary, dictionary-split-string, dictionary-do-select-dictionary) (dictionary-display-dictionarys, dictionary-search) (dictionary-tooltip-mode): * lisp/net/eudcb-macos-contacts.el (eudc-macos-contacts-set-server): * lisp/net/mailcap.el (mailcap-mime-data): * lisp/net/tramp-smb.el (tramp-smb-maybe-open-connection): * lisp/nxml/nxml-mode.el (nxml-mode): * lisp/progmodes/cc-engine.el: * lisp/progmodes/cperl-mode.el (cperl-mode) (cperl-fontify-syntaxically): * lisp/progmodes/flymake.el (flymake-diagnostic-functions): * lisp/progmodes/verilog-mode.el (verilog--supressed-warnings) (verilog-preprocess): * lisp/simple.el (self-insert-uses-region-functions): * lisp/textmodes/bibtex.el (bibtex-copy-summary-as-kill): * lisp/textmodes/texnfo-upd.el (texinfo-insert-master-menu-list): * src/dispnew.c: * src/font.c (Ffont_get): * src/indent.c (compute_motion): * src/process.c (init_process_emacs): * src/w32fns.c (deliver_wm_chars): * test/lisp/jsonrpc-tests.el (deferred-action-complex-tests): Fix typos in documentation, comments, and internal identifiers. --- doc/lispref/display.texi | 2 +- doc/lispref/windows.texi | 2 +- etc/NEWS | 2 +- etc/ORG-NEWS | 2 +- lisp/battery.el | 4 ++-- lisp/calendar/parse-time.el | 2 +- lisp/dired-x.el | 2 +- lisp/emacs-lisp/chart.el | 6 +++--- lisp/emacs-lisp/eldoc.el | 4 ++-- lisp/emacs-lisp/pcase.el | 4 ++-- lisp/gnus/gnus-search.el | 16 ++++++++-------- lisp/gnus/nnselect.el | 2 +- lisp/isearch.el | 2 +- lisp/mh-e/mh-show.el | 2 +- lisp/net/dictionary-connection.el | 6 +++--- lisp/net/dictionary.el | 20 ++++++++++---------- lisp/net/eudcb-macos-contacts.el | 2 +- lisp/net/mailcap.el | 2 +- lisp/net/tramp-smb.el | 2 +- lisp/nxml/nxml-mode.el | 2 +- lisp/progmodes/cc-engine.el | 2 +- lisp/progmodes/cperl-mode.el | 6 +++--- lisp/progmodes/flymake.el | 2 +- lisp/progmodes/verilog-mode.el | 4 ++-- lisp/simple.el | 2 +- lisp/textmodes/bibtex.el | 2 +- lisp/textmodes/texnfo-upd.el | 2 +- src/dispnew.c | 2 +- src/font.c | 2 +- src/indent.c | 2 +- src/process.c | 2 +- src/w32fns.c | 2 +- test/lisp/jsonrpc-tests.el | 2 +- 33 files changed, 59 insertions(+), 59 deletions(-) (limited to 'lisp/gnus/gnus-search.el') diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 93e935ccf86..131ad2d9c87 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -1997,7 +1997,7 @@ the beginning of the result if a multi-column character in If @var{ellipsis} is non-@code{nil}, it should be a string which will replace the end of @var{string} when it is truncated. In this case, -more charcaters will be removed from @var{string} to free enough space +more characters will be removed from @var{string} to free enough space for @var{ellipsis} to fit within @var{width} columns. However, if the display width of @var{string} is less than the display width of @var{ellipsis}, @var{ellipsis} will not be appended to the result. If diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index f305d1a8ee8..c32d711f12a 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -2557,7 +2557,7 @@ frame visible and, unless @var{alist} contains an This function tries to display @var{buffer} by finding a window that is displaying a buffer in a given mode. -If @var{alist} contains a @code{mode} entry, its value specifes a +If @var{alist} contains a @code{mode} entry, its value specifies a major mode (a symbol) or a list of major modes. If @var{alist} contains no @code{mode} entry, the current major mode of @var{buffer} is used instead. A window is a candidate if it displays a buffer diff --git a/etc/NEWS b/etc/NEWS index 7665d4740f9..ee8a68a259d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1015,7 +1015,7 @@ separate buffer, or a tooltip. *** New user option 'eldoc-documentation-strategy'. The built-in choices available for this user option let users compose the results of 'eldoc-documentation-functions' in various ways, even -if some of those functions are sychronous and some asynchchronous. +if some of those functions are synchronous and some asynchronous. The user option replaces 'eldoc-documentation-function', which is now obsolete. diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 2cae8b92ace..2b9cbf37c45 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -747,7 +747,7 @@ removed. For those who hate breaking changes, even though the changes are made to clean things up; fear not. ATTACH_DIR will still continue to work. It's just not documented any longer. When you get the chance, run the -code above to clean things up anyways! +code above to clean things up anyway! **** New hooks Two hooks are added to org-attach: diff --git a/lisp/battery.el b/lisp/battery.el index 77ad73d15d7..59f6987ad16 100644 --- a/lisp/battery.el +++ b/lisp/battery.el @@ -246,7 +246,7 @@ seconds." (add-to-list 'global-mode-string 'battery-mode-line-string t) (and (eq battery-status-function #'battery-upower) battery-upower-subscribe - (battery--upower-subsribe)) + (battery--upower-subscribe)) (setq battery-update-timer (run-at-time nil battery-update-interval #'battery-update-handler)) (battery-update)) @@ -634,7 +634,7 @@ Intended as a UPower PropertiesChanged signal handler." (mapc #'dbus-unregister-object battery--upower-signals) (setq battery--upower-signals ())) -(defun battery--upower-subsribe () +(defun battery--upower-subscribe () "Subscribe to UPower device change signals." (push (dbus-register-signal :system battery-upower-service battery-upower-path diff --git a/lisp/calendar/parse-time.el b/lisp/calendar/parse-time.el index ba7418faf78..aa3236cf256 100644 --- a/lisp/calendar/parse-time.el +++ b/lisp/calendar/parse-time.el @@ -29,7 +29,7 @@ ;; `parse-time-string' parses a time in a string and returns a list of ;; values, just like `decode-time', where unspecified elements in the -;; string are returned as nil (except unspecfied DST is returned as -1). +;; string are returned as nil (except unspecified DST is returned as -1). ;; `encode-time' may be applied on these values to obtain an internal ;; time value. diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 5a52eccbbe3..1199de183fb 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -447,7 +447,7 @@ If it is `no-dir', omitting is much faster, but you can only match against the non-directory part of the file name. Set it to nil if you need to match the entire file name.") -;; \017=^O for Omit - other packages can chose other control characters. +;; \017=^O for Omit - other packages can choose other control characters. (defvar dired-omit-marker-char ?\017 "Temporary marker used by Dired-Omit. Should never be used as marker by the user or other packages.") diff --git a/lisp/emacs-lisp/chart.el b/lisp/emacs-lisp/chart.el index 7d760ffc57f..40c17b916f9 100644 --- a/lisp/emacs-lisp/chart.el +++ b/lisp/emacs-lisp/chart.el @@ -187,7 +187,7 @@ Make sure the width/height is correct." ) "Class used to display an axis which represents different named items.") -(defclass chart-sequece () +(defclass chart-sequence () ((data :initarg :data :initform nil) (name :initarg :name @@ -583,12 +583,12 @@ SORT-PRED if desired." )) (iv (eq dir 'vertical))) (chart-add-sequence nc - (make-instance 'chart-sequece + (make-instance 'chart-sequence :data namelst :name nametitle) (if iv 'x-axis 'y-axis)) (chart-add-sequence nc - (make-instance 'chart-sequece + (make-instance 'chart-sequence :data numlst :name numtitle) (if iv 'y-axis 'x-axis)) diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index c95540ea3cf..a02406a7b73 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -100,7 +100,7 @@ If the value is a positive number, it is used to calculate a number of logical lines of documentation that ElDoc is allowed to put in the echo area. If a positive integer, the number is used directly, while a float specifies the number of lines as a -proporting of the echo area frame's height. +proportion of the echo area frame's height. If value is the symbol `truncate-sym-name-if-fit' t, the part of the doc string that represents a symbol's name may be truncated @@ -692,7 +692,7 @@ following values are allowed: - `eldoc-documentation-compose-eagerly': calls all functions in the special hook and display as many of the resulting doc - strings as possible, as soon as possibl. Preserving the + strings as possible, as soon as possible. Preserving the relative order of doc strings; - `eldoc-documentation-enthusiast': calls all functions in the diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index d3928fa5051..c7288b7fa2a 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el @@ -642,7 +642,7 @@ MATCH is the pattern that needs to be matched, of the form: (defun pcase--split-pred (vars upat pat) "Indicate the overlap or mutual-exclusion between UPAT and PAT. -More specifically retuns a pair (A . B) where A indicates whether PAT +More specifically returns a pair (A . B) where A indicates whether PAT can match when UPAT has matched, and B does the same for the case where UPAT failed to match. A and B can be one of: @@ -784,7 +784,7 @@ Otherwise, it defers to REST which is a list of branches of the form \(ELSE-MATCH ELSE-CODE . ELSE-VARS)." ;; Depending on the order in which we choose to check each of the MATCHES, ;; the resulting tree may be smaller or bigger. So in general, we'd want - ;; to be careful to chose the "optimal" order. But predicate + ;; to be careful to choose the "optimal" order. But predicate ;; patterns make this harder because they create dependencies ;; between matches. So we don't bother trying to reorder anything. (cond diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index d7b1c06114b..339bff9d67a 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -365,7 +365,7 @@ This variable can also be set per-server." "A list of strings representing expandable search keys. \"Expandable\" simply means the key can be abbreviated while typing in search queries, ie \"subject\" could be entered as -\"subj\" or even \"su\", though \"s\" is ambigous between +\"subj\" or even \"su\", though \"s\" is ambiguous between \"subject\" and \"since\". Ambiguous abbreviations will raise an error." @@ -402,7 +402,7 @@ The search \"language\" is essentially a series of key:value expressions. Key is most often a mail header, but there are other keys. Value is a string, quoted if it contains spaces. Key and value are separated by a colon, no space. Expressions -are implictly ANDed; the \"or\" keyword can be used to +are implicitly ANDed; the \"or\" keyword can be used to OR. \"not\" will negate the following expression, or keys can be prefixed with a \"-\". The \"near\" operator will work for engines that understand it; other engines will convert it to @@ -448,7 +448,7 @@ auto-completion of contact names and addresses for keys like Date values (any key in `gnus-search-date-keys') can be provided in any format that `parse-time-string' can parse (note that this can produce weird results). Dates with missing bits will be -interpreted as the most recent occurance thereof (ie \"march 03\" +interpreted as the most recent occurence thereof (ie \"march 03\" is the most recent March 3rd). Lastly, relative specifications such as 1d (one day ago) are understood. This also accepts w, m, and y. m is assumed to be 30 days. @@ -646,7 +646,7 @@ gnus-*-mark marks, and return an appropriate string." "Return a string from the current buffer. If DELIMITED is non-nil, assume the next character is a delimiter character, and return everything between point and the next -occurance of the delimiter, including the delimiters themselves. +occurence of the delimiter, including the delimiters themselves. If TRIM is non-nil, do not return the delimiters. Otherwise, return one word." ;; This function cannot handle nested delimiters, as it's not a @@ -789,7 +789,7 @@ the files in ARTLIST by that search key.") (raw-queries-p :initform (symbol-value 'gnus-search-imap-raw-queries-p))) :documentation - "The base IMAP search engine, using an IMAP server's search capabilites. + "The base IMAP search engine, using an IMAP server's search capabilities. This backend may be subclassed to handle particular IMAP servers' quirks.") @@ -1082,7 +1082,7 @@ Responsible for handling and, or, and parenthetical expressions.") (cl-defmethod gnus-search-imap-search-command ((engine gnus-search-imap) (query string)) "Create the IMAP search command for QUERY. -Currenly takes into account support for the LITERAL+ capability. +Currently takes into account support for the LITERAL+ capability. Other capabilities could be tested here." (with-slots (literal-plus) engine (when literal-plus @@ -1672,8 +1672,8 @@ and \"-\" before marks." (cl-defmethod gnus-search-transform-expression ((engine gnus-search-mairix) (expr (head or))) "Handle Mairix \"or\" statement. -Mairix only accepts \"or\" expressions on homogenous keys. We -cast \"or\" expressions on heterogenous keys as \"and\", which +Mairix only accepts \"or\" expressions on homogeneous keys. We +cast \"or\" expressions on heterogeneous keys as \"and\", which isn't quite right, but it's the best we can do. For date keys, only keep one of the terms." (let ((term1 (caadr expr)) diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el index fffa2d27312..1daa8aa673b 100644 --- a/lisp/gnus/nnselect.el +++ b/lisp/gnus/nnselect.el @@ -33,7 +33,7 @@ ;; turn be a vector of three elements: a real prefixed group name, an ;; article number in that group, and an integer score. The score is ;; not used by nnselect but may be used by other code to help in -;; sorting. Most functions will just chose a fixed number, such as +;; sorting. Most functions will just choose a fixed number, such as ;; 100, for this score. ;; For example the search function `gnus-search-run-query' applied to diff --git a/lisp/isearch.el b/lisp/isearch.el index c571ea94670..8266c4b7a01 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -3356,7 +3356,7 @@ the word mode." (defun isearch-lazy-count-format (&optional suffix-p) "Format the current match number and the total number of matches. -When SUFFIX-P is non-nil, the returned string is indended for +When SUFFIX-P is non-nil, the returned string is intended for isearch-message-suffix prompt. Otherwise, for isearch-message-prefix." (let ((format-string (if suffix-p lazy-count-suffix-format diff --git a/lisp/mh-e/mh-show.el b/lisp/mh-e/mh-show.el index 9ad843c3259..1d25b147323 100644 --- a/lisp/mh-e/mh-show.el +++ b/lisp/mh-e/mh-show.el @@ -136,7 +136,7 @@ displayed." (show-window (get-buffer-window mh-show-buffer)) (display-mime-buttons-flag mh-display-buttons-for-inline-parts-flag)) (if (not (eq (next-window (minibuffer-window)) (selected-window))) - (delete-other-windows)) ; force ourself to the top window + (delete-other-windows)) ; force ourselves to the top window (mh-in-show-buffer (mh-show-buffer) (setq mh-display-buttons-for-inline-parts-flag display-mime-buttons-flag) (if (and show-window diff --git a/lisp/net/dictionary-connection.el b/lisp/net/dictionary-connection.el index 8ad4fe4e637..83125742be3 100644 --- a/lisp/net/dictionary-connection.el +++ b/lisp/net/dictionary-connection.el @@ -23,9 +23,9 @@ ;;; Commentary: ;; dictionary-connection allows to handle TCP-based connections in -;; client mode where text-based information are exchanged. There is +;; client mode where text-based information is exchanged. There is ;; special support for handling CR LF (and the usual CR LF . CR LF -;; terminater). +;; terminator). ;;; Code: @@ -68,7 +68,7 @@ (defun dictionary-connection-open (server port) "Open a connection to SERVER at PORT. -A data structure identifing the connection is returned" +A data structure identifying the connection is returned" (let ((process-buffer (generate-new-buffer (format " connection to %s:%s" server diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el index 6f086053b6a..c6af4e66e39 100644 --- a/lisp/net/dictionary.el +++ b/lisp/net/dictionary.el @@ -127,9 +127,9 @@ by the choice value: The found word exactly matches the searched word. -- Similiar sounding +- Similar sounding - The found word sounds similiar to the searched word. For this match type + The found word sounds similar to the searched word. For this match type the soundex algorithm defined by Donald E. Knuth is used. It will only works with english words and the algorithm is not very reliable (i.e., the soundex algorithm is quite simple). @@ -148,7 +148,7 @@ by the choice value: dictionary server." :group 'dictionary :type '(choice (const :tag "Exact match" "exact") - (const :tag "Similiar sounding" "soundex") + (const :tag "Similar sounding" "soundex") (const :tag "Levenshtein distance one" "lev") (string :tag "User choice")) :version "28.1") @@ -419,7 +419,7 @@ This is a quick reference to this mode describing the default key bindings: ;;;###autoload (defun dictionary () - "Create a new dictonary buffer and install `dictionary-mode'." + "Create a new dictionary buffer and install `dictionary-mode'." (interactive) (let ((buffer (or (and dictionary-use-single-buffer (get-buffer "*Dictionary*")) @@ -568,7 +568,7 @@ The connection takes the proxy setting in customization group answer))) (defun dictionary-split-string (string) - "Split STRING constiting of space-separated words into elements. + "Split STRING consisting of space-separated words into elements. This function knows about the special meaning of quotes (\")" (let ((list)) (while (and string (> (length string) 0)) @@ -894,7 +894,7 @@ The word is taken from the buffer, the DICTIONARY is given as argument." (unless (dictionary-check-reply reply 110) (error "Unknown server answer: %s" (dictionary-reply reply))) - (dictionary-display-dictionarys)))) + (dictionary-display-dictionaries)))) (defun dictionary-simple-split-string (string &optional pattern) "Return a list of substrings of STRING which are separated by PATTERN. @@ -909,7 +909,7 @@ If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"." start (match-end 0))) (nreverse (cons (substring string start) parts)))) -(defun dictionary-display-dictionarys () +(defun dictionary-display-dictionaries () "Handle the display of all dictionaries existing on the server." (dictionary-pre-buffer) (insert "Please select your default dictionary:\n\n") @@ -1171,7 +1171,7 @@ allows editing it." ;; if called by pressing the button (unless word (setq word (read-string "Search word: " nil 'dictionary-word-history))) - ;; just in case non-interactivly called + ;; just in case non-interactively called (unless dictionary (setq dictionary dictionary-default-dictionary)) (dictionary-new-search (cons word dictionary))) @@ -1249,10 +1249,10 @@ allows editing it." ;;; Tooltip support -;; Add a mode indicater named "Dict" +;; Add a mode indicator named "Dict" (defvar dictionary-tooltip-mode nil - "Indicates wheather the dictionary tooltip mode is active.") + "Indicates whether the dictionary tooltip mode is active.") (nconc minor-mode-alist '((dictionary-tooltip-mode " Dict"))) (defcustom dictionary-tooltip-dictionary diff --git a/lisp/net/eudcb-macos-contacts.el b/lisp/net/eudcb-macos-contacts.el index 66a684dfc59..b07016c1229 100644 --- a/lisp/net/eudcb-macos-contacts.el +++ b/lisp/net/eudcb-macos-contacts.el @@ -108,7 +108,7 @@ RETURN-ATTRS is a list of attributes to return, defaulting to (defun eudc-macos-contacts-set-server (dummy) "Set the EUDC server to macOS Contacts app. The server in DUMMY is not actually used, since this backend -always and implicitly connetcs to an instance of the Contacts app +always and implicitly connects to an instance of the Contacts app running on the local host." (interactive) (eudc-set-server dummy 'macos-contacts) diff --git a/lisp/net/mailcap.el b/lisp/net/mailcap.el index b95cd0febcd..3097c9a671e 100644 --- a/lisp/net/mailcap.el +++ b/lisp/net/mailcap.el @@ -332,7 +332,7 @@ whose car is a symbol, it is `eval'uated to yield the validity. If it is a string or list of strings, it represents a shell command to run to return a true or false shell value for the validity. -The last matching entry in this structure takes presedence over +The last matching entry in this structure takes precedence over preceding entries.") (put 'mailcap-mime-data 'risky-local-variable t) diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 4519c34d36e..69359553e44 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -1928,7 +1928,7 @@ If ARGUMENT is non-nil, use it as argument for ;; Check whether we still have the same smbclient version. ;; Otherwise, we must delete the connection cache, because - ;; capabilities migh have changed. + ;; capabilities might have changed. (unless (or argument (processp p)) (let ((default-directory (tramp-compat-temporary-file-directory)) (command (concat tramp-smb-program " -V"))) diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el index 0602943db20..1bc905cee2d 100644 --- a/lisp/nxml/nxml-mode.el +++ b/lisp/nxml/nxml-mode.el @@ -546,7 +546,7 @@ Many aspects this mode can be customized using (when (and nxml-default-buffer-file-coding-system (not (local-variable-p 'buffer-file-coding-system))) (setq buffer-file-coding-system nxml-default-buffer-file-coding-system)) - ;; When starting a new file, insert the XML declaraction. + ;; When starting a new file, insert the XML declaration. (when (and nxml-auto-insert-xml-declaration-flag (zerop (buffer-size))) (nxml-insert-xml-declaration))) diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 484624b8664..9038c7bd95a 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -2665,7 +2665,7 @@ comment at the start of cc-engine.el for more info." ;; One of the above "near" caches is associated with each of these functions. ;; ;; When searching this cache, these functions first seek an exact match, then -;; a "close" match from the assiciated near cache. If neither of these +;; a "close" match from the associated near cache. If neither of these ;; succeed, the nearest preceding entry in the far cache is used. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 44a75269524..d01bd3a48ef 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -1764,12 +1764,12 @@ or as help on variables `cperl-tips', `cperl-problems', (setq-local syntax-propertize-function (lambda (start end) (goto-char start) - ;; Even if cperl-fontify-syntaxically has already gone + ;; Even if cperl-fontify-syntactically has already gone ;; beyond `start', syntax-propertize has just removed ;; syntax-table properties between start and end, so we have ;; to re-apply them. (setq cperl-syntax-done-to start) - (cperl-fontify-syntaxically end)))) + (cperl-fontify-syntactically end)))) (setq cperl-font-lock-multiline t) ; Not localized... (setq-local font-lock-multiline t) (setq-local font-lock-fontify-region-function @@ -8407,7 +8407,7 @@ do extra unwind via `cperl-unwind-to-safe'." (setq end (point))) (font-lock-default-fontify-region beg end loudly)) -(defun cperl-fontify-syntaxically (end) +(defun cperl-fontify-syntactically (end) ;; Some vars for debugging only ;; (message "Syntaxifying...") (let ((dbg (point)) (iend end) (idone cperl-syntax-done-to) diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index b8c8a827eed..d01803282aa 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -483,7 +483,7 @@ Currently, Flymake may provide these keyword-value pairs: * `:recent-changes', a list of recent changes since the last time the backend function was called for the buffer. An empty list - indicates that no changes have been reocrded. If it is the + indicates that no changes have been recorded. If it is the first time that this backend function is called for this activation of `flymake-mode', then this argument isn't provided at all (i.e. it's not merely nil). diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index f934ef7a80e..55c04e13323 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el @@ -134,7 +134,7 @@ (interactive) (message "Using verilog-mode version %s" verilog-mode-version)) -(defmacro verilog--supressed-warnings (warnings &rest body) +(defmacro verilog--suppressed-warnings (warnings &rest body) (declare (indent 1) (debug t)) (cond ((fboundp 'with-suppressed-warnings) @@ -5550,7 +5550,7 @@ FILENAME to find directory to run in, or defaults to `buffer-file-name'." ;; font-lock-fontify-buffer, but IIUC the problem this is supposed to ;; solve only appears in Emacsen older than font-lock-ensure anyway. (when fontlocked - (verilog--supressed-warnings + (verilog--suppressed-warnings ((interactive-only font-lock-fontify-buffer)) (font-lock-fontify-buffer)))))))) diff --git a/lisp/simple.el b/lisp/simple.el index d6ccdad9021..a4da3f58a99 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -549,7 +549,7 @@ It must be called via `run-hook-with-args-until-success' with no arguments. If any function on this hook returns a non-nil value, `delete-selection-mode' will act on that value (see `delete-selection-helper') and will usually delete the region. If all the functions on this hook return -nil, it is an indiction that `self-insert-command' needs the region +nil, it is an indication that `self-insert-command' needs the region untouched by `delete-selection-mode' and will itself do whatever is appropriate with the region. Any function on `post-self-insert-hook' that acts on the region should diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index a22cd97b309..301f7017e41 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -3327,7 +3327,7 @@ Use `bibtex-summary-function' to generate summary." (message "%s %s" key summary)))))) (defun bibtex-copy-summary-as-kill (&optional arg) - "Push summery of current BibTeX entry to kill ring. + "Push summary of current BibTeX entry to kill ring. Use `bibtex-summary-function' to generate summary. If prefix ARG is non-nil push BibTeX entry's URL to kill ring that is generated by calling `bibtex-url'." diff --git a/lisp/textmodes/texnfo-upd.el b/lisp/textmodes/texnfo-upd.el index ea35641a6c6..04778ee94d4 100644 --- a/lisp/textmodes/texnfo-upd.el +++ b/lisp/textmodes/texnfo-upd.el @@ -1033,7 +1033,7 @@ However, there does not need to be a title field." (save-excursion ;; `master-menu-inserted-p' is a kludge to tell - ;; whether to insert @end detailmenu (see bleow) + ;; whether to insert @end detailmenu (see below) (let (master-menu-inserted-p) ;; Handle top of menu (insert "\n@menu\n") diff --git a/src/dispnew.c b/src/dispnew.c index e603c671363..b3e4587250f 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -3328,7 +3328,7 @@ update_frame_with_menu (struct frame *f, int row, int col) } /* Update the mouse position for a frame F. This handles both - updating the display for mouse-face propreties and updating the + updating the display for mouse-face properties and updating the help echo text. Returns the number of events generated. */ diff --git a/src/font.c b/src/font.c index a59ebe216b8..7c1d1ff89b1 100644 --- a/src/font.c +++ b/src/font.c @@ -4122,7 +4122,7 @@ representing the OpenType features supported by the font by this form: SCRIPT, LANGSYS, and FEATURE are all symbols representing OpenType Layout tags. -In addition to the keys listed abobe, the following keys are reserved +In addition to the keys listed above, the following keys are reserved for the specific meanings as below: The value of :combining-capability is non-nil if the font-backend of diff --git a/src/indent.c b/src/indent.c index 0a6b460f753..6246b544fbd 100644 --- a/src/indent.c +++ b/src/indent.c @@ -1315,7 +1315,7 @@ compute_motion (ptrdiff_t from, ptrdiff_t frombyte, EMACS_INT fromvpos, j ^---- next after the point ^--- next char. after the point. ---------- - In case of sigle-column character + In case of single-column character ---------- abcdefgh\\ diff --git a/src/process.c b/src/process.c index 3beb9cf7146..b98bc297a3f 100644 --- a/src/process.c +++ b/src/process.c @@ -8255,7 +8255,7 @@ init_process_emacs (int sockfd) private SIGCHLD handler, allowing catch_child_signal to copy it into lib_child_handler. - Unfortunatly in glib commit 2e471acf, the behavior changed to + Unfortunately in glib commit 2e471acf, the behavior changed to always install a signal handler when g_child_watch_source_new is called and not just the first time it's called. Glib also now resets signal handlers to SIG_DFL when it no longer has a diff --git a/src/w32fns.c b/src/w32fns.c index 86c3db64e7b..9db367bfafe 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -3893,7 +3893,7 @@ deliver_wm_chars (int do_translate, HWND hwnd, UINT msg, UINT wParam, Essentially, we have no information about the "role" of modifiers on this key: which contribute into the produced character (so "are consumed"), and which are - "extra" (must attache to bindable events). + "extra" (must attach to bindable events). The default above would consume ALL modifiers, so the character is reported "as is". However, on many layouts diff --git a/test/lisp/jsonrpc-tests.el b/test/lisp/jsonrpc-tests.el index ea340c370d1..92306d1c7e5 100644 --- a/test/lisp/jsonrpc-tests.el +++ b/test/lisp/jsonrpc-tests.el @@ -244,7 +244,7 @@ :timeout 1) ;; Wait another 0.5 secs just in case the success handlers of ;; one of these last two requests didn't quite have a chance to - ;; run (Emacs 25.2 apparentely needs this). + ;; run (Emacs 25.2 apparently needs this). (accept-process-output nil 0.5) (should second-deferred-went-through-p) (should (eq 1 n-deferred-1)) -- cgit v1.2.3 From 8497af6892fcf9b08a1c120e897c9f5c21ea64fa Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 11 Mar 2021 01:14:30 -0500 Subject: * lisp/gnus/nnmh.el (nnmh-newsgroup-articles): Declare var Reported by Barry Fishman . Along the way, I checked other variables which are similarly let-bound to nil and then read with any intervening assignment, which found another similar case of missing `defvar`s plus a bit of dead code. * lisp/gnus/gnus-kill.el (gnus-apply-kill-file-internal): Remove constant nil var `beg`. * lisp/gnus/gnus-search.el (gnus-search-query-parse-kv): Remove constant nil var `return`. * lisp/gnus/gnus-start.el (gnus-ask-server-for-new-groups): Remove constant nil var `group`. (gnus-killed-assoc, gnus-marked-assoc, gnus-newsrc-assoc): Declare vars. * lisp/gnus/gnus-sum.el (gnus-compute-read-articles): Remove constant nil var `first`. * lisp/gnus/nnbabyl.el (nnbabyl-request-accept-article): Remove constant nil var `beg`. * lisp/gnus/nnfolder.el (nnfolder-possibly-change-group): Remove constant nil var `inf`. * lisp/gnus/nnrss.el (nnrss-request-article): Remove constant nil var `err`. --- lisp/gnus/gnus-kill.el | 4 ++-- lisp/gnus/gnus-search.el | 4 ++-- lisp/gnus/gnus-start.el | 11 ++++++++--- lisp/gnus/gnus-sum.el | 4 ++-- lisp/gnus/nnbabyl.el | 4 ++-- lisp/gnus/nnfolder.el | 4 ++-- lisp/gnus/nnmh.el | 2 ++ lisp/gnus/nnrss.el | 5 ++--- 8 files changed, 22 insertions(+), 16 deletions(-) (limited to 'lisp/gnus/gnus-search.el') diff --git a/lisp/gnus/gnus-kill.el b/lisp/gnus/gnus-kill.el index b0e6cb59d52..f73627a6480 100644 --- a/lisp/gnus/gnus-kill.el +++ b/lisp/gnus/gnus-kill.el @@ -337,7 +337,7 @@ Returns the number of articles marked as read." (gnus-newsgroup-kill-file gnus-newsgroup-name))) (unreads (length gnus-newsgroup-unreads)) (gnus-summary-inhibit-highlight t) - beg) + ) ;; beg (setq gnus-newsgroup-kill-headers nil) ;; If there are any previously scored articles, we remove these ;; from the `gnus-newsgroup-headers' list that the score functions @@ -381,7 +381,7 @@ Returns the number of articles marked as read." (gnus-set-mode-line 'summary) - (if beg + (if nil ;; beg (let ((nunreads (- unreads (length gnus-newsgroup-unreads)))) (or (eq nunreads 0) (gnus-message 6 "Marked %d articles as read" nunreads)) diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 339bff9d67a..61a1d675243 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -549,7 +549,7 @@ structure. In the simplest case, they are simply consed together. String KEY is converted to a symbol." - (let (return) + (let () ;; return (cond ((member key gnus-search-date-keys) (when (string= "after" key) @@ -559,7 +559,7 @@ KEY is converted to a symbol." (setq value (gnus-search-query-parse-mark value))) ((string= "message-id" key) (setq key "id"))) - (or return + (or nil ;; return (cons (intern key) value)))) (defun gnus-search-query-parse-date (value &optional rel-date) diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index a6b362e0834..44e97d54846 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el @@ -1172,7 +1172,7 @@ for new groups, and subscribe the new groups as zombies." gnus-check-new-newsgroups) gnus-secondary-select-methods)))) (groups 0) - group new-newsgroups got-new method hashtb + new-newsgroups got-new method hashtb ;; group gnus-override-subscribe-method) (unless gnus-killed-hashtb (gnus-make-hashtable-from-killed)) @@ -1203,14 +1203,14 @@ for new groups, and subscribe the new groups as zombies." (cond ((eq do-sub 'subscribe) (cl-incf groups) - (puthash g-name group gnus-killed-hashtb) + (puthash g-name nil gnus-killed-hashtb) ;; group (gnus-call-subscribe-functions gnus-subscribe-options-newsgroup-method g-name)) ((eq do-sub 'ignore) nil) (t (cl-incf groups) - (puthash g-name group gnus-killed-hashtb) + (puthash g-name nil gnus-killed-hashtb) ;; group (if gnus-subscribe-hierarchical-interactive (push g-name new-newsgroups) (gnus-call-subscribe-functions @@ -2378,6 +2378,11 @@ If FORCE is non-nil, the .newsrc file is read." (unless (gnus-yes-or-no-p (concat errmsg "; continue? ")) (error "%s" errmsg))))))))) +;; IIUC these 3 vars were used in older .newsrc files. +(defvar gnus-killed-assoc) +(defvar gnus-marked-assoc) +(defvar gnus-newsrc-assoc) + (defun gnus-read-newsrc-el-file (file) (let ((ding-file (concat file "d"))) (when (file-exists-p ding-file) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index bf58cf419a2..97da5503539 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -6354,9 +6354,9 @@ The resulting hash table is returned, or nil if no Xrefs were found." ;; First peel off all invalid article numbers. (when active (let ((ids articles) - id first) + id) ;; first (while (setq id (pop ids)) - (when (and first (> id (cdr active))) + (when nil ;; (and first (> id (cdr active))) ;; We'll end up in this situation in one particular ;; obscure situation. If you re-scan a group and get ;; a new article that is cross-posted to a different diff --git a/lisp/gnus/nnbabyl.el b/lisp/gnus/nnbabyl.el index 3e6f9e88eea..5f486f49703 100644 --- a/lisp/gnus/nnbabyl.el +++ b/lisp/gnus/nnbabyl.el @@ -323,7 +323,7 @@ (nnbabyl-possibly-change-newsgroup group server) (nnmail-check-syntax) (let ((buf (current-buffer)) - result beg) + result) ;; beg (and (nnmail-activate 'nnbabyl) (save-excursion @@ -331,7 +331,7 @@ (search-forward "\n\n" nil t) (forward-line -1) (save-excursion - (while (re-search-backward "^X-Gnus-Newsgroup: " beg t) + (while (re-search-backward "^X-Gnus-Newsgroup: " nil t) ;; beg (delete-region (point) (progn (forward-line 1) (point))))) (when nnmail-cache-accepted-message-ids (nnmail-cache-insert (nnmail-fetch-field "message-id") diff --git a/lisp/gnus/nnfolder.el b/lisp/gnus/nnfolder.el index 1dd784d5a5b..2de5b83a7b2 100644 --- a/lisp/gnus/nnfolder.el +++ b/lisp/gnus/nnfolder.el @@ -706,7 +706,7 @@ deleted. Point is left where the deleted region was." (if dont-check (setq nnfolder-current-group group nnfolder-current-buffer nil) - (let (inf file) + (let (file) ;; inf ;; If we have to change groups, see if we don't already have ;; the folder in memory. If we do, verify the modtime and ;; destroy the folder if needed so we can rescan it. @@ -718,7 +718,7 @@ deleted. Point is left where the deleted region was." ;; touched the file since last time. (when (and nnfolder-current-buffer (not (gnus-buffer-live-p nnfolder-current-buffer))) - (setq nnfolder-buffer-alist (delq inf nnfolder-buffer-alist) + (setq nnfolder-buffer-alist (delq nil nnfolder-buffer-alist) ;; inf nnfolder-current-buffer nil)) (setq nnfolder-current-group group) diff --git a/lisp/gnus/nnmh.el b/lisp/gnus/nnmh.el index 231583fae83..0923b8eff34 100644 --- a/lisp/gnus/nnmh.el +++ b/lisp/gnus/nnmh.el @@ -503,6 +503,8 @@ as unread by Gnus.") (setcdr active (1+ (cdr active)))) (cdr active))) +(defvar nnmh-newsgroup-articles) + (defun nnmh-update-gnus-unreads (group) ;; Go through the .nnmh-articles file and compare with the actual ;; articles in this folder. The articles that are "new" will be diff --git a/lisp/gnus/nnrss.el b/lisp/gnus/nnrss.el index aa7c8e584a5..36b7af0e345 100644 --- a/lisp/gnus/nnrss.el +++ b/lisp/gnus/nnrss.el @@ -200,7 +200,7 @@ for decoding when the cdr that the data specify is not available.") (nnrss-possibly-change-group group server) (let ((e (assq article nnrss-group-data)) (nntp-server-buffer (or buffer nntp-server-buffer)) - err) ;; post + ) ;; err post (when e (with-current-buffer nntp-server-buffer (erase-buffer) @@ -302,8 +302,7 @@ for decoding when the cdr that the data specify is not available.") (when nnrss-content-function (funcall nnrss-content-function e group article)))) (cond - (err - (nnheader-report 'nnrss err)) + ;; (err (nnheader-report 'nnrss err)) ((not e) (nnheader-report 'nnrss "no such id: %d" article)) (t -- cgit v1.2.3 From 10a14f6ac3f0d2464890bd9a4ef20ff228a9d255 Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Sun, 16 May 2021 10:19:41 -0700 Subject: Fix function signature for gnus-search-indexed-parse-output * lisp/gnus/gnus-search.el (gnus-search-indexed-parse-output): Generic function arg list didn't match the method arglist, which made for confusing function help. --- lisp/gnus/gnus-search.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp/gnus/gnus-search.el') diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 61a1d675243..a59d0e57a79 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -1294,8 +1294,8 @@ elements are present." ;; First, some common methods. -(cl-defgeneric gnus-search-indexed-parse-output (engine server &optional groups) - "Parse the results of ENGINE's query against SERVER in GROUPS. +(cl-defgeneric gnus-search-indexed-parse-output (engine server query &optional groups) + "Parse the results of ENGINE's QUERY against SERVER in GROUPS. Locally-indexed search engines return results as a list of filenames, sometimes with additional information. Returns a list of viable results, in the form of a list of [group article score] -- cgit v1.2.3 From 5fe343a44cdd83c43793c86b92ab5dd16a29bc3a Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Fri, 21 May 2021 13:35:38 -0700 Subject: Robustify parsing of gnus-search search results * lisp/gnus/gnus-search.el (gnus-search-indexed-parse-output): Look for a "process finished" tag, and don't choke on mis-parsed lines. --- lisp/gnus/gnus-search.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lisp/gnus/gnus-search.el') diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index a59d0e57a79..fc9f8684f63 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -1358,9 +1358,12 @@ Returns a list of [group article score] vectors." "\\|"))) artlist vectors article group) (goto-char (point-min)) - (while (not (eobp)) + (while (not (or (eobp) + (looking-at-p + "\\(?:[[:space:]\n]+\\)?Process .+ finished"))) (pcase-let ((`(,f-name ,score) (gnus-search-indexed-extract engine))) - (when (and (file-readable-p f-name) + (when (and f-name + (file-readable-p f-name) (null (file-directory-p f-name)) (or (null groups) (and (gnus-search-single-p query) -- cgit v1.2.3 From 4d63a033a726a8da33bda8d18a503e88bfb794fb Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Fri, 25 Jun 2021 20:42:16 -0700 Subject: Small improvements to handling of IMAP mark search * lisp/gnus/gnus-search.el (gnus-search-imap-handle-flag): Use a KEYWORD search for any mark starting with a "$", so "mark:$hasattachment" goes through as "KEYWORD $hasattachment". --- lisp/gnus/gnus-search.el | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'lisp/gnus/gnus-search.el') diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index fc9f8684f63..70bde264c11 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -1278,17 +1278,23 @@ elements are present." str))) (defun gnus-search-imap-handle-flag (flag) - "Make sure string FLAG is something IMAP will recognize." - ;; What else? What about the KEYWORD search key? + "Adjust string FLAG to help IMAP recognize it. +If it's one of the RFC3501 flags, make sure it's upcased. +Otherwise, if FLAG starts with a \"$\", treat as a KEYWORD +search. Otherwise, drop the flag." (setq flag (pcase flag ("flag" "flagged") ("read" "seen") ("replied" "answered") (_ flag))) - (if (member flag '("seen" "answered" "deleted" "draft" "flagged")) - (upcase flag) - "")) + (cond + ((member flag '("seen" "answered" "deleted" "draft" "flagged" "recent")) + (upcase flag)) + ((string-prefix-p "$" flag) + (format "KEYWORD %s" flag)) + ;; TODO: Provide a user option to treat *all* marks as a KEYWORDs? + (t ""))) ;;; Methods for the indexed search engines. -- cgit v1.2.3 From e7f6bb38ddb71bfe08bdca87119ff13cd40ecf62 Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Sat, 26 Jun 2021 10:16:19 -0700 Subject: Rework gnus-search-indexed-parse-output * lisp/gnus/gnus-search.el (gnus-search-indexed-parse-output): Be more careful about matching filesystem paths to Gnus group names; make absolutely sure that we only return valid article numbers. --- lisp/gnus/gnus-search.el | 95 ++++++++++++++++++++++-------------------------- 1 file changed, 43 insertions(+), 52 deletions(-) (limited to 'lisp/gnus/gnus-search.el') diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 70bde264c11..898b57bcef8 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -1351,68 +1351,59 @@ Returns a list of [group article score] vectors." (cl-defmethod gnus-search-indexed-parse-output ((engine gnus-search-indexed) server query &optional groups) - (let ((prefix (slot-value engine 'remove-prefix)) - (group-regexp (when groups - (mapconcat - (lambda (group-name) - (mapconcat #'regexp-quote - (split-string - (gnus-group-real-name group-name) - "[.\\/]") - "[.\\\\/]")) - groups - "\\|"))) - artlist vectors article group) + (let ((prefix (or (slot-value engine 'remove-prefix) + "")) + artlist article group) (goto-char (point-min)) + ;; Prep prefix, we want to at least be removing the root + ;; filesystem separator. + (when (stringp prefix) + (setq prefix (file-name-as-directory + (expand-file-name prefix "/")))) (while (not (or (eobp) (looking-at-p "\\(?:[[:space:]\n]+\\)?Process .+ finished"))) (pcase-let ((`(,f-name ,score) (gnus-search-indexed-extract engine))) (when (and f-name (file-readable-p f-name) - (null (file-directory-p f-name)) - (or (null groups) - (and (gnus-search-single-p query) - (alist-get 'thread query)) - (string-match-p group-regexp f-name))) - (push (list f-name score) artlist)))) + (null (file-directory-p f-name))) + (setq group + (replace-regexp-in-string + "[/\\]" "." + (replace-regexp-in-string + "/?\\(cur\\|new\\|tmp\\)?/\\'" "" + (replace-regexp-in-string + "\\`\\." "" + (string-remove-prefix + prefix (file-name-directory f-name)) + nil t) + nil t) + nil t)) + (setq group (gnus-group-full-name group server)) + (setq article (file-name-nondirectory f-name) + article + ;; TODO: Provide a cleaner way of producing final + ;; article numbers for the various backends. + (if (string-match-p "\\`[[:digit:]]+\\'" article) + (string-to-number article) + (nnmaildir-base-name-to-article-number + (substring article 0 (string-match ":" article)) + group (string-remove-prefix "nnmaildir:" server)))) + (when (and (numberp article) + (or (null groups) + (member group groups))) + (push (list f-name article group score) + artlist))))) ;; Are we running an additional grep query? (when-let ((grep-reg (alist-get 'grep query))) (setq artlist (gnus-search-grep-search engine artlist grep-reg))) - ;; Prep prefix. - (when (and prefix (null (string-empty-p prefix))) - (setq prefix (file-name-as-directory (expand-file-name prefix)))) - ;; Turn (file-name score) into [group article score]. - (pcase-dolist (`(,f-name ,score) artlist) - (setq article (file-name-nondirectory f-name) - group (file-name-directory f-name)) - ;; Remove prefix. - (when prefix - (setq group (string-remove-prefix prefix group))) - ;; Break the directory name down until it's something that - ;; (probably) can be used as a group name. - (setq group - (replace-regexp-in-string - "[/\\]" "." - (replace-regexp-in-string - "/?\\(cur\\|new\\|tmp\\)?/\\'" "" - (replace-regexp-in-string - "^[./\\]" "" - group nil t) - nil t) - nil t)) - - (push (vector (gnus-group-full-name group server) - (if (string-match-p "\\`[[:digit:]]+\\'" article) - (string-to-number article) - (nnmaildir-base-name-to-article-number - (substring article 0 (string-match ":" article)) - group (string-remove-prefix "nnmaildir:" server))) - (if (numberp score) - score - (string-to-number score))) - vectors)) - vectors)) + ;; Munge into the list of vectors expected by nnselect. + (mapcar (pcase-lambda (`(,_ ,article ,group ,score)) + (vector group article + (if (numberp score) + score + (string-to-number score)))) + artlist))) (cl-defmethod gnus-search-indexed-extract ((_engine gnus-search-indexed)) "Base implementation treats the whole line as a filename, and -- cgit v1.2.3 From d93ff9459feb77ed5df0d3af563d1280ff42062f Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Sat, 10 Jul 2021 10:00:32 -0700 Subject: Rewrite gnus-search-query-expand-key * lisp/gnus/gnus-search.el (gnus-search-query-expand-key): There was a misunderstanding about how completion-all-completion works (if the test string can't be completed, the whole table is returned). Simplify to use try-completion. * test/lisp/gnus/gnus-search-tests.el (gnus-s-expand-keyword): Ensure that an unknown/uncompletable keyword is returned unmolested. --- lisp/gnus/gnus-search.el | 22 ++++++++++------------ test/lisp/gnus/gnus-search-tests.el | 4 +++- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'lisp/gnus/gnus-search.el') diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 898b57bcef8..56675eb8651 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -629,18 +629,16 @@ gnus-*-mark marks, and return an appropriate string." mark)) (defun gnus-search-query-expand-key (key) - (cond ((test-completion key gnus-search-expandable-keys) - ;; We're done! - key) - ;; There is more than one possible completion. - ((consp (cdr (completion-all-completions - key gnus-search-expandable-keys #'stringp 0))) - (signal 'gnus-search-parse-error - (list (format "Ambiguous keyword: %s" key)))) - ;; Return KEY, either completed or untouched. - ((car-safe (completion-try-completion - key gnus-search-expandable-keys - #'stringp 0))))) + (let ((comp (try-completion key gnus-search-expandable-keys))) + (if (or (eql comp 't) ; Already a key. + (null comp)) ; An unknown key. + key + (if (string= comp key) + ;; KEY matches multiple possible keys. + (signal 'gnus-search-parse-error + (list (format "Ambiguous keyword: %s" key))) + ;; We completed to a unique known key. + comp)))) (defun gnus-search-query-return-string (&optional delimited trim) "Return a string from the current buffer. diff --git a/test/lisp/gnus/gnus-search-tests.el b/test/lisp/gnus/gnus-search-tests.el index e30ed9a80a7..6148da65621 100644 --- a/test/lisp/gnus/gnus-search-tests.el +++ b/test/lisp/gnus/gnus-search-tests.el @@ -49,7 +49,9 @@ (default-value 'gnus-search-expandable-keys)) (pairs '(("su" . "subject") - ("sin" . "since")))) + ("sin" . "since") + ("body" . "body") + ("list-id" . "list-id")))) (dolist (p pairs) (should (equal (gnus-search-query-expand-key (car p)) (cdr p)))) -- cgit v1.2.3 From 46f9949e1fc29489b02c31fa4f7620afe580be1b Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Sun, 11 Jul 2021 11:55:31 +0100 Subject: ; Fix misspellings of 'occurrence' in docs. --- doc/lispref/text.texi | 2 +- lisp/gnus/gnus-search.el | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'lisp/gnus/gnus-search.el') diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index b71748c0832..feb9e58f31c 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -4432,7 +4432,7 @@ ThXs Xs the contents of the buffer before. @defun subst-char-in-string fromchar tochar string &optional inplace @cindex replace characters in string -This function replaces all occurences of the character @var{fromchar} +This function replaces all occurrences of the character @var{fromchar} with @var{tochar} in @var{string}. By default, substitution occurs in a copy of @var{string}, but if the optional argument @var{inplace} is non-@code{nil}, the function modifies the @var{string} itself. In any diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 56675eb8651..8627619e96e 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -448,10 +448,10 @@ auto-completion of contact names and addresses for keys like Date values (any key in `gnus-search-date-keys') can be provided in any format that `parse-time-string' can parse (note that this can produce weird results). Dates with missing bits will be -interpreted as the most recent occurence thereof (ie \"march 03\" -is the most recent March 3rd). Lastly, relative specifications -such as 1d (one day ago) are understood. This also accepts w, m, -and y. m is assumed to be 30 days. +interpreted as the most recent occurrence thereof (i.e. \"march +03\" is the most recent March 3rd). Lastly, relative +specifications such as 1d (one day ago) are understood. This +also accepts w, m, and y. m is assumed to be 30 days. This function will accept pretty much anything as input. Its only job is to parse the query into a sexp, and pass that on -- @@ -644,8 +644,8 @@ gnus-*-mark marks, and return an appropriate string." "Return a string from the current buffer. If DELIMITED is non-nil, assume the next character is a delimiter character, and return everything between point and the next -occurence of the delimiter, including the delimiters themselves. -If TRIM is non-nil, do not return the delimiters. Otherwise, +occurrence of the delimiter, including the delimiters themselves. +If TRIM is non-nil, do not return the delimiters. Otherwise, return one word." ;; This function cannot handle nested delimiters, as it's not a ;; proper parser. Ie, you cannot parse "to:bob or (from:bob or -- cgit v1.2.3 From e25c1b5cd390a7a3f76f9309455d9632a36e373b Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Sun, 11 Jul 2021 09:00:33 -0700 Subject: Further tweaks to gnus-search-query-expand-key * lisp/gnus/gnus-search.el (gnus-search-query-expand-key): It's possible that KEY could be partially completed (ie no longer string= to COMP), but not all the way. Use a more accurate test. Add docstring. --- lisp/gnus/gnus-search.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lisp/gnus/gnus-search.el') diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 8627619e96e..39bde837b30 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -629,12 +629,19 @@ gnus-*-mark marks, and return an appropriate string." mark)) (defun gnus-search-query-expand-key (key) + "Attempt to expand KEY to a full keyword. +Use `gnus-search-expandable-keys' as a completion table; return +KEY directly if it can't be completed. Raise an error if KEY is +ambiguous, meaning that it is a prefix of multiple known +keywords. This means that it's not possible to enter a custom +keyword that happens to be a prefix of a known keyword." (let ((comp (try-completion key gnus-search-expandable-keys))) (if (or (eql comp 't) ; Already a key. (null comp)) ; An unknown key. key - (if (string= comp key) - ;; KEY matches multiple possible keys. + (if (null (member comp gnus-search-expandable-keys)) + ;; KEY is a prefix of multiple known keywords, and could not + ;; be completed to something unique. (signal 'gnus-search-parse-error (list (format "Ambiguous keyword: %s" key))) ;; We completed to a unique known key. -- cgit v1.2.3 From 6535fd1fa9ac21238a168916249ac59677a6118e Mon Sep 17 00:00:00 2001 From: akater Date: Tue, 20 Jul 2021 01:25:01 +0000 Subject: Evaluate eql specializers * lisp/emacs-lisp/cl-generic.el (cl-generic-generalizers): Evaluate forms that are eql specializers. Provide backward compatibility with a warning. * test/lisp/emacs-lisp/cl-generic-tests.el: Add a test. * lisp/emacs-lisp/bindat.el (bindat--type): Adhere to the new rule. * lisp/emacs-lisp/edebug.el (edebug--match-&-spec-op): Adhere to the new rule. * lisp/emacs-lisp/map.el (map-into): Adhere to the new rule. * lisp/emacs-lisp/radix-tree.el (map-into): Adhere to the new rule. * lisp/frame.el (cl-generic-define-context-rewriter): Adhere to the new rule. * lisp/gnus/gnus-search.el (gnus-search-transform-expression): Adhere to the new rule. * lisp/image/image-converter.el (image-converter--probe image-converter--convert): Adhere to the new rule. * lisp/mail/smtpmail.el (smtpmail-try-auth-method): Adhere to the new rule. * lisp/progmodes/elisp-mode.el (xref-backend-definitions) (xref-backend-apropos): Adhere to the new rule. * lisp/progmodes/etags.el (xref-backend-identifier-at-point) (xref-backend-identifier-completion-table) (xref-backend-identifier-completion-ignore-case) (xref-backend-definitions)(xref-backend-apropos): Adhere to the new rule. * test/lisp/emacs-lisp/checkdoc-tests.el (checkdoc-cl-defmethod-with-types-ok) (checkdoc-cl-defmethod-qualified-ok) (checkdoc-cl-defmethod-with-extra-qualifier-ok): Adhere to the new rule. * etc/NEWS: Describe the change. --- etc/NEWS | 5 +++++ lisp/emacs-lisp/bindat.el | 24 ++++++++++++------------ lisp/emacs-lisp/cl-generic.el | 12 +++++++++++- lisp/emacs-lisp/edebug.el | 18 +++++++++--------- lisp/emacs-lisp/map.el | 8 ++++---- lisp/emacs-lisp/radix-tree.el | 2 +- lisp/frame.el | 6 +++++- lisp/gnus/gnus-search.el | 2 +- lisp/image/image-converter.el | 12 ++++++------ lisp/mail/smtpmail.el | 6 +++--- lisp/progmodes/elisp-mode.el | 7 ++++--- lisp/progmodes/etags.el | 12 +++++++----- test/lisp/emacs-lisp/checkdoc-tests.el | 8 ++++---- test/lisp/emacs-lisp/cl-generic-tests.el | 6 +++++- 14 files changed, 77 insertions(+), 51 deletions(-) (limited to 'lisp/gnus/gnus-search.el') diff --git a/etc/NEWS b/etc/NEWS index 48dec0a2b3b..fb6eddc754f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -810,6 +810,11 @@ work as before. It is now defined as a generalized variable that can be used with 'setf' to modify the value stored in a given class slot. +--- +*** 'form' in '(eql form)' specializers in 'cl-defmethod' is now evaluated. +This corresponds to the behaviour of defmethod in Common Lisp Object System. +A warning is issued when old style is used. + ** New minor mode 'cl-font-lock-built-in-mode' for 'lisp-mode'. The mode provides refined highlighting of built-in functions, types, and variables. diff --git a/lisp/emacs-lisp/bindat.el b/lisp/emacs-lisp/bindat.el index 247fb91379e..76c2e80fda8 100644 --- a/lisp/emacs-lisp/bindat.el +++ b/lisp/emacs-lisp/bindat.el @@ -657,33 +657,33 @@ The port (if any) is omitted. IP can be a string, as well." OP can be one of: unpack', (pack VAL), or (length VAL) where VAL is the name of a variable that will hold the value we need to pack.") -(cl-defmethod bindat--type (op (_ (eql byte))) +(cl-defmethod bindat--type (op (_ (eql 'byte))) (bindat--pcase op ('unpack `(bindat--unpack-u8)) (`(length . ,_) `(cl-incf bindat-idx 1)) (`(pack . ,args) `(bindat--pack-u8 . ,args)))) -(cl-defmethod bindat--type (op (_ (eql uint)) n) +(cl-defmethod bindat--type (op (_ (eql 'uint)) n) (if (eq n 8) (bindat--type op 'byte) (bindat--pcase op ('unpack `(bindat--unpack-uint ,n)) (`(length . ,_) `(cl-incf bindat-idx (/ ,n 8))) (`(pack . ,args) `(bindat--pack-uint ,n . ,args))))) -(cl-defmethod bindat--type (op (_ (eql uintr)) n) +(cl-defmethod bindat--type (op (_ (eql 'uintr)) n) (if (eq n 8) (bindat--type op 'byte) (bindat--pcase op ('unpack `(bindat--unpack-uintr ,n)) (`(length . ,_) `(cl-incf bindat-idx (/ ,n 8))) (`(pack . ,args) `(bindat--pack-uintr ,n . ,args))))) -(cl-defmethod bindat--type (op (_ (eql str)) len) +(cl-defmethod bindat--type (op (_ (eql 'str)) len) (bindat--pcase op ('unpack `(bindat--unpack-str ,len)) (`(length . ,_) `(cl-incf bindat-idx ,len)) (`(pack . ,args) `(bindat--pack-str ,len . ,args)))) -(cl-defmethod bindat--type (op (_ (eql strz)) &optional len) +(cl-defmethod bindat--type (op (_ (eql 'strz)) &optional len) (bindat--pcase op ('unpack `(bindat--unpack-strz ,len)) (`(length ,val) @@ -701,25 +701,25 @@ is the name of a variable that will hold the value we need to pack.") (bindat--pack-str ,len . ,args) (bindat--pack-strz . ,args)))))) -(cl-defmethod bindat--type (op (_ (eql bits)) len) +(cl-defmethod bindat--type (op (_ (eql 'bits)) len) (bindat--pcase op ('unpack `(bindat--unpack-bits ,len)) (`(length . ,_) `(cl-incf bindat-idx ,len)) (`(pack . ,args) `(bindat--pack-bits ,len . ,args)))) -(cl-defmethod bindat--type (_op (_ (eql fill)) len) +(cl-defmethod bindat--type (_op (_ (eql 'fill)) len) `(progn (cl-incf bindat-idx ,len) nil)) -(cl-defmethod bindat--type (_op (_ (eql align)) len) +(cl-defmethod bindat--type (_op (_ (eql 'align)) len) `(progn (cl-callf bindat--align bindat-idx ,len) nil)) -(cl-defmethod bindat--type (op (_ (eql type)) exp) +(cl-defmethod bindat--type (op (_ (eql 'type)) exp) (bindat--pcase op ('unpack `(funcall (bindat--type-ue ,exp))) (`(length . ,args) `(funcall (bindat--type-le ,exp) . ,args)) (`(pack . ,args) `(funcall (bindat--type-pe ,exp) . ,args)))) -(cl-defmethod bindat--type (op (_ (eql vec)) count &rest type) +(cl-defmethod bindat--type (op (_ (eql 'vec)) count &rest type) (unless type (setq type '(byte))) (let ((fun (macroexpand-all (bindat--fun type) macroexpand-all-environment))) (bindat--pcase op @@ -743,10 +743,10 @@ is the name of a variable that will hold the value we need to pack.") `(dotimes (bindat--i ,count) (funcall ,fun (elt ,val bindat--i))))))) -(cl-defmethod bindat--type (op (_ (eql unit)) val) +(cl-defmethod bindat--type (op (_ (eql 'unit)) val) (pcase op ('unpack val) (_ nil))) -(cl-defmethod bindat--type (op (_ (eql struct)) &rest args) +(cl-defmethod bindat--type (op (_ (eql 'struct)) &rest args) (apply #'bindat--type op args)) (cl-defmethod bindat--type (op (_ (eql :pack-var)) var &rest fields) diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el index 544704be387..941e436ff78 100644 --- a/lisp/emacs-lisp/cl-generic.el +++ b/lisp/emacs-lisp/cl-generic.el @@ -1158,7 +1158,12 @@ These match if the argument is a cons cell whose car is `eql' to VAL." (cl-defmethod cl-generic-generalizers ((specializer (head eql))) "Support for (eql VAL) specializers. These match if the argument is `eql' to VAL." - (puthash (cadr specializer) specializer cl--generic-eql-used) + (let ((form (cadr specializer))) + (puthash (if (or (not (symbolp form)) (macroexp-const-p form)) + (eval form t) + (message "Quoting obsolete `eql' form: %S" specializer) + form) + specializer cl--generic-eql-used)) (list cl--generic-eql-generalizer)) (cl--generic-prefill-dispatchers 0 (eql nil)) @@ -1269,6 +1274,11 @@ Used internally for the (major-mode MODE) context specializers." (cl-generic-define-context-rewriter major-mode (mode &rest modes) `(major-mode ,(if (consp mode) ;;E.g. could be (eql ...) + ;; WARNING: unsure whether this + ;; “could be (eql ...)” commentary (or code) + ;; should be adjusted + ;; following the (planned) changes to eql specializer. + ;; Bug #47327 (progn (cl-assert (null modes)) mode) `(derived-mode ,mode . ,modes)))) diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 2aec8197dc9..7def9ff96a7 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -1731,7 +1731,7 @@ contains a circular object." (defsubst edebug-match-body (cursor) (edebug-forms cursor)) -(cl-defmethod edebug--match-&-spec-op ((_ (eql &optional)) cursor specs) +(cl-defmethod edebug--match-&-spec-op ((_ (eql '&optional)) cursor specs) ;; Keep matching until one spec fails. (edebug-&optional-wrapper cursor specs #'edebug-&optional-wrapper)) @@ -1755,7 +1755,7 @@ contains a circular object." "Handle &foo spec operators. &foo spec operators operate on all the subsequent SPECS.") -(cl-defmethod edebug--match-&-spec-op ((_ (eql &rest)) cursor specs) +(cl-defmethod edebug--match-&-spec-op ((_ (eql '&rest)) cursor specs) ;; Repeatedly use specs until failure. (let (edebug-best-error edebug-error-point) @@ -1768,7 +1768,7 @@ contains a circular object." (edebug-&optional-wrapper c (or s specs) rh))))) -(cl-defmethod edebug--match-&-spec-op ((_ (eql &or)) cursor specs) +(cl-defmethod edebug--match-&-spec-op ((_ (eql '&or)) cursor specs) ;; Keep matching until one spec succeeds, and return its results. ;; If none match, fail. ;; This needs to be optimized since most specs spend time here. @@ -1792,7 +1792,7 @@ contains a circular object." (apply #'edebug-no-match cursor "Expected one of" original-specs)) )) -(cl-defmethod edebug--match-&-spec-op ((_ (eql &interpose)) cursor specs) +(cl-defmethod edebug--match-&-spec-op ((_ (eql '&interpose)) cursor specs) "Compute the specs for `&interpose SPEC FUN ARGS...'. Extracts the head of the data by matching it against SPEC, and then matches the rest by calling (FUN HEAD PF ARGS...) @@ -1817,7 +1817,7 @@ a sequence of elements." (append instrumented-head (edebug-match cursor newspecs))) ,@args)))) -(cl-defmethod edebug--match-&-spec-op ((_ (eql ¬)) cursor specs) +(cl-defmethod edebug--match-&-spec-op ((_ (eql '¬)) cursor specs) ;; If any specs match, then fail (if (null (catch 'no-match (let ((edebug-gate nil)) @@ -1829,7 +1829,7 @@ a sequence of elements." ;; This means nothing matched, so it is OK. nil) ;; So, return nothing -(cl-defmethod edebug--match-&-spec-op ((_ (eql &key)) cursor specs) +(cl-defmethod edebug--match-&-spec-op ((_ (eql '&key)) cursor specs) ;; Following specs must look like ( ) ... ;; where is the name of a keyword, and spec is its spec. ;; This really doesn't save much over the expanded form and takes time. @@ -1842,7 +1842,7 @@ a sequence of elements." (car (cdr pair)))) specs)))) -(cl-defmethod edebug--match-&-spec-op ((_ (eql &error)) cursor specs) +(cl-defmethod edebug--match-&-spec-op ((_ (eql '&error)) cursor specs) ;; Signal an error, using the following string in the spec as argument. (let ((error-string (car specs)) (edebug-error-point (edebug-before-offset cursor))) @@ -1942,7 +1942,7 @@ a sequence of elements." (defun edebug-match-function (_cursor) (error "Use function-form instead of function in edebug spec")) -(cl-defmethod edebug--match-&-spec-op ((_ (eql &define)) cursor specs) +(cl-defmethod edebug--match-&-spec-op ((_ (eql '&define)) cursor specs) ;; Match a defining form. ;; Normally, &define is interpreted specially other places. ;; This should only be called inside of a spec list to match the remainder @@ -1958,7 +1958,7 @@ a sequence of elements." ;; Stop backtracking here (Bug#41988). (setq edebug-gate t))) -(cl-defmethod edebug--match-&-spec-op ((_ (eql &name)) cursor specs) +(cl-defmethod edebug--match-&-spec-op ((_ (eql '&name)) cursor specs) "Compute the name for `&name SPEC FUN` spec operator. The full syntax of that operator is: diff --git a/lisp/emacs-lisp/map.el b/lisp/emacs-lisp/map.el index 5c76fb9eb95..c59342875db 100644 --- a/lisp/emacs-lisp/map.el +++ b/lisp/emacs-lisp/map.el @@ -407,15 +407,15 @@ See `map-into' for all supported values of TYPE." "Convert MAP into a map of TYPE.") ;; FIXME: I wish there was a way to avoid this η-redex! -(cl-defmethod map-into (map (_type (eql list))) +(cl-defmethod map-into (map (_type (eql 'list))) "Convert MAP into an alist." (map-pairs map)) -(cl-defmethod map-into (map (_type (eql alist))) +(cl-defmethod map-into (map (_type (eql 'alist))) "Convert MAP into an alist." (map-pairs map)) -(cl-defmethod map-into (map (_type (eql plist))) +(cl-defmethod map-into (map (_type (eql 'plist))) "Convert MAP into a plist." (let (plist) (map-do (lambda (k v) (setq plist `(,v ,k ,@plist))) map) @@ -510,7 +510,7 @@ KEYWORD-ARGS are forwarded to `make-hash-table'." map) ht)) -(cl-defmethod map-into (map (_type (eql hash-table))) +(cl-defmethod map-into (map (_type (eql 'hash-table))) "Convert MAP into a hash-table with keys compared with `equal'." (map--into-hash map (list :size (map-length map) :test #'equal))) diff --git a/lisp/emacs-lisp/radix-tree.el b/lisp/emacs-lisp/radix-tree.el index fb659753501..a529ed025d6 100644 --- a/lisp/emacs-lisp/radix-tree.el +++ b/lisp/emacs-lisp/radix-tree.el @@ -240,7 +240,7 @@ PREFIX is only used internally." (declare-function map-apply "map" (function map)) (defun radix-tree-from-map (map) - ;; Aka (cl-defmethod map-into (map (type (eql radix-tree)))) ...) + ;; Aka (cl-defmethod map-into (map (type (eql 'radix-tree)))) ...) (require 'map) (let ((rt nil)) (map-apply (lambda (k v) (setq rt (radix-tree-insert rt k v))) map) diff --git a/lisp/frame.el b/lisp/frame.el index 9b3d120598b..8c05ad2fe5c 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -36,7 +36,11 @@ as its argument.") (cl-generic-define-context-rewriter window-system (value) ;; If `value' is a `consp', it's probably an old-style specializer, ;; so just use it, and anyway `eql' isn't very useful on cons cells. - `(window-system ,(if (consp value) value `(eql ,value)))) + `(window-system ,(if (consp value) value + ;; WARNING: unsure whether this eql expression + ;; is actually an eql specializer. + ;; Bug #47327 + `(eql ',value)))) (cl-defmethod frame-creation-function (params &context (window-system nil)) ;; It's tempting to get rid of tty-create-frame-with-faces and turn it into diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 39bde837b30..53af2f6fe6a 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -980,7 +980,7 @@ Responsible for handling and, or, and parenthetical expressions.") ;; Most search engines use implicit ANDs. (cl-defmethod gnus-search-transform-expression ((_ gnus-search-engine) - (_expr (eql and))) + (_expr (eql 'and))) nil) ;; Most search engines use explicit infixed ORs. diff --git a/lisp/image/image-converter.el b/lisp/image/image-converter.el index e47f1f76e42..97bf1ac058c 100644 --- a/lisp/image/image-converter.el +++ b/lisp/image/image-converter.el @@ -133,7 +133,7 @@ data is returned as a string." (list value) value))) -(cl-defmethod image-converter--probe ((type (eql graphicsmagick))) +(cl-defmethod image-converter--probe ((type (eql 'graphicsmagick))) "Check whether the system has GraphicsMagick installed." (with-temp-buffer (let ((command (image-converter--value type :command)) @@ -151,7 +151,7 @@ data is returned as a string." (push (downcase (match-string 1)) formats))) (nreverse formats))))) -(cl-defmethod image-converter--probe ((type (eql imagemagick))) +(cl-defmethod image-converter--probe ((type (eql 'imagemagick))) "Check whether the system has ImageMagick installed." (with-temp-buffer (let ((command (image-converter--value type :command)) @@ -171,7 +171,7 @@ data is returned as a string." (push (downcase (match-string 1)) formats))) (nreverse formats)))) -(cl-defmethod image-converter--probe ((type (eql ffmpeg))) +(cl-defmethod image-converter--probe ((type (eql 'ffmpeg))) "Check whether the system has ffmpeg installed." (with-temp-buffer (let ((command (image-converter--value type :command)) @@ -212,12 +212,12 @@ Only suffixes that map to `image-mode' are returned." 'image-mode) collect suffix)) -(cl-defmethod image-converter--convert ((type (eql graphicsmagick)) source +(cl-defmethod image-converter--convert ((type (eql 'graphicsmagick)) source image-format) "Convert using GraphicsMagick." (image-converter--convert-magick type source image-format)) -(cl-defmethod image-converter--convert ((type (eql imagemagick)) source +(cl-defmethod image-converter--convert ((type (eql 'imagemagick)) source image-format) "Convert using ImageMagick." (image-converter--convert-magick type source image-format)) @@ -249,7 +249,7 @@ Only suffixes that map to `image-mode' are returned." ;; error message. (buffer-string)))) -(cl-defmethod image-converter--convert ((type (eql ffmpeg)) source +(cl-defmethod image-converter--convert ((type (eql 'ffmpeg)) source image-format) "Convert using ffmpeg." (let ((command (image-converter--value type :command))) diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el index 133a2e1828e..33bdd050bdc 100644 --- a/lisp/mail/smtpmail.el +++ b/lisp/mail/smtpmail.el @@ -596,7 +596,7 @@ USER and PASSWORD should be non-nil." (error "Mechanism %S not implemented" mech)) (cl-defmethod smtpmail-try-auth-method - (process (_mech (eql cram-md5)) user password) + (process (_mech (eql 'cram-md5)) user password) (let ((ret (smtpmail-command-or-throw process "AUTH CRAM-MD5"))) (when (eq (car ret) 334) (let* ((challenge (substring (cadr ret) 4)) @@ -618,13 +618,13 @@ USER and PASSWORD should be non-nil." (smtpmail-command-or-throw process encoded))))) (cl-defmethod smtpmail-try-auth-method - (process (_mech (eql login)) user password) + (process (_mech (eql 'login)) user password) (smtpmail-command-or-throw process "AUTH LOGIN") (smtpmail-command-or-throw process (base64-encode-string user t)) (smtpmail-command-or-throw process (base64-encode-string password t))) (cl-defmethod smtpmail-try-auth-method - (process (_mech (eql plain)) user password) + (process (_mech (eql 'plain)) user password) ;; We used to send an empty initial request, and wait for an ;; empty response, and then send the password, but this ;; violate a SHOULD in RFC 2222 paragraph 5.1. Note that this diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 7ed2d3d08cc..542f8ad0b1b 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -696,7 +696,7 @@ Each function should return a list of xrefs, or nil; the first non-nil result supersedes the xrefs produced by `elisp--xref-find-definitions'.") -(cl-defmethod xref-backend-definitions ((_backend (eql elisp)) identifier) +(cl-defmethod xref-backend-definitions ((_backend (eql 'elisp)) identifier) (require 'find-func) ;; FIXME: use information in source near point to filter results: ;; (dvc-log-edit ...) - exclude 'feature @@ -875,7 +875,7 @@ non-nil result supersedes the xrefs produced by (declare-function xref-apropos-regexp "xref" (pattern)) -(cl-defmethod xref-backend-apropos ((_backend (eql elisp)) pattern) +(cl-defmethod xref-backend-apropos ((_backend (eql 'elisp)) pattern) (apply #'nconc (let ((regexp (xref-apropos-regexp pattern)) lst) @@ -893,7 +893,8 @@ non-nil result supersedes the xrefs produced by (facep sym))) 'strict)) -(cl-defmethod xref-backend-identifier-completion-table ((_backend (eql elisp))) +(cl-defmethod xref-backend-identifier-completion-table ((_backend + (eql 'elisp))) elisp--xref-identifier-completion-table) (cl-defstruct (xref-elisp-location diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index f0180ceeeca..ce1d8e5e620 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -2062,19 +2062,21 @@ file name, add `tag-partial-file-name-match-p' to the list value.") ;;;###autoload (defun etags--xref-backend () 'etags) -(cl-defmethod xref-backend-identifier-at-point ((_backend (eql etags))) +(cl-defmethod xref-backend-identifier-at-point ((_backend (eql 'etags))) (find-tag--default)) -(cl-defmethod xref-backend-identifier-completion-table ((_backend (eql etags))) +(cl-defmethod xref-backend-identifier-completion-table ((_backend + (eql 'etags))) (tags-lazy-completion-table)) -(cl-defmethod xref-backend-identifier-completion-ignore-case ((_backend (eql etags))) +(cl-defmethod xref-backend-identifier-completion-ignore-case ((_backend + (eql 'etags))) (find-tag--completion-ignore-case)) -(cl-defmethod xref-backend-definitions ((_backend (eql etags)) symbol) +(cl-defmethod xref-backend-definitions ((_backend (eql 'etags)) symbol) (etags--xref-find-definitions symbol)) -(cl-defmethod xref-backend-apropos ((_backend (eql etags)) pattern) +(cl-defmethod xref-backend-apropos ((_backend (eql 'etags)) pattern) (etags--xref-find-definitions (xref-apropos-regexp pattern) t)) (defun etags--xref-find-definitions (pattern &optional regexp?) diff --git a/test/lisp/emacs-lisp/checkdoc-tests.el b/test/lisp/emacs-lisp/checkdoc-tests.el index 7a7aa9fb3cd..2a1d8b27636 100644 --- a/test/lisp/emacs-lisp/checkdoc-tests.el +++ b/test/lisp/emacs-lisp/checkdoc-tests.el @@ -49,27 +49,27 @@ (with-temp-buffer (emacs-lisp-mode) ;; this method matches if A is the symbol `smthg' and if b is a list: - (insert "(cl-defmethod foo ((a (eql smthg)) (b list)) \"Return A+B.\")") + (insert "(cl-defmethod foo ((a (eql 'smthg)) (b list)) \"Return A+B.\")") (checkdoc-defun))) (ert-deftest checkdoc-cl-defmethod-qualified-ok () "Checkdoc should be happy with a `cl-defmethod' using qualifiers." (with-temp-buffer (emacs-lisp-mode) - (insert "(cl-defmethod test :around ((a (eql smthg))) \"Return A.\")") + (insert "(cl-defmethod test :around ((a (eql 'smthg))) \"Return A.\")") (checkdoc-defun))) (ert-deftest checkdoc-cl-defmethod-with-extra-qualifier-ok () "Checkdoc should be happy with a :extra qualified `cl-defmethod'." (with-temp-buffer (emacs-lisp-mode) - (insert "(cl-defmethod foo :extra \"foo\" ((a (eql smthg))) \"Return A.\")") + (insert "(cl-defmethod foo :extra \"foo\" ((a (eql 'smthg))) \"Return A.\")") (checkdoc-defun)) (with-temp-buffer (emacs-lisp-mode) (insert - "(cl-defmethod foo :extra \"foo\" :after ((a (eql smthg))) \"Return A.\")") + "(cl-defmethod foo :extra \"foo\" :after ((a (eql 'smthg))) \"Return A.\")") (checkdoc-defun))) (ert-deftest checkdoc-cl-defmethod-with-extra-qualifier-and-nil-args-ok () diff --git a/test/lisp/emacs-lisp/cl-generic-tests.el b/test/lisp/emacs-lisp/cl-generic-tests.el index 9312fb44a1e..0093b04d1d8 100644 --- a/test/lisp/emacs-lisp/cl-generic-tests.el +++ b/test/lisp/emacs-lisp/cl-generic-tests.el @@ -56,7 +56,11 @@ (should (equal (cl--generic-1 'a nil) '(a))) (should (equal (cl--generic-1 4 nil) '("quatre" 4))) (should (equal (cl--generic-1 5 nil) '("cinq" 5))) - (should (equal (cl--generic-1 6 nil) '("six" a)))) + (should (equal (cl--generic-1 6 nil) '("six" a))) + (defvar cl--generic-fooval 41) + (cl-defmethod cl--generic-1 ((_x (eql (+ cl--generic-fooval 1))) _y) + "forty-two") + (should (equal (cl--generic 42 nil) "forty-two"))) (cl-defstruct cl-generic-struct-parent a b) (cl-defstruct (cl-generic-struct-child1 (:include cl-generic-struct-parent)) c) -- cgit v1.2.3 From adab672edb3fad0851a52e3b6ccf3ac31c80b025 Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Thu, 5 Aug 2021 17:53:05 -0700 Subject: Further fix to filtering Gnus search group names * lisp/gnus/gnus-search.el (gnus-search-indexed-parse-output): Group names in the GROUPS argument may be prefixed or not, depending on which server we're searching, so always enforce prefix policy within the function. --- lisp/gnus/gnus-search.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'lisp/gnus/gnus-search.el') diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 53af2f6fe6a..8182630dfed 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -1358,6 +1358,7 @@ Returns a list of [group article score] vectors." server query &optional groups) (let ((prefix (or (slot-value engine 'remove-prefix) "")) + (groups (mapcar #'gnus-group-short-name groups)) artlist article group) (goto-char (point-min)) ;; Prep prefix, we want to at least be removing the root @@ -1384,7 +1385,6 @@ Returns a list of [group article score] vectors." nil t) nil t) nil t)) - (setq group (gnus-group-full-name group server)) (setq article (file-name-nondirectory f-name) article ;; TODO: Provide a cleaner way of producing final @@ -1404,10 +1404,12 @@ Returns a list of [group article score] vectors." (setq artlist (gnus-search-grep-search engine artlist grep-reg))) ;; Munge into the list of vectors expected by nnselect. (mapcar (pcase-lambda (`(,_ ,article ,group ,score)) - (vector group article - (if (numberp score) - score - (string-to-number score)))) + (vector + (gnus-group-full-name group server) + article + (if (numberp score) + score + (string-to-number score)))) artlist))) (cl-defmethod gnus-search-indexed-extract ((_engine gnus-search-indexed)) -- 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/gnus/gnus-search.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/gnus/gnus-search.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