unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#35647: Documentation and implementation of (move-to-column <n> t) differ.
@ 2019-05-09 10:48 Alan Mackenzie
  2019-05-09 14:04 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Alan Mackenzie @ 2019-05-09 10:48 UTC (permalink / raw)
  To: 35647

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).





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-05-09 16:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-09 10:48 bug#35647: Documentation and implementation of (move-to-column <n> t) differ Alan Mackenzie
2019-05-09 14:04 ` Eli Zaretskii
2019-05-09 15:05   ` Alan Mackenzie
2019-05-09 15:43     ` Eli Zaretskii
2019-05-09 16:32       ` Alan Mackenzie

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).