emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [RFC] Emphasis regexp


From: Michael Brand
Subject: [O] [RFC] Emphasis regexp
Date: Sat, 1 Feb 2014 09:27:07 +0100

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 via email to

[Prev in Thread] Current Thread [Next in Thread]