]> code.delx.au - gnu-emacs-elpa/commitdiff
remake/init.el: Try source line tracking
authorrocky <rocky@gnu.org>
Thu, 25 Sep 2014 07:30:43 +0000 (03:30 -0400)
committerrocky <rocky@gnu.org>
Thu, 25 Sep 2014 07:30:43 +0000 (03:30 -0400)
*: realgud-track-from-region -> realgud:track-from-region
track.el: correct garbled message to something grammatically correct but sometimes still garbled.

realgud/common/track.el
realgud/debugger/remake/init.el
test/test-track.el

index ff32b72349d287788e77d0d902bf3fc1c8c8c28d..7f1971970e6185dbf058882c57d64b6b3782bf37 100644 (file)
@@ -96,9 +96,9 @@ marks set in buffer-local variables to extract text"
          ;; Done with using old command buffer's last-input-end.
          ;; Update that for next time.
          (realgud-cmdbuf-info-last-input-end= last-output-start)
-         (realgud-track-from-region last-output-start
-                                 last-output-end cmd-mark cmd-buff
-                                 't 't))
+         (realgud:track-from-region last-output-start
+                                    last-output-end cmd-mark cmd-buff
+                                    't 't))
        )
     )
   )
@@ -112,7 +112,7 @@ marks set in buffer-local variables to extract text"
   (if realgud-track-mode
       (lexical-let* ((cmd-buff (current-buffer))
                     (cmd-mark (point-marker))
-                    (loc (realgud-track-from-region eshell-last-output-start
+                    (loc (realgud:track-from-region eshell-last-output-start
                                                  eshell-last-output-end cmd-mark)))
        (realgud-track-loc-action loc cmd-buff 't)))
   )
@@ -127,8 +127,8 @@ marks set in buffer-local variables to extract text"
       (realgud-track-loc text (point-marker))
     ))
 
-(defun realgud-track-from-region(from to &optional cmd-mark opt-cmdbuf
-                                  shortkey-on-tracing? no-warn-if-no-match?)
+(defun realgud:track-from-region(from to &optional cmd-mark opt-cmdbuf
+                                     shortkey-on-tracing? no-warn-if-no-match?)
   "Find and position a buffer at the location found in the marked region.
 
 You might want to use this function interactively after marking a
@@ -359,7 +359,8 @@ Otherwise return nil."
            (if (string-match loc-regexp text)
                (let* ((filename (match-string file-group text))
                       (line-str   (match-string line-group text))
-                      (source-str (match-string text-group text))
+                      (source-str (and text-group
+                                       (match-string text-group text)))
                       (lineno (string-to-number (or line-str "1"))))
                  (unless line-str (message "line number not found -- using 1"))
                  (if (and filename lineno)
@@ -368,7 +369,7 @@ Otherwise return nil."
                                                  ignore-file-re)
                    nil))
              (unless no-warn-on-no-match?
-               (message "Unable to file and line number for given line"))
+               (message "Unable to match file and line number"))
              )
          (and (message (concat "Buffer variable for regular expression pattern not"
                                " given and not passed as a parameter")) nil)))
index 65505223a2e14cc573bad0f0bb5facb2e6e52735..d2888c18389a9ad3327c9b3be39e3e47da0ea62a 100644 (file)
@@ -23,9 +23,10 @@ realgud-loc-pat struct")
 ;; -- (emacs-dbgr/realgud/debugger/Makefile:168)
 (setf (gethash "loc" realgud:remake-pat-hash)
       (make-realgud-loc-pat
-       :regexp "\\(?:^\\|\n\\)\\(?:.. \\)?(\\(\\(?:[a-zA-Z]:\\)?[-a-zA-Z0-9_/.\\\\ ]+\\):\\([0-9]+\\))"
+       :regexp "\\(?:^\\|\n\\)\\(?:.. \\)?(\\(\\(?:[a-zA-Z]:\\)?[-a-zA-Z0-9_/.\\\\ ]+\\):\\([0-9]+\\))\\(?:\n\\(.*?\\)\n\\)?"
        :file-group 1
-       :line-group 2))
+       :line-group 2
+       :text-group 3))
 
 ;; For example:
 ;;   remake<10>
index edba51cb9f521a7a5bc83bcb561db1da974ea195..7b6466a0a2431a71f610e2d2700bdd3c31111597 100644 (file)
@@ -9,7 +9,7 @@
 (declare-function realgud-loc-filename         'realgud-loc)
 (declare-function realgud-loc-p                'realgud-loc)
 (declare-function realgud-loc-line-number      'realgud-loc)
-(declare-function realgud-track-from-region    'realgud-track)
+(declare-function realgud:track-from-region    'realgud-track)
 (declare-function realgud-track-loc            'realgud-track)
 (declare-function realgud-track-loc-remaining  'realgud-track)
 (declare-function realgud-track-selected-frame 'realgud-track)
@@ -108,7 +108,7 @@ trepan: That's all, folks...
 
 (makunbound 'realgud-cmdbuf-info)
 (assert-raises error
-              (realgud-track-from-region (point-min)
+              (realgud:track-from-region (point-min)
                                       (point-max))
               "invalid cmdbuf")