From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Customizing faces with `defcustom' Date: Fri, 30 Dec 2005 08:29:42 +0200 Organization: JURTA Message-ID: <87zmmjxg1t.fsf@jurta.org> References: <43103F48.1020804@gmx.at> <4313F4CB.10200@gmx.at> <4375A332.6070000@gmx.at> <87fyperhgd.fsf@jurta.org> <438D5913.7030801@gmx.at> <43ABFA5C.2080302@gmx.at> <87y82afehi.fsf@jurta.org> <43B01C54.2040005@gmx.at> <87oe32fmt0.fsf@jurta.org> <43B26315.20005@gmx.at> <87acekpoho.fsf@jurta.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1135925399 1095 80.91.229.2 (30 Dec 2005 06:49:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 30 Dec 2005 06:49:59 +0000 (UTC) Cc: rudalics@gmx.at, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 30 07:49:56 2005 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EsE5J-0007Rn-G6 for ged-emacs-devel@m.gmane.org; Fri, 30 Dec 2005 07:49:54 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EsE6g-0006Ed-I4 for ged-emacs-devel@m.gmane.org; Fri, 30 Dec 2005 01:51:19 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EsE3i-00064B-0r for emacs-devel@gnu.org; Fri, 30 Dec 2005 01:48:14 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EsE3e-00063R-Hp for emacs-devel@gnu.org; Fri, 30 Dec 2005 01:48:11 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EsE3b-00062n-RV for emacs-devel@gnu.org; Fri, 30 Dec 2005 01:48:08 -0500 Original-Received: from [194.126.101.98] (helo=mail.neti.ee) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EsE44-0000Lc-7U; Fri, 30 Dec 2005 01:48:36 -0500 Original-Received: from mail.neti.ee (80-235-36-106-dsl.mus.estpak.ee [80.235.36.106]) by Relayhost1.neti.ee (Postfix) with ESMTP id 86004CF2F; Fri, 30 Dec 2005 08:46:56 +0200 (EET) Original-To: rms@gnu.org In-Reply-To: (Richard M. Stallman's message of "Thu, 29 Dec 2005 21:17:29 -0500") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) X-Virus-Scanned: by amavisd-new-2.2.1 (20041222) (Debian) at neti.ee X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:48541 Archived-At: > There should be a special separate face for the mode line. What would > be a good name for it? `mode-line-buffer'? This is too specific. > > `mode-line-buffer' would be a good name for a face used only to > highlight buffer names. But if we want something a little > more general, how about `mode-line-emphasis'? I now think the best name would be the same as the variable name whose propertized value is used in the mode-line to display buffer information. I mean the variable `mode-line-buffer-identification'. However, it is too long for the face name, and the suffix `-identification' or even a shorter one `-id' doesn't make the purpose of the face name clearer. Selecting a good face name will also set up a rule for naming more mode line faces that could be added after the release, e.g. (existing variable vs. new face name): mode-line-mule-info variable - mode-line-mule face mode-line-modified variable - mode-line-modified face mode-line-frame-identification variable - mode-line-frame face mode-line-position variable - mode-line-position face vc-mode variable - mode-line-vc-mode face mode-line-modes variable - mode-line-modes face ... So taking this into account, for now a good face name for buffer information in the mode line would be `mode-line-buffer'. In the patch below I added a new group `mode-line-faces' with the following faces belonging to it: mode-line mode-line-inactive mode-line-highlight mode-line-buffer (new face) display-time-mail-face Index: lisp/faces.el =================================================================== RCS file: /sources/emacs/emacs/lisp/faces.el,v retrieving revision 1.345 diff -c -r1.345 faces.el *** lisp/faces.el 11 Dec 2005 11:08:34 -0000 1.345 --- lisp/faces.el 30 Dec 2005 06:27:47 -0000 *************** *** 1932,1937 **** --- 1932,1943 ---- "Basic face for highlighting." :group 'basic-faces) + (defgroup mode-line-faces nil + "Faces used in the mode line." + :group 'modeline + :group 'faces + :version "22.1") + (defface mode-line-highlight '((((class color) (min-colors 88)) :box (:line-width 2 :color "grey40" :style released-button)) *************** *** 1939,1945 **** :inherit highlight)) "Basic mode line face for highlighting." :version "22.1" ! :group 'modeline :group 'basic-faces) (defface region --- 1945,1951 ---- :inherit highlight)) "Basic mode line face for highlighting." :version "22.1" ! :group 'mode-line-faces :group 'basic-faces) (defface region *************** *** 2014,2020 **** :inverse-video t)) "Basic mode line face for selected window." :version "21.1" ! :group 'modeline :group 'basic-faces) (defface mode-line-inactive --- 2020,2026 ---- :inverse-video t)) "Basic mode line face for selected window." :version "21.1" ! :group 'mode-line-faces :group 'basic-faces) (defface mode-line-inactive *************** *** 2030,2036 **** :foreground "grey80" :background "grey30")) "Basic mode line face for non-selected windows." :version "22.1" ! :group 'modeline :group 'basic-faces) ;; Make `modeline' an alias for `mode-line', for compatibility. --- 2036,2042 ---- :foreground "grey80" :background "grey30")) "Basic mode line face for non-selected windows." :version "22.1" ! :group 'mode-line-faces :group 'basic-faces) ;; Make `modeline' an alias for `mode-line', for compatibility. *************** *** 2038,2043 **** --- 2044,2055 ---- (put 'modeline-inactive 'face-alias 'mode-line-inactive) (put 'modeline-highlight 'face-alias 'mode-line-highlight) + (defface mode-line-buffer + '((t (:weight bold))) + "Face used to highlight buffer identification parts of the mode line." + :version "22.1" + :group 'mode-line-faces) + (defface header-line '((default :inherit mode-line) *************** *** 2077,2083 **** '((((type tty)) :inherit mode-line-inactive)) "Face used for vertical window dividers on ttys." :version "22.1" - :group 'modeline :group 'basic-faces) (defface minibuffer-prompt --- 2089,2094 ---- Index: lisp/bindings.el =================================================================== RCS file: /sources/emacs/emacs/lisp/bindings.el,v retrieving revision 1.155 diff -c -r1.155 bindings.el *** lisp/bindings.el 16 Dec 2005 11:35:25 -0000 1.155 --- lisp/bindings.el 30 Dec 2005 06:27:52 -0000 *************** *** 449,455 **** FMT is a format specifier such as \"%12b\". This function adds text properties for face, help-echo, and local-map to it." (list (propertize fmt ! 'face 'Buffer-menu-buffer 'help-echo (purecopy "mouse-1: previous buffer, mouse-3: next buffer") 'mouse-face 'mode-line-highlight --- 449,455 ---- FMT is a format specifier such as \"%12b\". This function adds text properties for face, help-echo, and local-map to it." (list (propertize fmt ! 'face 'mode-line-buffer 'help-echo (purecopy "mouse-1: previous buffer, mouse-3: next buffer") 'mouse-face 'mode-line-highlight Index: lisp/time.el =================================================================== RCS file: /sources/emacs/emacs/lisp/time.el,v retrieving revision 1.88 diff -c -r1.88 time.el *** lisp/time.el 11 Aug 2005 01:53:17 -0000 1.88 --- lisp/time.el 30 Dec 2005 06:27:02 -0000 *************** *** 129,135 **** If `display-time-use-mail-icon' is non-nil, the image's background color is the background of this face. Set this to make the mail indicator stand out on a color display." ! :group 'faces :group 'display-time :version "22.1" :type '(choice (const :tag "None" nil) face)) --- 129,135 ---- If `display-time-use-mail-icon' is non-nil, the image's background color is the background of this face. Set this to make the mail indicator stand out on a color display." ! :group 'mode-line-faces :group 'display-time :version "22.1" :type '(choice (const :tag "None" nil) face)) Index: lisp/info.el =================================================================== RCS file: /sources/emacs/emacs/lisp/info.el,v retrieving revision 1.469 diff -c -r1.469 info.el *** lisp/info.el 23 Dec 2005 21:52:00 -0000 1.469 --- lisp/info.el 30 Dec 2005 06:27:28 -0000 *************** *** 1403,1410 **** (concat " (" (if Info-current-file (file-name-nondirectory Info-current-file) ! " ") ! ") " (or Info-current-node "")))))) ;; Go to an Info node specified with a filename-and-nodename string ;; of the sort that is found in pointers in nodes. --- 1403,1414 ---- (concat " (" (if Info-current-file (file-name-nondirectory Info-current-file) ! "") ! ") " ! (if Info-current-node ! (propertize Info-current-node ! 'face 'mode-line-buffer) ! "")))))) ;; Go to an Info node specified with a filename-and-nodename string ;; of the sort that is found in pointers in nodes. -- Juri Linkov http://www.jurta.org/emacs/