]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/minibuffer.el (completion--insert-strings): Don't get confused by
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 2 Sep 2011 00:36:58 +0000 (20:36 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 2 Sep 2011 00:36:58 +0000 (20:36 -0400)
completion entries that end with an LF char.

lisp/ChangeLog
lisp/minibuffer.el

index a306f697c60104e61635cbaa35d40ce29619eb95..a7d2083f4b1327a31598c1ceb1622c994116f902 100644 (file)
@@ -1,3 +1,8 @@
+2011-09-02  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * minibuffer.el (completion--insert-strings): Don't get confused by
+       completion entries that end with an LF char.
+
 2011-09-01  Eli Zaretskii  <eliz@gnu.org>
 
        * window.el (frame-auto-delete, window-deletable-p): Doc fix.
 2011-09-01  Chong Yidong  <cyd@stupidchicken.com>
 
        * 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  <michael.albinus@gmx.de>
 
        (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 <monnier@iro.umontreal.ca>.
+       (tramp-drop-volume-letter): Simplify definition.
+       Suggested by Stefan Monnier <monnier@iro.umontreal.ca>.
 
 2011-08-30  Stefan Monnier  <monnier@iro.umontreal.ca>
 
index 313298de97eaf437ce1e4725f2ea6ecfc638b3ff..820b1599abbc3d41472bb93c9d6443c0a8ae1405 100644 (file)
@@ -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)