From: Stefan Monnier Date: Fri, 2 Sep 2011 00:36:58 +0000 (-0400) Subject: * lisp/minibuffer.el (completion--insert-strings): Don't get confused by X-Git-Tag: emacs-pretest-24.0.90~104^2~152^2~10 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ae0bc9fbe51e3cb1b933fa610e799e30ad611094;p=emacs.git * lisp/minibuffer.el (completion--insert-strings): Don't get confused by completion entries that end with an LF char. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a306f697c60..a7d2083f4b1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-09-02 Stefan Monnier + + * minibuffer.el (completion--insert-strings): Don't get confused by + completion entries that end with an LF char. + 2011-09-01 Eli Zaretskii * window.el (frame-auto-delete, window-deletable-p): Doc fix. @@ -5,11 +10,11 @@ 2011-09-01 Chong Yidong * window.el (display-buffer): Restore interactive spec. - (display-buffer-same-window, display-buffer-other-window): New - functions. + (display-buffer-same-window, display-buffer-other-window): + New functions. (pop-to-buffer-1): New function. Use the above. (pop-to-buffer, pop-to-buffer-same-window): Use it. - (pop-to-buffer-other-window, pop-to-buffer-other-frame): Deleted. + (pop-to-buffer-other-window, pop-to-buffer-other-frame): Delete. * view.el (view-buffer-other-window, view-buffer-other-frame): Just use pop-to-buffer. @@ -60,8 +65,8 @@ (display-buffer-alist-set-1, display-buffer-alist-set-2) (display-buffer-alist-set): Remove. (display-buffer-function, special-display-buffer-names) - (special-display-regexps, special-display-function): In - doc-string refer to display-buffer-window and quit-restore + (special-display-regexps, special-display-function): + In doc-string refer to display-buffer-window and quit-restore parameter. (pop-up-frame-alist, pop-up-frame-function, special-display-p) (special-display-frame-alist, special-display-popup-frame) @@ -72,8 +77,8 @@ (split-window-sensibly, window--try-to-split-window) (window--frame-usable-p, even-window-heights) (window--even-window-heights, window--display-buffer-1) - (window--display-buffer-2, display-buffer-other-frame): Restore - old Emacs 23 code, order and doc-strings where applicable. + (window--display-buffer-2, display-buffer-other-frame): + Restore old Emacs 23 code, order and doc-strings where applicable. (display-buffer-default, display-buffer-assq-regexp): New functions. (display-buffer-alist): Rewrite doc-string. (display-buffer-default-action) @@ -85,8 +90,8 @@ Restore Emacs 23 behavior but use window-normalize-buffer-to-switch-to. (pop-to-buffer-same-window): Rewrite. - (pop-to-buffer-other-window, pop-to-buffer-other-frame): Rewrite - using Emacs 23 options. + (pop-to-buffer-other-window, pop-to-buffer-other-frame): + Rewrite using Emacs 23 options. 2011-08-31 Michael Albinus @@ -95,8 +100,8 @@ (tramp-completion-file-name-regexp-separate) (tramp-completion-file-name-regexp-url): Don't use leading volume letter on win32 systems. (Bug#5303, Bug#9311) - (tramp-drop-volume-letter): Simplify definition. Suggested by - Stefan Monnier . + (tramp-drop-volume-letter): Simplify definition. + Suggested by Stefan Monnier . 2011-08-30 Stefan Monnier 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." (column 0) (rows (/ (length strings) columns)) (row 0) + (first t) (laststring nil)) ;; The insertion should be "sensible" no matter what choices were made ;; for the parameters above. (dolist (str strings) (unless (equal laststring str) ; Remove (consecutive) duplicates. (setq laststring str) + ;; FIXME: `string-width' doesn't pay attention to + ;; `display' properties. (let ((length (if (consp str) (+ (string-width (car str)) (string-width (cadr str))) @@ -1100,11 +1103,11 @@ It also eliminates runs of equal strings." (forward-line 1) (end-of-line))) (insert " \t") - (set-text-properties (- (point) 1) (point) + (set-text-properties (1- (point)) (point) `(display (space :align-to ,column))))) (t ;; Horizontal format - (unless (bolp) + (unless first (if (< wwidth (+ (max colwidth length) column)) ;; No space for `str' at point, move to next line. (progn (insert "\n") (setq column 0)) @@ -1112,12 +1115,13 @@ It also eliminates runs of equal strings." ;; Leave the space unpropertized so that in the case we're ;; already past the goal column, there is still ;; a space displayed. - (set-text-properties (- (point) 1) (point) + (set-text-properties (1- (point)) (point) ;; We can't just set tab-width, because ;; completion-setup-function will kill ;; all local variables :-( `(display (space :align-to ,column))) nil)))) + (setq first nil) (if (not (consp str)) (put-text-property (point) (progn (insert str) (point)) 'mouse-face 'highlight)