8

@NickD answered the question well. But you can also do this, just to inhibit showing messages for set-fill-column: (add-hook 'python-mode-hook (lambda () (setq indent-tabs-mode nil python-indent 4 tab-width 4) (let ((inhibit-message t)) (set-fill-column 80)))) ...


5

inhibit-message is a variable (added in 25.1), not a function (I mention this because you've written it like a function call). Therefore you can set its value buffer-locally: (setq-local inhibit-message t) Where you would do that would depend on your specific requirements. For a particular mode you can use the associated mode hook. For foo-mode you would ...


3

Regarding the specific example case... set-fill-column is a command which is only intended to be used interactively. To set the fill column programmatically, just do this: (setq fill-column 80) Which is exactly what set-fill-column would do, after validating that 80 was a valid argument and displaying the message -- but you don't need anything to validate 80 ...


3

Your confusion is on account of using C-xC-e C-x C-e runs the command eval-last-sexp (found in global-map), which is an interactive compiled Lisp function in ‘elisp-mode.el’. It is bound to C-x C-e. (eval-last-sexp EVAL-LAST-SEXP-ARG-INTERNAL) Evaluate sexp before point; print value in the echo area. Interactively, with a non ‘-’ prefix ...


1

(defun disable-lsp-conn-msg-advice (func &rest r) (unless (string-prefix-p "Connected to" (car r)) (apply func r))) (advice-add 'lsp--info :around #'disable-lsp-conn-msg-advice)


1

I found the answer here: https://superuser.com/questions/669701/emacs-disable-some-minibuffer-messages You suppress the message with advice-add (defun suppress-messages (old-fun &rest args) "Suppress messages from OLD-FUN with ARGS. https://superuser.com/questions/669701/emacs-disable-some-minibuffer-messages" (cl-flet ((silence (&rest args1) (...


Only top voted, non community-wiki answers of a minimum length are eligible