unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* I need to turn off defadvice warnings
@ 2012-01-06 22:47 jidanni
  2012-01-06 22:47 ` jidanni
  2012-01-06 23:49 ` Tassilo Horn
  0 siblings, 2 replies; 5+ 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] 5+ messages in thread

* Re: I need to turn off defadvice warnings
  2012-01-06 22:47 I need to turn off defadvice warnings jidanni
@ 2012-01-06 22:47 ` jidanni
  2012-01-06 23:49 ` Tassilo Horn
  1 sibling, 0 replies; 5+ 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] 5+ messages in thread

* Re: I need to turn off defadvice warnings
  2012-01-06 22:47 I need to turn off defadvice warnings jidanni
  2012-01-06 22:47 ` jidanni
@ 2012-01-06 23:49 ` Tassilo Horn
  1 sibling, 0 replies; 5+ 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] 5+ messages in thread

* 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; 5+ 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] 5+ 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; 5+ 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] 5+ messages in thread

end of thread, other threads:[~2012-01-13 13:11 UTC | newest]

Thread overview: 5+ 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
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

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