emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: a@xkqr.org (Chris)
To: emacs-orgmode@gnu.org
Subject: Suggestion: Add zero-width nbsp to emphasis-regexp-components
Date: Wed, 06 Jun 2018 09:54:37 +0200	[thread overview]
Message-ID: <87h8mgmjsy.fsf@surprise.skruttet> (raw)

[-- 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 --]

             reply	other threads:[~2018-06-06  7:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-06  7:54 Chris [this message]
2018-06-06 11:49 ` Suggestion: Add zero-width nbsp to emphasis-regexp-components Marcin Borkowski
2018-06-06 12:07   ` Nicolas Goaziou
2018-06-06 12:55     ` Chris
2018-06-06 20:52     ` Marcin Borkowski

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  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=87h8mgmjsy.fsf@surprise.skruttet \
    --to=a@xkqr.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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

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