[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/shellcop 7c025b1017 09/10: add debug code
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/shellcop 7c025b1017 09/10: add debug code |
Date: |
Wed, 5 Jan 2022 08:59:35 -0500 (EST) |
branch: elpa/shellcop
commit 7c025b10173ef380ea539dbbdcd7d60977119e24
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: Chen Bin <chenbin.sh@gmail.com>
add debug code
---
shellcop.el | 25 ++++++++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)
diff --git a/shellcop.el b/shellcop.el
index 793726d3b5..a2f9178135 100644
--- a/shellcop.el
+++ b/shellcop.el
@@ -2,7 +2,7 @@
;; Copyright (C) 2020-2021 Chen Bin
;;
-;; Version: 0.0.5
+;; Version: 0.0.6
;; Keywords: unix tools
;; Author: Chen Bin <chenbin DOT sh AT gmail DOT com>
;; URL: https://github.com/redguardtoo/shellcop
@@ -97,15 +97,24 @@ If there is error, it returns t."
:type 'function
:group 'shellcop)
+(defcustom shellcop-shell-buffer-name "*shell*"
+ "The name of buffer in `shell-mode'."
+ :type 'string
+ :group 'shellcop)
+
+(defvar shellcop-debug nil "Enable debug output if not nil.")
+
(defun shellcop-location-detail (str)
"Get file, line and column from STR."
- (when (string-match "^\\([^:]+\\):\\([0-9]+\\)+\\(:[0-9]+\\)?$" str)
+ (when shellcop-debug (message "shellcop-location-details (%s)" str))
+ (when (string-match "^\\([^:]+\\):\\([0-9]+\\)+\\(:[0-9]+\\)?" str)
(let* ((file (match-string 1 str))
(line (match-string 2 str))
(col (match-string 3 str)))
;; clean the column format
(when col
(setq col (replace-regexp-in-string ":" "" col)))
+ (when shellcop-debug (message "file=%s line=%s col=%s" file line col))
(list file line col))))
(defun shellcop-extract-location ()
@@ -150,6 +159,10 @@ If ABOVE is t, extract locations above current point; or
else below current poin
"Extract all locations near current point."
(let* ((location (shellcop-extract-location))
rlt)
+
+ (when shellcop-debug
+ (message "shellcop-extract-all-locations called. location=%s" location))
+
;; at least current line should contain file path
(when location
(shellcop-push-location location rlt)
@@ -169,6 +182,8 @@ If ABOVE is t, extract locations above current point; or
else below current poin
Extract file paths when user presses enter key shell."
(let* ((artifical (nth 1 args))
locations)
+ (when shellcop-debug
+ (message "shellcop-comint-send-input-hack (%s)" artifical))
(cond
((or artifical (not (eq major-mode 'shell-mode)))
;; do nothing
@@ -250,6 +265,7 @@ Keep latest N cli program output if it's not nil."
(cond
((not target-window)
(message "Buffer %s is not visible!" buf-name))
+
(t
(select-window target-window)
(let* ((inhibit-read-only t))
@@ -257,6 +273,7 @@ Keep latest N cli program output if it's not nil."
;; skip current prompt line
(forward-line -2)
(setq beg (shellcop-search-backward-prompt n)))
+
(cond
(beg
(delete-region (point-min) beg))
@@ -334,6 +351,8 @@ Or else erase current buffer."
(buffer-substring (region-beginning) (region-end)))
(t
(thing-at-point 'word)))))
+ (when shellcop-debug
+ (message "shellcop-focus-window called. sub-window=%s keyword=%s"
sub-window keyword))
(when sub-window
;; select sub-window
(select-window sub-window)
@@ -345,7 +364,7 @@ Or else erase current buffer."
"Search symbol or selected text in *shell* buffer of the other window."
(interactive)
(shellcop-focus-window
- "*shell*"
+ shellcop-shell-buffer-name
(lambda (keyword)
(when keyword
(funcall shellcop-string-search-function keyword)))))
- [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 <=
- [nongnu] elpa/shellcop 5102a94f80 05/10: clean code, ELPA Syncer, 2022/01/05
- [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