From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: more candidates for obsoletion Date: Tue, 04 Sep 2012 20:10:06 +0200 Message-ID: <87mx15oe0x.fsf@gnus.org> References: <87k40vptms.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1346782245 4933 80.91.229.3 (4 Sep 2012 18:10:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Sep 2012 18:10:45 +0000 (UTC) Cc: Juanma Barranquero , sds@gnu.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 04 20:10:47 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T8xaJ-0001Rj-2u for ged-emacs-devel@m.gmane.org; Tue, 04 Sep 2012 20:10:47 +0200 Original-Received: from localhost ([::1]:53501 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8xaF-0004JJ-RI for ged-emacs-devel@m.gmane.org; Tue, 04 Sep 2012 14:10:43 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41971) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8xaA-0004Hi-G6 for emacs-devel@gnu.org; Tue, 04 Sep 2012 14:10:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T8xa9-0004ai-AC for emacs-devel@gnu.org; Tue, 04 Sep 2012 14:10:38 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]:34546) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8xa9-0004WZ-2r; Tue, 04 Sep 2012 14:10:37 -0400 Original-Received: from ip-200-13-149-91.dialup.ice.net ([91.149.13.200] helo=rusty) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1T8xZr-0003OF-IB; Tue, 04 Sep 2012 20:10:23 +0200 In-Reply-To: (Stefan Monnier's message of "Sun, 13 May 2012 22:20:36 -0400") User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.50 (gnu/linux) X-MailScanner-ID: 1T8xZr-0003OF-IB MailScanner-NULL-Check: 1347387023.45672@jby3qmuKNyLEpDC8Hrf/oA X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.224.195 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:153005 Archived-At: Stefan Monnier 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