[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/lin 8aa367ec86 13/46: Merge branch 'various' into 'main
From: |
ELPA Syncer |
Subject: |
[elpa] externals/lin 8aa367ec86 13/46: Merge branch 'various' into 'main' |
Date: |
Thu, 7 Apr 2022 23:57:45 -0400 (EDT) |
branch: externals/lin
commit 8aa367ec86b531f31ee89b39e03ec28da3b7e565
Merge: fb32511d20 c3bfd5c300
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Merge branch 'various' into 'main'
Support mu4e, fixes & tweaks
See merge request protesilaos/lin!1
---
lin.el | 30 ++++++++++++++++++++----------
1 file changed, 20 insertions(+), 10 deletions(-)
diff --git a/lin.el b/lin.el
index 34967edb5e..0f3f90a801 100644
--- a/lin.el
+++ b/lin.el
@@ -84,7 +84,7 @@ the `lin-hl-override-fg' is applied."
(((class color) (min-colors 88) (background dark))
:background "#103265")
(t :inherit highlight))
- "Like `lin-hl', but does not override foreground color.
+ "Like `lin-hl-override-fg', but does not override foreground color.
Used only when `lin-override-foreground' is nil."
:group 'lin)
@@ -99,22 +99,32 @@ Used only when `lin-override-foreground' is nil."
Used only when `lin-override-foreground' is non-nil."
:group 'lin)
-(defun lin--face ()
- "Determine face based on `lin-override-foreground'."
- (if lin-override-foreground 'lin-hl-override-fg 'lin-hl))
-
-(defvar lin--cookie nil
+(defvar-local lin--cookie nil
"Cookie returned by `face-remap-add-relative'.")
+(defun lin--source-face ()
+ "Determine the source face, what to remap."
+ (cond
+ ((derived-mode-p 'mu4e-headers-mode)
+ 'mu4e-header-highlight-face)
+ (t
+ 'hl-line)))
+
+(defun lin--dest-face ()
+ "Determine the destination face, what source must remap to.
+This is controlled by `lin-override-foreground', which see."
+ (if lin-override-foreground 'lin-hl-override-fg 'lin-hl))
+
(define-minor-mode lin-mode
"Remap `hl-line' face to a local LIN face.
The overall style is controlled by `lin-override-foreground'."
:local t
:init-value nil
- (let ((face (lin--face)))
- (if lin-mode
- (setq lin--cookie (face-remap-add-relative 'hl-line face))
- (face-remap-remove-relative lin--cookie))))
+ (if lin-mode
+ (setq lin--cookie
+ (face-remap-add-relative (lin--source-face) (lin--dest-face)))
+ (face-remap-remove-relative lin--cookie)))
(provide 'lin)
+
;;; lin.el ends here
- [elpa] externals/lin 75f98524ec 29/46: Add bongo to lin-mode-hooks, (continued)
- [elpa] externals/lin 75f98524ec 29/46: Add bongo to lin-mode-hooks, ELPA Syncer, 2022/04/07
- [elpa] externals/lin ea174a53f2 36/46: Format the Commentary a bit better, ELPA Syncer, 2022/04/07
- [elpa] externals/lin fef282ebbb 44/46: Improve how lin--setup resets hooks, ELPA Syncer, 2022/04/07
- [elpa] externals/lin 81c256632b 14/46: Update manual's Acknowledgements, ELPA Syncer, 2022/04/07
- [elpa] externals/lin 6da81a4a70 23/46: Minor rewording of heading, ELPA Syncer, 2022/04/07
- [elpa] externals/lin 96a61754c8 19/46: Account for the case of hl-line-face, ELPA Syncer, 2022/04/07
- [elpa] externals/lin 4616650344 24/46: Added mu4e-headers-mode to lin-foreign-hooks, ELPA Syncer, 2022/04/07
- [elpa] externals/lin 3c1df2c174 38/46: Fix stable version, ELPA Syncer, 2022/04/07
- [elpa] externals/lin 07f40bd5e9 35/46: Add minor-mode lighter, ELPA Syncer, 2022/04/07
- [elpa] externals/lin fb32511d20 08/46: Add Acknowledgements to the manual, ELPA Syncer, 2022/04/07
- [elpa] externals/lin 8aa367ec86 13/46: Merge branch 'various' into 'main',
ELPA Syncer <=
- [elpa] externals/lin e5a0da969e 20/46: Add function lin-add-to-many-modes and option lin-foreign-hooks (#3), ELPA Syncer, 2022/04/07
- [elpa] externals/lin a85b9da0d1 21/46: Merge branch 'lin-add-to-many-modes' into 'main', ELPA Syncer, 2022/04/07
- [elpa] externals/lin 69321c759a 22/46: Update manual's Acknowledgements, ELPA Syncer, 2022/04/07
- [elpa] externals/lin 307c19f2e3 27/46: Remove needless 'when', ELPA Syncer, 2022/04/07
- [elpa] externals/lin ea1275a282 02/46: Fix typo, ELPA Syncer, 2022/04/07
- [elpa] externals/lin df19fb1108 09/46: Fix disabling mode, ELPA Syncer, 2022/04/07
- [elpa] externals/lin aa42c93609 11/46: Support mu4e-headers-mode, ELPA Syncer, 2022/04/07
- [elpa] externals/lin c3bfd5c300 12/46: Tweak whitespace, ELPA Syncer, 2022/04/07
- [elpa] externals/lin 52fbd27a29 15/46: Document face customisation for macOS, ELPA Syncer, 2022/04/07
- [elpa] externals/lin 067e7bcf6b 18/46: Update manual's acknowledgements section, ELPA Syncer, 2022/04/07