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

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

[elpa] externals/dtache b2eabec6c7 041/158: Improve dtache actions


From: ELPA Syncer
Subject: [elpa] externals/dtache b2eabec6c7 041/158: Improve dtache actions
Date: Wed, 19 Jan 2022 18:57:44 -0500 (EST)

branch: externals/dtache
commit b2eabec6c764bbf56617d586b695191a4b91479f
Merge: 80fca01eae 1bc60af5a0
Author: Niklas Eklund <niklas.eklund@posteo.net>
Commit: Niklas Eklund <niklas.eklund@posteo.net>

    Improve dtache actions
    
    To access commands there is now a dtache-action-map, which the users
    can use. Optionally those that uses embark can easily integrate that
    action map into the embark framework.
    
    The README/CHANGELOG are updated to reflect this change.
---
 CHANELOG.org     |  3 ++-
 README.org       | 18 ++++++++++++------
 dtache.el        | 15 +++++++++++++++
 embark-dtache.el | 56 --------------------------------------------------------
 guix.scm         |  2 --
 5 files changed, 29 insertions(+), 65 deletions(-)

diff --git a/CHANELOG.org b/CHANELOG.org
index dec05de4f1..ec183768c1 100644
--- a/CHANELOG.org
+++ b/CHANELOG.org
@@ -4,7 +4,8 @@
 
 * Development
 
-- Remove external dependency to marginalia. Dtache now implements annotations 
for all users.
+- Remove external dependency to =embark=. The package now implements an action 
map that can be used with/without embark.
+- Remove external dependency to =marginalia=. The package now provides 
annotations for all users.
 - Fix error in =dtache-env= usage. The integration wasn't correct which 
resulted in =dtache= failing to execute some commands properly
 - Make =dtache-env= optional rather than required. =Dtache= should be fine 
without it, just that automatic status labeling will not be run
 
diff --git a/README.org b/README.org
index 25c7f0773b..b786ee1b25 100644
--- a/README.org
+++ b/README.org
@@ -74,7 +74,7 @@ There are two convenient ways of listing sessions and acting 
upon one.
 
 ** Actions on sessions
 
-General commands that can be used either in =dtache-list-sessions= or in 
=dtache-open-session= (using the embark extension).
+Session commands that can be used in either =dtache-list-sessions= or in 
=dtache-open-session=.
 
 | Command                       | Description                                 |
 |-------------------------------+---------------------------------------------|
@@ -113,16 +113,22 @@ Commands to be used in shell buffers.
 | dtache-shell-attach     | Attach to a session         |
 | dtache-shell-detach     | Detach from a session       |
 
-** Embark
+* Tips & Tricks
+** Actions
 
-Add [[https://github.com/oantolin/embark/][embark]] actions to 
=dtache-open-session=.
+To act on sessions the user can either bind the =dtache-action-map= to a 
binding of there choice. An example could be.
 
 #+begin_src elisp
-  (use-package embark-dtache
-    :after (dtache embark))
+  (global-set-key (kbd "C-c d") dtache-action-map)
+#+end_src
+
+Or if the user has the package [[https://github.com/oantolin/embark/][embark]] 
installed the actions could be integrated with that package by adding the 
following to the =dtache= configuration.
+
+#+begin_src elisp
+  (defvar embark-dtache-map (make-composed-keymap dtache-action-map 
embark-general-map))
+  (add-to-list 'embark-keymap-alist '(dtache . embark-dtache-map))
 #+end_src
 
-* Tips & Tricks
 ** Automatic status labeling
 
 The =dtache-env= script found in this repository can be used to execute shell 
commands in a controlled environment. This environment makes sure that the exit 
status is present in the session's output. This makes it possible for =dtache= 
to automatically label a session with either =success= or =failure=.
diff --git a/dtache.el b/dtache.el
index 4e00d91dc8..00d5cf0142 100644
--- a/dtache.el
+++ b/dtache.el
@@ -79,6 +79,7 @@
   "Hooks to run when compiling a session.")
 (defvar dtache-metadata-annotators-alist nil
   "An alist of annotators for metadata.")
+
 (defvar dtache-annotation-format
   `((:width 3 :function dtache--active-str :face dtache-active-face)
     (:width 3 :function dtache--status-str :face dtache-failure-face)
@@ -90,6 +91,20 @@
     (:width 12 :function dtache--creation-str :face dtache-creation-face))
   "The format of the annotations.")
 
+(defvar dtache-action-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map "c" #'dtache-compile-session)
+    (define-key map "d" #'dtache-remove-session)
+    (define-key map "i" #'dtache-insert-session-command)
+    (define-key map "k" #'dtache-kill-session)
+    (define-key map "o" #'dtache-open-output)
+    (define-key map "r" #'dtache-rerun-session)
+    (define-key map "t" #'dtache-tail-output)
+    (define-key map "w" #'dtache-copy-session-command)
+    (define-key map "W" #'dtache-copy-session-output)
+    (define-key map "=" #'dtache-diff-session)
+    map))
+
 ;;;;; Faces
 
 (defgroup dtache-faces nil
diff --git a/embark-dtache.el b/embark-dtache.el
deleted file mode 100644
index 537fe970e6..0000000000
--- a/embark-dtache.el
+++ /dev/null
@@ -1,56 +0,0 @@
-;;; embark-dtache.el --- Dtache Embark integration -*- lexical-binding: t -*-
-
-;; Copyright (C) 2020-2021 Niklas Eklund
-
-;; Author: Niklas Eklund <niklas.eklund@posteo.net>
-;; URL: https://www.gitlab.com/niklaseklund/dtache.git
-;; Version: 0.1
-;; Package-Requires: ((emacs "27.1"))
-;; Keywords: convenience processes
-
-;; This file is not part of GNU Emacs.
-
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; This package provides `embark' actions to operate on a `dtache' session.
-
-;;; Code:
-
-;;;; Requirements
-
-(require 'dtache)
-(require 'embark)
-
-;;;; Keymap
-
-(embark-define-keymap embark-dtache-map
-  "Keymap for Embark dtache actions."
-  ("c" dtache-compile-session)
-  ("d" dtache-remove-session)
-  ("i" dtache-insert-session-command)
-  ("k" dtache-kill-session)
-  ("o" dtache-open-output)
-  ("r" dtache-rerun-session)
-  ("t" dtache-tail-output)
-  ("w" dtache-copy-session-command)
-  ("W" dtache-copy-session-output)
-  ("=" dtache-diff-session))
-
-(add-to-list 'embark-keymap-alist '(dtache . embark-dtache-map))
-
-(provide 'embark-dtache)
-
-;;; embark-dtache.el ends here
diff --git a/guix.scm b/guix.scm
index 3f65f203ca..b76838f33f 100644
--- a/guix.scm
+++ b/guix.scm
@@ -35,8 +35,6 @@
          "0yvkygdqghrp8xn7nfgfq3x5y913r6kasqndxy3fr2dqpxxb941a"))
        (file-name (git-file-name name version))))
      (build-system emacs-build-system)
-     (propagated-inputs
-      `(("emacs-embark" ,emacs-embark)))
      (native-inputs
       `(("emacs-ert-runner" ,emacs-ert-runner)))
      (inputs `(("dtach" ,dtach)))



reply via email to

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