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 opened message buffer or assigned to a new one.
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 is read-only now, is that it has been granted
its own major-mode, which inherits from
which is read-only. The advantages behind that are several.
Bind message-log-max to nil:
(defun foo ()
(let ((message-log-max nil))
M-x foo RET
[P.S. Don't be misled by tests using things such as M-: (let ((message-log-max nil)) (message "EEEEEEEEEEEEEEEEEE")) into thinking that the EEEEEEEEEEEEEEEEEE from evaluating the let sexp is the message that was output ...
I have the following snippet in my init.el, which was adapted from an original I found in the following Reddit thread:
(EDIT: modernised to advice-add and removed clumsy read-only buffer handling on advice of @blujay)
(defun sh/current-time-microseconds ()
One solution for that narrow case is to dynamically set save-silently for that invocation specific invocation. Try:
(run-at-time nil (* 5 60)
(let ((save-silently t))
You might alternatively use advice to globally accomplish the same thing. See Advising Functions in the Emacs ...
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 that sets VISIT to neither t nor nil nor a string. As the docstring of write-region tells us, this will avoid displaying the message. In the following example ...
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 immediately replaced by the second one.
To check that this is true, open the *Messages* buffer and then do M-x foo. You will see that foo adds two messages to the ...
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 this by writing a function that:
calls message with message-log-max let-bound to nil so that it won't log to *Messages*
manually inserts the propertized string ...
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 of your mail buffer
;; to embedded html as exported by org-mode. Call `org-mime-htmlize'
;; in a message buffer to convert either the active region or the
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)
"Prepend current timestamp (with microsecond precision) to a message"
(concat (format-time-string "[%F %T.%3N %Z] ")
(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 ()
(let ((old-max comint-buffer-maximum-size))
(setq comint-buffer-maximum-size 0)
(setq comint-buffer-maximum-size old-max)
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 string that was printed. Thus, though message did actually display the message, it was overwritten by M-: displaying the return value. (You can confirm that both ...
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 from another function/command, you shouldn't see the quotation marks:
(defun test-test-fn ()
Then call M-x test-test-fn RET to test....
Take a look at current-message function:
Probably introduced at or before Emacs version 20.
Return the string currently displayed in the echo area, or nil if none.
(format "current message is %s" (current-message)))
will return "current message is foo"
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, and then M-x muse-message-markup turns the message buffer into a multipart MIME message with an HTML component.
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 0))
(let ((message-log-max nil))
`(with-temp-message (or (current-message) "") ,@body)))
instead of (save-...
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 you will see both messages.
To give the user time to see the first message, you can use sit-for or sleep-for after it:
(defun foo (str bool)
You could try something like:
(run-with-timer 2 nil
(message "Some message")
(run-with-timer 3 nil
run-with-timer will call a function of your choice after a delay (there's a run-with-idle-timer variant if you want to only show the message when Emacs ...
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-related messages will still be printed, but all other
messages will not.")
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-%m-%d %T %Z] ")
(ad-get-arg 0)) ))
Finally i still like Stuart Hickinbottom 's answer, because it avoid show timestamp in minibuffer, ...
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 buffer is saved). A user can inspect a hook by calling M-x describe-variable and the name of the hook. A user can run a hook by evaluating (run-hooks NAME-OF-...
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-advice (fn-orig where fn-advice &rest body)
"Execute BODY with advice temporarily enabled."
(let ((fn-advice-var ,fn-advice))
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 1: Launch a recent public release of Emacs 26.3 -- without any user-configuration, aka emacs -Q
STEP 2: Download the library undo-tree, which was last ...
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 ‘keyboard.c’.
Its value is nil
You can customize this variable.
This variable was introduced, or its default value was changed, in
version 27.1 of Emacs.
You can ensure do-auto-save is called with the correct argument to suppress the message by advising the function:
(defun my-auto-save-wrapper (save-fn &rest args)
(apply save-fn '(t)))
(advice-add 'do-auto-save :around #'my-auto-save-wrapper)
I think you'd need to use polling, sadly.
Detecting via polling that a change happened isn't very hard. Detecting which change happened would in general require keeping a copy of the buffer's contents, but if you're willing to assume that the buffer is only modified by adding to its end or removing from its beginning, you can make it much cheaper.
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 logged to *Messages*.)