emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/lisp ChangeLog minibuffer.el


From: Stefan Monnier
Subject: [Emacs-diffs] emacs/lisp ChangeLog minibuffer.el
Date: Tue, 06 Jan 2009 04:17:11 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        09/01/06 04:17:11

Modified files:
        lisp           : ChangeLog minibuffer.el 

Log message:
        (completion-hilit-commonality): Don't presume
        all-completions always include the input as prefix.
        (completion-pcm--pattern-trivial-p): Accept a few more patterns
        as trivial.
        (completion-pcm--hilit-commonality): Remove leftover code that used to
        deal with the now removed cdr-in-last-cons.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.15050&r2=1.15051
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/minibuffer.el?cvsroot=emacs&r1=1.66&r2=1.67

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.15050
retrieving revision 1.15051
diff -u -b -r1.15050 -r1.15051
--- ChangeLog   6 Jan 2009 02:05:34 -0000       1.15050
+++ ChangeLog   6 Jan 2009 04:17:04 -0000       1.15051
@@ -1,11 +1,20 @@
+2009-01-06  Stefan Monnier  <address@hidden>
+
+       * minibuffer.el (completion-hilit-commonality): Don't presume
+       all-completions always include the input as prefix.
+       (completion-pcm--pattern-trivial-p): Accept a few more patterns
+       as trivial.
+       (completion-pcm--hilit-commonality): Remove leftover code that used to
+       deal with the now removed cdr-in-last-cons.
+
 2009-01-06  Juanma Barranquero  <address@hidden>
 
        * international/mule.el (define-coding-system): Fix typos in docstring.
 
 2009-01-05  Alan Mackenzie  <address@hidden>
 
-       * progmodes/cc-styles.el (c-setup-paragraph-variables): Ensure
-       paragraph-\(start\|separate\) match blank lines.  For AWK Mode.
+       * progmodes/cc-styles.el (c-setup-paragraph-variables):
+       Ensure paragraph-\(start\|separate\) match blank lines.  For AWK Mode.
 
 2009-01-05  Michael Albinus  <address@hidden>
 
@@ -90,34 +99,31 @@
        (tramp-prefix-domain-regexp, tramp-domain-regexp)
        (tramp-user-with-domain-regexp, tramp-prefix-ipv6-format)
        (tramp-prefix-ipv6-regexp, tramp-ipv6-regexp)
-       (tramp-postfix-ipv6-format, tramp-postfix-ipv6-regexp): New
-       defconst.
+       (tramp-postfix-ipv6-format, tramp-postfix-ipv6-regexp): New defconst.
        (tramp-file-name-structure, tramp-file-name-regexp-unified)
        (tramp-completion-dissect-file-name, tramp-parse-hosts-group)
        (tramp-dissect-file-name, tramp-make-tramp-file-name)
        (tramp-completion-make-tramp-file-name): Handle IPv6 addresses.
        (tramp-handle-insert-file-contents): Fix setting of
        `buffer-read-only'.
-       (tramp-compute-multi-hops, tramp-local-host-p): Use
-       `tramp-local-host-regexp'.
-       (tramp-file-name-real-user, tramp-file-name-domain): Use
-       `tramp-user-with-domain-regexp'.
+       (tramp-compute-multi-hops, tramp-local-host-p):
+       Use `tramp-local-host-regexp'.
+       (tramp-file-name-real-user, tramp-file-name-domain):
+       Use `tramp-user-with-domain-regexp'.
 
        * net/tramp-smb.el (top): Use `tramp-prefix-domain-regexp'.
-       (tramp-smb-maybe-open-connection): Use `tramp-file-name-*'
-       methods.
+       (tramp-smb-maybe-open-connection): Use `tramp-file-name-*' methods.
 
 2009-01-03  Roland Winkler  <address@hidden>
 
        * proced.el (proced-grammar-alist): Refiner can be a
        list (function help-echo) instead of a cons pair.
        (proced-post-display-hook): New variable.
-       (proced-tree-depth): Renamed from proced-tree-indent.
+       (proced-tree-depth): Rename from proced-tree-indent.
        (proced-mode): Derive mode from special-mode.
-       (proced-mode-map): Changed accordingly.
+       (proced-mode-map): Change accordingly.
        (proced, proced-update): Run proced-post-display-hook.
-       (proced-do-mark-all): Count processes for which mark has been
-       updated.
+       (proced-do-mark-all): Count processes for which mark has been updated.
        (proced-format): Check for ppid attribute.
        (proced-process-attributes): Take time and ctime attribute from
        system-process-attributes.

Index: minibuffer.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/minibuffer.el,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -b -r1.66 -r1.67
--- minibuffer.el       5 Jan 2009 03:19:33 -0000       1.66
+++ minibuffer.el       6 Jan 2009 04:17:10 -0000       1.67
@@ -789,7 +789,11 @@
                      (car (setq elem (cons (copy-sequence (car elem))
                                            (cdr elem))))
                    (setq elem (copy-sequence elem)))))
-            (put-text-property 0 com-str-len
+            (put-text-property 0
+                              ;; If completion-boundaries returns incorrect
+                              ;; values, all-completions may return strings
+                              ;; that don't contain the prefix.
+                              (min com-str-len (length str))
                                'font-lock-face 'completions-common-part
                                str)
             (if (> (length str) com-str-len)
@@ -1333,7 +1337,13 @@
   :type 'string)
 
 (defun completion-pcm--pattern-trivial-p (pattern)
-  (and (stringp (car pattern)) (null (cdr pattern))))
+  (and (stringp (car pattern))
+       ;; It can be followed by `point' and "" and still be trivial.
+       (let ((trivial t))
+        (dolist (elem (cdr pattern))
+          (unless (member elem '(point ""))
+            (setq trivial nil)))
+        trivial)))
 
 (defun completion-pcm--string->pattern (string &optional point)
   "Split STRING into a pattern.
@@ -1411,12 +1421,8 @@
 (defun completion-pcm--hilit-commonality (pattern completions)
   (when completions
     (let* ((re (completion-pcm--pattern->regex pattern '(point)))
-           (case-fold-search completion-ignore-case)
-           (last (last completions))
-           (base-size (cdr last)))
+           (case-fold-search completion-ignore-case))
       ;; Remove base-size during mapcar, and add it back later.
-      (setcdr last nil)
-      (nconc
        (mapcar
         (lambda (str)
           ;; Don't modify the string itself.
@@ -1432,8 +1438,7 @@
                                    'font-lock-face 
'completions-first-difference
                                    str)))
           str)
-        completions)
-       base-size))))
+       completions))))
 
 (defun completion-pcm--find-all-completions (string table pred point
                                                     &optional filter)




reply via email to

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