From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Paul Pogonyshev Newsgroups: gmane.emacs.devel Subject: simple patch for `align.el' Date: Sun, 24 Oct 2004 01:38:03 +0300 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_L1teBqxIRpfgDtH" X-Trace: sea.gmane.org 1098570703 23579 80.91.229.6 (23 Oct 2004 22:31:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 23 Oct 2004 22:31:43 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 24 00:31:38 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CLUQD-00077P-00 for ; Sun, 24 Oct 2004 00:31:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CLUXm-0005Xs-CZ for ged-emacs-devel@m.gmane.org; Sat, 23 Oct 2004 18:39:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CLUXP-0005Se-LJ for emacs-devel@gnu.org; Sat, 23 Oct 2004 18:39:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CLUXO-0005S7-MQ for emacs-devel@gnu.org; Sat, 23 Oct 2004 18:39:02 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CLUXO-0005Rx-JY for emacs-devel@gnu.org; Sat, 23 Oct 2004 18:39:02 -0400 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.34) id 1CLUPS-0001HI-3w for emacs-devel@gnu.org; Sat, 23 Oct 2004 18:30:50 -0400 Original-Received: (qmail 15392 invoked by uid 65534); 23 Oct 2004 22:30:46 -0000 Original-Received: from unknown (EHLO [195.50.12.114]) (195.50.12.114) by mail.gmx.net (mp015) with SMTP; 24 Oct 2004 00:30:46 +0200 X-Authenticated: #16844820 Original-To: emacs-devel@gnu.org User-Agent: KMail/1.6.2 Content-Disposition: inline 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: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:28810 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:28810 --Boundary-00=_L1teBqxIRpfgDtH Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Try typing a = 0; counter = 0; then select this region and `M-x align' it. The first line will have a space followed by a tab, which is not good and is frowned upon by the `whitespace' module. The simple patch below fixes this. I have to admit I didn't care to understand all the code in `align.el', but I'm absolutely sure the patch is safe and works. 2004-10-24 Paul Pogonyshev * align.el (align-areas): Delete whitespace before reindenting, so that tabs are never placed after spaces. My mailer currently mangles tabs, so I attach the patch instead of inlining it. Paul --Boundary-00=_L1teBqxIRpfgDtH Content-Type: text/x-diff; charset="us-ascii"; name="patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch" --- align.el 01 Sep 2003 18:45:04 +0300 1.13 +++ align.el 24 Oct 2004 00:36:41 +0300 @@ -1212,6 +1212,14 @@ have been aligned. No changes will be m (cond ((< gocol 0) t) ; don't do anything ((= cur gocol) t) ; don't need to ((< cur gocol) ; just add space + ;; FIXME: It is stated above that "...the + ;; whitespace to be modified was already + ;; deleted by `align-region', all we have + ;; to do here is indent." However, this + ;; doesn't seem to be true, so we first + ;; delete the whitespace to avoid tabs + ;; after spaces. + (delete-horizontal-space t) (indent-to gocol)) (t ;; This code works around an oddity in the --Boundary-00=_L1teBqxIRpfgDtH Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --Boundary-00=_L1teBqxIRpfgDtH--