Created
June 18, 2023 11:38
-
-
Save susam/07e608fa026a96caba882d7f7cc077a2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defvar previous-line-number nil) | |
(defun detect-line-number-change () | |
(let ((current-line-number (line-number-at-pos))) | |
(when (and previous-line-number (/= current-line-number previous-line-number)) | |
(message "%d => %d" previous-line-number current-line-number)) | |
(setq previous-line-number current-line-number))) | |
(add-hook 'post-command-hook 'detect-line-number-change) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment