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-")
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)
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"
20 ;; -------------------------------------------------------------------
21 ;; User definable variables
24 (defcustom realgud:trepanx-command-name
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."
30 :group 'realgud:trepanx)
32 ;; -------------------------------------------------------------------
37 (defun realgud:trepanx (&optional opt-command-line no-reset)
38 "Invoke the trepanx Ruby debugger and start the Emacs user interface.
40 String COMMAND-LINE specifies how to run trepanx.
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."
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))
56 (realgud:run-process "trepanx" script-name cmd-args
57 'realgud:trepanx-minibuffer-history
62 (defalias 'trepanx 'realgud:trepanx)
64 (provide-me "realgud-")