aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorJimmy Aguilar Mena2019-09-04 17:27:28 +0200
committerJimmy Aguilar Mena2019-10-14 14:18:39 +0200
commitbc8db39775eb3af36a45d51130cd4dbd3b3e7210 (patch)
tree9d7d643568943137bc436a7ecd021b2e07245e0e /lisp
parentf9206f34d63104c50659a15d3615646a09df87bf (diff)
downloademacs-bc8db39775eb3af36a45d51130cd4dbd3b3e7210.tar.gz
emacs-bc8db39775eb3af36a45d51130cd4dbd3b3e7210.zip
Added face parameter :extend.
This is an initial change to add a parameter :extend that will be used in the display engine later.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/cus-face.el6
-rw-r--r--lisp/faces.el47
-rw-r--r--lisp/help-fns.el1
3 files changed, 43 insertions, 11 deletions
diff --git a/lisp/cus-face.el b/lisp/cus-face.el
index d73bce42c3e..5a49a810434 100644
--- a/lisp/cus-face.el
+++ b/lisp/cus-face.el
@@ -233,7 +233,11 @@
233 (file :tag "File" 233 (file :tag "File"
234 :help-echo "Name of bitmap file." 234 :help-echo "Name of bitmap file."
235 :must-match t))) 235 :must-match t)))
236 236 (:extend
237 (choice :tag "Extend"
238 :help-echo "Control whether attributes should be extended after EOL."
239 (const :tag "Off" nil)
240 (const :tag "On" t)))
237 (:inherit 241 (:inherit
238 (repeat :tag "Inherit" 242 (repeat :tag "Inherit"
239 :help-echo "List of faces to inherit attributes from." 243 :help-echo "List of faces to inherit attributes from."
diff --git a/lisp/faces.el b/lisp/faces.el
index c789d3729e0..36fc69895dd 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -342,6 +342,7 @@ is either `foreground-color', `background-color', or a keyword."
342 (:box (".attributeBox" . "Face.AttributeBox")) 342 (:box (".attributeBox" . "Face.AttributeBox"))
343 (:underline (".attributeUnderline" . "Face.AttributeUnderline")) 343 (:underline (".attributeUnderline" . "Face.AttributeUnderline"))
344 (:inverse-video (".attributeInverse" . "Face.AttributeInverse")) 344 (:inverse-video (".attributeInverse" . "Face.AttributeInverse"))
345 (:extend (".attributeExtend" . "Face.AttributeExtend"))
345 (:stipple 346 (:stipple
346 (".attributeStipple" . "Face.AttributeStipple") 347 (".attributeStipple" . "Face.AttributeStipple")
347 (".attributeBackgroundPixmap" . "Face.AttributeBackgroundPixmap")) 348 (".attributeBackgroundPixmap" . "Face.AttributeBackgroundPixmap"))
@@ -594,6 +595,13 @@ Use `face-attribute' for finer control."
594 (let ((italic (face-attribute face :slant frame inherit))) 595 (let ((italic (face-attribute face :slant frame inherit)))
595 (memq italic '(italic oblique)))) 596 (memq italic '(italic oblique))))
596 597
598(defun face-extend-p (face &optional frame inherit)
599 "Return non-nil if FACE specifies a non-nil extend.
600If the optional argument FRAME is given, report on face FACE in that frame.
601If FRAME is t, report on the defaults for face FACE (for new frames).
602If FRAME is omitted or nil, use the selected frame.
603Optional argument INHERIT is passed to `face-attribute'."
604 (eq (face-attribute face :extend frame inherit) t))
597 605
598 606
599;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 607;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -760,6 +768,11 @@ For convenience, attributes `:family', `:foundry', `:width',
760`:height', `:weight', and `:slant' may also be set in one step 768`:height', `:weight', and `:slant' may also be set in one step
761from an X font name: 769from an X font name:
762 770
771`:extend'
772
773VALUE specifies whether the FACE should be extended after EOL.
774VALUE must be one of t or nil.
775
763`:font' 776`:font'
764 777
765Set font-related face attributes from VALUE. 778Set font-related face attributes from VALUE.
@@ -979,6 +992,18 @@ Use `set-face-attribute' or `modify-face' for finer control."
979 992
980(define-obsolete-function-alias 'set-face-italic-p 'set-face-italic "24.4") 993(define-obsolete-function-alias 'set-face-italic-p 'set-face-italic "24.4")
981 994
995(defun set-face-extend (face extend-p &optional frame)
996 "Specify whether face FACE should be extended.
997EXTEND-P nil means FACE explicitly doesn't extend after EOL.
998EXTEND-P t means FACE extends after EOL.
999
1000FRAME nil or not specified means change face on all frames.
1001Use `set-face-attribute' to \"unspecify\" underlining."
1002 (interactive
1003 (let ((list (read-face-and-attribute :extend)))
1004 (list (car list) (if (cadr list) t))))
1005 (set-face-attribute face frame :extend extend-p))
1006
982 1007
983(defalias 'set-face-background-pixmap 'set-face-stipple) 1008(defalias 'set-face-background-pixmap 'set-face-stipple)
984 1009
@@ -1102,7 +1127,7 @@ an integer value."
1102 (:slant 1127 (:slant
1103 (mapcar #'(lambda (x) (cons (symbol-name (aref x 1)) (aref x 1))) 1128 (mapcar #'(lambda (x) (cons (symbol-name (aref x 1)) (aref x 1)))
1104 font-slant-table)) 1129 font-slant-table))
1105 (:inverse-video 1130 ((or :inverse-video :extend)
1106 (mapcar #'(lambda (x) (cons (symbol-name x) x)) 1131 (mapcar #'(lambda (x) (cons (symbol-name x) x))
1107 (internal-lisp-face-attribute-values attribute))) 1132 (internal-lisp-face-attribute-values attribute)))
1108 ((or :underline :overline :strike-through :box) 1133 ((or :underline :overline :strike-through :box)
@@ -1147,6 +1172,7 @@ an integer value."
1147 (:slant . "slant") 1172 (:slant . "slant")
1148 (:underline . "underline") 1173 (:underline . "underline")
1149 (:overline . "overline") 1174 (:overline . "overline")
1175 (:extend . "extend")
1150 (:strike-through . "strike-through") 1176 (:strike-through . "strike-through")
1151 (:box . "box") 1177 (:box . "box")
1152 (:inverse-video . "inverse-video display") 1178 (:inverse-video . "inverse-video display")
@@ -1549,7 +1575,8 @@ is given, in which case return its value instead."
1549 ;; (see also realize_default_face in xfaces.c). 1575 ;; (see also realize_default_face in xfaces.c).
1550 (append 1576 (append
1551 '(:underline nil :overline nil :strike-through nil 1577 '(:underline nil :overline nil :strike-through nil
1552 :box nil :inverse-video nil :stipple nil :inherit nil) 1578 :box nil :inverse-video nil :stipple nil :inherit nil
1579 :extend nil)
1553 ;; `display-graphic-p' is unavailable when running 1580 ;; `display-graphic-p' is unavailable when running
1554 ;; temacs, prior to loading frame.el. 1581 ;; temacs, prior to loading frame.el.
1555 (when (fboundp 'display-graphic-p) 1582 (when (fboundp 'display-graphic-p)
@@ -2314,24 +2341,24 @@ If you set `term-file-prefix' to nil, this function does nothing."
2314;; if background is light. 2341;; if background is light.
2315(defface region 2342(defface region
2316 '((((class color) (min-colors 88) (background dark)) 2343 '((((class color) (min-colors 88) (background dark))
2317 :background "blue3") 2344 :background "blue3" :extend t)
2318 (((class color) (min-colors 88) (background light) (type gtk)) 2345 (((class color) (min-colors 88) (background light) (type gtk))
2319 :distant-foreground "gtk_selection_fg_color" 2346 :distant-foreground "gtk_selection_fg_color"
2320 :background "gtk_selection_bg_color") 2347 :background "gtk_selection_bg_color" :extend t)
2321 (((class color) (min-colors 88) (background light) (type ns)) 2348 (((class color) (min-colors 88) (background light) (type ns))
2322 :distant-foreground "ns_selection_fg_color" 2349 :distant-foreground "ns_selection_fg_color"
2323 :background "ns_selection_bg_color") 2350 :background "ns_selection_bg_color" :extend t)
2324 (((class color) (min-colors 88) (background light)) 2351 (((class color) (min-colors 88) (background light))
2325 :background "lightgoldenrod2") 2352 :background "lightgoldenrod2" :extend t)
2326 (((class color) (min-colors 16) (background dark)) 2353 (((class color) (min-colors 16) (background dark))
2327 :background "blue3") 2354 :background "blue3" :extend t)
2328 (((class color) (min-colors 16) (background light)) 2355 (((class color) (min-colors 16) (background light))
2329 :background "lightgoldenrod2") 2356 :background "lightgoldenrod2" :extend t)
2330 (((class color) (min-colors 8)) 2357 (((class color) (min-colors 8))
2331 :background "blue" :foreground "white") 2358 :background "blue" :foreground "white" :extend t)
2332 (((type tty) (class mono)) 2359 (((type tty) (class mono))
2333 :inverse-video t) 2360 :inverse-video t)
2334 (t :background "gray")) 2361 (t :background "gray" :extend t))
2335 "Basic face for highlighting the region." 2362 "Basic face for highlighting the region."
2336 :version "21.1" 2363 :version "21.1"
2337 :group 'basic-faces) 2364 :group 'basic-faces)
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 5e55240daba..235aa9a6e19 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -1385,6 +1385,7 @@ If FRAME is omitted or nil, use the selected frame."
1385 (:stipple . "Stipple") 1385 (:stipple . "Stipple")
1386 (:font . "Font") 1386 (:font . "Font")
1387 (:fontset . "Fontset") 1387 (:fontset . "Fontset")
1388 (:extend . "Extend")
1388 (:inherit . "Inherit"))) 1389 (:inherit . "Inherit")))
1389 (max-width (apply #'max (mapcar #'(lambda (x) (length (cdr x))) 1390 (max-width (apply #'max (mapcar #'(lambda (x) (length (cdr x)))
1390 attrs)))) 1391 attrs))))