emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r117141: * lisp/minibuffer.el (completion--sreverse)


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r117141: * lisp/minibuffer.el (completion--sreverse): Remove.
Date: Fri, 23 May 2014 15:54:50 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117141
revision-id: address@hidden
parent: address@hidden
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Fri 2014-05-23 11:54:44 -0400
message:
  * lisp/minibuffer.el (completion--sreverse): Remove.
  (completion--common-suffix): Use `reverse' instead.
  * lisp/emacs-lisp/regexp-opt.el (regexp-opt-group): Use `reverse' on strings.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/emacs-lisp/regexp-opt.el  
regexpopt.el-20091113204419-o5vbwnq5f7feedwu-1180
  lisp/minibuffer.el             
minibuffer.el-20091113204419-o5vbwnq5f7feedwu-8622
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-05-22 19:56:49 +0000
+++ b/lisp/ChangeLog    2014-05-23 15:54:44 +0000
@@ -1,3 +1,9 @@
+2014-05-23  Stefan Monnier  <address@hidden>
+
+       * 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  <address@hidden>
 
        * shell.el (shell-mode) <shell-dirstack-query>: Bypass bash aliases.

=== modified file 'lisp/emacs-lisp/regexp-opt.el'
--- a/lisp/emacs-lisp/regexp-opt.el     2014-02-10 01:34:22 +0000
+++ b/lisp/emacs-lisp/regexp-opt.el     2014-05-23 15:54:44 +0000
@@ -205,9 +205,7 @@
                      (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 @@
                              '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

=== modified file 'lisp/minibuffer.el'
--- a/lisp/minibuffer.el        2014-05-14 17:01:29 +0000
+++ b/lisp/minibuffer.el        2014-05-23 15:54:44 +0000
@@ -873,6 +873,7 @@
   ;; 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 @@
       (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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]