[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/auto-dim-other-buffers b599ff6db9 57/82: Better clean up w
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/auto-dim-other-buffers b599ff6db9 57/82: Better clean up when disabling the mode; remove arg from dim-all-buffers |
Date: |
Mon, 12 Dec 2022 20:58:44 -0500 (EST) |
branch: elpa/auto-dim-other-buffers
commit b599ff6db975d3506e921095b679d869edaaf0e7
Author: Michal Nazarewicz <mina86@mina86.com>
Commit: Michal Nazarewicz <mina86@mina86.com>
Better clean up when disabling the mode; remove arg from dim-all-buffers
In addition to undimming all buffers when mode is disabled, kill all
buffer-local definitions of ‘adob--face-mode-remapping’ variable. It’s
admittedly not a big issue but it leaves things cleaner.
With that change, remove argument from ‘adob--dim-all-buffers’ since
it’s no longer ever used for undimming.
---
auto-dim-other-buffers.el | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/auto-dim-other-buffers.el b/auto-dim-other-buffers.el
index 44e860c892..a5fad9076a 100644
--- a/auto-dim-other-buffers.el
+++ b/auto-dim-other-buffers.el
@@ -8,7 +8,7 @@
;; Michal Nazarewicz <mina86@mina86.com>
;; Maintainer: Michal Nazarewicz <mina86@mina86.com>
;; URL: https://github.com/mina86/auto-dim-other-buffers.el
-;; Version: 1.8
+;; Version: 1.8.1
;; This file is not part of GNU Emacs.
@@ -118,7 +118,7 @@ Currently only mini buffer and echo areas are ignored."
(defun adob--focus-out-hook ()
"Dim all buffers if `auto-dim-other-buffers-dim-on-focus-out'."
(when auto-dim-other-buffers-dim-on-focus-out
- (adob--dim-all-buffers t)))
+ (adob--dim-all-buffers)))
(defun adob--focus-in-hook ()
"Undim current buffers if `auto-dim-other-buffers-dim-on-focus-out'."
@@ -126,15 +126,15 @@ Currently only mini buffer and echo areas are ignored."
(adob--undim-buffer)
(setq adob--last-buffer (current-buffer))))
-(defun adob--dim-all-buffers (dim)
- "Dim (if DIM is non-nil) or undim all buffers which are not to be ignored.
+(defun adob--dim-all-buffers ()
+ "Dim all buffers which are not to be ignored.
Whether buffer should be ignored is determined by `adob--never-dim-p'
function."
(save-current-buffer
(dolist (buffer (buffer-list))
(unless (adob--never-dim-p buffer)
(set-buffer buffer)
- (if dim (adob--dim-buffer) (adob--undim-buffer))))))
+ (adob--dim-buffer)))))
(defun adob--hooks (callback)
"Add (if CALLBACK is `add-hook') or remove (if `remove-hook') adob hooks."
@@ -149,13 +149,19 @@ function."
"Visually makes non-current buffers less prominent"
:lighter " Dim"
:global t
+ (setq adob--last-buffer nil)
(if auto-dim-other-buffers-mode
(progn
- (setq adob--last-buffer nil)
- (adob--dim-all-buffers t)
+ (adob--dim-all-buffers)
(adob--hooks 'add-hook))
(adob--hooks 'remove-hook)
- (adob--dim-all-buffers nil)))
+ (save-current-buffer
+ (dolist (buffer (buffer-list))
+ (when (local-variable-p 'adob--face-mode-remapping buffer)
+ (set-buffer buffer)
+ (when adob--face-mode-remapping
+ (face-remap-remove-relative adob--face-mode-remapping))
+ (kill-local-variable 'adob--face-mode-remapping))))))
(provide 'auto-dim-other-buffers)
- [nongnu] elpa/auto-dim-other-buffers cad370fb6c 72/82: Preserve current-buffer, (continued)
- [nongnu] elpa/auto-dim-other-buffers cad370fb6c 72/82: Preserve current-buffer, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 191d714ebb 68/82: Dim individual windows rather than buffers, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers ed9ebbcc52 74/82: Define Auto Dim Other Buffers customise group, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 0a103b09eb 73/82: Require 'face-remap to silence compilation warning, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers a1c67bf557 81/82: Update screenshot animation and demo video link, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers c9fe23d03c 79/82: Allow configuring which faces to alter; not just the ‘default’, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 8062977284 10/82: face is real face, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 7f332de332 17/82: oops, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 7502775f38 29/82: Use a shorter lighter for the mode., ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers b1562a1200 38/82: Wrap `adob--dim-all-buffers' into a lambda when adding as a hook, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers b599ff6db9 57/82: Better clean up when disabling the mode; remove arg from dim-all-buffers,
ELPA Syncer <=
- [nongnu] elpa/auto-dim-other-buffers 53dd9b68fb 59/82: Ignore all hidden buffers, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 6c8804c7d2 58/82: Remove mode’s lighter, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers b3999f9728 48/82: Fix missing closing paren, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 0fba90826b 69/82: Sneakily link to phrxmd’s video demonstrating the mode, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 774fe859f8 64/82: Fix ‘auto-dim-other-buffers-dim-on-switch-to-minibuffer’ behaviour, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers f712de72d4 67/82: Optimise ‘never dim’ check, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 62c936d502 78/82: Fix buffer undimming when local variables are killed, ELPA Syncer, 2022/12/12