emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Suggestion: Add zero-width nbsp to emphasis-regexp-components
@ 2018-06-06  7:54 Chris
  2018-06-06 11:49 ` Marcin Borkowski
  0 siblings, 1 reply; 5+ messages in thread
From: Chris @ 2018-06-06  7:54 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2417 bytes --]

Hello!

I'm not an experienced mailing list user, but I will try to be brief.
Please excuse my lack of common courtesy.


* Problem

  There needs to be a way to coax Org into interpreting something as an
  emphasis marker, even if it ordinarily would not look like it (for
  example, because it is in the middle of a regular word, when putting
  emphasis on only part of a word.)

  - Version of Org: 9.1.6
  - Version of Emacs: GNU Emacs 25.3.2 (x86_64-pc-linux-gnu)


* Suggested Solution

  Include the Unicode zero width no-break space character (U+feff) in
  both ~pre~ and ~post~ sections of ~org-emphasis-regexp-components~.

  I currently have trouble accessing code.orgmode.org (502 Bad Gateway),
  but I imagine the solution to look something like

      --- org.el      2018-06-06 09:33:56.602335268 +0200
      +++ org-zwnbsp-emphasis.el      2018-06-06 09:39:37.985958647 +0200
      @@ -4355,7 +4355,7 @@
       ;; set this option proved cumbersome.  See this message/thread:
       ;; http://article.gmane.org/gmane.emacs.orgmode/68681
       (defvar org-emphasis-regexp-components
      -  '("- \t('\"{" "- \t.,:!?;'\")}\\[" " \t\r\n" "." 1)
      +  '("- \ufeff\t('\"{" "- \ufeff\t.,:!?;'\")}\\[" " \t\r\n" "." 1)
         "Components used to build the regular expression for emphasis.
       This is a list with five entries.  Terminology:  In an emphasis string
       like \" *strong word* \", we call the initial space PREMATCH, the final

  This has the added tiny benefit that legacy documents that still use
  U+feff as a byte order mark may be able to get emphasis also on their
  first word... (Not sure if this is a problem, actually, just throwing
  it out there.)


* Discussion

  - Does this even make sense to begin with, or is it just me?

  - Is the zero-width no-break space the most sensible character to do
    this with?

    I see the zero-width joiner as the alternative – but that appears to
    have more legitimate uses inside words, especially in some
    non-Western scripts such as Arabic and Indic. I use U+feff mostly
    because it is actually sort of a space but not quite.


* Related Reports

  I found an email in the archives which touches on the same point[1],
  but suggests a more radical change.

  [1]: https://lists.gnu.org/archive/html/emacs-orgmode/2017-09/msg00363.html

Regards,
Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

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

* Re: Suggestion: Add zero-width nbsp to emphasis-regexp-components
  2018-06-06  7:54 Suggestion: Add zero-width nbsp to emphasis-regexp-components Chris
@ 2018-06-06 11:49 ` Marcin Borkowski
  2018-06-06 12:07   ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Marcin Borkowski @ 2018-06-06 11:49 UTC (permalink / raw)
  To: Chris; +Cc: emacs-orgmode


On 2018-06-06, at 09:54, Chris <a@xkqr.org> wrote:

> * Problem
>
>   There needs to be a way to coax Org into interpreting something as an
>   emphasis marker, even if it ordinarily would not look like it (for
>   example, because it is in the middle of a regular word, when putting
>   emphasis on only part of a word.)
>
> * Suggested Solution
>
>   Include the Unicode zero width no-break space character (U+feff) in
>   both ~pre~ and ~post~ sections of ~org-emphasis-regexp-components~.

+1

-- 
Marcin Borkowski
http://mbork.pl

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

* Re: Suggestion: Add zero-width nbsp to emphasis-regexp-components
  2018-06-06 11:49 ` Marcin Borkowski
@ 2018-06-06 12:07   ` Nicolas Goaziou
  2018-06-06 12:55     ` Chris
  2018-06-06 20:52     ` Marcin Borkowski
  0 siblings, 2 replies; 5+ messages in thread
From: Nicolas Goaziou @ 2018-06-06 12:07 UTC (permalink / raw)
  To: Marcin Borkowski; +Cc: Chris, emacs-orgmode

Hello,

Marcin Borkowski <mbork@mbork.pl> writes:

> On 2018-06-06, at 09:54, Chris <a@xkqr.org> wrote:
>
>> * Problem
>>
>>   There needs to be a way to coax Org into interpreting something as an
>>   emphasis marker, even if it ordinarily would not look like it (for
>>   example, because it is in the middle of a regular word, when putting
>>   emphasis on only part of a word.)
>>
>> * Suggested Solution
>>
>>   Include the Unicode zero width no-break space character (U+feff) in
>>   both ~pre~ and ~post~ sections of ~org-emphasis-regexp-components~.
>
> +1

This is already the case. 

PRE and POST parts of `org-emphasis-regexp-components' contain
"[:space:]", which matches zero width space.

Regards,

-- 
Nicolas Goaziou

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

* Re: Suggestion: Add zero-width nbsp to emphasis-regexp-components
  2018-06-06 12:07   ` Nicolas Goaziou
@ 2018-06-06 12:55     ` Chris
  2018-06-06 20:52     ` Marcin Borkowski
  1 sibling, 0 replies; 5+ messages in thread
From: Chris @ 2018-06-06 12:55 UTC (permalink / raw)
  To: Nicolas Goaziou, Marcin Borkowski; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 384 bytes --]

Hey,

Nicolas Goaziou (mail@nicolasgoaziou.fr) 2018-06-06:
> Marcin Borkowski <mbork@mbork.pl> writes:
> This is already the case. 
>
> PRE and POST parts of `org-emphasis-regexp-components' contain
> "[:space:]", which matches zero width space.

Odd. I guess my version 9.1.6 is too old to get this change? In that
case, I'm looking forward to upgrade!

Regards,
Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

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

* Re: Suggestion: Add zero-width nbsp to emphasis-regexp-components
  2018-06-06 12:07   ` Nicolas Goaziou
  2018-06-06 12:55     ` Chris
@ 2018-06-06 20:52     ` Marcin Borkowski
  1 sibling, 0 replies; 5+ messages in thread
From: Marcin Borkowski @ 2018-06-06 20:52 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Chris, emacs-orgmode


On 2018-06-06, at 14:07, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:

> This is already the case. 
>
> PRE and POST parts of `org-emphasis-regexp-components' contain
> "[:space:]", which matches zero width space.

Wow, thanks!  That means I really need to upgrade my Org.

Best,

-- 
Marcin Borkowski
http://mbork.pl

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

end of thread, other threads:[~2018-06-06 20:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-06  7:54 Suggestion: Add zero-width nbsp to emphasis-regexp-components Chris
2018-06-06 11:49 ` Marcin Borkowski
2018-06-06 12:07   ` Nicolas Goaziou
2018-06-06 12:55     ` Chris
2018-06-06 20:52     ` Marcin Borkowski

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