+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.
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)))
(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)