[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Short patch for review
From: |
Stefan Monnier |
Subject: |
Re: Short patch for review |
Date: |
Wed, 18 Feb 2015 17:51:36 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
> Hi all, Kelly sent me a patch for changing a couple of `error'
> instances into `user-error'.
> It looks ok to me, but I'd appreciate if someone could confirm that
> it's alright.
I agree with the intention. I never know for sure how those _Noreturn
thingies work, so I can't guarantee that it does the right thing, but
the patch looks OK from a distance,
Stefan
> ---
> src/ChangeLog | 10 +++++++++-
> src/keyboard.c | 4 ++--
> src/lisp.h | 1 +
> src/minibuf.c | 2 +-
> 4 files changed, 13 insertions(+), 4 deletions(-)
> diff --git a/src/ChangeLog b/src/ChangeLog
> index 76e1956..1c74a9a 100644
> --- a/src/ChangeLog
> +++ b/src/ChangeLog
> @@ -1,6 +1,14 @@
> +2015-02-18 Kelly Dean <address@hidden>
> +
> + * lisp.h:
> + * keyboard.c: Move declaration of user_error to header file.
> + * keyboard.c (recursive_edit_1): Signal Quser_error, not Qerror.
> + * minibuf.c (read_minibuf): Use user_error, not error.
> + (Bug#14480)
> +
> 2015-02-16 Kelly Dean <address@hidden>
> - * src/keyboard.c (timer_check_2): Fix incorrect comment.
> + * keyboard.c (timer_check_2): Fix incorrect comment.
> 2015-02-14 Martin Rudalics <address@hidden>
> diff --git a/src/keyboard.c b/src/keyboard.c
> index ac70062..304d8a2 100644
> --- a/src/keyboard.c
> +++ b/src/keyboard.c
> @@ -731,7 +731,7 @@ recursive_edit_1 (void)
> /* Handle throw from read_minibuf when using minibuffer
> while it's active but we're in another window. */
> if (STRINGP (val))
> - xsignal1 (Qerror, val);
> + xsignal1 (Quser_error, val);
> return unbind_to (count, Qnil);
> }
> @@ -1179,7 +1179,7 @@ This also exits all active minibuffers. */
> Fthrow (Qtop_level, Qnil);
> }
> -static _Noreturn void
> +_Noreturn void
> user_error (const char *msg)
> {
> xsignal1 (Quser_error, build_string (msg));
> diff --git a/src/lisp.h b/src/lisp.h
> index 7795c90..ca73d21 100644
> --- a/src/lisp.h
> +++ b/src/lisp.h
> @@ -4005,6 +4005,7 @@ extern Lisp_Object unbind_to (ptrdiff_t, Lisp_Object);
> extern _Noreturn void error (const char *, ...) ATTRIBUTE_FORMAT_PRINTF (1,
> 2);
> extern _Noreturn void verror (const char *, va_list)
> ATTRIBUTE_FORMAT_PRINTF (1, 0);
> +extern _Noreturn void user_error (const char *);
> extern void un_autoload (Lisp_Object);
> extern Lisp_Object call_debugger (Lisp_Object arg);
> extern void init_eval_once (void);
> diff --git a/src/minibuf.c b/src/minibuf.c
> index 3408bb9..fca1a0d 100644
> --- a/src/minibuf.c
> +++ b/src/minibuf.c
> @@ -449,7 +449,7 @@ read_minibuf (Lisp_Object map, Lisp_Object
> initial, Lisp_Object prompt,
> && minibuf_level > 0)
> {
> if (EQ (selected_window, minibuf_window))
> - error ("Command attempted to use minibuffer while in minibuffer");
> + user_error ("Command attempted to use minibuffer while in minibuffer");
> else
> /* If we're in another window, cancel the minibuffer that's active. */
> Fthrow (Qexit,
> --
> 1.7.10.4