소스 검색

Slightly speed up `org--align-tags-here'

* lisp/org.el (org--align-tags-here): Check if tags are already at the
  correct column before messing with the buffer.
Nicolas Goaziou 7 년 전
부모
커밋
c6d717cc89
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      lisp/org.el

+ 3 - 1
lisp/org.el

@@ -14207,7 +14207,9 @@ If ONOFF is `on' or `off', don't toggle but set to this state."
   "Align tags on the current headline to TO-COL.
 Assume point is on a headline.  Preserve point when aligning
 tags."
-  (when (org-match-line org-tag-line-re)
+  (when (and (org-match-line org-tag-line-re)
+	     (/= to-col (save-excursion	;nothing to do?
+			  (goto-char (match-beginning 1)) (current-column))))
     (let* ((shift (if (>= to-col 0) to-col
 		    (- (abs to-col) (string-width (match-string 1)))))
 	   (origin (point-marker))