[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Patch for completion-setup-function
From: |
Kevin Rodgers |
Subject: |
Re: Patch for completion-setup-function |
Date: |
Mon, 26 Jul 2004 17:58:46 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 |
Satyaki Das wrote:
> Recently, I noticed the nifty highlighting for the first letter
> that differs among the available choices during file completion.
> This feature doesn't work perfectly for MH-E folder completion
> since the regexp to recognize the root is hardcoded.
>
> The attached patch to simple.el changes this. If this patch were
> applied then I could just bind the variable and make the
> highlighting work better in MH-E.
completion-root-regexp should be renamed to something like
completion-root-chars, since it's not a true regexp.
Or perhaps it could be defined as a regexp and skipped via
re-search-backward.
> Index: simple.el
> ===================================================================
> RCS file: /cvsroot/emacs/emacs/lisp/simple.el,v
> retrieving revision 1.651
> diff -u -r1.651 simple.el
> --- simple.el 23 Jul 2004 11:52:03 -0000 1.651
> +++ simple.el 25 Jul 2004 18:26:52 -0000
> @@ -4304,6 +4304,8 @@
> of the differing parts is, by contrast, slightly highlighted."
> :group 'completion)
>
> +(defvar completion-root-regexp "^/")
> +
> (defun completion-setup-function ()
> (let ((mainbuf (current-buffer))
> (mbuf-contents (minibuffer-contents)))
> @@ -4332,7 +4334,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)
--
Kevin Rodgers