diff options
| author | Jimmy Aguilar Mena | 2019-09-21 23:34:40 +0200 |
|---|---|---|
| committer | Jimmy Aguilar Mena | 2019-10-14 14:18:42 +0200 |
| commit | 424e6f54e5c3592f32016267179171b40dafbb99 (patch) | |
| tree | 1159d5075e6cac06f938a0a59006e7d2cc67543e | |
| parent | 38ee12d5a2df150e6ba9023d968d1c49c85ca6e1 (diff) | |
| download | emacs-424e6f54e5c3592f32016267179171b40dafbb99.tar.gz emacs-424e6f54e5c3592f32016267179171b40dafbb99.zip | |
Document new :extend face attribute in manuals.
Some stylistic corrections in src/xdisp.c and src/xfaces.c.
| -rw-r--r-- | doc/emacs/mark.texi | 5 | ||||
| -rw-r--r-- | doc/lispref/display.texi | 22 | ||||
| -rw-r--r-- | src/xdisp.c | 6 | ||||
| -rw-r--r-- | src/xfaces.c | 7 |
4 files changed, 33 insertions, 7 deletions
diff --git a/doc/emacs/mark.texi b/doc/emacs/mark.texi index bbeb4cb039e..f012d72fc2a 100644 --- a/doc/emacs/mark.texi +++ b/doc/emacs/mark.texi | |||
| @@ -23,6 +23,11 @@ When the mark is active, we say also that the region is active; Emacs | |||
| 23 | indicates its extent by highlighting the text within it, using the | 23 | indicates its extent by highlighting the text within it, using the |
| 24 | @code{region} face (@pxref{Face Customization}). | 24 | @code{region} face (@pxref{Face Customization}). |
| 25 | 25 | ||
| 26 | This is one of the few faces that has the @code{:extend t} attribute | ||
| 27 | by default, which implies that the same face is used to highlight the | ||
| 28 | text and space between end of line and the window border. To | ||
| 29 | highlight only the text you could set this attribute to @code{nil}. | ||
| 30 | |||
| 26 | @cindex deactivating the mark | 31 | @cindex deactivating the mark |
| 27 | After certain non-motion commands, including any command that | 32 | After certain non-motion commands, including any command that |
| 28 | changes the text in the buffer, Emacs automatically @dfn{deactivates} | 33 | changes the text in the buffer, Emacs automatically @dfn{deactivates} |
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 61bd4ce8830..1678d32db0a 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -2482,6 +2482,17 @@ faces (@pxref{Displaying Faces}). If the face to inherit from is | |||
| 2482 | never merges @code{:inherit} attributes. If a list of faces is used, | 2482 | never merges @code{:inherit} attributes. If a list of faces is used, |
| 2483 | attributes from faces earlier in the list override those from later | 2483 | attributes from faces earlier in the list override those from later |
| 2484 | faces. | 2484 | faces. |
| 2485 | |||
| 2486 | @item :extend | ||
| 2487 | Whether or not this face will be extended until the end of the window. | ||
| 2488 | The value should be @code{t} to extend until end of the window using | ||
| 2489 | this face or @code{nil} fill the space between the end of the line and | ||
| 2490 | the end of the window with the default face. When a face is conformed | ||
| 2491 | by merging multiple other faces; only those with @code{:extend t} will | ||
| 2492 | be merged to conform a new face to extend until end of window. By | ||
| 2493 | default only @code{region} and @code{hl-line} have this attribute set | ||
| 2494 | to @code{t}. | ||
| 2495 | |||
| 2485 | @end table | 2496 | @end table |
| 2486 | 2497 | ||
| 2487 | @defun font-family-list &optional frame | 2498 | @defun font-family-list &optional frame |
| @@ -2842,6 +2853,11 @@ This sets the @code{:inverse-video} attribute of @var{face} to | |||
| 2842 | This swaps the foreground and background colors of face @var{face}. | 2853 | This swaps the foreground and background colors of face @var{face}. |
| 2843 | @end deffn | 2854 | @end deffn |
| 2844 | 2855 | ||
| 2856 | @deffn Command set-face-extend face extend &optional frame | ||
| 2857 | This sets the @code{:extend} attribute of @var{face} to | ||
| 2858 | @var{extend}. | ||
| 2859 | @end deffn | ||
| 2860 | |||
| 2845 | The following functions examine the attributes of a face. They | 2861 | The following functions examine the attributes of a face. They |
| 2846 | mostly provide compatibility with old versions of Emacs. If you don't | 2862 | mostly provide compatibility with old versions of Emacs. If you don't |
| 2847 | specify @var{frame}, they refer to the selected frame; @code{t} refers | 2863 | specify @var{frame}, they refer to the selected frame; @code{t} refers |
| @@ -2900,6 +2916,12 @@ This function returns non-@code{nil} if face @var{face} specifies | |||
| 2900 | a non-@code{nil} @code{:inverse-video} attribute. | 2916 | a non-@code{nil} @code{:inverse-video} attribute. |
| 2901 | @end defun | 2917 | @end defun |
| 2902 | 2918 | ||
| 2919 | @defun face-extend-p face &optional frame | ||
| 2920 | This function returns non-@code{nil} if face @var{face} specifies | ||
| 2921 | a non-@code{nil} @code{:extend} attribute. | ||
| 2922 | @end defun | ||
| 2923 | |||
| 2924 | |||
| 2903 | @node Displaying Faces | 2925 | @node Displaying Faces |
| 2904 | @subsection Displaying Faces | 2926 | @subsection Displaying Faces |
| 2905 | @cindex displaying faces | 2927 | @cindex displaying faces |
diff --git a/src/xdisp.c b/src/xdisp.c index 2c69a1f04f1..45462c5ac59 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -21400,7 +21400,7 @@ append_space_for_newline (struct it *it, bool default_face_p) | |||
| 21400 | const int local_default_face_id = | 21400 | const int local_default_face_id = |
| 21401 | lookup_basic_face (it->w, it->f, DEFAULT_FACE_ID); | 21401 | lookup_basic_face (it->w, it->f, DEFAULT_FACE_ID); |
| 21402 | struct face* default_face = | 21402 | struct face* default_face = |
| 21403 | FACE_FROM_ID (it->f, local_default_face_id); | 21403 | FACE_FROM_ID_OR_NULL (it->f, local_default_face_id); |
| 21404 | 21404 | ||
| 21405 | #ifdef HAVE_WINDOW_SYSTEM | 21405 | #ifdef HAVE_WINDOW_SYSTEM |
| 21406 | if (FRAME_WINDOW_P (it->f)) | 21406 | if (FRAME_WINDOW_P (it->f)) |
| @@ -21534,7 +21534,7 @@ append_space_for_newline (struct it *it, bool default_face_p) | |||
| 21534 | g->ascent = it->max_ascent; | 21534 | g->ascent = it->max_ascent; |
| 21535 | g->descent = it->max_descent; | 21535 | g->descent = it->max_descent; |
| 21536 | } | 21536 | } |
| 21537 | #endif // HAVE_WINDOW_SYSTEM | 21537 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 21538 | it->override_ascent = -1; | 21538 | it->override_ascent = -1; |
| 21539 | it->constrain_row_ascent_descent_p = false; | 21539 | it->constrain_row_ascent_descent_p = false; |
| 21540 | it->current_x = saved_x; | 21540 | it->current_x = saved_x; |
| @@ -21722,8 +21722,6 @@ extend_face_to_end_of_line (struct it *it) | |||
| 21722 | } | 21722 | } |
| 21723 | } | 21723 | } |
| 21724 | 21724 | ||
| 21725 | /* Restore the face after the indicator was generated. */ | ||
| 21726 | |||
| 21727 | /* If there is space after the indicator generate an | 21725 | /* If there is space after the indicator generate an |
| 21728 | extra empty glyph to restore the face. Issue was | 21726 | extra empty glyph to restore the face. Issue was |
| 21729 | observed in X systems. */ | 21727 | observed in X systems. */ |
diff --git a/src/xfaces.c b/src/xfaces.c index 5577640325d..cc65527fe61 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -2282,7 +2282,7 @@ filter_face_ref (Lisp_Object face_ref, | |||
| 2282 | of ERR_MSGS). Use NAMED_MERGE_POINTS to detect loops in face | 2282 | of ERR_MSGS). Use NAMED_MERGE_POINTS to detect loops in face |
| 2283 | inheritance or list structure; it may be 0 for most callers. | 2283 | inheritance or list structure; it may be 0 for most callers. |
| 2284 | 2284 | ||
| 2285 | attr_filter is the index of a parameter that conditions the merging | 2285 | ATTR_FILTER is the index of a parameter that conditions the merging |
| 2286 | for named faces (case 1) to only the face_ref where | 2286 | for named faces (case 1) to only the face_ref where |
| 2287 | lface[merge_face_ref] is non-nil. To merge unconditionally set this | 2287 | lface[merge_face_ref] is non-nil. To merge unconditionally set this |
| 2288 | value to 0. | 2288 | value to 0. |
| @@ -6043,7 +6043,7 @@ compute_char_face (struct frame *f, int ch, Lisp_Object prop) | |||
| 6043 | which a different face is needed, as far as text properties and | 6043 | which a different face is needed, as far as text properties and |
| 6044 | overlays are concerned. W is a window displaying current_buffer. | 6044 | overlays are concerned. W is a window displaying current_buffer. |
| 6045 | 6045 | ||
| 6046 | attr_filter is passed merge_face_ref. | 6046 | ATTR_FILTER is passed merge_face_ref. |
| 6047 | 6047 | ||
| 6048 | REGION_BEG, REGION_END delimit the region, so it can be | 6048 | REGION_BEG, REGION_END delimit the region, so it can be |
| 6049 | highlighted. | 6049 | highlighted. |
| @@ -6126,7 +6126,8 @@ face_at_buffer_position (struct window *w, ptrdiff_t pos, | |||
| 6126 | } | 6126 | } |
| 6127 | 6127 | ||
| 6128 | /* Optimize common cases where we can use the default face. */ | 6128 | /* Optimize common cases where we can use the default face. */ |
| 6129 | if (noverlays == 0 && NILP (prop)) | 6129 | if (noverlays == 0 |
| 6130 | && NILP (prop)) | ||
| 6130 | { | 6131 | { |
| 6131 | SAFE_FREE (); | 6132 | SAFE_FREE (); |
| 6132 | return default_face->id; | 6133 | return default_face->id; |