[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/telephone-line cbaf1b8134 138/195: Switch guards to boundp
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/telephone-line cbaf1b8134 138/195: Switch guards to boundp checks rather than eval-after-load |
Date: |
Wed, 5 Jan 2022 02:59:40 -0500 (EST) |
branch: elpa/telephone-line
commit cbaf1b813475003ceb677acb48c4e964a99c68d9
Author: Daniel Bordak <dbordak@fastmail.fm>
Commit: Daniel Bordak <dbordak@fastmail.fm>
Switch guards to boundp checks rather than eval-after-load
---
telephone-line-segments.el | 71 +++++++++++++++++++++++-----------------------
1 file changed, 35 insertions(+), 36 deletions(-)
diff --git a/telephone-line-segments.el b/telephone-line-segments.el
index 960842c868..b1322f83da 100644
--- a/telephone-line-segments.el
+++ b/telephone-line-segments.el
@@ -98,42 +98,41 @@ mouse-3: Toggle minor modes"
(when (boundp 'erc-modified-channels-object)
(string-trim erc-modified-channels-object)))
-(eval-after-load 'evil
- '(telephone-line-defsegment* telephone-line-evil-tag-segment ()
- (let ((tag (cond
- ((not (evil-visual-state-p)) (upcase (symbol-name
evil-state)))
- ((eq evil-visual-selection 'block)
- (if telephone-line-evil-use-short-tag "VB" "V-BLOCK"))
- ((eq evil-visual-selection 'line)
- (if telephone-line-evil-use-short-tag "VL" "V-LINE"))
- (t "VISUAL"))))
- (if telephone-line-evil-use-short-tag
- (seq-take tag 2)
- tag))))
-
-(eval-after-load 'xah-fly-keys
- '(telephone-line-defsegment* telephone-line-xah-fly-keys-segment ()
- (let ((tag (if xah-fly-insert-state-q
- "INSERT" "COMMAND")))
- (if telephone-line-evil-use-short-tag
- (seq-take tag 1)
- tag))))
-
-(eval-after-load 'ryo-modal
- '(telephone-line-defsegment* telephone-line-ryo-modal-segment ()
- (let ((tag (if ryo-modal-mode
- "RYO" "EMACS")))
- (if telephone-line-evil-use-short-tag
- (seq-take tag 1)
- tag))))
-
-(eval-after-load 'workgroups2
- '(telephone-line-defsegment* telephone-line-workgroups2-segment ()
- (telephone-line-raw (wg-mode-line-string) t)))
-
-(eval-after-load 'nyan-mode
- '(telephone-line-defsegment* telephone-line-nyan-segment ()
- (nyan-create)))
+(telephone-line-defsegment* telephone-line-evil-tag-segment ()
+ (when (bound-and-true-p evil-mode)
+ (let ((tag (cond
+ ((not (evil-visual-state-p)) (upcase (symbol-name evil-state)))
+ ((eq evil-visual-selection 'block)
+ (if telephone-line-evil-use-short-tag "VB" "V-BLOCK"))
+ ((eq evil-visual-selection 'line)
+ (if telephone-line-evil-use-short-tag "VL" "V-LINE"))
+ (t "VISUAL"))))
+ (if telephone-line-evil-use-short-tag
+ (seq-take tag 2)
+ tag))))
+
+(telephone-line-defsegment* telephone-line-xah-fly-keys-segment ()
+ (when (boundp xah-fly-insert-state-q)
+ (let ((tag (if xah-fly-insert-state-q
+ "INSERT" "COMMAND")))
+ (if telephone-line-evil-use-short-tag
+ (seq-take tag 1)
+ tag))))
+
+(telephone-line-defsegment* telephone-line-ryo-modal-segment ()
+ (let ((tag (if (bound-and-true-p ryo-modal-mode)
+ "RYO" "EMACS")))
+ (if telephone-line-evil-use-short-tag
+ (seq-take tag 1)
+ tag)))
+
+(telephone-line-defsegment* telephone-line-workgroups2-segment ()
+ (when (bound-and-true-p workgroups-mode)
+ (telephone-line-raw (wg-mode-line-string) t)))
+
+(telephone-line-defsegment* telephone-line-nyan-segment ()
+ (when (bound-and-true-p nyan-mode)
+ (nyan-create)))
(provide 'telephone-line-segments)
;;; telephone-line-segments.el ends here
- [nongnu] elpa/telephone-line 743614f372 128/195: Force nil's width to 0; fixes clipping issue., (continued)
- [nongnu] elpa/telephone-line 743614f372 128/195: Force nil's width to 0; fixes clipping issue., ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 1cc28a7811 146/195: Forgot the else clause, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line dd1afefa00 152/195: Add telephone-line-error and warning faces., ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line dde8805867 142/195: Remove brackets from projectile segment, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line b3eaf4b825 134/195: Use center-lhs and center-rhs instead of keyword, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line f7014a0cc5 004/195: Add Readme, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 324da1bbb6 111/195: Add ryo-modal support, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 64a1f079f5 090/195: Update copyrights, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line c9aca6ce03 143/195: Add flycheck segment, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 6e1ecf51a2 147/195: Add doom/atom encoding segments, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line cbaf1b8134 138/195: Switch guards to boundp checks rather than eval-after-load,
ELPA Syncer <=
- [nongnu] elpa/telephone-line e8e2078b43 131/195: Less bad name for unicode separators, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 212b3df07a 166/195: Merge pull request #92 from sebasmonia/master, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 6521585c94 180/195: Merge pull request #112 from fishyfriend/evil-god, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 06cbfc8d49 179/195: Add face for evil-god-state, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line deda33317b 187/195: Fix formatting, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line c5e08d268d 007/195: Move screenshots into subdir, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 0762bae37a 079/195: Corrected indentation, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 96030b4c98 026/195: Further clean up start of readme, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 2e7ba0bfc2 015/195: Make utf-8 separators a part of pbm separators, rather than separate entities altogether, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 3e66e72d9c 075/195: add telephone-line-workgroups2-segment, ELPA Syncer, 2022/01/05