From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 21 05:59:26 2014 Received: (at submit) by debbugs.gnu.org; 21 Oct 2014 09:59:26 +0000 Received: from localhost ([127.0.0.1]:57798 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XgWDt-0003LU-SO for submit@debbugs.gnu.org; Tue, 21 Oct 2014 05:59:26 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40348) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XgWDr-0003LG-K1 for submit@debbugs.gnu.org; Tue, 21 Oct 2014 05:59:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XgWDl-0004m7-DC for submit@debbugs.gnu.org; Tue, 21 Oct 2014 05:59:18 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:37552) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgWDl-0004m3-AE for submit@debbugs.gnu.org; Tue, 21 Oct 2014 05:59:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42063) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgWDk-0008LW-Dx for bug-gnu-emacs@gnu.org; Tue, 21 Oct 2014 05:59:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XgWDj-0004ld-If for bug-gnu-emacs@gnu.org; Tue, 21 Oct 2014 05:59:16 -0400 Received: from mail.lysator.liu.se ([2001:6b0:17:f0a0::3]:47280) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgWDj-0004lM-BU for bug-gnu-emacs@gnu.org; Tue, 21 Oct 2014 05:59:15 -0400 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 376774007F for ; Tue, 21 Oct 2014 11:59:12 +0200 (CEST) Received: from bacon.lysator.liu.se (bacon.lysator.liu.se [IPv6:2001:6b0:17:f0a0::ce]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPS id 1EBFE4003B for ; Tue, 21 Oct 2014 11:59:12 +0200 (CEST) Received: from bacon.lysator.liu.se (localhost [127.0.0.1]) by bacon.lysator.liu.se (8.14.5+Sun/8.14.5) with ESMTP id s9L9xBnk009852 for ; Tue, 21 Oct 2014 11:59:11 +0200 (MEST) Received: (from nisse@localhost) by bacon.lysator.liu.se (8.14.5+Sun/8.14.5/Submit) id s9L9xBbY009851; Tue, 21 Oct 2014 11:59:11 +0200 (MEST) X-Authentication-Warning: bacon.lysator.liu.se: nisse set sender to nisse@lysator.liu.se using -f From: nisse@lysator.liu.se (Niels =?iso-8859-1?Q?M=F6ller?=) To: bug-gnu-emacs@gnu.org Subject: 24.4; fixup-whitespace at end of line leaves a trailing space Date: Tue, 21 Oct 2014 11:59:11 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (usg-unix-v) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Virus-Scanned: ClamAV using ClamSMTP Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.3 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.3 (----) The function fixup-whitespace leaves a trailing space when invoked at the end of a line (and this bug is a lot older than emacs-24.4). To reproduce: Run emacs -Q. Type x, to get a line containing "x" and with point at the end. Type M-x fixup-whitespace RET. A space is added, so we get a line containing "x ". I think this is a bug, because it's inconsistent with spacing conventions I'm aware of, and the space is deleted by emacs' M-x whitespace-cleanup. Patch below seems to solve the problem. Best regards, /Niels M=F6ller --- simple.el 2014-08-22 17:52:28.000000000 +0200 +++ simple.el.patched 2014-10-21 11:38:59.000000000 +0200 @@ -787,7 +787,7 @@ Leave one space or none, according to th (interactive "*") (save-excursion (delete-horizontal-space) - (if (or (looking-at "^\\|\\s)") + (if (or (looking-at "^\\|$\\|\\s)") (save-excursion (forward-char -1) (looking-at "$\\|\\s(\\|\\s'"))) nil --=20 Niels M=F6ller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 25 17:39:53 2017 Received: (at 18783) by debbugs.gnu.org; 25 Mar 2017 21:39:53 +0000 Received: from localhost ([127.0.0.1]:44730 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1crtPd-0001LG-H5 for submit@debbugs.gnu.org; Sat, 25 Mar 2017 17:39:53 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:33945) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1crtPb-0001Ky-2O; Sat, 25 Mar 2017 17:39:51 -0400 Received: by mail-it0-f66.google.com with SMTP id z70so4575263itb.1; Sat, 25 Mar 2017 14:39:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=ysoSRaXaPRgU92w/Ik7Efz0thaz+SHsk8URi/AQUQtg=; b=SvObuHzgPptZgNVDBgvdWml0X6ixMNFmHVfz2YErQ8+XNSBhris93O99b4WwqozMlz MAIczAl75NFxY7fpOVwddu6Fg3M7GlR/d+mKwzWEcspnbWQJzWK3g+uYnRCHproZiTpf mpcXWFE4cEbDngHrPJ8WbEr354l35nbaK0IxeUw76Vnl/5k4CFPzWCkKXL8r4eiOibu8 e3XucI4eAA1CpQa45nb+W45GKOw/BX+gwBIGIICg3qj6Gl+L6N/ouvlyx7kGVx6dSVyD rajC2NCa7EkY1ds3cDoKDf3bTl0PXyylaafxxaR1w1Va/v/sZh0EQxnMk5MLBPw2Fixe y3hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=ysoSRaXaPRgU92w/Ik7Efz0thaz+SHsk8URi/AQUQtg=; b=pJ4Ns3GiFDztOP6HZ9a5jMgHLKAQYuE4urWlwsXh8QdsiZwdQG+ajtzbHsjRBkCsxs iumMxedS6lpUqDTnKDITUT9BijZahfffpTNOr0uvtkSiJOn4yGJOwyXMUaqxsbsOjwyj eGtFu5onP9SZ3uqnu1eMbmz82ROeM6L0g+T30Jm5UxSyYRwf0O1AVx8JT1Y0RSS7/rhj PiADQWMSlIVn7LEsOduT1quQq4jhx11e3W6gZvwIz7kxD2NWLIJQP3Een4de6k6qWnwp uTxxGXBMeKmECYiE23NPTL6/OTrot34rsC1ZOyfFa1adQIny3e6HFZ1qP1ME3tYeQK4M lnLQ== X-Gm-Message-State: AFeK/H1X/4fDCSal9mbCdQJa3R8HwLJTuAlRs7UhVB4hzgAcslM+gNjRPb1VjIlC/mxLoA== X-Received: by 10.107.59.21 with SMTP id i21mr13811913ioa.46.1490477985385; Sat, 25 Mar 2017 14:39:45 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id l188sm3224580ioa.35.2017.03.25.14.39.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 25 Mar 2017 14:39:44 -0700 (PDT) From: npostavs@users.sourceforge.net To: nisse@lysator.liu.se (Niels =?utf-8?Q?M=C3=B6ller?=) Subject: Re: bug#18783: 24.4; fixup-whitespace at end of line leaves a trailing space References: Date: Sat, 25 Mar 2017 17:41:07 -0400 In-Reply-To: ("Niels \=\?utf-8\?Q\?M\?\= \=\?utf-8\?Q\?\=C3\=B6ller\=22's\?\= message of "Tue, 21 Oct 2014 11:59:11 +0200") Message-ID: <87lgrt591o.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 18783 Cc: 18783@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable tags 18783 patch quit nisse@lysator.liu.se (Niels M=C3=B6ller) writes: > The function fixup-whitespace leaves a trailing space when invoked at > the end of a line (and this bug is a lot older than emacs-24.4). Seems to have been present since the beginning, 1991-12-21 "Initial revision" shows the same code. > To reproduce: Run emacs -Q. Type x, to get a line containing "x" and > with point at the end. Type M-x fixup-whitespace RET. A space is added, > so we get a line containing "x ". > > I think this is a bug, because it's inconsistent with spacing > conventions I'm aware of, and the space is deleted by emacs' M-x > whitespace-cleanup. > > Patch below seems to solve the problem. Looks good to me, I will push to master in a few days. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Stop-fixup-whitespace-adding-trailing-whitespace-Bug.patch Content-Description: patch >From afdf5b6f8bbea6863e82f3890cd7f750741f95b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= Date: Tue, 21 Oct 2014 11:59:11 +0200 Subject: [PATCH] Stop `fixup-whitespace' adding trailing whitespace (Bug#18783) * lisp/simple.el (fixup-whitespace): Insert no spaces if point is at end of line after deleting horizontal whitespace. Copyright-paperwork-exempt: yes --- lisp/simple.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/simple.el b/lisp/simple.el index 7360e456e4..681cf83807 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -833,7 +833,7 @@ fixup-whitespace (interactive "*") (save-excursion (delete-horizontal-space) - (if (or (looking-at "^\\|\\s)") + (if (or (looking-at "^\\|$\\|\\s)") (save-excursion (forward-char -1) (looking-at "$\\|\\s(\\|\\s'"))) nil -- 2.11.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 30 21:05:25 2017 Received: (at 18783) by debbugs.gnu.org; 31 Mar 2017 01:05:25 +0000 Received: from localhost ([127.0.0.1]:53361 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ctl0H-0006fq-A9 for submit@debbugs.gnu.org; Thu, 30 Mar 2017 21:05:25 -0400 Received: from mail-it0-f48.google.com ([209.85.214.48]:36370) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ctl0F-0006fY-SL; Thu, 30 Mar 2017 21:05:24 -0400 Received: by mail-it0-f48.google.com with SMTP id e75so4570611itd.1; Thu, 30 Mar 2017 18:05:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=l6gbg78AjqTe7YQGVn/DqaeFotIz1az91GIWyS/WARI=; b=EVvxB0jqlaBDICKkvneHC/oeDZdUe72CUyqHY5Fz1ys9KHA4Si2RlsuZjfGdG3Lyvj Abjs8ZKmM82MIVS2nU+JgbxpOa4XbRWGkQwK8IbvDOrhXk7x6Ki6QetOoUg3jNwMs6lP /D0xwqRxBngBAD8fKnUPKZ3tJqFAGfm2jEKBRtOndaeBesr7kg2ZXSYjywXKvSjZScv2 +RIL0VvcfiKUF94cEU2v96shzB5l+7AtW5c1STa6MwkiMK+q+BaPpZFf9voSd5n5QFjM cWc7lYeqzc6RfQejm+/4aORmbWkNK4F3GHyXHvP3spIm1mc5FdGuMaC/KJInAM4aNX28 dpGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=l6gbg78AjqTe7YQGVn/DqaeFotIz1az91GIWyS/WARI=; b=RypVJf93NcJIKQLSorSjf3CXtytW7+FAgfTKWnywL9TjswRyP/i/TKriWzok3eDZ60 Lw5izOueTgj74cjnFFHpDRGpu056mp3zZjCjHCUGYqewpaD3PiCs/+KucjTyluogN422 N1leI/6R3UaFwci7GeFTWcjDB8MKBVqCefDwh4CYTnv4ceJTQgf8ni2TVCL/gBtKovEM Fi3gc1j19A0bL5PeKYJrnYxcy4L6CkWwcRdNF9qq8Xa/ltOXpCvzunfpF4EH9Wj/Ijg/ 88spi8V1zNWsZ+AY0QgGesD5W/3B3n+rx9ppHuUiP27l0RhGdehZyAng97itfnDfOmz5 qoqA== X-Gm-Message-State: AFeK/H1fLDIIwdfKbuG0dp1TAQ6nmvIathuFwD68ozj9HPMsLPpLdCsMntGVROTKim3Ypg== X-Received: by 10.36.90.144 with SMTP id v138mr635339ita.24.1490922318256; Thu, 30 Mar 2017 18:05:18 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id t90sm2349987ioi.31.2017.03.30.18.05.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 30 Mar 2017 18:05:17 -0700 (PDT) From: npostavs@users.sourceforge.net To: nisse@lysator.liu.se (Niels =?utf-8?Q?M=C3=B6ller?=) Subject: Re: bug#18783: 24.4; fixup-whitespace at end of line leaves a trailing space References: <87lgrt591o.fsf@users.sourceforge.net> Date: Thu, 30 Mar 2017 21:06:39 -0400 In-Reply-To: <87lgrt591o.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net's message of "Sat, 25 Mar 2017 17:41:07 -0400") Message-ID: <87y3vm1cgw.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 18783 Cc: 18783@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) tags 18783 fixed close 18783 26.1 quit npostavs@users.sourceforge.net writes: > Looks good to me, I will push to master in a few days. Pushed [1: d1e113ee60]. 1: 2017-03-30 21:05:08 -0400 d1e113ee60a0750acbbc0da569f7cc1bab88f11c Stop `fixup-whitespace' adding trailing whitespace (Bug#18783) From unknown Sat Aug 09 20:34:41 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, 28 Apr 2017 11:24:06 +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