]> code.delx.au - gnu-emacs-elpa/blob - packages/realgud/realgud/debugger/trepanx/trepanx.el
ede3163840edae8b5a7a3f4580d27668783cf307
[gnu-emacs-elpa] / packages / realgud / realgud / debugger / trepanx / trepanx.el
1 ;;; Copyright (C) 2010-2011, 2014-2015 Rocky Bernstein <rocky@gnu.org>
2 ;; `trepanx' Main interface to trepanx via Emacs
3 (require 'load-relative)
4 (require-relative-list '("../../common/helper") "realgud-")
5 (require-relative-list '("../../common/track") "realgud-")
6 (require-relative-list '("core" "track-mode") "realgud:trepanx-")
7
8 (declare-function trepanx-query-cmdline 'realgud:trepanx-core)
9 (declare-function trepanx-parse-cmd-args 'realgud:trepanx-core)
10 (declare-function realgud:run-process 'realgud-run)
11
12 ;; This is needed, or at least the docstring part of it is needed to
13 ;; get the customization menu to work in Emacs 24.
14 (defgroup realgud:trepanx nil
15 "The realgud interface to the Rubinius \"trepanning\" debugger"
16 :group 'ruby
17 :group 'realgud
18 :version "23.1")
19
20 ;; -------------------------------------------------------------------
21 ;; User definable variables
22 ;;
23
24 (defcustom realgud:trepanx-command-name
25 ;;"trepanx --emacs 3"
26 "trepanx"
27 "File name for executing the Ruby debugger and command options.
28 This should be an executable on your path, or an absolute file name."
29 :type 'string
30 :group 'realgud:trepanx)
31
32 ;; -------------------------------------------------------------------
33 ;; The end.
34 ;;
35
36 ;;;###autoload
37 (defun realgud:trepanx (&optional opt-command-line no-reset)
38 "Invoke the trepanx Ruby debugger and start the Emacs user interface.
39
40 String COMMAND-LINE specifies how to run trepanx.
41
42 Normally command buffers are reused when the same debugger is
43 reinvoked inside a command buffer with a similar command. If we
44 discover that the buffer has prior command-buffer information and
45 NO-RESET is nil, then that information which may point into other
46 buffers and source buffers which may contain marks and fringe or
47 marginal icons is reset."
48 (interactive)
49 (let* (
50 (cmd-str (or opt-command-line (trepanx-query-cmdline "trepanx")))
51 (cmd-args (split-string-and-unquote cmd-str))
52 (parsed-args (trepanx-parse-cmd-args cmd-args))
53 (script-args (cdr cmd-args))
54 (script-name (car script-args))
55 (cmd-buf))
56 (realgud:run-process "trepanx" script-name cmd-args
57 'realgud:trepanx-minibuffer-history
58 no-reset)
59 )
60 )
61
62 (defalias 'trepanx 'realgud:trepanx)
63
64 (provide-me "realgud-")