branch: elpa/auto-dim-other-buffers commit af8eec9ec24ef2eaa5f8f850edba561cb68052cd Author: Michal Nazarewicz <min...@mina86.com> Commit: Michal Nazarewicz <min...@mina86.com>
Prefer ‘window-buffer’ to ‘current-buffer’ ‘current-buffer’ might not be the selected buffer. Use ‘window-buffer’ instead. --- auto-dim-other-buffers.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/auto-dim-other-buffers.el b/auto-dim-other-buffers.el index 925eb1a6fb..89f208e695 100644 --- a/auto-dim-other-buffers.el +++ b/auto-dim-other-buffers.el @@ -1,14 +1,15 @@ ;;; auto-dim-other-buffers.el --- Makes non-current buffers less prominent -*- lexical-binding: t -*- ;; Copyright 2013 Steven Degutis -;; Copyright 2013,2014 Google Inc. +;; Copyright 2013-2017 Google Inc. ;; Copyright 2014 Justin Talbott +;; Copyright 2018-2020 Michał Nazarewicz ;; Author: Steven Degutis ;; Michal Nazarewicz <min...@mina86.com> ;; Maintainer: Michal Nazarewicz <min...@mina86.com> ;; URL: https://github.com/mina86/auto-dim-other-buffers.el -;; Version: 1.9.1 +;; Version: 1.9.2 ;; This file is not part of GNU Emacs. @@ -128,8 +129,9 @@ Currently only mini buffer and echo areas are ignored." (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--undim-buffer) - (setq adob--last-buffer (current-buffer)))) + (with-current-buffer (window-buffer) + (adob--undim-buffer) + (setq adob--last-buffer (current-buffer))))) ;;;###autoload (define-minor-mode auto-dim-other-buffers-mode @@ -144,7 +146,7 @@ Currently only mini buffer and echo areas are ignored." (save-current-buffer (if auto-dim-other-buffers-mode (progn - (setq adob--last-buffer (current-buffer)) + (setq adob--last-buffer (window-buffer)) (dolist (buffer (buffer-list)) (unless (or (eq buffer adob--last-buffer) (adob--never-dim-p buffer))