From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/86225 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.gnus.general Subject: Re: How to change definition of gnus-summary-exit? Date: Thu, 15 Oct 2015 22:17:12 +0200 Message-ID: <871tcvrinr.fsf@debian.uxu> References: <87io69jr5o.fsf@thinkpad.rath.org> <87si5diara.fsf@tullinup.koldfront.dk> <874mhsprmo.fsf@gnu.org> <87eggwvxat.fsf@thinkpad.rath.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1444939736 16061 80.91.229.3 (15 Oct 2015 20:08:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Oct 2015 20:08:56 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M34459@lists.math.uh.edu Thu Oct 15 22:08:41 2015 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from lists1.math.uh.edu ([129.7.128.208]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZmopK-0002rn-41 for ding-account@gmane.org; Thu, 15 Oct 2015 22:08:38 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.85) (envelope-from ) id 1Zmoow-0006P6-1P; Thu, 15 Oct 2015 15:08:14 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by lists1.math.uh.edu with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.85) (envelope-from ) id 1Zmoot-0006Oi-82 for ding@lists.math.uh.edu; Thu, 15 Oct 2015 15:08:11 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.85) (envelope-from ) id 1Zmoor-0000ae-8V for ding@lists.math.uh.edu; Thu, 15 Oct 2015 15:08:11 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]) by quimby.gnus.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1Zmoop-0000q5-JX for ding@gnus.org; Thu, 15 Oct 2015 22:08:07 +0200 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Zmook-0002G1-Mm for ding@gnus.org; Thu, 15 Oct 2015 22:08:02 +0200 Original-Received: from nl106-137-244.student.uu.se ([130.243.137.244]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 15 Oct 2015 22:08:02 +0200 Original-Received: from embe8573 by nl106-137-244.student.uu.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 15 Oct 2015 22:08:02 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-Lines: 42 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: nl106-137-244.student.uu.se Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:gsv6L/1T1ZjrTsUPzgoFmECMjYE= X-Spam-Score: -2.9 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:86225 Archived-At: Nikolaus Rath writes: > What's an advice (in this context)? An advice can be a lot of things, in the Emacs context, but in the context of your issue, I suspect the person who gave the piece of advice to use an advice, he suspected that you want something to always happen say, before or after the invocation of the regular function. This can be done with advices. Here is an example that I use, which isn't complicated to figure out what it does: (advice-add 'gnus-summary-insert-old-articles :after (lambda (dummy) (gnus-apply-kill-file))) Typically, advices are used when you don't want any major and complicated changes to a function. (But there are many thing that can be done with them.) However, just because they can be done doesn't mean that is the best way, and always so. Indeed, sometimes it is better to redefine the function as you did. However, in my experience the *best* way to do it is to write a brand new function - use the existing code if need be, but do everything new - that way, no collisions, the help is intact, etc. But the best advantage to this method is security. Because say you invoke function F at situation S. It doesn't do exactly what you want. So you change F and all is well - *at S*! But often F is used in other situations, and even by other software which you are unaware of. So instead, copy and edit F into F', and at S, change the keybinding that previously invoked F, so that it now invokes F'! -- underground experts united http://user.it.uu.se/~embe8573