Personal emacs config
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
3.2 KiB

  1. ;; Copyright (C) 2011, 2014-2016 Free Software Foundation, Inc
  2. ;; Author: Rocky Bernstein <rocky@gnu.org>
  3. ;; This program is free software; you can redistribute it and/or modify
  4. ;; it under the terms of the GNU General Public License as published by
  5. ;; the Free Software Foundation, either version 3 of the License, or
  6. ;; (at your option) any later version.
  7. ;; `zshdb' Main interface to zshdb via Emacs
  8. (require 'load-relative)
  9. (require-relative-list '("../../common/helper") "realgud-")
  10. (require-relative-list '("../../common/track") "realgud-")
  11. (require-relative-list '("../../common/run") "realgud:")
  12. (require-relative-list '("core" "track-mode") "realgud:zshdb-")
  13. (declare-function zshdb-track-mode (bool))
  14. (declare-function zshdb-query-cmdline 'realgud:zshdb-core)
  15. (declare-function zshdb-parse-cmd-args 'realgud:zshdb-core)
  16. ;; This is needed, or at least the docstring part of it is needed to
  17. ;; get the customization menu to work in Emacs 25.
  18. (defgroup realgud:zshdb nil
  19. "The realgud interface to the Zsh debugger, zshdb"
  20. :group 'realgud
  21. :version "25.1")
  22. ;; -------------------------------------------------------------------
  23. ;; User definable variables
  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. (declare-function zshdb-track-mode (bool))
  33. ;; -------------------------------------------------------------------
  34. ;; The end.
  35. ;;
  36. (declare-function zshdb-track-mode 'realgud-zshdb-track-mode)
  37. (declare-function zshdb-query-cmdline 'realgud:zshdb-core)
  38. (declare-function zshdb-parse-cmd-args 'realgud:zshdb-core)
  39. (declare-function realgud:run-debugger 'realgud:run)
  40. ; ### FIXME: DRY with other top-level routines
  41. ;;;###autoload
  42. (defun realgud:zshdb (&optional opt-cmd-line no-reset)
  43. "Invoke the zshdb Z-shell debugger and start the Emacs user interface.
  44. String OPT-CMD-LINE specifies how to run zshdb.
  45. OPT-CMD-LINE is treated like a shell string; arguments are
  46. tokenized by `split-string-and-unquote'. The tokenized string is
  47. parsed by `zshdb-parse-cmd-args' and path elements found by that
  48. are expanded using `realgud:expand-file-name-if-exists'.
  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. (let ((cmd-buf
  59. (realgud:run-debugger realgud:zshdb-command-name 'zshdb-query-cmdline
  60. 'zshdb-parse-cmd-args
  61. 'realgud:zshdb-minibuffer-history
  62. opt-cmd-line no-reset)))
  63. ;; (if cmd-buf
  64. ;; (with-current-buffer cmd-buf
  65. ;; ;; FIXME should allow customization whether to do or not
  66. ;; ;; and also only do if hook is not already there.
  67. ;; (realgud:zshdb-remove-ansi-schmutz)
  68. ;; )
  69. ;; )
  70. ))
  71. ;;;###autoload
  72. (defalias 'zshdb 'realgud:zshdb)
  73. (provide-me "realgud-")