Browse Source

Do not call modification hooks when triggering indentation

* lisp/org-indent.el (org-indent-remove-properties):
(org-indent-add-properties): Make sure changing these properties does
not trigger modification hooks
Carsten Dominik 14 năm trước cách đây
mục cha
commit
b7b6a72869
1 tập tin đã thay đổi với 5 bổ sung3 xóa
  1. 5 3
      lisp/org-indent.el

+ 5 - 3
lisp/org-indent.el

@@ -203,8 +203,9 @@ useful to make it ever so slightly different."
 
 (defun org-indent-remove-properties (beg end)
   "Remove indentations between BEG and END."
-  (org-unmodified
-   (remove-text-properties beg end '(line-prefix nil wrap-prefix nil))))
+  (let ((inhibit-modification-hooks t))
+    (org-unmodified
+     (remove-text-properties beg end '(line-prefix nil wrap-prefix nil)))))
 
 (defun org-indent-remove-properties-from-string (string)
   "Remove indentations between BEG and END."
@@ -219,7 +220,8 @@ useful to make it ever so slightly different."
   "Add indentation properties between BEG and END.
 Assumes that BEG is at the beginning of a line."
   (when (or t org-indent-mode)
-    (let (ov b e n level exit nstars)
+    (let ((inhibit-modification-hooks t)
+	  ov b e n level exit nstars)
       (org-unmodified
        (save-excursion
 	 (goto-char beg)