From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 08 05:33:30 2012 Received: (at submit) by debbugs.gnu.org; 8 Nov 2012 10:33:30 +0000 Received: from localhost ([127.0.0.1]:55450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TWPQP-0007d6-FD for submit@debbugs.gnu.org; Thu, 08 Nov 2012 05:33:29 -0500 Received: from eggs.gnu.org ([208.118.235.92]:40028) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TWPQN-0007cz-PI for submit@debbugs.gnu.org; Thu, 08 Nov 2012 05:33:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TWPQG-0006hU-MD for submit@debbugs.gnu.org; Thu, 08 Nov 2012 05:33:26 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:54534) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TWPQG-0006hN-Ib for submit@debbugs.gnu.org; Thu, 08 Nov 2012 05:33:20 -0500 Received: from eggs.gnu.org ([208.118.235.92]:47676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TWPQA-0006Op-H8 for bug-gnu-emacs@gnu.org; Thu, 08 Nov 2012 05:33:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TWPQ8-0006gR-Ry for bug-gnu-emacs@gnu.org; Thu, 08 Nov 2012 05:33:14 -0500 Received: from mail-ea0-f169.google.com ([209.85.215.169]:36132) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TWPQ8-0006g5-L7 for bug-gnu-emacs@gnu.org; Thu, 08 Nov 2012 05:33:12 -0500 Received: by mail-ea0-f169.google.com with SMTP id k11so1205317eaa.0 for ; Thu, 08 Nov 2012 02:33:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:x-debbugs-cc:date:message-id:mime-version :content-type; bh=gdkGqSCfyjHBIELmjAbx5P62rIpf7e6zpULB62vWOKM=; b=0jP7hu9HKjS71P38jxBqVo88JAVmzSq+OqjKJr+Yo6IcP7fSzsBYOSkcl+SJFnGLEa biP0M+tyGza/F6Hgz90TBWmRinTk4hLO2kAAqyF2VDNVBan1JcFveitIO1x04MoDP1iT t8ln5LclaAebtsjMQbAG/LXpod2cJ506qL5sFCDlef/LpfrjklMc3PwaE9myk37aeVuY 9BBlT4ud2vpFAz6pJKsijiXHrfL6qyENoraY3K+ecR9Zvton7fuIGI3UVnWHGONmstDm 9HBQGXk6StUfzcFPB9BzPsVMlbPMH7lFrP0WdUee86OKvgLV6fys4t3uou7Tb5EpQHxa CjHQ== Received: by 10.14.182.9 with SMTP id n9mr26176909eem.24.1352370790875; Thu, 08 Nov 2012 02:33:10 -0800 (PST) Received: from ulysses (cust.static.212-41-195-106.swisscomdata.ch. [212.41.195.106]) by mx.google.com with ESMTPS id c6sm69636111eep.17.2012.11.08.02.33.09 (version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 02:33:10 -0800 (PST) From: Chong Yidong To: bug-gnu-emacs@gnu.org Subject: 24.2.50; diff-remove-trailing-whitespace is broken X-Debbugs-CC: =?utf-8?Q?=C3=93scar?= Fuentes Date: Thu, 08 Nov 2012 18:33:08 +0800 Message-ID: <87pq3ov0yj.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -3.4 (---) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.4 (---) The command diff-remove-trailing-whitespace, newly introduced for Emacs 24.3, is broken. AFAICT, it can't easily be made to work right. 1) diff-remove-trailing-whitespace is confused about the order of files in the diff: echo "a" > oldfile echo "b " > newfile emacs -Q M-x diff RET newfile RET oldfile RET C-x o M-x diff-remove-trailing-whitespace RET => no trailing whitespace fixes needed (Note that the new file is by convention the FIRST argument to M-x diff and the SECOND argument to the `diff' command.) This can be fixed by replacing (diff-find-source-location t t) in the definition of diff-remove-trailing-whitespace. But we hit the second problem: 2) After the trailing whitespaces are fixed in the underlying files, the trailing whitespace still remains in the *Diff* buffer. The basic problem is that the algorithm of this command is too simplistic: it looks for trailing whitespace in the Diff buffer, jumps to the corresponding location given by diff-find-source-location, looks for trailing whitespace on that line, and deletes it. This simple algorithm can lead to serious mistakes. There's no attempt to check if the point in the Diff buffer corresponds to a "before" or "after" line (nothing ought to be done for the former, but the existing command is happy to use it), or whether the "trailing whitespace" that it found is merely the space which is customarily inserted after "!" in context diffs. Unless someone comes up with a version of this command that works right, I think we should go back to the drawing board on this, and remove it from Emacs 24.3. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 08 12:33:40 2012 Received: (at 12831-done) by debbugs.gnu.org; 8 Nov 2012 17:33:40 +0000 Received: from localhost ([127.0.0.1]:56364 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TWVz1-0001KN-Ug for submit@debbugs.gnu.org; Thu, 08 Nov 2012 12:33:40 -0500 Received: from mail-bk0-f44.google.com ([209.85.214.44]:45297) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TWVyz-0001KG-Sv for 12831-done@debbugs.gnu.org; Thu, 08 Nov 2012 12:33:38 -0500 Received: by mail-bk0-f44.google.com with SMTP id jc3so1364401bkc.3 for <12831-done@debbugs.gnu.org>; Thu, 08 Nov 2012 09:33:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=501PqHQmwtVMXuCkQbXkSUKWHEMwyCtHnKmc2MAzHrQ=; b=pQPWcUwMcbtQz6s11laabcT56xgPtGgYYcC56hSlCo5oIPCHBskm0/nFdyR+/YUMXc FkadWVxk+oMhsp1oNIQ8fkJ5jjHmjlHNbMEImvKchIy4BU2fZWqgYyk+YEgALYhGOL0P k5vx2PLHUQG5WRjTe6iGtnoNcvHI62YRm/kd+dz8RljAbeJVYcWERpSmtv7oTmdKn4yU 9y7adxiiNC9/4QSdpbQlHpbUmbhc2TT2GfnUveDZ5+OzS0QS/wLW8pP6rhwVZgVQobU0 iEIqLn9o72kHYKLa1roDWc5UusPxvBGUVcQ//sIu/XSysTOf5T2nKVEYoPLA6Grp8wyt lBJw== Received: by 10.204.157.144 with SMTP id b16mr2448266bkx.19.1352396013918; Thu, 08 Nov 2012 09:33:33 -0800 (PST) Received: from ulysses (cust.static.212-41-195-106.swisscomdata.ch. [212.41.195.106]) by mx.google.com with ESMTPS id z13sm17565102bkv.8.2012.11.08.09.33.32 (version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 09:33:33 -0800 (PST) From: Chong Yidong To: 12831-done@debbugs.gnu.org Subject: Re: bug#12831: 24.2.50; diff-remove-trailing-whitespace is broken References: <87pq3ov0yj.fsf@gnu.org> Date: Fri, 09 Nov 2012 01:33:30 +0800 In-Reply-To: <87pq3ov0yj.fsf@gnu.org> (Chong Yidong's message of "Thu, 08 Nov 2012 18:33:08 +0800") Message-ID: <87k3tw0zkl.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 12831-done Cc: =?utf-8?Q?=C3=93scar?= Fuentes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) > The command diff-remove-trailing-whitespace, newly introduced for Emacs > 24.3, is broken. I have rewritten the command to make it work properly, and renamed it to diff-delete-trailing-whitespace (for consistency with the existing delete-trailing-whitespace command). From unknown Fri Sep 12 22:55:20 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 07 Dec 2012 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator