0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-29 20:37:51 +00:00

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.
This commit is contained in:
Nicolas Goaziou 2018-04-28 23:54:23 +02:00
parent 8785052735
commit c6d717cc89

View file

@ -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))