From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: Emphasize the character to be typed next in *Completions* Date: 23 Mar 2004 01:14:25 +0100 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <20040322.001321.112307618.jet@gyve.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1079997804 19508 80.91.224.253 (22 Mar 2004 23:23:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 22 Mar 2004 23:23:24 +0000 (UTC) Cc: Masatake YAMATO , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Mar 23 00:23:16 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1B5YlI-0004yD-00 for ; Tue, 23 Mar 2004 00:23:16 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1B5YlH-0004Bg-00 for ; Tue, 23 Mar 2004 00:23:15 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B5Yk2-0005Z9-Qz for emacs-devel@quimby.gnus.org; Mon, 22 Mar 2004 18:21:58 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1B5Yjf-0005TF-4g for emacs-devel@gnu.org; Mon, 22 Mar 2004 18:21:35 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1B5Yj7-0005IX-V5 for emacs-devel@gnu.org; Mon, 22 Mar 2004 18:21:33 -0500 Original-Received: from [195.41.46.235] (helo=pfepa.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B5YdF-0003r3-4t; Mon, 22 Mar 2004 18:14:57 -0500 Original-Received: from kfs-l.imdomain.dk.cua.dk (0x503e2644.bynxx3.adsl-dhcp.tele.dk [80.62.38.68]) by pfepa.post.tele.dk (Postfix) with SMTP id 637A947FE67; Tue, 23 Mar 2004 00:14:44 +0100 (CET) Original-To: rms@gnu.org In-Reply-To: Original-Lines: 38 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:20749 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:20749 Richard Stallman 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 http://www.cua.dk