From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Emphasize the character to be typed next in *Completions* Date: Tue, 23 Mar 2004 20:38:19 +0200 Organization: JURTA Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <871xnj4des.fsf@mail.jurta.org> References: <20040322053942.03A2467DC4@imf.math.ku.dk> <405EB27E.6020904@math.ku.dk> <20040322.185510.266153697.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 1080067475 26951 80.91.224.253 (23 Mar 2004 18:44:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 23 Mar 2004 18:44:35 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Mar 23 19:44:28 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 1B5qt2-0003xw-00 for ; Tue, 23 Mar 2004 19:44:28 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1B5qt1-0001Bc-00 for ; Tue, 23 Mar 2004 19:44:27 +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 1B5qt3-0004RC-8S for emacs-devel@quimby.gnus.org; Tue, 23 Mar 2004 13:44:29 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1B5qsR-00049k-TK for emacs-devel@gnu.org; Tue, 23 Mar 2004 13:43:51 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1B5qrr-0003O9-9b for emacs-devel@gnu.org; Tue, 23 Mar 2004 13:43:46 -0500 Original-Received: from [66.33.219.6] (helo=knife.dreamhost.com) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B5qqn-0002cl-BW for emacs-devel@gnu.org; Tue, 23 Mar 2004 13:42:09 -0500 Original-Received: from mail.jurta.org (80-235-40-249-dsl.mus.estpak.ee [80.235.40.249]) by knife.dreamhost.com (Postfix) with ESMTP id 3DF3FE403D; Tue, 23 Mar 2004 10:41:55 -0800 (PST) Original-To: bob@rattlesnake.com In-Reply-To: (Robert J. Chassell's message of "Tue, 23 Mar 2004 14:29:22 +0000 (UTC)") User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) 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:20812 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:20812 "Robert J. Chassell" writes: > Please do not think in terms of any single characteristic such as > `bold'. Not everyone uses the same monitor you do. > > I never use bold because it looks bad on the monitor I mostly use. I fully agree that developers can't make assumptions about user's display characteristics. For example, bold faces are hardly readable with small font sizes. To be able to remove bold properties from all used faces and to make other transformations that fit faces into used displays, I propose to add a new hook `custom-define-face-hook'. Note that existing hook `custom-define-hook' can't be used because it's called too often (from defcustom and defgroup). Example of usage: (defun my-fonts-set (&optional frame) (mapc (lambda (face) ;; My font makes bold texts unreadable, ;; so remove bold property from every face (when (face-bold-p face frame) (set-face-bold-p face nil frame) (set-face-underline-p face t frame)) ;; Fonts with different height decrease the amount of lines ;; visible on screen, so remove the height properties (when (numberp (face-attribute face :height frame)) (set-face-attribute face frame :height 'unspecified)) ;; Fonts with different width decrease the amount of characters ;; on the line, so remove the width properties (when (numberp (face-attribute face :width frame)) (set-face-attribute face frame :width 'unspecified))) (face-list))) (add-to-list 'custom-define-face-hook 'my-fonts-set) Any objections to this patch? Index: emacs/lisp/cus-face.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/cus-face.el,v retrieving revision 1.33 diff -c -r1.33 cus-face.el *** emacs/lisp/cus-face.el 1 Sep 2003 15:45:09 -0000 1.33 --- emacs/lisp/cus-face.el 23 Mar 2004 18:10:16 -0000 *************** *** 32,37 **** --- 32,40 ---- ;;; Declaring a face. + (defvar custom-define-face-hook nil + "Hook called after defining face.") + ;;;###autoload (defun custom-declare-face (face spec doc &rest args) "Like `defface', but FACE is evaluated as a normal argument." *************** *** 57,63 **** (when (and doc (null (face-documentation face))) (set-face-documentation face (purecopy doc))) (custom-handle-all-keywords face args 'custom-face) ! (run-hooks 'custom-define-hook)) face) ;;; Face attributes. --- 60,67 ---- (when (and doc (null (face-documentation face))) (set-face-documentation face (purecopy doc))) (custom-handle-all-keywords face args 'custom-face) ! (run-hooks 'custom-define-hook) ! (run-hooks 'custom-define-face-hook)) face) ;;; Face attributes. -- Juri Linkov http://www.jurta.org/emacs/