diff options
| author | Stefan Monnier | 2009-01-06 04:17:04 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2009-01-06 04:17:04 +0000 |
| commit | 1bba1cfc46bc13ee9be30614086b7005d5a0c1df (patch) | |
| tree | c059ef99c561dcbc02adfb3c6d54121a4f58aff9 | |
| parent | 8d5e14a9c7098f476e7a6716e22016e88f39c5bd (diff) | |
| download | emacs-1bba1cfc46bc13ee9be30614086b7005d5a0c1df.tar.gz emacs-1bba1cfc46bc13ee9be30614086b7005d5a0c1df.zip | |
(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.
| -rw-r--r-- | lisp/ChangeLog | 34 | ||||
| -rw-r--r-- | lisp/minibuffer.el | 53 |
2 files changed, 49 insertions, 38 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bd394143d9a..5267a905bdc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,11 +1,20 @@ | |||
| 1 | 2009-01-06 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * minibuffer.el (completion-hilit-commonality): Don't presume | ||
| 4 | all-completions always include the input as prefix. | ||
| 5 | (completion-pcm--pattern-trivial-p): Accept a few more patterns | ||
| 6 | as trivial. | ||
| 7 | (completion-pcm--hilit-commonality): Remove leftover code that used to | ||
| 8 | deal with the now removed cdr-in-last-cons. | ||
| 9 | |||
| 1 | 2009-01-06 Juanma Barranquero <lekktu@gmail.com> | 10 | 2009-01-06 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 11 | ||
| 3 | * international/mule.el (define-coding-system): Fix typos in docstring. | 12 | * international/mule.el (define-coding-system): Fix typos in docstring. |
| 4 | 13 | ||
| 5 | 2009-01-05 Alan Mackenzie <acm@muc.de> | 14 | 2009-01-05 Alan Mackenzie <acm@muc.de> |
| 6 | 15 | ||
| 7 | * progmodes/cc-styles.el (c-setup-paragraph-variables): Ensure | 16 | * progmodes/cc-styles.el (c-setup-paragraph-variables): |
| 8 | paragraph-\(start\|separate\) match blank lines. For AWK Mode. | 17 | Ensure paragraph-\(start\|separate\) match blank lines. For AWK Mode. |
| 9 | 18 | ||
| 10 | 2009-01-05 Michael Albinus <michael.albinus@gmx.de> | 19 | 2009-01-05 Michael Albinus <michael.albinus@gmx.de> |
| 11 | 20 | ||
| @@ -90,34 +99,31 @@ | |||
| 90 | (tramp-prefix-domain-regexp, tramp-domain-regexp) | 99 | (tramp-prefix-domain-regexp, tramp-domain-regexp) |
| 91 | (tramp-user-with-domain-regexp, tramp-prefix-ipv6-format) | 100 | (tramp-user-with-domain-regexp, tramp-prefix-ipv6-format) |
| 92 | (tramp-prefix-ipv6-regexp, tramp-ipv6-regexp) | 101 | (tramp-prefix-ipv6-regexp, tramp-ipv6-regexp) |
| 93 | (tramp-postfix-ipv6-format, tramp-postfix-ipv6-regexp): New | 102 | (tramp-postfix-ipv6-format, tramp-postfix-ipv6-regexp): New defconst. |
| 94 | defconst. | ||
| 95 | (tramp-file-name-structure, tramp-file-name-regexp-unified) | 103 | (tramp-file-name-structure, tramp-file-name-regexp-unified) |
| 96 | (tramp-completion-dissect-file-name, tramp-parse-hosts-group) | 104 | (tramp-completion-dissect-file-name, tramp-parse-hosts-group) |
| 97 | (tramp-dissect-file-name, tramp-make-tramp-file-name) | 105 | (tramp-dissect-file-name, tramp-make-tramp-file-name) |
| 98 | (tramp-completion-make-tramp-file-name): Handle IPv6 addresses. | 106 | (tramp-completion-make-tramp-file-name): Handle IPv6 addresses. |
| 99 | (tramp-handle-insert-file-contents): Fix setting of | 107 | (tramp-handle-insert-file-contents): Fix setting of |
| 100 | `buffer-read-only'. | 108 | `buffer-read-only'. |
| 101 | (tramp-compute-multi-hops, tramp-local-host-p): Use | 109 | (tramp-compute-multi-hops, tramp-local-host-p): |
| 102 | `tramp-local-host-regexp'. | 110 | Use `tramp-local-host-regexp'. |
| 103 | (tramp-file-name-real-user, tramp-file-name-domain): Use | 111 | (tramp-file-name-real-user, tramp-file-name-domain): |
| 104 | `tramp-user-with-domain-regexp'. | 112 | Use `tramp-user-with-domain-regexp'. |
| 105 | 113 | ||
| 106 | * net/tramp-smb.el (top): Use `tramp-prefix-domain-regexp'. | 114 | * net/tramp-smb.el (top): Use `tramp-prefix-domain-regexp'. |
| 107 | (tramp-smb-maybe-open-connection): Use `tramp-file-name-*' | 115 | (tramp-smb-maybe-open-connection): Use `tramp-file-name-*' methods. |
| 108 | methods. | ||
| 109 | 116 | ||
| 110 | 2009-01-03 Roland Winkler <Roland.Winkler@physik.uni-erlangen.de> | 117 | 2009-01-03 Roland Winkler <Roland.Winkler@physik.uni-erlangen.de> |
| 111 | 118 | ||
| 112 | * proced.el (proced-grammar-alist): Refiner can be a | 119 | * proced.el (proced-grammar-alist): Refiner can be a |
| 113 | list (function help-echo) instead of a cons pair. | 120 | list (function help-echo) instead of a cons pair. |
| 114 | (proced-post-display-hook): New variable. | 121 | (proced-post-display-hook): New variable. |
| 115 | (proced-tree-depth): Renamed from proced-tree-indent. | 122 | (proced-tree-depth): Rename from proced-tree-indent. |
| 116 | (proced-mode): Derive mode from special-mode. | 123 | (proced-mode): Derive mode from special-mode. |
| 117 | (proced-mode-map): Changed accordingly. | 124 | (proced-mode-map): Change accordingly. |
| 118 | (proced, proced-update): Run proced-post-display-hook. | 125 | (proced, proced-update): Run proced-post-display-hook. |
| 119 | (proced-do-mark-all): Count processes for which mark has been | 126 | (proced-do-mark-all): Count processes for which mark has been updated. |
| 120 | updated. | ||
| 121 | (proced-format): Check for ppid attribute. | 127 | (proced-format): Check for ppid attribute. |
| 122 | (proced-process-attributes): Take time and ctime attribute from | 128 | (proced-process-attributes): Take time and ctime attribute from |
| 123 | system-process-attributes. | 129 | system-process-attributes. |
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 51e0358136b..364ee3d909f 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el | |||
| @@ -789,7 +789,11 @@ of the differing parts is, by contrast, slightly highlighted." | |||
| 789 | (car (setq elem (cons (copy-sequence (car elem)) | 789 | (car (setq elem (cons (copy-sequence (car elem)) |
| 790 | (cdr elem)))) | 790 | (cdr elem)))) |
| 791 | (setq elem (copy-sequence elem))))) | 791 | (setq elem (copy-sequence elem))))) |
| 792 | (put-text-property 0 com-str-len | 792 | (put-text-property 0 |
| 793 | ;; If completion-boundaries returns incorrect | ||
| 794 | ;; values, all-completions may return strings | ||
| 795 | ;; that don't contain the prefix. | ||
| 796 | (min com-str-len (length str)) | ||
| 793 | 'font-lock-face 'completions-common-part | 797 | 'font-lock-face 'completions-common-part |
| 794 | str) | 798 | str) |
| 795 | (if (> (length str) com-str-len) | 799 | (if (> (length str) com-str-len) |
| @@ -1333,7 +1337,13 @@ expression (not containing character ranges like `a-z')." | |||
| 1333 | :type 'string) | 1337 | :type 'string) |
| 1334 | 1338 | ||
| 1335 | (defun completion-pcm--pattern-trivial-p (pattern) | 1339 | (defun completion-pcm--pattern-trivial-p (pattern) |
| 1336 | (and (stringp (car pattern)) (null (cdr pattern)))) | 1340 | (and (stringp (car pattern)) |
| 1341 | ;; It can be followed by `point' and "" and still be trivial. | ||
| 1342 | (let ((trivial t)) | ||
| 1343 | (dolist (elem (cdr pattern)) | ||
| 1344 | (unless (member elem '(point "")) | ||
| 1345 | (setq trivial nil))) | ||
| 1346 | trivial))) | ||
| 1337 | 1347 | ||
| 1338 | (defun completion-pcm--string->pattern (string &optional point) | 1348 | (defun completion-pcm--string->pattern (string &optional point) |
| 1339 | "Split STRING into a pattern. | 1349 | "Split STRING into a pattern. |
| @@ -1411,29 +1421,24 @@ PATTERN is as returned by `completion-pcm--string->pattern'." | |||
| 1411 | (defun completion-pcm--hilit-commonality (pattern completions) | 1421 | (defun completion-pcm--hilit-commonality (pattern completions) |
| 1412 | (when completions | 1422 | (when completions |
| 1413 | (let* ((re (completion-pcm--pattern->regex pattern '(point))) | 1423 | (let* ((re (completion-pcm--pattern->regex pattern '(point))) |
| 1414 | (case-fold-search completion-ignore-case) | 1424 | (case-fold-search completion-ignore-case)) |
| 1415 | (last (last completions)) | ||
| 1416 | (base-size (cdr last))) | ||
| 1417 | ;; Remove base-size during mapcar, and add it back later. | 1425 | ;; Remove base-size during mapcar, and add it back later. |
| 1418 | (setcdr last nil) | 1426 | (mapcar |
| 1419 | (nconc | 1427 | (lambda (str) |
| 1420 | (mapcar | 1428 | ;; Don't modify the string itself. |
| 1421 | (lambda (str) | 1429 | (setq str (copy-sequence str)) |
| 1422 | ;; Don't modify the string itself. | 1430 | (unless (string-match re str) |
| 1423 | (setq str (copy-sequence str)) | 1431 | (error "Internal error: %s does not match %s" re str)) |
| 1424 | (unless (string-match re str) | 1432 | (let ((pos (or (match-beginning 1) (match-end 0)))) |
| 1425 | (error "Internal error: %s does not match %s" re str)) | 1433 | (put-text-property 0 pos |
| 1426 | (let ((pos (or (match-beginning 1) (match-end 0)))) | 1434 | 'font-lock-face 'completions-common-part |
| 1427 | (put-text-property 0 pos | 1435 | str) |
| 1428 | 'font-lock-face 'completions-common-part | 1436 | (if (> (length str) pos) |
| 1429 | str) | 1437 | (put-text-property pos (1+ pos) |
| 1430 | (if (> (length str) pos) | 1438 | 'font-lock-face 'completions-first-difference |
| 1431 | (put-text-property pos (1+ pos) | 1439 | str))) |
| 1432 | 'font-lock-face 'completions-first-difference | 1440 | str) |
| 1433 | str))) | 1441 | completions)))) |
| 1434 | str) | ||
| 1435 | completions) | ||
| 1436 | base-size)))) | ||
| 1437 | 1442 | ||
| 1438 | (defun completion-pcm--find-all-completions (string table pred point | 1443 | (defun completion-pcm--find-all-completions (string table pred point |
| 1439 | &optional filter) | 1444 | &optional filter) |