[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 ----
          (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) 
+               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 
+       ;; Insert help string.
        (goto-char (point-min))
        (if (display-mouse-p)
          (insert (substitute-command-keys

Kim F. Storm <address@hidden> http://www.cua.dk

reply via email to

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