[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dtache 115de6c1a2 022/158: Add default value for dtache
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dtache 115de6c1a2 022/158: Add default value for dtache-max-command-length |
Date: |
Wed, 19 Jan 2022 18:57:41 -0500 (EST) |
branch: externals/dtache
commit 115de6c1a20d7937fd5d04669cd163311e1aa019
Author: Niklas Eklund <niklas.eklund@posteo.net>
Commit: Niklas Eklund <niklas.eklund@posteo.net>
Add default value for dtache-max-command-length
---
README.org | 3 ++-
dtache.el | 24 +++++++++++-------------
2 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/README.org b/README.org
index 73f2968ccd..a92efc2b27 100644
--- a/README.org
+++ b/README.org
@@ -154,7 +154,8 @@ Add [[https://github.com/oantolin/embark/][embark]] actions
to =dtache-open-sess
(use-package marginalia-dtache
:after (dtache marginalia)
:config
- (add-to-list 'marginalia-annotators-heavy '(dtache .
marginalia-dtache-annotate)))
+ ;; Register marginalia annotator
+ (add-to-list 'marginalia-annotator-registry '(dtache
marginalia-dtache-annotate builtin none)))
#+end_src
* Tips & Tricks
diff --git a/dtache.el b/dtache.el
index 34675a4913..9ec22552dc 100644
--- a/dtache.el
+++ b/dtache.el
@@ -61,7 +61,7 @@
"Shell to run the dtach command in.")
(defvar dtache-env "dtache-env"
"The name of the `dtache' program.")
-(defvar dtache-max-command-length nil
+(defvar dtache-max-command-length 90
"Maximum length of displayed command.")
(defvar dtache-redirect-only-regexps '()
"Regexps for commands that should be run with redirect only.")
@@ -615,17 +615,15 @@ Sessions running on current host or localhost are
updated."
(defun dtache--session-truncate-command (session)
"Return a truncated string representation of SESSION's command."
- (if (null dtache-max-command-length)
- (dtache--session-command session)
- (let ((command (dtache--session-command session))
- (part-length (- dtache-max-command-length 3)))
- (if (<= (length command) dtache-max-command-length)
- (let ((padding-length (- dtache-max-command-length (length
command))))
- (concat command (make-string padding-length ?\s)))
- (concat
- (substring command 0 (/ part-length 2))
- "..."
- (substring command (- (length command) (/ part-length 2)) (length
command)))))))
+ (let ((command (dtache--session-command session))
+ (part-length (- dtache-max-command-length 3)))
+ (if (<= (length command) dtache-max-command-length)
+ (let ((padding-length (- dtache-max-command-length (length command))))
+ (concat command (make-string padding-length ?\s)))
+ (concat
+ (substring command 0 (/ part-length 2))
+ "..."
+ (substring command (- (length command) (/ part-length 2)) (length
command))))))
(defun dtache--session-update (session)
"Update the `dtache' SESSION."
@@ -908,7 +906,7 @@ the current time is used."
(define-derived-mode dtache-sessions-mode tabulated-list-mode "Dtache Sessions"
"Dtache sessions."
(setq tabulated-list-format
- `[("Command" ,(or dtache-max-command-length 50) nil)
+ `[("Command" ,dtache-max-command-length nil)
("Active" 10 nil)
("Status" 10 nil)
("Host" 20 nil)
- [elpa] externals/dtache f6c9710c1b 017/158: Merge develop branch into master, (continued)
- [elpa] externals/dtache f6c9710c1b 017/158: Merge develop branch into master, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 99fd5c5b5c 025/158: Make sure to erase the output buffer, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache b2eabec6c7 041/158: Improve dtache actions, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 357432877c 033/158: Implement annotation/affixation function, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache ecc7563302 048/158: Update LICENSE, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 2958d21869 035/158: Remove marginalia from dtache, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache afb2684f38 027/158: Improve dtache-env command, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache c29079e0c0 047/158: Remove dtache-session-history, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache db230154e4 016/158: Merge develop branch into master, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 2a38a9b538 030/158: Robustify against failures in configuration, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 115de6c1a2 022/158: Add default value for dtache-max-command-length,
ELPA Syncer <=
- [elpa] externals/dtache 09d378e50a 024/158: Fix read-only problematic, ELPA Syncer, 2022/01/19
- [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