[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/auto-dim-other-buffers e473ef45ea 05/82: set buffer faces
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/auto-dim-other-buffers e473ef45ea 05/82: set buffer faces MUCH less often |
Date: |
Mon, 12 Dec 2022 20:58:37 -0500 (EST) |
branch: elpa/auto-dim-other-buffers
commit e473ef45ea3defa22de7cfb4b2f7e02d41f346d5
Author: Steven Degutis <sbdegutis@gmail.com>
Commit: Steven Degutis <sbdegutis@gmail.com>
set buffer faces MUCH less often
---
auto-dim-other-buffers.el | 37 +++++++++++++++++++++++++------------
1 file changed, 25 insertions(+), 12 deletions(-)
diff --git a/auto-dim-other-buffers.el b/auto-dim-other-buffers.el
index 5683cf2168..280dfdb3de 100644
--- a/auto-dim-other-buffers.el
+++ b/auto-dim-other-buffers.el
@@ -12,27 +12,40 @@
:type 'face
:group 'auto-dim-other-buffers)
-(defun turn-off-auto-dim-other-buffers ()
+(setq adob/last-buffer nil)
+
+(defun adob/pre-command-hook ()
+ (setq adob/last-buffer (current-buffer)))
+
+(defun adob/post-command-hook ()
+ (let ((original (current-buffer)))
+ (unless (eq original adob/last-buffer)
+ (dolist (buffer (buffer-list))
+ (set-buffer buffer)
+ (unless (minibufferp)
+ (buffer-face-set auto-dim-other-buffers-face)))
+ (set-buffer original)
+ (buffer-face-set nil))))
+
+(defun adob/clear-all-windows ()
(interactive)
- (remove-hook 'post-command-hook 'sd/auto-dim-other-buffers)
(let ((original (current-buffer)))
(dolist (buffer (buffer-list))
(set-buffer buffer)
(buffer-face-set nil))
(set-buffer original)))
-(defun turn-on-auto-dim-other-buffers ()
+(defun turn-off-auto-dim-other-buffers ()
(interactive)
- (add-hook 'post-command-hook 'sd/auto-dim-other-buffers))
+ (remove-hook 'pre-command-hook 'adob/pre-command-hook)
+ (remove-hook 'post-command-hook 'adob/post-command-hook)
+ (adob/clear-all-windows))
-(defun sd/auto-dim-other-buffers ()
- (let ((original (current-buffer)))
- (dolist (buffer (buffer-list))
- (set-buffer buffer)
- (unless (minibufferp)
- (buffer-face-set auto-dim-other-buffers-face)))
- (set-buffer original)
- (buffer-face-set nil)))
+(defun turn-on-auto-dim-other-buffers ()
+ (interactive)
+ (setq adob/last-buffer nil)
+ (add-hook 'pre-command-hook 'adob/pre-command-hook)
+ (add-hook 'post-command-hook 'adob/post-command-hook))
(provide 'auto-dim-other-buffers)
- [nongnu] elpa/auto-dim-other-buffers 8b909cb210 41/82: fix change major mode on next-error-hook, (continued)
- [nongnu] elpa/auto-dim-other-buffers 8b909cb210 41/82: fix change major mode on next-error-hook, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers d1ee176652 54/82: Update screenshot; make it animated, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers ec74b4803a 56/82: Split ‘adob--dim-buffer’ into two no-argument functions, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 0c15c0d3a4 52/82: s/adob--ignore-buffer/adob--never-dim-p/, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 82626612bd 71/82: Handle window and buffer switching at the same time, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 2a19931b27 80/82: Introduce ‘auto-dim-other-buffers-hide-face’ for hidden dimmed text, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers f0d48d94c3 77/82: Introduce ‘auto-dim-other-buffers-never-dim-buffer-functions’, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 33b5f88b79 82/82: Correctly handle optional kill-all-local-variables argument in advice, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 9f768ddd9a 76/82: Debounce focus-change events, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 07d906f0f0 04/82: useless extra thing, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers e473ef45ea 05/82: set buffer faces MUCH less often,
ELPA Syncer <=
- [nongnu] elpa/auto-dim-other-buffers 7ed6580b7d 12/82: update sshot, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers e93f115d32 09/82: comments and fix, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers b236157a77 15/82: uhh, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 8f58e3f7fe 27/82: Use “adob--” as a prefix for private stuff., ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers d8987326e6 20/82: dim new windows that pop up, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 6600c79600 24/82: Mark adob-mode as autoload function, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 932b16751f 31/82: .gitignore *.elc files., ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers a385b6013e 39/82: Drop turn-{on, off}-* functions., ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 8c4470713f 33/82: Set lexical binding on., ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers a066c32ada 40/82: Allow disabling “dimming on focus out” feature, ELPA Syncer, 2022/12/12