]> code.delx.au - gnu-emacs-elpa/blob - packages/realgud/realgud/debugger/zshdb/zshdb.el
Add 'packages/realgud/' from commit 'd811316e6a0f4eeee8a1347f504c196c86baa2cb'
[gnu-emacs-elpa] / packages / realgud / realgud / debugger / zshdb / zshdb.el
1 ;;; Copyright (C) 2011, 2014-2015 Rocky Bernstein <rocky@gnu.org>
2 ;; `zshdb' Main interface to zshdb via Emacs
3 (require 'list-utils)
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-")
9
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)
13
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"
18 :group 'realgud
19 :version "24.1")
20
21 ;; -------------------------------------------------------------------
22 ;; User definable variables
23 ;;
24
25 (defcustom realgud:zshdb-command-name
26 ;;"zshdb --emacs 3"
27 "zshdb"
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."
30 :type 'string
31 :group 'realgud:zshdb)
32
33 (declare-function zshdb-track-mode (bool))
34
35 ;; -------------------------------------------------------------------
36 ;; The end.
37 ;;
38
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)
43
44 ; ### FIXME: DRY with other top-level routines
45 ;;;###autoload
46 (defun realgud:zshdb (&optional opt-cmd-line no-reset)
47 "Invoke the zshdb Z-shell debugger and start the Emacs user interface.
48
49 String OPT-CMD-LINE specifies how to run zshdb.
50
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'.
55
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.
63 "
64 (interactive)
65 (realgud:run-debugger realgud:zshdb-command-name 'zshdb-query-cmdline
66 'zshdb-parse-cmd-args
67 'realgud:zshdb-minibuffer-history
68 opt-cmd-line no-reset)
69 )
70
71 (defalias 'zshdb 'realgud:zshdb)
72
73 (provide-me "realgud-")