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.

71 lines
2.5 KiB

  1. ;; Copyright (C) 2011, 2014-2016, 2019 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. ;; `kshdb' Main interface to kshdb via Emacs
  8. (require 'load-relative)
  9. (require-relative-list '("../../common/helper") "realgud-")
  10. (require-relative-list '("../../common/track") "realgud-")
  11. (require-relative-list '("core" "track-mode") "realgud:kshdb-")
  12. ;; This is needed, or at least the docstring part of it is needed to
  13. ;; get the customization menu to work in Emacs 24.
  14. (defgroup realgud:kshdb nil
  15. "The realgud interface to the Korn shell debugger, kshdb"
  16. :group 'realgud
  17. :version "25.1")
  18. ;; -------------------------------------------------------------------
  19. ;; User definable variables
  20. ;;
  21. (defcustom realgud:kshdb-command-name
  22. ;;"kshdb --emacs 3"
  23. "kshdb"
  24. "File name for executing the kshdb and its command options.
  25. This should be an executable on your path, or an absolute file name."
  26. :type 'string
  27. :group 'realgud:kshdb)
  28. (declare-function kshdb-track-mode (bool))
  29. (declare-function kshdb-query-cmdline 'realgud:kshdb-core)
  30. (declare-function kshdb-parse-cmd-args 'realgud:kshdb-core)
  31. (declare-function realgud:run-process 'realgud-run)
  32. ;; -------------------------------------------------------------------
  33. ;; The end.
  34. ;;
  35. ;;;###autoload
  36. (defun realgud:kshdb (&optional opt-command-line no-reset)
  37. "Invoke the Korn shell debugger, kshdb, and start the Emacs user interface.
  38. String COMMAND-LINE specifies how to run kshdb.
  39. Normally command buffers are reused when the same debugger is
  40. reinvoked inside a command buffer with a similar command. If we
  41. discover that the buffer has prior command-buffer information and
  42. NO-RESET is nil, then that information which may point into other
  43. buffers and source buffers which may contain marks and fringe or
  44. marginal icons is reset."
  45. (interactive)
  46. (let* ((cmd-str (or opt-command-line (kshdb-query-cmdline "kshdb")))
  47. (cmd-args (split-string-and-unquote cmd-str))
  48. (parsed-args (kshdb-parse-cmd-args cmd-args))
  49. (script-args (cdr cmd-args))
  50. (script-name (car script-args))
  51. (cmd-buf))
  52. (realgud:run-process "kshdb" script-name cmd-args
  53. 'realgud:kshdb-minibuffer-history
  54. no-reset)
  55. ))
  56. ;;;###autoload
  57. (defalias 'kshdb 'realgud:kshdb)
  58. (provide-me "realgud-")
  59. ;;; kshdb.el ends here