0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-29 18:36:26 +00:00

Allow emphasis markers after an hyphen

* lisp/org.el (org-emphasis-regexp-components): Allow emphasis markers
  after an hyphen.
(org-do-emphasis-faces): Do not strike-through table hlines.

Hypen is already allowed after emphasis markers.  This allows one to
write, e.g., 2017-*09*-27.
This commit is contained in:
Nicolas Goaziou 2017-08-04 18:40:28 +02:00
parent b0776e39b5
commit dd6be5d161

View file

@ -4376,7 +4376,7 @@ After a match, the match groups contain these elements:
;; 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)
'("- \t('\"{" "- \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
@ -5782,12 +5782,16 @@ This should be called after the variable `org-link-parameters' has changed."
(goto-char (match-beginning 0))
;; Do not match headline stars. Do not consider
;; stars of a headline as closing marker for bold
;; markup either.
(and (not (looking-at-p org-outline-regexp-bol))
(looking-at (if verbatim? org-verbatim-re org-emph-re))
(not (string-match-p
(concat org-outline-regexp-bol "\\'")
(match-string 0)))))
;; markup either. Do not match table hlines.
(and
(not (looking-at-p org-outline-regexp-bol))
(not (and (equal marker "+")
(org-match-line
"^[ \t]*\\(|[-+]+|?\\|\\+[-+]+\\+\\)[ \t]*$")))
(looking-at (if verbatim? org-verbatim-re org-emph-re))
(not (string-match-p
(concat org-outline-regexp-bol "\\'")
(match-string 0)))))
(pcase-let ((`(,_ ,face ,_) (assoc marker org-emphasis-alist)))
(font-lock-prepend-text-property
(match-beginning 2) (match-end 2) 'face face)