changeset 49691:0eed24634607

(gud-gdb-run-command-fetch-lines, gud-display-line): Use with-current-buffer and simplify.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 10 Feb 2003 21:54:08 +0000
parents e2f33e589249
children 1713a3efdd23
files lisp/gud.el
diffstat 1 files changed, 3 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gud.el	Mon Feb 10 21:52:30 2003 +0000
+++ b/lisp/gud.el	Mon Feb 10 21:54:08 2003 +0000
@@ -627,8 +627,7 @@
   "Run COMMAND, and return the list of lines it outputs.
 BUFFER is the GUD buffer in which to run the command.
 SKIP is the number of chars to skip on each lines, it defaults to 0."
-  (save-excursion
-    (set-buffer buffer)
+  (with-current-buffer buffer
     (if (save-excursion
 	  (goto-char (point-max))
 	  (forward-line 0)
@@ -2503,9 +2502,7 @@
 (defun gud-display-line (true-file line)
   (let* ((last-nonmenu-event t)	 ; Prevent use of dialog box for questions.
 	 (buffer
-	  (save-excursion
-	    (or (eq (current-buffer) gud-comint-buffer)
-		(set-buffer gud-comint-buffer))
+	  (with-current-buffer gud-comint-buffer
 	    (gud-find-file true-file)))
 	 (window (and buffer (or (get-buffer-window buffer)
 				 (if (eq gud-minor-mode 'gdba)
@@ -2514,8 +2511,7 @@
 	 (pos))
     (if buffer
 	(progn
-	  (save-excursion
-	    (set-buffer buffer)
+	  (with-current-buffer buffer
 	    (if (not (or (verify-visited-file-modtime buffer) gud-keep-buffer))
 		(progn
 		  (if