[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/nano-modeline 18c437b 04/24: Added TTY top/bottom case
From: |
ELPA Syncer |
Subject: |
[elpa] externals/nano-modeline 18c437b 04/24: Added TTY top/bottom case |
Date: |
Wed, 6 Oct 2021 17:57:32 -0400 (EDT) |
branch: externals/nano-modeline
commit 18c437b82bdcb456843106fbc0e8a29293294287
Author: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
Commit: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
Added TTY top/bottom case
---
README.md | 2 +-
nano-modeline.el | 40 +++++++++++++++++++++++-----------------
2 files changed, 24 insertions(+), 18 deletions(-)
diff --git a/README.md b/README.md
index 7d3c727..08552e8 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@ A simple modeline. Best with [N Λ N O
theme](https://github.com/rougier/nano-th
Install with [straight.el](https://github.com/raxod502/straight.el):
```
-;; Optional
+;; Optional (N Λ N O theme)
(straight-use-package '(nano-theme :type git :host github
:repo "rougier/nano-theme"))
diff --git a/nano-modeline.el b/nano-modeline.el
index e0a7f4e..b88c8aa 100644
--- a/nano-modeline.el
+++ b/nano-modeline.el
@@ -47,10 +47,10 @@ Modeline is composed as:
[ status | name (primary) secondary ]"
:group 'nano-modeline)
-(defvar nano-modeline--selected-window (selected-window)
+(defvar nano-modeline--selected-window nil
"Currently selected window")
-(defcustom nano-modeline-position 'top
+(defcustom nano-modeline-position 'bottom
"Default position (top or bottom)"
:type '(choice (const :tag "Top" top)
(const :tag "Bottom" bottom))
@@ -578,29 +578,36 @@ Modeline is composed as:
:underline 'unspecified :overline 'unspecified
:box 'unspecified :inherit 'unspecified))
-(defun nano-modeline ()
+(defun nano-modeline (&optional position)
"Install a header line whose content is dependend on the major mode"
(interactive)
+ ;; Update selected window
+ (setq nano-modeline--selected-window (selected-window))
+ (setq nano-modeline-position (or position nano-modeline-position))
+
;; "Box" effect is obtained through display property
- (set-face-attribute 'mode-line nil :box nil)
- (set-face-attribute 'mode-line-inactive nil :box nil)
+ (nano-modeline-face-clear 'mode-line)
+ (nano-modeline-face-clear 'mode-line-inactive)
+ (nano-modeline-face-clear 'header-line)
(setq eshell-status-in-modeline nil)
-
- ;; TTY Mode
- (cond ((not (display-graphic-p))
- (setq-default mode-line-format (list "%-"))
- (nano-modeline-face-clear 'mode-line)
- (nano-modeline-face-clear 'mode-line-inactive)
+
+ ;; TTY mode top
+ (cond ((and (not (display-graphic-p) (eq nano-modeline-position 'top)))
+ (setq mode-line-format nil)
+ (setq-default mode-line-format nil)
(set-face-attribute 'mode-line nil :inherit 'nano-modeline-active)
(set-face-attribute 'mode-line-inactive nil :inherit
'nano-modeline-inactive))
+ ;; TTY Mode bottom
+ ((and (not (display-graphic-p) (eq nano-modeline-position 'top)))
+ (setq header-line-format nil)
+ (setq-default header-line-format nil))
+
;; Graphic mode, modeline at top
- ((and (display-graphic-p) (eq nano-modeline-position 'top))
+ ((eq nano-modeline-position 'top)
+ (setq mode-line-format (list ""))
(setq-default mode-line-format (list ""))
- (nano-modeline-face-clear 'mode-line)
- (nano-modeline-face-clear 'mode-line-inactive)
- (nano-modeline-face-clear 'header-line)
(set-face-attribute 'mode-line nil :inherit 'nano-modeline-active
:height 0.1)
(set-face-attribute 'mode-line-inactive nil :inherit
'nano-modeline-inactive
@@ -608,6 +615,7 @@ Modeline is composed as:
;; Graphic mode, modeline at bottom
(t
+ (setq header-line-format nil)
(setq-default header-line-format nil)
(set-face-attribute 'mode-line nil :height (face-attribute
'default :height))
(set-face-attribute 'mode-line-inactive nil :height (face-attribute
'default :height))))
@@ -649,6 +657,4 @@ Modeline is composed as:
(add-hook 'post-command-hook
(lambda () (setq nano-modeline--selected-window (selected-window))))
-(nano-modeline)
-
(provide 'nano-modeline)
- [elpa] externals/nano-modeline 5690ea3 06/24: Added screenshots, (continued)
- [elpa] externals/nano-modeline 5690ea3 06/24: Added screenshots, ELPA Syncer, 2021/10/06
- [elpa] externals/nano-modeline 53d327a 13/24: Fix incompatibilities with mu4e > 1.6.5, ELPA Syncer, 2021/10/06
- [elpa] externals/nano-modeline 5edeac2 22/24: Typo, ELPA Syncer, 2021/10/06
- [elpa] externals/nano-modeline 9d5290a 14/24: Merge pull request #4 from seblemaguer/fix-mu4e, ELPA Syncer, 2021/10/06
- [elpa] externals/nano-modeline ac0b497 15/24: Cleanup code, ELPA Syncer, 2021/10/06
- [elpa] externals/nano-modeline c3c6f4c 17/24: Fix mu4e modeline and added user mode, ELPA Syncer, 2021/10/06
- [elpa] externals/nano-modeline 0c94fc8 20/24: Linting, ELPA Syncer, 2021/10/06
- [elpa] externals/nano-modeline d6cb2a6 23/24: Linting + bugfix (mu4e), ELPA Syncer, 2021/10/06
- [elpa] externals/nano-modeline 8052795 24/24: Added autoload, ELPA Syncer, 2021/10/06
- [elpa] externals/nano-modeline edcbfe4 12/24: Merge remote-tracking branch 'origin/master', ELPA Syncer, 2021/10/06
- [elpa] externals/nano-modeline 18c437b 04/24: Added TTY top/bottom case,
ELPA Syncer <=
- [elpa] externals/nano-modeline e84ca06 05/24: Removed optional position, ELPA Syncer, 2021/10/06
- [elpa] externals/nano-modeline 9ca47db 16/24: Merge remote-tracking branch 'origin/master', ELPA Syncer, 2021/10/06
- [elpa] externals/nano-modeline 2bbe1d5 19/24: Linting and removed s.el dependency, ELPA Syncer, 2021/10/06
- [elpa] externals/nano-modeline 2574703 18/24: Updated deft screenshot, ELPA Syncer, 2021/10/06
- [elpa] externals/nano-modeline fcb7898 21/24: Update installation instructions, ELPA Syncer, 2021/10/06