aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2011-09-01 20:36:58 -0400
committerStefan Monnier2011-09-01 20:36:58 -0400
commitae0bc9fbe51e3cb1b933fa610e799e30ad611094 (patch)
treea31dc73149444bcf27d8ed29760e4e7a1795b9d1
parente9d90883a2dd2009e77661ac5803d2bb36ed9b88 (diff)
downloademacs-ae0bc9fbe51e3cb1b933fa610e799e30ad611094.tar.gz
emacs-ae0bc9fbe51e3cb1b933fa610e799e30ad611094.zip
* lisp/minibuffer.el (completion--insert-strings): Don't get confused by
completion entries that end with an LF char.
-rw-r--r--lisp/ChangeLog27
-rw-r--r--lisp/minibuffer.el10
2 files changed, 23 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a306f697c60..a7d2083f4b1 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12011-09-02 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * minibuffer.el (completion--insert-strings): Don't get confused by
4 completion entries that end with an LF char.
5
12011-09-01 Eli Zaretskii <eliz@gnu.org> 62011-09-01 Eli Zaretskii <eliz@gnu.org>
2 7
3 * window.el (frame-auto-delete, window-deletable-p): Doc fix. 8 * window.el (frame-auto-delete, window-deletable-p): Doc fix.
@@ -5,11 +10,11 @@
52011-09-01 Chong Yidong <cyd@stupidchicken.com> 102011-09-01 Chong Yidong <cyd@stupidchicken.com>
6 11
7 * window.el (display-buffer): Restore interactive spec. 12 * window.el (display-buffer): Restore interactive spec.
8 (display-buffer-same-window, display-buffer-other-window): New 13 (display-buffer-same-window, display-buffer-other-window):
9 functions. 14 New functions.
10 (pop-to-buffer-1): New function. Use the above. 15 (pop-to-buffer-1): New function. Use the above.
11 (pop-to-buffer, pop-to-buffer-same-window): Use it. 16 (pop-to-buffer, pop-to-buffer-same-window): Use it.
12 (pop-to-buffer-other-window, pop-to-buffer-other-frame): Deleted. 17 (pop-to-buffer-other-window, pop-to-buffer-other-frame): Delete.
13 18
14 * view.el (view-buffer-other-window, view-buffer-other-frame): 19 * view.el (view-buffer-other-window, view-buffer-other-frame):
15 Just use pop-to-buffer. 20 Just use pop-to-buffer.
@@ -60,8 +65,8 @@
60 (display-buffer-alist-set-1, display-buffer-alist-set-2) 65 (display-buffer-alist-set-1, display-buffer-alist-set-2)
61 (display-buffer-alist-set): Remove. 66 (display-buffer-alist-set): Remove.
62 (display-buffer-function, special-display-buffer-names) 67 (display-buffer-function, special-display-buffer-names)
63 (special-display-regexps, special-display-function): In 68 (special-display-regexps, special-display-function):
64 doc-string refer to display-buffer-window and quit-restore 69 In doc-string refer to display-buffer-window and quit-restore
65 parameter. 70 parameter.
66 (pop-up-frame-alist, pop-up-frame-function, special-display-p) 71 (pop-up-frame-alist, pop-up-frame-function, special-display-p)
67 (special-display-frame-alist, special-display-popup-frame) 72 (special-display-frame-alist, special-display-popup-frame)
@@ -72,8 +77,8 @@
72 (split-window-sensibly, window--try-to-split-window) 77 (split-window-sensibly, window--try-to-split-window)
73 (window--frame-usable-p, even-window-heights) 78 (window--frame-usable-p, even-window-heights)
74 (window--even-window-heights, window--display-buffer-1) 79 (window--even-window-heights, window--display-buffer-1)
75 (window--display-buffer-2, display-buffer-other-frame): Restore 80 (window--display-buffer-2, display-buffer-other-frame):
76 old Emacs 23 code, order and doc-strings where applicable. 81 Restore old Emacs 23 code, order and doc-strings where applicable.
77 (display-buffer-default, display-buffer-assq-regexp): New functions. 82 (display-buffer-default, display-buffer-assq-regexp): New functions.
78 (display-buffer-alist): Rewrite doc-string. 83 (display-buffer-alist): Rewrite doc-string.
79 (display-buffer-default-action) 84 (display-buffer-default-action)
@@ -85,8 +90,8 @@
85 Restore Emacs 23 behavior but use 90 Restore Emacs 23 behavior but use
86 window-normalize-buffer-to-switch-to. 91 window-normalize-buffer-to-switch-to.
87 (pop-to-buffer-same-window): Rewrite. 92 (pop-to-buffer-same-window): Rewrite.
88 (pop-to-buffer-other-window, pop-to-buffer-other-frame): Rewrite 93 (pop-to-buffer-other-window, pop-to-buffer-other-frame):
89 using Emacs 23 options. 94 Rewrite using Emacs 23 options.
90 95
912011-08-31 Michael Albinus <michael.albinus@gmx.de> 962011-08-31 Michael Albinus <michael.albinus@gmx.de>
92 97
@@ -95,8 +100,8 @@
95 (tramp-completion-file-name-regexp-separate) 100 (tramp-completion-file-name-regexp-separate)
96 (tramp-completion-file-name-regexp-url): Don't use leading volume 101 (tramp-completion-file-name-regexp-url): Don't use leading volume
97 letter on win32 systems. (Bug#5303, Bug#9311) 102 letter on win32 systems. (Bug#5303, Bug#9311)
98 (tramp-drop-volume-letter): Simplify definition. Suggested by 103 (tramp-drop-volume-letter): Simplify definition.
99 Stefan Monnier <monnier@iro.umontreal.ca>. 104 Suggested by Stefan Monnier <monnier@iro.umontreal.ca>.
100 105
1012011-08-30 Stefan Monnier <monnier@iro.umontreal.ca> 1062011-08-30 Stefan Monnier <monnier@iro.umontreal.ca>
102 107
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 313298de97e..820b1599abb 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -1076,12 +1076,15 @@ It also eliminates runs of equal strings."
1076 (column 0) 1076 (column 0)
1077 (rows (/ (length strings) columns)) 1077 (rows (/ (length strings) columns))
1078 (row 0) 1078 (row 0)
1079 (first t)
1079 (laststring nil)) 1080 (laststring nil))
1080 ;; The insertion should be "sensible" no matter what choices were made 1081 ;; The insertion should be "sensible" no matter what choices were made
1081 ;; for the parameters above. 1082 ;; for the parameters above.
1082 (dolist (str strings) 1083 (dolist (str strings)
1083 (unless (equal laststring str) ; Remove (consecutive) duplicates. 1084 (unless (equal laststring str) ; Remove (consecutive) duplicates.
1084 (setq laststring str) 1085 (setq laststring str)
1086 ;; FIXME: `string-width' doesn't pay attention to
1087 ;; `display' properties.
1085 (let ((length (if (consp str) 1088 (let ((length (if (consp str)
1086 (+ (string-width (car str)) 1089 (+ (string-width (car str))
1087 (string-width (cadr str))) 1090 (string-width (cadr str)))
@@ -1100,11 +1103,11 @@ It also eliminates runs of equal strings."
1100 (forward-line 1) 1103 (forward-line 1)
1101 (end-of-line))) 1104 (end-of-line)))
1102 (insert " \t") 1105 (insert " \t")
1103 (set-text-properties (- (point) 1) (point) 1106 (set-text-properties (1- (point)) (point)
1104 `(display (space :align-to ,column))))) 1107 `(display (space :align-to ,column)))))
1105 (t 1108 (t
1106 ;; Horizontal format 1109 ;; Horizontal format
1107 (unless (bolp) 1110 (unless first
1108 (if (< wwidth (+ (max colwidth length) column)) 1111 (if (< wwidth (+ (max colwidth length) column))
1109 ;; No space for `str' at point, move to next line. 1112 ;; No space for `str' at point, move to next line.
1110 (progn (insert "\n") (setq column 0)) 1113 (progn (insert "\n") (setq column 0))
@@ -1112,12 +1115,13 @@ It also eliminates runs of equal strings."
1112 ;; Leave the space unpropertized so that in the case we're 1115 ;; Leave the space unpropertized so that in the case we're
1113 ;; already past the goal column, there is still 1116 ;; already past the goal column, there is still
1114 ;; a space displayed. 1117 ;; a space displayed.
1115 (set-text-properties (- (point) 1) (point) 1118 (set-text-properties (1- (point)) (point)
1116 ;; We can't just set tab-width, because 1119 ;; We can't just set tab-width, because
1117 ;; completion-setup-function will kill 1120 ;; completion-setup-function will kill
1118 ;; all local variables :-( 1121 ;; all local variables :-(
1119 `(display (space :align-to ,column))) 1122 `(display (space :align-to ,column)))
1120 nil)))) 1123 nil))))
1124 (setq first nil)
1121 (if (not (consp str)) 1125 (if (not (consp str))
1122 (put-text-property (point) (progn (insert str) (point)) 1126 (put-text-property (point) (progn (insert str) (point))
1123 'mouse-face 'highlight) 1127 'mouse-face 'highlight)