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

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

[elpa] externals/realgud 66f22b9 64/72: Avoid running y-n-prompt from in


From: Stefan Monnier
Subject: [elpa] externals/realgud 66f22b9 64/72: Avoid running y-n-prompt from inside minubuffer...
Date: Fri, 26 Mar 2021 22:49:14 -0400 (EDT)

branch: externals/realgud
commit 66f22b9e54a57b882b28d4a01ddead7c3f9e96fe
Author: rocky <rocky@gnu.org>
Commit: rocky <rocky@gnu.org>

    Avoid running y-n-prompt from inside minubuffer...
    
    It should be done inside the command buffer.
    
    We were getting into a loop where we were constantly prompting for a
    name but couldn't enter one because only "y" and "n" were allowed.
    
    trepan{2,3k}: some support for new locals window
---
 realgud/common/file.el            | 91 ++++++++++++++++++++-------------------
 realgud/debugger/trepan2/init.el  |  7 ++-
 realgud/debugger/trepan3k/init.el |  8 +++-
 3 files changed, 59 insertions(+), 47 deletions(-)

diff --git a/realgud/common/file.el b/realgud/common/file.el
index dd923f5..d0416cf 100644
--- a/realgud/common/file.el
+++ b/realgud/common/file.el
@@ -1,4 +1,4 @@
-;; Copyright (C) 2010-2011, 2013-2014, 2016-2019 Free Software Foundation, Inc
+;; Copyright (C) 2010-2011, 2013-2014, 2016-2020 Free Software Foundation, Inc
 
 ;; Author: Rocky Bernstein <rocky@gnu.org>
 
@@ -107,51 +107,52 @@ problem as best as we can determine."
 
      (unless (and filename (file-readable-p filename))
 
-       (cond
-       ;; Is file already listed for ignore?
-       ((realgud:file-ignore filename ignore-re-file-list)
-        (message "tracking ignored for %s" filename))
-
-       ;; If we can find the filename, e.g. "src/code.c" as a suffix of file in
-       ;; the list of buffers seen, use that
-       ((and
-         (setq buffer-files
-            (with-current-buffer (marker-buffer cmd-marker)
-              (mapcar (lambda (buf) (buffer-file-name buf))
-                      (realgud-cmdbuf-info-srcbuf-list realgud-cmdbuf-info))))
-         (setq matching-file-list (realgud--file-matching-suffix buffer-files 
filename))
-         (car matching-file-list)))
-
-       ;; Do we want to blacklist this?
-       ((y-or-n-p (format "Unable to locate %s\nBlacklist it for location 
tracking?" filename))
-        ;; FIXME: there has to be a simpler way to set ignore-file-list
-        (with-current-buffer cmdbuf
-          (push filename ignore-re-file-list)
-          (realgud-cmdbuf-info-ignore-re-file-list= ignore-re-file-list))
-        (setq filename nil)
-        )
-
-       ;; Do we have a custom find-file function?
-       (find-file-fn
-        (setq filename (funcall find-file-fn cmd-marker filename directory)))
-
-       (t
-        (let ((found-file (funcall realgud-file-find-function (point-marker) 
filename directory)))
-          (if found-file
-              (progn
-                (setq remapped-filename (buffer-file-name found-file))
-                (when (and remapped-filename (file-exists-p remapped-filename))
-                  (realgud-cmdbuf-filename-remap-alist=
-                   (cons
-                    (cons filename remapped-filename)
-                    filename-remap-alist)
-                   cmdbuf)
-                  (setq filename remapped-filename)
-                  ))
-            ;; else
+       (with-current-buffer cmdbuf
+        (cond
+         ;; Is file already listed for ignore?
+         ((realgud:file-ignore filename ignore-re-file-list)
+          (message "tracking ignored for %s" filename))
+
+         ;; If we can find the filename, e.g. "src/code.c" as a suffix of file 
in
+         ;; the list of buffers seen, use that
+         ((and
+           (setq buffer-files
+                 (with-current-buffer (marker-buffer cmd-marker)
+                   (mapcar (lambda (buf) (buffer-file-name buf))
+                           (realgud-cmdbuf-info-srcbuf-list 
realgud-cmdbuf-info))))
+           (setq matching-file-list (realgud--file-matching-suffix 
buffer-files filename))
+           (car matching-file-list)))
+
+         ;; Do we want to blacklist this?
+         ((y-or-n-p (format "Unable to locate %s\nBlacklist it for location 
tracking?" filename))
+          ;; FIXME: there has to be a simpler way to set ignore-file-list
+          (progn
+            (push filename ignore-re-file-list)
+            (realgud-cmdbuf-info-ignore-re-file-list= ignore-re-file-list)
             (setq filename nil)
-            )))
-       )))
+          ))
+
+         ;; Do we have a custom find-file function?
+         (find-file-fn
+          (setq filename (funcall find-file-fn cmd-marker filename directory)))
+
+         (t
+          (let ((found-file (funcall realgud-file-find-function (point-marker) 
filename directory)))
+            (if found-file
+                (progn
+                  (setq remapped-filename (buffer-file-name found-file))
+                  (when (and remapped-filename (file-exists-p 
remapped-filename))
+                    (realgud-cmdbuf-filename-remap-alist=
+                     (cons
+                      (cons filename remapped-filename)
+                      filename-remap-alist)
+                     cmdbuf)
+                    (setq filename remapped-filename)
+                    ))
+              ;; else
+              (setq filename nil)
+              )))
+         ))))
   ;;)
 
   (if filename
diff --git a/realgud/debugger/trepan2/init.el b/realgud/debugger/trepan2/init.el
index 029a0e7..8a826e7 100644
--- a/realgud/debugger/trepan2/init.el
+++ b/realgud/debugger/trepan2/init.el
@@ -1,4 +1,4 @@
-;; Copyright (C) 2010-2012, 2014-2017, 2019 Free Software Foundation, Inc
+;; Copyright (C) 2010-2012, 2014-2017, 2019, 2020 Free Software Foundation, Inc
 
 ;; Author: Rocky Bernstein <rocky@gnu.org>
 
@@ -138,6 +138,11 @@ realgud-loc-pat struct")
 (setf (gethash "shell"            realgud:trepan2-command-hash) "python")
 (setf (gethash "until"            realgud:trepan2-command-hash) "continue %l")
 
+;; Stuff to suport locals window
+;; (setf (gethash "info-locals-names-list" realgud:trepan2-command-hash) 
"eval('\\n'.join(locals().keys()))")
+;; (setf (gethash "info-value" realgud:trepan2-command-hash) "pp %s")
+;; (setf (gethash "info-type" realgud:trepan2-command-hash) "eval type(%s)")
+
 ;; If your version of trepan2 doesn't support "quit!",
 ;; get a more recent version of trepan2
 (setf (gethash "quit" realgud:trepan2-command-hash) "quit!")
diff --git a/realgud/debugger/trepan3k/init.el 
b/realgud/debugger/trepan3k/init.el
index e67ec6d..7a4f75d 100644
--- a/realgud/debugger/trepan3k/init.el
+++ b/realgud/debugger/trepan3k/init.el
@@ -1,4 +1,4 @@
-;; Copyright (C) 2010-2019 Free Software Foundation, Inc
+;; Copyright (C) 2010-2019, 2020 Free Software Foundation, Inc
 
 ;; Author: Rocky Bernstein <rocky@gnu.org>
 
@@ -136,6 +136,12 @@ realgud-loc-pat struct")
 (setf (gethash "shell"            realgud:trepan3k-command-hash) "python")
 (setf (gethash "until"            realgud:trepan3k-command-hash) "continue %l")
 
+;; Stuff to suport locals window
+(setf (gethash "info-locals-names-list" realgud:trepan3k-command-hash) "info 
locals --list")
+(setf (gethash "info-value" realgud:trepan3k-command-hash) "pp %s")
+(setf (gethash "info-type" realgud:trepan3k-command-hash) "eval type(%s)")
+
+
 ;; If your version of trepan3k doesn't support "quit!",
 ;; get a more recent version of trepan3k
 (setf (gethash "quit" realgud:trepan3k-command-hash) "quit!")



reply via email to

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