[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/auto-dim-other-buffers a066c32ada 40/82: Allow disabling
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/auto-dim-other-buffers a066c32ada 40/82: Allow disabling “dimming on focus out” feature |
Date: |
Mon, 12 Dec 2022 20:58:41 -0500 (EST) |
branch: elpa/auto-dim-other-buffers
commit a066c32ada5b56be52541e9217dc9f5a022aef7a
Author: Michal Nazarewicz <mina86@mina86.com>
Commit: Michal Nazarewicz <mina86@mina86.com>
Allow disabling “dimming on focus out” feature
Added `auto-dim-other-buffers-dim-on-focus-out' customize variable
which allows disabling of the “dim on focus out” feature.
---
auto-dim-other-buffers.el | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/auto-dim-other-buffers.el b/auto-dim-other-buffers.el
index 8377f5427d..cc262b63c0 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.6.3
+;; Version: 1.6.4
;; This file is not part of GNU Emacs.
@@ -58,6 +58,11 @@
"Face (presumably dimmed somehow) for non-current buffers."
:group 'auto-dim-other-buffers)
+(defcustom auto-dim-other-buffers-dim-on-focus-out t
+ "Whether to dim all buffers when a frame looses focus."
+ :type 'boolean
+ :group 'auto-dim-other-buffers)
+
(defvar adob--last-buffer nil
"Buffer we were before command finished.")
@@ -100,6 +105,17 @@ Currently only mini buffer and echo areas are ignored."
"Dim or undim a new buffer if a new window, like help window, has popped up."
(adob--dim-buffer (not (eq (current-buffer) (window-buffer)))))
+(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)))
+
+(defun adob--focus-in-hook ()
+ "Undim current buffers if `auto-dim-other-buffers-dim-on-focus-out'."
+ (when auto-dim-other-buffers-dim-on-focus-out
+ (adob--dim-buffer nil)
+ (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.
Whether buffer should be ignored is determined by `adob--ignore-buffer'
@@ -114,8 +130,8 @@ function."
"Add (if CALLBACK is `add-hook') or remove (if `remove-hook') adob hooks."
(dolist (args
'((post-command-hook adob--post-command-hook)
- (focus-out-hook (lambda () (adob--dim-all-buffers t)))
- (focus-in-hook adob--after-change-major-mode-hook)
+ (focus-out-hook adob--focus-out-hook)
+ (focus-in-hook adob--focus-in-hook)
(after-change-major-mode-hook adob--after-change-major-mode-hook)
(next-error-hook 'adob--after-change-major-mode-hook)))
(apply callback args)))
- [nongnu] elpa/auto-dim-other-buffers e473ef45ea 05/82: set buffer faces MUCH less often, (continued)
- [nongnu] elpa/auto-dim-other-buffers e473ef45ea 05/82: set buffer faces MUCH less often, ELPA Syncer, 2022/12/12
- [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 <=
- [nongnu] elpa/auto-dim-other-buffers 8b1d8803b5 43/82: Fix Markdown formatting in README file, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers e9c886fac5 42/82: Use even number of arguments for `setq', ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 853523a854 50/82: Don't dim last buffer when switching to minibuffer or echo area., ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers efd617c999 60/82: Make sure current buffer is not dimmed when the mode is enabled, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers e4ef0a93ca 66/82: Unconditionally undim selected buffer when focus is regained, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers a87cf772ac 61/82: Dim only the last buffer when loosing focus, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 087baafa08 51/82: Move minibuffer check to the beginning of ‘adob--buffer-list-update-hook’, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers bedeef9ea3 70/82: Support ‘adow-mode’ since the first Emacs 27 preview releases, ELPA Syncer, 2022/12/12
- [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