diff options
author | Rasmus <rasmus@gmx.us> | 2017-12-06 15:02:15 +0100 |
---|---|---|
committer | Rasmus <rasmus@gmx.us> | 2017-12-06 15:37:41 +0100 |
commit | 445eefd238eb7c3843e18cd265c05f07233f8aff (patch) | |
tree | 1b80ecda2301629cf8e1f0b2941e1f729952ca84 /lisp/org/org-src.el | |
parent | 5381c70b7a9d46fe4de205363b99f761e2475f1f (diff) | |
download | emacs-445eefd238eb7c3843e18cd265c05f07233f8aff.tar.gz emacs-445eefd238eb7c3843e18cd265c05f07233f8aff.tar.bz2 emacs-445eefd238eb7c3843e18cd265c05f07233f8aff.zip |
Backport: Update Org to v9.1.4
Please note this is a bugfix release. See etc/ORG-NEWS for details.
(cherry picked from commit 567b5efe1f338c10c574758fb968915c5c34c909)
Diffstat (limited to 'lisp/org/org-src.el')
-rw-r--r-- | lisp/org/org-src.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/org/org-src.el b/lisp/org/org-src.el index 99d7c6f7fda..4191d9aadcf 100644 --- a/lisp/org/org-src.el +++ b/lisp/org/org-src.el @@ -581,14 +581,15 @@ Escaping happens when a line starts with \"*\", \"#+\", \",*\" or (interactive "r") (save-excursion (goto-char end) - (while (re-search-backward "^[ \t]*,?\\(\\*\\|#\\+\\)" beg t) + (while (re-search-backward "^[ \t]*\\(,*\\(?:\\*\\|#\\+\\)\\)" beg t) (save-excursion (replace-match ",\\1" nil nil nil 1))))) (defun org-escape-code-in-string (s) "Escape lines in string S. Escaping happens when a line starts with \"*\", \"#+\", \",*\" or \",#+\" by appending a comma to it." - (replace-regexp-in-string "^[ \t]*,?\\(\\*\\|#\\+\\)" ",\\1" s nil nil 1)) + (replace-regexp-in-string "^[ \t]*\\(,*\\(?:\\*\\|#\\+\\)\\)" ",\\1" + s nil nil 1)) (defun org-unescape-code-in-region (beg end) "Un-escape lines between BEG and END. @@ -597,7 +598,7 @@ with \",*\", \",#+\", \",,*\" and \",,#+\"." (interactive "r") (save-excursion (goto-char end) - (while (re-search-backward "^[ \t]*,?\\(,\\)\\(?:\\*\\|#\\+\\)" beg t) + (while (re-search-backward "^[ \t]*,*\\(,\\)\\(?:\\*\\|#\\+\\)" beg t) (save-excursion (replace-match "" nil nil nil 1))))) (defun org-unescape-code-in-string (s) @@ -605,7 +606,7 @@ with \",*\", \",#+\", \",,*\" and \",,#+\"." Un-escaping happens by removing the first comma on lines starting with \",*\", \",#+\", \",,*\" and \",,#+\"." (replace-regexp-in-string - "^[ \t]*,?\\(,\\)\\(?:\\*\\|#\\+\\)" "" s nil nil 1)) + "^[ \t]*,*\\(,\\)\\(?:\\*\\|#\\+\\)" "" s nil nil 1)) |