[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/blow 4736d1419c 4/5: Revise the code to be two lines short
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/blow 4736d1419c 4/5: Revise the code to be two lines shorter |
Date: |
Sun, 27 Nov 2022 15:58:34 -0500 (EST) |
branch: elpa/blow
commit 4736d1419c0dc2bef504d374d61ff1379a58c322
Author: Akib Azmain Turja <akib@disroot.org>
Commit: Akib Azmain Turja <akib@disroot.org>
Revise the code to be two lines shorter
---
blow.el | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/blow.el b/blow.el
index 15cfd75956..1dcf49d11d 100644
--- a/blow.el
+++ b/blow.el
@@ -93,7 +93,7 @@
(defun blow--set-mode-list (symbol value)
"Set SYMBOL's default value to VALUE, SYMBOL should be `blow-mode-list'."
- (set-default symbol value)
+ (custom-set-default symbol value)
(when blow-mode
(blow--setup-all-buffers)))
@@ -111,12 +111,12 @@ Don't modify this variable from Lisp programs, use `blow'
instead."
(sexp :tag "Mode line template")))
:set #'blow--set-mode-list)
-(defvar blow--original-lighters nil
+(defvar blow--original-lighters (make-hash-table)
"Hash table of modes and their original lighters or nil.")
(defun blow--hash-exists-p (key table)
"Return t if KEY is in hash table TABLE."
- (let ((default (make-symbol "blow--nonexistant")))
+ (let ((default (make-symbol "nonexistant")))
(not (eq (gethash key table default) default))))
(defun blow--puthash-unless-exists (key value table)
@@ -140,7 +140,7 @@ Don't modify this variable from Lisp programs, use `blow'
instead."
replacement-lighters)
(dolist (buffer (buffer-list))
(with-current-buffer buffer
- (let* ((default (make-symbol "blow--nonexistant"))
+ (let* ((default (make-symbol "nonexistant"))
(replacement
(gethash major-mode major-mode-replacement-lighters
default)))
@@ -151,8 +151,6 @@ Don't modify this variable from Lisp programs, use `blow'
instead."
(defun blow--setup-all-buffers ()
"Blow mode lighters on all buffers."
- (unless blow--original-lighters
- (setq blow--original-lighters (make-hash-table)))
(let ((changed-lighters
(make-hash-table :test 'eq
:size (length blow-mode-list))))
@@ -204,7 +202,7 @@ Don't modify this variable from Lisp programs, use `blow'
instead."
#'blow--after-major-mode-change))
(let ((blow-mode-list nil))
(blow--setup-all-buffers)
- (setq blow--original-lighters nil)
+ (setq blow--original-lighters (make-hash-table))
(remove-hook 'after-change-major-mode-hook
#'blow--after-major-mode-change))))
- [nongnu] branch elpa/blow created (now a773405f5a), ELPA Syncer, 2022/11/27
- [nongnu] elpa/blow 4736d1419c 4/5: Revise the code to be two lines shorter,
ELPA Syncer <=
- [nongnu] elpa/blow a773405f5a 5/5: Add .dir-locals.el, ELPA Syncer, 2022/11/27
- [nongnu] elpa/blow 9f01b3b456 2/5: Handle major mode change, ELPA Syncer, 2022/11/27
- [nongnu] elpa/blow ddbb0af452 3/5: Fix typos in commentary and README, ELPA Syncer, 2022/11/27
- [nongnu] elpa/blow d632077061 1/5: Add blow.el, COPYING and README.org, ELPA Syncer, 2022/11/27