Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ahs-change-range no longer works after updating to lastest melpa #12

Open
DirtYiCE opened this issue Aug 5, 2021 · 1 comment
Open

Comments

@DirtYiCE
Copy link

DirtYiCE commented Aug 5, 2021

After updating from 20210108.1841 to 20210715.1416 I've noticed that the default range was switched from whole buffer to display area. But what's worse that after using ahs-change-range to switch to a different range, ahs stops working: whatever was highlighted stays highlighted, even if I move my cursor around.

I've reproduced it with this tiny config:

(custom-set-variables
 '(package-archives
   '(("gnu" . "http://elpa.gnu.org/packages/")
     ("melpa-stable" . "http://stable.melpa.org/packages/")
     ("melpa" . "https://melpa.org/packages/"))))

; auto-highlight bindings
(setq-default auto-highlight-symbol-mode-map
              (let ((map (make-sparse-keymap)))
                (define-key map (kbd "M-<up>"     ) 'ahs-backward            )
                (define-key map (kbd "ESC <up>"   ) 'ahs-backward            )
                (define-key map (kbd "M-<down>"   ) 'ahs-forward             )
                (define-key map (kbd "ESC <down>" ) 'ahs-forward             )
                (define-key map (kbd "M-S-<up>"   ) 'ahs-backward-definition )
                (define-key map (kbd "M-S-<down>" ) 'ahs-forward-definition  )
                (define-key map (kbd "M--"        ) 'ahs-back-to-start       )
                (define-key map (kbd "C-x C-'"    ) 'ahs-change-range        )
                (define-key map (kbd "C-x C-a"    ) 'ahs-edit-mode           )
                map))
(global-auto-highlight-symbol-mode 1)

After typing C-x C-', the highlight stops updating.
Using Emacs 27.2 on Linux.

@dsedivec
Copy link

As far as I can see, ahs-init is only called when the mode is turned on, and ahs-init puts ahs-start-timer in post-command-hook and after-change-functions.

However, ahs-clear is called when disabling the mode or from ahs-change-range, and ahs-clear removes ahs-start-timer from both post-command-hook and after-change-functions.

Maybe ahs-change-range wants to call something other than ahs-clear? I can't immediately see why it needs to call ahs-clear.

dsedivec added a commit to dsedivec/dot-emacs-d that referenced this issue Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants