[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 549f6f0 135/215: Merge pull request #98 from rocky/83-bett
From: |
Rocky Bernstein |
Subject: |
[elpa] master 549f6f0 135/215: Merge pull request #98 from rocky/83-better-scope-keybindings |
Date: |
Sat, 30 Jul 2016 14:49:00 +0000 (UTC) |
branch: master
commit 549f6f099b8621ceca371d144ebd891a7389d327
Merge: f7947aa d2b8d13
Author: R. Bernstein <address@hidden>
Commit: R. Bernstein <address@hidden>
Merge pull request #98 from rocky/83-better-scope-keybindings
Fix 83 and 88: refactor cmds.el
---
realgud.el | 4 +-
realgud/common/cmds.el | 74 ++++++++++++++++++---------------
realgud/common/key.el | 5 +++
realgud/debugger/nodejs/init.el | 2 +-
realgud/debugger/nodejs/track-mode.el | 10 -----
realgud/debugger/perldb/track-mode.el | 7 ----
realgud/debugger/remake/track-mode.el | 1 -
realgud/debugger/zshdb/track-mode.el | 1 -
8 files changed, 48 insertions(+), 56 deletions(-)
diff --git a/realgud.el b/realgud.el
index 9c0cdad..066255f 100644
--- a/realgud.el
+++ b/realgud.el
@@ -1,7 +1,7 @@
;;; realgud.el --- A modular front-end for interacting with external debuggers
;; Author: Rocky Bernstein
-;; Version: 1.3
+;; Version: 1.3.1
;; Package-Requires: ((load-relative "1.0") (list-utils "0.4.2") (loc-changes
"1.1") (test-simple "1.0"))
;; URL: http://github.com/rocky/emacs-dbgr
;; Compatibility: GNU Emacs 24.x
@@ -48,7 +48,7 @@
;; The debuggers we currently support are:
;; NAME INVOCATION** WHAT
-; -----------------------------------
+;; -----------------------------------
;; bashdb bashdb bash
;; Devel::Trepan trepan.pl Perl5
;; gdb realgud:gdb gdb
diff --git a/realgud/common/cmds.el b/realgud/common/cmds.el
index f2f0e31..9516345 100644
--- a/realgud/common/cmds.el
+++ b/realgud/common/cmds.el
@@ -49,9 +49,9 @@ when command was run from a menu."
t)
t))
-(defun realgud:cmd-remap(arg cmd-name default-cmd-template key
- &optional no-record? frame-switch?
- realgud-prompts?)
+(defun realgud:cmd-run-command(arg cmd-name default-cmd-template
+ &optional no-record? frame-switch?
+ realgud-prompts?)
"Run debugger command CMD-NAME using DEFAULT-CMD-TEMPLATE
if none has been set in the command hash. If key is given we'll set
a shortcut for that key."
@@ -81,29 +81,38 @@ a shortcut for that key."
;; (message "recentering...")
;; (realgud-recenter-arrow)
;; ))
- )
- ;; FIXME: this is a one-time thing. Put in caller.
- (if key
- (local-set-key (format "\C-c%s" key)
- (intern (format "realgud:cmd-%s" cmd-name))))
+ )
)
))
+(defun realgud:cmd-remap (arg cmd-name default-cmd-template
+ &optional key no-record? frame-switch?
+ realgud-prompts?)
+ "Compatibility alias for `realgud:cmd-run-command'.
+ARG, CMD-NAME, DEFAULT-CMD-TEMPLATE are as in `realgud:cmd-run-command'.
+KEY is ignored. NO-RECORD?, FRAME-SWITCH?, REALGUD-PROMPTS? are
+as in `realgud:cmd-run-command'."
+ (realgud:cmd-run-command arg cmd-name default-cmd-template
+ no-record? frame-switch?
+ realgud-prompts?))
+
+(make-obsolete 'realgud:cmd-remap 'realgud:cmd-run-command "1.3.1")
+
(defun realgud:cmd-backtrace(arg)
"Show the current call stack"
(interactive "p")
- (realgud:cmd-remap arg "backtrace" "backtrace" "T")
+ (realgud:cmd-run-command arg "backtrace" "backtrace")
)
(defun realgud:cmd-break(arg)
"Set a breakpoint at the current line"
(interactive "p")
- (realgud:cmd-remap arg "break" "break %X:%l" "b"))
+ (realgud:cmd-run-command arg "break" "break %X:%l"))
(defun realgud:cmd-clear(line-num)
"Delete breakpoint at the current line"
(interactive "p")
- (realgud:cmd-remap line-num "clear" "clear %l" "X"))
+ (realgud:cmd-run-command line-num "clear" "clear %l"))
(defun realgud:cmd-continue(&optional arg)
"Continue execution.
@@ -114,7 +123,7 @@ running."
(list (read-string "Continue args: " nil nil nil t))))
(when (or arg (realgud:prompt-if-safe-mode
"Continue to next breakpoint?"))
- (realgud:cmd-remap arg "continue" "continue" "c")))
+ (realgud:cmd-run-command arg "continue" "continue")))
(defun realgud:bpnum-on-current-line()
"Return number of one breakpoint on current line, if any.
@@ -142,7 +151,7 @@ numeric prefix argument, delete breakpoint with that number
instead. With prefix argument (C-u), or when no breakpoint can
be found on the current line, prompt for a breakpoint number."
(interactive (realgud:bpnum-from-prefix-arg))
- (realgud:cmd-remap bpnum "delete" "delete %p" "D"))
+ (realgud:cmd-run-command bpnum "delete" "delete %p"))
(defun realgud:cmd-disable(bpnum)
"Disable breakpoint BPNUM.
@@ -151,7 +160,7 @@ numeric prefix argument, disable breakpoint with that number
instead. With prefix argument (C-u), or when no breakpoint can
be found on the current line, prompt for a breakpoint number."
(interactive (realgud:bpnum-from-prefix-arg))
- (realgud:cmd-remap bpnum "disable" "disable %p" "-"))
+ (realgud:cmd-run-command bpnum "disable" "disable %p"))
(defun realgud:cmd-enable(bpnum)
"Enable breakpoint BPNUM.
@@ -160,21 +169,19 @@ numeric prefix argument, enable breakpoint with that
number
instead. With prefix argument (C-u), or when no breakpoint can
be found on the current line, prompt for a breakpoint number."
(interactive (realgud:bpnum-from-prefix-arg))
- (realgud:cmd-remap bpnum "enable" "enable %p" "+"))
+ (realgud:cmd-run-command bpnum "enable" "enable %p"))
(defun realgud:cmd-eval(arg)
"Evaluate an expression."
(interactive "MEval expesssion: ")
- (realgud:cmd-remap arg "eval" "eval %s" "e")
+ (realgud:cmd-run-command arg "eval" "eval %s")
)
(defun realgud:cmd-eval-region(start end)
"Evaluate current region."
(interactive "r")
(let ((text (buffer-substring-no-properties start end)))
- (realgud:cmd-remap text "eval" "eval %s" "e")
- )
- )
+ (realgud:cmd-run-command text "eval" "eval %s")))
(defun realgud:cmd-eval-dwim()
"Eval the current region if active; otherwise, prompt."
@@ -187,30 +194,29 @@ be found on the current line, prompt for a breakpoint
number."
"Run until the completion of the current stack frame.
This command is often referred to as 'step out' as opposed to
-'step over' or 'step into'.
-"
+'step over' or 'step into'."
(interactive "p")
- (realgud:cmd-remap arg "finish" "finish" ".")
+ (realgud:cmd-run-command arg "finish" "finish")
)
(defun realgud:cmd-frame(arg)
"Change the current frame number to the value of the numeric argument.
If no argument specified use 0 or the most recent frame."
(interactive "p")
- (realgud:cmd-remap arg "frame" "frame %p" "f" t t)
+ (realgud:cmd-run-command arg "frame" "frame %p" t t)
)
(defun realgud:cmd-kill(arg)
"kill debugger process"
(interactive "p")
- (realgud:cmd-remap arg "kill" "kill" "k" nil nil 't)
+ (realgud:cmd-run-command arg "kill" "kill" nil nil t)
)
(defun realgud:cmd-newer-frame(&optional arg)
"Move the current frame to a newer (more recent) frame.
With a numeric argument move that many levels forward."
(interactive "p")
- (realgud:cmd-remap arg "down" "down %p" "<" t t)
+ (realgud:cmd-run-command arg "down" "down %p" "<" t t)
)
(defun realgud:cmd-next(&optional arg)
@@ -224,7 +230,7 @@ The definition of 'next' is debugger specific so, see the
debugger documentation for a more complete definition of what is
getting stepped."
(interactive "p")
- (realgud:cmd-remap arg "next" "next %p" "n")
+ (realgud:cmd-run-command arg "next" "next %p")
)
(defun realgud:cmd-next-no-arg(&optional arg)
@@ -234,32 +240,32 @@ The definition of 'next' is debugger specific so, see the
debugger documentation for a more complete definition of what is
getting stepped."
(interactive)
- (realgud:cmd-remap nil "next" "next" "n")
+ (realgud:cmd-run-command nil "next" "next")
)
(defun realgud:cmd-older-frame(&optional arg)
"Move the current frame to an older (less recent) frame.
With a numeric argument move that many levels back."
(interactive "p")
- (realgud:cmd-remap arg "up" "up %p" ">" t t)
+ (realgud:cmd-run-command arg "up" "up %p" t t)
)
(defun realgud:cmd-repeat-last(&optional arg)
"Repeat the last command (or generally what <enter> does."
(interactive "")
- (realgud:cmd-remap arg "repeat-last" "\n" "." 't nil 't)
+ (realgud:cmd-run-command arg "repeat-last" "\n" t nil t)
)
(defun realgud:cmd-restart(&optional arg)
"Restart execution."
(interactive "")
- (realgud:cmd-remap arg "restart" "run" "R" 't nil 't)
+ (realgud:cmd-run-command arg "restart" "run" t nil t)
)
(defun realgud:cmd-shell(&optional arg)
"Drop to a shell."
(interactive "")
- (realgud:cmd-remap arg "shell" "shell" "S")
+ (realgud:cmd-run-command arg "shell" "shell")
)
(defun realgud:cmd-step(&optional arg)
@@ -273,7 +279,7 @@ The definition of 'step' is debugger specific so, see the
debugger documentation for a more complete definition of what is
getting stepped."
(interactive "p")
- (realgud:cmd-remap arg "step" "step %p" "s")
+ (realgud:cmd-run-command arg "step" "step %p")
)
(defun realgud:cmd-step-no-arg()
@@ -283,7 +289,7 @@ The definition of 'step' is debugger specific so, see the
debugger documentation for a more complete definition of what is
getting stepped."
(interactive)
- (realgud:cmd-remap nil "step" "step" "s")
+ (realgud:cmd-run-command nil "step" "step")
)
(defun realgud:cmd-terminate ()
@@ -303,7 +309,7 @@ Continue until the current line. In some cases this is
really
two commands - setting a temporary breakpoint on the line and
continuing execution."
(interactive "p")
- (realgud:cmd-remap arg "until" "until" "u")
+ (realgud:cmd-run-command arg "until" "until")
)
(defun realgud:cmd-quit (&optional arg)
diff --git a/realgud/common/key.el b/realgud/common/key.el
index a7bd912..19dd397 100644
--- a/realgud/common/key.el
+++ b/realgud/common/key.el
@@ -105,6 +105,10 @@ Nor does it touch prefix keys; for that see
`realgud-populate-keys-standard'"
(let ((prefix-map (make-sparse-keymap)))
(define-key map "b" 'realgud:cmd-break)
(define-key map "D" 'realgud:cmd-delete)
+ (define-key map "X" 'realgud:cmd-clear)
+ (define-key map "-" 'realgud:cmd-disable)
+ (define-key map "+" 'realgud:cmd-enable)
+ (define-key map "T" 'realgud:cmd-backtrace)
(define-key map [delete] 'realgud:cmd-delete)
(define-key map [enter] 'realgud:cmd-repeat-last)
(define-key map (kbd "RET") 'realgud:cmd-repeat-last)
@@ -112,6 +116,7 @@ Nor does it touch prefix keys; for that see
`realgud-populate-keys-standard'"
(define-key map "f" 'realgud:cmd-finish)
(define-key map "n" 'realgud:cmd-next)
(define-key map "q" 'realgud:cmd-quit)
+ (define-key map "k" 'realgud:cmd-kill)
(define-key map "r" 'realgud:cmd-restart)
(define-key map "R" 'realgud:cmd-restart)
(define-key map "s" 'realgud:cmd-step)
diff --git a/realgud/debugger/nodejs/init.el b/realgud/debugger/nodejs/init.el
index 9712b75..118eb22 100644
--- a/realgud/debugger/nodejs/init.el
+++ b/realgud/debugger/nodejs/init.el
@@ -148,7 +148,7 @@ realgud-loc-pat struct")
(setf (gethash "backtrace" realgud:nodejs-command-hash) "T")
(setf (gethash "break" realgud:nodejs-command-hash)
- "setBreakpoint(%l)")
+ "setBreakpoint('%X',%l)")
(setf (gethash "continue" realgud:nodejs-command-hash) "cont")
(setf (gethash "quit" realgud:nodejs-command-hash) "quit")
(setf (gethash "finish" realgud:nodejs-command-hash) "out")
diff --git a/realgud/debugger/nodejs/track-mode.el
b/realgud/debugger/nodejs/track-mode.el
index ff7465c..753e20d 100644
--- a/realgud/debugger/nodejs/track-mode.el
+++ b/realgud/debugger/nodejs/track-mode.el
@@ -28,7 +28,6 @@
(require-relative-list '("core" "init") "realgud:nodejs-")
;; (require-relative-list '("../../lang/js") "realgud-lang-")
-(declare-function realgud:cmd-remap 'realgud-cmds)
(declare-function realgud:track-set-debugger 'realgud-track-mode)
(declare-function realgud-track-mode-setup 'realgud-track-mode)
@@ -74,12 +73,6 @@ If called interactively with no prefix argument, the mode is
toggled. A prefix a
))
)
-(defun realgud:nodejs-set-break(arg)
- "Set a breakpoint at the current line"
- (interactive "p")
- (realgud:cmd-remap arg "break" "setBreakpoint('%X',%l)" "b")
- )
-
;; ;; Debugger commands that nodejs doesn't have
;; (define-key nodejs-track-mode-map
;; [remap realgud:cmd-newer-frame] 'undefined)
@@ -91,8 +84,5 @@ If called interactively with no prefix argument, the mode is
toggled. A prefix a
[remap realgud:cmd-step] 'realgud:cmd-step-no-arg)
(define-key nodejs-short-key-mode-map
[remap realgud:cmd-next] 'realgud:cmd-next-no-arg)
-(define-key nodejs-short-key-mode-map
- [remap realgud:cmd-break] 'realgud:nodejs-set-break)
-(define-key nodejs-short-key-mode-map "T" 'realgud:cmd-backtrace)
(provide-me "realgud:nodejs-")
diff --git a/realgud/debugger/perldb/track-mode.el
b/realgud/debugger/perldb/track-mode.el
index 3d27722..39c2ec7 100644
--- a/realgud/debugger/perldb/track-mode.el
+++ b/realgud/debugger/perldb/track-mode.el
@@ -30,7 +30,6 @@
(realgud-track-mode-vars "perldb")
-(declare-function realgud:cmd-remap 'realgud-cmds)
(declare-function realgud-perl-populate-command-keys
'realgud:perldb)
(declare-function realgud-track-mode 'realgud-track-mode)
@@ -72,16 +71,10 @@ If called interactively with no prefix argument, the mode
is toggled. A prefix a
))
)
-(defun realgud:perldb-backtrace(arg)
- (interactive "p")
- (realgud:cmd-remap arg "backtrace" "T" "T")
-)
-
;; Perldb doesn't have stack switching commands.
(define-key perldb-short-key-mode-map
[remap realgud:cmd-newer-frame] 'undefined)
(define-key perldb-short-key-mode-map
[remap realgud:cmd-older-frame] 'undefined)
-(define-key perldb-short-key-mode-map "T" 'realgud:perldb-backtrace)
(provide-me "realgud:perldb-")
diff --git a/realgud/debugger/remake/track-mode.el
b/realgud/debugger/remake/track-mode.el
index b2b6b97..8fae564 100644
--- a/realgud/debugger/remake/track-mode.el
+++ b/realgud/debugger/remake/track-mode.el
@@ -12,7 +12,6 @@
"realgud-")
(require-relative-list '("core" "init") "realgud:remake-")
-(declare-function realgud:cmd-remap 'realgud-cmds)
(declare-function realgud:track-set-debugger 'realgud-track-mode)
(declare-function realgud-track-mode-setup 'realgud-track-mode)
(declare-function realgud:track-set-debugger 'realgud-track-mode)
diff --git a/realgud/debugger/zshdb/track-mode.el
b/realgud/debugger/zshdb/track-mode.el
index fa2ffe5..9df126f 100644
--- a/realgud/debugger/zshdb/track-mode.el
+++ b/realgud/debugger/zshdb/track-mode.el
@@ -13,7 +13,6 @@
(require-relative-list '("core" "init") "realgud:zshdb-")
(require-relative "../../lang/posix-shell" nil "realgud-lang-")
-(declare-function realgud:cmd-remap 'realgud-cmds)
(declare-function realgud:track-set-debugger 'realgud-track-mode)
(declare-function realgud-track-mode-setup 'realgud-track-mode)
(declare-function realgud-posix-shell-populate-command-keys
- [elpa] master f3426ed 072/215: Merge branch 'master' of github.com:rocky/emacs-dbgr, (continued)
- [elpa] master f3426ed 072/215: Merge branch 'master' of github.com:rocky/emacs-dbgr, Rocky Bernstein, 2016/07/30
- [elpa] master 4e85910 088/215: Add pytest error message pattern in python debuggers, Rocky Bernstein, 2016/07/30
- [elpa] master 01617c5 100/215: ipdb: add regex test, Rocky Bernstein, 2016/07/30
- [elpa] master 5395757 091/215: More cleanup from last two commits., Rocky Bernstein, 2016/07/30
- [elpa] master 1e2fe55 098/215: Add rspec loc pattern.., Rocky Bernstein, 2016/07/30
- [elpa] master ea5dcba 094/215: ipdb: add new debugger based on pdb, Rocky Bernstein, 2016/07/30
- [elpa] master d1c1176 146/215: Simplify the implementation of realgud:cmdbuf-associate, Rocky Bernstein, 2016/07/30
- [elpa] master 95f076e 150/215: Improve IPDB completion, Rocky Bernstein, 2016/07/30
- [elpa] master d45788c 152/215: Merge pull request #106 from rocky/75-ipdb-completion, Rocky Bernstein, 2016/07/30
- [elpa] master 032ea4b 143/215: Merge branch 'master' of github.com:rocky/emacs-dbgr, Rocky Bernstein, 2016/07/30
- [elpa] master 549f6f0 135/215: Merge pull request #98 from rocky/83-better-scope-keybindings,
Rocky Bernstein <=
- [elpa] master aedea61 138/215: Merge pull request #101 from rocky/bp-icon-in-fringe, Rocky Bernstein, 2016/07/30
- [elpa] master 87d1ada 137/215: Refactor and improve breakpoint UI, Rocky Bernstein, 2016/07/30
- [elpa] master d6b879d 042/215: Merge branch 'trepanjs', Rocky Bernstein, 2016/07/30
- [elpa] master f3420e9 151/215: Merge pull request #105 from rocky/new-README, Rocky Bernstein, 2016/07/30
- [elpa] master 1c3d8c2 171/215: Add a bit of padding around the logo to make GitHub happy, Rocky Bernstein, 2016/07/30
- [elpa] master 678ec6b 139/215: Use `buffer-live-p' instead of `buffer-name' in `buffer-killed?', Rocky Bernstein, 2016/07/30
- [elpa] master daac75b 175/215: Add a C-u interface to break and clear, Rocky Bernstein, 2016/07/30
- [elpa] master fe679e9 077/215: Don't try source buffer initialization if it doesn't exist., Rocky Bernstein, 2016/07/30
- [elpa] master 3f08b2b 165/215: Update screenshot, Rocky Bernstein, 2016/07/30
- [elpa] master 4ac3ca2 147/215: Fill in missing bits of Cask file, Rocky Bernstein, 2016/07/30