emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r105636: * lisp/minibuffer.el (comple


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r105636: * lisp/minibuffer.el (completion--insert-strings): Don't get confused by
Date: Thu, 01 Sep 2011 20:36:58 -0400
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 105636
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Thu 2011-09-01 20:36:58 -0400
message:
  * lisp/minibuffer.el (completion--insert-strings): Don't get confused by
  completion entries that end with an LF char.
modified:
  lisp/ChangeLog
  lisp/minibuffer.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-09-01 17:51:42 +0000
+++ b/lisp/ChangeLog    2011-09-02 00:36:58 +0000
@@ -1,3 +1,8 @@
+2011-09-02  Stefan Monnier  <address@hidden>
+
+       * minibuffer.el (completion--insert-strings): Don't get confused by
+       completion entries that end with an LF char.
+
 2011-09-01  Eli Zaretskii  <address@hidden>
 
        * window.el (frame-auto-delete, window-deletable-p): Doc fix.
@@ -5,11 +10,11 @@
 2011-09-01  Chong Yidong  <address@hidden>
 
        * 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  <address@hidden>
 
@@ -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 <address@hidden>.
+       (tramp-drop-volume-letter): Simplify definition.
+       Suggested by Stefan Monnier <address@hidden>.
 
 2011-08-30  Stefan Monnier  <address@hidden>
 

=== modified file 'lisp/minibuffer.el'
--- a/lisp/minibuffer.el        2011-08-22 12:58:37 +0000
+++ b/lisp/minibuffer.el        2011-09-02 00:36:58 +0000
@@ -1076,12 +1076,15 @@
            (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 @@
                    (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 @@
                  ;; 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)


reply via email to

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