[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dtache dae6db33db 083/158: Fix various minor problems
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dtache dae6db33db 083/158: Fix various minor problems |
Date: |
Wed, 19 Jan 2022 18:58:00 -0500 (EST) |
branch: externals/dtache
commit dae6db33dbe3a0168027b579ac2ecd43510888d5
Author: Niklas Eklund <niklas.eklund@posteo.net>
Commit: Niklas Eklund <niklas.eklund@posteo.net>
Fix various minor problems
---
README.org | 3 ++-
dtache-compile.el | 14 ++++++++++----
dtache.el | 42 ++++++++++++++++++++++--------------------
3 files changed, 34 insertions(+), 25 deletions(-)
diff --git a/README.org b/README.org
index a04eed7d51..8d9597cd8f 100644
--- a/README.org
+++ b/README.org
@@ -182,7 +182,8 @@ A =use-package= configuration of the =dtache-consult=
extension, which provides
#+begin_src elisp
(use-package dtache-consult
- :commands dtache-consult-session)
+ :after dtache
+ :bind ([remap dtache-open-session] . dtache-consult-session))
#+end_src
The command =dtache-consult-session= is a replacement for
=dtache-open-session=. The difference is that the consult command provides
multiple session sources, which is defined in the =dtache-consult-sources=
variable. Users can customize which sources to use, as well as use individual
sources in other =consult= commands, such as =consult-buffer=. The users can
also narrow the list of sessions by entering a key. The list of supported keys
are:
diff --git a/dtache-compile.el b/dtache-compile.el
index a3200ab8f3..72458662d9 100644
--- a/dtache-compile.el
+++ b/dtache-compile.el
@@ -35,21 +35,27 @@
;;;; Commands
;;;###autoload
-(defun dtache-compile ()
+(defun dtache-compile (command &optional comint)
"Run COMMAND through `compile' but in a 'dtache' session.
Optionally enable COMINT if prefix-argument is provided."
- (interactive)
+ (interactive
+ (list
+ (let ((command (eval compile-command)))
+ (if (or compilation-read-command current-prefix-arg)
+ (compilation-read-command command)
+ command))
+ (consp current-prefix-arg)))
(let* ((dtache-enabled t)
(dtache-session-action dtache-compile-session-action)
(dtache-session-type 'compile)
(dtache--dtach-mode 'create))
- (call-interactively #'compile)))
+ (compile command comint)))
;;;###autoload
(defun dtache-compile-recompile (&optional edit-command)
"Re-compile by running `compile' but in a 'dtache' session.
Optionally EDIT-COMMAND."
- (interactive)
+ (interactive "P")
(let* ((dtache-enabled t)
(dtache-session-action dtache-compile-session-action)
(dtache-session-type 'compile)
diff --git a/dtache.el b/dtache.el
index 93088bbfb1..f57fa6c93e 100644
--- a/dtache.el
+++ b/dtache.el
@@ -199,10 +199,10 @@
;;;; Commands
;;;###autoload
-(defun dtache-shell-command (command)
+(defun dtache-shell-command (command &optional suppress-output)
"Execute COMMAND asynchronously with `dtache'.
-If called with prefix-argument the output is suppressed."
+Optionally SUPPRESS-OUTPUT."
(interactive
(list
(read-shell-command (if shell-command-prompt-show-cwd
@@ -210,10 +210,11 @@ If called with prefix-argument the output is suppressed."
(abbreviate-file-name
default-directory))
"Dtache shell command: ")
- nil 'dtache-shell-command-history)))
+ nil 'dtache-shell-command-history)
+ current-prefix-arg))
(let ((dtache-session-type 'shell-command)
(dtache-session-action dtache-shell-command-action))
- (dtache-start-session command current-prefix-arg)))
+ (dtache-start-session command suppress-output)))
;;;###autoload
(defun dtache-open-session (session)
@@ -440,23 +441,24 @@ nil before closing."
"Start a `dtache' session running COMMAND.
Optionally SUPPRESS-OUTPUT."
- (if (and (not (eq dtache--dtach-mode 'attach))
- (or suppress-output
- (eq dtache--dtach-mode 'new)
- (dtache-redirect-only-p command)))
- (let* ((inhibit-message t)
- (dtache--dtach-mode 'new)
- (dtache--current-session (dtache-create-session command)))
+ (let ((inhibit-message t)
+ (dtache-enabled t)
+ (dtache--current-session
+ (or dtache--current-session
+ (dtache-create-session command))))
+ (if-let ((run-in-background
+ (and (not (eq dtache--dtach-mode 'attach))
+ (or suppress-output
+ (eq dtache--dtach-mode 'new)
+ (dtache-redirect-only-p command))))
+ (dtache--dtach-mode 'new))
(apply #'start-file-process-shell-command
- `("dtache" nil ,command)))
- (cl-letf* ((inhibit-message t)
- ((symbol-function #'set-process-sentinel) #'ignore)
- (dtache--dtach-mode (or dtache--dtach-mode 'create))
- (buffer "*Dtache Shell Command*")
- (dtache--current-session (or dtache--current-session
(dtache-create-session command)))
- (dtache-enabled t))
- (funcall #'async-shell-command command buffer)
- (with-current-buffer buffer (setq dtache--buffer-session
dtache--current-session)))))
+ `("dtache" nil ,command))
+ (cl-letf* (((symbol-function #'set-process-sentinel) #'ignore)
+ (dtache--dtach-mode (or dtache--dtach-mode 'create))
+ (buffer "*Dtache Shell Command*"))
+ (funcall #'async-shell-command command buffer)
+ (with-current-buffer buffer (setq dtache--buffer-session
dtache--current-session))))))
(defun dtache-update-sessions ()
"Update `dtache' sessions.
- [elpa] externals/dtache 4e99fc9daa 049/158: Deprecate dtache-list-sessions, (continued)
- [elpa] externals/dtache 4e99fc9daa 049/158: Deprecate dtache-list-sessions, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache cb1762ffc2 052/158: Add presentation about dtache version 0.2, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 5d9c8aa54f 053/158: Add macOS support, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 01a27b4dc2 056/158: Update README with reference to consult-dtache, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache b75af1b9a7 059/158: Update notification setup, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache b47bc3be09 061/158: Update copyright years, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 182ab7ccc6 064/158: Add integration with consult, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache ea6d8ae426 068/158: Add missing autoloads, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache e2efe466e0 076/158: Improve error handling with dtache-valid-session, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 79f1d905a9 078/158: Add example of how to enhance a command with dtach, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache dae6db33db 083/158: Fix various minor problems,
ELPA Syncer <=
- [elpa] externals/dtache 52e839ff4a 007/158: Update README with links, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 7e8727f3a2 020/158: Add TODO to investigate unknown inactive sessions, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache b94baaeecd 021/158: Fix bug in setup notification, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 763246bffe 026/158: Remove explicit dependency on dtache-env, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 087e8f4c73 019/158: Update README, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache d574161815 042/158: Simplify buffer handling, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 1878cefb2f 038/158: Remove embark dependency, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 3c61776c7f 014/158: Fix dtache initialization, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 7c07950642 043/158: Implement better encapsulation of database, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 42569d1c5f 036/158: Update broken tests, ELPA Syncer, 2022/01/19