emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emphasize the character to be typed next in *Completions*


From: Juri Linkov
Subject: Re: Emphasize the character to be typed next in *Completions*
Date: Thu, 15 Apr 2004 21:25:36 +0300
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

Masatake YAMATO <address@hidden> writes:
>> However, looking at these names, it seems to me that maybe they should
>> be changed to `completions-common-part' and
>> `completions-first-difference'.  That says where they are used, which
>> is more useful; whether to use them for emphasis or counteremphasis is
>> then up to the user.  Do you agree?
>
> I completely agree with you. If no objection, I will install the improved
> version in a few days.

I agree that new names are better because they more clearly represent
the essence of these faces.  However, their docstrings should also
suggest their possible use.

BTW, this feature sometimes fails in the *Completions* buffer.

For example, type

    M-x info RET
    g (/usr/share/ TAB

with a sufficiently long directory path and it fails with the following bt:

Debugger entered--Lisp error: (args-out-of-range 4505 4505)
  get-char-property(4505 mouse-face)
  (and (get-char-property element-start (quote mouse-face)) (get-char-property 
element-common-end (quote mouse-face)))
  (if (and (get-char-property element-start ...) (get-char-property 
element-common-end ...)) (progn (put-text-property element-start 
element-common-end ... ...) (put-text-property element-common-end ... ... ...)))
  (when (and (get-char-property element-start ...) (get-char-property 
element-common-end ...)) (put-text-property element-start element-common-end 
(quote font-lock-face) (quote completion-de-emphasis)) (put-text-property 
element-common-end (1+ element-common-end) (quote font-lock-face) (quote 
completion-emphasis)))
  (while element-start (setq element-common-end (+ element-start 
common-string-length)) (when (and ... ...) (put-text-property element-start 
element-common-end ... ...) (put-text-property element-common-end ... ... ...)) 
(setq element-start (next-single-property-change element-start ...)))
  (let ((common-string-length ...) (element-start ...) element-common-end) 
(while element-start (setq element-common-end ...) (when ... ... ...) (setq 
element-start ...)))
  (progn (let (... ... element-common-end) (while element-start ... ... ...)))
  (if completion-base-size (progn (let ... ...)))
  (when completion-base-size (let (... ... element-common-end) (while 
element-start ... ... ...)))
  (let ((mainbuf ...) (mbuf-contents ...)) (if minibuffer-completing-file-name 
(with-current-buffer mainbuf ...)) (set-buffer standard-output) 
(completion-list-mode) (make-local-variable (quote 
completion-reference-buffer)) (setq completion-reference-buffer mainbuf) (if 
minibuffer-completing-file-name (setq completion-base-size ...) 
(save-match-data ...)) (when completion-base-size (let ... ...)) (goto-char 
(point-min)) (if (display-mouse-p) (insert ...)) (insert 
(substitute-command-keys "In this buffer, type \\[choose-completion] to select 
the completion near point.\n\n")))
  (save-excursion (let (... ...) (if minibuffer-completing-file-name ...) 
(set-buffer standard-output) (completion-list-mode) (make-local-variable ...) 
(setq completion-reference-buffer mainbuf) (if minibuffer-completing-file-name 
... ...) (when completion-base-size ...) (goto-char ...) (if ... ...) (insert 
...)))
  completion-setup-function()
  run-hooks(completion-setup-hook)
  minibuffer-complete()
  call-interactively(minibuffer-complete)
  completing-read("Go to node: " Info-read-node-name-1 nil t)
  (let* ((completion-ignore-case t) (Info-read-node-completion-table ...) 
(nodename ...)) (if (equal nodename "") (or default ...) nodename))
  Info-read-node-name("Go to node: ")
  (list (Info-read-node-name "Go to node: ") current-prefix-arg)
  call-interactively(Info-goto-node)

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]