unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
Cc: rudalics@gmx.at, emacs-devel@gnu.org
Subject: Re: Customizing faces with `defcustom'
Date: Fri, 30 Dec 2005 08:29:42 +0200	[thread overview]
Message-ID: <87zmmjxg1t.fsf@jurta.org> (raw)
In-Reply-To: <E1Es9ph-0005d4-AK@fencepost.gnu.org> (Richard M. Stallman's message of "Thu, 29 Dec 2005 21:17:29 -0500")

>     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 ""))))))
  \f
  ;; 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)
! 			  ""))))))
  \f
  ;; 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/

  reply	other threads:[~2005-12-30  6:29 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-27 10:24 Customizing faces with `defcustom' martin rudalics
2005-08-28 15:11 ` Richard M. Stallman
2005-08-30  5:55   ` martin rudalics
2005-09-01 15:53     ` Richard M. Stallman
2005-11-12  8:09       ` martin rudalics
2005-11-13 20:54         ` Richard M. Stallman
2005-11-15  7:45           ` martin rudalics
2005-11-16 19:26           ` martin rudalics
2005-11-17 14:07             ` Richard M. Stallman
2005-11-30  2:44           ` Juri Linkov
2005-11-30  7:47             ` martin rudalics
2005-11-30 13:27               ` Per Abrahamsen
2005-11-30 15:33                 ` Juri Linkov
2005-12-23 13:23                 ` martin rudalics
2005-12-24 20:14                   ` Juri Linkov
2005-12-25 16:23                     ` martin rudalics
2005-12-26  2:20                       ` Richard M. Stallman
2005-12-27 19:05                         ` Juri Linkov
2005-12-28 17:01                           ` Richard M. Stallman
2005-12-25 19:07                     ` Richard M. Stallman
2005-12-25 19:07                     ` Richard M. Stallman
2005-12-26 16:37                       ` martin rudalics
2005-12-27  4:55                         ` Richard M. Stallman
2005-12-27 19:04                           ` Juri Linkov
2005-12-28 10:04                             ` martin rudalics
2005-12-28 15:57                               ` Juri Linkov
2005-12-28 22:48                               ` Richard M. Stallman
2005-12-29  9:47                                 ` martin rudalics
2005-12-30  2:18                                   ` Richard M. Stallman
2005-12-28 22:48                               ` Richard M. Stallman
2005-12-29  1:23                                 ` Juri Linkov
2005-12-30  2:17                                   ` Richard M. Stallman
2005-12-30  6:29                                     ` Juri Linkov [this message]
2005-12-30 14:15                                       ` martin rudalics
2005-12-31  0:48                                         ` Juri Linkov
2005-12-31 19:36                                           ` Richard M. Stallman
2005-12-30 22:10                                       ` Richard M. Stallman
2005-12-31  0:48                                         ` Juri Linkov
2005-12-31 19:36                                           ` Richard M. Stallman
2006-01-04  6:34                                             ` Juri Linkov
2006-01-05  3:46                                               ` Richard M. Stallman
2006-01-01 16:10                                           ` Richard M. Stallman
2005-12-31 17:40                                       ` Richard M. Stallman
2006-01-04  6:31                                         ` Juri Linkov
2006-01-05  3:46                                           ` Richard M. Stallman
2005-12-29 10:13                                 ` martin rudalics
2005-12-30  2:18                                   ` Richard M. Stallman
2005-12-28 17:01                             ` Richard M. Stallman
2005-12-27 19:04                       ` Juri Linkov
2005-12-28 17:01                         ` Richard M. Stallman
2005-11-30  9:15             ` Per Abrahamsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zmmjxg1t.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.org \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).