Hot answers tagged

20 votes
Accepted

How to attach multiple files in `message-mode`?

Open the directory in dired with C-x 4 d and type M-x turn-on-gnus-dired-mode. Then mark the required files with m (or whatever) and type C-c RET C-a. The files can now be attached to an already ...
10 votes
Accepted

How to add a timestamp to each entry in Emacs' *Messages* buffer?

I have the following snippet in my init.el, which was adapted from an original I found in the following Reddit thread: http://www.reddit.com/r/emacs/comments/16tzu9/...
9 votes
Accepted

Prevent Emacs from messaging when it writes recentf

One solution for that narrow case is to dynamically set save-silently for that invocation specific invocation. Try: (run-at-time nil (* 5 60) (lambda () (let ((save-...
  • 7,169
8 votes

How to add a timestamp to each entry in Emacs' *Messages* buffer?

The translation of @xinfatang's simple solution to the new advice-add syntax as a wrapper around the message function is: (defun my-message-with-timestamp (old-func fmt-string &rest args) "...
  • 81
8 votes
Accepted

How do I suppress messages in the echo area (e.g. `Fill column set to 80 (was 80)`)?

@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 ...
  • 73.5k
7 votes
Accepted

Elisp code execution order?

Forms in the function body are executed in order, just as you would expect. When you choose "y" if does not "jump" past the first message call. If looks like it did because the first message gets ...
  • 9,022
7 votes

Suppress message in minibuffer when a buffer is saved?

As was pointed out by @phils the "Wrote file" comes from write-region. If you don't use the inhibit-message variable introduced in Emacs 25, you could replace the original write-region with a function ...
  • 3,399
7 votes
Accepted

How to debug the "message" function on entry ?

You want to use the debug-on-message variable in this situation. If non-nil, debug if a message matching this regexp is displayed.
  • 46.1k
7 votes
Accepted

Inspect message output

M-x view-echo-area-messages RET or C-h e will open the *Messages* buffer. (This buffer can even contain some stuff that's not shown in the minibuffer, see inhibit-message.)
  • 1,095
6 votes
Accepted

How to preserve color in *Messages* buffer?

You can't with message. Having looked at the internals of message, only the raw char* is given to the function that actually logs the text, all text properties are lost. You can hack your way around ...
6 votes
Accepted

gnus "fancy" hyperlinks, bullet points, etc

Maybe org-mime.el by Eric Schulte. ;; WYSWYG, html mime composition using org-mode ;; ;; For mail composed using the orgstruct-mode minor mode, this ;; provides a function for converting all or part ...
  • 2,662
6 votes
Accepted

Disabling the "Auto-saving...done" message

Is there a way to just disable this message, but not the auto-saving functionality? Yes, Emacs 27 will introduce the user option auto-save-no-message: auto-save-no-message is a variable defined in ‘...
  • 11.8k
6 votes
Accepted

Print message in echo area with no "quotes"?

What you see printed in the echo area when evaluating the command is its return value - a string. The print syntax for strings includes quotation marks. When you call the command non-interactively ...
  • 14.4k
6 votes
Accepted

Is there a way to read the current displayed message?

Take a look at current-message function: (current-message) Probably introduced at or before Emacs version 20. Return the string currently displayed in the echo area, or nil if none. Code (progn (...
  • 2,230
6 votes
Accepted

How to suppress `When done with a buffer, type C-x #` warning message?

The only way to avoid that message with Emacs earlier than 28.1 is to invoke emacsclient with the -n (--nowait) option. Starting with Emacs 28.1 (basically, current upstream at the time of writing), ...
  • 24.4k
5 votes

Print message in echo area with no "quotes"?

When you evaluate a function with M-:, the function gets run, and then its return value is displayed in the echo area. The return value of test-fn is the value returned by message, which is the ...
  • 5,982
5 votes
Accepted

Is it possible suppress save message for undo-tree?

undo-tree-save-history calls write-region. In this example, we suppress the Wrote ... message entirely using an :around advice. Here are the steps used to verify the answer works as advertised: STEP ...
  • 18.4k
5 votes
Accepted

How to suppress `Wrote /home/user/.emacs.d/recentf` message in minibuffer

This should do it. (defun no-msg (function) "Prevent FUNCTION from showing `Wrote <FILE>' messages. \(The messages are still logged to `*Messages*'.)" (let ((inhibit-message t)) ...
  • 73.5k
4 votes

gnus "fancy" hyperlinks, bullet points, etc

I located a package called muse-message, which does exactly what I was hoping for. I have not ever used Muse, but it's a markup system similar to markdown. Muse-message allows for using Muse markup, ...
4 votes
Accepted

Suppress message in minibuffer when a buffer is saved?

You can use following (defmacro with-suppressed-message (&rest body) "Suppress new messages temporarily in the echo area and the `*Messages*' buffer while BODY is evaluated." (declare (indent ...
4 votes

How to add a timestamp to each entry in Emacs' *Messages* buffer?

Refer to https://www.emacswiki.org/emacs/DebugMessages: (defadvice message (before when-was-that activate) "Add timestamps to `message' output." (ad-set-arg 0 (...
4 votes

Percentage sign in `print` and `message`

By running (message (format ...)), you're using the string as a format twice. print takes an object as its parameter, while message takes a format string. Use "%s" as the format and you can ...
  • 1,880
3 votes
Accepted

how to read messages which appear after `C-x C-c`?

When killing Emacs, there are several hooks that may end up being called -- including, but not limited to, kill-emacs-hook, kill-buffer-hook (when a buffer is killed), write-file-functions hook (if a ...
  • 18.4k
3 votes

Elisp code execution order?

It's not being skipped. The second message is printed after the first message is printed, but there is no wait between the two, so you do not notice the first message. Look in buffer *Messages* and ...
  • 73.5k
3 votes
Accepted

How to show a message in the echo area not immediately but after a certain delay and to disappear it after a certain delay

You could try something like: (run-with-timer 2 nil (lambda () (message "Some message") (run-with-timer 3 nil (lambda () (message nil)...
3 votes
Accepted

how to increase the debugging message level

If you set variable debug-on-error to t then Emacs will show you a detailed backtrace of what function calls led to the error. (This affects only actual errors, not non-error messages, which are also ...
  • 73.5k
3 votes

Suppress message in minibuffer when a buffer is saved?

There is a var named save-silently in files.el. if you set the var to t I think the message will not show again. (defvar save-silently nil "If non-nil, avoid messages when saving files. Error-...
  • 131
3 votes
Accepted

eval-expression that shows the current character

Just convert the result of (char-after) to string: (message (string (char-after)))
  • 1,880
3 votes

How to add a locally override the message function?

This macro adds support for adding a suffix to messages. Using advice allows this to be nested, so multiple functions can add their own suffixes which accumulate onto the end. (defmacro with-temp-...
  • 7,969
3 votes
Accepted

When working on elisp where to show intermediate values?

If you are using messages to yourself while developing then: That's fine - nothing wrong with using message. You can also define a wrapper for such uses of message, which respects a global variable ...
  • 73.5k

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