* I need to turn off defadvice warnings
@ 2012-01-06 22:47 jidanni
2011-12-28 21:22 ` bug#10392: mention ad-handle-definition startup warnings jidanni
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: jidanni @ 2012-01-06 22:47 UTC (permalink / raw)
To: help-gnu-emacs; +Cc: yamaoka
A friend told me to use
(defadvice gnus-summary-select-article-buffer ...
But now I get
ad-handle-definition: `gnus-summary-select-article-buffer' got redefined
warnings.
Is there anyway to turn them off?
(info "(elisp) Advising Functions")
doesn't mention the warnings!
Can I turn them off for just this one advice?
Or is the only way rewrite the whole function with defun?
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#10392: mention ad-handle-definition startup warnings
@ 2011-12-28 21:22 ` jidanni
2012-01-06 20:15 ` Glenn Morris
2012-01-06 22:47 ` bug#10392: I need to turn off defadvice warnings jidanni
0 siblings, 2 replies; 8+ messages in thread
From: jidanni @ 2011-12-28 21:22 UTC (permalink / raw)
To: 10392; +Cc: yamaoka
X-Debbugs-Cc: yamaoka@jpl.org
(info "(elisp) Advising Functions")
doesn't mention that e.g., putting
(defadvice gnus-summary-select-article-buffer (after jump-to-html-part
activate)
"Jump to an html part that emacs-w3m rendered, if any."
(unless (get-text-property (point) 'mm-inline-text-html-with-w3m)
(let ((pos (text-property-any (point-min) (point-max)
'mm-inline-text-html-with-w3m t)))
(gnus-goto-char pos))))
in .gnus.el will cause startup warnings
ad-handle-definition: `gnus-summary-select-article-buffer' got redefined
for the rest of one's life, with no mention of workarounds to turn them
off either.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#10392: mention ad-handle-definition startup warnings
2011-12-28 21:22 ` bug#10392: mention ad-handle-definition startup warnings jidanni
@ 2012-01-06 20:15 ` Glenn Morris
2012-01-06 22:47 ` bug#10392: I need to turn off defadvice warnings jidanni
1 sibling, 0 replies; 8+ messages in thread
From: Glenn Morris @ 2012-01-06 20:15 UTC (permalink / raw)
To: 10392-done
tags 10392 notabug
stop
jidanni@jidanni.org wrote:
> doesn't mention that e.g., putting
>
> (defadvice gnus-summary-select-article-buffer (after jump-to-html-part
> activate)
> "Jump to an html part that emacs-w3m rendered, if any."
> (unless (get-text-property (point) 'mm-inline-text-html-with-w3m)
> (let ((pos (text-property-any (point-min) (point-max)
> 'mm-inline-text-html-with-w3m t)))
> (gnus-goto-char pos))))
>
> in .gnus.el will cause startup warnings
>
> ad-handle-definition: `gnus-summary-select-article-buffer' got redefined
By itself, it does not.
> for the rest of one's life, with no mention of workarounds to turn them
> off either.
C-h v ad-redefinition-action
Ask on help-gnu-emacs if you need more explanation about using advice.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#10392: I need to turn off defadvice warnings
2011-12-28 21:22 ` bug#10392: mention ad-handle-definition startup warnings jidanni
2012-01-06 20:15 ` Glenn Morris
@ 2012-01-06 22:47 ` jidanni
1 sibling, 0 replies; 8+ messages in thread
From: jidanni @ 2012-01-06 22:47 UTC (permalink / raw)
To: 10392, help-gnu-emacs; +Cc: yamaoka
OK,
(info "(elisp) Advising Functions")
should mention that advising functions will produce warnings.
And to turn off the warnings, one needs to (setq ad-redefinition-action 'accept),
and one cannot just turn them off for one advice, with e.g., let().
;(let ((ad-redefinition-action 'accept))
(setq ad-redefinition-action 'accept)
(defadvice gnus-summary-select-article-buffer (after jump-to-html-part
activate)
"Jump to an html part that emacs-w3m rendered, if any."
(unless (get-text-property (point) 'mm-inline-text-html-with-w3m)
(let ((pos (text-property-any (point-min) (point-max)
'mm-inline-text-html-with-w3m t)))
(gnus-goto-char pos))))
;)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: I need to turn off defadvice warnings
2012-01-06 22:47 I need to turn off defadvice warnings jidanni
2011-12-28 21:22 ` bug#10392: mention ad-handle-definition startup warnings jidanni
@ 2012-01-06 22:47 ` jidanni
2012-01-06 23:49 ` Tassilo Horn
2 siblings, 0 replies; 8+ messages in thread
From: jidanni @ 2012-01-06 22:47 UTC (permalink / raw)
Cc: yamaoka
OK,
(info "(elisp) Advising Functions")
should mention that advising functions will produce warnings.
And to turn off the warnings, one needs to (setq ad-redefinition-action 'accept),
and one cannot just turn them off for one advice, with e.g., let().
;(let ((ad-redefinition-action 'accept))
(setq ad-redefinition-action 'accept)
(defadvice gnus-summary-select-article-buffer (after jump-to-html-part
activate)
"Jump to an html part that emacs-w3m rendered, if any."
(unless (get-text-property (point) 'mm-inline-text-html-with-w3m)
(let ((pos (text-property-any (point-min) (point-max)
'mm-inline-text-html-with-w3m t)))
(gnus-goto-char pos))))
;)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: I need to turn off defadvice warnings
2012-01-06 22:47 I need to turn off defadvice warnings jidanni
2011-12-28 21:22 ` bug#10392: mention ad-handle-definition startup warnings jidanni
2012-01-06 22:47 ` jidanni
@ 2012-01-06 23:49 ` Tassilo Horn
2 siblings, 0 replies; 8+ messages in thread
From: Tassilo Horn @ 2012-01-06 23:49 UTC (permalink / raw)
To: help-gnu-emacs
jidanni@jidanni.org writes:
> A friend told me to use
> (defadvice gnus-summary-select-article-buffer ...
>
> But now I get
> ad-handle-definition: `gnus-summary-select-article-buffer' got redefined
> warnings.
>
> Is there anyway to turn them off?
Don't simply turn off a warning, but check what causes it. In your
case, the warning tells you that
gnus-summary-select-article-buffer
already has an advice on it. Your new defadvice deactivates the old
piece of advice and activates the new one.
Bye,
Tassilo
^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <mailman.1325.1325893818.15002.help-gnu-emacs@gnu.org>]
* Re: I need to turn off defadvice warnings
[not found] <mailman.1325.1325893818.15002.help-gnu-emacs@gnu.org>
@ 2012-01-13 0:00 ` jidanni
2012-01-13 13:11 ` Tassilo Horn
0 siblings, 1 reply; 8+ messages in thread
From: jidanni @ 2012-01-13 0:00 UTC (permalink / raw)
To: tassilo; +Cc: help-gnu-emacs
>>>>> "TH" == Tassilo Horn <tassilo@member.fsf.org> writes:
TH> jidanni@jidanni.org writes:
>> A friend told me to use
>> (defadvice gnus-summary-select-article-buffer ...
>>
>> But now I get
>> ad-handle-definition: `gnus-summary-select-article-buffer' got redefined
>> warnings.
>>
>> Is there anyway to turn them off?
TH> Don't simply turn off a warning, but check what causes it. In your
TH> case, the warning tells you that
TH> gnus-summary-select-article-buffer
TH> already has an advice on it. Your new defadvice deactivates the old
TH> piece of advice and activates the new one.
Well,
that would be nice,
if that was the case.
Unfortunately it is not,
as far as I can tell.
You are welcome to try,
it is all in
http://jidanni.org/comp/configuration/
Yes I had to use
(setq ad-redefinition-action 'accept)
to get it to shut up.
No, if I don't advise it, describe-function doesn't show where it was
advised previously.
No I don't know why this advise makes noise but my others don't.
Also if what you say is true, then I say the message ought to be
> ad-handle-definition: `gnus-summary-select-article-buffer'*S ADVICE* got redefined
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: I need to turn off defadvice warnings
2012-01-13 0:00 ` jidanni
@ 2012-01-13 13:11 ` Tassilo Horn
0 siblings, 0 replies; 8+ messages in thread
From: Tassilo Horn @ 2012-01-13 13:11 UTC (permalink / raw)
To: help-gnu-emacs
jidanni@jidanni.org writes:
>>> But now I get
>>> ad-handle-definition: `gnus-summary-select-article-buffer' got redefined
>>> warnings.
>>>
>>> Is there anyway to turn them off?
>
> TH> Don't simply turn off a warning, but check what causes it. In your
> TH> case, the warning tells you that
>
> TH> gnus-summary-select-article-buffer
>
> TH> already has an advice on it. Your new defadvice deactivates the old
> TH> piece of advice and activates the new one.
>
> Well,
>
> that would be nice,
>
> if that was the case.
>
> Unfortunately it is not,
> as far as I can tell.
Yeah, I was wrong. You can put as many advices at a function as you
want.
But at least, I know what causes the warning. Here's a recipe:
--8<---------------cut here---------------start------------->8---
(defun foo-foo ())
(defadvice foo-foo (before foo activate))
(defun foo-foo ())
--8<---------------cut here---------------end--------------->8---
So you first define an advice on the function `foo-foo', and then the
function gets redefined. In your case,
`gnus-summary-select-article-buffer' gets redefined at some point in
time. Not sure why, though...
What you can try is this:
M-: (setq ad-redefinition-action 'error)
M-x toggle-debug-on-error RET
M-x gnus RET
I suspect something first loads the gnus version bundled with emacs, and
then you load the git version. But I cannot find the source of the
problem in your configs (which are pretty confusing.) :-)
Bye,
Tassilo
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-01-13 13:11 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-06 22:47 I need to turn off defadvice warnings jidanni
2011-12-28 21:22 ` bug#10392: mention ad-handle-definition startup warnings jidanni
2012-01-06 20:15 ` Glenn Morris
2012-01-06 22:47 ` bug#10392: I need to turn off defadvice warnings jidanni
2012-01-06 22:47 ` jidanni
2012-01-06 23:49 ` Tassilo Horn
[not found] <mailman.1325.1325893818.15002.help-gnu-emacs@gnu.org>
2012-01-13 0:00 ` jidanni
2012-01-13 13:11 ` Tassilo Horn
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.