소스 검색

Changes automatically made to cookies shouldn't move tags

* lisp/org.el (org-auto-align-tags): change docstring.
(org-update-parent-todo-statistics): keep tags aligned even when
statistics cookies are shifting them.
* lisp/org-list.el (org-update-checkbox-count): keep tags aligned even
when statistics cookies are shifting them.
Nicolas Goaziou 14 년 전
부모
커밋
ddeab1a8af
2개의 변경된 파일8개의 추가작업 그리고 5개의 파일을 삭제
  1. 3 1
      lisp/org-list.el
  2. 5 4
      lisp/org.el

+ 3 - 1
lisp/org-list.el

@@ -82,6 +82,7 @@
 (require 'org-compat)
 
 (defvar org-M-RET-may-split-line)
+(defvar org-auto-align-tags)
 (defvar org-blank-before-new-entry)
 (defvar org-clock-string)
 (defvar org-closed-string)
@@ -2308,7 +2309,8 @@ With optional prefix argument ALL, do this for the whole buffer."
 			    (format "[%d/%d]" checked total))))
 		(goto-char beg)
 		(insert new)
-		(delete-region (point) (+ (point) (- end beg)))))
+		(delete-region (point) (+ (point) (- end beg)))
+		(when org-auto-align-tags (org-fix-tags-on-the-fly))))
 	    cookies-list))))
 
 (defun org-get-checkbox-statistics-face ()

+ 5 - 4
lisp/org.el

@@ -2850,10 +2850,10 @@ it means that the tags should be flushright to that column.  For example,
   :type 'integer)
 
 (defcustom org-auto-align-tags t
-  "Non-nil means realign tags after pro/demotion of TODO state change.
-These operations change the length of a headline and therefore shift
-the tags around.  With this options turned on, after each such operation
-the tags are again aligned to `org-tags-column'."
+  "Non-nil keeps tags aligned when modifying headlines.
+Some operations (i.e. demoting) change the length of a headline and
+therefore shift the tags around.  With this option turned on, after
+each such operation the tags are again aligned to `org-tags-column'."
   :group 'org-tags
   :type 'boolean)
 
@@ -11339,6 +11339,7 @@ statistics everywhere."
 	    (goto-char checkbox-beg)
 	    (insert new)
 	    (delete-region (point) (+ (point) ndel))
+	    (when org-auto-align-tags (org-fix-tags-on-the-fly))
 	    (when ov (move-overlay ov ovs ove)))
 	  (when cookie-present
 	    (run-hook-with-args 'org-after-todo-statistics-hook