[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 1e2fe55 098/215: Add rspec loc pattern..
From: |
Rocky Bernstein |
Subject: |
[elpa] master 1e2fe55 098/215: Add rspec loc pattern.. |
Date: |
Sat, 30 Jul 2016 14:48:57 +0000 (UTC) |
branch: master
commit 1e2fe5515c119a153a8f6bdf174ccfa291260a77
Author: rocky <address@hidden>
Commit: rocky <address@hidden>
Add rspec loc pattern..
.. in the never-ending battle of again location reporting originality
init.el: DRY
---
realgud/common/backtrack-mode.el | 2 +-
realgud/debugger/rdebug/init.el | 2 +-
realgud/debugger/trepan/init.el | 17 ++++++-----------
realgud/lang/ruby.el | 17 +++++++++++++++++
4 files changed, 25 insertions(+), 13 deletions(-)
diff --git a/realgud/common/backtrack-mode.el b/realgud/common/backtrack-mode.el
index 2a48f2a..aaf89c9 100644
--- a/realgud/common/backtrack-mode.el
+++ b/realgud/common/backtrack-mode.el
@@ -61,7 +61,7 @@ debugger with that information"
(let* ((base-variable-name
(or (gethash debugger-name realgud:variable-basename-hash)
debugger-name))
- (specific-track-mode (intern (concat prefix "-backtrack-mode")))
+ (specific-track-mode (intern (concat base-variable-name
"-backtrack-mode")))
)
(if (and (not (eval specific-track-mode))
(functionp specific-track-mode))
diff --git a/realgud/debugger/rdebug/init.el b/realgud/debugger/rdebug/init.el
index 3f0021f..7dc6fb3 100644
--- a/realgud/debugger/rdebug/init.el
+++ b/realgud/debugger/rdebug/init.el
@@ -132,4 +132,4 @@ realgud-loc-pat struct")
(setf (gethash "shell" realgud-rdebug-command-hash) "irb")
(setf (gethash "rdebug" realgud-command-hash) realgud-rdebug-command-hash)
-(provide-me "realgud-rdebug-")
+2(provide-me "realgud-rdebug-")
diff --git a/realgud/debugger/trepan/init.el b/realgud/debugger/trepan/init.el
index 2da793e..f2148fa 100644
--- a/realgud/debugger/trepan/init.el
+++ b/realgud/debugger/trepan/init.el
@@ -47,18 +47,13 @@ realgud-loc-pat struct")
(setf (gethash "syntax-error" realgud:trepan-pat-hash)
realgud-ruby-YARV-syntax-error-pat)
-;; Regular expression that describes a Ruby YARV 1.9 backtrace line.
-;; For example:
-;; <internal:lib/rubygems/custom_require>:29:in `require'
-;; <internal:lib/rubygems/custom_require>:29:in `require'
-;; /tmp/Rakefile:50:in `<top /src/external-vcs/laser/Rakefile>'
-;; from /usr/lib/ruby/gems/rspec/compatibility.rb:6:in `const_missing'
+;; Regular expression that describes a Ruby YARV backtrace line.
+;; For example:
+;; from /ruby/gems/2.2.0/gems/fog-1.32.0/lib/fog/digitalocean.rb:1:in
`<top (required)>'
+;; from /Users/fog-1.32.0/lib/fog.rb:28:in `require'
(setf (gethash "lang-backtrace" realgud:trepan-pat-hash)
- (make-realgud-loc-pat
- :regexp "^\\(?:[\t]from \\)?\\([^:]+\\):\\([0-9]+\\)\\(?:in `.*'\\)?"
- :file-group 1
- :line-group 2))
-
+ realgud-ruby-backtrace-loc-pat)
+
;; Regular expression that describes a ruby $! backtrace
(setf (gethash "dollar-bang-backtrace" realgud:trepan-pat-hash)
realgud-ruby-dollar-bang-loc-pat)
diff --git a/realgud/lang/ruby.el b/realgud/lang/ruby.el
index aa1ffa4..6c11cc4 100644
--- a/realgud/lang/ruby.el
+++ b/realgud/lang/ruby.el
@@ -16,6 +16,14 @@
"A realgud-loc-pat struct that describes a Rails backtrace (or
traceback) line." )
+(defconst realgud-rspec-backtrace-loc-pat
+ (make-realgud-loc-pat
+ :regexp "^[ ]*# \\([^:]+\\):\\([0-9]+\\)\\(?:[:]in `.*'\\)?"
+ :file-group 1
+ :line-group 2)
+ "A realgud-loc-pat struct that describes an rspec backtrace (or
+traceback) line." )
+
;; Regular expression that describes a Ruby YARV 1.9 syntax error line.
;; SyntaxError: /tmp/columnize.rb:270: syntax error, unexpected $end, ...
(defconst realgud-ruby-YARV-syntax-error-pat
@@ -65,6 +73,14 @@ described by PT."
(interactive "d")
(realgud-goto-line-for-pt pt "rails-backtrace"))
+;; FIXME: there is probably a less redundant way to do the following
+;; FNS.
+(defun realgud:rspec-goto-backtrace-line (pt)
+ "Display the location mentioned by the Rails backtrace line
+described by PT."
+ (interactive "d")
+ (realgud-goto-line-for-pt pt "rspec-backtrace"))
+
(defun realgud:rubinius-goto-Xagent-backtrace-line (pt)
"Display the location mentioned by the Rubinius Xagent- backtrace line
described by PT."
@@ -91,6 +107,7 @@ described by PT."
(define-key map (kbd "C-c !!") 'realgud:ruby-goto-dollar-bang-line)
(define-key map (kbd "C-c !b") 'realgud:goto-debugger-backtrace-line)
(define-key map (kbd "C-c !r") 'realgud:rails-goto-backtrace-line)
+ (define-key map (kbd "C-c !s") 'realgud:rspec-goto-backtrace-line)
)
- [elpa] master b275bd2 119/215: Improve behavior of delete, enable, and disable, (continued)
- [elpa] master b275bd2 119/215: Improve behavior of delete, enable, and disable, Rocky Bernstein, 2016/07/30
- [elpa] master ca33520 120/215: Add a prefix arg to "continue" command, Rocky Bernstein, 2016/07/30
- [elpa] master 379528b 106/215: Disable ipdb until melpa is updated, Rocky Bernstein, 2016/07/30
- [elpa] master e049c12 124/215: Merge pull request #89 from cpitclaudel/87-improve-delete-command, Rocky Bernstein, 2016/07/30
- [elpa] master 91704f9 141/215: Automatically attach to a command buffer when enabling short-key-mode, Rocky Bernstein, 2016/07/30
- [elpa] master 40e73bc 123/215: Merge pull request #92 from cpitclaudel/82-add-safe-mode, Rocky Bernstein, 2016/07/30
- [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 <=
- [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, 2016/07/30
- [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