GNU bug report logs - #27016
possible bug in `defsetf'

Previous Next

Package: emacs;

Reported by: Rafael D Sorkin <rsorkin <at> perimeterinstitute.ca>

Date: Mon, 22 May 2017 06:40:01 UTC

Severity: minor

Tags: fixed, patch

Found in versions 24.4, 25.2

Fixed in version 26.1

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


Message #102 received at 27016 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: npostavs <at> users.sourceforge.net
Cc: 27016 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 Rafael D Sorkin <rsorkin <at> perimeterinstitute.ca>
Subject: Re: bug#27016: possible bug in `defsetf'
Date: Mon, 03 Jul 2017 13:25:57 +0200
npostavs <at> users.sourceforge.net writes:

> I hope someone will correct me if I've gotten mixed up again, but I
> believe the byte-compiled case already works fine:
>
>     ~/src/emacs$ cat bug-27016-defsetf.el
>     (require 'cl)
>
>     (defvar pair nil)
>     (setq pair (cons 3 4))
>     (when nil
>       (defalias 'foobar 'cons)
>       (defsetf foobar setcar))
>     ~/src/emacs$ emacs -Q -batch -f batch-byte-compile bug-27016-defsetf.el
>
>     In toplevel form:
>     bug-27016-defsetf.el:1:1:Warning: cl package required at runtime
>     bug-27016-defsetf.el:3:1:Warning: global/dynamic var ‘pair’ lacks a prefix
>     ~/src/emacs$ emacs -Q -batch -l bug-27016-defsetf.elc --eval '(setf (foobar pair) 0)'
>     Symbol’s function definition is void: \(setf\ foobar\)

Yes - if you use two separate Emacs instances.  The defsetf gets
evaluated in the Emacs that is used to compile the code
(unconditionally).

So what you state is not suspicious for a problem with a surprising side
effect when performing macroexpansion, right?


Michael.




This bug report was last modified 7 years and 290 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.