初稿: 2018-08-09 Thu 11:00
最終更新日: 2018-12-14 Fri 20:44
ホーム | 文書トップ | 目次

org-unmodified
バッファ内容を保存した上でbodyを実行する

 1: ;; Use `org-with-silent-modifications' to ignore cosmetic changes and
 2: ;; `org-unmodified' to ignore real text modifications
 3: (defmacro org-unmodified (&rest body)
 4:   "Run BODY while preserving the buffer's `buffer-modified-p' state."
 5:   (declare (debug (body)))
 6:   (org-with-gensyms (was-modified)
 7:     `(let ((,was-modified (buffer-modified-p)))
 8:        (unwind-protect
 9:            (let ((buffer-undo-list t)
10:                  (inhibit-modification-hooks t))
11:              ,@body)
12:          (set-buffer-modified-p ,was-modified)))))

日付: 2018-08-09 Thu 11:00

著者: conao

Created: 2018-12-14 Fri 21:04

Validate