[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dtache 60ec4c26d1 03/14: Add smart-mode-block-list
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dtache 60ec4c26d1 03/14: Add smart-mode-block-list |
Date: |
Fri, 13 May 2022 11:57:47 -0400 (EDT) |
branch: externals/dtache
commit 60ec4c26d1e3b8915950419167e7abf0bc212376
Author: Niklas Eklund <niklas.eklund@posteo.net>
Commit: Niklas Eklund <niklas.eklund@posteo.net>
Add smart-mode-block-list
---
dtache.el | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/dtache.el b/dtache.el
index 9483e7f424..236a95d14e 100644
--- a/dtache.el
+++ b/dtache.el
@@ -92,6 +92,11 @@
:type 'string
:group 'dtache)
+(defcustom dtache-env-smart-mode-block-list nil
+ "A list of regexps for commands that should be run in dumb mode in
`dtache-env'."
+ :type 'list
+ :group 'dtache)
+
(defcustom dtache-annotation-format
'((:width 3 :function dtache--state-str :face dtache-state-face)
(:width 3 :function dtache--status-str :face dtache-failure-face)
@@ -1126,10 +1131,20 @@ If SESSION is nonattachable fallback to a command that
doesn't rely on tee."
(env (if dtache-env dtache-env (format "%s -c" dtache-shell-program)))
(command
(if dtache-env
- (concat "smart " (shell-quote-argument (dtache--session-command
session)))
+ (concat (format "%s " (dtache--env-mode (dtache--session-command
session)))
+ (shell-quote-argument (dtache--session-command session)))
(shell-quote-argument (dtache--session-command session)))))
(format "%s %s %s; %s %s" begin-shell-group env command end-shell-group
redirect)))
+(defun dtache--env-mode (command)
+ "Return mode to run in `dtache-env' based on COMMAND."
+ (if-let ((blocked-command
+ (seq-find (lambda (regexp)
+ (string-match-p regexp command))
+ dtache-env-smart-mode-block-list)))
+ 'dumb
+ 'smart))
+
(defun dtache--host ()
"Return a cons with (host . type)."
(let ((remote (file-remote-p default-directory)))
- [elpa] externals/dtache updated (5a39733299 -> 04f27090ae), ELPA Syncer, 2022/05/13
- [elpa] externals/dtache 19f13e25d5 02/14: new-dtache-env, ELPA Syncer, 2022/05/13
- [elpa] externals/dtache 60ec4c26d1 03/14: Add smart-mode-block-list,
ELPA Syncer <=
- [elpa] externals/dtache d34c6cb023 10/14: Delete README.org, ELPA Syncer, 2022/05/13
- [elpa] externals/dtache c1f3b629b8 01/14: Update README, ELPA Syncer, 2022/05/13
- [elpa] externals/dtache 0f3dce2191 04/14: Fix tests, ELPA Syncer, 2022/05/13
- [elpa] externals/dtache 7f07d2ddd3 06/14: Add missing autoload cookie, ELPA Syncer, 2022/05/13
- [elpa] externals/dtache 2764a29989 08/14: Update dtache-env-mode, ELPA Syncer, 2022/05/13
- [elpa] externals/dtache 7311bcaac8 09/14: Update dtache-env-mode implementation, ELPA Syncer, 2022/05/13
- [elpa] externals/dtache 5087f90120 12/14: Update CHANGELOG, ELPA Syncer, 2022/05/13
- [elpa] externals/dtache 80d019e595 05/14: Address suggestion from linter, ELPA Syncer, 2022/05/13
- [elpa] externals/dtache d0c5522c9e 07/14: Update README.md, ELPA Syncer, 2022/05/13
- [elpa] externals/dtache df25737444 13/14: Mention that users need to update dtache-env, ELPA Syncer, 2022/05/13