summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2003-02-10 21:54:08 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2003-02-10 21:54:08 +0000
commit1e28f647a7f3b9bc164713cd972ae14a9429caff (patch)
tree5ecdac6e3b6b6384b7df71d6c631ba722d6a5fff
parent22f5d492084be45add196d8ecc3a1280b43260cd (diff)
downloademacs-1e28f647a7f3b9bc164713cd972ae14a9429caff.tar.gz
(gud-gdb-run-command-fetch-lines, gud-display-line):
Use with-current-buffer and simplify.
-rw-r--r--lisp/gud.el10
1 files changed, 3 insertions, 7 deletions
diff --git a/lisp/gud.el b/lisp/gud.el
index 3ef5a7ad83c..6d192081719 100644
--- a/lisp/gud.el
+++ b/lisp/gud.el
@@ -627,8 +627,7 @@ It is passed through FILTER before we look at it."
"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 @@ Obeying it means displaying in another window the specified file and line."
(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 @@ Obeying it means displaying in another window the specified file and line."
(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