1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-11 00:30:17 -08:00

Improve documentation of column-related functions

* doc/lispref/text.texi (Primitive Indent, Columns):
* src/indent.c (Fcurrent_indentation, Fmove_to_column): Document
that column counting ignores invisible text.  (Bug#56837)
This commit is contained in:
Eli Zaretskii 2022-07-30 19:34:38 +03:00
parent c95a34c960
commit eb11dae499
2 changed files with 14 additions and 2 deletions

View file

@ -2297,6 +2297,9 @@ begins. @xref{Usual Display}.
amount of horizontal scrolling. Consequently, a column value can be amount of horizontal scrolling. Consequently, a column value can be
arbitrarily high. The first (or leftmost) column is numbered 0. They arbitrarily high. The first (or leftmost) column is numbered 0. They
also ignore overlays and text properties, aside from invisibility. also ignore overlays and text properties, aside from invisibility.
Invisible text is considered as having zero width, unless
@code{buffer-invisibility-spec} specifies that invisible text should
be displayed as ellipsis (@pxref{Invisible Text}).
@defun current-column @defun current-column
This function returns the horizontal position of point, measured in This function returns the horizontal position of point, measured in
@ -2370,6 +2373,10 @@ This function returns the indentation of the current line, which is
the horizontal position of the first nonblank character. If the the horizontal position of the first nonblank character. If the
contents are entirely blank, then this is the horizontal position of the contents are entirely blank, then this is the horizontal position of the
end of the line. end of the line.
This function considers invisible text as having zero width, unless
@code{buffer-invisibility-spec} specifies that invisible text should
be displayed as ellipsis. @xref{Invisible Text}.
@end defun @end defun
@deffn Command indent-to column &optional minimum @deffn Command indent-to column &optional minimum

View file

@ -866,8 +866,10 @@ The return value is the column where the insertion ends. */)
DEFUN ("current-indentation", Fcurrent_indentation, Scurrent_indentation, DEFUN ("current-indentation", Fcurrent_indentation, Scurrent_indentation,
0, 0, 0, 0, 0, 0,
doc: /* Return the indentation of the current line. doc: /* Return the indentation of the current line.
This is the horizontal position of the character This is the horizontal position of the character following any initial
following any initial whitespace. */) whitespace.
Text that has an invisible property is considered as having width 0, unless
`buffer-invisibility-spec' specifies that it is replaced by an ellipsis. */)
(void) (void)
{ {
ptrdiff_t posbyte; ptrdiff_t posbyte;
@ -985,6 +987,9 @@ as displayed of the previous characters in the line.
This function ignores line-continuation; This function ignores line-continuation;
there is no upper limit on the column number a character can have there is no upper limit on the column number a character can have
and horizontal scrolling has no effect. and horizontal scrolling has no effect.
Text that has an invisible property is considered as having width 0,
unless `buffer-invisibility-spec' specifies that it is replaced by
an ellipsis.
If specified column is within a character, point goes after that character. 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. If it's past end of line, point goes to end of line.