summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-09-22 04:37:55 +0000
committerRichard M. Stallman <rms@gnu.org>1996-09-22 04:37:55 +0000
commite45c5b737cd186c3f1a4f00846b3c27ea6feeea8 (patch)
treeb799449584cd5d1686fc2d8288fe9efb5a4d8974
parentec6795875dd4d78788ed6842e708121d525eeb95 (diff)
downloademacs-e45c5b737cd186c3f1a4f00846b3c27ea6feeea8.tar.gz
(save-current-buffer): Compile it like save-excursion.
(byte-compile-save-current-buffer): New function.
-rw-r--r--lisp/emacs-lisp/bytecomp.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 719584bfcc9..a36ecceadc7 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -10,7 +10,7 @@
;;; This version incorporates changes up to version 2.10 of the
;;; Zawinski-Furuseth compiler.
-(defconst byte-compile-version "$Revision: 2.19 $")
+(defconst byte-compile-version "$Revision: 2.20 $")
;; This file is part of GNU Emacs.
@@ -489,7 +489,8 @@ Each element is (INDEX . VALUE)")
(byte-defop 94 -1 byte-min)
(byte-defop 95 -1 byte-mult) ; v19 only
(byte-defop 96 1 byte-point)
-(byte-defop 97 1 byte-mark-OBSOLETE) ; no longer generated as of v18
+(byte-defop 97 0 byte-save-current-buffer
+ "To make a binding to record the current buffer")
(byte-defop 98 0 byte-goto-char)
(byte-defop 99 0 byte-insert)
(byte-defop 100 1 byte-point-max)
@@ -2870,6 +2871,7 @@ If FORM is a lambda or a macro, byte-compile it as a function."
(byte-defop-compiler-1 unwind-protect)
(byte-defop-compiler-1 condition-case)
(byte-defop-compiler-1 save-excursion)
+(byte-defop-compiler-1 save-current-buffer)
(byte-defop-compiler-1 save-restriction)
(byte-defop-compiler-1 save-window-excursion)
(byte-defop-compiler-1 with-output-to-temp-buffer)
@@ -2951,6 +2953,11 @@ If FORM is a lambda or a macro, byte-compile it as a function."
(byte-compile-body-do-effect (cdr form))
(byte-compile-out 'byte-unbind 1))
+(defun byte-compile-save-current-buffer (form)
+ (byte-compile-out 'byte-save-current-buffer 0)
+ (byte-compile-body-do-effect (cdr form))
+ (byte-compile-out 'byte-unbind 1))
+
(defun byte-compile-save-window-excursion (form)
(byte-compile-push-constant
(byte-compile-top-level-body (cdr form) for-effect))