]> code.delx.au - gnu-emacs-elpa/blob - packages/realgud/realgud/debugger/kshdb/kshdb.el
Add 'packages/realgud/' from commit 'd811316e6a0f4eeee8a1347f504c196c86baa2cb'
[gnu-emacs-elpa] / packages / realgud / realgud / debugger / kshdb / kshdb.el
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"
11 :group 'realgud
12 :version "24.1")
13
14 ;; -------------------------------------------------------------------
15 ;; User definable variables
16 ;;
17
18 (defcustom realgud:kshdb-command-name
19 ;;"kshdb --emacs 3"
20 "kshdb"
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."
23 :type 'string
24 :group 'realgud:kshdb)
25
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)
30
31 ;; -------------------------------------------------------------------
32 ;; The end.
33 ;;
34
35 ;;;###autoload
36 (defun realgud:kshdb (&optional opt-command-line no-reset)
37 "Invoke the Korn shell debugger, kshdb, and start the Emacs user interface.
38
39 String COMMAND-LINE specifies how to run kshdb.
40
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."
47 (interactive)
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))
53 (cmd-buf))
54 (realgud:run-process "kshdb" script-name cmd-args
55 'realgud:kshdb-minibuffer-history
56 no-reset)
57 ))
58
59 (defalias 'kshdb 'realgud:kshdb)
60 (provide-me "realgud-")
61
62 ;;; kshdb.el ends here