emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Michael Brand <michael.ch.brand@gmail.com>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: [RFC] Emphasis regexp
Date: Sat, 1 Feb 2014 09:27:07 +0100	[thread overview]
Message-ID: <CALn3zojGveWvSnV0Lccgm4qMcnfxnN2XtsOEdyYPZQ=7YWVcxA@mail.gmail.com> (raw)

Hi all

I must be missing something since I think these are very common use
cases: How is one supposed to get code emphasis to recognize the
beginning and end "as expected" in the four examples ='the file.org'=
and ="$1"= and =a = 'x'= and =b = "y"=?

Can I change =org-emphasis-regexp-components= in the Org repository
accordingly to allow single and double quotes for "border" or would
that break too many use cases? To try out what would break in existing
Org files with what I suggest, use
#+NAME: change_border
#+BEGIN_SRC emacs-lisp
  (setq org-emphasis-regexp-components
        '(" \t('\"{" "- \t.,:!?;'\")}\\" " \t\r\n," "." 1))
#+END_SRC
and reload Org mode and reopen the Org buffers that were already
opened.

Additionally and at the cost of "giving up" (why would they be
needed?) '=foo bar=' and "=foo bar=", which possibly should anyway be
either just 'foo bar' and "foo bar" or =foo bar=, also the examples
=c='z'= and =d="t"= would work when using
#+NAME: change_pre_and_post_and_border
#+BEGIN_SRC emacs-lisp
  (setq org-emphasis-regexp-components
        '(" \t({" "- \t.,:!?;)}\\" " \t\r\n," "." 1))
#+END_SRC

As a reminder and to reset during trials, the current state is
#+BEGIN_SRC emacs-lisp
  (setq org-emphasis-regexp-components
        '(" \t('\"{" "- \t.,:!?;'\")}\\" " \t\r\n,\"'" "." 1))
#+END_SRC

Which one of the following is your preference for
=org-emphasis-regexp-components= and why?:
- as in named block "change_pre_and_post_and_border"
- as in named block "change_border"
- keep current state
- other

Below is the history of =org-emphasis-regexp-components= for further
argumentation. The git commits d45806cc and 8ddd57dc (repository
conversion (?) in 2008) have a commit message that does not tell why
single and double quotes were added to be possible for "pre" and
"post" and to be not allowed for "border". Is there a version control
Org repository prior to git with some more comment that has not been
converted to git?

#+BEGIN_VERSE
2ff8fc11  org.el      (Carsten Dominik 2008-01-31 11:32:03 +0100
2327)  '(" \t("        " \t.,?;:'\")"     " \t\r\n,."    "." 1 nil)
d45806cc  org.el      (Carsten Dominik 2008-01-31 11:32:41 +0100
2641)  '(" \t("         " \t.,?;'\")"     " \t\r\n,"     "." 1 nil)
bd2ceb1b  org.el      (Carsten Dominik 2008-01-31 11:33:26 +0100
2800)  '(" \t('\""      " \t.,?;'\")"     " \t\r\n,"     "." 1 nil)
8ddd57dc  org.el      (Carsten Dominik 2008-01-31 11:34:30 +0100
3421)  '(" \t('\""    "- \t.,:?;'\")"     " \t\r\n,\"'"  "." 1 nil)
93570c03  org.el      (Carsten Dominik 2008-01-31 11:37:51 +0100
3955)  '(" \t('\""    "- \t.,:?;'\")"     " \t\r\n,\"'"  "." 1)
fe939ecb9 lisp/org.el (Carsten Dominik 2008-03-22 16:52:18 +0100
2631)  '(" \t('\""    "- \t.,:?;'\")"     " \t\r\n,\"'"  "." 1)
19f700a60 lisp/org.el (Carsten Dominik 2009-03-23 11:14:29 +0100
2631)  '(" \t('\""   "- \t.,:!?;'\")"     " \t\r\n,\"'"  "." 1)
49878b038 lisp/org.el (Carsten Dominik 2009-03-30 11:49:10 +0200
2762)  '(" \t('\"{"  "- \t.,:!?;'\")}"    " \t\r\n,\"'"  "." 1)
8d0acabf2 lisp/org.el (Carsten Dominik 2009-08-01 23:32:28 +0200
2782)  '(" \t('\"{"  "- \t.,:!?;'\")}\\"  " \t\r\n,\"'"  "." 1)
0ba7d3d2f lisp/org.el (Carsten Dominik 2009-08-18 07:45:35 +0100
2807) '(" \t('`\"{"  "- \t.,:!?;'\")}\\"  " \t\r\n,\"'"  "." 1)
44bb3134d lisp/org.el (Carsten Dominik 2009-08-27 10:29:04 +0200
4244)  '(" \t('\"{"  "- \t.,:!?;'\")}\\"  " \t\r\n,\"'"  "." 1)
#+END_VERSE

Michael

             reply	other threads:[~2014-02-01  8:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-01  8:27 Michael Brand [this message]
2014-02-01 15:02 ` [RFC] Emphasis regexp Florian Beck
2014-02-03 10:15   ` Michael Brand
2014-02-03  8:55 ` Bastien

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='CALn3zojGveWvSnV0Lccgm4qMcnfxnN2XtsOEdyYPZQ=7YWVcxA@mail.gmail.com' \
    --to=michael.ch.brand@gmail.com \
    --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).