Pārlūkot izejas kodu

Lists: Avoid unnecessary buffer-modified

When fixing bullet types, bullets are now only replaced if they would
change, so if nothing changes, the buffer will remain unmodified.
Carsten Dominik 16 gadi atpakaļ
vecāks
revīzija
fdf8ffc4f1
2 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. 1 0
      lisp/ChangeLog
  2. 1 1
      lisp/org-list.el

+ 1 - 0
lisp/ChangeLog

@@ -2,6 +2,7 @@
 
 	* org-list.el (org-toggle-checkbox): Make double prefix set the
 	checkbox to "[-]".
+	(org-fix-bullet-type): Only replace bullet it it is changed.
 
 	* org.el (org-add-log-setup): Fix positioning when
 	`org-log-states-order-reversed' is nil.

+ 1 - 1
lisp/org-list.el

@@ -761,7 +761,7 @@ Also, fix the indentation."
 	  (skip-chars-forward " \t")
 	  (looking-at "\\S-+ *")
 	  (setq oldbullet (match-string 0))
-	  (replace-match bullet)
+	  (unless (equal bullet oldbullet) (replace-match bullet))
 	  (org-shift-item-indentation (- (length bullet) (length oldbullet))))))
     (goto-line line)
     (org-move-to-column col)