[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dtache 6fa1fafb96 15/19: Add integration with embark
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dtache 6fa1fafb96 15/19: Add integration with embark |
Date: |
Wed, 18 May 2022 12:57:37 -0400 (EDT) |
branch: externals/dtache
commit 6fa1fafb9650844e592963d99e451c67b74498df
Author: Niklas Eklund <niklas.eklund@posteo.net>
Commit: Niklas Eklund <niklas.eklund@posteo.net>
Add integration with embark
---
dtache-init.el | 41 ++++++++++++++++++++++++++++++++++++++++-
dtache.el | 15 ---------------
2 files changed, 40 insertions(+), 16 deletions(-)
diff --git a/dtache-init.el b/dtache-init.el
index 7dbe1bf4a0..a303ef5696 100644
--- a/dtache-init.el
+++ b/dtache-init.el
@@ -27,6 +27,18 @@
(require 'subr-x)
+(declare-function dtache-attach-session "dtache")
+(declare-function dtache-compile-session "dtache")
+(declare-function dtache-delete-session "dtache")
+(declare-function dtache-insert-session-command "dtache")
+(declare-function dtache-kill-session "dtache")
+(declare-function dtache-rerun-session "dtache")
+(declare-function dtache-tail-session "dtache")
+(declare-function dtache-view-session "dtache")
+(declare-function dtache-copy-session-command "dtache")
+(declare-function dtache-copy-session "dtache")
+(declare-function dtache-diff-session "dtache")
+
(declare-function dtache-shell-mode "dtache")
(declare-function dtache-compile-start "dtache-compile")
(declare-function dtache-dired-do-shell-command "dtache-dired")
@@ -44,6 +56,9 @@
(declare-function projectile "projectile")
(declare-function vterm "vterm")
+(defvar embark-general-map)
+(defvar embark-keymap-alist)
+
;;;; Variables
(defcustom dtache-init-block-list nil
@@ -52,14 +67,32 @@
:type 'list)
(defcustom dtache-init-allow-list
- '(compile dired dired-rsync eshell org projectile shell vterm)
+ '(compile dired dired-rsync embark eshell org projectile shell vterm)
"A list of allowed packages."
:group 'dtache
:type 'list)
+(defvar dtache-action-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "a" #'dtache-attach-session)
+ (define-key map "c" #'dtache-compile-session)
+ (define-key map "d" #'dtache-delete-session)
+ (define-key map "i" #'dtache-insert-session-command)
+ (define-key map "k" #'dtache-kill-session)
+ (define-key map "r" #'dtache-rerun-session)
+ (define-key map "t" #'dtache-tail-session)
+ (define-key map "v" #'dtache-view-session)
+ (define-key map "w" #'dtache-copy-session-command)
+ (define-key map "W" #'dtache-copy-session)
+ (define-key map "=" #'dtache-diff-session)
+ map))
+
+;;;; Support functions
+
(defvar dtache-init--package-integration '((compile . dtache-init-compile)
(dired . dtache-init-dired)
(dired-rsync .
dtache-init-dired-rsync)
+ (embark . dtache-init-embark)
(eshell . dtache-init-eshell)
(org . dtache-init-org)
(projectile .
dtache-init-projectile)
@@ -124,6 +157,12 @@
(when (functionp #'vterm)
(add-hook 'vterm-mode-hook #'dtache-vterm-mode)))
+(defun dtache-init-embark ()
+ "Initialize integration with `embark'."
+ (with-eval-after-load 'embark
+ (defvar embark-dtache-map (make-composed-keymap dtache-action-map
embark-general-map))
+ (add-to-list 'embark-keymap-alist '(dtache . embark-dtache-map))))
+
(provide 'dtache-init)
;;; dtache-init.el ends here
diff --git a/dtache.el b/dtache.el
index 2c925f35f0..1e460c4a3d 100644
--- a/dtache.el
+++ b/dtache.el
@@ -198,21 +198,6 @@ Valid values are: create, new and attach")
"The version of `dtache-session'.
This version is encoded as [package-version].[revision].")
-(defvar dtache-action-map
- (let ((map (make-sparse-keymap)))
- (define-key map "a" #'dtache-attach-session)
- (define-key map "c" #'dtache-compile-session)
- (define-key map "d" #'dtache-delete-session)
- (define-key map "i" #'dtache-insert-session-command)
- (define-key map "k" #'dtache-kill-session)
- (define-key map "r" #'dtache-rerun-session)
- (define-key map "t" #'dtache-tail-session)
- (define-key map "v" #'dtache-view-session)
- (define-key map "w" #'dtache-copy-session-command)
- (define-key map "W" #'dtache-copy-session)
- (define-key map "=" #'dtache-diff-session)
- map))
-
;;;;; Faces
(defgroup dtache-faces nil
- [elpa] externals/dtache e034da8f30 10/19: Remove redundant dtache-setup, (continued)
- [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, 2022/05/18
- [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 <=
- [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