branch: master
commit 0a1dbc4ceda0c8f790f4f6e6ff9f694f559aaa61
Author: rocky <[email protected]>
Commit: rocky <[email protected]>
Remove node asci schmutz. put in lang/js.el
Add more FSF copyrights
---
realgud/debugger/nodejs/nodejs.el | 23 ++++++++++++++++++--
realgud/debugger/trepanjs/trepanjs.el | 38 +++++++++++++++++++++++++++------
realgud/lang/js.el | 10 +++++++++
3 files changed, 63 insertions(+), 8 deletions(-)
diff --git a/realgud/debugger/nodejs/nodejs.el
b/realgud/debugger/nodejs/nodejs.el
index 23b7a38..33cb74f 100644
--- a/realgud/debugger/nodejs/nodejs.el
+++ b/realgud/debugger/nodejs/nodejs.el
@@ -1,12 +1,31 @@
+;; Copyright (C) 2015 Free Software Foundation, Inc
+
+;; Author: Rocky Bernstein <[email protected]>
+
+;; 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/>.
+;;; Regular expressions for nodejs Javascript debugger.
;;; Copyright (C) 2014-2015 Rocky Bernstein <[email protected]>
+
;; `nodejs' Main interface to nodejs debugger via Emacs
(require 'list-utils)
(require 'load-relative)
(require-relative-list '("../../common/helper") "realgud-")
(require-relative-list '("../../common/run") "realgud:")
(require-relative-list '("core" "track-mode") "realgud:nodejs-")
+(require-relative-list '("../../lang/js") "realgud-lang-")
-(declare-function realgud:nodejs-remove-ansi-shmutz 'realgud-core)
+(declare-function realgud:js-remove-ansi-schmutz 'realgud-lang-js)
(declare-function realgud:run-debugger 'realgud:run)
;; This is needed, or at least the docstring part of it is needed to
@@ -65,7 +84,7 @@ fringe and marginal icons.
(with-current-buffer cmd-buf
;; FIXME should allow customization whether to do or not
;; and also only do if hook is not already there.
- (realgud:nodejs-remove-ansi-shmutz)
+ (realgud:js-remove-ansi-schmutz)
)
)))
diff --git a/realgud/debugger/trepanjs/trepanjs.el
b/realgud/debugger/trepanjs/trepanjs.el
index f153a3f..9742d1d 100644
--- a/realgud/debugger/trepanjs/trepanjs.el
+++ b/realgud/debugger/trepanjs/trepanjs.el
@@ -1,12 +1,31 @@
-;;; Copyright (C) 2010-2011, 2013-2015 Rocky Bernstein <[email protected]>
+;; Copyright (C) 2015 Free Software Foundation, Inc
+
+;; Author: Rocky Bernstein <[email protected]>
+
+;; 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/>.
+;;; Regular expressions for nodejs Javascript debugger.
+
;; `trepanjs' Main interface to trepanjs via Emacs
(require 'load-relative)
(require-relative-list '("../../common/helper") "realgud-")
(require-relative-list '("../../common/run") "realgud:")
(require-relative-list '("core" "track-mode") "realgud:trepanjs-")
+(require-relative-list '("../../lang/js") "realgud-lang-")
(declare-function realgud:trepanjs-query-cmdline 'realgud:trepanjs-core)
(declare-function realgud:trepanjs-parse-cmd-args 'realgud:trepanjs-core)
+(declare-function realgud:js-remove-ansi-schmutz 'realgud-lang-js)
(declare-function realgud:run-debugger 'realgud:run)
;; This is needed, or at least the docstring part of it is needed to
@@ -47,11 +66,18 @@ marginal icons is reset. See `loc-changes-clear-buffer' to
clear
fringe and marginal icons.
"
(interactive)
- (realgud:run-debugger "trepanjs" 'realgud:trepanjs-query-cmdline
- 'realgud:trepanjs-parse-cmd-args
- 'realgud:trepanjs-minibuffer-history
- opt-cmd-line no-reset)
- )
+ (let ((cmd-buf
+ (realgud:run-debugger "trepanjs" 'realgud:trepanjs-query-cmdline
+ 'realgud:trepanjs-parse-cmd-args
+ 'realgud:trepanjs-minibuffer-history
+ opt-cmd-line no-reset)))
+ (if cmd-buf
+ (with-current-buffer cmd-buf
+ ;; FIXME should allow customization whether to do or not
+ ;; and also only do if hook is not already there.
+ (realgud:js-remove-ansi-schmutz)
+ )
+ )))
(defalias 'trepanjs 'realgud:trepanjs)
(provide-me "realgud-")
diff --git a/realgud/lang/js.el b/realgud/lang/js.el
index bb5ab38..6ab462f 100644
--- a/realgud/lang/js.el
+++ b/realgud/lang/js.el
@@ -35,4 +35,14 @@
:char-offset-group 4)
"A realgud-loc-pat struct that describes a V8 backtrace location")
+(defun realgud:js-remove-ansi-schmutz()
+ "Remove ASCII escape sequences that node.js 'decorates' in
+prompts and interactive output with"
+ (add-to-list
+ 'comint-preoutput-filter-functions
+ (lambda (output)
+ (replace-regexp-in-string "\033\\[[0-9]+[GKJ]" "" output)))
+ )
+
+
(provide-me "realgud-lang-")