Rearrange db/debug initfiles

This commit is contained in:
Henrik Lissner 2016-07-19 15:01:38 -04:00
parent 9ee28fda89
commit 8b83c03782
7 changed files with 53 additions and 50 deletions

6
Cask
View file

@ -127,9 +127,8 @@
;;(depends-on "helm-projectile")
;;(depends-on "helm-swoop")
;; Code evaluation/REPLs/debug -- core/core-eval.el
;; Code evaluation/REPLs -- core/core-eval.el
(depends-on "quickrun")
(depends-on "realgud")
(depends-on "repl-toggle")
;; Sessions --- core/core-sessions.el
@ -288,3 +287,6 @@
;; Writing -- modules/custom-write.el
; (depends-on "helm-bibtex")
;; Debugging -- modules/custom-debug.el
(depends-on "realgud")

View file

@ -1,9 +1,7 @@
;;; core-eval.el
;; + Running inline code + REPLs (using `quickrun' + `repl-toggle')
;; + Almost-universal debugging (with `realgud')
;; + Simple code navigation (using `dump-jump' and `imenu-list')
;; + A universal tags config (WIP)
;; remove ellipsis when printing sexp in message buffer
(setq eval-expression-print-length nil
@ -47,43 +45,5 @@
:ei "<down>" 'comint-next-input
:ei "<up>" 'comint-previous-input))
;;
(after! debug
;; For elisp debugging
(map! :map debugger-mode-map
:n "RET" 'debug-help-follow
:n "n" 'debugger-step-through
:n "c" 'debugger-continue))
(use-package realgud
:commands (realgud:gdb realgud:trepanjs realgud:bashdb realgud:zshdb)
:config
(map! :map realgud:shortkey-mode-map
:n "j" 'evil-next-line
:n "k" 'evil-previous-line
:n "h" 'evil-backward-char
:n "l" 'evil-forward-char
:m "n" 'realgud:cmd-next
:m "b" 'realgud:cmd-break
:m "B" 'realgud:cmd-clear
:n "c" 'realgud:cmd-continue)
;; Popup rules
(def-popup! "\\`\\*\\(g\\|zsh\\|bash\\)db.*?\\*\\'" :size 20 :regexp t)
(def-popup! "\\`\\*trepanjs.*?\\*\\'" :size 20 :regexp t)
;; Temporary Ex commands for the debugger
(def-tmp-excmd! doom:def-debug-on doom:def-debug-off
("n[ext]" . realgud:cmd-next)
("s[tep]" . realgud:cmd-step)
("b[reak]" . doom:debug-toggle-breakpoint)
("c[ontinue]" . realgud:cmd-continue))
;; TODO does this work with shackle?
(advice-add 'realgud-cmdbuf-init :after 'doom:def-debug-on)
(advice-add 'realgud:cmd-quit :after 'doom:def-debug-off)
;; Monkey-patch `realgud:run-process' to run in a popup.
(advice-add 'realgud:run-process :override 'doom*realgud:run-process))
(provide 'core-eval)
;;; core-eval.el ends here

10
init.el
View file

@ -50,7 +50,7 @@
core-vcs ; remember remember, that commit in November
core-ivy ; a search engine for life and love
core-workgroups ; cure Emacs alzheimers + tab emulation
core-eval ; run code, run; debug too
core-eval ; run code, run + REPL support
;;; Dev environments
module-cc ; C/C++/Obj-C madness
@ -58,7 +58,6 @@
module-csharp ; unity, .NET, and mono shenanigans
module-css ; #big-bang::before { content: ""; }
module-data ; config/data formats
module-db ; using emacs as a db browser/client
module-elisp ; drowning in parentheses
module-eshell ; so I can have a sane shell, even in Windows
module-go ; the hipster dialect
@ -69,7 +68,7 @@
module-latex ; for writing papers in Emacs
module-lua ; one-based indices? one-based indices.
module-php ; making php less painful to work with
module-processing ; pretty prototypes
module-processing ; for prototyping
module-python ; beautiful is better than ugly
module-rest ; Emacs as a service
module-ruby ; 1.step do {|i| p "Ruby is #{i&1==0?'love':'life'}"}
@ -80,11 +79,12 @@
module-text ; writing docs for people to ignore
module-web ; The end is always near </html>
;;; Experimental
module-eshell ; for inferior OSes *cough*windows
;;; Org
module-org ; for organized fearless leader
;;; Custom modules
custom-db ; emacs as a db browser/client
custom-debug ; nigh-universal debugging
custom-demo ; allow me to demonstrate...
custom-tags ; if you liked it you should've generated a tag for it
custom-tmux ; close the rift between GUI & terminal

View file

@ -1,4 +1,4 @@
;;; module-db.el
;;; custom-db.el
(use-package sql-mode
:mode "\\.sql$"
@ -39,5 +39,5 @@ open comint."
(sql-product-interactive product 0)
(message "Started new %s connection" product)))))
(provide 'module-db)
;;; module-db.el ends here
(provide 'custom-db)
;;; custom-db.el ends here

41
modules/custom-debug.el Normal file
View file

@ -0,0 +1,41 @@
;;; custom-debug.el --- debugging with `realgud'
(after! debug
;; For elisp debugging
(map! :map debugger-mode-map
:n "RET" 'debug-help-follow
:n "n" 'debugger-step-through
:n "c" 'debugger-continue))
(use-package realgud
:commands (realgud:gdb realgud:trepanjs realgud:bashdb realgud:zshdb)
:config
(map! :map realgud:shortkey-mode-map
:n "j" 'evil-next-line
:n "k" 'evil-previous-line
:n "h" 'evil-backward-char
:n "l" 'evil-forward-char
:m "n" 'realgud:cmd-next
:m "b" 'realgud:cmd-break
:m "B" 'realgud:cmd-clear
:n "c" 'realgud:cmd-continue)
;; Popup rules
(def-popup! "\\`\\*\\(g\\|zsh\\|bash\\)db.*?\\*\\'" :size 20 :regexp t)
(def-popup! "\\`\\*trepanjs.*?\\*\\'" :size 20 :regexp t)
;; Temporary Ex commands for the debugger
(def-tmp-excmd! doom:def-debug-on doom:def-debug-off
("n[ext]" . realgud:cmd-next)
("s[tep]" . realgud:cmd-step)
("b[reak]" . doom:debug-toggle-breakpoint)
("c[ontinue]" . realgud:cmd-continue))
;; TODO does this work with shackle?
(advice-add 'realgud-cmdbuf-init :after 'doom:def-debug-on)
(advice-add 'realgud:cmd-quit :after 'doom:def-debug-off)
;; Monkey-patch `realgud:run-process' to run in a popup.
(advice-add 'realgud:run-process :override 'doom*realgud:run-process))
(provide 'custom-debug)
;;; custom-debug.el ends here