summaryrefslogtreecommitdiff
path: root/lisp/org/org-macs.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/org/org-macs.el')
-rw-r--r--lisp/org/org-macs.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el
index 04e26708d69..a44bdbe30fd 100644
--- a/lisp/org/org-macs.el
+++ b/lisp/org/org-macs.el
@@ -126,6 +126,15 @@ Also, do not record undo information."
(org-move-to-column ,col)))))
(def-edebug-spec org-preserve-lc (body))
+;; Copied from bookmark.el
+(defmacro org-with-buffer-modified-unmodified (&rest body)
+ "Run BODY while preserving the buffer's `buffer-modified-p' state."
+ (org-with-gensyms (was-modified)
+ `(let ((,was-modified (buffer-modified-p)))
+ (unwind-protect
+ (progn ,@body)
+ (set-buffer-modified-p ,was-modified)))))
+
(defmacro org-without-partial-completion (&rest body)
`(if (and (boundp 'partial-completion-mode)
partial-completion-mode