]> git.eshelyaron.com Git - emacs.git/commitdiff
; extend_face_id and fill_column_indicator corrections
authorJimmy Aguilar Mena <spacibba@aol.com>
Wed, 9 Oct 2019 14:44:21 +0000 (16:44 +0200)
committerJimmy Aguilar Mena <spacibba@aol.com>
Mon, 14 Oct 2019 12:18:42 +0000 (14:18 +0200)
*etc/NEWS: Correction for extend face and add some comments in the
code.

etc/NEWS
src/xdisp.c
src/xfaces.c

index 680ac03853369320d03cd8cdf61b530e942f0b06..59237267f094f077bd6362443b2a3e89343b4961 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -385,10 +385,11 @@ simply, makes "foo" complete to both "barfoo" and "frodo".  Add 'flex'
 to 'completion-styles' or 'completion-category-overrides' to use it.
 
 +++
-** There is a new face attribute :extend to use the face attributes to
+** New face attribute ':extend' to control face extension at EOL.
+There is a new face attribute :extend to use the face attributes to
 extend after the end of the line until the end of the window.  Such
-:extend is set to nil by default in all faces except for `hl-line` and
-`region` because those extend until the end of the window by default.
+:extend is set to nil by default in all faces except for 'hl-line' and
+'region' because those extend until the end of the window by default.
 
 ** Connection-local variables
 
index 45462c5ac59c5992daa0ab9b8102c874122536fe..6c0b1f88488e6f3282293ad573c3bea90a4b9788 100644 (file)
@@ -442,7 +442,7 @@ fill_column_indicator_column (struct it *it, int char_width)
                         ? BVAR (current_buffer, fill_column)
                         : Vdisplay_fill_column_indicator_column);
 
-      /* The stretch width needs to considet the latter
+      /* The stretch width needs to consider the latter
         added glyph in append_space_for_newline.  */
       if (RANGED_FIXNUMP (0, col, INT_MAX))
        {
@@ -21691,6 +21691,9 @@ extend_face_to_end_of_line (struct it *it)
              && indicator_column < it->last_visible_x)
             {
 
+             /* Here we substract char_width because we want the
+                column indicator in the column INDICATOR_COLUMN, not
+                after it.  */
              const int stretch_width =
                indicator_column - it->current_x - char_width;
 
@@ -21851,6 +21854,11 @@ extend_face_to_end_of_line (struct it *it)
                      default_face->id : face->id);
 
       /* Display fill-column indicator if needed.  */
+      /* We need to subtract 1 to the indicator_column here because we
+        will add the indicator IN the column indicator number, not
+        after it.  We compare the variable it->current_x before
+        producing the glyph.  When FRAME_WINDOW_P we substract
+        CHAR_WIDTH calculating STRETCH_WIDTH for the same reason.  */
       const int indicator_column =
        fill_column_indicator_column (it, 1) - 1;
       do
index cc65527fe612b7efd9ff49a8b628521f08b25fd9..5a741ae8cc6811815cee5516bb50e9a17fcab444 100644 (file)
@@ -2284,7 +2284,7 @@ filter_face_ref (Lisp_Object face_ref,
 
    ATTR_FILTER is the index of a parameter that conditions the merging
    for named faces (case 1) to only the face_ref where
-   lface[merge_face_ref] is non-nil. To merge unconditionally set this
+   lface[merge_face_ref] is non-nil.  To merge unconditionally set this
    value to 0.
 
    FACE_REF may be a single face specification or a list of such