From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nikolai Weibull Subject: Re: [PATCH] Only set org-hide foreground if one is available Date: Tue, 18 Mar 2014 19:12:15 +0100 Message-ID: References: <1395093037-22550-1-git-send-email-now@disu.se> <87txavfrww.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53392) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPyUt-0003CD-45 for emacs-orgmode@gnu.org; Tue, 18 Mar 2014 14:12:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPyUr-0004br-23 for emacs-orgmode@gnu.org; Tue, 18 Mar 2014 14:12:19 -0400 In-Reply-To: <87txavfrww.fsf@bzg.ath.cx> 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: Bastien Cc: emacs-orgmode@gnu.org On Tue, Mar 18, 2014 at 4:27 PM, Bastien wrote: > Nikolai Weibull writes: > >> (org-mode): When loading Org buffers through desktop > > I'm not sure what the above means, can you explain it? > Also, what is exactly the bug this fixes (beyond setting > something that does not need setting)? Sorry, I realize that I was way too terse. When loading Org buffers from a desktop file (see (desktop-save-mode)) when Emacs starts as a daemon (through, for example, emacsclient --alternate-editor '' -t), org-hide (and I=E2=80=99m guessing other faces a= s well =E2=80=93 I=E2=80=99m not well versed with Emacs=E2=80=99 faces) will = apparently not contain any information. My guess is that until a frame has been created (or perhaps displayed), which won=E2=80=99t happen until after the = Org buffers have been created and thus Org mode has been initialized and this code called, faces won=E2=80=99t be initialized, perhaps to account fo= r things such as rules relating to background/foreground (such as those defined in (defface org-hide)). Thus it=E2=80=99s not safe to simply assum= e that (face-foreground 'org-hide) will return a non-nil value, which means that (org-find-invisible-foreground) /can/ return nil. If we set (face-foreground 'org-hide nil) during initialization, for some other reason that I=E2=80=99m similarly unfamiliar with, my themed setting = of org-hide (via (load-theme)) won=E2=80=99t be applied (and the default value specified in the defface of org-hide will similarly not be used). As should be painfully obvious from that description, I=E2=80=99m not sure = why (face-foreground 'org-hide) is returning nil and I=E2=80=99m not sure why (set-face-foreground 'org-hide nil) prevents the themed setting to be applied. I am, however, sure that this solved the issue of org-hide having an unspecified foreground.