summaryrefslogtreecommitdiff
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2009-10-31 02:38:34 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2009-10-31 02:38:34 +0000
commit9a5293129d0e7b2b6333a735f054d2273572b1b3 (patch)
treea04125bf576f98c659f65f5b4a35cbfedc494652 /lisp/progmodes
parentd566f228251359ebf1f1f5ab69753089c04e5515 (diff)
downloademacs-9a5293129d0e7b2b6333a735f054d2273572b1b3.tar.gz
* textmodes/two-column.el (2C-split):
* textmodes/texnfo-upd.el (texinfo-multi-file-included-list): * textmodes/tex-mode.el (tex-set-buffer-directory): * textmodes/spell.el (spell-region, spell-string): * textmodes/reftex.el (reftex-erase-buffer): (reftex-get-file-buffer-force, reftex-kill-temporary-buffers): * textmodes/reftex-toc.el (reftex-toc-promote-action): * textmodes/reftex-sel.el (reftex-get-offset, reftex-insert-docstruct) (reftex-select-item): * textmodes/reftex-ref.el (reftex-label-info-update) (reftex-offer-label-menu): * textmodes/reftex-index.el (reftex-index-change-entry) (reftex-index-phrases-info): * textmodes/reftex-global.el (reftex-create-tags-file) (reftex-save-all-document-buffers, reftex-ensure-write-access): * textmodes/reftex-dcr.el (reftex-echo-ref, reftex-echo-cite) (reftex-view-crossref-from-bibtex): * textmodes/reftex-cite.el (reftex-bibtex-selection-callback) (reftex-extract-bib-entries-from-thebibliography) (reftex-all-used-citation-keys, reftex-create-bibtex-file): * textmodes/refbib.el (r2b-capitalize-title): (r2b-convert-buffer, r2b-help): * textmodes/page-ext.el (pages-directory) (pages-directory-goto-with-mouse): * textmodes/bibtex.el (bibtex-validate-globally): * textmodes/bib-mode.el (bib-capitalize-title): * textmodes/artist.el (artist-clear-buffer, artist-system): * progmodes/xscheme.el (global-set-scheme-interaction-buffer): (local-set-scheme-interaction-buffer, xscheme-process-filter) (verify-xscheme-buffer, xscheme-enter-interaction-mode) (xscheme-enter-debugger-mode, xscheme-debugger-mode-p) (xscheme-send-control-g-interrupt, xscheme-start-process) (xscheme-process-sentinel, xscheme-cd): * progmodes/verilog-mode.el (verilog-read-always-signals) (verilog-set-define, verilog-getopt-file) (verilog-module-inside-filename-p): * progmodes/sh-script.el: * progmodes/python.el (python-pdbtrack-get-source-buffer) (python-pdbtrack-grub-for-buffer, python-execute-file): * progmodes/octave-inf.el (inferior-octave): * progmodes/idlwave.el (idlwave-scan-user-lib-files) (idlwave-shell-compile-helper-routines, idlwave-set-local) (idlwave-display-completion-list-xemacs, idlwave-list-abbrevs) (idlwave-display-completion-list-emacs, idlwave-list-load-path-shadows) (idlwave-completion-fontify-classes, idlwave-display-calling-sequence): * progmodes/idlw-shell.el (idlwave-shell-examine-display-clear) (idlwave-shell-filter, idlwave-shell-examine-highlight) (idlwave-shell-sentinel, idlwave-shell-filter-directory) (idlwave-shell-display-line, idlwave-shell-set-bp-in-module) (idlwave-shell-examine-display, idlwave-shell-run-region) (idlwave-shell-filter-bp, idlwave-shell-save-and-action) (idlwave-shell-sources-filter, idlwave-shell-goto-next-error): * progmodes/idlw-help.el (idlwave-help-get-special-help) (idlwave-help-get-help-buffer): * progmodes/gud.el (gud-basic-call, gud-find-class) (gud-tooltip-activate-mouse-motions-if-enabled): * progmodes/gdb-mi.el (gdb-mouse-toggle-breakpoint-fringe): * progmodes/ebrowse.el (ebrowse-member-table, ebrowse-save-tree-as) (ebrowse-view-exit-fn, ebrowse-tags-list-members-in-file) (ebrowse-tags-next-file): * progmodes/ebnf2ps.el (ebnf-generate-eps, ebnf-generate-eps) (ebnf-eps-production-list, ebnf-begin-file, ebnf-log) (ebnf-eps-finish-and-write): * progmodes/cpp.el (cpp-edit-save): * progmodes/cperl-mode.el (cperl-pod-to-manpage): * progmodes/cc-defs.el (c-emacs-features): * progmodes/antlr-mode.el (antlr-invalidate-context-cache) (antlr-directory-dependencies): * progmodes/ada-xref.el (ada-gnat-parse-gpr, ada-get-ali-file-name) (ada-run-application, ada-find-in-src-path, ada-goto-parent) (ada-find-any-references, ada-make-filename-from-adaname) (ada-make-body-gnatstub): * obsolete/rnews.el (news-list-news-groups): * obsolete/resume.el (resume-suspend-hook,resume-write-buffer-to-file): * obsolete/iso-acc.el (iso-acc-minibuf-setup): * net/rcirc.el (rcirc-debug): * net/newst-treeview.el (newsticker--treeview-list-add-item) (newsticker--treeview-list-clear, newsticker-treeview-browse-url) (newsticker--treeview-list-update-faces, newsticker-treeview-save) (newsticker--treeview-item-show-text, newsticker--treeview-item-show) (newsticker--treeview-tree-update-tag,newsticker--treeview-buffer-init) (newsticker-treeview-show-item, newsticker--treeview-unfold-node) (newsticker--treeview-list-clear-highlight) (newsticker--treeview-list-update-highlight) (newsticker--treeview-list-highlight-start) (newsticker--treeview-tree-update-highlight) (newsticker--treeview-get-selected-item) (newsticker-treeview-mark-list-items-old) (newsticker--treeview-set-current-node): * net/newst-plainview.el (newsticker--buffer-set-uptodate): * net/newst-backend.el (newsticker--get-news-by-funcall) (newsticker--get-news-by-wget, newsticker--image-get) (newsticker--image-sentinel): * net/mairix.el (mairix-rmail-fetch-field, mairix-gnus-fetch-field): * net/eudcb-ph.el (eudc-ph-do-request, eudc-ph-open-session): (eudc-ph-close-session): * net/eudc.el (eudc-save-options): * language/thai-word.el (thai-update-word-table): * language/japan-util.el (japanese-string-conversion): * international/titdic-cnv.el (tsang-quick-converter) (ziranma-converter, ctlau-converter): * international/mule-cmds.el (describe-language-environment): * international/ja-dic-cnv.el (skkdic-convert-okuri-ari) (skkdic-convert-postfix, skkdic-convert-prefix): (skkdic-convert-okuri-nasi, skkdic-convert): * emacs-lisp/re-builder.el (reb-update-overlays): * emacs-lisp/pp.el (pp-to-string, pp-display-expression): * emacs-lisp/gulp.el (gulp-send-requests): * emacs-lisp/find-gc.el (trace-call-tree): * emacs-lisp/eieio-opt.el (eieio-browse, eieio-describe-class) (eieio-describe-generic): * emacs-lisp/eieio-base.el (eieio-persistent-read): * emacs-lisp/edebug.el (edebug-outside-excursion): * emacs-lisp/debug.el (debugger-make-xrefs): * emacs-lisp/cust-print.el (custom-prin1-to-string): * emacs-lisp/chart.el (chart-new-buffer): * emacs-lisp/authors.el (authors-scan-el, authors-scan-change-log): Use with-current-buffer. * textmodes/artist.el (artist-system): Don't call copy-sequence on a fresh string. * progmodes/idlw-shell.el (easymenu setup): Use dolist.
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/ada-xref.el34
-rw-r--r--lisp/progmodes/antlr-mode.el6
-rw-r--r--lisp/progmodes/cc-defs.el3
-rw-r--r--lisp/progmodes/cperl-mode.el3
-rw-r--r--lisp/progmodes/cpp.el3
-rw-r--r--lisp/progmodes/ebnf2ps.el18
-rw-r--r--lisp/progmodes/ebrowse.el34
-rw-r--r--lisp/progmodes/gdb-mi.el3
-rw-r--r--lisp/progmodes/gud.el9
-rw-r--r--lisp/progmodes/idlw-help.el6
-rw-r--r--lisp/progmodes/idlw-shell.el94
-rw-r--r--lisp/progmodes/idlwave.el34
-rw-r--r--lisp/progmodes/octave-inf.el3
-rw-r--r--lisp/progmodes/python.el13
-rw-r--r--lisp/progmodes/sh-script.el3
-rw-r--r--lisp/progmodes/verilog-mode.el18
-rw-r--r--lisp/progmodes/xscheme.el38
17 files changed, 126 insertions, 196 deletions
diff --git a/lisp/progmodes/ada-xref.el b/lisp/progmodes/ada-xref.el
index 4bb53a85f47..7a6212d4cfd 100644
--- a/lisp/progmodes/ada-xref.el
+++ b/lisp/progmodes/ada-xref.el
@@ -355,8 +355,7 @@ Return new value of PLIST.
GPR_FILE must be full path to file, normalized.
src_dir, obj_dir will include compiler runtime.
Assumes environment variable ADA_PROJECT_PATH is set properly."
- (save-excursion
- (set-buffer (get-buffer-create "*gnatls*"))
+ (with-current-buffer (get-buffer-create "*gnatls*")
(erase-buffer)
;; this can take a long time; let the user know what's up
@@ -1041,16 +1040,14 @@ existing buffer `*gnatfind*', if there is one."
(setq command (concat command " -p\"" ada-prj-default-project-file "\""))))
(if (and append (get-buffer ada-gnatfind-buffer-name))
- (save-excursion
- (set-buffer "*gnatfind*")
+ (with-current-buffer "*gnatfind*"
(setq old-contents (buffer-string))))
(let ((compilation-error "reference"))
(compilation-start command 'compilation-mode (lambda (mode) ada-gnatfind-buffer-name)))
;; Hide the "Compilation" menu
- (save-excursion
- (set-buffer ada-gnatfind-buffer-name)
+ (with-current-buffer ada-gnatfind-buffer-name
(local-unset-key [menu-bar compilation-menu])
(if old-contents
@@ -1318,8 +1315,7 @@ If ARG is non-nil, ask for user confirmation."
command)))
;; Run the command
- (save-excursion
- (set-buffer (get-buffer-create "*run*"))
+ (with-current-buffer (get-buffer-create "*run*")
(set 'buffer-read-only nil)
(erase-buffer)
@@ -1547,8 +1543,7 @@ the project file."
;; the 'D' lines. This is done repeatedly, in case the direct parent is
;; also a separate.
- (save-excursion
- (set-buffer (get-file-buffer file))
+ (with-current-buffer (get-file-buffer file)
(let ((short-ali-file-name
(concat (file-name-sans-extension (file-name-nondirectory file))
".ali"))
@@ -2044,13 +2039,11 @@ the declaration and documentation of the subprograms one is using."
choice
file)
- (save-excursion
-
- ;; Do the grep in all the directories. We do multiple shell
- ;; commands instead of one in case there is no .ali file in one
- ;; of the directory and the shell stops because of that.
+ ;; Do the grep in all the directories. We do multiple shell
+ ;; commands instead of one in case there is no .ali file in one
+ ;; of the directory and the shell stops because of that.
- (set-buffer (get-buffer-create "*grep*"))
+ (with-current-buffer (get-buffer-create "*grep*")
(while dirs
(insert (shell-command-to-string
(concat
@@ -2234,8 +2227,7 @@ Return the position of the declaration in the buffer, or nil if not found."
(unit-name nil)
(body-name nil)
(ali-name nil))
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(goto-char (point-min))
(re-search-forward "^U \\([^ \t%]+\\)%[bs][ \t]+\\([^ \t]+\\)")
(setq unit-name (match-string 1))
@@ -2280,8 +2272,7 @@ Return the position of the declaration in the buffer, or nil if not found."
This is a GNAT specific function that uses gnatkrunch."
(let ((krunch-buf (generate-new-buffer "*gkrunch*"))
(cross-prefix (plist-get (cdr (ada-xref-current-project)) 'cross_prefix)))
- (save-excursion
- (set-buffer krunch-buf)
+ (with-current-buffer krunch-buf
;; send adaname to external process `gnatkr'.
;; Add a dummy extension, since gnatkr versions have two different
;; behaviors depending on the version:
@@ -2340,8 +2331,7 @@ If INTERACTIVE is nil, assume this is called from `ff-file-created-hook'."
" " gnatstub-opts " " filename))
(buffer (get-buffer-create "*gnat stub*")))
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(compilation-minor-mode 1)
(erase-buffer)
(insert gnatstub-cmd)
diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el
index 521e8a17aeb..3dc312c0cab 100644
--- a/lisp/progmodes/antlr-mode.el
+++ b/lisp/progmodes/antlr-mode.el
@@ -1087,8 +1087,7 @@ Used for `antlr-slow-syntactic-context'.")
;; checkdoc-params: (dummies)
"Invalidate context cache for syntactical context information."
:XEMACS ; XEmacs bug workaround
- (save-excursion
- (set-buffer (get-buffer-create " ANTLR XEmacs bug workaround"))
+ (with-current-buffer (get-buffer-create " ANTLR XEmacs bug workaround")
(buffer-syntactic-context-depth)
nil)
:EMACS
@@ -2182,8 +2181,7 @@ export vocabulary specified in that file."
"\\'"))
classes dependencies)
(unwind-protect
- (save-excursion
- (set-buffer temp-buffer)
+ (with-current-buffer temp-buffer
(widen) ; just in case...
(dolist (file grammar)
(when (and (file-regular-p file)
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el
index dc5a005cb2e..c4b85c151ed 100644
--- a/lisp/progmodes/cc-defs.el
+++ b/lisp/progmodes/cc-defs.el
@@ -1469,8 +1469,7 @@ non-nil, a caret is prepended to invert the set."
parse-sexp-lookup-properties
parse-sexp-ignore-comments
lookup-syntax-properties)
- (save-excursion
- (set-buffer buf)
+ (with-current-buffer buf
(set-syntax-table (make-syntax-table))
;; For some reason we have to set some of these after the
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 42f7a0e95da..7446de6ff8f 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -8571,8 +8571,7 @@ the appropriate statement modifier."
(let* ((pod2man-args (concat buffer-file-name " | nroff -man "))
(bufname (concat "Man " buffer-file-name))
(buffer (generate-new-buffer bufname)))
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(let ((process-environment (copy-sequence process-environment)))
;; Prevent any attempt to use display terminal fanciness.
(setenv "TERM" "dumb")
diff --git a/lisp/progmodes/cpp.el b/lisp/progmodes/cpp.el
index beb7b8cc066..2990cc34038 100644
--- a/lisp/progmodes/cpp.el
+++ b/lisp/progmodes/cpp.el
@@ -575,8 +575,7 @@ You can also use the keyboard accelerators indicated like this: [K]ey."
"Save the current cpp configuration in a file."
(interactive)
(require 'pp)
- (save-excursion
- (set-buffer cpp-edit-buffer)
+ (with-current-buffer cpp-edit-buffer
(let ((buffer (find-file-noselect cpp-config-file)))
(set-buffer buffer)
(erase-buffer)
diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el
index 172151fb274..b64ac2925af 100644
--- a/lisp/progmodes/ebnf2ps.el
+++ b/lisp/progmodes/ebnf2ps.el
@@ -4565,8 +4565,7 @@ end
horizontal (memq (ebnf-node-action prod)
ebnf-action-list))
;; generate production in EPS buffer
- (save-excursion
- (set-buffer eps-buffer)
+ (with-current-buffer eps-buffer
(setq ebnf-eps-upper-x 0.0
ebnf-eps-upper-y 0.0
ebnf-eps-max-width prod-width
@@ -4581,8 +4580,7 @@ end
(ebnf-eps-finish-and-write eps-buffer
(ebnf-eps-filename prod-name)))
;; prepare for next loop
- (save-excursion
- (set-buffer eps-buffer)
+ (with-current-buffer eps-buffer
(erase-buffer))
(setq ebnf-tree (cdr ebnf-tree)))
;; write and kill temporary buffers
@@ -4617,8 +4615,7 @@ end
prod-width prod-height eps-buffer)
(while prod-list
(add-to-list file-list-sym (car prod-list))
- (save-excursion
- (set-buffer (get-buffer-create (concat " *" (car prod-list) "*")))
+ (with-current-buffer (get-buffer-create (concat " *" (car prod-list) "*"))
(goto-char (point-max))
(cond
;; first production
@@ -5278,8 +5275,7 @@ killed after process termination."
(defun ebnf-begin-file ()
(ps-flush-output)
- (save-excursion
- (set-buffer ps-spool-buffer)
+ (with-current-buffer ps-spool-buffer
(goto-char (point-min))
(and (search-forward "%%Creator: " nil t)
(not (search-forward "& ebnf2ps v"
@@ -5299,8 +5295,7 @@ killed after process termination."
(defun ebnf-eps-finish-and-write (buffer filename)
(when (buffer-modified-p buffer)
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(ebnf-eps-header-footer-set filename)
(setq ebnf-eps-upper-x (max ebnf-eps-upper-x ebnf-eps-max-width)
ebnf-eps-upper-y (if (zerop ebnf-eps-upper-y)
@@ -6349,8 +6344,7 @@ killed after process termination."
(defun ebnf-log (format-str &rest args)
(when ebnf-log
- (save-excursion
- (set-buffer (get-buffer-create "*Ebnf2ps Log*"))
+ (with-current-buffer (get-buffer-create "*Ebnf2ps Log*")
(goto-char (point-max))
(insert (apply 'format format-str args) "\n"))))
diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el
index 41a77151c1a..bd0f28b350d 100644
--- a/lisp/progmodes/ebrowse.el
+++ b/lisp/progmodes/ebrowse.el
@@ -1002,8 +1002,7 @@ HEADER is the tree header structure of the class tree."
(loop for buffer in (ebrowse-browser-buffer-list)
until (eq header (ebrowse-value-in-buffer 'ebrowse--header buffer))
finally do
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(ebrowse-fill-member-table))))
(ebrowse-hs-member-table header))
@@ -1613,8 +1612,7 @@ and (b) in the directories named in `ebrowse-search-path'."
Restore frame configuration active before viewing the file,
and possibly kill the viewed buffer."
(let (exit-action original-frame-configuration)
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(setq original-frame-configuration ebrowse--frame-configuration
exit-action ebrowse--view-exit-action))
;; Delete the frame in which we viewed.
@@ -3555,7 +3553,7 @@ The file name is read from the minibuffer."
(interactive)
(let* ((buffer (or (ebrowse-choose-from-browser-buffers)
(error "No tree buffer")))
- (files (save-excursion (set-buffer buffer) (ebrowse-files-table)))
+ (files (with-current-buffer buffer (ebrowse-files-table)))
(file (completing-read "List members in file: " files nil t))
(header (ebrowse-value-in-buffer 'ebrowse--header buffer))
temp-buffer-setup-hook
@@ -3733,8 +3731,7 @@ TREE-BUFFER specifies the class tree we operate on."
;; on which tree (s)he wants to operate.
(when initialize
(let ((buffer (or tree-buffer (ebrowse-choose-from-browser-buffers))))
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(setq ebrowse-tags-next-file-list
(ebrowse-files-list (ebrowse-marked-classes-p))
ebrowse-tags-loop-last-file
@@ -4124,8 +4121,7 @@ Otherwise, FILE-NAME specifies the file to save the tree in."
(header (copy-ebrowse-hs ebrowse--header))
(tree ebrowse--tree))
(unwind-protect
- (save-excursion
- (set-buffer (setq standard-output temp-buffer))
+ (with-current-buffer (setq standard-output temp-buffer)
(erase-buffer)
(setf (ebrowse-hs-member-table header) nil)
(insert (prin1-to-string header) " ")
@@ -4210,8 +4206,8 @@ NUMBER-OF-STATIC-VARIABLES:"
;;; Global key bindings
-;;; The following can be used to bind key sequences starting with
-;;; prefix `\C-c\C-m' to browse commands.
+;; The following can be used to bind key sequences starting with
+;; prefix `\C-c\C-m' to browse commands.
(defvar ebrowse-global-map nil
"*Keymap for Ebrowse commands.")
@@ -4270,14 +4266,14 @@ NUMBER-OF-STATIC-VARIABLES:"
;;; Electric C++ browser buffer menu
-;;; Electric buffer menu customization to display only some buffers
-;;; (in this case Tree buffers). There is only one problem with this:
-;;; If the very first character typed in the buffer menu is a space,
-;;; this will select the buffer from which the buffer menu was
-;;; invoked. But this buffer is not displayed in the buffer list if
-;;; it isn't a tree buffer. I therefore let the buffer menu command
-;;; loop read the command `p' via `unread-command-char'. This command
-;;; has no effect since we are on the first line of the buffer.
+;; Electric buffer menu customization to display only some buffers
+;; (in this case Tree buffers). There is only one problem with this:
+;; If the very first character typed in the buffer menu is a space,
+;; this will select the buffer from which the buffer menu was
+;; invoked. But this buffer is not displayed in the buffer list if
+;; it isn't a tree buffer. I therefore let the buffer menu command
+;; loop read the command `p' via `unread-command-char'. This command
+;; has no effect since we are on the first line of the buffer.
(defvar electric-buffer-menu-mode-hook nil)
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index f547f9a17c5..703f4ac6162 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -2465,8 +2465,7 @@ If not in a source or disassembly buffer just set point."
obj)
(when (numberp pos)
(with-selected-window (posn-window posn)
- (save-excursion
- (set-buffer (window-buffer (selected-window)))
+ (with-current-buffer (window-buffer (selected-window))
(goto-char pos)
(dolist (overlay (overlays-in pos pos))
(when (overlay-get overlay 'put-break)
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 49637f9b970..e3413ab137b 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -2831,8 +2831,7 @@ Obeying it means displaying in another window the specified file and line."
(let ((proc (get-buffer-process gud-comint-buffer)))
(or proc (error "Current buffer has no process"))
;; Arrange for the current prompt to get deleted.
- (save-excursion
- (set-buffer gud-comint-buffer)
+ (with-current-buffer gud-comint-buffer
(save-restriction
(widen)
(if (marker-position gud-delete-prompt-marker)
@@ -3062,8 +3061,7 @@ class of the file (using s to separate nested class ids)."
;; symbols until 'topmost-intro is reached to find out if
;; point is within a nested class
(if (and fbuffer (equal (symbol-file 'java-mode) "cc-mode"))
- (save-excursion
- (set-buffer fbuffer)
+ (with-current-buffer fbuffer
(let ((nclass) (syntax))
;; While the c-syntactic information does not start
;; with the 'topmost-intro symbol, there may be
@@ -3327,8 +3325,7 @@ only tooltips in the buffer containing the overlay arrow."
(remove-hook 'post-command-hook
'gud-tooltip-activate-mouse-motions-if-enabled)
(dolist (buffer (buffer-list))
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(if (and gud-tooltip-mode
(memq major-mode gud-tooltip-modes))
(gud-tooltip-activate-mouse-motions t)
diff --git a/lisp/progmodes/idlw-help.el b/lisp/progmodes/idlw-help.el
index dffec272b6c..4cf275b3e6f 100644
--- a/lisp/progmodes/idlw-help.el
+++ b/lisp/progmodes/idlw-help.el
@@ -807,8 +807,7 @@ see if a link is set for it. Try extra help functions if necessary."
(defun idlwave-help-get-special-help (name type class keyword)
"Call the function given by `idlwave-extra-help-function'."
(let* ((cw (selected-window))
- (help-pos (save-excursion
- (set-buffer (idlwave-help-get-help-buffer))
+ (help-pos (with-current-buffer (idlwave-help-get-help-buffer)
(let ((buffer-read-only nil))
(funcall idlwave-extra-help-function
name type class keyword)))))
@@ -1224,8 +1223,7 @@ Useful when source code is displayed as help. See the option
(if buf
nil
(setq buf (get-buffer-create "*IDLWAVE Help*"))
- (save-excursion
- (set-buffer buf)
+ (with-current-buffer buf
(idlwave-help-mode)))
buf))
diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el
index ee4fb984f9a..7fce6a6ae20 100644
--- a/lisp/progmodes/idlw-shell.el
+++ b/lisp/progmodes/idlw-shell.el
@@ -1541,11 +1541,11 @@ and then calls `idlwave-shell-send-command' for any pending commands."
(concat idlwave-shell-accumulation string)))
-;;; Test/Debug code
- ;(with-current-buffer
- ; (get-buffer-create "*idlwave-shell-output*")
- ; (goto-char (point-max))
- ; (insert "\nReceived STRING\n===>\n" string "\n<====\n"))
+ ;; ;; Test/Debug code
+ ;;(with-current-buffer
+ ;; (get-buffer-create "*idlwave-shell-output*")
+ ;; (goto-char (point-max))
+ ;; (insert "\nReceived STRING\n===>\n" string "\n<====\n"))
;; Check for prompt in current accumulating output
(when (setq idlwave-shell-ready
@@ -1553,8 +1553,7 @@ and then calls `idlwave-shell-send-command' for any pending commands."
idlwave-shell-accumulation))
;; Gather the command output
(if idlwave-shell-hide-output
- (save-excursion
- (set-buffer idlwave-shell-hidden-output-buffer)
+ (with-current-buffer idlwave-shell-hidden-output-buffer
(setq full-output (buffer-string))
(goto-char (point-max))
(re-search-backward idlwave-shell-prompt-pattern nil t)
@@ -1618,8 +1617,7 @@ and then calls `idlwave-shell-send-command' for any pending commands."
(let* ((buf (idlwave-shell-buffer))
(win (get-buffer-window buf)))
(when (get-buffer buf)
- (save-excursion
- (set-buffer (idlwave-shell-buffer))
+ (with-current-buffer (idlwave-shell-buffer)
(goto-char (point-max))
(insert (format "\n\n Process %s %s" process event))
(if (and idlwave-shell-save-command-history
@@ -1639,8 +1637,7 @@ and then calls `idlwave-shell-send-command' for any pending commands."
(idlwave-shell-cleanup)
;; Run the hook, if possible in the shell buffer.
(if (get-buffer buf)
- (save-excursion
- (set-buffer buf)
+ (with-current-buffer buf
(run-hooks 'idlwave-shell-sentinel-hook))
(run-hooks 'idlwave-shell-sentinel-hook))))
@@ -2088,13 +2085,12 @@ HEAP_GC, /VERBOSE"
(defun idlwave-shell-filter-directory ()
"Get the current directory from `idlwave-shell-command-output'.
Change the default directory for the process buffer to concur."
- (save-excursion
- (set-buffer (idlwave-shell-buffer))
+ (with-current-buffer (idlwave-shell-buffer)
(if (string-match ",___cur[\n\r ]+\\([^\n\r]+\\)[\n\r]"
idlwave-shell-command-output)
(let ((dir (substring idlwave-shell-command-output
(match-beginning 1) (match-end 1))))
-; (message "Setting Emacs working dir to %s" dir)
+ ;; (message "Setting Emacs working dir to %s" dir)
(setq idlwave-shell-default-directory dir)
(setq default-directory (file-name-as-directory dir))))))
@@ -2363,10 +2359,10 @@ matter what the settings of that variable."
;; fixme: errors are dangerous in shell filters. but i think i
;; have never encountered this one.
(error "invalid frame - unable to access file: %s" (car frame))
-;;;
-;;; buffer : the buffer to display a line in.
-;;; select-shell: current buffer is the shell.
-;;;
+ ;;
+ ;; buffer : the buffer to display a line in.
+ ;; select-shell: current buffer is the shell.
+ ;;
(setq idlwave-shell-mode-line-info
(if (nth 2 frame)
(format "[%d:%s]"
@@ -2385,8 +2381,7 @@ matter what the settings of that variable."
nil (idlwave-shell-source-frame)))
;; enter the buffer and mark the line
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(save-restriction
(widen)
(goto-char (point-min))
@@ -2713,8 +2708,7 @@ Assumes that `idlwave-shell-sources-alist' contains an entry for that module."
(message "The source file for module %s is probably not compiled"
module)
(beep))
- (save-excursion
- (set-buffer buf)
+ (with-current-buffer buf
(save-excursion
(goto-char (point-min))
(let ((case-fold-search t))
@@ -2822,8 +2816,8 @@ Runs to the last statement and then steps 1 statement. Use the .out command."
(idlwave-shell-print (if (idlwave-region-active-p) '(4) nil)
,help ,ev))))
-;;; Begin terrible hack section -- XEmacs tests for button2 explicitly
-;;; on drag events, calling drag-n-drop code if detected. Ughhh...
+;; Begin terrible hack section -- XEmacs tests for button2 explicitly
+;; on drag events, calling drag-n-drop code if detected. Ughhh...
(defun idlwave-default-mouse-track-event-is-with-button (event n)
t)
@@ -3035,8 +3029,7 @@ from `idlwave-shell-examine-alist' via mini-buffer shortcut key."
(defun idlwave-shell-examine-display ()
"View the examine command output in a separate buffer."
(let (win cur-beg cur-end)
- (save-excursion
- (set-buffer (get-buffer-create "*Examine*"))
+ (with-current-buffer (get-buffer-create "*Examine*")
(use-local-map idlwave-shell-examine-map)
(setq buffer-read-only nil)
(goto-char (point-max))
@@ -3121,13 +3114,11 @@ from `idlwave-shell-examine-alist' via mini-buffer shortcut key."
(defun idlwave-shell-examine-display-clear ()
(interactive)
- (save-excursion
- (let ((buf (get-buffer "*Examine*")))
- (when (bufferp buf)
- (set-buffer buf)
- (setq buffer-read-only nil)
- (erase-buffer)
- (setq buffer-read-only t)))))
+ (let ((buf (get-buffer "*Examine*")))
+ (when (bufferp buf)
+ (with-current-buffer buf
+ (let ((inhibit-read-only t))
+ (erase-buffer))))))
(defun idlwave-retrieve-expression-from-level (expr level)
"Return IDL command to print the expression EXPR from stack level LEVEL.
@@ -3222,8 +3213,7 @@ size(___,/DIMENSIONS)"
(process (get-buffer-process buffer))
(process-mark (if process (process-mark process)))
output-begin output-end)
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(goto-char process-mark)
(beginning-of-line)
(setq output-end (point))
@@ -3295,9 +3285,8 @@ An END statement is appended to the region if necessary.
If there is a prefix argument, display IDL process."
(interactive "r\nP")
(let ((oldbuf (current-buffer)))
- (save-excursion
- (set-buffer (idlwave-find-file-noselect
- (idlwave-shell-temp-file 'pro) 'tmp))
+ (with-current-buffer (idlwave-find-file-noselect
+ (idlwave-shell-temp-file 'pro) 'tmp)
(set (make-local-variable 'comment-start-skip) ";+[ \t]*")
(set (make-local-variable 'comment-start) ";")
(erase-buffer)
@@ -3410,8 +3399,7 @@ of 'count, 'cmd and 'condition. Defaults to 'index."
Create `idlwave-shell-bp-alist' updating breakpoint count and command
data from previous breakpoint list. If NO-SHOW is set, don't update
the breakpoint overlays."
- (save-excursion
- (set-buffer (get-buffer-create idlwave-shell-bp-buffer))
+ (with-current-buffer (get-buffer-create idlwave-shell-bp-buffer)
(erase-buffer)
(insert idlwave-shell-command-output)
(goto-char (point-min))
@@ -3914,8 +3902,7 @@ handled by this command."
(idlwave-shell-last-save-and-action-file
(if (setq buf (idlwave-get-buffer-visiting
idlwave-shell-last-save-and-action-file))
- (save-excursion
- (set-buffer buf)
+ (with-current-buffer buf
(save-buffer))))
(t (setq idlwave-shell-last-save-and-action-file
(read-file-name "File: ")))))
@@ -3995,8 +3982,7 @@ Queries IDL using the string in `idlwave-shell-sources-query'."
Create `idlwave-shell-sources-alist' consisting of list elements
of the form:
(module name . (source-file-truename idlwave-internal-filename))"
- (save-excursion
- (set-buffer (get-buffer-create idlwave-shell-bp-buffer))
+ (with-current-buffer (get-buffer-create idlwave-shell-bp-buffer)
(erase-buffer)
(insert idlwave-shell-command-output)
(goto-char (point-min))
@@ -4068,8 +4054,7 @@ of the form:
"Move point to next IDL syntax error."
(interactive)
(let (frame col)
- (save-excursion
- (set-buffer idlwave-shell-error-buffer)
+ (with-current-buffer idlwave-shell-error-buffer
(goto-char idlwave-shell-error-last)
(if (or
(re-search-forward idlwave-shell-syntax-error nil t)
@@ -4526,14 +4511,13 @@ idlwave-shell-electric-debug-mode-map)
(easy-menu-define
idlwave-shell-mode-menu idlwave-shell-mode-map "IDL shell menus"
idlwave-shell-menu-def)
- (save-excursion
- (mapc (lambda (buf)
- (set-buffer buf)
- (if (eq major-mode 'idlwave-mode)
- (progn
- (easy-menu-remove idlwave-mode-debug-menu)
- (easy-menu-add idlwave-mode-debug-menu))))
- (buffer-list)))))
+ (save-current-buffer
+ (dolist (buf (buffer-list))
+ (set-buffer buf)
+ (if (eq major-mode 'idlwave-mode)
+ (progn
+ (easy-menu-remove idlwave-mode-debug-menu)
+ (easy-menu-add idlwave-mode-debug-menu)))))))
;; The Breakpoint Glyph -------------------------------------------------------
@@ -4694,7 +4678,7 @@ static char * file[] = {
(provide 'idlw-shell)
(provide 'idlwave-shell)
-;;; Load the toolbar when wanted by the user.
+;; Load the toolbar when wanted by the user.
(autoload 'idlwave-toolbar-toggle "idlw-toolbar"
"Toggle the IDLWAVE toolbar.")
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index 4f29d3c7079..8e80bc552e8 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -5512,8 +5512,7 @@ directories and save the routine info.
idlwave-path-alist path-alist ; for library-path instead
idlwave-true-path-alist nil)
(if idlwave-auto-write-paths (idlwave-write-paths))
- (save-excursion
- (set-buffer (get-buffer-create "*idlwave-scan.pro*"))
+ (with-current-buffer (get-buffer-create "*idlwave-scan.pro*")
(idlwave-mode)
(setq dirs-alist (reverse path-alist))
(while (setq dir (pop dirs-alist))
@@ -5818,9 +5817,8 @@ end
(defun idlwave-shell-compile-helper-routines (&optional wait)
(unless (and idlwave-idlwave_routine_info-compiled
(file-readable-p (idlwave-shell-temp-file 'rinfo)))
- (save-excursion
- (set-buffer (idlwave-find-file-noselect
- (idlwave-shell-temp-file 'pro)))
+ (with-current-buffer (idlwave-find-file-noselect
+ (idlwave-shell-temp-file 'pro))
(erase-buffer)
(insert idlwave-routine-info.pro)
(save-buffer 0))
@@ -7171,14 +7169,12 @@ If these don't exist, a letter in the string is automatically selected."
(defun idlwave-set-local (var value &optional buffer)
"Set the buffer-local value of VAR in BUFFER to VALUE."
- (save-excursion
- (set-buffer (or buffer (current-buffer)))
+ (with-current-buffer (or buffer (current-buffer))
(set (make-local-variable var) value)))
(defun idlwave-local-value (var &optional buffer)
"Return the value of VAR in BUFFER, but only if VAR is local to BUFFER."
- (save-excursion
- (set-buffer (or buffer (current-buffer)))
+ (with-current-buffer (or buffer (current-buffer))
(and (local-variable-p var (current-buffer))
(symbol-value var))))
@@ -7194,8 +7190,7 @@ If these don't exist, a letter in the string is automatically selected."
(apply 'display-completion-list list
':activate-callback 'idlwave-default-choose-completion
cl-args))
- (save-excursion
- (set-buffer "*Completions*")
+ (with-current-buffer "*Completions*"
(use-local-map
(or idlwave-completion-map
(setq idlwave-completion-map
@@ -7222,8 +7217,7 @@ If these don't exist, a letter in the string is automatically selected."
"Display completion list and install the choose wrappers."
(with-output-to-temp-buffer "*Completions*"
(display-completion-list list))
- (save-excursion
- (set-buffer "*Completions*")
+ (with-current-buffer "*Completions*"
(use-local-map
(or idlwave-completion-map
(setq idlwave-completion-map
@@ -7837,8 +7831,7 @@ associated TAG, if any."
(defun idlwave-completion-fontify-classes ()
"Goto the *Completions* buffer and fontify the class info."
(when (featurep 'font-lock)
- (save-excursion
- (set-buffer "*Completions*")
+ (with-current-buffer "*Completions*"
(save-excursion
(goto-char (point-min))
(let ((buffer-read-only nil))
@@ -8385,9 +8378,8 @@ If we do not know about MODULE, just return KEYWORD literally."
((null calling-seq)
(error "Calling sequence of %s %s not available" type name))
(t
- (save-excursion
- (move-marker idlwave-rinfo-marker (point))
- (set-buffer (get-buffer-create "*Help*"))
+ (move-marker idlwave-rinfo-marker (point))
+ (with-current-buffer (get-buffer-create "*Help*")
(use-local-map idlwave-rinfo-map)
(setq buffer-read-only nil)
(erase-buffer)
@@ -8755,8 +8747,7 @@ can be used to detect possible name clashes during this process."
(apply 'idlwave-do-find-module
(get-text-property (point) 'find-args))))
(message "Compiling list...( 0%%)")
- (save-excursion
- (set-buffer (get-buffer-create "*Shadows*"))
+ (with-current-buffer (get-buffer-create "*Shadows*")
(setq buffer-read-only nil)
(erase-buffer)
(while (setq routine (pop routines))
@@ -9358,8 +9349,7 @@ This function was written since `list-abbrevs' looks terrible for IDLWAVE mode."
(princ (format fmt str rpl func)))
abbrevs)))
;; Make sure each abbreviation uses only one display line
- (save-excursion
- (set-buffer "*Help*")
+ (with-current-buffer "*Help*"
(setq truncate-lines t)))
;; Add .pro files to speedbar for support, if it's loaded
diff --git a/lisp/progmodes/octave-inf.el b/lisp/progmodes/octave-inf.el
index db1d4d4d570..2c9051df4a5 100644
--- a/lisp/progmodes/octave-inf.el
+++ b/lisp/progmodes/octave-inf.el
@@ -178,8 +178,7 @@ startup file, `~/.emacs-octave'."
(get-buffer-create buffer)
(if (comint-check-proc buffer)
()
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(comint-mode)
(inferior-octave-startup)
(inferior-octave-mode)))
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 77e10cf06e0..ce54d2a0873 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -2654,8 +2654,7 @@ problem."
;; Add in number of lines for leading '##' comments:
(setq lineno
(+ lineno
- (save-excursion
- (set-buffer funcbuffer)
+ (with-current-buffer funcbuffer
(if (equal (point-min)(point-max))
0
(count-lines
@@ -2683,13 +2682,12 @@ problem."
(while (and buffers (not got))
(setq buf (car buffers)
buffers (cdr buffers))
- (if (and (save-excursion (set-buffer buf)
- (string= major-mode "python-mode"))
+ (if (and (with-current-buffer buf
+ (string= major-mode "python-mode"))
(or (string-match funcname (buffer-name buf))
(string-match (concat "^\\s-*\\(def\\|class\\)\\s-+"
funcname "\\s-*(")
- (save-excursion
- (set-buffer buf)
+ (with-current-buffer buf
(buffer-substring (point-min)
(point-max))))))
(setq got buf)))
@@ -2747,8 +2745,7 @@ comint believe the user typed this string so that
;; add some comment, so that we can filter it out of history
(cmd (format "execfile(r'%s') # PYTHON-MODE\n" filename)))
(unwind-protect
- (save-excursion
- (set-buffer procbuf)
+ (with-current-buffer procbuf
(goto-char (point-max))
(move-marker (process-mark proc) (point))
(funcall (process-filter proc) proc msg))
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index ef37b3bfa0d..0ab55d6a045 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -2978,8 +2978,7 @@ so that `occur-next' and `occur-prev' will work."
;;
;; (defun what-i-learned (list)
;; (let ((p list))
-;; (save-excursion
-;; (set-buffer "*scratch*")
+;; (with-current-buffer "*scratch*"
;; (goto-char (point-max))
;; (insert "(setq\n")
;; (while p
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el
index 557d587e6f3..27f7580f523 100644
--- a/lisp/progmodes/verilog-mode.el
+++ b/lisp/progmodes/verilog-mode.el
@@ -7137,7 +7137,10 @@ IGNORE-NEXT is true to ignore next token, fake from inside case statement."
uses-delayed) ;; Found signal/rvalue; push if not function
(search-forward ")")
(verilog-read-always-signals-recurse nil nil nil)
- ;;(if dbg (save-excursion (set-buffer (get-buffer-create "*vl-dbg*")) (delete-region (point-min) (point-max)) (insert dbg) (setq dbg "")))
+ ;;(if dbg (with-current-buffer (get-buffer-create "*vl-dbg*")
+ ;; (delete-region (point-min) (point-max))
+ ;; (insert dbg)
+ ;; (setq dbg "")))
;; Return what was found
(list sigs-out nil sigs-in uses-delayed))))
@@ -7249,8 +7252,7 @@ list of ( (signal_name connection_name)... )."
(defun verilog-set-define (defname defvalue &optional buffer enumname)
"Set the definition DEFNAME to the DEFVALUE in the given BUFFER.
Optionally associate it with the specified enumeration ENUMNAME."
- (save-excursion
- (set-buffer (or buffer (current-buffer)))
+ (with-current-buffer (or buffer (current-buffer))
(let ((mac (intern (concat "vh-" defname))))
;;(message "Define %s=%s" defname defvalue) (sleep-for 1)
;; Need to define to a constant if no value given
@@ -7497,8 +7499,8 @@ Some macros and such are also found and included. For dinotrace.el."
(forward-line 1)
(when (string-match "//" line)
(setq line (substring line 0 (match-beginning 0))))
- (save-excursion
- (set-buffer orig-buffer) ; Variables are buffer-local, so need right context.
+ ;; Variables are buffer-local, so need right context.
+ (with-current-buffer orig-buffer
(verilog-getopt line))))))
(defun verilog-getopt-flags ()
@@ -7599,11 +7601,11 @@ Allows version control to check out the file if need be."
(and (fboundp 'vc-backend)
(vc-backend filename)))
(let (pt)
- (save-excursion
- (set-buffer (find-file-noselect filename))
+ (with-current-buffer (find-file-noselect filename)
(goto-char (point-min))
(while (and
- ;; It may be tempting to look for verilog-defun-re, don't, it slows things down a lot!
+ ;; It may be tempting to look for verilog-defun-re,
+ ;; don't, it slows things down a lot!
(verilog-re-search-forward-quick "\\<module\\>" nil t)
(verilog-re-search-forward-quick "[(;]" nil t))
(if (equal module (verilog-read-module-name))
diff --git a/lisp/progmodes/xscheme.el b/lisp/progmodes/xscheme.el
index 5cf4651ad13..2477865745d 100644
--- a/lisp/progmodes/xscheme.el
+++ b/lisp/progmodes/xscheme.el
@@ -264,8 +264,8 @@ With argument, asks for a command line."
(setq-default xscheme-buffer-name buffer-name)
(setq-default xscheme-process-name process-name)
(setq-default xscheme-runlight-string
- (save-excursion (set-buffer buffer-name)
- xscheme-runlight-string))
+ (with-current-buffer buffer-name
+ xscheme-runlight-string))
(setq-default xscheme-runlight
(if (eq (process-status process-name) 'run)
default-xscheme-runlight
@@ -283,8 +283,8 @@ With argument, asks for a command line."
(make-local-variable 'xscheme-process-name)
(setq xscheme-process-name process-name)
(make-local-variable 'xscheme-runlight)
- (setq xscheme-runlight (save-excursion (set-buffer buffer-name)
- xscheme-runlight))))
+ (setq xscheme-runlight (with-current-buffer buffer-name
+ xscheme-runlight))))
(defun local-clear-scheme-interaction-buffer ()
"Make the current buffer use the default scheme interaction buffer."
@@ -305,8 +305,7 @@ With argument, asks for a command line."
((not process)
(error "Buffer `%s' is not a scheme interaction buffer" buffer-name))
(t
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(if (not (xscheme-process-buffer-current-p))
(error "Buffer `%s' is not a scheme interaction buffer"
buffer-name)))
@@ -469,8 +468,7 @@ with no args, if that value is non-nil.
(scheme-interaction-mode-commands scheme-interaction-mode-map)))
(defun xscheme-enter-interaction-mode ()
- (save-excursion
- (set-buffer (xscheme-process-buffer))
+ (with-current-buffer (xscheme-process-buffer)
(if (not (eq major-mode 'scheme-interaction-mode))
(if (eq major-mode 'scheme-debugger-mode)
(scheme-interaction-mode-initialize)
@@ -519,8 +517,7 @@ Commands:
(xscheme-send-char last-command-event))
(defun xscheme-enter-debugger-mode (prompt-string)
- (save-excursion
- (set-buffer (xscheme-process-buffer))
+ (with-current-buffer (xscheme-process-buffer)
(if (not (eq major-mode 'scheme-debugger-mode))
(progn
(if (not (eq major-mode 'scheme-interaction-mode))
@@ -530,8 +527,7 @@ Commands:
(defun xscheme-debugger-mode-p ()
(let ((buffer (xscheme-process-buffer)))
(and buffer
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(eq major-mode 'scheme-debugger-mode)))))
;;;; Evaluation Commands
@@ -765,13 +761,11 @@ Control returns to the top level rep loop."
(let ((inhibit-quit t))
(cond ((not xscheme-control-g-synchronization-p)
(interrupt-process xscheme-process-name))
- ((save-excursion
- (set-buffer xscheme-buffer-name)
+ ((with-current-buffer xscheme-buffer-name
xscheme-control-g-disabled-p)
(message "Relax..."))
(t
- (save-excursion
- (set-buffer xscheme-buffer-name)
+ (with-current-buffer xscheme-buffer-name
(setq xscheme-control-g-disabled-p t))
(message xscheme-control-g-message-string)
(interrupt-process xscheme-process-name)
@@ -807,8 +801,7 @@ Control returns to the top level rep loop."
(defun xscheme-start-process (command-line the-process the-buffer)
(let ((buffer (get-buffer-create the-buffer)))
(let ((process (get-buffer-process buffer)))
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(if (and process (memq (process-status process) '(run stop)))
(set-marker (process-mark process) (point-max))
(progn (if process (delete-process process))
@@ -944,8 +937,7 @@ the remaining input.")
(defun xscheme-process-sentinel (proc reason)
(let* ((buffer (process-buffer proc))
(name (buffer-name buffer)))
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(xscheme-process-filter-initialize (eq reason 'run))
(if (not (eq reason 'run))
(progn
@@ -983,8 +975,7 @@ the remaining input.")
(call-noexcursion nil))
(while xscheme-filter-input
(setq call-noexcursion nil)
- (save-excursion
- (set-buffer (process-buffer proc))
+ (with-current-buffer (process-buffer proc)
(cond ((eq xscheme-process-filter-state 'idle)
(let ((start (string-match "\e" xscheme-filter-input)))
(if start
@@ -1193,8 +1184,7 @@ the remaining input.")
string))
(defun xscheme-cd (directory-string)
- (save-excursion
- (set-buffer (xscheme-process-buffer))
+ (with-current-buffer (xscheme-process-buffer)
(cd directory-string)))
(defun xscheme-prompt-for-confirmation (prompt-string)