4304 |
of the differing parts is, by contrast, slightly highlighted." |
of the differing parts is, by contrast, slightly highlighted." |
4305 |
:group 'completion) |
:group 'completion) |
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 |
|
|
4313 |
(defun completion-setup-function () |
(defun completion-setup-function () |
4314 |
(let ((mainbuf (current-buffer)) |
(let ((mainbuf (current-buffer)) |
4315 |
(mbuf-contents (minibuffer-contents))) |
(mbuf-contents (minibuffer-contents))) |
4338 |
(with-current-buffer mainbuf |
(with-current-buffer mainbuf |
4339 |
(save-excursion |
(save-excursion |
4340 |
(goto-char (point-max)) |
(goto-char (point-max)) |
4341 |
(skip-chars-backward "^/") |
(skip-chars-backward completion-root-regexp) |
4342 |
(- (point) (minibuffer-prompt-end))))) |
(- (point) (minibuffer-prompt-end))))) |
4343 |
;; Otherwise, in minibuffer, the whole input is being completed. |
;; Otherwise, in minibuffer, the whole input is being completed. |
4344 |
(if (minibufferp mainbuf) |
(if (minibufferp mainbuf) |