From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#35600: 27.0.50; uncomment-region fails correctly to reverse the action of comment-region. Date: Mon, 6 May 2019 10:11:00 +0000 Message-ID: <20190506101100.GA4300@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="217681"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) To: 35600@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 06 12:12:15 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hNabX-000uRB-32 for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 May 2019 12:12:15 +0200 Original-Received: from localhost ([127.0.0.1]:53839 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNabV-0000cH-RA for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 May 2019 06:12:13 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:45363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNabL-0000aA-JK for bug-gnu-emacs@gnu.org; Mon, 06 May 2019 06:12:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hNabK-0002Lh-IN for bug-gnu-emacs@gnu.org; Mon, 06 May 2019 06:12:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42222) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hNabK-0002LX-EL for bug-gnu-emacs@gnu.org; Mon, 06 May 2019 06:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hNabK-0007WG-4u for bug-gnu-emacs@gnu.org; Mon, 06 May 2019 06:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 May 2019 10:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35600 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.155713747728843 (code B ref -1); Mon, 06 May 2019 10:12:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 May 2019 10:11:17 +0000 Original-Received: from localhost ([127.0.0.1]:55765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hNaab-0007V9-53 for submit@debbugs.gnu.org; Mon, 06 May 2019 06:11:17 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:58989) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hNaaY-0007Uv-OE for submit@debbugs.gnu.org; Mon, 06 May 2019 06:11:15 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:58678) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hNaaT-0001WM-Lz for submit@debbugs.gnu.org; Mon, 06 May 2019 06:11:09 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:45134) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNaaS-0008Pz-NE for bug-gnu-emacs@gnu.org; Mon, 06 May 2019 06:11:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hNaaR-0001VV-NS for bug-gnu-emacs@gnu.org; Mon, 06 May 2019 06:11:08 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:11357 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1hNaaR-0001Sh-DA for bug-gnu-emacs@gnu.org; Mon, 06 May 2019 06:11:07 -0400 Original-Received: (qmail 27547 invoked by uid 3782); 6 May 2019 10:11:02 -0000 Original-Received: from acm.muc.de (p4FE15DE3.dip0.t-ipconnect.de [79.225.93.227]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 06 May 2019 12:11:01 +0200 Original-Received: (qmail 4371 invoked by uid 1000); 6 May 2019 10:11:00 -0000 Content-Disposition: inline X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:158827 Archived-At: Hello, Emacs. In the master branch: With indent-tabs-mode t, and tab-width (say) 8, start off with the following two line of Emacs lisp: (if (null bs-state) (ignore) ^ (the first of these lines being indented by four spaces, the second by a ). Mark the two lines, and execute M-x comment-region. We get this: ;; (if (null bs-state) ;; (ignore) ^ (where all the space is space characters except for the just before "(ignore)"). Now execute M-x uncomment-region. This should restore the region to what it started as. Instead one gets: (if (null bs-state) (ignore) ^^^^ ^ SPCs , there now being four spurious spaces before the preceding "(ignore)". This is a bug. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; In uncomment-region-default-1, the variable `spt' gets set to the result of comment-search-forward, the ";" at the beginning of the comment on the current line. The function then narrows to between `spt' and BO next line. In this narrowed region, the function removes the comment starter. Because of the narrowing, it cannot take any account of the spaces at the start of the line. Possibly, uncomment-region needs to be amended so that that narrowing includes any space preceding the comment starter, and that space gets properly handled. -- Alan Mackenzie (Nuremberg, Germany).