I see that I can do something like this:

(defun limit-warnings ()
  (set (make-local-variable 'warning-minimum-level) 'fatal))

(add-hook 'minibuffer-setup-hook 'disable-warnings)

(Sorry for syntax errors; I'm not very familiar with Lisp and the above is just an example.)

How do I combine that with warning options to disable warnings from only the minibuffer? (For example, the minibuffer doesn't need to tell me that I've hit the end of the buffer or that the M-x: prompt string is read-only.)

I tried describe-variable with warning-minimum-level and there was no such variable defined.

  • You want to look at the functions that use line-move-visual or line-move-1 or line-move -- within the library simple.el -- the error message occurs because the optional argument of noerror is not being used to suppress the error message. However, some functions depend upon that signal error to halt an ongoing function -- e.g., multiple-cursors mode depends upon that signal error to prevent a never ending loop.
    – lawlist
    Commented Apr 26, 2015 at 5:54
  • @lawlist: Please post that as an an answer, which the OP can perhaps then accept.
    – Drew
    Commented Dec 4, 2015 at 17:49
  • 1
    Why hasn't (setq warning-minimum-level :emergency) been suggested as an answer?
    – viksit
    Commented Jan 21, 2017 at 22:41

1 Answer 1


This is very similar to the question Is there a way to disable the “buffer is read-only” warning?, so a very similar answer seems appropriate.

You can disable these messages by setting command-error-function to a function that ignores signals buffer-read-only, beginning-of-buffer, and end-of-buffer.

(defun my-command-error-function (data context caller)
  "Ignore the buffer-read-only, beginning-of-buffer,
end-of-buffer signals; pass the rest to the default handler."
  (when (not (memq (car data) '(buffer-read-only
    (command-error-default-function data context caller)))

(setq command-error-function #'my-command-error-function)

(Tested using GNU Emacs 24.5.1.)

  • I believe a big warning disclaimer is in order? Would this cause the M-0 C-x e executions to go on in inf loop? I use that to keep repeating a kmacro from the current point to the end of the buffer (technically until there's an error). Commented Feb 3, 2016 at 19:34
  • @KaushalModi: Nope. (Try for yourself: C-x ( C-n C-x ) M-0 C-x e would do.) command-error-function is called when there is an unhandled signal, and since end-of-buffer is caught by the kmacro execution code, command-error-function is not called. Commented Feb 3, 2016 at 19:39
  • @KaushalModi: Hmm. I was wrong. It is called, but it still does not cause an infinite loop, it seems. (The old comment should remain as a reminder for me to test things before speaking up.) Commented Feb 3, 2016 at 19:43
  • 1
    @KaushalModi: it turns out that cmd_error() in keyboard.c sets executing-kbd-macro to nil before command-error-function is called, so kmacros are stopped on error no matter what you do. Commented Feb 3, 2016 at 20:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.