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

Fix #146 - Make suppress messages Emacs 28 compatible #148

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KaratasFurkan
Copy link

@KaratasFurkan KaratasFurkan commented Apr 11, 2021

Fix #146.

cl-letfdoes not suppress message function in Emacs 28 for some reason. I suspect that (symbol-function 'message) returns gnus/message.elc. This PR fix this with another approach.

Here is one more approach that uses advice system:

(defmacro with-suppress-messages (&rest body)
  "Suppress messages during evaluation of BODY."
  (advice-add 'message :override 'ignore)
  `(let ((return (progn ,@body)))
     (advice-remove 'message 'ignore)
     return))

(with-suppress-messages
 (ignore-errors (aggressive-indent...)))

but I think changing related variables temporarily like in the PR is much cleaner.

@JasonKDarby
Copy link

Until this proper fix is implemented I've been using this approach:
(setq aggressive-indent-region-function #'(lambda (x y) (let ((inhibit-message t)) (indent-region x y)))))
in case anybody was looking for something easy as a stop gap.

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

Successfully merging this pull request may close these issues.

aggressive-indent-mode prints "Indenting region...done" all the time
2 participants