From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Yoni Rabkin Katzenell Newsgroups: gmane.emacs.devel Subject: Re: whitespace-cleanup from /etc/TODO Date: Mon, 14 Aug 2006 11:04:06 +0300 Message-ID: <874pwfyc95.fsf@actcom.com> References: <87zme8tqxx.fsf@actcom.com> <4pwf50tc.fsf@mx.qsc.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1155542567 11540 80.91.229.2 (14 Aug 2006 08:02:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 14 Aug 2006 08:02:47 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 14 10:02:43 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GCXPG-0003fz-1s for ged-emacs-devel@m.gmane.org; Mon, 14 Aug 2006 10:02:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GCXPF-0002ex-KH for ged-emacs-devel@m.gmane.org; Mon, 14 Aug 2006 04:02:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GCXP0-0002es-3t for emacs-devel@gnu.org; Mon, 14 Aug 2006 04:02:26 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GCXOy-0002eg-F6 for emacs-devel@gnu.org; Mon, 14 Aug 2006 04:02:25 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GCXOy-0002ed-0u for emacs-devel@gnu.org; Mon, 14 Aug 2006 04:02:24 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GCXUj-0000XF-AY for emacs-devel@gnu.org; Mon, 14 Aug 2006 04:08:21 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1GCXOq-0003cn-EX for emacs-devel@gnu.org; Mon, 14 Aug 2006 10:02:16 +0200 Original-Received: from p15.haifa5.actcom.co.il ([192.114.82.46]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 14 Aug 2006 10:02:16 +0200 Original-Received: from yoni-r by p15.haifa5.actcom.co.il with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 14 Aug 2006 10:02:16 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 43 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: p15.haifa5.actcom.co.il X-Ethics: Use GNU User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:1cpUCA6sjazqIK0crE9OzFkTzmE= X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:58369 Archived-At: Adrian Aichner writes: > Yoni Rabkin Katzenell writes: > >> The following trivial patch will print an appropriate message when >> `whitespace-cleanup' is run on a region, otherwise it will print that >> `whitespace-cleanup' has run on the entire buffer. >> >> diff -c /home/yrk/devel/sandbox/emacs-hacking/whitespace-original.el /home/yrk/devel/sandbox/emacs-hacking/whitespace.el >> *** /home/yrk/devel/sandbox/emacs-hacking/whitespace-original.el 2006-08-13 21:23:58.542642560 +0300 >> --- /home/yrk/devel/sandbox/emacs-hacking/whitespace.el 2006-08-13 21:12:38.085087832 +0300 >> *************** >> --- 575,586 ---- >> ;; Call this recursively till everything is taken care of >> (if whitespace-any >> (whitespace-cleanup-internal) >> + ;; if we are done, talk to the user >> (progn >> ! (unless whitespace-silent >> ! (if whitespace-region-only >> ! (message "The region is now clean") > > I suggest to retain the buffer-file-name argument in the case above. > > Otherwise you're trading an old piece of valuable information against > a new (perhaps less important) one. But the case above does not describe an entire-buffer operation. The case above is only when `whitespace-clean' has been called on a region within the buffer. > Adrian > >> ! (message "%s is now clean" buffer-file-name))) >> (whitespace-update-modeline))) >> (setq tab-width whitespace-tabwith-saved)))) It does not make sense to me to tell the user that the entire file has been cleaned when only a region of it has been cleaned. So I might be misunderstanding your point. -- "Cut your own wood and it will warm you twice"