APPROVE COMMIT
NOTE: This patch has been committed
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1535233105 -3600
# Sat Aug 25 22:38:25 2018 +0100
# Node ID 0e1a8b0e7cf8d016d4ca539f0b279ad8b645df49
# Parent 68a9e72bc26775c4e0d1aae4cfde4a6c7a1e8c9a
Call #'string-match, #'looking-at much less often.
2018-08-25 Aidan Kehoe <kehoea(a)parhasard.net>
* autoload.el (generate-file-autoloads):
* autoload.el (generate-custom-defines):
* autoload.el (generate-custom-defines-1):
* bytecomp.el:
* bytecomp.el (byte-compile-dest-file): New.
* bytecomp.el (byte-compile-inline-expand):
* disass.el (disassemble-1):
* files.el:
* files.el (parse-colon-path):
* files.el (set-auto-mode):
* files.el (hack-local-variables):
* files.el (hack-local-variables-last-page):
* files.el (hack-local-variables-prop-line):
* files.el (file-relative-name):
* files.el (revert-buffer):
* files.el (recover-session):
* files.el (file-expand-wildcards):
* files.el (shell-quote-wildcard-pattern):
* files.el (insert-directory):
* files.el (insert-directory-adj-pos):
* find-paths.el (paths-find-recursive-path):
* font-lock.el (font-lock-lisp-like):
* font-lock.el (font-lock-match-java-declarations):
* font-mgr.el:
* font-mgr.el (xlfd-font-name-p):
* gutter-items.el (buffers-tab-omit-some-buffers):
* gutter-items.el (select-buffers-tab-buffers-by-mode):
Call #'string-match, #'looking-at much less often, preferring
#'string-match-p and #'looking-at-p instead for fewer side-effects.
* cus-edit.el:
* cus-edit.el (customize-version-lessp):
Use the much cheaper #'parse-integer instead of #'read here.
* files.el (convert-standard-filename):
Redefine this to act as identity on non-windows-nt systems.
diff -r 68a9e72bc267 -r 0e1a8b0e7cf8 lisp/ChangeLog
--- a/lisp/ChangeLog Wed Aug 22 00:05:11 2018 +0100
+++ b/lisp/ChangeLog Sat Aug 25 22:38:25 2018 +0100
@@ -1,7 +1,44 @@
+2018-08-25 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * autoload.el (generate-file-autoloads):
+ * autoload.el (generate-custom-defines):
+ * autoload.el (generate-custom-defines-1):
+ * bytecomp.el:
+ * bytecomp.el (byte-compile-dest-file): New.
+ * bytecomp.el (byte-compile-inline-expand):
+ * disass.el (disassemble-1):
+ * files.el:
+ * files.el (parse-colon-path):
+ * files.el (set-auto-mode):
+ * files.el (hack-local-variables):
+ * files.el (hack-local-variables-last-page):
+ * files.el (hack-local-variables-prop-line):
+ * files.el (file-relative-name):
+ * files.el (revert-buffer):
+ * files.el (recover-session):
+ * files.el (file-expand-wildcards):
+ * files.el (shell-quote-wildcard-pattern):
+ * files.el (insert-directory):
+ * files.el (insert-directory-adj-pos):
+ * find-paths.el (paths-find-recursive-path):
+ * font-lock.el (font-lock-lisp-like):
+ * font-lock.el (font-lock-match-java-declarations):
+ * font-mgr.el:
+ * font-mgr.el (xlfd-font-name-p):
+ * gutter-items.el (buffers-tab-omit-some-buffers):
+ * gutter-items.el (select-buffers-tab-buffers-by-mode):
+ Call #'string-match, #'looking-at much less often, preferring
+ #'string-match-p and #'looking-at-p instead for fewer side-effects.
+ * cus-edit.el:
+ * cus-edit.el (customize-version-lessp):
+ Use the much cheaper #'parse-integer instead of #'read here.
+ * files.el (convert-standard-filename):
+ Redefine this to act as identity on non-windows-nt systems.
+
2018-08-14 Aidan Kehoe <kehoea(a)parhasard.net>
* misc.el (make-weak-box):
- Make this code work when run compiled too, not that it will come
+ Make this code work when run interpreted too, not that it will come
up much.
2018-08-13 Aidan Kehoe <kehoea(a)parhasard.net>
diff -r 68a9e72bc267 -r 0e1a8b0e7cf8 lisp/autoload.el
--- a/lisp/autoload.el Wed Aug 22 00:05:11 2018 +0100
+++ b/lisp/autoload.el Sat Aug 25 22:38:25 2018 +0100
@@ -367,19 +367,22 @@
If FILE is being visited in a buffer, the contents of the buffer
are used."
(interactive "fGenerate autoloads for file: ")
- (cond ((string-match "\\.el$" file)
- (generate-autoload-type-section
- file
- (replace-in-string (file-name-nondirectory file) "\\.elc?$" "")
- nil #'generate-lisp-file-autoloads-1))
- ;; #### jj, are C++ modules possible?
- ((string-match "\\.c$" file)
- (generate-autoload-type-section
- file
- (replace-in-string (file-name-nondirectory file) "\\.c$" "")
- t #'generate-c-file-autoloads-1))
- (t
- (error 'wrong-type-argument file "not a C or Elisp source file"))))
+ (let* ((file-name-nondirectory (file-name-nondirectory file))
+ (extension (position ?. file-name-nondirectory :from-end t)))
+ (unless extension
+ (error 'wrong-type-argument file
+ "no suffix, cannot identify file type"))
+ (cond ((not (mismatch ".el" file-name-nondirectory :start2 extension))
+ (generate-autoload-type-section
+ file (subseq file-name-nondirectory 0 extension) nil
+ #'generate-lisp-file-autoloads-1))
+ ;; #### jj, are C++ modules possible?
+ ((not (mismatch ".c" file-name-nondirectory :start2 extension))
+ (generate-autoload-type-section
+ file (subseq file-name-nondirectory 0 extension)
+ t #'generate-c-file-autoloads-1))
+ (t (error 'wrong-type-argument file
+ "not a C or Elisp source file")))))
(defun* generate-autoload-type-section (file load-name literal fun-to-call)
"Insert at point an autoload-type section for FILE.
@@ -668,17 +671,22 @@
If FILE is being visited in a buffer, the contents of the buffer
are used."
(interactive "fGenerate custom defines for file: ")
- (cond ((string-match "\\.el$" file)
- (generate-autoload-type-section
- file
- (replace-in-string (file-name-nondirectory file) "\\.elc?$" "")
- nil #'generate-custom-defines-1))
- ((string-match "\\.c$" file)
- ;; no way to generate custom-defines for C files (currently?),
- ;; but cannot signal an error.
- nil)
- (t
- (error 'wrong-type-argument file "not a C or Elisp source file"))))
+ (let* ((file-name-nondirectory (file-name-nondirectory file))
+ (extension (position ?. file-name-nondirectory :from-end t)))
+ (cond ((and extension
+ (not (mismatch ".el" file-name-nondirectory
+ :start2 extension)))
+ (generate-autoload-type-section
+ file (subseq file-name-nondirectory 0 extension) nil
+ #'generate-custom-defines-1))
+ ((and extension
+ (not (mismatch ".c" file-name-nondirectory
+ :start2 extension)))
+ ;; no way to generate custom-defines for C files (currently?),
+ ;; but cannot signal an error.
+ nil)
+ (t
+ (error 'wrong-type-argument file "not a C or Elisp source
file")))))
(defun* generate-custom-defines-1 (outbuf load-name trim-name)
"Insert at point in OUTBUF a custom-define section for an Elisp file.
diff -r 68a9e72bc267 -r 0e1a8b0e7cf8 lisp/bytecomp.el
--- a/lisp/bytecomp.el Wed Aug 22 00:05:11 2018 +0100
+++ b/lisp/bytecomp.el Sat Aug 25 22:38:25 2018 +0100
@@ -229,15 +229,15 @@
(funcall handler 'byte-compiler-base-file-name filename)
filename)))
-(unless (fboundp 'byte-compile-dest-file)
- ;; The user may want to redefine this along with emacs-lisp-file-regexp,
- ;; so only define it if it is undefined.
- (defun byte-compile-dest-file (filename)
- "Convert an Emacs Lisp source file name to a compiled file name."
- (setq filename (byte-compiler-base-file-name filename))
- (setq filename (file-name-sans-versions filename))
- (if (string-match emacs-lisp-file-regexp filename)
- (concat (substring filename 0 (match-beginning 0)) ".elc")
+;; The user may want to redefine this along with emacs-lisp-file-regexp,
+;; so only define it if it is undefined.
+(defun-when-void byte-compile-dest-file (filename)
+ "Convert an Emacs Lisp source file name to a compiled file name."
+ (setq filename (byte-compiler-base-file-name filename))
+ (setq filename (file-name-sans-versions filename))
+ (let ((match-beginning (string-match-p emacs-lisp-file-regexp filename)))
+ (if match-beginning
+ (concat (substring filename 0 match-beginning) ".elc")
(concat filename ".elc"))))
;; This can be the 'byte-compile property of any symbol.
diff -r 68a9e72bc267 -r 0e1a8b0e7cf8 lisp/cus-edit.el
--- a/lisp/cus-edit.el Wed Aug 22 00:05:11 2018 +0100
+++ b/lisp/cus-edit.el Sat Aug 25 22:38:25 2018 +0100
@@ -836,15 +836,18 @@
(defun customize-version-lessp (version1 version2)
(let (major1 major2 minor1 minor2)
- (string-match "\\([0-9]+\\)[.]\\([0-9]+\\)" version1)
- (setq major1 (read (match-string 1 version1)))
- (setq minor1 (read (match-string 2 version1)))
- (string-match "\\([0-9]+\\)[.]\\([0-9]+\\)" version2)
- (setq major2 (read (match-string 1 version2)))
- (setq minor2 (read (match-string 2 version2)))
- (or (< major1 major2)
- (and (= major1 major2)
- (< minor1 minor2)))))
+ (save-match-data
+ (string-match "\\([0-9]+\\)[.]\\([0-9]+\\)" version1)
+ (setq major1 (parse-integer version1 :start (match-beginning 1)
+ :end (match-end 1))
+ minor1 (parse-integer version1 :start (match-beginning 2)
+ :end (match-end 2)))
+ (string-match "\\([0-9]+\\)[.]\\([0-9]+\\)" version2)
+ (setq major2 (parse-integer version2 :start (match-beginning 1)
+ :end (match-end 1))
+ minor2 (parse-integer version2 :start (match-beginning 2)
+ :end (match-end 2)))
+ (or (< major1 major2) (and (eql major1 major2) (< minor1 minor2))))))
;;;###autoload
(defalias 'customize-variable-other-window 'customize-option-other-window)
diff -r 68a9e72bc267 -r 0e1a8b0e7cf8 lisp/disass.el
--- a/lisp/disass.el Wed Aug 22 00:05:11 2018 +0100
+++ b/lisp/disass.el Sat Aug 25 22:38:25 2018 +0100
@@ -200,9 +200,9 @@
(if pc-value
(insert (format "%d" pc-value)))
(indent-to (+ indent disassemble-column-1-indent))
- (if (and op
- (string-match "^byte-" (setq opname (symbol-name op))))
- (setq opname (substring opname 5))
+ (if (and op (string-match-p "^byte-"
+ (setq opname (symbol-name op))))
+ (setq opname (substring opname (length "byte-")))
(setq opname "<not-an-opcode>"))
(if (eq op 'byte-constant2)
(insert " #### shouldn't have seen constant2 here!\n "))
diff -r 68a9e72bc267 -r 0e1a8b0e7cf8 lisp/files.el
--- a/lisp/files.el Wed Aug 22 00:05:11 2018 +0100
+++ b/lisp/files.el Sat Aug 25 22:38:25 2018 +0100
@@ -545,23 +545,33 @@
;that really does change some file names to canonicalize certain
;patterns and to guarantee valid names."
(defun convert-standard-filename (filename)
- "Convert a standard file's name to something suitable for the current
OS."
- (if (eq system-type 'windows-nt)
- (let ((name (copy-sequence filename))
- (start 0))
- ;; leave ':' if part of drive specifier
- (if (and (> (length name) 1)
- (eq (aref name 1) ?:))
- (setq start 2))
- ;; destructively replace invalid filename characters with !
- (while (string-match "[?*:<>|\"\000-\037]" name start)
- (aset name (match-beginning 0) ?!)
- (setq start (match-end 0)))
- ;; FSF: [convert directory separators to Windows format ...]
- ;; unneeded in XEmacs.
- name)
- filename))
-
+ "Convert a standard FILENAME to something suitable for the current OS."
+ ;; See below for the non-windows-nt code that is equivalent to
+ ;; #'identity.
+ (let ((name (copy-sequence filename))
+ (start 0) match-beginning)
+ ;; leave ':' if part of drive specifier
+ (if (and (> (length name) 1) (eq (aref name 1) ?:))
+ (setq start 2))
+ ;; destructively replace invalid filename characters with !
+ (while (setq match-beginning
+ (string-match-p "[?*:<>|\"\000-\037]" name
start))
+ (aset name match-beginning ?!)
+ (setq start (1+ match-beginning)))
+ ;; FSF: [convert directory separators to Windows format ...]
+ ;; unneeded in XEmacs.
+ name))
+
+(when (and (not (eq system-type 'windows-nt))
+ (compiled-function-p (symbol-function 'convert-standard-filename)))
+ (fset 'convert-standard-filename
+ (make-byte-code
+ (compiled-function-arglist (symbol-function 'identity))
+ (compiled-function-instructions (symbol-function 'identity))
+ (compiled-function-constants (symbol-function 'identity))
+ (compiled-function-stack-depth (symbol-function 'identity))
+ (compiled-function-doc-string
+ (symbol-function 'convert-standard-filename)))))
(defun pwd ()
"Show the current default directory."
@@ -584,7 +594,8 @@
(and cd-path
(let (cd-list (cd-start 0) cd-colon)
(setq cd-path (concat cd-path path-separator))
- (while (setq cd-colon (string-match path-separator cd-path cd-start))
+ (while (setq cd-colon
+ (string-match-p path-separator cd-path cd-start))
(setq cd-list
(nconc cd-list
(list (if (= cd-start cd-colon)
@@ -1784,7 +1795,7 @@
(if (and (null mode)
(save-excursion ; XEmacs
(goto-char (point-min))
- (looking-at "#!")))
+ (looking-at-p "#!")))
(let ((firstline
(buffer-substring
(point-min)
@@ -1831,17 +1842,19 @@
(not (let ((temp inhibit-first-line-modes-regexps)
(name (if buffer-file-name
(file-name-sans-versions buffer-file-name)
- (buffer-name))))
+ (buffer-name)))
+ match-beginning)
(while (let ((sufs inhibit-first-line-modes-suffixes))
(while (and sufs (not
- (string-match (car sufs) name)))
+ (setq match-beginning
+ (string-match-p (car sufs)
+ name))))
(setq sufs (cdr sufs)))
sufs)
- (setq name (substring name 0 (match-beginning 0))))
- (while (and temp
- (not (string-match-p (car temp) name)))
- (setq temp (cdr temp))
- temp))))
+ (setq name (substring name 0 match-beginning)))
+ (while (and temp (not (string-match-p (car temp) name)))
+ (setq temp (cdr temp)))
+ temp)))
(progn
;; Look for variables in the -*- line.
(hack-local-variables-prop-line force)
@@ -1930,7 +1943,7 @@
(forward-line 1))
;; Skip the prefix, if any.
(if prefix
- (if (looking-at prefix)
+ (if (looking-at-p prefix)
(forward-char prefixlen)
(error "Local variables entry is missing the prefix")))
;; Find the variable name; strip whitespace.
@@ -1951,7 +1964,7 @@
(setq val (read (current-buffer)))
(skip-chars-backward "\n")
(skip-chars-forward " \t")
- (or (if suffix (looking-at suffix) (eolp))
+ (or (if suffix (looking-at-p suffix) (eolp))
(error "Local variables entry is terminated incorrectly"))
;; Set the variable. "Variables" mode and eval are funny.
(hack-one-local-variable var val))))))))
@@ -1972,7 +1985,7 @@
;; put them in the first line of
;; such a file without screwing up
;; the interpreter invocation.
- (end-of-line (and (looking-at "^#!") 2))
+ (end-of-line (and (looking-at-p "^#!") 2))
(point))))
;; Parse the -*- line into the `result' alist.
(cond ((not (search-forward "-*-" end t))
@@ -2696,12 +2709,11 @@
".."
(concat "../" ancestor))))
;; Now ancestor is empty, or .., or ../.., etc.
- (if (string-match (concat "^" (regexp-quote directory)) fname)
+ (if (string-match-p (concat "^" (regexp-quote directory)) fname)
;; We matched within FNAME's directory part.
;; Add the rest of FNAME onto ANCESTOR.
- (let ((rest (substring fname (match-end 0))))
- (if (and (equal ancestor ".")
- (not (equal rest "")))
+ (let ((rest (substring fname (length directory))))
+ (if (and (equal ancestor ".") (not (equal rest "")))
;; But don't bother with ANCESTOR if it would give us `./'.
rest
(concat (file-name-as-directory ancestor) rest)))
@@ -3461,7 +3473,7 @@
((or noconfirm
(and (not (buffer-modified-p))
(dolist (rx revert-without-query found)
- (when (string-match rx file-name)
+ (when (string-match-p rx file-name)
(setq found t))))
;; If we might perform an optimized revert then we
;; want to delay prompting in case we don't need to
@@ -3769,7 +3781,7 @@
(declare-fboundp (dired (cons auto-save-list-dir files)))
(save-excursion
(goto-char (point-min))
- (or (looking-at "Move to the session you want to recover,")
+ (or (looking-at-p "Move to the session you want to recover,")
(let ((inhibit-read-only t))
(delete-matching-lines "^[ \t]*total.*$")
(insert "Move to the session you want to recover,\n"
@@ -4025,9 +4037,10 @@
;; A list of all dirs that DIRPART specifies.
;; This can be more than one dir
;; if DIRPART contains wildcards.
- (dirs (if (and dirpart (string-match "[[*?]" dirpart))
- (mapcar 'file-name-as-directory
- (file-expand-wildcards (directory-file-name dirpart)))
+ (dirs (if (and dirpart (string-match-p "[[*?]" dirpart))
+ (mapcar #'file-name-as-directory
+ (file-expand-wildcards
+ (directory-file-name dirpart)))
(list dirpart)))
contents)
(while dirs
@@ -4087,42 +4100,42 @@
quoted with double quotes.
Existing quote characters in PATTERN are left alone, so you can pass
PATTERN that already quotes some of the special characters."
- (save-match-data
- (cond
- ((memq system-type '(ms-dos windows-nt))
- ;; 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-p "[\"]" 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
- ;; passing arguments to batch files that use positional
- ;; arguments like %1.
- (not (string-match-p "[ \t;&()#$',=+]" pattern)))
-
- pattern
- (let ((result "\"")
- (beg 0)
- end)
- (while (string-match "[*?]+" pattern beg)
- (setq end (match-beginning 0)
- result (concat result (substring pattern beg end)
- "\""
- (substring pattern end (match-end 0))
- "\"")
- beg (match-end 0)))
- (concat result (substring pattern beg) "\""))))
- (t
- (let ((beg 0))
- (while (string-match "[ \t\n;<>&|()#$]" pattern beg)
- (setq pattern
- (concat (substring pattern 0 (match-beginning 0))
- "\\"
- (substring pattern (match-beginning 0)))
- beg (1+ (match-end 0)))))
- pattern))))
-
+ (cond
+ ((memq system-type '(ms-dos windows-nt))
+ ;; 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 (find ?\" 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
+ ;; passing arguments to batch files that use positional
+ ;; arguments like %1.
+ (not (string-match-p "[ \t;&()#$',=+]" pattern)))
+ pattern
+ (let ((result "\"")
+ (beg 0)
+ end)
+ (save-match-data
+ (while (string-match "[*?]+" pattern beg)
+ (setq end (match-beginning 0)
+ result (concat result (substring pattern beg end)
+ "\""
+ (substring pattern end (match-end 0))
+ "\"")
+ beg (match-end 0)))
+ (concat result (substring pattern beg) "\"")))))
+ (t
+ (let ((start 0) stream beg)
+ (while (setq beg (string-match-p "[ \t\n;<>&|()#$]" pattern
start))
+ (write-sequence pattern (or stream
+ (setq stream
+ (make-string-output-stream)))
+ :start start :end beg)
+ (write-sequence "\\" stream)
+ (write-char (aref pattern beg) stream)
+ (setq start (1+ beg)))
+ (if stream (get-output-stream-string stream) pattern)))))
(defvar insert-directory-program "ls"
"Absolute or relative name of the `ls' program used by
`insert-directory'.")
@@ -4233,9 +4246,9 @@
(member "--dired" switches))
(save-excursion
(forward-line -2)
- (when (looking-at "//SUBDIRED//")
+ (when (looking-at-p "//SUBDIRED//")
(forward-line -1))
- (if (looking-at "//DIRED//")
+ (if (looking-at-p "//DIRED//")
(setq result 0))))
(when (and (not (eq 0 result))
@@ -4296,10 +4309,10 @@
(member "--dired" switches))
(string-match-p "--dired\\>" switches))
(forward-line -2)
- (when (looking-at "//SUBDIRED//")
+ (when (looking-at-p "//SUBDIRED//")
(delete-region (point) (progn (forward-line 1) (point)))
(forward-line -1))
- (if (looking-at "//DIRED//")
+ (if (looking-at-p "//DIRED//")
(let ((end (line-end-position))
(linebeg (point))
error-lines)
@@ -4343,7 +4356,7 @@
;; "//DIRED-OPTIONS//"-line, but no "//DIRED//"-line
;; and we went one line too far back (see above).
(forward-line 1))
- (if (looking-at "//DIRED-OPTIONS//")
+ (if (looking-at-p "//DIRED-OPTIONS//")
(delete-region (point) (progn (forward-line 1) (point))))))))))
(defun insert-directory-adj-pos (pos error-lines)
diff -r 68a9e72bc267 -r 0e1a8b0e7cf8 lisp/find-paths.el
--- a/lisp/find-paths.el Wed Aug 22 00:05:11 2018 +0100
+++ b/lisp/find-paths.el Sat Aug 25 22:38:25 2018 +0100
@@ -71,7 +71,8 @@
(reverse-dirs '()))
(while raw-entries
(if (not (and exclude-regexp
- (string-match exclude-regexp (car raw-entries))))
+ (string-match-p
+ exclude-regexp (car raw-entries))))
(setq reverse-dirs
(cons (expand-file-name (car raw-entries) directory)
reverse-dirs)))
diff -r 68a9e72bc267 -r 0e1a8b0e7cf8 lisp/font-lock.el
--- a/lisp/font-lock.el Wed Aug 22 00:05:11 2018 +0100
+++ b/lisp/font-lock.el Sat Aug 25 22:38:25 2018 +0100
@@ -1616,7 +1616,7 @@
(get mode 'font-lock-lisp-like)
;; If the property is not specified, guess. Similar logic exists
;; in add-log, but I think this encompasses more modes.
- (string-match "lisp\\|scheme" (symbol-name mode))))
+ (string-match-p "lisp\\|scheme" (symbol-name mode))))
;; fontify-syntactically-region used to use syntactically-sectionize, which
;; was supposedly much faster than the FSF version because it was written in
@@ -3098,16 +3098,14 @@
(goto-char (match-end 0)))
(and
(looking-at java-font-lock-identifier-regexp)
- (save-match-data
- (not (string-match java-font-lock-type-regexp
+ (not (string-match-p java-font-lock-type-regexp
(buffer-substring (match-beginning 1)
- (match-end 1)))))
- (save-match-data
- (save-excursion
- (goto-char (match-beginning 1))
- (not (looking-at
+ (match-end 1))))
+ (save-excursion
+ (goto-char (match-beginning 1))
+ (not (looking-at-p
(concat java-font-lock-class-name-regexp
- "\\s *\\(\\[\\s *\\]\\s *\\)*\\<")))))
+ "\\s *\\(\\[\\s *\\]\\s *\\)*\\<"))))
(save-match-data
(condition-case nil
(progn
diff -r 68a9e72bc267 -r 0e1a8b0e7cf8 lisp/font-mgr.el
--- a/lisp/font-mgr.el Wed Aug 22 00:05:11 2018 +0100
+++ b/lisp/font-mgr.el Sat Aug 25 22:38:25 2018 +0100
@@ -234,8 +234,7 @@
(defun xlfd-font-name-p (fontname)
"Check whether the string FONTNAME is a XLFD font name."
- (save-match-data
- (string-match xft-xlfd-font-regexp fontname)))
+ (string-match-p xft-xlfd-font-regexp fontname))
;; FcPatternPrint: there is no point in having wrappers fc-pattern-print,
;; Ffc_pattern_print since this function prints to stdout.
diff -r 68a9e72bc267 -r 0e1a8b0e7cf8 lisp/gutter-items.el
--- a/lisp/gutter-items.el Wed Aug 22 00:05:11 2018 +0100
+++ b/lisp/gutter-items.el Sat Aug 25 22:38:25 2018 +0100
@@ -189,7 +189,7 @@
Omit buffers based on the value of `buffers-tab-omit-list', which
see."
(let ((regexp (mapconcat 'concat buffers-tab-omit-list "\\|")))
- (not (null (string-match regexp (buffer-name buf))))))
+ (not (null (string-match-p regexp (buffer-name buf))))))
(defun buffers-tab-switch-to-buffer (buffer)
"For use as a value for `buffers-tab-switch-to-buffer-function'."
@@ -220,10 +220,10 @@
(and buffers-tab-grouping-regexp
(find-if #'(lambda (x)
(or
- (and (string-match x mode1)
- (string-match x mode2))
- (and (string-match x modenm1)
- (string-match x modenm2))))
+ (and (string-match-p x mode1)
+ (string-match-p x mode2))
+ (and (string-match-p x modenm1)
+ (string-match-p x modenm2))))
buffers-tab-grouping-regexp)))
t)
(t nil))))
--
‘As I sat looking up at the Guinness ad, I could never figure out /
How your man stayed up on the surfboard after forty pints of stout’
(C. Moore)