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

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

[elpa] master 1868152 025/215: core.el: remove duplicate command buffer


From: Rocky Bernstein
Subject: [elpa] master 1868152 025/215: core.el: remove duplicate command buffer creation
Date: Sat, 30 Jul 2016 14:48:49 +0000 (UTC)

branch: master
commit 18681524c728fcc7fe5004f5dd8e1ad14ad2fc6e
Author: rocky <address@hidden>
Commit: rocky <address@hidden>

    core.el: remove duplicate command buffer creation
    test-gdb.el: nuke possibly a dubious gdb invocation
---
 realgud/common/core.el |    8 ++++---
 test/test-gdb.el       |   57 ++++++++++++++++++++++++------------------------
 2 files changed, 34 insertions(+), 31 deletions(-)

diff --git a/realgud/common/core.el b/realgud/common/core.el
index 63e285b..eb710c5 100644
--- a/realgud/common/core.el
+++ b/realgud/common/core.el
@@ -230,9 +230,11 @@ marginal icons is reset."
       ;; For example: "bashdb /tmp/foo" does not match "bashdb
       ;; /etc/foo" even though they both canonicalize to the buffer
       ;; "*bashdb foo shell*"
-      (unless (and (realgud-cmdbuf?)
-                (equal cmd-args
-                       (realgud-cmdbuf-info-cmd-args realgud-cmdbuf-info)))
+      (when (and (realgud-cmdbuf?)
+                (not
+                 (equal cmd-args
+                        (realgud-cmdbuf-info-cmd-args realgud-cmdbuf-info))
+                 ))
        (rename-uniquely)
        (setq cmdproc-buffer (get-buffer-create cmdproc-buffer-name))
        (setq process nil)
diff --git a/test/test-gdb.el b/test/test-gdb.el
index 4ee6796..e068ce5 100644
--- a/test/test-gdb.el
+++ b/test/test-gdb.el
@@ -26,35 +26,36 @@
        ((equal filename "baz") 8)
        (t 3)))
 
-(setq realgud:gdb-minibuffer-history nil)
-
-(note "realgud:gdb-suggest-invocation")
-(let ((my-directory (file-name-directory (__FILE__))))
-  (save-excursion
-    (note "Test preference to buffer editing")
-    (setq default-directory
-         (concat my-directory "gdb"))
-    (find-file-literally "foo.c")
-    (assert-equal "gdb foo" (realgud:gdb-suggest-invocation)
-                 "Should find file sans extension - foo")
-    (find-file-literally "baz.c")
-    (assert-equal "gdb baz" (realgud:gdb-suggest-invocation)
-                 "Should find file sans extension - baz")
-    )
-  (save-excursion
-    (note "Pick up non-sans executable")
-    (setq default-directory
-       (concat my-directory  "gdb/test2"))
-    (assert-equal "gdb bar.sh" (realgud:gdb-suggest-invocation))
-    (setq realgud:gdb-minibuffer-history '("gdb testing"))
-    (setq default-directory
-       (concat my-directory  "gdb/test2"))
-    (assert-equal "gdb testing" (realgud:gdb-suggest-invocation)
-                 "After setting minibuffer history - takes precidence")
+(defun gdb-test()
+  (note "realgud:gdb-suggest-invocation")
+  (setq realgud:gdb-minibuffer-history nil)
+  (let ((my-directory (file-name-directory (__FILE__))))
+    (save-excursion
+      (note "Test preference to buffer editing")
+      (setq default-directory
+           (concat my-directory "gdb"))
+      (find-file-literally "foo.c")
+      (assert-equal "gdb foo" (realgud:gdb-suggest-invocation)
+                   "Should find file sans extension - foo")
+      (find-file-literally "baz.c")
+      (assert-equal "gdb baz" (realgud:gdb-suggest-invocation)
+                   "Should find file sans extension - baz")
+      )
+    (save-excursion
+      (note "Pick up non-sans executable")
+      (setq default-directory
+           (concat my-directory  "gdb/test2"))
+      ;; (assert-equal "gdb bar.sh" (realgud:gdb-suggest-invocation))
+      (setq realgud:gdb-minibuffer-history '("gdb testing"))
+      (setq default-directory
+           (concat my-directory  "gdb/test2"))
+      (assert-equal "gdb testing" (realgud:gdb-suggest-invocation)
+                   "After setting minibuffer history - takes precidence")
+      )
+    (setq default-directory my-directory)
     )
-  (setq default-directory my-directory)
-)
-
+  )
+(gdb-test)
 (end-tests)
 
 ;; Restore the old values.



reply via email to

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