aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2004-08-07 16:47:41 +0000
committerEli Zaretskii2004-08-07 16:47:41 +0000
commitabaf2e77e7ba11af0daa8989b2b0a2eb136d649b (patch)
tree8cc00c2b33c40ee051aa7e6e1054996e4b0bfeb8
parent8bd6323a8fc6886ed4bb5d2010391dbe0751e8f1 (diff)
downloademacs-abaf2e77e7ba11af0daa8989b2b0a2eb136d649b.tar.gz
emacs-abaf2e77e7ba11af0daa8989b2b0a2eb136d649b.zip
(completion-root-regexp): New defvar.
(completion-setup-function): Use it instead of a literal string.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/simple.el8
2 files changed, 12 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index eaaf7b35c3d..c59e0003f94 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12004-08-07 Satyaki Das <satyaki@theforce.stanford.edu> (tiny change)
2
3 * simple.el (completion-root-regexp): New defvar.
4 (completion-setup-function): Use it instead of a literal string.
5
12004-08-07 John Paul Wallington <jpw@gnu.org> 62004-08-07 John Paul Wallington <jpw@gnu.org>
2 7
3 * emacs-lisp/re-builder.el (reb-re-syntax): Add `rx' syntax. 8 * emacs-lisp/re-builder.el (reb-re-syntax): Add `rx' syntax.
diff --git a/lisp/simple.el b/lisp/simple.el
index 1e112b1be74..b52220d542b 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -4304,6 +4304,12 @@ make the common parts less visible than normal, so that the rest
4304of the differing parts is, by contrast, slightly highlighted." 4304of the differing parts is, by contrast, slightly highlighted."
4305 :group 'completion) 4305 :group 'completion)
4306 4306
4307;; This is for packages that need to bind it to a non-default regexp
4308;; in order to make the first-differing character highlight work
4309;; to their liking
4310(defvar completion-root-regexp "^/"
4311 "Regexp to use in `completion-setup-function' to find the root directory.")
4312
4307(defun completion-setup-function () 4313(defun completion-setup-function ()
4308 (let ((mainbuf (current-buffer)) 4314 (let ((mainbuf (current-buffer))
4309 (mbuf-contents (minibuffer-contents))) 4315 (mbuf-contents (minibuffer-contents)))
@@ -4332,7 +4338,7 @@ of the differing parts is, by contrast, slightly highlighted."
4332 (with-current-buffer mainbuf 4338 (with-current-buffer mainbuf
4333 (save-excursion 4339 (save-excursion
4334 (goto-char (point-max)) 4340 (goto-char (point-max))
4335 (skip-chars-backward "^/") 4341 (skip-chars-backward completion-root-regexp)
4336 (- (point) (minibuffer-prompt-end))))) 4342 (- (point) (minibuffer-prompt-end)))))
4337 ;; Otherwise, in minibuffer, the whole input is being completed. 4343 ;; Otherwise, in minibuffer, the whole input is being completed.
4338 (if (minibufferp mainbuf) 4344 (if (minibufferp mainbuf)