[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] fill_column_indicator b28e53a 08/10: *lisp/display-fill-co
From: |
Jimmy Aguilar Mena |
Subject: |
[Emacs-diffs] fill_column_indicator b28e53a 08/10: *lisp/display-fill-column-indicator.el: Extended condition to set |
Date: |
Fri, 3 May 2019 17:23:57 -0400 (EDT) |
branch: fill_column_indicator
commit b28e53aa68fe2b3625681aa622c28c0881605f54
Author: Jimmy Aguilar Mena <address@hidden>
Commit: Jimmy Aguilar Mena <address@hidden>
*lisp/display-fill-column-indicator.el: Extended condition to set
display-fill-column-indicator-character in graphical displays.
*src/xdisp.c: Fixed some long lines.
---
lisp/display-fill-column-indicator.el | 5 ++-
src/xdisp.c | 62 ++++++++++++++++++++---------------
2 files changed, 40 insertions(+), 27 deletions(-)
diff --git a/lisp/display-fill-column-indicator.el
b/lisp/display-fill-column-indicator.el
index fa14879..f6b7352 100644
--- a/lisp/display-fill-column-indicator.el
+++ b/lisp/display-fill-column-indicator.el
@@ -55,7 +55,10 @@ character for the indicator setting
`display-fill-column-indicator-character'."
(progn
(setq display-fill-column-indicator t)
(unless display-fill-column-indicator-character
- (if (char-displayable-p ?\u2502)
+ (if (and (char-displayable-p ?\u2502)
+ (or (not (display-graphic-p))
+ (eq (aref (query-font (car (internal-char-font nil
?\u2502))) 0)
+ (face-font 'default))))
(setq display-fill-column-indicator-character ?\u2502)
(setq display-fill-column-indicator-character ?|))))
(setq display-fill-column-indicator nil)))
diff --git a/src/xdisp.c b/src/xdisp.c
index 25ef98b..31bb83c 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -20183,19 +20183,23 @@ append_space_for_newline (struct it *it, bool
default_face_p)
XFIXNAT (Vdisplay_fill_column_indicator_column);
struct font *font =
- default_face->font ? default_face->font : FRAME_FONT (it->f);
+ default_face->font ?
+ default_face->font : FRAME_FONT (it->f);
const int char_width =
- font->average_width ? font->average_width : font->space_width;
+ font->average_width ?
+ font->average_width : font->space_width;
const int column_x =
- char_width * fill_column_indicator_column +
it->lnum_pixel_width;
+ char_width * fill_column_indicator_column +
+ it->lnum_pixel_width;
if (it->current_x == column_x)
{
it->c = it->char_to_display =
XFIXNAT (Vdisplay_fill_column_indicator_character);
it->face_id =
- merge_faces (it->w, Qfill_column_face, 0, DEFAULT_FACE_ID);
+ merge_faces (it->w, Qfill_column_face,
+ 0, DEFAULT_FACE_ID);
face = FACE_FROM_ID(it->f, it->face_id);
goto produce_glyphs;
}
@@ -20444,10 +20448,12 @@ extend_face_to_end_of_line (struct it *it)
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;
+ font->average_width ?
+ font->average_width : font->space_width;
- const int column_x = char_width * fill_column_indicator_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))
@@ -20459,39 +20465,43 @@ extend_face_to_end_of_line (struct it *it)
const bool saved_box_start = it->start_of_box_run_p;
Lisp_Object save_object = it->object;
- /* The stretch width needs to considet the latter added glyph
*/
- const int stretch_width = column_x - it->current_x -
char_width;
+ /* The stretch width needs to considet the latter
+ added glyph */
+ const int stretch_width =
+ column_x - it->current_x - char_width;
memset (&it->position, 0, sizeof it->position);
it->avoid_cursor_p = true;
it->object = Qnil;
- /* Only generate a stretch glysph if there is distance between
- current_x and and the indicator position */
+ /* Only generate a stretch glysph if there is distance
+ between current_x and and the indicator position */
if (stretch_width > 0)
- {
- int stretch_ascent = (((it->ascent + it->descent)
- * FONT_BASE (font)) / FONT_HEIGHT (font));
- append_stretch_glyph (it, Qnil, stretch_width,
- it->ascent + it->descent,
stretch_ascent);
- }
-
- /* Generate the glysph indicator only if
append_space_for_newline
- didn't already. */
+ {
+ int stretch_ascent = (((it->ascent + it->descent)
+ * FONT_BASE (font)) / FONT_HEIGHT
(font));
+ append_stretch_glyph (it, Qnil, stretch_width,
+ it->ascent + it->descent,
+ stretch_ascent);
+ }
+
+ /* Generate the glysph indicator only if
+ append_space_for_newline didn't already. */
if (it->current_x < column_x)
{
- it->char_to_display =
+ it->char_to_display =
XFIXNAT (Vdisplay_fill_column_indicator_character);
it->face_id =
- merge_faces (it->w, Qfill_column_face, 0,
DEFAULT_FACE_ID);
+ merge_faces (it->w, Qfill_column_face,
+ 0, DEFAULT_FACE_ID);
PRODUCE_GLYPHS (it);
}
/* Restore the face after the indicator was generated */
it->face_id = saved_face_id;
- /* If there is space after the indicator generate an extra
- empty glysph to restore the face. */
+ /* If there is space after the indicator generate an
+ extra empty glysph to restore the face. */
it->char_to_display = ' ';
PRODUCE_GLYPHS (it);
@@ -20630,8 +20640,8 @@ extend_face_to_end_of_line (struct it *it)
{
int fill_column_indicator_column = -1;
- /* Vdisplay_fill_column_indicator_column accepts the special value t
- to use the default fill-column variable. */
+ /* Vdisplay_fill_column_indicator_column accepts the special
+ value t to use the default fill-column variable. */
if (EQ (Vdisplay_fill_column_indicator_column, Qt)
&& FIXNATP (BVAR (current_buffer, fill_column)))
fill_column_indicator_column =
- [Emacs-diffs] branch fill_column_indicator created (now 298f0a9), Jimmy Aguilar Mena, 2019/05/03
- [Emacs-diffs] fill_column_indicator c3a5797 03/10: Fixed fill-column-indicator for continuation lines, Jimmy Aguilar Mena, 2019/05/03
- [Emacs-diffs] fill_column_indicator 0013466 07/10: display-fill-column-indicator interface correction, Jimmy Aguilar Mena, 2019/05/03
- [Emacs-diffs] fill_column_indicator 5d8365f 05/10: Added correction in the texinfo manual., Jimmy Aguilar Mena, 2019/05/03
- [Emacs-diffs] fill_column_indicator fd15e89 06/10: ; Small changes in the documentation, Jimmy Aguilar Mena, 2019/05/03
- [Emacs-diffs] fill_column_indicator 74ecb36 04/10: Added fill-column-indicator manual documentation, Jimmy Aguilar Mena, 2019/05/03
- [Emacs-diffs] fill_column_indicator f0a257d 02/10: Display-fill-column-indicator NEWS info., Jimmy Aguilar Mena, 2019/05/03
- [Emacs-diffs] fill_column_indicator 7750ebe 01/10: Start display-fill-column-indicator-mode., Jimmy Aguilar Mena, 2019/05/03
- [Emacs-diffs] fill_column_indicator e122a1d 09/10: *src/xdisp.c: Fixed fill column indicator position in terminal mode., Jimmy Aguilar Mena, 2019/05/03
- [Emacs-diffs] fill_column_indicator 298f0a9 10/10: ; Corrected display-fill-column-indicator mode., Jimmy Aguilar Mena, 2019/05/03
- [Emacs-diffs] fill_column_indicator b28e53a 08/10: *lisp/display-fill-column-indicator.el: Extended condition to set,
Jimmy Aguilar Mena <=