** Multicolor fonts such as "Noto Color Emoji" can be displayed on
Emacs configured with Cairo drawing and linked with cairo >= 1.16.0.
+---
+** Emacs now optionally displays a fill column indicator.
+
+The fill column indicator is a usefull functionality specially in
+prog-mode to indicate the position of a specific column. This is
+similar to what 'fill-column-indicator' package provides, but much
+faster and compatible with show-trailing-whitespace.
+
+Customize the buffer-local variables 'display-fill-column-indicator'
+and 'display-fill-column-indicator-character' to activate the
+indicator.
+
+Alternatively you can use the modes
+'display-fill-column-indicator-mode' or the global
+'global-display-fill-column-indicator-mode' which enables it locally
+and globally respectively and also chooses the character to use if no
+one is set.
+
+The indicators is not displayed at all in minibuffer windows and
+in tooltips, as it is not useful there.
+
+There are 2 new buffer local variables and 1 face to customize this
+mode:
+
+*** 'display-fill-column-indicator-column' is the column where the
+ indicator should be set. It can take positive numerical values for
+ the column or the special value t. Any other value disables the
+ indicator. The default value is t.
+
+ When the value is t it means that the variable 'fill-column' will
+ be used.
+
+*** 'display-fill-column-indicator-char' is the character used for the
+ indicator. This character can be any valid char including unicode
+ ones if the user's font supports them.
+
+ When the mode is enabled throw the functions
+ 'display-fill-column-indicator-mode' and
+ 'global-display-fill-column-indicator-mode', they check if there
+ is a value non-nil for this variable, otherwise the initialization
+ tries to set it to U+2502 or '|'.
+
+*** 'fill-column-face' is the face used to display the indicator it
+ inherits it default values from shadow and the default faces.
+
\f
* Editing Changes in Emacs 27.1
same place than the line */
if (!NILP (Vdisplay_fill_column_indicator)
&& (it->w->pseudo_window_p == 0)
- && FIXNATP (Vdisplay_fill_column_indicator_column)
+ && (!NILP (Vdisplay_fill_column_indicator_column))
&& FIXNATP (Vdisplay_fill_column_indicator_character))
{
+ int fill_column_indicator_column = -1;
+
+ if (EQ (Vdisplay_fill_column_indicator_column, Qt)
+ && FIXNATP (BVAR (current_buffer, fill_column)))
+ fill_column_indicator_column =
+ XFIXNAT (BVAR (current_buffer, fill_column));
+ else if (FIXNATP (Vdisplay_fill_column_indicator_column))
+ fill_column_indicator_column =
+ XFIXNAT (Vdisplay_fill_column_indicator_column);
+
struct font *font =
default_face->font ? default_face->font : FRAME_FONT (it->f);
const int char_width =
font->average_width ? font->average_width : font->space_width;
- const int fill_column =
- XFIXNAT (Vdisplay_fill_column_indicator_column);
+
const int column_x =
- char_width * fill_column + it->lnum_pixel_width;
+ char_width * fill_column_indicator_column + it->lnum_pixel_width;
if (it->current_x == column_x)
{
active */
if (!NILP (Vdisplay_fill_column_indicator)
&& (it->w->pseudo_window_p == 0)
- && FIXNATP (Vdisplay_fill_column_indicator_column)
+ && (!NILP (Vdisplay_fill_column_indicator_column))
&& FIXNATP (Vdisplay_fill_column_indicator_character))
{
+ int fill_column_indicator_column = -1;
+
+ if (EQ (Vdisplay_fill_column_indicator_column, Qt)
+ && FIXNATP (BVAR (current_buffer, fill_column)))
+ fill_column_indicator_column =
+ XFIXNAT (BVAR (current_buffer, fill_column));
+ else if (FIXNATP (Vdisplay_fill_column_indicator_column))
+ fill_column_indicator_column =
+ XFIXNAT (Vdisplay_fill_column_indicator_column);
+
struct font *font =
default_face->font ? default_face->font : FRAME_FONT (f);
const int char_width =
font->average_width ? font->average_width : font->space_width;
- const int fill_column =
- XFIXNAT (Vdisplay_fill_column_indicator_column);
-
- const int column_x = char_width * fill_column + it->lnum_pixel_width;
+ const int column_x = char_width * fill_column_indicator_column +
+ it->lnum_pixel_width;
if ((it->current_x <= column_x)
&& (column_x <= it->last_visible_x))
it->face_id = face->id;
/* Display fill-column-line if mode is active */
- if (!NILP (Vdisplay_fill_column_indicator))
+ if (!NILP (Vdisplay_fill_column_indicator)
+ && (!NILP (Vdisplay_fill_column_indicator_column))
+ && FIXNATP (Vdisplay_fill_column_indicator_character))
{
- const int fill_column_indicator_line =
- XFIXNAT (Vdisplay_fill_column_indicator_column)
- + it->lnum_pixel_width;
+ int fill_column_indicator_column = -1;
+
+ if (EQ (Vdisplay_fill_column_indicator_column, Qt)
+ && FIXNATP (BVAR (current_buffer, fill_column)))
+ fill_column_indicator_column =
+ XFIXNAT (BVAR (current_buffer, fill_column));
+ else if (FIXNATP (Vdisplay_fill_column_indicator_column))
+ fill_column_indicator_column =
+ XFIXNAT (Vdisplay_fill_column_indicator_column);
+
do
{
- if (it->current_x == fill_column_indicator_line)
+ if (it->current_x == fill_column_indicator_column)
{
const int saved_face = it->face_id;
it->face_id =
Fmake_variable_buffer_local (Qdisplay_fill_column_indicator);
DEFVAR_LISP ("display-fill-column-indicator-column", Vdisplay_fill_column_indicator_column,
- doc: /* Column to draw the indicator when `display-fill-column-indicator' is non-nil.
-The default value is the variable `fill-column' if not other value is given. */);
- Vdisplay_fill_column_indicator_column = Qnil;
+ doc: /* Column to draw the fill column indicator when
+`display-fill-column-indicator' is non-nil. The default value is t
+which means that the indicator will use the `fill-column' variable. If
+a numeric value is set, the indicator will be drawn in that column
+independently of the `fill-column' value. */);
+ Vdisplay_fill_column_indicator_column = Qt;
DEFSYM (Qdisplay_fill_column_indicator_column, "display-fill-column-indicator-column");
Fmake_variable_buffer_local (Qdisplay_fill_column_indicator_column);