From 003759a6dca730df6fae6c9bc8d4a47761b10014 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 22 Feb 2023 15:16:25 +0200 Subject: [PATCH] Explain effect of variable-pitch fonts on fill-column * doc/emacs/text.texi (Fill Commands): * doc/emacs/display.texi (Displaying Boundaries): * lisp/display-fill-column-indicator.el (display-fill-column-indicator-mode): Document caveats of using variable-pitch fonts with 'fill-column' and its indicator. (Bug#61677) --- doc/emacs/display.texi | 6 +++++- doc/emacs/text.texi | 7 ++++++- lisp/display-fill-column-indicator.el | 3 +++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index a86c12a0db7..7ec843180b8 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi @@ -1402,7 +1402,11 @@ right-to-left paragraphs. functionality especially in @code{prog-mode} and its descendants (@pxref{Major Modes}) to indicate the position of a specific column that has some special meaning for formatting the source code of a -program. +program. This assumes the buffer uses a fixed-pitch font, where all +the characters (with the possible exception of double-width +characters) have the same width on display. If the buffer uses +variable-pitch fonts, the fill-column indicators on different lines +might appear unaligned. To activate the fill-column indication display, use the minor modes @code{display-fill-@-column-indicator-mode} and diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi index 3cc5f10582a..7037c8c943a 100644 --- a/doc/emacs/text.texi +++ b/doc/emacs/text.texi @@ -619,7 +619,12 @@ variable @code{fill-column}. The default value (@pxref{Locals}) is is to use the command @kbd{C-x f} (@code{set-fill-column}). With a numeric argument, it uses that as the new fill column. With just @kbd{C-u} as argument, it sets @code{fill-column} to the current -horizontal position of point. +horizontal position of point. Note that, by its very nature, +@code{fill-column} is measured in column units; the actual position of +that column on a graphical display depends on the font being used. In +particular, using variable-pitch fonts will cause the +@code{fill-column} occupy different horizontal positions on display in +different lines. @cindex centering @findex center-line diff --git a/lisp/display-fill-column-indicator.el b/lisp/display-fill-column-indicator.el index 7ad09de0765..45bdca2f5a5 100644 --- a/lisp/display-fill-column-indicator.el +++ b/lisp/display-fill-column-indicator.el @@ -53,6 +53,9 @@ customize `display-fill-column-indicator-column'. You can change the character for the indicator setting `display-fill-column-indicator-character'. The globalized version is `global-display-fill-column-indicator-mode', which see. +This minor mode assumes the buffer uses a fixed-pitch font; if you +use variable-pitch fonts, the indicators on different lines might +not appear aligned. See Info node `Displaying Boundaries' for details." :lighter nil (if display-fill-column-indicator-mode -- 2.39.2