From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/1119 Path: news.gmane.org!not-for-mail From: Klaus Berndl Newsgroups: gmane.emacs.gnus.user Subject: Re: using defadvice to delete other windows when hiding threads Date: 11 Sep 2002 17:23:25 +0200 Organization: UTA/netway (Customer) Message-ID: References: <65xc4rum.fsf@random.localnet.UnwiredUniverse.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1138667939 9894 80.91.229.2 (31 Jan 2006 00:38:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 31 Jan 2006 00:38:59 +0000 (UTC) Original-X-From: nobody Tue Jan 17 17:28:39 2006 Original-Path: quimby.gnus.org!lackawana.kippona.com!news.stealth.net!news.stealth.net!newsfeed.freenet.de!newsfeed.r-kom.de!newsfeed.completel.de!news.netway.at!not-for-mail Original-Newsgroups: gnu.emacs.gnus Original-NNTP-Posting-Host: 195.96.24.28 Original-X-Trace: newsreader1.netway.at 1031757996 6114 195.96.24.28 (11 Sep 2002 15:26:36 GMT) Original-X-Complaints-To: abuse@netway.at Original-NNTP-Posting-Date: 11 Sep 2002 15:26:36 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 X-Forwarded: by - (DeleGate/7.5.3) Original-Xref: bridgekeeper.physik.uni-ulm.de gnus-emacs-gnus:1259 Original-Lines: 46 X-Gnus-Article-Number: 1259 Tue Jan 17 17:28:39 2006 Xref: news.gmane.org gmane.emacs.gnus.user:1119 Archived-At: 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