unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#7693: 24.0.50, 23.2.91; advice to kill-new causes warning
@ 2010-12-21  0:44 Katsumi Yamaoka
  2010-12-23 15:37 ` Stefan Monnier
  2017-10-14  6:30 ` Noam Postavsky
  0 siblings, 2 replies; 4+ messages in thread
From: Katsumi Yamaoka @ 2010-12-21  0:44 UTC (permalink / raw)
  To: 7693; +Cc: Herbert J. Skuhra

Maybe it's harmless but surprises me a bit.

(require 'bytecomp)
(defadvice kill-new (before nop activate))

This causes a warning in the "*Compile-Log*" buffer as follows:

Warning: ad-Orig-kill-new called with 3 arguments, but accepts only 1-2

It is because the arglist of `kill-new' is still
(string &optional replace yank-handler), that `advice' recognizes
by using `symbol-function'.  Any idea?

;; Emacs-w3m advises `kill-new' for some reason.





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

* bug#7693: 24.0.50, 23.2.91; advice to kill-new causes warning
  2010-12-21  0:44 bug#7693: 24.0.50, 23.2.91; advice to kill-new causes warning Katsumi Yamaoka
@ 2010-12-23 15:37 ` Stefan Monnier
  2017-10-14  6:30 ` Noam Postavsky
  1 sibling, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2010-12-23 15:37 UTC (permalink / raw)
  To: Katsumi Yamaoka; +Cc: Herbert J. Skuhra, 7693

severity 7693 minor
thanks

> Maybe it's harmless but surprises me a bit.

Indeed, it's harmless, and it's admittedly unjustified.

> (require 'bytecomp)
> (defadvice kill-new (before nop activate))

> This causes a warning in the "*Compile-Log*" buffer as follows:

> Warning: ad-Orig-kill-new called with 3 arguments, but accepts only 1-2

> It is because the arglist of `kill-new' is still
> (string &optional replace yank-handler), that `advice' recognizes
> by using `symbol-function'.  Any idea?

I think it's right for the advice to use the obsolete (string &optional
replace yank-handler) rather than the advertised arglist, so what we'd
need to do here is just silence the warning (rather than change the code
generated by defadvice).

We already have a few other cases where we emit warnings for obsolete
vars and functions that aren't justified (typically in the code that
implements those obsolete objects).  It would be good to figure out how
to cleanly silence such warnings.


        Stefan





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

* bug#7693: 24.0.50, 23.2.91; advice to kill-new causes warning
  2010-12-21  0:44 bug#7693: 24.0.50, 23.2.91; advice to kill-new causes warning Katsumi Yamaoka
  2010-12-23 15:37 ` Stefan Monnier
@ 2017-10-14  6:30 ` Noam Postavsky
  2017-10-15 23:42   ` Katsumi Yamaoka
  1 sibling, 1 reply; 4+ messages in thread
From: Noam Postavsky @ 2017-10-14  6:30 UTC (permalink / raw)
  To: Katsumi Yamaoka; +Cc: Herbert J. Skuhra, 7693

Katsumi Yamaoka <yamaoka@jpl.org> writes:

> Maybe it's harmless but surprises me a bit.
>
> (require 'bytecomp)
> (defadvice kill-new (before nop activate))
>
> This causes a warning in the "*Compile-Log*" buffer as follows:

I tried compiling a file containing the above statements in newer
(24.3..26) emacs and got no warnings.  Not sure if the behaviour has
changed, or I misunderstood the report.





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

* bug#7693: 24.0.50, 23.2.91; advice to kill-new causes warning
  2017-10-14  6:30 ` Noam Postavsky
@ 2017-10-15 23:42   ` Katsumi Yamaoka
  0 siblings, 0 replies; 4+ messages in thread
From: Katsumi Yamaoka @ 2017-10-15 23:42 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: Herbert J. Skuhra, 7693-done

On Sat, 14 Oct 2017 02:30:09 -0400, Noam Postavsky wrote:
> Katsumi Yamaoka <yamaoka@jpl.org> writes:

>> Maybe it's harmless but surprises me a bit.

>> (require 'bytecomp)
>> (defadvice kill-new (before nop activate))

>> This causes a warning in the "*Compile-Log*" buffer as follows:

> I tried compiling a file containing the above statements in newer
> (24.3..26) emacs and got no warnings.  Not sure if the behaviour has
> changed, or I misunderstood the report.

I got no warning in some Emacs 23.2 .. 27.0.50 vesions, too.
Though I found no related description in the ChangeLog files,
it might have been fixed by a side effect of something (a major
change in advice.el, etc.).  Otherwise it might have been just
a discrepancy arisen temporarily in Dec 2010.  So, I'm closing
this bug.  Thanks.

Regards,





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

end of thread, other threads:[~2017-10-15 23:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-21  0:44 bug#7693: 24.0.50, 23.2.91; advice to kill-new causes warning Katsumi Yamaoka
2010-12-23 15:37 ` Stefan Monnier
2017-10-14  6:30 ` Noam Postavsky
2017-10-15 23:42   ` Katsumi Yamaoka

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