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 8f58e3f7fe 27/82: Use “adob--” as


From: ELPA Syncer
Subject: [nongnu] elpa/auto-dim-other-buffers 8f58e3f7fe 27/82: Use “adob--” as a prefix for private stuff.
Date: Mon, 12 Dec 2022 20:58:40 -0500 (EST)

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

    Use “adob--” as a prefix for private stuff.
    
    Using dashes instead of slash (as in “adob/”) is more consistent
    with ELisp code being part of Emacs.  At the same time,
    “auto-dim-other-buffers--” is a bit long for internal functions,
    thus it is abbreviated to “adob--”.
---
 auto-dim-other-buffers.el | 63 ++++++++++++++++++++++++-----------------------
 1 file changed, 32 insertions(+), 31 deletions(-)

diff --git a/auto-dim-other-buffers.el b/auto-dim-other-buffers.el
index f57192b67d..c20fd8a796 100644
--- a/auto-dim-other-buffers.el
+++ b/auto-dim-other-buffers.el
@@ -8,27 +8,27 @@
   "Face (presumably dimmed somehow) for non-current buffers."
   :group 'auto-dim-other-buffers)
 
-(defvar adob/last-buffer nil
+(defvar adob--last-buffer nil
   "Buffer we were before command finished.")
 
-(defun adob/ignore-buffer (buffer)
+(defun adob--ignore-buffer (buffer)
   (or (null buffer)
       (minibufferp buffer)
       (string-match "^ \\*Echo Area" (buffer-name buffer))))
 
-(defun adob/pre-command-hook ()
-  (setq adob/last-buffer (current-buffer)))
+(defun adob--pre-command-hook ()
+  (setq adob--last-buffer (current-buffer)))
 
-(defun adob/post-command-hook ()
+(defun adob--post-command-hook ()
   ;; if we haven't switched buffers, do nothing
-  (unless (eq (current-buffer) adob/last-buffer)
+  (unless (eq (current-buffer) 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.
-    (and (buffer-live-p adob/last-buffer)
-         (not (adob/ignore-buffer adob/last-buffer))
-         (with-current-buffer adob/last-buffer
+    (and (buffer-live-p adob--last-buffer)
+         (not (adob--ignore-buffer adob--last-buffer))
+         (with-current-buffer adob--last-buffer
            (buffer-face-set 'auto-dim-other-buffers-face)))
 
     ;; now, restore the current buffer, and undim it.
@@ -36,41 +36,42 @@
 
 ;; if a new window pops up, like a help window or something, we
 ;; should dim or undim it, depending on if its selected.
-(defun adob/after-change-major-mode-hook ()
+(defun adob--after-change-major-mode-hook ()
   (buffer-face-set (unless (eq (current-buffer) (window-buffer))
                      'auto-dim-other-buffers-face)))
 
-(defun adob/set-face-on-all-buffers (face)
+(defun adob--set-face-on-all-buffers (face)
   (save-current-buffer
     (dolist (buffer (buffer-list))
-      (unless (adob/ignore-buffer buffer)
+      (unless (adob--ignore-buffer buffer)
         (set-buffer buffer)
         (buffer-face-set face)))))
 
-(defun adob/undim-all-windows ()
-  (adob/set-face-on-all-buffers nil))
+(defun adob--undim-all-windows ()
+  (adob--set-face-on-all-buffers nil))
 
-(defun adob/dim-all-windows ()
-  (adob/set-face-on-all-buffers 'auto-dim-other-buffers-face))
+(defun adob--dim-all-windows ()
+  (adob--set-face-on-all-buffers 'auto-dim-other-buffers-face))
 
 (defun turn-off-auto-dim-other-buffers ()
-  (remove-hook 'pre-command-hook 'adob/pre-command-hook)
-  (remove-hook 'post-command-hook 'adob/post-command-hook)
-  (remove-hook 'focus-out-hook 'adob/dim-all-windows)
-  (remove-hook 'focus-in-hook 'adob/after-change-major-mode-hook)
-  (remove-hook 'after-change-major-mode-hook 
'adob/after-change-major-mode-hook)
-  (remove-hook 'next-error-hook 'adob/after-change-major-mode-hook)
-  (adob/undim-all-windows))
+  (remove-hook 'pre-command-hook 'adob--pre-command-hook)
+  (remove-hook 'post-command-hook 'adob--post-command-hook)
+  (remove-hook 'focus-out-hook 'adob--dim-all-windows)
+  (remove-hook 'focus-in-hook 'adob--after-change-major-mode-hook)
+  (remove-hook 'after-change-major-mode-hook
+               'adob--after-change-major-mode-hook)
+  (remove-hook 'next-error-hook 'adob--after-change-major-mode-hook)
+  (adob--undim-all-windows))
 
 (defun turn-on-auto-dim-other-buffers ()
-  (setq adob/last-buffer nil)
-  (adob/dim-all-windows)
-  (add-hook 'pre-command-hook 'adob/pre-command-hook)
-  (add-hook 'post-command-hook 'adob/post-command-hook)
-  (add-hook 'focus-out-hook 'adob/dim-all-windows)
-  (add-hook 'focus-in-hook 'adob/after-change-major-mode-hook)
-  (add-hook 'after-change-major-mode-hook 'adob/after-change-major-mode-hook)
-  (add-hook 'next-error-hook 'adob/after-change-major-mode-hook))
+  (setq adob--last-buffer nil)
+  (adob--dim-all-windows)
+  (add-hook 'pre-command-hook 'adob--pre-command-hook)
+  (add-hook 'post-command-hook 'adob--post-command-hook)
+  (add-hook 'focus-out-hook 'adob--dim-all-windows)
+  (add-hook 'focus-in-hook 'adob--after-change-major-mode-hook)
+  (add-hook 'after-change-major-mode-hook 'adob--after-change-major-mode-hook)
+  (add-hook 'next-error-hook 'adob--after-change-major-mode-hook))
 
 ;;;###autoload
 (define-minor-mode auto-dim-other-buffers-mode



reply via email to

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