wolray / symbol-overlay

Highlight symbols with keymap-enabled overlays
346 stars 42 forks source link

Don't log navigation steps to the messages buffer #37

Closed duianto closed 5 years ago

duianto commented 5 years ago

The messages buffer gets flooded with every symbol navigation step.

defun: 1/42 <-- jump-first defun: 42/42 <-- jump-last interactive: 17/17 <-- switch-forward defun: 42/42 <-- switch- backward defun: 41/42 <-- jump-prev defun: 40/42 defun: 39/42 defun: 38/42 defun: 37/42 defun: 36/42 defun: 37/42 <-- jump-next defun: 38/42 defun: 39/42 defun: 40/42

This can be prevented by wrapping (let (message-log-max nil) BODY) around the navigation code. Then the messages only appear in the minibuffer, but they won't be written to the messages buffer.

It might be enough to just wrap these commands: symbol-overlay-jump-next, ..-prev, ..-first, ..-last symbol-overlay-switch-forward, ..-backward

System info

symbol-overlay.el

;; Version: 4.1 ;; Package-Version: 20190305.1643

GNU Emacs 26.2 (build 1, x86_64-w64-mingw32) of 2019-04-13 Windows 10 Version 1803

purcell commented 5 years ago

Why do you think that symbol-overlay is producing these messages? I don't see them at all.

duianto commented 5 years ago

I started Emacs -Q and loaded the Spacemacs packages directory:

(setq package-user-dir "~/.emacs.d/elpa/26.2/develop/")
(package-initialize)

And now that you said that it doesn't happen for you. I tried it without loading the Spacemacs packages directory (in case something from Spacemacs was being loaded some how).

I started Emacs -Q again, but this time I added Melpa to the package-archives: https://melpa.org/#/getting-started

M-x package-install symbol-overlay

Moved the cursor to when in the melpa getting started snippet.

M-x symbol-overlay-put

Navigating between the occurrences with n or p still adds entries in the messages buffer:

when: 1/2 (symbol-overlay-face-5) when: 2/2 when: 1/2 when: 2/2 when: 1/2 when: 2/2 when: 1/2 when: 2/2 when: 1/2

purcell commented 5 years ago

Thanks - the use of symbol-overlay-put was what I was missing. Confirmed and fixed, as per your suggestion. 👍