summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2012-12-30 01:21:27 +0100
committerBastien Guerry <bzg@altern.org>2012-12-30 01:21:27 +0100
commit14c3635a0dc532401ba3aa9a5b5c2650bc562b40 (patch)
treefab1c07ac5187feb3db9a636938ab9ee9a4d0ebb
parente4ca9f44e3e05576df83b91ec88c525903a83ace (diff)
downloadorg-mode-14c3635a0dc532401ba3aa9a5b5c2650bc562b40.tar.gz
New macro `org-with-buffer-modified-unmodified'
* org-macs.el (org-with-buffer-modified-unmodified): New macro. * org.el (org-entry-blocked-p): Use the new macro. Thanks to Nick Dokos for reporting this. The macro is a copy of `with-buffer-modified-unmodified' which (wrongly?) lives in bookmark.el.
-rw-r--r--lisp/org-macs.el9
-rw-r--r--lisp/org.el2
2 files changed, 10 insertions, 1 deletions
diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index e999917..a5d0c62 100644
--- a/lisp/org-macs.el
+++ b/lisp/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
diff --git a/lisp/org.el b/lisp/org.el
index a508cd4..b06b0ac 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11773,7 +11773,7 @@ changes because there are unchecked boxes in this entry."
(defun org-entry-blocked-p ()
"Is the current entry blocked?"
- (with-buffer-modified-unmodified
+ (org-with-buffer-modified-unmodified
(if (org-entry-get nil "NOBLOCKING")
nil ;; Never block this entry
(not