From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Towards a cleaner build Date: Wed, 29 May 2019 13:17:30 +0200 Message-ID: References: <83pnohbhny.fsf@gnu.org> <83zhn6zkgf.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="48272"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Eli Zaretskii , Stefan Monnier , Emacs developers To: Noam Postavsky Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 29 13:17:56 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hVwah-000CQd-RJ for ged-emacs-devel@m.gmane.org; Wed, 29 May 2019 13:17:55 +0200 Original-Received: from localhost ([127.0.0.1]:51934 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVwag-0000mJ-RJ for ged-emacs-devel@m.gmane.org; Wed, 29 May 2019 07:17:54 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:44209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVwaV-0000l6-63 for emacs-devel@gnu.org; Wed, 29 May 2019 07:17:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVwaU-000818-4o for emacs-devel@gnu.org; Wed, 29 May 2019 07:17:43 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:35476) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVwaT-0007yM-VJ; Wed, 29 May 2019 07:17:42 -0400 Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hVwaJ-0007Kx-2i; Wed, 29 May 2019 13:17:35 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAALVBMVEVJLhb///pfbqJMW6v/ //5GSIQqCQKBk7P+/vz+//jR0s////z+//v///88GwTMPD2eAAABsUlEQVQ4jZWUMWvCQBTHHwUr XYTOUpCUUsng4tK1kC0EilCLDqUI1U2iRWxS8Iukg51aOhSELHLkQwg3FI4Dl6a45DP0XUwuiZ5D /8MR3u/+79073gWcU4KyDANX37CoxWMxcAhPlcRoAizT5/ui4GAOSwmIbwYqMOKK/TFQbE+KKwE6 /g0cVRcClD1JnpqprjgH1yNq0CGBGujZhewA7wBwqzwPai3tvNms46n0Qg2tdjdFPSPoehKMNW1y +1BKgJsBjEzmduVXAIapZIPv0+nYnld6W4eeORDMBl/rBHRJHrR7s9IgTWXlQOvRvmlpF/UisAGO fmq4wkk8V4axRbSGoXXpOAGXHkmqsMYaoAx9qEQbkco3kkysEa0hDIeZQwJ0hGG/EsUOl+QcUYQA teEEOrJxdo8Ao0PhWIAr++NtjInwFuhnORAOMVMkUi3AqcoGP6U+YiCLGKksKgAh4mNnHukCRvj2 AsZ35pEJ4LOgEPwWy0q8KK4QQ0dwCCjfQQrYPngzDwF18ZXow4r3F1/7NbyInwvZismDsKW4EgnE /0dMBqXmEvRXUpTPKTHJ8g+FGB56cpWIJwAAAABJRU5ErkJggg== In-Reply-To: (Noam Postavsky's message of "Tue, 28 May 2019 16:43:48 -0400") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 80.91.231.51 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:237146 Archived-At: Noam Postavsky writes: > On Tue, 28 May 2019 at 11:11, Lars Ingebrigtsen wrote: > >> +(defmacro with-suppressed-warnings (warnings &rest body) >> + "Like `progn', but prevents compiler warnings in the body." > > Not quite like progn, since WARNINGS (is that WARNINGS or WARNING, by > the way?) is not evaluated. > >> + (declare (indent 1)) > > A debug spec would be a good thing to have. Yup. >> + ;; The implementation for the interpreter is basically trivial. >> + `(with-suppressed-warnings-1 ',warnings (progn ,@body))) > > A comment here on why we need both a function and macro would be > useful (or is it possible to have this work with just a macro?) Let's see... Oh, right. `with-no-warnings' is a function, while I thought it would make sense for `with-suppressed-warnings' to be a macro since the WARNINGS are supposed to be unevaluated. But as a macro that expands to (basically) `progn', then the byte compiler just sees the `progn' and is unable to do anything with the form. So I needed to make the macro expand to something the byte compiler can pick up, which is `with-suppressed-warnings-1'. I'm completely open to me not understanding how the byte compiler works... because I don't, really. :-) But I tried using just a macro first, and I couldn't get the byte compiler to understand it. >> +(defun with-suppressed-warnings-1 (_ &rest body) >> + "Like `progn', but prevents compiler warnings in the body." >> + (declare (indent 1)) > > This should be called internal--with-suppressed-warnings-1, and the > (declare (indent 1)) thing left out, since nobody should be calling > this function directly anyway, right? Yup. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no