unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#15666: 24.3.50; regression: `defadvice' of a special form
@ 2013-10-20 23:15 Drew Adams
  2013-10-20 23:32 ` Drew Adams
  2021-05-30  5:45 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 4+ messages in thread
From: Drew Adams @ 2013-10-20 23:15 UTC (permalink / raw)
  To: 15666

(elisp) `Defining Advice' says that you can use `defadvice' to advise a
special form.  It is quite clear about this:

  "Here, FUNCTION is the name of the function (or macro or special form)
  to be advised.  From now on, we will write just "function" when
  describing the entity being advised, but this always includes macros
                                           ^^^^^^^^^^^^^^^^^^^^
  and special forms."
      ^^^^^^^^^^^^^

And indeed it does...in Emacs 20.  But this was apparently broken,
starting with Emacs 22 (I don't have 21 to test there).  In Emacs 20,
this works fine:

(defadvice defconst (after foo last activate)
  (put (ad-get-arg 0) 'foo-prop t))

In Emacs 22 you get this: (error "Invalid lambda variable [docstring]").
In Emacs 24 you get this:

 (error "Advice impossible: defconst is a special form")

Please reverse the regression, allowing use of `defadvice' with special
forms, as the doc claims and as was in fact the case prior to Emacs 22.


In GNU Emacs 24.3.50.1 (i686-pc-mingw32)
 of 2013-10-19 on LEG570
Bzr revision: 114715 rgm@gnu.org-20131019023520-s8mwtib7xcx9e05w
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --enable-checking 'CFLAGS=-O0 -g3' CPPFLAGS=-DGLYPH_DEBUG=1'





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#15666: 24.3.50; regression: `defadvice' of a special form
  2013-10-20 23:15 bug#15666: 24.3.50; regression: `defadvice' of a special form Drew Adams
@ 2013-10-20 23:32 ` Drew Adams
  2021-05-30  5:45 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 4+ messages in thread
From: Drew Adams @ 2013-10-20 23:32 UTC (permalink / raw)
  To: 15666

> In Emacs 24 you get this:
>  (error "Advice impossible: defconst is a special form")

And the code that raises that error has this comment:

(cond
   ((special-form-p def)
    ;; Not worth the trouble trying to handle this, I think.
    (error "Advice impossible: %S is a special form" symbol))

"I think"?  That does not justify this regression.

It was worth the trouble before it was broken, i.e., for a
couple of decades.  Why go to the "trouble" of breaking it?





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#15666: 24.3.50; regression: `defadvice' of a special form
  2013-10-20 23:15 bug#15666: 24.3.50; regression: `defadvice' of a special form Drew Adams
  2013-10-20 23:32 ` Drew Adams
@ 2021-05-30  5:45 ` Lars Ingebrigtsen
  2021-05-30 14:32   ` bug#15666: [External] : " Drew Adams
  1 sibling, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-05-30  5:45 UTC (permalink / raw)
  To: Drew Adams; +Cc: 15666

Drew Adams <drew.adams@oracle.com> writes:

> (elisp) `Defining Advice' says that you can use `defadvice' to advise a
> special form.  It is quite clear about this:
>
>   "Here, FUNCTION is the name of the function (or macro or special form)
>   to be advised.  From now on, we will write just "function" when
>   describing the entity being advised, but this always includes macros
>                                            ^^^^^^^^^^^^^^^^^^^^
>   and special forms."
>       ^^^^^^^^^^^^^

The manual now says:

  Special forms (@pxref{Special Forms}) cannot be advised, however macros can
be advised, in much the same way as functions.

And I don't think we want to change this at this point, so I'm closing
this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#15666: [External] : Re: bug#15666: 24.3.50; regression: `defadvice' of a special form
  2021-05-30  5:45 ` Lars Ingebrigtsen
@ 2021-05-30 14:32   ` Drew Adams
  0 siblings, 0 replies; 4+ messages in thread
From: Drew Adams @ 2021-05-30 14:32 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 15666@debbugs.gnu.org

> The manual now says:
> 
>   Special forms (@pxref{Special Forms}) cannot be advised, however
>   macros can be advised, in much the same way as functions.
> 
> And I don't think we want to change this at this point, so I'm closing
> this bug report.

The manual now says that because the regression was
just baked in.  It's still a regression in behavior
for Emacs users.  Really too bad.

This should at least be left open, for possible
fixing at some point by a new generation of Emacs
developers.

It's not like this loss is actually _desired_, is it?
Do you have an argument (other than "that's the way
it is now, and that's how it's doc'd") for why this
loss is _beneficial_?  At the very least, this should
be wishlist, IMO: a regression fix to hope for.







^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-30 14:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-20 23:15 bug#15666: 24.3.50; regression: `defadvice' of a special form Drew Adams
2013-10-20 23:32 ` Drew Adams
2021-05-30  5:45 ` Lars Ingebrigtsen
2021-05-30 14:32   ` bug#15666: [External] : " Drew Adams

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).