emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r115916: Fix bug 15980


From: Bastien Guerry
Subject: [Emacs-diffs] trunk r115916: Fix bug 15980
Date: Tue, 07 Jan 2014 23:36:56 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115916
revision-id: address@hidden
parent: address@hidden
committer: Bastien Guerry <address@hidden>
branch nick: trunk
timestamp: Wed 2014-01-08 00:36:29 +0100
message:
  Fix bug 15980
  
  * minibuffer.el (completion--try-word-completion): When both a
  hyphen and a space are possible candidates for the character
  following a word, display both candidates.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/minibuffer.el             
minibuffer.el-20091113204419-o5vbwnq5f7feedwu-8622
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-01-07 17:16:24 +0000
+++ b/lisp/ChangeLog    2014-01-07 23:36:29 +0000
@@ -1,3 +1,9 @@
+2014-01-07  Bastien Guerry  <address@hidden>
+
+       * minibuffer.el (completion--try-word-completion): When both a
+       hyphen and a space are possible candidates for the character
+       following a word, display both candidates.  (Bug#15980)
+
 2014-01-07  Martin Rudalics  <address@hidden>
 
        * window.el (balance-windows-2): While rounding don't give a

=== modified file 'lisp/minibuffer.el'
--- a/lisp/minibuffer.el        2014-01-01 07:43:34 +0000
+++ b/lisp/minibuffer.el        2014-01-07 23:36:29 +0000
@@ -1334,16 +1334,19 @@
         ;; instead, but it was too blunt, leading to situations where SPC
         ;; was the only insertable char at point but minibuffer-complete-word
         ;; refused inserting it.
-        (let ((exts (mapcar (lambda (str) (propertize str 'completion-try-word 
t))
-                            '(" " "-")))
-              (before (substring string 0 point))
-              (after (substring string point))
-             tem)
-         (while (and exts (not (consp tem)))
-            (setq tem (completion-try-completion
-                      (concat before (pop exts) after)
-                      table predicate (1+ point) md)))
-         (if (consp tem) (setq comp tem))))
+        (let* ((exts (mapcar (lambda (str) (propertize str 
'completion-try-word t))
+                            '(" " "-")))
+              (before (substring string 0 point))
+              (after (substring string point))
+              (comps
+               (delete nil
+                       (mapcar (lambda (ext)
+                                 (completion-try-completion
+                                  (concat before ext after)
+                                  table predicate (1+ point) md))
+                               exts))))
+         (when (and (= 1 (length comps) (consp (car comps))))
+           (setq comp (car comps)))))
 
       ;; Completing a single word is actually more difficult than completing
       ;; as much as possible, because we first have to find the "current


reply via email to

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