From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: BUG-#+ Fontification Date: Fri, 29 May 2009 01:33:03 -0400 Message-ID: <10323.1243575183@gamaville.dokosmarshall.org> References: <87octd2cql.fsf@gollum.intra.norang.ca> <751104C9-F496-4C28-AC3A-62E808444651@gmail.com> <87bppc3no1.fsf@gollum.intra.norang.ca> <877i003nm4.fsf@gollum.intra.norang.ca> <87zlcw281l.fsf@gollum.intra.norang.ca> <14307.1243550041@alphaville.usa.hp.com> <87vdnk25qs.fsf@gollum.intra.norang.ca> <8298.1243566088@gamaville.dokosmarshall.org> Reply-To: nicholas.dokos@hp.com Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M9ujm-0007Gl-8u for emacs-orgmode@gnu.org; Fri, 29 May 2009 01:34:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M9ujk-0007GR-6A for emacs-orgmode@gnu.org; Fri, 29 May 2009 01:34:37 -0400 Received: from [199.232.76.173] (port=48011 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M9ujj-0007GO-Vk for emacs-orgmode@gnu.org; Fri, 29 May 2009 01:34:36 -0400 Received: from qmta11.emeryville.ca.mail.comcast.net ([76.96.27.211]:40065) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M9ujj-0007Rr-Fi for emacs-orgmode@gnu.org; Fri, 29 May 2009 01:34:35 -0400 In-Reply-To: Message from Nick Dokos of "Thu, 28 May 2009 23:01:28 EDT." <8298.1243566088@gamaville.dokosmarshall.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bernt Hansen Cc: emacs-orgmode@gnu.org Nick Dokos wrote: > Bernt Hansen wrote: > > > Nick Dokos writes: > > > > > Bernt Hansen wrote: > > > > ... > > >> > > >> So to 'fix' this issue I customized the face and set Foreground to > > >> 'Firebrick' (red) which I think is what it used to look like. Should > > >> this face not have some default colouring defined? or are we supposed to > > >> customize it. That just jumped out at me as different from the default > > >> behaviour we used to have -- and is what prompted this thread. > > >> > > > > > > It *is* initialized: > > > > > > ,---- > > > | (defface org-meta-line > > > | (org-compatible-face 'font-lock-comment-face nil) <-------- > > > | "Face for meta lines startin with \"#+\"." > > > | :group 'org-faces > > > | :version "22.1") > > > `---- > > > > > > It should look like a comment - but you may have defined the face > > > somehow and the macrology might be incapable of redefining it. Have you > > > tried restarting emacs? > > > > Yes - I started a minimal emacs session to isolate the commit where it > > turns black. > > There seems to be an initialization problem of some sort: in my > currently running session I evaluate the following two forms and get the > results shown: > > ,---- > | (get 'org-meta-line 'face-defface-spec) > | ((t :inherit font-lock-comment-face)) > | > | (symbol-plist 'org-meta-line) > | (face 102 face-defface-spec ((t :inherit font-lock-comment-face)) > | face-documentation "Face for meta lines startin with \"#+\"." custom-version "22.1") > `---- > > This instance of emacs was created by the Gnome session manager. If I > start another instance by clicking on the Emacs icon/menu item/etc. I > get the same behavior. > > But if I open an xterm (or start a shell in emacs) and start another > instance from the command line, I get the following: > > ,---- > | (get 'org-meta-line 'face-defface-spec) > | nil > | > | (symbol-plist 'org-meta-line) > | (face 101 face-defface-spec nil > | face-documentation "Face for meta lines startin with \"#+\"." custom-version "22.1") > `---- > > I don't know what causes this difference in behavior. > Well, duh: because of my PATH, I was getting emacs 22 from the command line, but emacs 23 from the panel/menu - no wonder there is a difference. OTOH, this was stupidity with a purpose :-) The upshot is that org-compatible-face does not deal with emacs 22 gracefully, since the first two clauses of the cond fail there and so it takes the default branch; but since specs is nil in the call, the function returns nil. Bernt, you are on emacs 22, correct? One of the emacs-major-version vs. 22 comparisons should probably include equality (from the description, I suspect the first one): ,---- | (defun org-compatible-face (inherits specs) | "Make a compatible face specification. | If INHERITS is an existing face and if the Emacs version supports it, | just inherit the face. If not, use SPECS to define the face. | XEmacs and Emacs 21 do not know about the `min-colors' attribute. | For them we convert a (min-colors 8) entry to a `tty' entry and move it | to the top of the list. The `min-colors' attribute will be removed from | any other entries, and any resulting duplicates will be removed entirely." | (cond | ((and inherits (facep inherits) | (not (featurep 'xemacs)) (> emacs-major-version 22)) | ; ^ | ; ^--- this should probably be >= | | ;; In Emacs 23, we use inheritance where possible. | ;; We only do this in Emacs 23, because only there the outline | ;; faces have been changed to the original org-mode-level-faces. | (list (list t :inherit inherits))) | ((or (featurep 'xemacs) (< emacs-major-version 22)) | ;; These do not understand the `min-colors' attribute. | (let (r e a) | (while (setq e (pop specs)) | (cond | ((memq (car e) '(t default)) (push e r)) | ((setq a (member '(min-colors 8) (car e))) | (nconc r (list (cons (cons '(type tty) (delq (car a) (car e))) | (cdr e))))) | ((setq a (assq 'min-colors (car e))) | (setq e (cons (delq a (car e)) (cdr e))) | (or (assoc (car e) r) (push e r))) | (t (or (assoc (car e) r) (push e r))))) | (nreverse r))) | (t specs))) `---- Thanks, Nick