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

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

[elpa] master 6a5c71d 112/215: Merge pull request #80 from cpitclaudel/m


From: Rocky Bernstein
Subject: [elpa] master 6a5c71d 112/215: Merge pull request #80 from cpitclaudel/master
Date: Sat, 30 Jul 2016 14:48:58 +0000 (UTC)

branch: master
commit 6a5c71d86a24221f5eb56f6197e562c4de47ceb7
Merge: 76cb0d4 b346e13
Author: R. Bernstein <address@hidden>
Commit: R. Bernstein <address@hidden>

    Merge pull request #80 from cpitclaudel/master
    
    Improve completion and default value in realgud-query-cmdline
---
 realgud/common/core.el |   16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/realgud/common/core.el b/realgud/common/core.el
index cecd5ee..ad86499 100644
--- a/realgud/common/core.el
+++ b/realgud/common/core.el
@@ -47,13 +47,12 @@ Otherwise, just return FILENAME."
 )
 
 (defun realgud-suggest-invocation
-  (debugger-name minibuffer-history lang-str lang-ext-regexp
+  (debugger-name _minibuffer-history lang-str lang-ext-regexp
                 &optional last-resort)
   "Suggest a debugger command invocation. If the current buffer
 is a source file or process buffer previously set, then use the
 value of that the command invocations found by buffer-local
-variables. Next, try to use the first value of MINIBUFFER-HISTORY
-if that exists.  Finally we try to find a suitable program file
+variables.  Otherwise, we try to find a suitable program file
 using LANG-STR and LANG-EXT-REGEXP."
   (let* ((buf (current-buffer))
         (filename)
@@ -62,12 +61,11 @@ using LANG-STR and LANG-EXT-REGEXP."
     (cond
      ((and cmd-str-cmdbuf (equal debugger-name (realgud-cmdbuf-debugger-name 
buf)))
       cmd-str-cmdbuf)
-     ((and minibuffer-history (listp minibuffer-history))
-      (car minibuffer-history))
      ((setq filename (realgud:suggest-file-from-buffer lang-str))
-      (concat debugger-name " " filename))
+      (concat debugger-name " " (shell-quote-argument filename)))
      (t (concat debugger-name " "
-               (realgud-suggest-lang-file lang-str lang-ext-regexp 
last-resort)))
+                (shell-quote-argument
+                 (realgud-suggest-lang-file lang-str lang-ext-regexp 
last-resort))))
      )))
 
 (defun realgud-query-cmdline
@@ -86,11 +84,9 @@ We also set filename completion and use a history of the 
prior
 dbgr invocations "
   (let ((debugger (or opt-debugger
                   (realgud-sget 'srcbuf-info 'debugger-name))))
-    (read-from-minibuffer
+    (read-shell-command
      (format "Run %s (like this): " debugger)  ;; prompt string
      (funcall suggest-invocation-fn debugger)  ;; initial value
-     minibuffer-local-map                      ;; keymap
-     nil                                       ;; read - use default value
      minibuffer-history                        ;; history variable
      )))
 



reply via email to

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