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`.
This commit is contained in:
Mattias Engdegård 2021-08-09 11:20:00 +02:00
parent c7855c8ca3
commit 3b7b181bde
145 changed files with 299 additions and 299 deletions

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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)))))))

View file

@ -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)

View file

@ -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)

View file

@ -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) ?\:))

View file

@ -481,7 +481,7 @@
":"
(if (and (equal cmd "e")
(or (not input)
(string-match
(string-search
"#" input))
(> radix 14))
(format "*%d.^" radix)

View file

@ -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)))))))

View file

@ -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))))))

View file

@ -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))

View file

@ -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))

View file

@ -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)

View file

@ -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")))

View file

@ -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.

View file

@ -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")))

View file

@ -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."

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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:

View file

@ -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))))

View file

@ -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.

View file

@ -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

View file

@ -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")))

View file

@ -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))

View file

@ -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 "[ ]+")))))

View file

@ -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))))

View file

@ -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

View file

@ -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))

View file

@ -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)))

View file

@ -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))

View file

@ -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))

View file

@ -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

View file

@ -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")))

View file

@ -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)

View file

@ -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))

View file

@ -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))))))

View file

@ -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

View file

@ -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 ()

View file

@ -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))

View file

@ -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))

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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)

View file

@ -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"))

View file

@ -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))

View file

@ -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

View file

@ -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)

View file

@ -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 "\""))

View file

@ -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")

View file

@ -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

View file

@ -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 "/")

View file

@ -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))))

View file

@ -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))))

View file

@ -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") ".

View file

@ -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))))

View file

@ -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))

View file

@ -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))))

View file

@ -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,")))

View file

@ -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)))

View file

@ -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))))))

View file

@ -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 ""))))

View file

@ -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)

View file

@ -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))

View file

@ -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))

View file

@ -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))

View file

@ -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?")

View file

@ -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)))))

View file

@ -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'

View file

@ -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")))

View file

@ -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"

View file

@ -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.

View file

@ -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)

View file

@ -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)))

View file

@ -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,

View file

@ -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

View file

@ -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)

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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)))

View file

@ -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))

View file

@ -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 <luser@host>
(setq from (substring from 0 (1- addr-start))))

View file

@ -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))

View file

@ -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

View file

@ -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

View file

@ -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))))

View file

@ -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."

View file

@ -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)))))

View file

@ -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)))

View file

@ -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)))))

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -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)))))

View file

@ -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

View file

@ -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))))))

Some files were not shown because too many files have changed in this diff Show more