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


View this message in rfc822 format

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: bug#27016: possible bug in `defsetf'
Date: Mon, 10 Jul 2017 02:26:14 +0200
npostavs <at> users.sourceforge.net writes:

> Here's a patch for it: [...]

Thanks for working on this.  AFAIU I think it should work.

> @@ -146,12 +149,15 @@ (defmacro gv-define-expander (name handler)
>  HANDLER is a function which takes an argument DO followed by the same
>  arguments as NAME.  DO is a function as defined in `gv-get'."
>    (declare (indent 1) (debug (sexp form)))
> -  ;; Use eval-and-compile so the method can be used in the same file as it
> -  ;; is defined.
> -  ;; FIXME: Just like byte-compile-macro-environment, we should have something
> -  ;; like byte-compile-symbolprop-environment so as to handle these things
> -  ;; cleanly without affecting the running Emacs.
> -  `(eval-and-compile (put ',name 'gv-expander ,handler)))
> +  ;; Push onto `byte-compile-macro-environment' so the method can be
> +  ;; used in the same file as it is defined.
> +  (when (boundp 'byte-compile-macro-environment)
> +    (push (cons :gv-expanders
> +                (cons (cons name handler)
> +                      (cdr (assq :gv-expanders
> +                                 byte-compile-macro-environment))))
> +          byte-compile-macro-environment))
> +  `(put ',name 'gv-expander ,handler))

Is it intended to add an :gv-expanders entry to
byte-compile-macro-environment more than once?


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.