emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/auto-dim-other-buffers a385b6013e 39/82: Drop turn-{on, of


From: ELPA Syncer
Subject: [nongnu] elpa/auto-dim-other-buffers a385b6013e 39/82: Drop turn-{on, off}-* functions.
Date: Mon, 12 Dec 2022 20:58:41 -0500 (EST)

branch: elpa/auto-dim-other-buffers
commit a385b6013ed23c36816863cb4a5f8550fdc627fd
Author: Michal Nazarewicz <mina86@mina86.com>
Commit: Michal Nazarewicz <mina86@mina86.com>

    Drop turn-{on,off}-* functions.
    
    `turn-on-auto-dim-other-buffers' and `turn-off-auto-dim-other-buffers'
    functions were not really useful.  For example, they did not set the
    `auto-dim-other-buffers-mode' variable so they could not be used
    instead of calling the minor mode.  Furthermore, since [cfab476: Move
    hooks adding/removing to separate function], they were pretty short
    thus separating them did not provide much benefits as far as
    readability is concerned.  Because of that, the functions are now
    removed, and their code put directly into the minor mode function.
---
 auto-dim-other-buffers.el | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/auto-dim-other-buffers.el b/auto-dim-other-buffers.el
index 67ed07d987..8377f5427d 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.2
+;; Version: 1.6.3
 
 ;; This file is not part of GNU Emacs.
 
@@ -120,25 +120,18 @@ function."
              (next-error-hook 'adob--after-change-major-mode-hook)))
     (apply callback args)))
 
-(defun turn-off-auto-dim-other-buffers ()
-  "Turn `auto-dim-other-buffers-mode' off."
-  (adob--hooks 'remove-hook)
-  (adob--dim-all-buffers nil))
-
-(defun turn-on-auto-dim-other-buffers ()
-  "Turn `auto-dim-other-buffers-mode' on."
-  (setq adob--last-buffer nil)
-  (adob--dim-all-buffers t)
-  (adob--hooks 'add-hook))
-
 ;;;###autoload
 (define-minor-mode auto-dim-other-buffers-mode
   "Visually makes non-current buffers less prominent"
   :lighter " Dim"
   :global t
   (if auto-dim-other-buffers-mode
-      (turn-on-auto-dim-other-buffers)
-    (turn-off-auto-dim-other-buffers)))
+      (progn
+        (setq adob--last-buffer nil)
+        (adob--dim-all-buffers t)
+        (adob--hooks 'add-hook))
+    (adob--hooks 'remove-hook)
+    (adob--dim-all-buffers nil)))
 
 (provide 'auto-dim-other-buffers)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]