[Top][All Lists]
[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: |
Thu, 22 Oct 2009 16:14:53 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Stefan Monnier <monnier> 09/10/22 16:14:53
Modified files:
lisp : ChangeLog minibuffer.el
Log message:
(completion-table-with-terminator): Allow to specify the
terminator-regexp.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.16478&r2=1.16479
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/minibuffer.el?cvsroot=emacs&r1=1.89&r2=1.90
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.16478
retrieving revision 1.16479
diff -u -b -r1.16478 -r1.16479
--- ChangeLog 22 Oct 2009 15:27:17 -0000 1.16478
+++ ChangeLog 22 Oct 2009 16:14:49 -0000 1.16479
@@ -1,5 +1,8 @@
2009-10-22 Stefan Monnier <address@hidden>
+ * minibuffer.el (completion-table-with-terminator): Allow to specify
+ the terminator-regexp.
+
* simple.el (switch-to-completions): Look for *Completions* in other
frames as well.
Index: minibuffer.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/minibuffer.el,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -b -r1.89 -r1.90
--- minibuffer.el 21 Oct 2009 20:04:02 -0000 1.89
+++ minibuffer.el 22 Oct 2009 16:14:52 -0000 1.90
@@ -200,16 +200,24 @@
and TABLE only (via `apply-partially').
TABLE is a completion table, and TERMINATOR is a string appended to TABLE's
completion if it is complete. TERMINATOR is also used to determine the
-completion suffix's boundary."
+completion suffix's boundary.
+TERMINATOR can also be a cons cell (TERMINATOR . TERMINATOR-REGEXP)
+in which case TERMINATOR-REGEXP is a regular expression whose submatch
+number 1 should match TERMINATOR. This is used when there is a need to
+distinguish occurrences of the TERMINATOR strings which are really terminators
+from others (e.g. escaped)."
(cond
((eq (car-safe action) 'boundaries)
(let* ((suffix (cdr action))
(bounds (completion-boundaries string table pred suffix))
- (max (string-match (regexp-quote terminator) suffix)))
+ (terminator-regexp (if (consp terminator)
+ (cdr terminator) (regexp-quote terminator)))
+ (max (string-match terminator-regexp suffix)))
(list* 'boundaries (car bounds)
(min (cdr bounds) (or max (length suffix))))))
((eq action nil)
(let ((comp (try-completion string table pred)))
+ (if (consp terminator) (setq terminator (car terminator)))
(if (eq comp t)
(concat string terminator)
(if (and (stringp comp)