[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/nano-modeline 2bbe1d5 19/24: Linting and removed s.el d
From: |
ELPA Syncer |
Subject: |
[elpa] externals/nano-modeline 2bbe1d5 19/24: Linting and removed s.el dependency |
Date: |
Wed, 6 Oct 2021 17:57:36 -0400 (EDT) |
branch: externals/nano-modeline
commit 2bbe1d5c7af964bedbb6d876732df0da1a273c10
Author: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
Commit: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
Linting and removed s.el dependency
---
nano-modeline.el | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/nano-modeline.el b/nano-modeline.el
index ed22cbb..5be9f9e 100644
--- a/nano-modeline.el
+++ b/nano-modeline.el
@@ -161,7 +161,15 @@ Modeline is composed as:
"Should the user supplied mode be called for modeline?"
nano-modeline-user-mode)
-(defun vc-branch ()
+(defun nano-modeline-truncate (str size &optional ellipsis)
+ "If STR is longer than SIZE, truncate it and add ELLIPSIS."
+
+ (let ((ellipsis (or ellipsis "…")))
+ (if (> (length str) size)
+ (format "%s%s" (substring str 0 (- size (length ellipsis))) ellipsis)
+ str)))
+
+(defun nano-modeline-vc-branch ()
(if vc-mode
(let ((backend (vc-backend buffer-file-name)))
(concat "#" (substring-no-properties vc-mode
@@ -293,7 +301,7 @@ Modeline is composed as:
(feed-title (plist-get (elfeed-feed-meta feed) :title))
(entry-author (elfeed-meta elfeed-show-entry :author)))
(nano-modeline-compose (nano-modeline-status)
- (s-truncate 40 title "…")
+ (nano-modeline-truncate title 40)
(concat "(" tags-str ")")
feed-title)))
@@ -457,7 +465,7 @@ Modeline is composed as:
(from (mu4e~headers-contact-str (mu4e-message-field msg :from)))
(date (mu4e-message-field msg :date)))
(nano-modeline-compose (nano-modeline-status)
- (s-truncate 40 subject "…")
+ (nano-modeline-truncate subject 40)
""
from)))
@@ -503,7 +511,7 @@ Modeline is composed as:
(defun nano-modeline-org-clock-mode ()
(let ((buffer-name (format-mode-line "%b"))
(mode-name (nano-mode-name))
- (branch (vc-branch))
+ (branch (nano-modeline-vc-branch))
(position (format-mode-line "%l:%c")))
(nano-modeline-compose (nano-modeline-status)
buffer-name
@@ -520,7 +528,7 @@ Modeline is composed as:
(defun nano-modeline-docview-mode ()
(let ((buffer-name (format-mode-line "%b"))
(mode-name (nano-mode-name))
- (branch (vc-branch))
+ (branch (nano-modeline-vc-branch))
(page-number (concat
(number-to-string (doc-view-current-page)) "/"
(or (ignore-errors
@@ -542,7 +550,7 @@ Modeline is composed as:
(defun nano-modeline-pdf-view-mode ()
(let ((buffer-name (format-mode-line "%b"))
(mode-name (nano-mode-name))
- (branch (vc-branch))
+ (branch (nano-modeline-vc-branch))
(page-number (concat
(number-to-string (pdf-view-current-page)) "/"
(or (ignore-errors
@@ -616,7 +624,7 @@ Modeline is composed as:
(defun nano-modeline-default-mode ()
(let ((buffer-name (format-mode-line "%b"))
(mode-name (nano-mode-name))
- (branch (vc-branch))
+ (branch (nano-modeline-vc-branch))
(position (format-mode-line "%l:%c")))
(nano-modeline-compose (nano-modeline-status)
buffer-name
- [elpa] externals/nano-modeline 9d5290a 14/24: Merge pull request #4 from seblemaguer/fix-mu4e, (continued)
- [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, 2021/10/06
- [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 <=
- [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