From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#16319: 24.3.50; `case' macro not expanded in advice Date: Wed, 1 Jan 2014 14:05:18 -0800 (PST) Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1388613992 24150 80.91.229.3 (1 Jan 2014 22:06:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 1 Jan 2014 22:06:32 +0000 (UTC) To: 16319@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 01 23:06:35 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1VyTvp-0002ab-GG for geb-bug-gnu-emacs@m.gmane.org; Wed, 01 Jan 2014 23:06:29 +0100 Original-Received: from localhost ([::1]:42556 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VyTvp-00052X-2M for geb-bug-gnu-emacs@m.gmane.org; Wed, 01 Jan 2014 17:06:29 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60031) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VyTvb-00051X-VM for bug-gnu-emacs@gnu.org; Wed, 01 Jan 2014 17:06:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VyTvO-0000Ch-Pe for bug-gnu-emacs@gnu.org; Wed, 01 Jan 2014 17:06:15 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42649) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VyTvO-0000CP-LY for bug-gnu-emacs@gnu.org; Wed, 01 Jan 2014 17:06:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VyTvO-000181-6d for bug-gnu-emacs@gnu.org; Wed, 01 Jan 2014 17:06:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 Jan 2014 22:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 16319 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13886139534320 (code B ref -1); Wed, 01 Jan 2014 22:06:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Jan 2014 22:05:53 +0000 Original-Received: from localhost ([127.0.0.1]:56668 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VyTvE-00017c-I4 for submit@debbugs.gnu.org; Wed, 01 Jan 2014 17:05:52 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:58220) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VyTvD-00017U-0Q for submit@debbugs.gnu.org; Wed, 01 Jan 2014 17:05:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VyTv2-0000AM-Jg for submit@debbugs.gnu.org; Wed, 01 Jan 2014 17:05:50 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:40792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VyTv2-0000AI-Ez for submit@debbugs.gnu.org; Wed, 01 Jan 2014 17:05:40 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59941) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VyTut-00050W-QK for bug-gnu-emacs@gnu.org; Wed, 01 Jan 2014 17:05:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VyTuk-00008q-Tj for bug-gnu-emacs@gnu.org; Wed, 01 Jan 2014 17:05:31 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:20988) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VyTuk-00008m-Nr for bug-gnu-emacs@gnu.org; Wed, 01 Jan 2014 17:05:22 -0500 Original-Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id s01M5KAn030795 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 1 Jan 2014 22:05:21 GMT Original-Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s01M5JnQ024759 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 1 Jan 2014 22:05:20 GMT Original-Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s01M5Jrh023217 for ; Wed, 1 Jan 2014 22:05:19 GMT X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:82806 Archived-At: 1. This bug: emacs -Q Put this in a file foo.el and byte-compile it. (eval-when-compile (require 'cl)) ;; case,=20 (when (fboundp 'file-cache-add-file) (defadvice file-cache-add-file (around bmkp-autofile-filecache activate) "Respect option `bmkp-autofile-filecache'." (case bmkp-autofile-filecache (autofile-only (bmkp-autofile-set (ad-get-arg 0) nil nil 'NO-UPDA= TE-P)) (autofile+cache (progn ad-do-it (bmkp-autofile-set (ad-get-arg 0)= nil nil 'NO-UPDATE-P 'MSG-P))) (cache-only ad-do-it)))) emacs -Q M-x load-file foo.elc M-: (file-cache-add-file "foo.el") Debugger entered--Lisp error: (void-function case) (case bmkp-autofile-filecache (autofile-only (bmkp-autofile-set file=20 nil nil (quote NO-UPDATE-P))) (autofile+cache (progn (setq ad-return-value (with-no-warnings (funcall ad--addoit-function file))) (bmkp-autofile-set file nil nil (quote NO-UPDATE-P) (quote MSG-P)))) (cache-only (setq ad-return-value (with-no-warnings (funcall ad--addoit-function file)))))=20 (let (ad-return-value) (case bmkp-autofile-filecache (autofile-only (bmkp-autofile-set file nil nil (quote NO-UPDATE-P))) (autofile+cache (progn (setq ad-return-value (with-no-warnings (funcall ad--addoit-function file))) (bmkp-autofile-set file nil nil (quote NO-UPDATE-P) (quote MSG-P)))) (cache-only (setq ad-return-value (with-no-warnings (funcall ad--addoit-function file))))) ad-return-value)=20 ad-Advice-file-cache-add-file(#[...]) file-cache-add-file("foo.el") eval((file-cache-add-file "foo.el") nil) eval-expression((file-cache-add-file "foo.el") nil) call-interactively(eval-expression nil nil) command-execute(eval-expression) 2. Another (minor), related bug: As a workaround, I defined a helper function, which has just the `case' sexp, and I use that in the defadvice. But then I get a warning about `ad-do-it' being an undefined variable. So I work around that by adding (defvar ad-do-it). But that's not right either, since `ad-do-it' is not a variable. Fixing #1 will take care of #2. If you do not fix #1 then at least the byte-compiler should not flag `ad-do-it' as an undefined variable. In GNU Emacs 24.3.50.1 (i686-pc-mingw32) of 2013-12-27 on ODIEONE Bzr revision: 115778 rgm@gnu.org-20131228000456-1797o8z6veuyozs0 Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --prefix=3D/c/Devel/emacs/binary --enable-checking=3Dyes,glyphs 'CFLAGS=3D-O0 -g3' LDFLAGS=3D-Lc:/Devel/emacs/lib CPPFLAGS=3D-Ic:/Devel/emacs/include'