From mboxrd@z Thu Jan 1 00:00:00 1970 Path: quimby.gnus.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: mode-line-inactive and face inheritance Date: Mon, 18 Feb 2002 10:24:40 -0500 Message-ID: <200202181524.g1IFOe210109@rum.cs.yale.edu> References: <9003-Sat16Feb2002095527+0200-eliz@is.elta.co.il> NNTP-Posting-Host: quimby2.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: quimby2.netfonds.no 1014046863 27952 195.204.10.66 (18 Feb 2002 15:41:03 GMT) X-Complaints-To: usenet@quimby2.netfonds.no NNTP-Posting-Date: 18 Feb 2002 15:41:03 GMT Cc: emacs-devel@gnu.org Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby2.netfonds.no with esmtp (Exim 3.12 #1 (Debian)) id 16cpuY-0007Gk-00 for ; Mon, 18 Feb 2002 16:41:02 +0100 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.33 #1 (Debian)) id 16cphK-0006vq-00; Mon, 18 Feb 2002 10:27:22 -0500 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by fencepost.gnu.org with esmtp (Exim 3.33 #1 (Debian)) id 16cpem-0006gh-00 for ; Mon, 18 Feb 2002 10:24:44 -0500 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id g1IFOe210109; Mon, 18 Feb 2002 10:24:40 -0500 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: "Eli Zaretskii" Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.5 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: quimby.gnus.org gmane.emacs.devel:1286 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:1286 > Here's the definition of mode-line-inactive face: > > (defface mode-line-inactive > '((((type x w32 mac) (background light) (class color)) > :inherit mode-line > :weight light > :box (:line-width -1 :color "grey75" :style nil) > :foreground "grey20" :background "grey90") > (((type x w32 mac) (background dark) (class color)) > :inherit mode-line > :weight light > :box (:line-width -1 :color "grey40" :style nil) > :foreground "grey80" :background "grey30") > (t > :inverse-video t)) > "Basic mode line face for non-selected windows." > :version "21.2" > :group 'modeline > :group 'basic-faces) > > The definition for non-GUI versions doesn't include `:inherit mode-line'. > Is that intentional? I think it's not a good idea to have this > difference, especially since the documentation mentions the inheritance, > and doesn't say it's display-dependent. FWIW, I don't see any reason > why an :inherit attribute would hurt here. Reminds me that I have a minor hack in faces.el that allows slightly more structured specs for faces, so that you can move the `:inherit mode-line' outside of any display-specific thing. More specifically, it adds an `all' entry which (just like `t') always matches but doesn't prevent subsequent specs from being considered. Also it allows nesting of display-specific specs so you can extract the common part of the `light' and `'dark' settings for `color' displays. It needs to be cleaned up and documented before it's ready for commit, but I'm not even sure if there's any interest in such a feature. Stefan Index: faces.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/faces.el,v retrieving revision 1.254 diff -c -r1.254 faces.el *** faces.el 12 Feb 2002 02:59:05 -0000 1.254 --- faces.el 18 Feb 2002 15:18:05 -0000 *************** *** 1283,1301 **** (unless frame (setq frame (selected-frame))) (let ((tail spec) ! result) (while tail (let* ((entry (pop tail)) (display (car entry)) (attrs (cdr entry))) ! (when (face-spec-set-match-display display frame) ! (setq result (if (listp (car attrs)) ;; Old-style entry, the attribute list is the ;; first element. ! (car attrs) ! attrs) ! tail nil)))) ! result)) (defun face-spec-reset-face (face &optional frame) --- 1283,1307 ---- (unless frame (setq frame (selected-frame))) (let ((tail spec) ! result all) (while tail (let* ((entry (pop tail)) (display (car entry)) (attrs (cdr entry))) ! (if (eq display 'all) ! (setq all attrs) ! (when (face-spec-set-match-display display frame) ! (setq result (cond ! ((null (cdr attrs)) ;; was (listp (car attrs)) ;; Old-style entry, the attribute list is the ;; first element. ! (car attrs)) ! ((listp (car attrs)) ! ;; Nested spec ! (face-spec-choose attrs frame)) ! (t attrs)) ! tail nil))))) ! (if all (append result all) result))) (defun face-spec-reset-face (face &optional frame) *************** *** 1747,1770 **** ;; happens to look good with the only current use of header-lines, ;; the info browser. XXX :underline t) ! (((class color grayscale) (background light)) ! :inherit mode-line ! :background "grey90" :foreground "grey20" ! :box nil) ! (((class color grayscale) (background dark)) ! :inherit mode-line ! :background "grey20" :foreground "grey90" ! :box nil) (((class mono) (background light)) :inherit mode-line :background "white" :foreground "black" :inverse-video nil :box nil :underline t) (((class mono) (background dark)) :inherit mode-line :background "black" :foreground "white" :inverse-video nil :box nil :underline t) (t --- 1753,1779 ---- ;; happens to look good with the only current use of header-lines, ;; the info browser. XXX :underline t) ! (((class color grayscale)) ! (all ! :inherit mode-line ! :family "helv" ! :box (:line-width -1 :style released-button)) ! (((background light)) ! :background "grey90" :foreground "grey20") ! (((background dark)) ! :background "grey20" :foreground "grey90")) (((class mono) (background light)) :inherit mode-line :background "white" :foreground "black" :inverse-video nil + :family "helv" :box nil :underline t) (((class mono) (background dark)) :inherit mode-line :background "black" :foreground "white" :inverse-video nil + :family "helv" :box nil :underline t) (t *************** *** 1775,1786 **** (defface tool-bar ! '((((type x w32 mac) (class color)) ! (:box (:line-width 1 :style released-button) ! :background "grey75" :foreground "black")) (((type x) (class mono)) ! (:box (:line-width 1 :style released-button) ! :background "grey" :foreground "black")) (t ())) "Basic tool-bar face." --- 1784,1796 ---- (defface tool-bar ! '((all ! :box (:line-width 1 :style released-button) ! :foreground "black") ! (((type x w32 mac) (class color)) ! :background "grey75") (((type x) (class mono)) ! :background "grey") (t ())) "Basic tool-bar face." _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://mail.gnu.org/mailman/listinfo/emacs-devel