[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#35647: Documentation and implementation of (move-to-column <n> t) di

From: Alan Mackenzie
Subject: bug#35647: Documentation and implementation of (move-to-column <n> t) differ.
Date: Thu, 9 May 2019 10:48:50 +0000
User-agent: Mutt/1.10.1 (2018-07-13)

Hello, Emacs.

In (move-to-column <n> t), the t argument, FORCE, "replaces the tab with
spaces" if it needs to do so to get exactly to column <n> 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 <n>, 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 <n>, then calls Findent_to to
finish the indentation to <n>.  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).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]