[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dtache eaf141725f 044/158: Add compile section to tips
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dtache eaf141725f 044/158: Add compile section to tips and tricks in README |
Date: |
Wed, 19 Jan 2022 18:57:44 -0500 (EST) |
branch: externals/dtache
commit eaf141725f423a003ea18bacc5c7548195deb61d
Author: Niklas Eklund <niklas.eklund@posteo.net>
Commit: Niklas Eklund <niklas.eklund@posteo.net>
Add compile section to tips and tricks in README
---
README.org | 34 +++++++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/README.org b/README.org
index b786ee1b25..abbd236b2f 100644
--- a/README.org
+++ b/README.org
@@ -230,11 +230,43 @@ The =dtache= package supports
[[https://www.gnu.org/software/emacs/manual/html_n
Some programs doesn't play well with =tee= which =dtache= relies upon to
redirect the output both to standard out as well as to file. If you encounter a
situation where output from a session is only visible once it has finished
running, the command you launched should instead be using =redirect only=. To
list a command to run with redirect only in the future can be done by adding a
regexp to =dtache-redirect-only-regexps=.
#+begin_src elisp
- (setq dtache-read-only-list '("^ls"))
+ (setq dtache-redirect-only-regexps '("^ls"))
#+end_src
Here the command beginning with =ls= would from now on be using redirect only.
+** Replace compile with dtache
+
+*** Unconditionally
+
+=Dtache= can be seen as a replacement for =compile=. To unconditionally
replace the latter with the former one can apply this advice.
+
+#+begin_src elisp
+ (defun dtache-compile-override (command &optional _)
+ "Run COMMAND with `dtache'."
+ (dtache-start-session command))
+
+ (advice-add 'compile :override #'dtache-compile-override)
+#+end_src
+
+#+RESULTS:
+
+*** Selectively
+
+Maybe you like the behavior of =compile= but for some specific commands you
would like to replace the usage of =compile= with =dtache=. That can be done
with the following advice, in this case replacing the usage of =compile= within
function =foo=.
+
+#+begin_src elisp
+ (defun dtache-replace-compile-advice (orig-fun &rest args)
+ "Replace `compile' with `dtache'.
+ This is done before ORIG-FUN is passed ARGS."
+ (cl-letf* (((symbol-function 'compile)
+ (lambda (command &optional _)
+ (dtache-start-session command))))
+ (apply orig-fun args)))
+
+ (advice-add #'foo :around #'dtache-replace-compile-advice)
+#+end_src
+
** Evil bindings
For inspiration on how to configure =dtache-list-sessions= to use evil
bindings see
[[https://gitlab.com/niklaseklund/dotfiles/blob/master/.config/emacs/init.el#L1393][Niklas
Eklund's Emacs config]].
- [elpa] externals/dtache 708f9afbf2 002/158: Add empty README, (continued)
- [elpa] externals/dtache 708f9afbf2 002/158: Add empty README, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 7cbd6b3530 009/158: Merge remote branch into master, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache d0b0ed41e2 012/158: Merge develop branch into master, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache bcbc2d8b4d 003/158: Merge with development branch, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache ea07041f52 013/158: Merge develop branch into master, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 522e149252 010/158: Add .dir-locals.el file, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 9b9d58e6b5 011/158: Add flycheck-mode to .dir-locals, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 9194f78dec 005/158: Update credits section, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 34b481d354 008/158: Add some more information to the README, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 91baa9ecfa 031/158: Update dtache-message detection, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache eaf141725f 044/158: Add compile section to tips and tricks in README,
ELPA Syncer <=
- [elpa] externals/dtache eb997e0b4e 023/158: Correct some spelling mistakes, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 082139f1c3 045/158: Add instructions on how to customize annotations, ELPA Syncer, 2022/01/19
- [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