]> code.delx.au - gnu-emacs/commitdiff
Support ':relative-width' space display spec on text-mode terminals
authorEli Zaretskii <eliz@gnu.org>
Wed, 23 Sep 2015 13:20:10 +0000 (16:20 +0300)
committerEli Zaretskii <eliz@gnu.org>
Wed, 23 Sep 2015 13:20:10 +0000 (16:20 +0300)
* src/xdisp.c (produce_stretch_glyph): Support ':relative-width'
space display spec on text-mode terminals, by calling
PRODUCE_GLYPHS instead of x_produce_glyphs.  Remove the HAVE_WINDOW_SYSTEM
guards from the supporting code, as well as the test for a GUI frame.

doc/lispref/display.texi
src/xdisp.c

index 6a30adf9c90053434d96e67d2055007c250fc5fc..452462adcfc38e4e71abf8cc526ae27eb39587ee 100644 (file)
@@ -4387,8 +4387,9 @@ width.  @var{width} can also be a @dfn{pixel width} specification
 Specifies that the width of the stretch should be computed from the
 first character in the group of consecutive characters that have the
 same @code{display} property.  The space width is the pixel width of
-that character, multiplied by @var{factor}.  This specification is
-only supported on graphic terminals.
+that character, multiplied by @var{factor}.  (On text-mode terminals,
+the ``pixel width'' of a character is usually 1, but it could be more
+for TABs and double-width CJK characters.)
 
 @item :align-to @var{hpos}
 Specifies that the space should be wide enough to reach @var{hpos}.
index 0d0bc91efd9f6f2138f48419f9fd515d87f53d1f..bac74e2a34fc679679d089fa1aeaf5110d4f6ccb 100644 (file)
@@ -25956,9 +25956,7 @@ produce_stretch_glyph (struct it *it)
       zero_width_ok_p = true;
       width = (int)tem;
     }
-#ifdef HAVE_WINDOW_SYSTEM
-  else if (FRAME_WINDOW_P (it->f)
-          && (prop = Fplist_get (plist, QCrelative_width), NUMVAL (prop) > 0))
+  else if (prop = Fplist_get (plist, QCrelative_width), NUMVAL (prop) > 0)
     {
       /* Relative width `:relative-width FACTOR' specified and valid.
         Compute the width of the characters having the `glyph'
@@ -25978,10 +25976,9 @@ produce_stretch_glyph (struct it *it)
 
       it2.glyph_row = NULL;
       it2.what = IT_CHARACTER;
-      x_produce_glyphs (&it2);
+      PRODUCE_GLYPHS (&it2);
       width = NUMVAL (prop) * it2.pixel_width;
     }
-#endif /* HAVE_WINDOW_SYSTEM */
   else if ((prop = Fplist_get (plist, QCalign_to), !NILP (prop))
           && calc_pixel_width_or_height (&tem, it, prop, font, true,
                                          &align_to))