Skip to content

Commit

Permalink
Tags are renamed in post-command-hook
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronjensen committed May 20, 2020
1 parent 5b60a6f commit a6260f1
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions auto-rename-tag.el
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,8 @@ END : end of the changes."
(unless auto-rename-tag--record-prev-word
(setq auto-rename-tag--record-prev-word "")))))

(defun auto-rename-tag--after-change-function (_begin _end _length)
"Do stuff after buffer is changed.
BEGIN : beginning of the changes.
END : end of the changes.
LENGTH : deletion length."
(defun auto-rename-tag--post-command ()
"Do stuff after buffer is changed."
(when auto-rename-tag--pre-command-actived
(save-excursion
(let ((is-end-tag nil)
Expand Down Expand Up @@ -429,12 +426,12 @@ LENGTH : deletion length."
(defun auto-rename-tag--enable ()
"Enable `auto-rename-tag' in current buffer."
(add-hook 'before-change-functions #'auto-rename-tag--before-change-functions nil t)
(add-hook 'after-change-functions #'auto-rename-tag--after-change-function nil t))
(add-hook 'post-command-hook #'auto-rename-tag--post-command nil t))

(defun auto-rename-tag--disable ()
"Disable `auto-rename-tag' in current buffer."
(remove-hook 'before-change-functions #'auto-rename-tag--before-change-functions t)
(remove-hook 'after-change-functions #'auto-rename-tag--after-change-function t))
(remove-hook 'post-command-hook #'auto-rename-tag--post-command t))


;;;###autoload
Expand Down

0 comments on commit a6260f1

Please sign in to comment.