[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dtache 24ceed0282 12/19: Improve dtache-init
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dtache 24ceed0282 12/19: Improve dtache-init |
Date: |
Wed, 18 May 2022 12:57:36 -0400 (EDT) |
branch: externals/dtache
commit 24ceed0282698adc5c9b0fb46cffd3935a2cb59d
Author: Niklas Eklund <niklas.eklund@posteo.net>
Commit: Niklas Eklund <niklas.eklund@posteo.net>
Improve dtache-init
---
dtache-init.el | 49 +++++++++++++++++++++++++++++++------------------
1 file changed, 31 insertions(+), 18 deletions(-)
diff --git a/dtache-init.el b/dtache-init.el
index 88873f0791..7dbe1bf4a0 100644
--- a/dtache-init.el
+++ b/dtache-init.el
@@ -46,32 +46,45 @@
;;;; Variables
-(defvar dtache-init-package-integration '((compile . dtache-init-compile)
- (dired . dtache-init-dired)
- (dired-rsync .
dtache-init-dired-rsync)
- (eshell . dtache-init-eshell)
- (org . dtache-init-org)
- (projectile . dtache-init-projectile)
- (shell . dtache-init-shell)
- (vterm . dtache-init-vterm))
+(defcustom dtache-init-block-list nil
+ "A list of blocked packages."
+ :group 'dtache
+ :type 'list)
+
+(defcustom dtache-init-allow-list
+ '(compile dired dired-rsync eshell org projectile shell vterm)
+ "A list of allowed packages."
+ :group 'dtache
+ :type 'list)
+
+(defvar dtache-init--package-integration '((compile . dtache-init-compile)
+ (dired . dtache-init-dired)
+ (dired-rsync .
dtache-init-dired-rsync)
+ (eshell . dtache-init-eshell)
+ (org . dtache-init-org)
+ (projectile .
dtache-init-projectile)
+ (shell . dtache-init-shell)
+ (vterm . dtache-init-vterm))
"Alist which contain names of packages and their initialization function.")
-(defun dtache-init (&optional block-packages)
- "Initialize `dtache' integration with all packages.
+;;;; Functions
-Optionally provide a list of BLOCK-PACKAGES that should be blocked from
-being integrated with `dtache'."
+;;;###autoload
+(defun dtache-init ()
+ "Initialize `dtache' integration with all packages."
;; Required for `dtache-shell-command' which is always provided
(add-hook 'shell-mode-hook #'dtache-shell-mode)
- (let ((packages
- (thread-last dtache-init-package-integration
+ (let ((init-functions
+ (thread-last dtache-init--package-integration
+ (seq-filter (lambda (it)
+ (member (car it) dtache-init-allow-list)))
(seq-remove (lambda (it)
- (member (car it) block-packages)))
- (seq-map #'car))))
- (dolist (package packages)
- (funcall (alist-get package dtache-init-package-integration)))))
+ (member (car it) dtache-init-block-list)))
+ (seq-map #'cdr))))
+ (dolist (init-function init-functions)
+ (funcall init-function))))
(defun dtache-init-shell ()
"Initialize integration with `shell'."
- [elpa] externals/dtache e3193146b4 06/19: Improve initialization of packages, (continued)
- [elpa] externals/dtache e3193146b4 06/19: Improve initialization of packages, ELPA Syncer, 2022/05/18
- [elpa] externals/dtache b5abeb8368 09/19: Add hidden source to dtache-consult, ELPA Syncer, 2022/05/18
- [elpa] externals/dtache e034da8f30 10/19: Remove redundant dtache-setup, ELPA Syncer, 2022/05/18
- [elpa] externals/dtache 28430fbff4 13/19: Add setting for active session, ELPA Syncer, 2022/05/18
- [elpa] externals/dtache dc740b1b43 03/19: Address require in vterm, ELPA Syncer, 2022/05/18
- [elpa] externals/dtache 3103ee6118 08/19: Update indentation, ELPA Syncer, 2022/05/18
- [elpa] externals/dtache 4e7387bbe0 04/19: Add dtache-vterm-mode, ELPA Syncer, 2022/05/18
- [elpa] externals/dtache 34f5111023 11/19: Rename dtache-setup, ELPA Syncer, 2022/05/18
- [elpa] externals/dtache 6c51554e69 01/19: Improve package configuration, ELPA Syncer, 2022/05/18
- [elpa] externals/dtache 5a5b3f5db3 02/19: Fix names, ELPA Syncer, 2022/05/18
- [elpa] externals/dtache 24ceed0282 12/19: Improve dtache-init,
ELPA Syncer <=
- [elpa] externals/dtache 34f39efa36 14/19: Add string when attaching, ELPA Syncer, 2022/05/18
- [elpa] externals/dtache 6fa1fafb96 15/19: Add integration with embark, ELPA Syncer, 2022/05/18
- [elpa] externals/dtache 8d2ea557c0 16/19: Conditionally enable log mode when diffing, ELPA Syncer, 2022/05/18
- [elpa] externals/dtache 65fd89d6d7 17/19: Disable show output on attach by default, ELPA Syncer, 2022/05/18
- [elpa] externals/dtache e864ccd547 18/19: Improve attaching to a detached compilation, ELPA Syncer, 2022/05/18
- [elpa] externals/dtache 7f63c79a06 07/19: Update dtache-command-format, ELPA Syncer, 2022/05/18
- [elpa] externals/dtache b45d3a6a74 05/19: Add vterm to dtache-init, ELPA Syncer, 2022/05/18
- [elpa] externals/dtache 02651e47d3 19/19: Update CHANGELOG, ELPA Syncer, 2022/05/18