[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/auto-dim-other-buffers d4f5508b4e 30/82: Bumped version to
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/auto-dim-other-buffers d4f5508b4e 30/82: Bumped version to 1.5 and updated docstrings and comments. |
Date: |
Mon, 12 Dec 2022 20:58:40 -0500 (EST) |
branch: elpa/auto-dim-other-buffers
commit d4f5508b4e36aeb3ec0b2604697ee64b4e5bb64f
Author: Michal Nazarewicz <mina86@mina86.com>
Commit: Michal Nazarewicz <mina86@mina86.com>
Bumped version to 1.5 and updated docstrings and comments.
---
README.md | 29 ++++++++++++++++++------
auto-dim-other-buffers.el | 57 ++++++++++++++++++++++++++++++++++++++++++-----
2 files changed, 74 insertions(+), 12 deletions(-)
diff --git a/README.md b/README.md
index fd019d4069..0b19aa2ebd 100644
--- a/README.md
+++ b/README.md
@@ -1,17 +1,32 @@
# auto-dim-other-buffers.el
-Visually makes non-current buffers less prominent.
+The `auto-dim-other-buffers-mode' is a global minor mode which
+makes non-current buffer less prominent making it more apparent
+which window has a focus.
![screenshot](screenshot.png)
-## Install via [MELPA](http://melpa.milkbox.net/)
+The preferred way to install the mode is by installing a package
+form MELPA:
-`M-x` `package-install` `auto-dim-other-buffers`
+ M-x package-install RET auto-dim-other-buffers RET
-## Turn it on
+Once installed, the mode can be turned on (globally) with:
-`M-x` `auto-dim-other-buffers-mode` (it's a global mode)
+ M-x auto-dim-other-buffers-mode RET
-## Customize "dimmed" buffers face
+To make the mode enabled every time Emacs starts, add the following
+to Emacs initialisation file (~/.emacs or ~/.emacs.d/init.el):
-By default, "less prominent" means "has a black background". But you might
want to change that by customizing `auto-dim-other-buffers-face`.
+ (add-hook 'after-init-hook (lambda ()
+ (when (fboundp 'auto-dim-other-buffers-mode)
+ (auto-dim-other-buffers-mode t))))
+
+To configure how dimmed buffers look like, customise
+`auto-dim-other-buffers-face`. This can be accomplished by:
+
+ M-x customize-face RET auto-dim-other-buffers-face RET
+
+The `auto-dim-other-buffers-mode` is a global minor mode which
+makes non-current buffer less prominent making it more apparent
+which window has a focus.
diff --git a/auto-dim-other-buffers.el b/auto-dim-other-buffers.el
index 3753e909b6..3e2f3d65f5 100644
--- a/auto-dim-other-buffers.el
+++ b/auto-dim-other-buffers.el
@@ -1,8 +1,45 @@
-;;; auto-dim-other-buffers.el --- Visually makes non-current buffers less
prominent
+;;; auto-dim-other-buffers.el --- Makes non-current buffers less prominent
+
+;; Copyright 2013 Steven Degutis
+;; Copyright 2013,2014 Google Inc.
+;; Copyright 2014 Justin Talbott
;; Author: Steven Degutis
-;; URL: https://github.com/sdegutis/auto-dim-other-buffers.el
-;; Version: 1.4
+;; Michal Nazarewicz <mina86@mina86.com>
+;; Maintainer: Michal Nazarewicz <mina86@mina86.com>
+;; URL: https://github.com/mina86/auto-dim-other-buffers.el
+;; Version: 1.5
+
+;; This file is not part of GNU Emacs.
+
+;;; Commentary:
+
+;; The `auto-dim-other-buffers-mode' is a global minor mode which
+;; makes non-current buffer less prominent making it more apparent
+;; which window has a focus.
+
+;; The preferred way to install the mode is by installing a package
+;; form MELPA:
+;;
+;; M-x package-install RET auto-dim-other-buffers RET
+
+;; Once installed, the mode can be turned on (globally) with:
+;;
+;; M-x auto-dim-other-buffers-mode RET
+
+;; To make the mode enabled every time Emacs starts, add the following
+;; to Emacs initialisation file (~/.emacs or ~/.emacs.d/init.el):
+;;
+;; (add-hook 'after-init-hook (lambda ()
+;; (when (fboundp 'auto-dim-other-buffers-mode)
+;; (auto-dim-other-buffers-mode t))))
+
+;; To configure how dimmed buffers look like, customise
+;; `auto-dim-other-buffers-face'. This can be accomplished by:
+;;
+;; M-x customize-face RET auto-dim-other-buffers-face RET
+
+;;; Code:
(defface auto-dim-other-buffers-face '((t :background "black"))
"Face (presumably dimmed somehow) for non-current buffers."
@@ -12,14 +49,18 @@
"Buffer we were before command finished.")
(defun adob--ignore-buffer (buffer)
+ "Return whether to ignore BUFFER and do not affect it's state.
+Currently only mini buffer and echo areas are ignored."
(or (null buffer)
(minibufferp buffer)
(string-match "^ \\*Echo Area" (buffer-name buffer))))
(defun adob--pre-command-hook ()
+ "Record current buffer before the command is run."
(setq adob--last-buffer (current-buffer)))
(defun adob--post-command-hook ()
+ "If buffer has changed, dim the last one and undim the new one."
;; if we haven't switched buffers, do nothing
(unless (eq (current-buffer) adob--last-buffer)
@@ -34,13 +75,15 @@
;; now, restore the current buffer, and undim it.
(buffer-face-set nil)))
-;; 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 ()
+ "Dim or undim a new buffer if a new window, like help window, has popped up."
(buffer-face-set (unless (eq (current-buffer) (window-buffer))
'auto-dim-other-buffers-face)))
(defun adob--set-face-on-all-buffers (face)
+ "Set FACE on all buffers which are not to be ignored.
+Whether buffer should be ignored is determined by `adob--ignore-buffer'
+function."
(save-current-buffer
(dolist (buffer (buffer-list))
(unless (adob--ignore-buffer buffer)
@@ -48,12 +91,15 @@
(buffer-face-set face)))))
(defun adob--undim-all-buffers ()
+ "Undim all buffers."
(adob--set-face-on-all-buffers nil))
(defun adob--dim-all-buffers ()
+ "Dim all buffers."
(adob--set-face-on-all-buffers 'auto-dim-other-buffers-face))
(defun turn-off-auto-dim-other-buffers ()
+ "Turn `auto-dim-other-buffers-mode' off."
(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-buffers)
@@ -64,6 +110,7 @@
(adob--undim-all-buffers))
(defun turn-on-auto-dim-other-buffers ()
+ "Turn `auto-dim-other-buffers-mode' on."
(setq adob--last-buffer nil)
(adob--dim-all-buffers)
(add-hook 'pre-command-hook 'adob--pre-command-hook)
- [nongnu] elpa/auto-dim-other-buffers cfab476572 36/82: Move hooks adding/removing to separate function, (continued)
- [nongnu] elpa/auto-dim-other-buffers cfab476572 36/82: Move hooks adding/removing to separate function, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers cedb4c4895 47/82: Use ‘buffer-list-update-hook’ instead of ‘post-command-hook’, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 44b8965cff 32/82: Specify the license, GPL-3.0+ is used., ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 4cc1e1bb08 55/82: Add version of the dim face for light background, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 8d7ef78b4a 65/82: Prefer ‘after-focus-change-function’, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers af8eec9ec2 62/82: Prefer ‘window-buffer’ to ‘current-buffer’, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 4d6e644340 03/82: customizable face, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers d2039c43af 08/82: upgrade the version based on how efficient it is now :D, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 5c793ea235 14/82: better readme, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 0bf0800bb8 07/82: dont try to set face on dead buffers, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers d4f5508b4e 30/82: Bumped version to 1.5 and updated docstrings and comments.,
ELPA Syncer <=
- [nongnu] elpa/auto-dim-other-buffers 475321c845 35/82: Refactor `adob--dim-buffer' to check `dim' only once, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers b797afadb4 44/82: s/it’s/its/, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 31c13e7ed8 45/82: Use ‘window-buffer’ instead of ‘current-buffer’, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 90f6a6f0fb 49/82: Bump Version in comment, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 53652211c1 53/82: Add MELPA badge to README, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers bc36211be2 63/82: Dim buffers appearing in non-selected windows, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 69d369e884 75/82: Fix minor typos and small refactor making use of ‘dolist`, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers e20bc722d6 02/82: that didnt help..., ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 244c979b67 25/82: after-change-major-mode-hook on next-error-hook, ELPA Syncer, 2022/12/12
- [nongnu] elpa/auto-dim-other-buffers 37085cf479 28/82: Consistently use “buffers” in function names, not “windows”., ELPA Syncer, 2022/12/12