[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Suppressing beginning/end-of-buffer error messages (WAS: GNU Emacs r
From: |
Noam Postavsky |
Subject: |
Re: Suppressing beginning/end-of-buffer error messages (WAS: GNU Emacs raison d'etre) |
Date: |
Fri, 22 May 2020 08:46:16 -0400 |
On Fri, 22 May 2020 at 05:30, martin rudalics <address@hidden> wrote:
> > (defun ignore-edge-of-buffer-errors (default-fun error context
> signaller)
> > (unless (memq (car error) '(beginning-of-buffer end-of-buffer))
> > (funcall default-fun error context signaller)))
> > (add-function :around command-error-function
> > #'ignore-edge-of-buffer-errors)
>
> That will save me a lot of trouble.
>
> I suppose it would also work when I set 'command-error-function' to
> 'ignore-edge-of-buffer-errors' right away but the advice is probably
> cleaner.
If you set directly, then getting hold of the original value of
command-error-function becomes bit trickier. The following should do
the same, but I prefer the add-function version since it depends less
on the order of evaluation.
(defvar original-command-error-function command-error-function)
(defun ignore-edge-of-buffer-errors (error context signaller)
(unless (memq (car error) '(beginning-of-buffer end-of-buffer))
(funcall original-command-error-function
error context signaller)))
(setq command-error-function #'ignore-edge-of-buffer-errors)
(alternatively, you can hardcode command-error-default-function, but
then you lose other additions to command-error-function, like
help-command-error-confusable-suggestions)
- Re: GNU Emacs raison d'etre, (continued)
- Re: GNU Emacs raison d'etre, martin rudalics, 2020/05/20
- Re: GNU Emacs raison d'etre, Eli Zaretskii, 2020/05/21
- Re: GNU Emacs raison d'etre, martin rudalics, 2020/05/21
- RE: GNU Emacs raison d'etre, Drew Adams, 2020/05/18
- Re: GNU Emacs raison d'etre, martin rudalics, 2020/05/19
- Suppressing beginning/end-of-buffer error messages (WAS: GNU Emacs raison d'etre), Noam Postavsky, 2020/05/21
- Re: Suppressing beginning/end-of-buffer error messages (WAS: GNU Emacs raison d'etre), martin rudalics, 2020/05/22
- Re: Suppressing beginning/end-of-buffer error messages (WAS: GNU Emacs raison d'etre),
Noam Postavsky <=
- Re: Suppressing beginning/end-of-buffer error messages (WAS: GNU Emacs raison d'etre), martin rudalics, 2020/05/23
- Re: Suppressing beginning/end-of-buffer error messages (WAS: GNU Emacs raison d'etre), Noam Postavsky, 2020/05/23
- RE: GNU Emacs raison d'etre, Drew Adams, 2020/05/17
- Re: GNU Emacs raison d'etre, Stefan Monnier, 2020/05/17
- RE: GNU Emacs raison d'etre, Drew Adams, 2020/05/17
- Re: GNU Emacs raison d'etre, Dmitry Gutov, 2020/05/17
- Re: GNU Emacs raison d'etre, Stefan Monnier, 2020/05/17
- Re: GNU Emacs raison d'etre, Dmitry Gutov, 2020/05/17
- Re: GNU Emacs raison d'etre, martin rudalics, 2020/05/18
- Re: GNU Emacs raison d'etre, Dmitry Gutov, 2020/05/18