From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: more candidates for obsoletion Date: Sun, 13 May 2012 22:20:36 -0400 Message-ID: References: <87k40vptms.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1336962053 20522 80.91.229.3 (14 May 2012 02:20:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 14 May 2012 02:20:53 +0000 (UTC) Cc: Juanma Barranquero , sds@gnu.org, emacs-devel@gnu.org To: Lars Magne Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 14 04:20:52 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 1STku3-0002YJ-AR for ged-emacs-devel@m.gmane.org; Mon, 14 May 2012 04:20:51 +0200 Original-Received: from localhost ([::1]:41258 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1STku2-000728-Jl for ged-emacs-devel@m.gmane.org; Sun, 13 May 2012 22:20:50 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48250) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1STktz-00071s-8J for emacs-devel@gnu.org; Sun, 13 May 2012 22:20:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1STktw-0006IG-Tn for emacs-devel@gnu.org; Sun, 13 May 2012 22:20:46 -0400 Original-Received: from ironport-out.teksavvy.com ([206.248.143.162]:7175) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1STktw-0006Hs-Oc; Sun, 13 May 2012 22:20:44 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjEKACxOgk/O+IOn/2dsb2JhbABDtheCDAOBDIEIggkBAQQBViMFCws0EhQYDSSIHAW2MothhHkEpEWBXYMD X-IronPort-AV: E=Sophos;i="4.75,391,1330923600"; d="scan'208";a="180042484" Original-Received: from 206-248-131-167.dsl.teksavvy.com (HELO pastel.home) ([206.248.131.167]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 13 May 2012 22:20:39 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 959A558D29; Sun, 13 May 2012 22:20:36 -0400 (EDT) In-Reply-To: (Lars Magne Ingebrigtsen's message of "Sun, 13 May 2012 20:34:46 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.143.162 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:150476 Archived-At: > 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); > } Doesn't look too bad. A few questions and suggestions: - !NILP is implied y STRINGP. - You might prefer to use fast_string_match. - Is the recursive debugging a problem you've found to show up unavoidably all the time, or are you just being cautious? - 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. Stefan