1 ;;; Copyright (C) 2011, 2014-2015 Rocky Bernstein <rocky@gnu.org>
2 ;; `kshdb' Main interface to kshdb 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:kshdb-")
7 ;; This is needed, or at least the docstring part of it is needed to
8 ;; get the customization menu to work in Emacs 24.
9 (defgroup realgud:kshdb nil
10 "The realgud interface to the Korn shell debugger, kshdb"
14 ;; -------------------------------------------------------------------
15 ;; User definable variables
18 (defcustom realgud:kshdb-command-name
21 "File name for executing the kshdb and its command options.
22 This should be an executable on your path, or an absolute file name."
24 :group 'realgud:kshdb)
26 (declare-function kshdb-track-mode (bool))
27 (declare-function kshdb-query-cmdline 'realgud:kshdb-core)
28 (declare-function kshdb-parse-cmd-args 'realgud:kshdb-core)
29 (declare-function realgud:run-process 'realgud-run)
31 ;; -------------------------------------------------------------------
36 (defun realgud:kshdb (&optional opt-command-line no-reset)
37 "Invoke the Korn shell debugger, kshdb, and start the Emacs user interface.
39 String COMMAND-LINE specifies how to run kshdb.
41 Normally command buffers are reused when the same debugger is
42 reinvoked inside a command buffer with a similar command. If we
43 discover that the buffer has prior command-buffer information and
44 NO-RESET is nil, then that information which may point into other
45 buffers and source buffers which may contain marks and fringe or
46 marginal icons is reset."
48 (let* ((cmd-str (or opt-command-line (kshdb-query-cmdline "kshdb")))
49 (cmd-args (split-string-and-unquote cmd-str))
50 (parsed-args (kshdb-parse-cmd-args cmd-args))
51 (script-args (cdr cmd-args))
52 (script-name (car script-args))
54 (realgud:run-process "kshdb" script-name cmd-args
55 'realgud:kshdb-minibuffer-history
59 (defalias 'kshdb 'realgud:kshdb)
60 (provide-me "realgud-")
62 ;;; kshdb.el ends here