[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emphasize the character to be typed next in *Completions*
From: |
Kim F. Storm |
Subject: |
Re: Emphasize the character to be typed next in *Completions* |
Date: |
23 Mar 2004 01:14:25 +0100 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
Richard Stallman <address@hidden> writes:
> That could be a clever idea. Others: do you like this feature?
>
I like the idea, but I'm less positive with the actual choice. I've
been experimenting with some of the other options proposed. Here is
my preferred method:
*** simple.el.~1.633.~ 2004-03-18 13:01:21.000000000 +0100
--- simple.el 2004-03-23 01:13:19.000000000 +0100
***************
*** 4145,4150 ****
--- 4145,4165 ----
(save-match-data
(if (minibufferp mainbuf)
(setq completion-base-size 0))))
+ ;; Emphasis the first uncommon character in completions.
+ (if (and completion-base-size
+ (boundp 'font-lock-comment-face))
+ (let ((common-string-length
+ (length (substring mbuf-contents completion-base-size)))
+ (element-start (next-single-property-change (point-min)
'mouse-face))
+ element-common-start)
+ (while element-start
+ (setq element-common-start (+ element-start common-string-length))
+ (when (and (get-char-property element-start 'mouse-face)
+ (get-char-property element-common-start 'mouse-face))
+ (put-text-property element-start element-common-start
+ 'face 'font-lock-comment-face))
+ (setq element-start (next-single-property-change element-start
'mouse-face)))))
+ ;; Insert help string.
(goto-char (point-min))
(if (display-mouse-p)
(insert (substitute-command-keys
--
Kim F. Storm <address@hidden> http://www.cua.dk
- Emphasize the character to be typed next in *Completions*, Masatake YAMATO, 2004/03/21
- Re: Emphasize the character to be typed next in *Completions*, Lars Hansen, 2004/03/22
- Re: Emphasize the character to be typed next in *Completions*, Richard Stallman, 2004/03/22
- Re: Emphasize the character to be typed next in *Completions*, Masatake YAMATO, 2004/03/23
- Re: Emphasize the character to be typed next in *Completions*, Kim F. Storm, 2004/03/23
- Re: Emphasize the character to be typed next in *Completions*, Stefan Monnier, 2004/03/23