Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* using defadvice to delete other windows when hiding threads
@ 2002-09-11 12:45 Derrell.Lipman
  2002-09-11 15:23 ` Klaus Berndl
  0 siblings, 1 reply; 2+ messages in thread
From: Derrell.Lipman @ 2002-09-11 12:45 UTC (permalink / raw)


I'm trying to learn how to use defadvice to modify gnus behavior.

When I want to look only at the thread subjects in a group (T H) I always also
want to delete the other windows in the frame so that I see a larger portion
of the thread listing.

I've tried the following, which gives no error when being eval'ed, but also
does nothing at all when I do T H...

(defadvice gnus-summary-hide-all-threads (after activate)
  "Display only one window when hiding all threads"
  (delete-other-windows))

What am I doing wrong here?

Or is this entirely the wrong way to be going about this?  Should I just
define a new function that calls gnus-summary-hide-all-threads and
delete-other-windows, and bind T H to it?  I was hoping to use this as an
excuse to understand defadvice.

Thanks,

Derrell


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

* Re: using defadvice to delete other windows when hiding threads
  2002-09-11 12:45 using defadvice to delete other windows when hiding threads Derrell.Lipman
@ 2002-09-11 15:23 ` Klaus Berndl
  0 siblings, 0 replies; 2+ messages in thread
From: Klaus Berndl @ 2002-09-11 15:23 UTC (permalink / raw)


On Wed, 11 Sep 2002, Derrell Lipman wrote:

>  I'm trying to learn how to use defadvice to modify gnus behavior.
>  
>  When I want to look only at the thread subjects in a group (T H) I always
>  also want to delete the other windows in the frame so that I see a larger
>  portion of the thread listing.
>  
>  I've tried the following, which gives no error when being eval'ed, but also
>  does nothing at all when I do T H...
>  
>  (defadvice gnus-summary-hide-all-threads (after activate)
>    "Display only one window when hiding all threads"
>    (delete-other-windows))
>  
>  What am I doing wrong here?

You must give your defadvice a name (should be senseful). Read the
documentation of defadvice carefully and you will see what is wrong...
In your advice you have given the name "activate" because you forget the
second parameter of defadvice and therefore your advice has never been
activated....

(defadvice gnus-summary-hide-all-threads (after my-first-advice activate)
 ...)

will do what you want!


>  Or is this entirely the wrong way to be going about this?  Should I just
>  define a new function that calls gnus-summary-hide-all-threads and
>  delete-other-windows, and bind T H to it?  I was hoping to use this as an
>  excuse to understand defadvice.

No, IMHO your way is not a bad way, you habe just to go it in the right way
(see above)... :-)

Ciao,
Klaus

-- 
Klaus Berndl			mailto: klaus.berndl@sdm.de
sd&m AG				http://www.sdm.de
software design & management
Thomas-Dehler-Str. 27, 81737 München, Germany
Tel +49 89 63812-392, Fax -220


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

end of thread, other threads:[~2002-09-11 15:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-11 12:45 using defadvice to delete other windows when hiding threads Derrell.Lipman
2002-09-11 15:23 ` Klaus Berndl

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 NNTP newsgroup(s).