[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/auto-dim-other-buffers 087baafa08 51/82: Move minibuffer
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/auto-dim-other-buffers 087baafa08 51/82: Move minibuffer check to the beginning of ‘adob--buffer-list-update-hook’ |
Date: |
Mon, 12 Dec 2022 20:58:43 -0500 (EST) |
branch: elpa/auto-dim-other-buffers
commit 087baafa0868dc24233845914c09398e6a3d35d5
Author: Michal Nazarewicz <mina86@mina86.com>
Commit: Michal Nazarewicz <mina86@mina86.com>
Move minibuffer check to the beginning of ‘adob--buffer-list-update-hook’
With ‘auto-dim-other-buffers-dim-on-switch-to-minibuffer’ option disabled,
if user switches from buffer α to minibuffer and then to buffer β (e.g.
by invoking ‘other-window’), buffer α will remain undimmed even though
β becomes the current one.
This is because ‘adob--last-buffer’ is updated to point to minibuffer
even though α remains undimmed.
Move the minibuffer check to the top of ‘adob--buffer-list-update-hook’
function so that switching to minibuffer becomes a noöp, i.e. the code
behaves as if the old buffer was still active.
Fixes: https://github.com/mina86/auto-dim-other-buffers.el/issues/14
Fixes: https://github.com/mina86/auto-dim-other-buffers.el/pull/15
---
auto-dim-other-buffers.el | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
diff --git a/auto-dim-other-buffers.el b/auto-dim-other-buffers.el
index 540bd75330..02f0f3f8a0 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.7
+;; Version: 1.8
;; This file is not part of GNU Emacs.
@@ -96,22 +96,18 @@ Currently only mini buffer and echo areas are ignored."
(defun adob--buffer-list-update-hook ()
"If buffer has changed, dim the last one and undim the new one."
(let ((buf (window-buffer)))
- ;; if we haven't switched buffers, do nothing
- (unless (eq buf adob--last-buffer)
- ;; first, try to dim the last buffer. if it's nil, then the
- ;; feature was just turned on and all buffers are already
- ;; dimmed. if it's just killed, don't try to set its face.
+ (when (and
+ ;; Don’t do anything if buffer didn’t changed.
+ (not (eq buf adob--last-buffer))
+ ;; If so configured, don’t dim when switching to minibuffer.
+ (or auto-dim-other-buffers-dim-on-switch-to-minibuffer
+ (not (minibufferp buf))))
+ ;; Dim last buffer if it’s live and not ignored.
(and (buffer-live-p adob--last-buffer)
(not (adob--ignore-buffer adob--last-buffer))
- ;; By default, dim last buffer on switch to any other buffer. But if
- ;; option is nil, then don't dim last buffer on switch to minibuffer
- ;; or echo area.
- (or auto-dim-other-buffers-dim-on-switch-to-minibuffer
- (not (or (minibufferp (current-buffer))
- (string-match "^ \\*Echo Area" (buffer-name
(current-buffer))))))
(with-current-buffer adob--last-buffer
(adob--dim-buffer t)))
- ;; now, restore the selected buffer, and undim it.
+ ;; Undim the new buffer.
(with-current-buffer buf
(adob--dim-buffer nil))
(setq adob--last-buffer buf))))
- [nongnu] elpa/auto-dim-other-buffers 932b16751f 31/82: .gitignore *.elc files., (continued)
- [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
- [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 <=
- [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
- [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