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 ...
user avatar
16 votes

Flush all output in shell buffer (and *Messages* too)

You can clean up the *Messages* buffer the same way you always could, with the kill-buffer command. The next time a message is signaled, the buffer will be recreated anew. The reason that this buffer ...
user avatar
  • 22.4k
12 votes
Accepted

How to display a message in echo-area only

Bind message-log-max to nil: (defun foo () (interactive) (let ((message-log-max nil)) (message "EEEEEEEEEEEEEEEEEE"))) M-x foo RET [P.S. Don't be misled by tests using things such as M-: (...
user avatar
  • 70.1k
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/...
user avatar
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) "...
user avatar
  • 81
8 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-...
user avatar
  • 6,864
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 ...
user avatar
  • 70.1k
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 ...
user avatar
  • 3,329
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 ...
user avatar
  • 8,992
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 ...
user avatar
6 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.)
user avatar
  • 1,045
6 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.
user avatar
  • 43.8k
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 ...
user avatar
  • 2,642
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), ...
user avatar
  • 20.3k
5 votes
Accepted

Flush all output in shell buffer (and *Messages* too)

(erase-buffer) won't work on comint and shell buffers if they are read-only. Here's the defun I use quite often for clearing shellish buffers: (defun clear-comint-buffer () (interactive) (let ((...
user avatar
  • 1,354
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 ...
user avatar
  • 5,854
5 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 ...
user avatar
  • 14.2k
5 votes

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 (...
user avatar
  • 2,185
4 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 ‘...
user avatar
  • 11.4k
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, ...
user avatar
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 ...
user avatar
4 votes

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

Refer from https://www.emacswiki.org/emacs/DebugMessages: (defadvice message (before when-was-that activate) "Add timestamps to `message' output." (ad-set-arg 0 (concat (format-time-string "[%Y-%...
user avatar
4 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 ...
user avatar
  • 17.8k
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 ...
user avatar
  • 1,762
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 ...
user avatar
  • 70.1k
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-...
user avatar
  • 131
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 ...
user avatar
  • 70.1k
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)...
user avatar
3 votes
Accepted

eval-expression that shows the current character

Just convert the result of (char-after) to string: (message (string (char-after)))
user avatar
  • 1,762
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 ...
user avatar
  • 17.8k

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