From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: =?UTF-8?B?UmU6IFtidWc/XSBvcmctY29weS1mYWNlIGRvZXNu4oCZdCBhZGQg?= =?UTF-8?B?ZmFjZXMgdG8gb3JnLWZhY2VzIGN1c3RvbWl6ZSBncm91cA==?= Date: Tue, 23 Sep 2014 13:27:20 -0400 Message-ID: <87y4tant6v.fsf@gmail.com> References: <87tx4yu2su.fsf@gmail.com> <86k35rldto.fsf@somewhere.org> <87wq9pssuo.fsf@gmail.com> <86d2am1xp4.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWTsH-0007Bg-7r for emacs-orgmode@gnu.org; Tue, 23 Sep 2014 13:27:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWTs8-0003UV-0i for emacs-orgmode@gnu.org; Tue, 23 Sep 2014 13:27:37 -0400 Received: from mail-qc0-x22f.google.com ([2607:f8b0:400d:c01::22f]:56310) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWTs7-0003SS-Qc for emacs-orgmode@gnu.org; Tue, 23 Sep 2014 13:27:27 -0400 Received: by mail-qc0-f175.google.com with SMTP id o8so2033154qcw.20 for ; Tue, 23 Sep 2014 10:27:22 -0700 (PDT) In-Reply-To: <86d2am1xp4.fsf@somewhere.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Sebastien Vauban , emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Seb, 2014ko irailak 23an, Sebastien Vauban-ek idatzi zuen: >=20 > Hi Aaron, >=20 > Aaron Ecay wrote: >> 2014ko abuztuak 29an, Sebastien Vauban-ek idatzi zuen: >>> I think it's related to an Emacs bug (#16440) which I reported on the >>> Org mailing list in February. >>=20 >> I don=E2=80=99t completely understand what is going on in that bug repor= t. My >> proposal is to convert org-copy-face to defface. >=20 > I think this is "the right thing" (TM). >=20 >> I can=E2=80=99t tell if this would fix your problem or not, but if it=E2= =80=99s >> exclusive to the faces I listed in my previous email the answer is >> probably =E2=80=9Cyes.=E2=80=9D >=20 > From what I can see, yes, the faces which are wrongly displayed (before > re-applying the theme) match the ones defined by `org-copy-face'. So, > this seems the right way to go. OK, thanks for the followup. I=E2=80=99m attaching the patch to this email= . If I don=E2=80=99t hear any further feedback, I=E2=80=99ll commit it to master= in a few days. --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0001-org-faces-remove-org-copy-face.patch Content-Transfer-Encoding: quoted-printable >From 128726a88ca2ec2232071cd9a6d7869df01fd953 Mon Sep 17 00:00:00 2001 From: Aaron Ecay Date: Tue, 23 Sep 2014 13:21:22 -0400 Subject: [PATCH] org-faces: remove org-copy-face MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit * lisp/org-faces.el (org-copy-face): Remove function. (org-checkbox-statistics-todo, org-checkbox-statistics-done) (org-block-begin-line, org-block-end-line, org-quote) (org-verse, org-agenda-date, org-agenda-date-today) (org-agenda-clocking, org-agenda-date-weekend) (org-agenda-current-time, org-mode-line-clock) (org-mode-line-clock-overrun): Convert to `defface' from `org-copy-face'. The =E2=80=98org-copy-face=E2=80=99 function didn=E2=80=99t properly deal w= ith face customizations and color themes. --- lisp/org-faces.el | 96 +++++++++++++++++++++++++++++++--------------------= ---- 1 file changed, 54 insertions(+), 42 deletions(-) diff --git a/lisp/org-faces.el b/lisp/org-faces.el index 6e62ad0..36f810e 100644 --- a/lisp/org-faces.el +++ b/lisp/org-faces.el @@ -31,19 +31,6 @@ (require 'org-macs) (require 'org-compat) =20 -(defun org-copy-face (old-face new-face docstring &rest attributes) - (unless (facep new-face) - (if (fboundp 'set-face-attribute) - (progn - (make-face new-face) - (set-face-attribute new-face nil :inherit old-face) - (apply 'set-face-attribute new-face nil attributes) - (set-face-doc-string new-face docstring)) - (copy-face old-face new-face) - (if (fboundp 'set-face-doc-string) - (set-face-doc-string new-face docstring))))) -(put 'org-copy-face 'lisp-indent-function 2) - (when (featurep 'xemacs) (put 'mode-line 'face-alias 'modeline)) =20 @@ -427,12 +414,15 @@ determines if it is a foreground or a background colo= r." "Face for checkboxes." :group 'org-faces) =20 +(defface org-checkbox-statistics-todo + '((t (:inherit org-todo))) + "Face used for unfinished checkbox statistics." + :group 'org-faces) =20 -(org-copy-face 'org-todo 'org-checkbox-statistics-todo - "Face used for unfinished checkbox statistics.") - -(org-copy-face 'org-done 'org-checkbox-statistics-done - "Face used for finished checkbox statistics.") +(defface org-checkbox-statistics-done + '((t (:inherit org-done))) + "Face used for finished checkbox statistics." + :group 'org-faces) =20 (defcustom org-tag-faces nil "Faces for specific tags. @@ -537,11 +527,15 @@ follows a #+DATE:, #+AUTHOR: or #+EMAIL: keyword." :group 'org-faces :version "22.1") =20 -(org-copy-face 'org-meta-line 'org-block-begin-line - "Face used for the line delimiting the begin of source blocks.") +(defface org-block-begin-line + '((t (:inherit org-meta-line))) + "Face used for the line delimiting the begin of source blocks." + :group 'org-faces) =20 -(org-copy-face 'org-meta-line 'org-block-end-line - "Face used for the line delimiting the end of source blocks.") +(defface org-block-end-line + '((t (:inherit org-block-begin-line))) + "Face used for the line delimiting the end of source blocks." + :group 'org-faces) =20 (defface org-verbatim (org-compatible-face 'shadow @@ -557,10 +551,15 @@ follows a #+DATE:, #+AUTHOR: or #+EMAIL: keyword." :group 'org-faces :version "22.1") =20 -(org-copy-face 'org-block 'org-quote - "Face for #+BEGIN_QUOTE ... #+END_QUOTE blocks.") -(org-copy-face 'org-block 'org-verse - "Face for #+BEGIN_VERSE ... #+END_VERSE blocks.") +(defface org-quote + '((t (:inherit org-block))) + "Face for #+BEGIN_QUOTE ... #+END_QUOTE blocks." + :group 'org-faces) + +(defface org-verse + '((t (:inherit org-block))) + "Face for #+BEGIN_VERSE ... #+END_VERSE blocks." + :group 'org-faces) =20 (defcustom org-fontify-quote-and-verse-blocks nil "Non-nil means, add a special face to #+begin_quote and #+begin_verse bl= ock. @@ -597,21 +596,28 @@ content of these blocks will still be treated as Org = syntax." "Face used in agenda for captions and dates." :group 'org-faces) =20 -(org-copy-face 'org-agenda-structure 'org-agenda-date - "Face used in agenda for normal days.") +(defface org-agenda-date + '((t (:inherit org-agenda-structure))) + "Face used in agenda for normal days." + :group 'org-faces) =20 -(org-copy-face 'org-agenda-date 'org-agenda-date-today +(defface org-agenda-date-today + '((t (:inherit org-agenda-date :weight bold :italic t))) "Face used in agenda for today." - :weight 'bold :italic 't) + :group 'org-faces) =20 -(org-copy-face 'secondary-selection 'org-agenda-clocking - "Face marking the current clock item in the agenda.") +(defface org-agenda-clocking + '((t (:inherit secondary-selection))) + "Face marking the current clock item in the agenda." + :group 'org-faces) =20 -(org-copy-face 'org-agenda-date 'org-agenda-date-weekend +(defface org-agenda-date-weekend + '((t (:inherit org-agenda-date :weight bold))) "Face used in agenda for weekend days. -See the variable `org-agenda-weekend-days' for a definition of which days -belong to the weekend." - :weight 'bold) + +See the variable `org-agenda-weekend-days' for a definition of +which days belong to the weekend." + :group 'org-faces) =20 (defface org-scheduled (org-compatible-face nil @@ -716,8 +722,10 @@ month and 365.24 days for a year)." "Face used for time grids." :group 'org-faces) =20 -(org-copy-face 'org-time-grid 'org-agenda-current-time - "Face used to show the current time in the time grid.") +(defface org-agenda-current-time + '((t (:inherit org-time-grid))) + "Face used to show the current time in the time grid." + :group 'org-faces) =20 (defface org-agenda-diary (org-compatible-face 'default nil) @@ -788,11 +796,15 @@ level org-n-level-faces" :version "24.4" :package-version '(Org . "8.0")) =20 -(org-copy-face 'mode-line 'org-mode-line-clock - "Face used for clock display in mode line.") -(org-copy-face 'mode-line 'org-mode-line-clock-overrun +(defface org-mode-line-clock + '((t (:inherit mode-line))) + "Face used for clock display in mode line." + :group 'org-faces) + +(defface org-mode-line-clock-overrun + '((t (:inherit mode-line :background "red"))) "Face used for clock display for overrun tasks in mode line." - :background "red") + :group 'org-faces) =20 (provide 'org-faces) =20 --=20 2.1.0 --=-=-= Content-Type: text/plain -- Aaron Ecay --=-=-=--