all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kelly Dean <kellydeanch@yahoo.com>
To: 14480@debbugs.gnu.org
Subject: bug#14480: [PATCH3] Re: bug#14480: A few error to user-error replacements
Date: Tue, 11 Jun 2013 17:52:36 -0700 (PDT)	[thread overview]
Message-ID: <1370998356.74871.YahooMailClassic@web141104.mail.bf1.yahoo.com> (raw)
In-Reply-To: <1369617965.32345.YahooMailClassic@web141101.mail.bf1.yahoo.com>

[-- Attachment #1: Type: text/plain, Size: 837 bytes --]

Here's another one:
(setq debug-on-error t)
M-x M-x
It enters debugger.
Also:
M-x C-x o M-x
It enters debugger.

The attached patch fixes it in both cases. It also applies to trunk; just ignore the hunk for undo.c (user_error is already deleted from undo.c in trunk, but the hunk is needed for 24.3 to prevent a compiler error).

Also, in primitive-undo in simple.el in trunk, the 4 occurrences of
(error "Changes to be undone are outside visible portion of buffer")
might be a regression; primitive-undo in undo.c in 24.3 uses user_error in all 4 cases. But I haven't checked to make sure; maybe they really are program errors, not user errors.

Also, between 24.3 and trunk, bitch_at_user in dispnew.c changed from using the error function to manually signalling a user error. It should just use user_error, which does the same thing.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: user-error3.patch --]
[-- Type: text/x-diff; name="user-error3.patch", Size: 1686 bytes --]

--- emacs-24.3/src/lisp.h
+++ emacs-24.3/src/lisp.h
@@ -3148,6 +3148,7 @@
 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 Lisp_Object un_autoload (Lisp_Object);
 extern Lisp_Object call_debugger (Lisp_Object arg);
 extern void init_eval_once (void);
--- emacs-24.3/src/keyboard.c
+++ emacs-24.3/src/keyboard.c
@@ -782,7 +782,7 @@
   /* 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);
 }
@@ -1207,7 +1207,7 @@
   Fthrow (Qtop_level, Qnil);
 }
 
-static _Noreturn void
+_Noreturn void
 user_error (const char *msg)
 {
   xsignal1 (Quser_error, build_string (msg));
--- emacs-24.3/src/minibuf.c
+++ emacs-24.3/src/minibuf.c
@@ -449,7 +449,7 @@
       && 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,
--- emacs-24.3/src/undo.c
+++ emacs-24.3/src/undo.c
@@ -445,12 +445,6 @@
   unbind_to (count, Qnil);
 }
 
-static _Noreturn void
-user_error (const char *msg)
-{
-  xsignal1 (Quser_error, build_string (msg));
-}
-
 \f
 DEFUN ("primitive-undo", Fprimitive_undo, Sprimitive_undo, 2, 2, 0,
        doc: /* Undo N records from the front of the list LIST.

  parent reply	other threads:[~2013-06-12  0:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-27  1:26 bug#14480: [PATCH] A few error to user-error replacements Kelly Dean
2013-06-04  0:35 ` bug#14480: [PATCH2] Re: bug#14480: " Kelly Dean
2013-06-12  0:52 ` Kelly Dean [this message]
2013-06-12 13:49 ` Kelly Dean
2014-02-28  2:34 ` bug#14480: [PATCH] " Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1370998356.74871.YahooMailClassic@web141104.mail.bf1.yahoo.com \
    --to=kellydeanch@yahoo.com \
    --cc=14480@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.