From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Doug Lewan Newsgroups: gmane.emacs.help Subject: Re: Clear trailing whitespace on save, but not at the cursor Date: Thu, 22 Mar 2012 21:08:08 +0000 Message-ID: <495248DFDEA08C469BBDED2D4AA6C614409AB6@DAKIYA1.pegasus.local> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1332450367 13873 80.91.229.3 (22 Mar 2012 21:06:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 22 Mar 2012 21:06:07 +0000 (UTC) To: "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 22 22:06:06 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SApCr-0007OF-Ki for geh-help-gnu-emacs@m.gmane.org; Thu, 22 Mar 2012 22:06:01 +0100 Original-Received: from localhost ([::1]:42358 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SApCq-0000gE-QN for geh-help-gnu-emacs@m.gmane.org; Thu, 22 Mar 2012 17:06:00 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SApCk-0000fM-BJ for help-gnu-emacs@gnu.org; Thu, 22 Mar 2012 17:05:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SApCi-0002PV-N2 for help-gnu-emacs@gnu.org; Thu, 22 Mar 2012 17:05:53 -0400 Original-Received: from mailhost.shubertorg.com ([207.246.209.200]:50145 helo=webmail.shubertorg.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SApCi-0002PF-JL for help-gnu-emacs@gnu.org; Thu, 22 Mar 2012 17:05:52 -0400 Original-Received: from dakiya1.pegasus.local ([fe80::5ce2:4641:22cf:ff1f]) by DAKIYA1.pegasus.local ([::1]) with mapi id 14.01.0339.001; Thu, 22 Mar 2012 17:08:09 -0400 Thread-Topic: Re: Clear trailing whitespace on save, but not at the cursor Thread-Index: Ac0Ib43aTwVEe4iiQ+6QoIzYGMxPqg== Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.0.21.202] X-detected-operating-system: by eggs.gnu.org: Windows XP/2000 (RFC1323+, w+, tstamp-) X-Received-From: 207.246.209.200 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:84093 Archived-At: Aaron Meurer writes: > But it seems to me that the whole emacs lisp system is designed=20 > from the ground up to do hooking (by the way, where I come from, "hooking= " > is given the much auspicious name "monkey patching"). First:=20 Today I learned "monkey patching" (and, by going to Wikipedia, it's synonym= "duck punching"). Thanks for giving me a techno-chuckle. Second:=20 (Assuming I understand the meaning of monkey patching) Hooks are /not/ the = same thing. Hooks are favors you ask for when something happens. Hooks are = easily removed. Often they are if they are badly behaved. See the documenta= tion for after-change-functions. Advice seem like they fit the definition of monkey patching. A piece of adv= ice can be enabled and disabled, but it stays once it has been (defadvice)d= . The emacs lisp manual has lots of warnings about advice. It has legitimate = uses, but they are rare -- typically there's-no-other-darn-way-to-do-this k= ind of things. It's usually worthwhile spending time to find another way be= cause it's hard to write interesting advice that doesn't have unexpected co= nsequences. The emacs lisp manual has no general warnings about hooks. There's probably something to that. ,Douglas Douglas Lewan Shubert Ticketing (201) 489-8600 ext 224