emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/realgud 3630fef 121/140: keep history in attaching comm


From: Rocky Bernstein
Subject: [elpa] externals/realgud 3630fef 121/140: keep history in attaching command-buffers ...
Date: Sat, 25 May 2019 19:35:47 -0400 (EDT)

branch: externals/realgud
commit 3630fef6619f9f191a58308d9e0f04a52bde564a
Author: rocky <address@hidden>
Commit: rocky <address@hidden>

    keep history in attaching command-buffers ...
    
    track.el: using breakpoint locate-file function marks breakpoint now
    send.el: fix bug in handling %U
---
 realgud/common/attach.el |   7 ++-
 realgud/common/send.el   |   2 +-
 realgud/common/track.el  | 131 +++++++++++++++++++++++++++++------------------
 3 files changed, 85 insertions(+), 55 deletions(-)

diff --git a/realgud/common/attach.el b/realgud/common/attach.el
index fdd538d..957df80 100644
--- a/realgud/common/attach.el
+++ b/realgud/common/attach.el
@@ -29,7 +29,7 @@
 (declare-function realgud-srcbuf-init-or-update       'realgud-source)
 (declare-function realgud-short-key-mode-setup        'realgud-shortkey)
 
-;; (defvar realgud:attach-cmdbuf-history nil "minibuffer command buffer 
history list'.")
+(defvar realgud:attach-cmdbuf-history nil "attach command buffer history 
list'.")
 
 
 ;;;###autoload
@@ -61,8 +61,7 @@
    (list
     (completing-read "Choose a realgud command buffer: "
                     (realgud:attach-list-command-buffers) nil t nil
-                    nil nil)))
-                    ;; realgud:attach-cmdbuf-history (car-safe 
realgud:attach-cmdbuf-history))))
+                    'realgud:attach-cmdbuf-history nil)))
   (if (stringp cmdbuf) (setq cmdbuf (get-buffer cmdbuf)))
   (let* ((srcbuf (current-buffer))
         (shortkey-mode?))
@@ -72,7 +71,7 @@
       (unless (get-buffer-process (current-buffer))
        (warn "Can't find a process for command buffer %s" (current-buffer)))
       (setq shortkey-mode? (realgud-sget 'cmdbuf-info 'src-shortkey?)))
-    ;; (add-to-list 'realgud:attach-cmdbuf-history (buffer-name cmdbuf))
+    (add-to-list 'realgud:attach-cmdbuf-history (buffer-name cmdbuf))
     (realgud-cmdbuf-add-srcbuf srcbuf)
     (realgud-srcbuf-init-or-update srcbuf cmdbuf)
     (if shortkey-mode? (realgud-short-key-mode-setup 't)))
diff --git a/realgud/common/send.el b/realgud/common/send.el
index f1c6659..a6fb4ed 100644
--- a/realgud/common/send.el
+++ b/realgud/common/send.el
@@ -205,7 +205,7 @@ taken from current buffer, or OPT-BUFFER if non-nil.  Some
 
                ((eq key ?U)
                 (if (string-match src-file-name "^file://")
-                    (setq src-file-name (substring 7)))
+                    (setq src-file-name (substring src-file-name 7)))
                 (or (and src-file-name (expand-file-name src-file-name))
                     "*source-file-not-found-for-%X"))
 
diff --git a/realgud/common/track.el b/realgud/common/track.el
index f158d84..63cafa4 100644
--- a/realgud/common/track.el
+++ b/realgud/common/track.el
@@ -1,4 +1,4 @@
-;; Copyright (C) 2015-2018 Free Software Foundation, Inc
+;; Copyright (C) 2015-2019 Free Software Foundation, Inc
 
 ;; Author: Rocky Bernstein <address@hidden>
 
@@ -520,6 +520,7 @@ Otherwise return nil. CMD-MARK is set in the realgud-loc 
object created.
                  (file-group     (realgud-loc-pat-file-group loc-pat))
                  (line-group     (realgud-loc-pat-line-group loc-pat))
                  (text-group     (realgud-loc-pat-text-group loc-pat))
+                 (column-group   (realgud-loc-pat-column-group loc-pat))
                  (ignore-re-file-list (or opt-ignore-re-file-list
                                           (realgud-sget 'cmdbuf-info 
'ignore-re-file-list)))
                  (callback-loc-fn (realgud-sget 'cmdbuf-info 'callback-loc-fn))
@@ -535,67 +536,97 @@ Otherwise return nil. CMD-MARK is set in the realgud-loc 
object created.
                             (line-str (match-string line-group text))
                             (source-str (and text-group (match-string 
text-group text)))
                             (lineno (string-to-number (or line-str "1")))
+                            (column-str (and column-group (match-string 
column-group text)))
+                            (column (string-to-number (or column-str "1")))
                             (directory
                              (cond ((boundp 'starting-directory) 
starting-directory)
                                    (t nil)))
                             )
                        (cond (callback-loc-fn
-                              (setq found-func (funcall callback-loc-fn text
+                              (if (setq found-loc (funcall callback-loc-fn text
                                                         filename lineno 
source-str
-                                                        cmd-mark directory))
-                              (setq loc-pat-list nil))
-
-                             ('t
+                                                        cmd-mark directory 
column))
+                                  ;; FIXME: dry with code in 
realgud-track-bp-file-line
+                                  (let ((bp-list (realgud-sget 'cmdbuf-info 
'bp-list))
+                                        srcbuf)
+
+                                    ;; Add src buffer mentioned and set it 
possibly to go into shortkey mode
+                                    (setq srcbuf (realgud-loc-goto found-loc))
+                                    (realgud-cmdbuf-add-srcbuf srcbuf cmdbuf)
+                                    (realgud-srcbuf-init-or-update srcbuf 
cmdbuf)
+                                    (with-current-buffer srcbuf
+                                      (realgud-short-key-mode-setup
+                                       (or realgud-short-key-on-tracing? 
shortkey-mode?)
+                                       ))
+
+                                    ;; Add breakpoint to list of breakpoints
+                                    (with-current-buffer-safe (marker-buffer 
(realgud-loc-marker found-loc))
+                                      (realgud-bp-add-info found-loc))
+
+                                    (unless (member found-loc bp-list)
+                                      (realgud-cmdbuf-info-bp-list= (cons 
found-loc bp-list)))
+                                    )
+                                (setq loc-pat-list nil)))
+                             (t
                               (unless line-str
                                 (message "line number not found -- using 1"))
-                              (if (and filename lineno)
-                                  (let* ((directory
-                                          (cond ((boundp 'starting-directory) 
starting-directory)
-                                                (t nil)))
-                                         (srcbuf)
-                                         (loc-or-error
-                                          (realgud:file-loc-from-line
-                                           filename lineno
-                                           cmd-mark
-                                           source-str
-                                           (string-to-number bp-num)
-                                           nil directory
-                                           )))
-                                    (if (stringp loc-or-error)
-                                        (progn
-                                          (message loc-or-error)
-                                          ;; set to return nil
-                                          (setq found-loc nil)
-                                          (setq loc-pat-list nil))
-                                      ;; else
-                                      (let ((loc loc-or-error)
-                                            (bp-list (realgud-sget 
'cmdbuf-info 'bp-list)))
-
-                                        ;; Add src buffer mentioned and set it 
possibly to go into shortkey mode
-                                        (setq srcbuf (realgud-loc-goto loc))
-                                        (realgud-cmdbuf-add-srcbuf srcbuf 
cmdbuf)
-                                        (realgud-srcbuf-init-or-update srcbuf 
cmdbuf)
-                                        (with-current-buffer srcbuf
-                                          (realgud-short-key-mode-setup
-                                           (or realgud-short-key-on-tracing? 
shortkey-mode?)
-                                           ))
-
-                                        ;; Add breakpoint to list of 
breakpoints
-                                        (with-current-buffer-safe 
(marker-buffer (realgud-loc-marker loc))
-                                                                  
(realgud-bp-add-info loc))
-
-                                        (unless (member loc bp-list)
-                                          (realgud-cmdbuf-info-bp-list= (cons 
loc bp-list)))
-
-                                        ;; Set to return location
-                                        (setq found-loc loc-or-error)
-                                        (setq loc-pat-list nil))
-                                      )))
-                              )))
+                              (if (setq found-loc
+                                        (realgud-track-bp-file-line cmd-mark 
cmdbuf filename lineno source-str bp-num directory column shortkey-mode?))
+                                  (setq loc-pat-list nil)))
+
+                             )
+                       )
                    ))))
        found-loc)
+      )))
+
+(defun realgud-track-bp-file-line(cmd-mark cmdbuf filename lineno source-str 
bp-num directory column shortkey-mode?)
+  (if (and filename lineno)
+      (let* ((directory
+             (cond ((boundp 'starting-directory) starting-directory)
+                   (t nil)))
+            (srcbuf)
+            (found-loc nil)
+            (loc-or-error
+             (realgud:file-loc-from-line
+              filename lineno
+              cmd-mark
+              source-str
+              (string-to-number bp-num)
+              nil directory
+              )))
+       (if (stringp loc-or-error)
+           (progn
+             (message loc-or-error)
+             ;; set to return nil
+             (setq found-loc nil))
+         ;; else
+         (let ((loc loc-or-error)
+               (bp-list (realgud-sget 'cmdbuf-info 'bp-list)))
+
+           ;; Add src buffer mentioned and set it possibly to go into shortkey 
mode
+           (setq srcbuf (realgud-loc-goto loc))
+           (realgud-cmdbuf-add-srcbuf srcbuf cmdbuf)
+           (realgud-srcbuf-init-or-update srcbuf cmdbuf)
+           (with-current-buffer srcbuf
+             (realgud-short-key-mode-setup
+              (or realgud-short-key-on-tracing? shortkey-mode?)
+              ))
+
+           ;; Add breakpoint to list of breakpoints
+           (with-current-buffer-safe (marker-buffer (realgud-loc-marker loc))
+             (realgud-bp-add-info loc))
+
+           (unless (member loc bp-list)
+             (realgud-cmdbuf-info-bp-list= (cons loc bp-list)))
+
+           ;; Set to return location
+           (setq found-loc loc-or-error)
+         ))
+    found-loc
     )))
 
+
 (defun realgud-track-bp-delete(text &optional cmd-mark cmdbuf 
ignore-re-file-list)
   "Do regular-expression matching to see if a breakpoint has been
 deleted inside string TEXT. Return a list of breakpoint locations



reply via email to

[Prev in Thread] Current Thread [Next in Thread]