From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via CC-Mode-help Newsgroups: gmane.emacs.cc-mode.general,gmane.emacs.devel Subject: Re: Last use of defadvice in Emacs Date: Fri, 08 Apr 2022 13:39:58 -0400 Message-ID: References: Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20348"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: bug-cc-mode@gnu.org, emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: cc-mode-help-bounces@lists.sourceforge.net Fri Apr 08 19:40:30 2022 Return-path: Envelope-to: sf-cc-mode-help@m.gmane-mx.org Original-Received: from lists.sourceforge.net ([216.105.38.7]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ncsaz-00055P-OZ for sf-cc-mode-help@m.gmane-mx.org; Fri, 08 Apr 2022 19:40:30 +0200 Original-Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.94.2) (envelope-from ) id 1ncsar-0001hx-I0; Fri, 08 Apr 2022 17:40:20 +0000 Original-Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ncsaq-0001hr-BB for cc-mode-help@lists.sourceforge.net; Fri, 08 Apr 2022 17:40:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:MIME-Version:In-Reply-To:Date: References:Message-ID:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=+lfncxr3kHAlDI23L3w3qmoH3eI5SYGd6sy5fd9RErE=; b=i46JkPVZ1soH3nRN5WuxUI4XhP 9ZjWAVVYa5vBh+DzTsl2DLNEz3DdZ4KBP6vl6FNtD+bCP2XJULkSFBDFz10V6FBsuibl0SL+Y1cJm acXyFBgdQ0pzmhkGrelJ8/sJUl2iKXdDMK5b/QhfNh23OplOUw27twpJdzT/qThkMGCE=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:MIME-Version:In-Reply-To:Date:References:Message-ID:Subject: Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=+lfncxr3kHAlDI23L3w3qmoH3eI5SYGd6sy5fd9RErE=; b=HrYbJDAN7YAyxj1zrIhjX8a7rd a1RFAmdoj3Mq8ot9UdwMnzdM1VipdJRzvbbpyhGhY5EVV2WLLITMhVp9IjMwYepQeNUdsbqy/vZvX /2I/0qc4FyMrLcS3Rdz2IoAlyswBmrJbk6LQm1cCNklB7SqtFihcDzi3XnS8qw6bipjY=; Original-Received: from eggs.gnu.org ([209.51.188.92]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.94.2) id 1ncsan-009yMi-9N for cc-mode-help@lists.sourceforge.net; Fri, 08 Apr 2022 17:40:19 +0000 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:60426) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ncsae-0002x3-Sk; Fri, 08 Apr 2022 13:40:10 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id ADE1210020C; Fri, 8 Apr 2022 13:40:06 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id D675010012E; Fri, 8 Apr 2022 13:40:00 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1649439600; bh=o/fveT7bFrBTbkK5ukXv+r2YHSVYrpvON/EnrDD+iZI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=HNqLSPtgTnaeiTK0gNcFvyYFtI0Au/PkSKBGqKh3xeJLfPbcQ8IzJ2Q1LT+HLBDsQ GfF4kWro/FSQBIKXnlCIG73kwzbb3ezb4PqCNUSW+HbRV/4VCSBJHsk+5WfRdLZgl4 mMi+IO0cW/x50uUkjfIDykzc69MKjp6pCAy7ldSiRqZy6KAsJSMXjfhkaS/9mWqi63 Kdq+krJq/i57tasoWFXqZCDRILQccfHVXtfvbYx6d6/lgvEQFLmCuWuBMQ9G9ImlmV tT4U8KfSodovX+jEAs4SR0xcXjX5Q/UA0USmeZZCmqi80JrIDt5tSHqWj0uehvaVOB RvTd8fTVE+yyw== Original-Received: from alfajor (unknown [45.72.221.51]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 9F16B120478; Fri, 8 Apr 2022 13:40:00 -0400 (EDT) In-Reply-To: (Alan Mackenzie's message of "Fri, 8 Apr 2022 17:10:54 +0000") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Headers-End: 1ncsan-009yMi-9N X-BeenThere: cc-mode-help@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Bug reports, feature requests, and general talk about CC Mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: cc-mode-help-bounces@lists.sourceforge.net Xref: news.gmane.io gmane.emacs.cc-mode.general:8303 gmane.emacs.devel:287977 Archived-At: >> (defmacro url-http-ntlm--if-when-compile (cond &rest body) >> (declare (debug t) (indent 1)) >> (when (eval cond) >> `(progn ,@body))) > >> ;; Remove authorization after redirect. >> (url-http-ntlm--if-when-compile >> (and (boundp 'emacs-major-version) >> (< emacs-major-version 25)) >> ... >> ... Various code, including, incidentally, a `defadvice` ... >> ...) > > Here, a piece of `byte-code' gets compiled for the > url-http-ntlm--if-when-compile call. This is useless code without any > useful function. (I've just tried it.) That bytecode implements your #if feature. So if we care about that feature, we'd remove the `url-http-ntlm--` prefix and move it to lisp/subr.el, indeed. I agree that Emacs does not come with the equivalent of #if but the above macro shows that it can be implemented quite easily if we care to provide it. > I haven't been able to find AUCTeX's source code yet, but I'm not sure > this macro would meet the "no code at all" criterion, either. Again it depends if you count the code of the macro itself (which currently lives in AUCTeX but is fundamentally generic so could be moved to `subr.el`) rather than only the code resulting from the macroexpansion. Stefan