emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Sebastien Vauban <wxhgmqzgwmuf@spammotel.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: add entries to *emphasis-alist
Date: Fri, 17 Aug 2012 15:50:35 -0400	[thread overview]
Message-ID: <5815.1345233035@alphaville> (raw)
In-Reply-To: Message from "Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com> of "Fri, 17 Aug 2012 21:01:00 +0200." <80vcghuyvn.fsf@somewhere.org>

Sebastien Vauban <wxhgmqzgwmuf@spammotel.com> 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.


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?

  reply	other threads:[~2012-08-17 19:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-17 12:26 add entries to *emphasis-alist Philipp Kroos
2012-08-17 19:01 ` Sebastien Vauban
2012-08-17 19:50   ` Nick Dokos [this message]
2012-08-19 11:01     ` Philipp Kroos
2012-08-19 11:38       ` Nicolas Goaziou
2012-08-19 12:53         ` Philipp Kroos
2012-08-19 15:25           ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5815.1345233035@alphaville \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=wxhgmqzgwmuf@spammotel.com \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).