[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/shellcop 5102a94f80 05/10: clean code
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/shellcop 5102a94f80 05/10: clean code |
Date: |
Wed, 5 Jan 2022 08:59:35 -0500 (EST) |
branch: elpa/shellcop
commit 5102a94f80a7d7ff7b6e524ba68672f5895ac822
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: Chen Bin <chenbin.sh@gmail.com>
clean code
---
shellcop.el | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/shellcop.el b/shellcop.el
index 1ad15dea04..aad6766f7c 100644
--- a/shellcop.el
+++ b/shellcop.el
@@ -2,7 +2,7 @@
;; Copyright (C) 2020 Chen Bin
;;
-;; Version: 0.0.2
+;; Version: 0.0.3
;; Keywords: unix tools
;; Author: Chen Bin <chenbin DOT sh AT gmail DOT com>
;; URL: https://github.com/redguardtoo/shellcop
@@ -34,7 +34,7 @@
;; `shellcop-reset-with-new-command' will,
;; - kill current running process
;; - erase the content in shell buffer
-;; - If `shellcop-sub-window-has-error-function' return nil in all
sub-windows, run `shellcop-insert-shell-command-function'
+;; - If `shellcop-sub-window-has-error-function' return nil in all
sub-windows, run `shellcop-insert-shell-command-function'.
;;
;; `shellcop-erase-buffer' erases the content buffer with below names,
;; - "*Messages*" (default)
@@ -81,6 +81,11 @@ If there is error, it returns t."
:type 'string
:group 'shellcop)
+(defcustom shellcop-wait-time-after-kill-running-job 2
+ "Seconds to wait after kill running job in shell."
+ :type 'number
+ :group 'shellcop)
+
(defun shellcop-location-detail (str)
"Get file, line and column from STR."
(when (string-match "^\\([^:]+\\):\\([0-9]+\\)+\\(:[0-9]+\\)?$" str)
@@ -149,7 +154,8 @@ If ABOVE is t, extract locations above current point; or
else below current poin
(forward-line (1- n))))
(defun shellcop-comint-send-input-hack (orig-func &rest args)
- "Advice `comint-send-input' with ORIG-FUNC and ARGS."
+ "Advice `comint-send-input' with ORIG-FUNC and ARGS.
+Extract file paths when user presses enter key shell."
(let* ((artifical (nth 1 args))
locations)
(cond
@@ -270,9 +276,12 @@ Keep latest N cli program output if it's not nil."
;; back to original window
(select-window orig-w)
+ ;; kill current running process
(comint-interrupt-subjob)
- ;; wait 2 seconds
- (sit-for 2)
+
+ ;; wait
+ (sit-for shellcop-wait-time-after-kill-running-job)
+
(shellcop-erase-one-visible-buffer (buffer-name (current-buffer)))
(goto-char (point-max))
- [nongnu] branch elpa/shellcop created (now 8213452241), ELPA Syncer, 2022/01/05
- [nongnu] elpa/shellcop 4710d80099 02/10: doc, ELPA Syncer, 2022/01/05
- [nongnu] elpa/shellcop 12db5dffb2 03/10: simplify erase buffer command, ELPA Syncer, 2022/01/05
- [nongnu] elpa/shellcop eec62d29bc 04/10: fixed erase *Messages* buffer error, ELPA Syncer, 2022/01/05
- [nongnu] elpa/shellcop 8213452241 10/10: can goto location manually, ELPA Syncer, 2022/01/05
- [nongnu] elpa/shellcop 38cfb38a2b 01/10: first import, ELPA Syncer, 2022/01/05
- [nongnu] elpa/shellcop 7c025b1017 09/10: add debug code, ELPA Syncer, 2022/01/05
- [nongnu] elpa/shellcop 5102a94f80 05/10: clean code,
ELPA Syncer <=
- [nongnu] elpa/shellcop c4d0468ce4 06/10: support elpy python shell, ELPA Syncer, 2022/01/05
- [nongnu] elpa/shellcop b0045fb41f 07/10: search *shell* buffer from other sub-window, ELPA Syncer, 2022/01/05
- [nongnu] elpa/shellcop a5ebf9e3ea 08/10: fixed some minor issues per melpa review, ELPA Syncer, 2022/01/05