(file :tag "File"
:help-echo "Name of bitmap file."
:must-match t)))
-
+ (:extend
+ (choice :tag "Extend"
+ :help-echo "Control whether attributes should be extended after EOL."
+ (const :tag "Off" nil)
+ (const :tag "On" t)))
(:inherit
(repeat :tag "Inherit"
:help-echo "List of faces to inherit attributes from."
(:box (".attributeBox" . "Face.AttributeBox"))
(:underline (".attributeUnderline" . "Face.AttributeUnderline"))
(:inverse-video (".attributeInverse" . "Face.AttributeInverse"))
+ (:extend (".attributeExtend" . "Face.AttributeExtend"))
(:stipple
(".attributeStipple" . "Face.AttributeStipple")
(".attributeBackgroundPixmap" . "Face.AttributeBackgroundPixmap"))
(let ((italic (face-attribute face :slant frame inherit)))
(memq italic '(italic oblique))))
+(defun face-extend-p (face &optional frame inherit)
+ "Return non-nil if FACE specifies a non-nil extend.
+If the optional argument FRAME is given, report on face FACE in that frame.
+If FRAME is t, report on the defaults for face FACE (for new frames).
+If FRAME is omitted or nil, use the selected frame.
+Optional argument INHERIT is passed to `face-attribute'."
+ (eq (face-attribute face :extend frame inherit) t))
\f
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
`:height', `:weight', and `:slant' may also be set in one step
from an X font name:
+`:extend'
+
+VALUE specifies whether the FACE should be extended after EOL.
+VALUE must be one of t or nil.
+
`:font'
Set font-related face attributes from VALUE.
(define-obsolete-function-alias 'set-face-italic-p 'set-face-italic "24.4")
+(defun set-face-extend (face extend-p &optional frame)
+ "Specify whether face FACE should be extended.
+EXTEND-P nil means FACE explicitly doesn't extend after EOL.
+EXTEND-P t means FACE extends after EOL.
+
+FRAME nil or not specified means change face on all frames.
+Use `set-face-attribute' to \"unspecify\" underlining."
+ (interactive
+ (let ((list (read-face-and-attribute :extend)))
+ (list (car list) (if (cadr list) t))))
+ (set-face-attribute face frame :extend extend-p))
+
(defalias 'set-face-background-pixmap 'set-face-stipple)
(:slant
(mapcar #'(lambda (x) (cons (symbol-name (aref x 1)) (aref x 1)))
font-slant-table))
- (:inverse-video
+ ((or :inverse-video :extend)
(mapcar #'(lambda (x) (cons (symbol-name x) x))
(internal-lisp-face-attribute-values attribute)))
((or :underline :overline :strike-through :box)
(:slant . "slant")
(:underline . "underline")
(:overline . "overline")
+ (:extend . "extend")
(:strike-through . "strike-through")
(:box . "box")
(:inverse-video . "inverse-video display")
;; (see also realize_default_face in xfaces.c).
(append
'(:underline nil :overline nil :strike-through nil
- :box nil :inverse-video nil :stipple nil :inherit nil)
+ :box nil :inverse-video nil :stipple nil :inherit nil
+ :extend nil)
;; `display-graphic-p' is unavailable when running
;; temacs, prior to loading frame.el.
(when (fboundp 'display-graphic-p)
;; if background is light.
(defface region
'((((class color) (min-colors 88) (background dark))
- :background "blue3")
+ :background "blue3" :extend t)
(((class color) (min-colors 88) (background light) (type gtk))
:distant-foreground "gtk_selection_fg_color"
- :background "gtk_selection_bg_color")
+ :background "gtk_selection_bg_color" :extend t)
(((class color) (min-colors 88) (background light) (type ns))
:distant-foreground "ns_selection_fg_color"
- :background "ns_selection_bg_color")
+ :background "ns_selection_bg_color" :extend t)
(((class color) (min-colors 88) (background light))
- :background "lightgoldenrod2")
+ :background "lightgoldenrod2" :extend t)
(((class color) (min-colors 16) (background dark))
- :background "blue3")
+ :background "blue3" :extend t)
(((class color) (min-colors 16) (background light))
- :background "lightgoldenrod2")
+ :background "lightgoldenrod2" :extend t)
(((class color) (min-colors 8))
- :background "blue" :foreground "white")
+ :background "blue" :foreground "white" :extend t)
(((type tty) (class mono))
:inverse-video t)
- (t :background "gray"))
+ (t :background "gray" :extend t))
"Basic face for highlighting the region."
:version "21.1"
:group 'basic-faces)
(:stipple . "Stipple")
(:font . "Font")
(:fontset . "Fontset")
+ (:extend . "Extend")
(:inherit . "Inherit")))
(max-width (apply #'max (mapcar #'(lambda (x) (length (cdr x)))
attrs))))
/* Pixel value or color index of background color. */
unsigned long background;
- /* Pixel value or color index of underline color. */
+ /* Pixel value or color index of underline, overlined,
+ strike-through, or box color. */
unsigned long underline_color;
-
- /* Pixel value or color index of overlined, strike-through, or box
- color. */
unsigned long overline_color;
unsigned long strike_through_color;
unsigned long box_color;
? FRAME_FACE_CACHE (F)->faces_by_id[ID] \
: NULL)
+#define FACE_EXTENSIBLE_P(F) \
+ (!NILP (F->lface[LFACE_EXTEND_INDEX]))
+
/* True if FACE is suitable for displaying ASCII characters. */
INLINE bool
FACE_SUITABLE_FOR_ASCII_CHAR_P (struct face *face)
/* Face id of the iterator saved in case a glyph from dpvec contains
a face. The face is restored when all glyphs from dpvec have
been delivered. */
- int saved_face_id;
+ int saved_face_id, saved_extend_face_id;
/* Vector of glyphs for control character translation. The pointer
dpvec is set to ctl_chars when a control character is translated.
ptrdiff_t prev_stop;
ptrdiff_t base_level_stop;
struct composition_it cmp_it;
- int face_id;
+ int face_id, extend_face_id;
/* Save values specific to a given method. */
union {
/* Face to use. */
int face_id;
+ /* Face to extend at EOL/ */
+ int extend_face_id;
+
/* Setting of buffer-local variable selective-display-ellipses. */
bool_bf selective_display_ellipsis_p : 1;
#define LFACE_FONT(LFACE) AREF ((LFACE), LFACE_FONT_INDEX)
#define LFACE_INHERIT(LFACE) AREF ((LFACE), LFACE_INHERIT_INDEX)
#define LFACE_FONTSET(LFACE) AREF ((LFACE), LFACE_FONTSET_INDEX)
+#define LFACE_EXTEND(LFACE) AREF ((LFACE), LFACE_EXTEND_INDEX)
#define LFACE_DISTANT_FOREGROUND(LFACE) \
AREF ((LFACE), LFACE_DISTANT_FOREGROUND_INDEX)
|| SYMBOLP (attrs[LFACE_UNDERLINE_INDEX])
|| STRINGP (attrs[LFACE_UNDERLINE_INDEX])
|| CONSP (attrs[LFACE_UNDERLINE_INDEX]));
+ eassert (UNSPECIFIEDP (attrs[LFACE_EXTEND_INDEX])
+ || IGNORE_DEFFACE_P (attrs[LFACE_EXTEND_INDEX])
+ || SYMBOLP (attrs[LFACE_EXTEND_INDEX])
+ || STRINGP (attrs[LFACE_EXTEND_INDEX]));
eassert (UNSPECIFIEDP (attrs[LFACE_OVERLINE_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_OVERLINE_INDEX])
|| SYMBOLP (attrs[LFACE_OVERLINE_INDEX])
err_msgs, named_merge_points))
err = true;
}
+ else if (EQ (keyword, QCextend))
+ {
+ if (EQ (value, Qt) || NILP (value))
+ to[LFACE_EXTEND_INDEX] = value;
+ else
+ err = true;
+ }
else
err = true;
old_value = LFACE_INVERSE (lface);
ASET (lface, LFACE_INVERSE_INDEX, value);
}
+ else if (EQ (attr, QCextend))
+ {
+ if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value))
+ {
+ CHECK_SYMBOL (value);
+ if (!EQ (value, Qt) && !NILP (value))
+ signal_error ("Invalid extend face attribute value", value);
+ }
+ old_value = LFACE_EXTEND (lface);
+ ASET (lface, LFACE_EXTEND_INDEX, value);
+ }
else if (EQ (attr, QCforeground))
{
/* Compatibility with 20.x. */
value = face_boolean_x_resource_value (value, true);
else if (EQ (attr, QCweight) || EQ (attr, QCslant) || EQ (attr, QCwidth))
value = intern (SSDATA (value));
- else if (EQ (attr, QCreverse_video) || EQ (attr, QCinverse_video))
+ else if (EQ (attr, QCreverse_video)
+ || EQ (attr, QCinverse_video)
+ || EQ (attr, QCextend))
value = face_boolean_x_resource_value (value, true);
else if (EQ (attr, QCunderline)
|| EQ (attr, QCoverline)
value = LFACE_SWIDTH (lface);
else if (EQ (keyword, QCinherit))
value = LFACE_INHERIT (lface);
+ else if (EQ (keyword, QCextend))
+ value = LFACE_EXTEND (lface);
else if (EQ (keyword, QCfont))
value = LFACE_FONT (lface);
else if (EQ (keyword, QCfontset))
if (EQ (attr, QCunderline) || EQ (attr, QCoverline)
|| EQ (attr, QCstrike_through)
- || EQ (attr, QCinverse_video) || EQ (attr, QCreverse_video))
+ || EQ (attr, QCinverse_video)
+ || EQ (attr, QCreverse_video)
+ || EQ (attr, QCextend))
result = list2 (Qt, Qnil);
return result;
|| (!UNSPECIFIEDP (attrs[LFACE_INVERSE_INDEX])
&& face_attr_equal_p (attrs[LFACE_INVERSE_INDEX],
def_attrs[LFACE_INVERSE_INDEX]))
+ || (!UNSPECIFIEDP (attrs[LFACE_EXTEND_INDEX])
+ && face_attr_equal_p (attrs[LFACE_EXTEND_INDEX],
+ def_attrs[LFACE_EXTEND_INDEX]))
|| (!UNSPECIFIEDP (attrs[LFACE_FOREGROUND_INDEX])
&& face_attr_equal_p (attrs[LFACE_FOREGROUND_INDEX],
def_attrs[LFACE_FOREGROUND_INDEX]))
ASET (lface, LFACE_FONTSET_INDEX, Qnil);
}
+ if (UNSPECIFIEDP (LFACE_EXTEND (lface)))
+ ASET (lface, LFACE_EXTEND_INDEX, Qnil);
+
if (UNSPECIFIEDP (LFACE_UNDERLINE (lface)))
ASET (lface, LFACE_UNDERLINE_INDEX, Qnil);
DEFSYM (QCstrike_through, ":strike-through");
DEFSYM (QCbox, ":box");
DEFSYM (QCinherit, ":inherit");
+ DEFSYM (QCextend, ":extend");
/* Symbols used for Lisp face attribute values. */
DEFSYM (QCcolor, ":color");