summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/authors.el6
-rw-r--r--lisp/emacs-lisp/chart.el3
-rw-r--r--lisp/emacs-lisp/cust-print.el6
-rw-r--r--lisp/emacs-lisp/debug.el3
-rw-r--r--lisp/emacs-lisp/edebug.el3
-rw-r--r--lisp/emacs-lisp/eieio-base.el3
-rw-r--r--lisp/emacs-lisp/eieio-opt.el9
-rw-r--r--lisp/emacs-lisp/find-gc.el3
-rw-r--r--lisp/emacs-lisp/gulp.el3
-rw-r--r--lisp/emacs-lisp/pp.el6
-rw-r--r--lisp/emacs-lisp/re-builder.el3
11 files changed, 16 insertions, 32 deletions
diff --git a/lisp/emacs-lisp/authors.el b/lisp/emacs-lisp/authors.el
index 1b60f339081..7eb61dd1a5a 100644
--- a/lisp/emacs-lisp/authors.el
+++ b/lisp/emacs-lisp/authors.el
@@ -706,8 +706,7 @@ with the file and the number of each action:
(existing-buffer (get-file-buffer log-file))
(buffer (find-file-noselect log-file))
authors file pos)
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(save-restriction
(widen)
(goto-char (point-min))
@@ -758,8 +757,7 @@ TABLE is a hash table to add author information to."
(enable-local-eval nil)
(buffer (find-file-noselect file)))
(setq file (file-name-nondirectory file))
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(save-restriction
(widen)
(goto-char (point-min))
diff --git a/lisp/emacs-lisp/chart.el b/lisp/emacs-lisp/chart.el
index 1ec7fda4014..0f0e4046167 100644
--- a/lisp/emacs-lisp/chart.el
+++ b/lisp/emacs-lisp/chart.el
@@ -134,8 +134,7 @@ Useful if new Emacs is used on B&W display.")
(defun chart-new-buffer (obj)
"Create a new buffer NAME in which the chart OBJ is displayed.
Returns the newly created buffer."
- (save-excursion
- (set-buffer (get-buffer-create (format "*%s*" (oref obj title))))
+ (with-current-buffer (get-buffer-create (format "*%s*" (oref obj title)))
(chart-mode)
(setq chart-local-object obj)
(current-buffer)))
diff --git a/lisp/emacs-lisp/cust-print.el b/lisp/emacs-lisp/cust-print.el
index f3a571d5b3f..b9591739cbd 100644
--- a/lisp/emacs-lisp/cust-print.el
+++ b/lisp/emacs-lisp/cust-print.el
@@ -332,15 +332,13 @@ This is the custom-print replacement for the standard `prin1-to-string'."
(let ((buf (get-buffer-create " *custom-print-temp*")))
;; We must erase the buffer before printing in case an error
;; occurred during the last prin1-to-string and we are in debugger.
- (save-excursion
- (set-buffer buf)
+ (with-current-buffer buf
(erase-buffer))
;; We must be in the current-buffer when the print occurs.
(if noescape
(custom-princ object buf)
(custom-prin1 object buf))
- (save-excursion
- (set-buffer buf)
+ (with-current-buffer buf
(buffer-string)
;; We could erase the buffer again, but why bother?
)))
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index 59c37a5f3d5..f03e0ab9e40 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -329,8 +329,7 @@ That buffer should be current already."
(defun debugger-make-xrefs (&optional buffer)
"Attach cross-references to function names in the `*Backtrace*' buffer."
(interactive "b")
- (save-excursion
- (set-buffer (or buffer (current-buffer)))
+ (with-current-buffer (or buffer (current-buffer))
(setq buffer (current-buffer))
(let ((inhibit-read-only t)
(old-end (point-min)) (new-end (point-min)))
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index fe47074bf97..68c9659e8f3 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -3605,8 +3605,7 @@ Return the result of the last expression."
)
(setq-default cursor-in-non-selected-windows edebug-outside-d-c-i-n-s-w)
(unwind-protect
- (save-excursion ; of edebug-buffer
- (set-buffer edebug-outside-buffer)
+ (with-current-buffer edebug-outside-buffer ; of edebug-buffer
(goto-char edebug-outside-point)
(if (marker-buffer (edebug-mark-marker))
(set-marker (edebug-mark-marker) edebug-outside-mark))
diff --git a/lisp/emacs-lisp/eieio-base.el b/lisp/emacs-lisp/eieio-base.el
index f624714f8a6..a8a219edeb5 100644
--- a/lisp/emacs-lisp/eieio-base.el
+++ b/lisp/emacs-lisp/eieio-base.el
@@ -230,8 +230,7 @@ a file. Optional argument NAME specifies a default file name."
(buffstr nil))
(unwind-protect
(progn
- (save-excursion
- (set-buffer (get-buffer-create " *tmp eieio read*"))
+ (with-current-buffer (get-buffer-create " *tmp eieio read*")
(insert-file-contents filename nil nil nil t)
(goto-char (point-min))
(setq buffstr (buffer-string)))
diff --git a/lisp/emacs-lisp/eieio-opt.el b/lisp/emacs-lisp/eieio-opt.el
index 499f5ebf45a..4afe1738a81 100644
--- a/lisp/emacs-lisp/eieio-opt.el
+++ b/lisp/emacs-lisp/eieio-opt.el
@@ -43,8 +43,7 @@ variable `eieio-default-superclass'."
(if (not root-class) (setq root-class 'eieio-default-superclass))
(if (not (class-p root-class)) (signal 'wrong-type-argument (list 'class-p root-class)))
(display-buffer (get-buffer-create "*EIEIO OBJECT BROWSE*") t)
- (save-excursion
- (set-buffer (get-buffer "*EIEIO OBJECT BROWSE*"))
+ (with-current-buffer (get-buffer "*EIEIO OBJECT BROWSE*")
(erase-buffer)
(goto-char 0)
(eieio-browse-tree root-class "" "")
@@ -161,8 +160,7 @@ Optional HEADERFCN should be called to insert a few bits of info first."
(terpri)
(terpri))
(setq methods (cdr methods))))))
- (save-excursion
- (set-buffer (help-buffer))
+ (with-current-buffer (help-buffer)
(buffer-string)))
(defun eieio-describe-class-slots (class)
@@ -376,8 +374,7 @@ Also extracts information about all methods specific to this generic."
(terpri)
(terpri)))
(setq i (1+ i)))))
- (save-excursion
- (set-buffer (help-buffer))
+ (with-current-buffer (help-buffer)
(buffer-string)))
(defun eieio-lambda-arglist (func)
diff --git a/lisp/emacs-lisp/find-gc.el b/lisp/emacs-lisp/find-gc.el
index 180c3b8a843..1b60b25dc0e 100644
--- a/lisp/emacs-lisp/find-gc.el
+++ b/lisp/emacs-lisp/find-gc.el
@@ -113,8 +113,7 @@ Also store it in `find-gc-unsafe'."
(call-process "csh" nil nil nil "-c"
(format "ln -s %s/*.[ch] /tmp/esrc"
find-gc-source-directory))))
- (save-excursion
- (set-buffer (get-buffer-create "*Trace Call Tree*"))
+ (with-current-buffer (get-buffer-create "*Trace Call Tree*")
(setq find-gc-subrs-called nil)
(let ((case-fold-search nil)
(files find-gc-source-files)
diff --git a/lisp/emacs-lisp/gulp.el b/lisp/emacs-lisp/gulp.el
index 475e2ad753a..cdc2a66be4b 100644
--- a/lisp/emacs-lisp/gulp.el
+++ b/lisp/emacs-lisp/gulp.el
@@ -91,8 +91,7 @@ You can't edit the messages, but you can confirm whether to send each one.
The list of addresses for which you decided not to send mail
is left in the `*gulp*' buffer at the end."
(interactive "DRequest updates for Lisp directory: \nP")
- (save-excursion
- (set-buffer (get-buffer-create gulp-tmp-buffer))
+ (with-current-buffer (get-buffer-create gulp-tmp-buffer)
(let ((m-p-alist (gulp-create-m-p-alist
(directory-files dir nil "^[^=].*\\.el$" t)
dir))
diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el
index 55ae740bd38..45e659efd30 100644
--- a/lisp/emacs-lisp/pp.el
+++ b/lisp/emacs-lisp/pp.el
@@ -42,8 +42,7 @@
"Return a string containing the pretty-printed representation of OBJECT.
OBJECT can be any Lisp object. Quoting characters are used as needed
to make output that `read' can handle, whenever this is possible."
- (save-excursion
- (set-buffer (generate-new-buffer " pp-to-string"))
+ (with-current-buffer (generate-new-buffer " pp-to-string")
(unwind-protect
(progn
(lisp-mode-variables nil)
@@ -105,8 +104,7 @@ after OUT-BUFFER-NAME."
(temp-buffer-show-function
(function
(lambda (buf)
- (save-excursion
- (set-buffer buf)
+ (with-current-buffer buf
(goto-char (point-min))
(end-of-line 1)
(if (or (< (1+ (point)) (point-max))
diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el
index 31f7d8da49e..4b64f7aa808 100644
--- a/lisp/emacs-lisp/re-builder.el
+++ b/lisp/emacs-lisp/re-builder.el
@@ -658,8 +658,7 @@ If SUBEXP is non-nil mark only the corresponding sub-expressions."
(matches 0)
(submatches 0)
firstmatch)
- (save-excursion
- (set-buffer reb-target-buffer)
+ (with-current-buffer reb-target-buffer
(reb-delete-overlays)
(goto-char (point-min))
(while (and (not (eobp))