]> git.eshelyaron.com Git - emacs.git/commitdiff
(completion-root-regexp): New defvar.
authorEli Zaretskii <eliz@gnu.org>
Sat, 7 Aug 2004 16:47:41 +0000 (16:47 +0000)
committerEli Zaretskii <eliz@gnu.org>
Sat, 7 Aug 2004 16:47:41 +0000 (16:47 +0000)
(completion-setup-function): Use it instead of a literal string.

lisp/ChangeLog
lisp/simple.el

index eaaf7b35c3d097d07262ff14c0d35140118dd8f7..c59e0003f94de92b0127da287c8aecd0408ca56f 100644 (file)
@@ -1,3 +1,8 @@
+2004-08-07  Satyaki Das  <satyaki@theforce.stanford.edu>  (tiny change)
+
+       * simple.el (completion-root-regexp): New defvar.
+       (completion-setup-function): Use it instead of a literal string.
+
 2004-08-07  John Paul Wallington  <jpw@gnu.org>
 
        * emacs-lisp/re-builder.el (reb-re-syntax): Add `rx' syntax.
index 1e112b1be74f3f124b0ec1c3428fbf23529346d2..b52220d542b89308a49a9dd4f09dd7f8bbdac622 100644 (file)
@@ -4304,6 +4304,12 @@ make the common parts less visible than normal, so that the rest
 of the differing parts is, by contrast, slightly highlighted."
   :group 'completion)
 
+;; This is for packages that need to bind it to a non-default regexp
+;; in order to make the first-differing character highlight work
+;; to their liking
+(defvar completion-root-regexp "^/"
+  "Regexp to use in `completion-setup-function' to find the root directory.")
+
 (defun completion-setup-function ()
   (let ((mainbuf (current-buffer))
        (mbuf-contents (minibuffer-contents)))
@@ -4332,7 +4338,7 @@ of the differing parts is, by contrast, slightly highlighted."
                (with-current-buffer mainbuf
                  (save-excursion
                    (goto-char (point-max))
-                   (skip-chars-backward "^/")
+                   (skip-chars-backward completion-root-regexp)
                    (- (point) (minibuffer-prompt-end)))))
        ;; Otherwise, in minibuffer, the whole input is being completed.
        (if (minibufferp mainbuf)