diff --git a/contrib/lisp/org-md.el b/contrib/lisp/org-md.el index 2fb417288..4579ca31e 100644 --- a/contrib/lisp/org-md.el +++ b/contrib/lisp/org-md.el @@ -334,7 +334,7 @@ a communication channel." (let ((first-object (car (org-element-contents paragraph)))) ;; If paragraph starts with a #, protect it. (if (and (stringp first-object) (string-match "\\`#" first-object)) - (replace-match "\\#" nil t first-object) + (replace-regexp-in-string "\\`#" "\\#" contents nil t) contents))) diff --git a/lisp/org.el b/lisp/org.el index e7c6223e7..94c2de081 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -21078,7 +21078,7 @@ a footnote definition, try to fill the first paragraph within." ;; in current paragraph nor text before message ;; body. ((derived-mode-p 'message-mode) - (let ((body-start (message-goto-body))) + (let ((body-start (save-excursion (message-goto-body)))) (when body-start (setq beg (max body-start beg)))) (when (save-excursion (re-search-forward