1 ;;; Copyright (C) 2011, 2014-2015 Rocky Bernstein <rocky@gnu.org>
2 ;; `zshdb' Main interface to zshdb via Emacs
4 (require 'load-relative)
5 (require-relative-list '("../../common/helper") "realgud-")
6 (require-relative-list '("../../common/track") "realgud-")
7 (require-relative-list '("../../common/run") "realgud:")
8 (require-relative-list '("core" "track-mode") "realgud:zshdb-")
10 (declare-function zshdb-track-mode (bool))
11 (declare-function zshdb-query-cmdline 'realgud:zshdb-core)
12 (declare-function zshdb-parse-cmd-args 'realgud:zshdb-core)
14 ;; This is needed, or at least the docstring part of it is needed to
15 ;; get the customization menu to work in Emacs 24.
16 (defgroup realgud:zshdb nil
17 "The realgud interface to the Zsh debugger, zshdb"
21 ;; -------------------------------------------------------------------
22 ;; User definable variables
25 (defcustom realgud:zshdb-command-name
28 "File name for executing the zshdb and its command options.
29 This should be an executable on your path, or an absolute file name."
31 :group 'realgud:zshdb)
33 (declare-function zshdb-track-mode (bool))
35 ;; -------------------------------------------------------------------
39 (declare-function zshdb-track-mode 'realgud-zshdb-track-mode)
40 (declare-function zshdb-query-cmdline 'realgud:zshdb-core)
41 (declare-function zshdb-parse-cmd-args 'realgud:zshdb-core)
42 (declare-function realgud:run-debugger 'realgud:run)
44 ; ### FIXME: DRY with other top-level routines
46 (defun realgud:zshdb (&optional opt-cmd-line no-reset)
47 "Invoke the zshdb Z-shell debugger and start the Emacs user interface.
49 String OPT-CMD-LINE specifies how to run zshdb.
51 OPT-CMD-LINE is treated like a shell string; arguments are
52 tokenized by `split-string-and-unquote'. The tokenized string is
53 parsed by `zshdb-parse-cmd-args' and path elements found by that
54 are expanded using `realgud:expand-file-name-if-exists'.
56 Normally, command buffers are reused when the same debugger is
57 reinvoked inside a command buffer with a similar command. If we
58 discover that the buffer has prior command-buffer information and
59 NO-RESET is nil, then that information which may point into other
60 buffers and source buffers which may contain marks and fringe or
61 marginal icons is reset. See `loc-changes-clear-buffer' to clear
62 fringe and marginal icons.
65 (realgud:run-debugger realgud:zshdb-command-name 'zshdb-query-cmdline
67 'realgud:zshdb-minibuffer-history
68 opt-cmd-line no-reset)
71 (defalias 'zshdb 'realgud:zshdb)
73 (provide-me "realgud-")