From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Martin Stjernholm Newsgroups: gmane.emacs.devel Subject: Re: gratuitous changes Date: 10 Feb 2003 01:29:22 +0100 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <5badh5q8pp.fsf@lister.roxen.com> References: <5b3cn7lgx6.fsf@lister.roxen.com> <20030202061404.GB3660@gnu.org> <5bk7gd74hw.fsf@lister.roxen.com> <20030206172231.GA32231@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1044836953 14973 80.91.224.249 (10 Feb 2003 00:29:13 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 10 Feb 2003 00:29:13 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18i1oo-0003t9-00 for ; Mon, 10 Feb 2003 01:29:06 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18i1zY-00062T-00 for ; Mon, 10 Feb 2003 01:40:13 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18i1pp-0004bd-00 for emacs-devel@quimby.gnus.org; Sun, 09 Feb 2003 19:30:09 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18i1pK-00046I-00 for emacs-devel@gnu.org; Sun, 09 Feb 2003 19:29:38 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18i1pE-0003tH-00 for emacs-devel@gnu.org; Sun, 09 Feb 2003 19:29:33 -0500 Original-Received: from godzilla.roxen.com ([194.52.182.190] helo=mail.roxen.com) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18i1pA-0003lJ-00; Sun, 09 Feb 2003 19:29:28 -0500 Original-Received: by mail.roxen.com (Postfix, from userid 52) id 6A2E099CD; Mon, 10 Feb 2003 01:29:26 +0100 (MET) Original-Received: from lister.roxen.com (lister.roxen.com [194.52.182.147]) by mail.roxen.com (Postfix) with ESMTP id A469899CA; Mon, 10 Feb 2003 01:29:22 +0100 (MET) Original-To: Miles Bader In-Reply-To: <20030206172231.GA32231@gnu.org> Original-Lines: 29 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 Original-cc: Eli Zaretskii Original-cc: rms@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:11523 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:11523 Miles Bader wrote: > > It uses after-change-functions, post-command-hook, first-change-hook > > and write-contents-hooks. What's the problem with that? > > It slows down editing. /.../ I took care to ensure that they run very fast in the normal case. In the most common case, i.e. when there has been no preceding modification, the post-command-hook function only does a single test of a variable. When there has been a change the overhead still is negligible compared to on-the-fly font locking. I don't think it's an issue even on low end systems. > Suppose some hook wrapped all the text in a visited file with an appropriate > `modification-hooks' property, which would simply remove itself from any > lines that were modified. Then the file-write-time hook could scan through > and only remove line-ending whitespace from lines that aren't wrapped by that > property. That's an alternative. I can see one problem with it: It's not possible to avoid trimming of multiline edits, e.g. when blocks are yanked. In my ws-trim package that's configurable. Besides, the trimming wouldn't take place interactively. Whether that's a drawback or a feature is of course a matter of taste. I like the interactive way since it minimizes the experience of the extra whitespace, i.e. edit a line, leave it, go back again and it'll already be nice and tidy.