From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: add entries to *emphasis-alist Date: Fri, 17 Aug 2012 15:50:35 -0400 Message-ID: <5815.1345233035@alphaville> References: <20120817122605.GA6624@desktop> <80vcghuyvn.fsf@somewhere.org> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([208.118.235.92]:40142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2SZX-0000Oi-GB for emacs-orgmode@gnu.org; Fri, 17 Aug 2012 15:51:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T2SZW-0002eb-8y for emacs-orgmode@gnu.org; Fri, 17 Aug 2012 15:51:07 -0400 Received: from g1t0026.austin.hp.com ([15.216.28.33]:21336) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2SZW-0002eK-24 for emacs-orgmode@gnu.org; Fri, 17 Aug 2012 15:51:06 -0400 In-Reply-To: Message from "Sebastien Vauban" of "Fri, 17 Aug 2012 21:01:00 +0200." <80vcghuyvn.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 Cc: emacs-orgmode@gnu.org Sebastien Vauban wrote: > You have to make that customization *before* loading Org in your .emacs file. > Weird, never really understood why, but that's like that. > The point is that the value of org-emphasis-alist (as well as the value of org-emphasis-regexp-components) is used in order to calculate the value of org-emph-re by calling the function org-set-emph-re afterwards: it's org-emph-re that's used for the all the gory calculations, not org-emphasis-alist, which just provides a nicer interface. So if you arrange to call the org-set-emph-re function afterwards, you can change org-emphasis-alist at any time. Customize makes it easy, in that it does that automatically (see the :set property of org-emphasis-alist). If you do the setq before loading org, then what happens is that when the defcustom is encountered, the value of the :set property (a function) is called: the modified value of org-emphasis-alist is then used to calculate org-emph-re, instead of the original default. If you do it after, none of that happens and it's as if you never changed it. Nick PS BTW, the docstring for the variable says: "Use customize to modify this, or restart Emacs after changing it" but I'm not sure that's correct: if you change the variable in one session, the value is not going to be propagated to the next session, unless you use customize or put the setq in .emacs. In the latter case, it's not going to work unless you do it the way Seb describes: set it before loading Org. So restarting emacs is *not* enough. Am I missing something?