]> code.delx.au - gnu-emacs-elpa/blob - packages/realgud/realgud/debugger/bashdb/bashdb.el
Add 'packages/realgud/' from commit 'd811316e6a0f4eeee8a1347f504c196c86baa2cb'
[gnu-emacs-elpa] / packages / realgud / realgud / debugger / bashdb / bashdb.el
1 ;;; Copyright (C) 2011, 2013-2015 Rocky Bernstein <rocky@gnu.org>
2 ;; `bashdb' Main interface to bashdb via Emacs
3 (require 'list-utils)
4 (require 'load-relative)
5 (require-relative-list '("../../common/helper") "realgud-")
6 (require-relative-list '("../../common/run") "realgud:")
7 (require-relative-list '("core" "track-mode") "realgud:bashdb-")
8
9 ;; This is needed, or at least the docstring part of it is needed to
10 ;; get the customization menu to work in Emacs 24.
11 (defgroup realgud:bashdb nil
12 "The realgud interface to bashdb"
13 :group 'realgud
14 :version "24.3")
15
16 ;; -------------------------------------------------------------------
17 ;; User-definable variables
18 ;;
19
20 (defcustom realgud:bashdb-command-name
21 ;;"bashdb --emacs 3"
22 "bashdb"
23 "File name for executing the bash debugger and command options.
24 This should be an executable on your path, or an absolute file name."
25 :type 'string
26 :group 'realgud:bashdb)
27
28 ;; -------------------------------------------------------------------
29 ;; The end.
30 ;;
31
32 (declare-function bashdb-track-mode 'realgud-bashdb-track-mode)
33 (declare-function bashdb-query-cmdline 'realgud:bashdb-core)
34 (declare-function bashdb-parse-cmd-args 'realgud:bashdb-core)
35 (declare-function realgud:run-debugger 'realgud:run)
36
37 ;;;###autoload
38 (defun realgud:bashdb (&optional opt-cmd-line no-reset)
39 "Invoke the bashdb shell debugger and start the Emacs user interface.
40
41 String OPT-CMD-LINE specifies how to run bash. You will be prompted
42 for a command line is one isn't supplied.
43
44 OPT-CMD-LINE is treated like a shell string; arguments are
45 tokenized by `split-string-and-unquote'. The tokenized string is
46 parsed by `bashdb-parse-cmd-args' and path elements found by that
47 are expanded using `realgud:expand-file-name-if-exists'.
48
49 Normally, command buffers are reused when the same debugger is
50 reinvoked inside a command buffer with a similar command. If we
51 discover that the buffer has prior command-buffer information and
52 NO-RESET is nil, then that information which may point into other
53 buffers and source buffers which may contain marks and fringe or
54 marginal icons is reset. See `loc-changes-clear-buffer' to clear
55 fringe and marginal icons.
56 "
57 (interactive)
58 (realgud:run-debugger "bashdb"
59 'bashdb-query-cmdline
60 'bashdb-parse-cmd-args
61 'realgud:bashdb-minibuffer-history
62 opt-cmd-line no-reset)
63 )
64
65 (defalias 'bashdb 'realgud:bashdb)
66
67 (provide-me "realgud-")