0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-07-20 01:56:29 +00:00

Merge branch 'maint'

This commit is contained in:
Nicolas Goaziou 2013-05-12 09:57:42 +02:00
commit 824e95540d

View file

@ -1917,11 +1917,15 @@ TEXT is the string to transcode. INFO is a plist holding
contextual information."
(let ((specialp (plist-get info :with-special-strings))
(output text))
;; Protect %, #, &, $, ^, _, { and }.
(while (string-match "\\([^\\]\\|^\\)\\([%$#&{}^_]\\)" output)
;; Protect %, #, &, $, _, { and }.
(while (string-match "\\([^\\]\\|^\\)\\([%$#&{}_]\\)" output)
(setq output
(replace-match
(format "\\%s" (match-string 2 output)) nil t output 2)))
;; Protect ^.
(setq output
(replace-regexp-in-string
"\\([^\\]\\|^\\)\\(\\^\\)" "\\\\^{}" output nil nil 2))
;; Protect \. If special strings are used, be careful not to
;; protect "\" in "\-" constructs.
(let ((symbols (if specialp "-%$#&{}^_\\" "%$#&{}^_\\")))