]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/minibuffer.el (completion--sreverse): Remove.
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 23 May 2014 15:54:44 +0000 (11:54 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 23 May 2014 15:54:44 +0000 (11:54 -0400)
(completion--common-suffix): Use `reverse' instead.
* lisp/emacs-lisp/regexp-opt.el (regexp-opt-group): Use `reverse' on strings.

lisp/ChangeLog
lisp/emacs-lisp/regexp-opt.el
lisp/minibuffer.el

index aaf7cb232c8f298e10a037cdf6e1d26ca26e2221..7c2b1ec5ad64a584da2a0f9dc4dcd017d41e90f9 100644 (file)
@@ -1,3 +1,9 @@
+2014-05-23  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * minibuffer.el (completion--sreverse): Remove.
+       (completion--common-suffix): Use `reverse' instead.
+       * emacs-lisp/regexp-opt.el (regexp-opt-group): Use `reverse' on strings.
+
 2014-05-22  Glenn Morris  <rgm@gnu.org>
 
        * shell.el (shell-mode) <shell-dirstack-query>: Bypass bash aliases.
index b2d4f2b71dd50cc3a26c9ea9a164db183c53efed..ff9388171a6b3dd5decf947fecb32a4d03c163f3 100644 (file)
@@ -205,9 +205,7 @@ Merges keywords to avoid backtracking in Emacs's regexp matcher."
                      (regexp-opt-group suffixes t t)
                      close-group))
 
-         (let* ((sgnirts (mapcar (lambda (s)
-                                   (concat (nreverse (string-to-list s))))
-                                 strings))
+         (let* ((sgnirts (mapcar #'reverse strings))
                 (xiffus (try-completion "" sgnirts)))
            (if (> (length xiffus) 0)
                ;; common suffix: take it and recurse on the prefixes.
@@ -218,8 +216,7 @@ Merges keywords to avoid backtracking in Emacs's regexp matcher."
                              'string-lessp)))
                  (concat open-group
                          (regexp-opt-group prefixes t t)
-                         (regexp-quote
-                          (concat (nreverse (string-to-list xiffus))))
+                         (regexp-quote (nreverse xiffus))
                          close-group))
 
              ;; Otherwise, divide the list into those that start with a
index f8e39dc1529d40615c39e83d486bcc63e191391d..2f898fa1ba5e12c3174b31fd31e404a9d33977e5 100644 (file)
@@ -873,6 +873,7 @@ completing buffer and file names, respectively."
   ;; part of the string (e.g. substitute-in-file-name).
   (let ((requote
          (when (completion-metadata-get metadata 'completion--unquote-requote)
+           (cl-assert (functionp table))
            (let ((new (funcall table string point 'completion--unquote)))
              (setq string (pop new))
              (setq table (pop new))
@@ -3057,16 +3058,9 @@ filter out additional entries (because TABLE might not obey PRED)."
       (nconc (completion-pcm--hilit-commonality pattern all)
              (length prefix)))))
 
-(defun completion--sreverse (str)
-  "Like `reverse' but for a string STR rather than a list."
-  (apply #'string (nreverse (mapcar 'identity str))))
-
 (defun completion--common-suffix (strs)
   "Return the common suffix of the strings STRS."
-  (completion--sreverse
-   (try-completion
-    ""
-    (mapcar #'completion--sreverse strs))))
+  (nreverse (try-completion "" (mapcar #'reverse strs))))
 
 (defun completion-pcm--merge-completions (strs pattern)
   "Extract the commonality in STRS, with the help of PATTERN.