[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master e2c3271 015/215: Minimal support for running under eshell
From: |
Rocky Bernstein |
Subject: |
[elpa] master e2c3271 015/215: Minimal support for running under eshell |
Date: |
Sat, 30 Jul 2016 14:48:48 +0000 (UTC) |
branch: master
commit e2c3271331800912e60f10355185af153fe40bb5
Author: rocky <address@hidden>
Commit: rocky <address@hidden>
Minimal support for running under eshell
More FSF copyrights
---
realgud/common/loc.el | 19 ++++++++++++++++---
realgud/common/send.el | 35 ++++++++++++++++++++++++++++-------
realgud/common/track-mode.el | 15 ++++++++++-----
realgud/common/track.el | 2 +-
4 files changed, 55 insertions(+), 16 deletions(-)
diff --git a/realgud/common/loc.el b/realgud/common/loc.el
index fe4b214..00c75a0 100644
--- a/realgud/common/loc.el
+++ b/realgud/common/loc.el
@@ -1,6 +1,19 @@
-;;; Copyright (C) 2010, 2012, 2014-2015 Rocky Bernstein <address@hidden>
-;;; Debugger location
-;;; Commentary:
+;; Copyright (C) 2015 Free Software Foundation, Inc
+
+;; Author: Rocky Bernstein <address@hidden>
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;; This describes a debugger location structure and has code for
;; working with them.
diff --git a/realgud/common/send.el b/realgud/common/send.el
index 3d752ec..85f26b5 100644
--- a/realgud/common/send.el
+++ b/realgud/common/send.el
@@ -16,6 +16,7 @@
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
(require 'comint)
+(require 'eshell)
(require 'load-relative)
(require-relative-list '("window") "realgud-")
(require-relative-list '("buffer/helper") "realgud-buffer-")
@@ -24,16 +25,36 @@
(declare-function comint-goto-process-mark 'comint)
(declare-function comint-send-input 'comint)
-(defun realgud-send-command-comint (process command-str)
+(defun realgud:send-input ()
+ "Sends command buffer line either to comint or eshell"
+ (interactive)
+ ;; FIXME DRY with code in realgud:send-command-common() and track-mode.el
+ (cond ((and (boundp 'eshell-mode) eshell-mode)
+ (eshell-send-input))
+ ((and (boundp 'comint-prompt-regexp)
+ (comint-check-proc (current-buffer)))
+ (comint-send-input))
+ ('t (error "We can only handle comint or eshell buffers")))
+ )
+
+(defun realgud:send-command-common (process command-str)
"Assume we are in a comint buffer. Insert COMMAND-STR and
send that input onto the process."
(if (eq 'run (process-status process))
(progn
- (comint-goto-process-mark)
- (setq comint-last-output-start
- (setq realgud-last-output-start (point-marker)))
+ ;; FIXME DRY with code in realgud:send-input() and track-mode.el
+ (cond ((and (boundp 'eshell-mode) eshell-mode)
+ (goto-char eshell-last-output-end)
+ (setq eshell-last-output-start
+ (setq realgud-last-output-start (point-marker))))
+ ((and (boundp 'comint-prompt-regexp)
+ (comint-check-proc (current-buffer)))
+ (comint-goto-process-mark)
+ (setq comint-last-output-start
+ (setq realgud-last-output-start (point-marker))))
+ ('t (error "We can only handle cmint or eshell buffers")))
(insert command-str)
- (comint-send-input)
+ (realgud:send-input)
)
;; else
(message "Process %s not in `run' state; not issuing %s"
@@ -77,7 +98,7 @@ results into the command buffer."
"Invoke the debugger COMMAND adding that command and the
results into the command buffer."
(let* ((cmdbuf (realgud-get-cmdbuf opt-buffer))
- (send-command-fn (or opt-send-fn (function
realgud-send-command-comint)))
+ (send-command-fn (or opt-send-fn (function
realgud:send-command-common)))
)
(if cmdbuf
(with-current-buffer cmdbuf
@@ -222,7 +243,7 @@ debugger prompt.
;; display of the command buffer.
(if realgud-prompts? (realgud-window-cmd-undisturb-src nil 't))
- (realgud-send-command command-str (function
realgud-send-command-comint))
+ (realgud-send-command command-str (function
realgud:send-command-common))
;; Wait for the process-mark to change before changing variables
;; that effect the hook processing.
diff --git a/realgud/common/track-mode.el b/realgud/common/track-mode.el
index c2c1dcd..4199181 100644
--- a/realgud/common/track-mode.el
+++ b/realgud/common/track-mode.el
@@ -38,10 +38,10 @@
(declare-function realgud-cmdbuf-info-set?
'realgud-buffer-command)
-
(defvar realgud-track-mode-map
(let ((map (copy-keymap shell-mode-map)))
(realgud-populate-debugger-menu map)
+ (define-key map "\r" 'realgud:send-input)
(define-key map [M-right] 'realgud-track-hist-newest)
(define-key map [M-down] 'realgud-track-hist-newer)
(define-key map [M-up] 'realgud-track-hist-older)
@@ -137,10 +137,15 @@ of this mode."
(set-marker comint-last-output-start (point)))
(set (make-local-variable 'tool-bar-map) realgud:tool-bar-map)
- (add-hook 'comint-output-filter-functions
- 'realgud-track-comint-output-filter-hook)
- (add-hook 'eshell-output-filter-functions
- 'realgud-track-eshell-output-filter-hook)
+ ;; FIXME DRY with code in send.el
+ (cond ((and (boundp 'eshell-mode) eshell-mode)
+ (add-hook 'eshell-output-filter-functions
+ 'realgud-track-eshell-output-filter-hook))
+ ((and (boundp 'comint-prompt-regexp)
+ (comint-check-proc (current-buffer)))
+ (add-hook 'comint-output-filter-functions
+ 'realgud-track-comint-output-filter-hook))
+ ('t (error "We can only handle comint or eshell buffers")))
(run-mode-hooks 'realgud-track-mode-hook))
;; else
(progn
diff --git a/realgud/common/track.el b/realgud/common/track.el
index 1c40ba8..24a531d 100644
--- a/realgud/common/track.el
+++ b/realgud/common/track.el
@@ -130,7 +130,7 @@ marks set in buffer-local variables to extract text"
(lexical-let* ((cmd-buff (current-buffer))
(cmd-mark (point-marker))
(loc (realgud:track-from-region eshell-last-output-start
- eshell-last-output-end
cmd-mark)))
+ eshell-last-output-end
cmd-mark)))
(realgud-track-loc-action loc cmd-buff 't)))
)
- [elpa] master a02f3cd 006/215: Bind RET in shortkey to repeat-last; add FSF (C), (continued)
- [elpa] master a02f3cd 006/215: Bind RET in shortkey to repeat-last; add FSF (C), Rocky Bernstein, 2016/07/30
- [elpa] master 345c67c 014/215: eval.el: issue #40, Rocky Bernstein, 2016/07/30
- [elpa] master 9e2656a 029/215: Correct nodejs/init.el bugs - sync with master, Rocky Bernstein, 2016/07/30
- [elpa] master 9cf5e4d 028/215: Add breakpoint set to nodejs, Rocky Bernstein, 2016/07/30
- [elpa] master 3993d13 020/215: Respect shortkey mode setting, Rocky Bernstein, 2016/07/30
- [elpa] master 3a0b837 022/215: Update README.md to note that we can use in eshell, Rocky Bernstein, 2016/07/30
- [elpa] master 886f741 024/215: Make sure we go into realgud-track mode when we have custom mode, Rocky Bernstein, 2016/07/30
- [elpa] master dc0b45b 034/215: Revert "Squelch one of the many compiler warnings", Rocky Bernstein, 2016/07/30
- [elpa] master b8d8686 032/215: Squelch one of the many compiler warnings, Rocky Bernstein, 2016/07/30
- [elpa] master 266e5df 021/215: Small error message grammar correction, Rocky Bernstein, 2016/07/30
- [elpa] master e2c3271 015/215: Minimal support for running under eshell,
Rocky Bernstein <=
- [elpa] master 33bfa6f 033/215: Squelch one of the many compiler warnings, Rocky Bernstein, 2016/07/30
- [elpa] master 395db6d 016/215: Simplify eshell/comint/shell mode testing., Rocky Bernstein, 2016/07/30
- [elpa] master 2acb30c 031/215: Start js lang. add js backtrace regexp, Rocky Bernstein, 2016/07/30
- [elpa] master 1868152 025/215: core.el: remove duplicate command buffer creation, Rocky Bernstein, 2016/07/30
- [elpa] master b920afc 043/215: trepanjs: handle eval properly, Rocky Bernstein, 2016/07/30
- [elpa] master ea27a82 026/215: More copyright assignments to FSF, Rocky Bernstein, 2016/07/30
- [elpa] master 3d74bb5 013/215: More FSF copyright assignments., Rocky Bernstein, 2016/07/30
- [elpa] master 0e68d8d 038/215: common/regexp.el: start to DRY regexps, Rocky Bernstein, 2016/07/30
- [elpa] master 03ecacd 049/215: trepanjs msg change: stop in -> call in, Rocky Bernstein, 2016/07/30
- [elpa] master 986585b 035/215: Revert "Squelch one of the many compiler warnings", Rocky Bernstein, 2016/07/30