From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Is there a way to inhibit message3 from Elisp? Date: Wed, 22 Apr 2015 13:53:29 +0300 Message-ID: <83618o4eom.fsf@gnu.org> References: <87618psiu4.fsf@gmail.com> <87a8y1l3ho.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1429700123 9839 80.91.229.3 (22 Apr 2015 10:55:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 22 Apr 2015 10:55:23 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Oleh Krehel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 22 12:55:14 2015 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 1YksJE-0000GR-E6 for ged-emacs-devel@m.gmane.org; Wed, 22 Apr 2015 12:55:12 +0200 Original-Received: from localhost ([::1]:34328 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YksJE-0006ay-0C for ged-emacs-devel@m.gmane.org; Wed, 22 Apr 2015 06:55:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54994) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YksIv-0006Yt-OG for emacs-devel@gnu.org; Wed, 22 Apr 2015 06:54:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YksIr-0002FU-OD for emacs-devel@gnu.org; Wed, 22 Apr 2015 06:54:53 -0400 Original-Received: from mtaout24.012.net.il ([80.179.55.180]:48973) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YksIr-0002FP-Gq for emacs-devel@gnu.org; Wed, 22 Apr 2015 06:54:49 -0400 Original-Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0NN700A00EVY9700@mtaout24.012.net.il> for emacs-devel@gnu.org; Wed, 22 Apr 2015 13:44:43 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NN7002DFF6JY280@mtaout24.012.net.il>; Wed, 22 Apr 2015 13:44:43 +0300 (IDT) In-reply-to: <87a8y1l3ho.fsf@gmail.com> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.180 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:185771 Archived-At: > From: Oleh Krehel > Date: Tue, 21 Apr 2015 20:50:59 +0200 > Cc: emacs-devel@gnu.org > > Please check the scratch/inhibit-message3 branch. > I don't have experience with Emacs C code, let me know if I'm doing > something in a silly way. Some comments below. > I got this code to work as I expect: > > (progn > (setq inhibit-message t) > (message "foo") > (setq inhibit-message nil)) > > However, this doesn't work: > > (let ((inhibit-message t)) > (message "foo")) How does it "not work"? It did for me. Some comments for the changes: . This variable is a boolean, so it's better to use DEFVAR_BOOL instead of DEFVAR_LISP. (Don't forget to change the test in message3 accordingly.) . The Emacs coding conventions are to use this: if (something) { do_whatever (); } rather than this: if (something) { do_whatever (); } Besides, when there's only one statement after 'if', you don't need the braces at all. . With your last change, the doc string is misleading, and should be updated. . The change should be accompanied by an entry in etc/NEWS. Bonus points for updating the ELisp manual as well. Thanks for working on this.