unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 35647@debbugs.gnu.org
Subject: bug#35647: Documentation and implementation of (move-to-column <n> t) differ.
Date: Thu, 9 May 2019 15:05:37 +0000	[thread overview]
Message-ID: <20190509150537.GC11178@ACM> (raw)
In-Reply-To: <837eazhggs.fsf@gnu.org>

Hello, Eli.

On Thu, May 09, 2019 at 17:04:19 +0300, Eli Zaretskii wrote:
> > Date: Thu, 9 May 2019 10:48:50 +0000
> > From: Alan Mackenzie <acm@muc.de>

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

> Would you mind preparing a documentation patch for this issue?

How about:


diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index 500df1f8f0..278bc3c268 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -2252,9 +2252,11 @@ Columns
 the middle of a multicolumn character such as a tab, point moves to the
 end of that character.  However, if @var{force} is non-@code{nil}, and
 @var{column} is in the middle of a tab, then @code{move-to-column}
-converts the tab into spaces so that it can move precisely to column
-@var{column}.  Other multicolumn characters can cause anomalies despite
-@var{force}, since there is no way to split them.
+either converts the tab into spaces (when @code{indent-tabs-mode} is
+@code{nil}), or inserts enough spaces before it (otherwise), so that
+point can move precisely to column @var{column}.  Other multicolumn
+characters can cause anomalies despite @var{force}, since there is no
+way to split them.
 
 The argument @var{force} also has an effect if the line isn't long
 enough to reach column @var{column}; if it is @code{t}, that means to
diff --git a/src/indent.c b/src/indent.c
index c76e6b7b4b..90d8b1ce8e 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -983,9 +983,10 @@ If specified column is within a character, point goes after that character.
 If it's past end of line, point goes to end of line.
 
 Optional second argument FORCE non-nil means if COLUMN is in the
-middle of a tab character, change it to spaces.
-In addition, if FORCE is t, and the line is too short to reach
-COLUMN, add spaces/tabs to get there.
+middle of a tab character, either change it to spaces (when
+`indent-tabs-mode' is nil), or insert enough spaces before it to reach
+COLUMN (otherwise).  In addition, if FORCE is t, and the line is too short
+to reach COLUMN, add spaces/tabs to get there.
 
 The return value is the current column.  */)
   (Lisp_Object column, Lisp_Object force)


?

> Thanks.

-- 
Alan Mackenzie (Nuremberg, Germany).





  reply	other threads:[~2019-05-09 15:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2019-05-09 15:43     ` Eli Zaretskii
2019-05-09 16:32       ` Alan Mackenzie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190509150537.GC11178@ACM \
    --to=acm@muc.de \
    --cc=35647@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).