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#35647: Documentation and implementation of (move-to-column t) differ. Date: Thu, 9 May 2019 10:48:50 +0000 Message-ID: <20190509104850.GA11178@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="54086"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) To: 35647@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 09 12:50:11 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 1hOgcs-000DyU-KG for geb-bug-gnu-emacs@m.gmane.org; Thu, 09 May 2019 12:50:10 +0200 Original-Received: from localhost ([127.0.0.1]:52253 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOgcr-000117-Kn for geb-bug-gnu-emacs@m.gmane.org; Thu, 09 May 2019 06:50:09 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47356) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOgcl-00010y-G8 for bug-gnu-emacs@gnu.org; Thu, 09 May 2019 06:50:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOgck-0005f2-BA for bug-gnu-emacs@gnu.org; Thu, 09 May 2019 06:50:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49422) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hOgck-0005ex-7m for bug-gnu-emacs@gnu.org; Thu, 09 May 2019 06:50:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hOgck-000743-2g for bug-gnu-emacs@gnu.org; Thu, 09 May 2019 06:50: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: Thu, 09 May 2019 10:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35647 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.155739894627078 (code B ref -1); Thu, 09 May 2019 10:50:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 May 2019 10:49:06 +0000 Original-Received: from localhost ([127.0.0.1]:34729 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hOgbq-00072f-4S for submit@debbugs.gnu.org; Thu, 09 May 2019 06:49:06 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:32831) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hOgbo-000724-FR for submit@debbugs.gnu.org; Thu, 09 May 2019 06:49:04 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:54373) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hOgbj-0005Dm-9n for submit@debbugs.gnu.org; Thu, 09 May 2019 06:48:59 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47204) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOgbi-0000xJ-C3 for bug-gnu-emacs@gnu.org; Thu, 09 May 2019 06:48:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOgbh-0005Cn-CF for bug-gnu-emacs@gnu.org; Thu, 09 May 2019 06:48:58 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:21923 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1hOgbh-0005C1-2R for bug-gnu-emacs@gnu.org; Thu, 09 May 2019 06:48:57 -0400 Original-Received: (qmail 96835 invoked by uid 3782); 9 May 2019 10:48:51 -0000 Original-Received: from acm.muc.de (p4FE15B16.dip0.t-ipconnect.de [79.225.91.22]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 09 May 2019 12:48:50 +0200 Original-Received: (qmail 11230 invoked by uid 1000); 9 May 2019 10:48:50 -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:158974 Archived-At: Hello, Emacs. In (move-to-column t), the t argument, FORCE, "replaces the tab with spaces" if it needs to do so to get exactly to column which is in the middle of a tab. At least, that's what the documentation says. In the implementation, when indent-tabs-mode is non-nil, Emacs _inserts_ spaces before the tab to get to column , rather than replacing the tab with spaces. This discrepancy is a bug. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; What the code in Fmove_to_column actually does is to delete the tab, insert enough spaces to get to column , then calls Findent_to to finish the indentation to . Findent_to uses a tab when indent-tabs-mode is non-nil. My feeling here is that the documentation rather than the code should be amended. To amend the code would make it more difficult for uncomment-region to restore a tab character which has been earlier manipulated by comment-region. (See also bug #35600.) -- Alan Mackenzie (Nuremberg, Germany).