emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: Please make org-emphasis-regexp-components respect all whitespace [9.0.10 (9.0.10-5-g1654a5-elpa @ /home/rrt/.emacs.d/elpa/org-20170904/)]
@ 2017-09-14 19:59 Reuben Thomas
  2017-09-14 22:22 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Reuben Thomas @ 2017-09-14 19:59 UTC (permalink / raw)
  To: emacs-orgmode



Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

     http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.
------------------------------------------------------------------------

I tried writing:

  ~get~/~set~ methods

Fair enough, this renders as all verbatim, according to the parsing rules.

So, I tried adding zero-width spaces around the slash. Same result.

org-emphasis-regexp-components indeed does not consider all whitespace,
just some. So, I tried adding [:space:] to the PRE and POST patterns,
and now it works.

I currently have in my Emacs init:

(setq org-emphasis-regexp-components ;; define before loading org
      '("[:space:]('\"{" "-[:space:].,:!?;'\")}\\[" "[:space:]\r\n" "." 1))

In other words, I added [:space:] to the BORDER pattern too.

It would seem reasonable to have something like this be the default. In
particular, worg/dev/org-syntax.org already talks about “whitespace”,
not specifically “spaces, tabs etc.”.

But, I wonder, is it a problem that [:space:] contains vertical
whitespace characters too? (I left “\r\n” in the BORDER pattern as a
reminder that they are there on purpose, whereas PRE and POST previously
contained only space and tab, i.e. horizontal whitespace.) On the other
hand, since PRE and POST are anchored to the start and end of a line,
and the number of newlines is by default limited to 1, perhaps it’s not
a problem?

In any case, it would be nice to have a natural solution to the problem
of emphasis delimiters in this sort of situation. Simply taking
advantage of Unicode characters such as zero-width space seems simpler
than complicating the parser (and it’s also increasingly obvious to
users as they get used to the power of Unicode, and is the sort of trick
that works with lots of different systems, not just Org).

Emacs  : GNU Emacs 25.2.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
 of 2017-09-12
Package: Org mode version 9.0.10 (9.0.10-5-g1654a5-elpa @ /home/rrt/.emacs.d/elpa/org-20170904/)
-- 
https://rrt.sc3d.org/

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

* Re: Bug: Please make org-emphasis-regexp-components respect all whitespace [9.0.10 (9.0.10-5-g1654a5-elpa @ /home/rrt/.emacs.d/elpa/org-20170904/)]
  2017-09-14 19:59 Bug: Please make org-emphasis-regexp-components respect all whitespace [9.0.10 (9.0.10-5-g1654a5-elpa @ /home/rrt/.emacs.d/elpa/org-20170904/)] Reuben Thomas
@ 2017-09-14 22:22 ` Nicolas Goaziou
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2017-09-14 22:22 UTC (permalink / raw)
  To: Reuben Thomas; +Cc: emacs-orgmode

Hello,

Reuben Thomas <rrt@sc3d.org> writes:

> I currently have in my Emacs init:
>
> (setq org-emphasis-regexp-components ;; define before loading org
>       '("[:space:]('\"{" "-[:space:].,:!?;'\")}\\[" "[:space:]\r\n" "." 1))
>
> In other words, I added [:space:] to the BORDER pattern too.
>
> It would seem reasonable to have something like this be the default. In
> particular, worg/dev/org-syntax.org already talks about “whitespace”,
> not specifically “spaces, tabs etc.”.
>
> But, I wonder, is it a problem that [:space:] contains vertical
> whitespace characters too? (I left “\r\n” in the BORDER pattern as a
> reminder that they are there on purpose, whereas PRE and POST previously
> contained only space and tab, i.e. horizontal whitespace.) On the other
> hand, since PRE and POST are anchored to the start and end of a line,
> and the number of newlines is by default limited to 1, perhaps it’s not
> a problem?

I don't think it is a problem with vertical spaces.

IIRC, that change was request by someone else some months ago, but the
request probably felt through the cracks.

Anyway, I made that change to master branch. We'll see what happens.

Thank you.

-- 
Nicolas Goaziou

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

end of thread, other threads:[~2017-09-14 22:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-14 19:59 Bug: Please make org-emphasis-regexp-components respect all whitespace [9.0.10 (9.0.10-5-g1654a5-elpa @ /home/rrt/.emacs.d/elpa/org-20170904/)] Reuben Thomas
2017-09-14 22:22 ` Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

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

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).