changeset 56613:05c3cf703d59

(completion-root-regexp): New defvar. (completion-setup-function): Use it instead of a literal string.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 07 Aug 2004 16:45:24 +0000
parents f139a56bb0f0
children 9a3481cbb263
files lisp/simple.el
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/simple.el	Sat Aug 07 12:03:54 2004 +0000
+++ b/lisp/simple.el	Sat Aug 07 16:45:24 2004 +0000
@@ -4304,6 +4304,12 @@
 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 @@
 		(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)