aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2009-04-14 02:02:30 +0000
committerStefan Monnier2009-04-14 02:02:30 +0000
commit1afbbf8521b3208b029c48fd8bb82190c73f5aeb (patch)
tree768cf209efe56c4fcc5af5c3d7dca77bd4f76759
parentd156542d902d20dafbc9d2b8d95492928996e49f (diff)
downloademacs-1afbbf8521b3208b029c48fd8bb82190c73f5aeb.tar.gz
emacs-1afbbf8521b3208b029c48fd8bb82190c73f5aeb.zip
(completion--try-word-completion): Don't disable
`partial-completion' any more. Mark the added char instead. (completion-pcm--string->pattern): Notice chars added by completion--try-word-completion and treat them specially.
-rw-r--r--lisp/ChangeLog21
-rw-r--r--lisp/minibuffer.el22
2 files changed, 29 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index fd14c1aade7..bb2855cbd2b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12009-04-14 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * minibuffer.el (completion--try-word-completion): Don't disable
4 `partial-completion' any more. Mark the added char instead.
5 (completion-pcm--string->pattern): Notice chars added by
6 completion--try-word-completion and treat them specially.
7
12009-04-13 Jason Rumney <jasonr@gnu.org> 82009-04-13 Jason Rumney <jasonr@gnu.org>
2 9
3 * faces.el (frame-set-background-mode): Window system frames 10 * faces.el (frame-set-background-mode): Window system frames
@@ -6,13 +13,12 @@
6 13
72009-04-13 Kenichi Handa <handa@m17n.org> 142009-04-13 Kenichi Handa <handa@m17n.org>
8 15
9 * language/japanese.el (cp932): Delete alias for 16 * language/japanese.el (cp932): Delete alias for japanese-shift-jis.
10 japanese-shift-jis.
11 17
122009-04-12 Michael Albinus <michael.albinus@gmx.de> 182009-04-12 Michael Albinus <michael.albinus@gmx.de>
13 19
14 * net/tramp.el (tramp-do-copy-or-rename-file-directly): Overwrite 20 * net/tramp.el (tramp-do-copy-or-rename-file-directly):
15 always the tmpfile. (Bug#2962). 21 Overwrite always the tmpfile. (Bug#2962).
16 22
172009-04-11 Chong Yidong <cyd@stupidchicken.com> 232009-04-11 Chong Yidong <cyd@stupidchicken.com>
18 24
@@ -25,8 +31,8 @@
25 (hack-dir-local-variables): Adapt to new 31 (hack-dir-local-variables): Adapt to new
26 dir-locals-directory-cache entry format. 32 dir-locals-directory-cache entry format.
27 33
28 * international/mule-diag.el (describe-font-internal): Change 34 * international/mule-diag.el (describe-font-internal):
29 ignored argument to IGNORED. 35 Rename ignored argument to IGNORED.
30 (describe-font): Elide unnecessary argument to 36 (describe-font): Elide unnecessary argument to
31 describe-font-internal (Bug#2945). 37 describe-font-internal (Bug#2945).
32 38
@@ -85,8 +91,7 @@
85 91
862009-04-09 Michael Albinus <michael.albinus@gmx.de> 922009-04-09 Michael Albinus <michael.albinus@gmx.de>
87 93
88 * net/tramp.el (tramp-file-name-handler-alist): Add 94 * net/tramp.el (tramp-file-name-handler-alist): Add `vc-registered'.
89 `vc-registered'.
90 (tramp-handle-vc-registered ): New defun. (Bug#1741). 95 (tramp-handle-vc-registered ): New defun. (Bug#1741).
91 96
92 * net/tramp-cache.el (tramp-flush-directory-property): Use the 97 * net/tramp-cache.el (tramp-flush-directory-property): Use the
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 92325ae4958..911a6b3c2d9 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -607,13 +607,17 @@ If `minibuffer-completion-confirm' is `confirm-after-completion',
607 ;; If completion finds next char not unique, 607 ;; If completion finds next char not unique,
608 ;; consider adding a space or a hyphen. 608 ;; consider adding a space or a hyphen.
609 (when (= (length string) (length (car comp))) 609 (when (= (length string) (length (car comp)))
610 (let ((exts '(" " "-")) 610 ;; Mark the added char with the `completion-word' property, so it
611 ;; can be handled specially by completion styles such as
612 ;; partial-completion.
613 ;; We used to remove `partial-completion' from completion-styles
614 ;; instead, but it was too blunt, leading to situations where SPC
615 ;; was the only insertable char at point but minibuffer-complete-word
616 ;; refused inserting it.
617 (let ((exts (mapcar (lambda (str) (propertize str 'completion-try-word t))
618 '(" " "-")))
611 (before (substring string 0 point)) 619 (before (substring string 0 point))
612 (after (substring string point)) 620 (after (substring string point))
613 ;; Disable partial-completion for this.
614 (completion-styles
615 (or (remove 'partial-completion completion-styles)
616 completion-styles))
617 tem) 621 tem)
618 (while (and exts (not (consp tem))) 622 (while (and exts (not (consp tem)))
619 (setq tem (completion-try-completion 623 (setq tem (completion-try-completion
@@ -1381,7 +1385,13 @@ or a symbol chosen among `any', `star', `point'."
1381 (p 0) 1385 (p 0)
1382 (p0 0)) 1386 (p0 0))
1383 1387
1384 (while (setq p (string-match-p completion-pcm--delim-wild-regex string p)) 1388 (while (and (setq p (string-match-p completion-pcm--delim-wild-regex
1389 string p))
1390 ;; If the char was added by minibuffer-complete-word, then
1391 ;; don't treat it as a delimiter, otherwise "M-x SPC"
1392 ;; ends up inserting a "-" rather than listing
1393 ;; all completions.
1394 (not (get-text-property p 'completion-try-word string)))
1385 (push (substring string p0 p) pattern) 1395 (push (substring string p0 p) pattern)
1386 (if (eq (aref string p) ?*) 1396 (if (eq (aref string p) ?*)
1387 (progn 1397 (progn