From mboxrd@z Thu Jan 1 00:00:00 1970 From: Philipp Kroos Subject: Re: add entries to *emphasis-alist Date: Sun, 19 Aug 2012 13:01:10 +0200 Message-ID: <20120819110109.GA6210@Vostro> References: <20120817122605.GA6624@desktop> <80vcghuyvn.fsf@somewhere.org> <5815.1345233035@alphaville> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="PEIAKu/WMn1b1Hv9" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:51785) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T33KM-0007Bu-Lp for emacs-orgmode@gnu.org; Sun, 19 Aug 2012 07:05:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T33KL-00081p-6R for emacs-orgmode@gnu.org; Sun, 19 Aug 2012 07:05:54 -0400 Received: from mailout09.t-online.de ([194.25.134.84]:45298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T33KK-00080E-Ll for emacs-orgmode@gnu.org; Sun, 19 Aug 2012 07:05:52 -0400 Content-Disposition: inline In-Reply-To: <5815.1345233035@alphaville> 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: emacs-orgmode@gnu.org --PEIAKu/WMn1b1Hv9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline It worked using customize, thanks. And thanks for the explanation, Nick. At least my approach to set the value would not work at all without an explicit call to org-set-emph-re, since it relied on the variable being already defined. It might be of minor interest, anyway, I've attached a patch-suggestion that would clearify the usage sufficiently, at least for me... Best regards, Philipp On Fri, Aug 17, 2012 at 03:50:35PM -0400, Nick Dokos wrote: > 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? > > --PEIAKu/WMn1b1Hv9 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="org-emphasis-alist-doc.patch" diff --git a/lisp/org.el b/lisp/org.el index 3bf338d..c70d94d 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -3770,7 +3770,9 @@ characters, the face to be used by font-lock for highlighting in Org-mode Emacs buffers, and the HTML tags to be used for this. For LaTeX export, see the variable `org-export-latex-emphasis-alist'. For DocBook export, see the variable `org-export-docbook-emphasis-alist'. -Use customize to modify this, or restart Emacs after changing it." +The value of org-emphasis-alist is used to calculate a regular expression +during startup; changing it manually may not have an effect. +You should use customize to modify this. Otherwise, see `org-set-emph-re'." :group 'org-appearance :set 'org-set-emph-re :type '(repeat --PEIAKu/WMn1b1Hv9--