unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Juanma Barranquero <lekktu@gmail.com>, sds@gnu.org, emacs-devel@gnu.org
Subject: Re: more candidates for obsoletion
Date: Tue, 04 Sep 2012 20:10:06 +0200	[thread overview]
Message-ID: <87mx15oe0x.fsf@gnus.org> (raw)
In-Reply-To: <jwv62bzldb8.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sun, 13 May 2012 22:20:36 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>  static void
>>  set_message (const char *s, Lisp_Object string,
>>  	     EMACS_INT nbytes, int multibyte_p)
>>  {
>> +  int count = SPECPDL_INDEX ();
>> +
>>    message_enable_multibyte
>>      = ((s && multibyte_p)
>>         || (STRINGP (string) && STRING_MULTIBYTE (string)));
>> @@ -10420,6 +10431,19 @@
>>  			 (intptr_t) s, string, nbytes, multibyte_p);
>>    message_buf_print = 0;
>>    help_echo_showing_p = 0;
>> +
>> +  record_unwind_save_match_data ();
>> +
>> +  if (! debugging &&
>> +      ! NILP (Vdebug_on_message) &&
>> +      STRINGP (Vdebug_on_message) &&
>> +      ! NILP (Fstring_match (Vdebug_on_message, string, Qnil))) {
>> +    debugging = 1;
>> +    record_unwind_protect (undo_debugging, Qnil);
>> +    call_debugger (Fcons (Qerror, Fcons (string, Qnil)));
>> +  }
>> +
>> +  unbind_to (count, Qnil);
>>  }

(I'm including the patch again, since it's been years since it was last
seen.  Or something.  :-)

> Doesn't look too bad.  A few questions and suggestions:
> - !NILP is implied y STRINGP.
> - You might prefer to use fast_string_match.

Fixed and fixed.  And then I don't have to save the match data either, I
guess?

> - Is the recursive debugging a problem you've found to show up
>   unavoidably all the time, or are you just being cautious?

It is a real problem.  My first test case used a string that the
debugger used, too, so Emacs went into an infinite debugging loop...

> - You could turn your `debugging' into a Lisp var (call it
>   "inhibit-debug-on-message"), or you could let-bind debug-on-message to
>   nil around the call to the debugger.

Sounds good.  I've had a peek around the sources, but I can't quite see
how to let-bind something from C.  What should I be looking for as an
example?

-- 
(domestic pets only, the antidote for overdose, milk.)
  http://lars.ingebrigtsen.no  *  Sent from my Emacs



  reply	other threads:[~2012-09-04 18:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-01  6:43 more candidates for obsoletion Glenn Morris
2012-05-01 19:51 ` Sam Steingold
2012-05-01 22:06   ` Juanma Barranquero
2012-05-01 22:25     ` Lars Magne Ingebrigtsen
2012-05-01 22:28       ` Lars Magne Ingebrigtsen
2012-05-02 13:02         ` Stefan Monnier
2012-05-13 18:34           ` Lars Magne Ingebrigtsen
2012-05-14  2:20             ` Stefan Monnier
2012-09-04 18:10               ` Lars Ingebrigtsen [this message]
2012-09-04 19:29                 ` Stefan Monnier
2012-09-04 21:24                   ` Lars Ingebrigtsen
2012-05-02  5:03       ` Thierry Volpiatto
2012-05-02  9:25 ` Michael Albinus

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87mx15oe0x.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=emacs-devel@gnu.org \
    --cc=lekktu@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    --cc=sds@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).