Re: [O] add entries to *emphasis-alist
Hi Philipp, Philipp Kroos writes: > Well, sorry.. > Before sending the mail I read the documentation on > http://orgmode.org/worg/org-contribute.html#sec-4 > regarding correct submission of patches... and did it wrong. > So just for the records, here it is again. Thanks for the patch. As Nicolas said, emphasis markers will be hardcoded at some point, so we don't want to encourage users to tweak this in the meantime. I'll add a note about this in the release notes of Org 7.9. I'll not apply the patch, as it exposes the user to things we don't really want him to explore, such as `org-set-emph-re'... the current docstring is fine to me. > Hopefully, if I can contribute a `real' patch someday, the format will > be right ;) No doubt :) Ps: Think of using `C-x 4 a' to get a proper ChangeLog entry. -- Bastien
Re: [O] add entries to *emphasis-alist
Well, sorry.. Before sending the mail I read the documentation on http://orgmode.org/worg/org-contribute.html#sec-4 regarding correct submission of patches... and did it wrong. So just for the records, here it is again. Hopefully, if I can contribute a `real' patch someday, the format will be right ;) Regards, philipp On Sun, Aug 19, 2012 at 01:38:10PM +0200, Nicolas Goaziou wrote: > Hello, > > Philipp Kroos writes: > > > 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... > > At some point, emphasis markers will be hard-coded anyway. Though, it > will be easy to change their meaning during the export process. > > > Regards, > > -- > Nicolas Goaziou > From 6bd616854ccb981693c2178c5a9c0378cf3954aa Mon Sep 17 00:00:00 2001 From: Philipp Kroos Date: Sun, 19 Aug 2012 14:34:56 +0200 Subject: [PATCH] Minor change of documentation * lisp/org.el org-emphasis-alist: Clearified the documentation The value is not changeable with a setq-form, the customization-interface should be used. The change describes that. TINYCHANGE --- lisp/org.el | 4 +++- 1 Datei geändert, 3 Zeilen hinzugefügt(+), 1 Zeile entfernt(-) 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 -- 1.7.11.4
Re: [O] add entries to *emphasis-alist
Hello, Philipp Kroos writes: > 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... At some point, emphasis markers will be hard-coded anyway. Though, it will be easy to change their meaning during the export process. Regards, -- Nicolas Goaziou
Re: [O] add entries to *emphasis-alist
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? > > 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
Re: [O] add entries to *emphasis-alist
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?
Re: [O] add entries to *emphasis-alist
Hi Philipp, Philipp Kroos wrote: > is it still possible to add items to the emphasis alists? > I'm preparing a presentation with orgmode/beamer and try to get a markup > for alert using '@'. > According to some (old..) thread > (http://lists.gnu.org/archive/html/emacs-orgmode/2010-01/msg00592.html) > I added an entry to org-emhasis-alist and > org-export-latex-emphasis-alist, see below. > Unfortunately, this is not working, '@noise@' is exported to '@noise@' > literally. > I had a quick look at the source in org-latex.el and if I understand it > correctly, the fontification is done in org-export-latex-fontify > according to matches with org-emph-re, defined in org.el. But > org-emph-re doesn't match with '@'- consequently, the markup is ignored. > > So do I have to redefine org-emph-re as well or is there any other trick? > I'm using the current org from git. > > Thanks all! > > > ;; this is how I add the entries to the lists > (setq org-emphasis-alist > (append org-emphasis-alist > '(("@" org-warning "" "" > (setq org-export-latex-emphasis-alist > (append org-export-latex-emphasis-alist > '(("@" "\\alert{%s}" nil > > ;; this is a minimal example > #+LaTeX_CLASS: beamer > #+LaTeX_CLASS_OPTIONS: [presentation] > #+BEAMER_FRAME_LEVEL: 1 > > * Testsection > ** with some important @noise@ You have to make that customization *before* loading Org in your .emacs file. Weird, never really understood why, but that's like that. Best regards, Seb -- Sebastien Vauban
[O] add entries to *emphasis-alist
Hi, is it still possible to add items to the emphasis alists? I'm preparing a presentation with orgmode/beamer and try to get a markup for alert using '@'. According to some (old..) thread (http://lists.gnu.org/archive/html/emacs-orgmode/2010-01/msg00592.html) I added an entry to org-emhasis-alist and org-export-latex-emphasis-alist, see below. Unfortunately, this is not working, '@noise@' is exported to '@noise@' literally. I had a quick look at the source in org-latex.el and if I understand it correctly, the fontification is done in org-export-latex-fontify according to matches with org-emph-re, defined in org.el. But org-emph-re doesn't match with '@'- consequently, the markup is ignored. So do I have to redefine org-emph-re as well or is there any other trick? I'm using the current org from git. Thanks all! ;; this is how I add the entries to the lists (setq org-emphasis-alist (append org-emphasis-alist '(("@" org-warning "" "" (setq org-export-latex-emphasis-alist (append org-export-latex-emphasis-alist '(("@" "\\alert{%s}" nil ;; this is a minimal example #+LaTeX_CLASS: beamer #+LaTeX_CLASS_OPTIONS: [presentation] #+BEAMER_FRAME_LEVEL: 1 * Testsection ** with some important @noise@