all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* emphasis borders, double quotes, and export
@ 2014-03-28 13:58 Alan Schmitt
  2014-03-28 15:10 ` Alan Schmitt
  0 siblings, 1 reply; 17+ messages in thread
From: Alan Schmitt @ 2014-03-28 13:58 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

I have removed the single and double quote characters from my
configuration of the emphasis borders:

#+begin_src emacs-lisp
  (setcar (nthcdr 2 org-emphasis-regexp-components) " \t\n,")
  (custom-set-variables `(org-emphasis-alist ',org-emphasis-alist))
#+end_src

However, the latex export of the following file is not correct.

--8<---------------cut here---------------start------------->8---
This is a string: ~"Nil"~.
--8<---------------cut here---------------end--------------->8---

The generated latex is as follows (I show just the fragment of
interest):

#+begin_src latex
This is a string: \textasciitilde{}"Nil"\textasciitilde{}.
#+end_src

I see the same problem with html export.

Note that syntax highlighting works correctly.

Is this a bug?

Thanks,

Alan

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: emphasis borders, double quotes, and export
  2014-03-28 13:58 emphasis borders, double quotes, and export Alan Schmitt
@ 2014-03-28 15:10 ` Alan Schmitt
  2014-03-28 16:29   ` Nicolas Goaziou
  0 siblings, 1 reply; 17+ messages in thread
From: Alan Schmitt @ 2014-03-28 15:10 UTC (permalink / raw)
  To: emacs-orgmode

Alan Schmitt <alan.schmitt@polytechnique.org> writes:

> Hello,
>
> I have removed the single and double quote characters from my
> configuration of the emphasis borders:
>
> #+begin_src emacs-lisp
>   (setcar (nthcdr 2 org-emphasis-regexp-components) " \t\n,")
>   (custom-set-variables `(org-emphasis-alist ',org-emphasis-alist))
> #+end_src
>
> However, the latex export of the following file is not correct.
>
> This is a string: ~"Nil"~.
>
> The generated latex is as follows (I show just the fragment of
> interest):
>
> #+begin_src latex
> This is a string: \textasciitilde{}"Nil"\textasciitilde{}.
> #+end_src
>
> I see the same problem with html export.
>
> Note that syntax highlighting works correctly.
>
> Is this a bug?

Looking a little deeper into this, it seems to be a regression. I had
files with things like ~'a list~ that exported correctly a couple weeks
ago that no longer export correctly.

Alan

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: emphasis borders, double quotes, and export
  2014-03-28 15:10 ` Alan Schmitt
@ 2014-03-28 16:29   ` Nicolas Goaziou
  2014-03-28 17:22     ` Alan Schmitt
  2014-04-04 13:08     ` Alan Schmitt
  0 siblings, 2 replies; 17+ messages in thread
From: Nicolas Goaziou @ 2014-03-28 16:29 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: emacs-orgmode

Hello,

Alan Schmitt <alan.schmitt@polytechnique.org> writes:

> Looking a little deeper into this, it seems to be a regression. I had
> files with things like ~'a list~ that exported correctly a couple weeks
> ago that no longer export correctly.

This should be fixed. Thank you.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: emphasis borders, double quotes, and export
  2014-03-28 16:29   ` Nicolas Goaziou
@ 2014-03-28 17:22     ` Alan Schmitt
  2014-04-04 13:08     ` Alan Schmitt
  1 sibling, 0 replies; 17+ messages in thread
From: Alan Schmitt @ 2014-03-28 17:22 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> Alan Schmitt <alan.schmitt@polytechnique.org> writes:
>
>> Looking a little deeper into this, it seems to be a regression. I had
>> files with things like ~'a list~ that exported correctly a couple weeks
>> ago that no longer export correctly.
>
> This should be fixed. Thank you.

I confirm it is, thanks a lot.

Alan

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: emphasis borders, double quotes, and export
  2014-03-28 16:29   ` Nicolas Goaziou
  2014-03-28 17:22     ` Alan Schmitt
@ 2014-04-04 13:08     ` Alan Schmitt
  2014-04-04 19:02       ` Nicolas Goaziou
  1 sibling, 1 reply; 17+ messages in thread
From: Alan Schmitt @ 2014-04-04 13:08 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Hello Nicolas,

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> Alan Schmitt <alan.schmitt@polytechnique.org> writes:
>
>> Looking a little deeper into this, it seems to be a regression. I had
>> files with things like ~'a list~ that exported correctly a couple weeks
>> ago that no longer export correctly.
>
> This should be fixed. Thank you.

I'm afraid it broke again (it was fixed for a while, but I recently
updated org and it's now broken).

ECM:

exp_init.el:
--8<---------------cut here---------------start------------->8---
(add-to-list 'load-path "/Users/schmitta/projets/org-mode/lisp")

(require 'org)
(require 'ox-html)

(setcar (nthcdr 2 org-emphasis-regexp-components) " \t\n,")
(custom-set-variables `(org-emphasis-alist ',org-emphasis-alist))
--8<---------------cut here---------------end--------------->8---

bugquote.org:
--8<---------------cut here---------------start------------->8---
This is a string: ~"Nil"~.

This as another string: ~'a list~.
--8<---------------cut here---------------end--------------->8---

Then run:
  emacs --batch -Q -l exp_init.el bugquote.org -f org-html-export-to-html

The resulting html shows the '~'.

Thanks,

Alan

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: emphasis borders, double quotes, and export
  2014-04-04 13:08     ` Alan Schmitt
@ 2014-04-04 19:02       ` Nicolas Goaziou
  2014-04-04 21:52         ` Nick Dokos
  2014-04-05  9:41         ` Alan Schmitt
  0 siblings, 2 replies; 17+ messages in thread
From: Nicolas Goaziou @ 2014-04-04 19:02 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: emacs-orgmode

Hello,

Alan Schmitt <alan.schmitt@polytechnique.org> writes:

> I'm afraid it broke again (it was fixed for a while, but I recently
> updated org and it's now broken).
>
> ECM:
>
> exp_init.el:
> (add-to-list 'load-path "/Users/schmitta/projets/org-mode/lisp")
>
> (require 'org)
> (require 'ox-html)
>
> (setcar (nthcdr 2 org-emphasis-regexp-components) " \t\n,")
> (custom-set-variables `(org-emphasis-alist ',org-emphasis-alist))

You need to reload Org after modifying `org-emphasis-regexp-components'.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: emphasis borders, double quotes, and export
  2014-04-04 19:02       ` Nicolas Goaziou
@ 2014-04-04 21:52         ` Nick Dokos
  2014-04-04 22:35           ` Nicolas Goaziou
  2014-04-05  9:41         ` Alan Schmitt
  1 sibling, 1 reply; 17+ messages in thread
From: Nick Dokos @ 2014-04-04 21:52 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> Alan Schmitt <alan.schmitt@polytechnique.org> writes:
>
>> I'm afraid it broke again (it was fixed for a while, but I recently
>> updated org and it's now broken).
>>
>> ECM:
>>
>> exp_init.el:
>> (add-to-list 'load-path "/Users/schmitta/projets/org-mode/lisp")
>>
>> (require 'org)
>> (require 'ox-html)
>>
>> (setcar (nthcdr 2 org-emphasis-regexp-components) " \t\n,")
>> (custom-set-variables `(org-emphasis-alist ',org-emphasis-alist))
>
> You need to reload Org after modifying `org-emphasis-regexp-components'.
>

The custom-set-variables trick should be enough IIUC. org-emphasis-alist
has a :set 'org-set-emph-re i in its property list, so org-set-emph-re
gets called to reinitialize everything.

Nick

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: emphasis borders, double quotes, and export
  2014-04-04 21:52         ` Nick Dokos
@ 2014-04-04 22:35           ` Nicolas Goaziou
  2014-04-05  3:04             ` Nick Dokos
  0 siblings, 1 reply; 17+ messages in thread
From: Nicolas Goaziou @ 2014-04-04 22:35 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

Hello,

Nick Dokos <ndokos@gmail.com> writes:

> The custom-set-variables trick should be enough IIUC. org-emphasis-alist
> has a :set 'org-set-emph-re i in its property list, so org-set-emph-re
> gets called to reinitialize everything.

But `org-set-emph-re' is insufficient at the moment, because it only
updates `org-emph-re', not parts of the parser relying on
`org-emphasis-regexp-components' (namely `org-element--object-regexp').


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: emphasis borders, double quotes, and export
  2014-04-04 22:35           ` Nicolas Goaziou
@ 2014-04-05  3:04             ` Nick Dokos
  0 siblings, 0 replies; 17+ messages in thread
From: Nick Dokos @ 2014-04-05  3:04 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> Nick Dokos <ndokos@gmail.com> writes:
>
>> The custom-set-variables trick should be enough IIUC. org-emphasis-alist
>> has a :set 'org-set-emph-re i in its property list, so org-set-emph-re
>> gets called to reinitialize everything.
>
> But `org-set-emph-re' is insufficient at the moment, because it only
> updates `org-emph-re', not parts of the parser relying on
> `org-emphasis-regexp-components' (namely `org-element--object-regexp').
>

Ah, thanks! Didn't know about that.

-- 
Nick

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: emphasis borders, double quotes, and export
  2014-04-04 19:02       ` Nicolas Goaziou
  2014-04-04 21:52         ` Nick Dokos
@ 2014-04-05  9:41         ` Alan Schmitt
  2014-04-05 10:17           ` Nicolas Goaziou
  1 sibling, 1 reply; 17+ messages in thread
From: Alan Schmitt @ 2014-04-05  9:41 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Hi Nicolas,

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> Alan Schmitt <alan.schmitt@polytechnique.org> writes:
>
>> I'm afraid it broke again (it was fixed for a while, but I recently
>> updated org and it's now broken).
>>
>> ECM:
>>
>> exp_init.el:
>> (add-to-list 'load-path "/Users/schmitta/projets/org-mode/lisp")
>>
>> (require 'org)
>> (require 'ox-html)
>>
>> (setcar (nthcdr 2 org-emphasis-regexp-components) " \t\n,")
>> (custom-set-variables `(org-emphasis-alist ',org-emphasis-alist))
>
> You need to reload Org after modifying `org-emphasis-regexp-components'.

Thank you for the suggestion. How can I do that? Add an "(org-reload)"
in my async init file? Is there a more efficient way than loading org,
setting the variable, and immediately reloading org again?

Alan

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: emphasis borders, double quotes, and export
  2014-04-05  9:41         ` Alan Schmitt
@ 2014-04-05 10:17           ` Nicolas Goaziou
  2014-04-06 14:00             ` Alan Schmitt
  0 siblings, 1 reply; 17+ messages in thread
From: Nicolas Goaziou @ 2014-04-05 10:17 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: emacs-orgmode

Hello,

Alan Schmitt <alan.schmitt@polytechnique.org> writes:

> Thank you for the suggestion. How can I do that? Add an "(org-reload)"
> in my async init file? Is there a more efficient way than loading org,
> setting the variable, and immediately reloading org again?

You can set the variable before loading Org for the first time.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: emphasis borders, double quotes, and export
  2014-04-05 10:17           ` Nicolas Goaziou
@ 2014-04-06 14:00             ` Alan Schmitt
  2014-04-06 14:13               ` Nicolas Goaziou
  0 siblings, 1 reply; 17+ messages in thread
From: Alan Schmitt @ 2014-04-06 14:00 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> Alan Schmitt <alan.schmitt@polytechnique.org> writes:
>
>> Thank you for the suggestion. How can I do that? Add an "(org-reload)"
>> in my async init file? Is there a more efficient way than loading org,
>> setting the variable, and immediately reloading org again?
>
> You can set the variable before loading Org for the first time.

I just tried it and I get the following error at start-up time:

> Warning (initialization): An error occurred while loading `/Users/schmitta/.emacs.d/init.el':
>
> Symbol's value as variable is void: org-emphasis-regexp-components

My init.el is quite short (as most of my configuration is in an org
file).

--8<---------------cut here---------------start------------->8---
;; Turn off mouse interface early in startup to avoid momentary display
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))

;; remember this directory
(setq emacsd-dir
      (file-name-directory (or load-file-name (buffer-file-name))))

;; set this up before loading org
(setcar (nthcdr 2 org-emphasis-regexp-components) " \t\n,")

;; org-setup
(add-to-list 'load-path (concat emacsd-dir "org/emacs/site-lisp/org"))
(require 'org)

;; Then tangle and load the file
(org-babel-load-file (expand-file-name "myconfig.org" emacsd-dir))
--8<---------------cut here---------------end--------------->8---

I assume the problem is that I want to change only one field of
`org-emphasis-regexp-components' but it's not possible to do so because
it's not defined before org is loaded.

I guess one way to proceed is to split up
`org-emphasis-regexp-components' into its four components, to be able to
change only the one I need. Would such a patch be accepted?

Thanks,

Alan

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: emphasis borders, double quotes, and export
  2014-04-06 14:00             ` Alan Schmitt
@ 2014-04-06 14:13               ` Nicolas Goaziou
  2014-04-06 19:04                 ` Alan Schmitt
  0 siblings, 1 reply; 17+ messages in thread
From: Nicolas Goaziou @ 2014-04-06 14:13 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: emacs-orgmode

Hello,

Alan Schmitt <alan.schmitt@polytechnique.org> writes:

> I assume the problem is that I want to change only one field of
> `org-emphasis-regexp-components' but it's not possible to do so because
> it's not defined before org is loaded.
>
> I guess one way to proceed is to split up
> `org-emphasis-regexp-components' into its four components, to be able to
> change only the one I need. Would such a patch be accepted?

This is not needed. You can redefine the four components with an initial
setq:

 (setq org-emphasis-regexp-components
       '(" \t('\"{" "- \t.,:!?;'\")}\\" your-own-string "." 1))


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: emphasis borders, double quotes, and export
  2014-04-06 14:13               ` Nicolas Goaziou
@ 2014-04-06 19:04                 ` Alan Schmitt
  2014-04-06 19:37                   ` Nicolas Goaziou
  0 siblings, 1 reply; 17+ messages in thread
From: Alan Schmitt @ 2014-04-06 19:04 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> Alan Schmitt <alan.schmitt@polytechnique.org> writes:
>
>> I assume the problem is that I want to change only one field of
>> `org-emphasis-regexp-components' but it's not possible to do so because
>> it's not defined before org is loaded.
>>
>> I guess one way to proceed is to split up
>> `org-emphasis-regexp-components' into its four components, to be able to
>> change only the one I need. Would such a patch be accepted?
>
> This is not needed. You can redefine the four components with an initial
> setq:
>
>  (setq org-emphasis-regexp-components
>        '(" \t('\"{" "- \t.,:!?;'\")}\\" your-own-string "." 1))

Thanks, I'm aware this works. I was trying not to manually set some
default values so that, if default changes, I would benefit from the
change. But from what I understand there is not really a choice here
without changing org.

Thanks again,

Alan

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: emphasis borders, double quotes, and export
  2014-04-06 19:04                 ` Alan Schmitt
@ 2014-04-06 19:37                   ` Nicolas Goaziou
  2014-04-06 21:34                     ` Nick Dokos
  2014-04-07 12:57                     ` Alan Schmitt
  0 siblings, 2 replies; 17+ messages in thread
From: Nicolas Goaziou @ 2014-04-06 19:37 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: emacs-orgmode

Alan Schmitt <alan.schmitt@polytechnique.org> writes:

> Thanks, I'm aware this works. I was trying not to manually set some
> default values so that, if default changes, I would benefit from the
> change. But from what I understand there is not really a choice here
> without changing org.

I guess the next stop for this variable will be, hopefully, the dustbin.
So, if I were you, I wouldn't worry much about future changes.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: emphasis borders, double quotes, and export
  2014-04-06 19:37                   ` Nicolas Goaziou
@ 2014-04-06 21:34                     ` Nick Dokos
  2014-04-07 12:57                     ` Alan Schmitt
  1 sibling, 0 replies; 17+ messages in thread
From: Nick Dokos @ 2014-04-06 21:34 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Alan Schmitt <alan.schmitt@polytechnique.org> writes:
>
>> Thanks, I'm aware this works. I was trying not to manually set some
>> default values so that, if default changes, I would benefit from the
>> change. But from what I understand there is not really a choice here
>> without changing org.
>
> I guess the next stop for this variable will be, hopefully, the dustbin.

... and there will be great rejoicing throughout the land.

-- 
Nick

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: emphasis borders, double quotes, and export
  2014-04-06 19:37                   ` Nicolas Goaziou
  2014-04-06 21:34                     ` Nick Dokos
@ 2014-04-07 12:57                     ` Alan Schmitt
  1 sibling, 0 replies; 17+ messages in thread
From: Alan Schmitt @ 2014-04-07 12:57 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Alan Schmitt <alan.schmitt@polytechnique.org> writes:
>
>> Thanks, I'm aware this works. I was trying not to manually set some
>> default values so that, if default changes, I would benefit from the
>> change. But from what I understand there is not really a choice here
>> without changing org.
>
> I guess the next stop for this variable will be, hopefully, the dustbin.
> So, if I were you, I wouldn't worry much about future changes.

I won't then. And thank you for putting up with me ;-)

Alan

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2014-04-07 13:01 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-28 13:58 emphasis borders, double quotes, and export Alan Schmitt
2014-03-28 15:10 ` Alan Schmitt
2014-03-28 16:29   ` Nicolas Goaziou
2014-03-28 17:22     ` Alan Schmitt
2014-04-04 13:08     ` Alan Schmitt
2014-04-04 19:02       ` Nicolas Goaziou
2014-04-04 21:52         ` Nick Dokos
2014-04-04 22:35           ` Nicolas Goaziou
2014-04-05  3:04             ` Nick Dokos
2014-04-05  9:41         ` Alan Schmitt
2014-04-05 10:17           ` Nicolas Goaziou
2014-04-06 14:00             ` Alan Schmitt
2014-04-06 14:13               ` Nicolas Goaziou
2014-04-06 19:04                 ` Alan Schmitt
2014-04-06 19:37                   ` Nicolas Goaziou
2014-04-06 21:34                     ` Nick Dokos
2014-04-07 12:57                     ` Alan Schmitt

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.