unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: 16319@debbugs.gnu.org
Subject: bug#16319: 24.3.50; `case' macro not expanded in advice
Date: Wed, 1 Jan 2014 14:05:18 -0800 (PST)	[thread overview]
Message-ID: <e734d1bf-4be7-450d-b804-5322495dc21e@default> (raw)

1. This bug:

emacs -Q

Put this in a file foo.el and byte-compile it.

(eval-when-compile (require 'cl)) ;; case, 

(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-UPDATE-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 
    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))))) 
  (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) 
  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=/c/Devel/emacs/binary --enable-checking=yes,glyphs
 'CFLAGS=-O0 -g3' LDFLAGS=-Lc:/Devel/emacs/lib
 CPPFLAGS=-Ic:/Devel/emacs/include'





             reply	other threads:[~2014-01-01 22:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-01 22:05 Drew Adams [this message]
2014-01-02 15:14 ` bug#16319: 24.3.50; `case' macro not expanded in advice Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e734d1bf-4be7-450d-b804-5322495dc21e@default \
    --to=drew.adams@oracle.com \
    --cc=16319@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).