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.

87 lines
3.0 KiB

  1. ;; Copyright (C) 2015 Free Software Foundation, Inc
  2. ;; Author: Rocky Bernstein <rocky@gnu.org>
  3. ;; This program is free software: you can redistribute it and/or
  4. ;; modify it under the terms of the GNU General Public License as
  5. ;; published by the Free Software Foundation, either version 3 of the
  6. ;; License, or (at your option) any later version.
  7. ;; This program is distributed in the hope that it will be useful, but
  8. ;; WITHOUT ANY WARRANTY; without even the implied warranty of
  9. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. ;; General Public License for more details.
  11. ;; You should have received a copy of the GNU General Public License
  12. ;; along with this program. If not, see
  13. ;; <http://www.gnu.org/licenses/>.
  14. ;; `gub' Main interface to Go gub via Emacs
  15. (require 'load-relative)
  16. (require-relative-list '("../../common/helper") "realgud-")
  17. (require-relative-list '("../../common/track") "realgud-")
  18. (require-relative-list '("core" "track-mode") "realgud:gub-")
  19. (eval-when-compile (require 'cl-lib))
  20. ;; This is needed, or at least the docstring part of it is needed to
  21. ;; get the customization menu to work in Emacs 24.
  22. (defgroup realgud:gub nil
  23. "The realgud interface to the Go SSA interpreter debugger, gub"
  24. :group 'realgud
  25. :version "23.4")
  26. ;; -------------------------------------------------------------------
  27. ;; User definable variables
  28. ;;
  29. (defcustom realgud:gub-command-name
  30. "tortoise -run -gub= -interp=SS --"
  31. "File name for executing the Go SSA interpreter/debugger, gub, and command options.
  32. This should be an executable on your path, or an absolute file name."
  33. :type 'string
  34. :group 'realgud:gub)
  35. (declare-function gub-query-cmdline 'realgud-gub-core)
  36. (declare-function gub-parse-cmd-args 'realgud-gub-core)
  37. (declare-function realgud:run-process 'realgud-core)
  38. (defun realgud-gub-fn (&optional opt-command-line no-reset)
  39. "See `realgud-gub' for details"
  40. (let* ((cmd-str (or opt-command-line (gub-query-cmdline "gub")))
  41. (cmd-args (split-string-and-unquote cmd-str))
  42. (parsed-args (gub-parse-cmd-args cmd-args))
  43. (gub-program (car parsed-args))
  44. (gub-args (cadr parsed-args))
  45. (go-prog-and-args (cl-caddr parsed-args))
  46. (script-filename (car go-prog-and-args))
  47. (cmd-buf))
  48. (realgud:run-process gub-program script-filename cmd-args
  49. 'gub-track-mode no-reset)
  50. )
  51. )
  52. ;;;###autoload
  53. (defun realgud-gub (&optional opt-command-line no-reset)
  54. "Invoke the Go SSA debugger, gub and start the Emacs user interface.
  55. String COMMAND-LINE specifies how to run gub.
  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."
  62. (interactive)
  63. (realgud-gub-fn opt-command-line no-reset)
  64. )
  65. ;;;###autoload
  66. (defalias 'gub 'realgud-gub)
  67. (provide-me "realgud-")
  68. ;;; gub.el ends here