changeset 4775:1d61580e0cf7

Remove Fsave_window_excursion from window.c, it's overridden by Lisp. lisp/ChangeLog addition: 2009-11-08 Aidan Kehoe <kehoea@parhasard.net> * bytecomp.el (save-window-excursion): Remove the compiler form for this bytecode, we no longer generate calls to it. Keep the information about the bytecode's numeric value, we want that for disassembling code. src/ChangeLog addition: 2009-11-08 Aidan Kehoe <kehoea@parhasard.net> * window.c (Fsave_window_excursion, save_window_excursion_unwind): Remove these functions, the first was masked by #'save-window-excursion in window.el, and the second can be easily replaced with Lisp primitives. * bytecode.c (Bsave_window_excursion) : Don't pass save_window_excursion_unwind to record_unwind_protect, now the former is gone. * event-stream.c (execute_help_form): Ditto.
author Aidan Kehoe <kehoea@parhasard.net>
date Thu, 17 Dec 2009 12:57:38 +0000
parents 26a007fa2f4c
children 73e8632018ad
files lisp/ChangeLog lisp/bytecomp.el src/ChangeLog src/bytecode.c src/event-stream.c src/window.c src/window.h
diffstat 7 files changed, 29 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Tue Dec 15 13:45:48 2009 -0700
+++ b/lisp/ChangeLog	Thu Dec 17 12:57:38 2009 +0000
@@ -66,6 +66,13 @@
 	* buffer.el (switch-to-buffer): Don't offer the current buffer in
 	the completion list.
 
+2009-11-08  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* bytecomp.el (save-window-excursion): 
+	Remove the compiler form for this bytecode, we no longer generate
+	calls to it. Keep the information about the bytecode's numeric
+	value, we want that for disassembling code.
+
 2009-11-01  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* cl-extra.el (equalp): 
--- a/lisp/bytecomp.el	Tue Dec 15 13:45:48 2009 -0700
+++ b/lisp/bytecomp.el	Thu Dec 17 12:57:38 2009 +0000
@@ -684,7 +684,7 @@
 
 (byte-defop 138  0 byte-save-excursion
   "to make a binding to record the buffer, point and mark")
-(byte-defop 139  0 byte-save-window-excursion
+(byte-defop 139  0 byte-save-window-excursion ; almost obsolete
   "to make a binding to record entire window configuration")
 (byte-defop 140  0 byte-save-restriction
   "to make a binding to record the current buffer clipping restrictions")
@@ -4029,7 +4029,6 @@
 (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)
 ;; no track-mouse.
 
@@ -4128,11 +4127,6 @@
     (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))
-  (byte-compile-out 'byte-save-window-excursion 0))
-
 (defun byte-compile-with-output-to-temp-buffer (form)
   (byte-compile-form (car (cdr form)))
   (byte-compile-out 'byte-temp-output-buffer-setup 0)
--- a/src/ChangeLog	Tue Dec 15 13:45:48 2009 -0700
+++ b/src/ChangeLog	Thu Dec 17 12:57:38 2009 +0000
@@ -466,6 +466,18 @@
 
 2009-11-08  Aidan Kehoe  <kehoea@parhasard.net>
 
+	* window.c (Fsave_window_excursion, save_window_excursion_unwind): 
+	Remove these functions, the first was masked by
+	#'save-window-excursion in window.el, and the second can be easily
+	replaced with Lisp primitives.
+	* bytecode.c (Bsave_window_excursion) : Don't pass
+	save_window_excursion_unwind to record_unwind_protect, now the
+	former is gone.
+	* event-stream.c (execute_help_form): 
+	Ditto.
+
+2009-11-08  Aidan Kehoe  <kehoea@parhasard.net>
+
 	* sysfile.h (DEFAULT_DIRECTORY_FALLBACK):
 	New #define, "/" on Unix and "C:\\" on Win32 native, a directory
 	that should "always" be available.
--- a/src/bytecode.c	Tue Dec 15 13:45:48 2009 -0700
+++ b/src/bytecode.c	Thu Dec 17 12:57:38 2009 +0000
@@ -1455,11 +1455,15 @@
 			     save_excursion_save ());
       break;
 
+      /* This bytecode will eventually go away, once we no longer encounter
+         byte code from 21.4. In 21.5.10 and newer, save-window-excursion is
+         a macro. */
     case Bsave_window_excursion:
       {
 	int count = specpdl_depth ();
-	record_unwind_protect (save_window_excursion_unwind,
-			       call1 (Qcurrent_window_configuration, Qnil));
+	record_unwind_protect (Feval,
+                               list2 (Qset_window_configuration,
+                                      call0 (Qcurrent_window_configuration)));
 	TOP_LVALUE = Fprogn (TOP);
 	unbind_to (count);
 	break;
--- a/src/event-stream.c	Tue Dec 15 13:45:48 2009 -0700
+++ b/src/event-stream.c	Thu Dec 17 12:57:38 2009 +0000
@@ -839,8 +839,9 @@
   struct gcpro gcpro1, gcpro2;
   GCPRO2 (echo, help);
 
-  record_unwind_protect (save_window_excursion_unwind,
-			 call1 (Qcurrent_window_configuration, Qnil));
+  record_unwind_protect (Feval,
+                         list2 (Qset_window_configuration,
+                                call0 (Qcurrent_window_configuration)));
   reset_key_echo (command_builder, 1);
 
   help = IGNORE_MULTIPLE_VALUES (Feval (Vhelp_form));
--- a/src/window.c	Tue Dec 15 13:45:48 2009 -0700
+++ b/src/window.c	Thu Dec 17 12:57:38 2009 +0000
@@ -5267,30 +5267,6 @@
   mark_window_as_deleted (w);
 }
 
-Lisp_Object
-save_window_excursion_unwind (Lisp_Object window_config)
-{
-  Lisp_Object val = call1 (Qset_window_configuration, window_config);
-  return val;
-}
-
-DEFUN ("save-window-excursion", Fsave_window_excursion, 0, UNEVALLED, 0, /*
-Execute BODY, preserving window sizes and contents.
-Restores which buffer appears in which window, where display starts,
-as well as the current buffer.
-Does not restore the value of point in current buffer.
-
-arguments: (&rest BODY)
-*/
-       (args))
-{
-  /* This function can GC */
-  int speccount = specpdl_depth ();
-
-  record_unwind_protect (save_window_excursion_unwind,
-			 call1 (Qcurrent_window_configuration, Qnil));
-  return unbind_to_1 (speccount, Fprogn (args));
-}
 
 static int
 get_current_pixel_pos (Lisp_Object window, Lisp_Object pos,
@@ -5558,7 +5534,6 @@
 #ifdef MEMORY_USAGE_STATS
   DEFSUBR (Fwindow_memory_usage);
 #endif
-  DEFSUBR (Fsave_window_excursion);
   DEFSUBR (Fcurrent_pixel_column);
   DEFSUBR (Fcurrent_pixel_row);
 }
--- a/src/window.h	Tue Dec 15 13:45:48 2009 -0700
+++ b/src/window.h	Thu Dec 17 12:57:38 2009 +0000
@@ -105,7 +105,6 @@
 EXFUN (Fwindow_point, 1);
 EXFUN (Fwindow_start, 1);
 
-Lisp_Object save_window_excursion_unwind (Lisp_Object);
 extern Lisp_Object Qcurrent_window_configuration, Qset_window_configuration;
 Lisp_Object display_buffer (Lisp_Object, Lisp_Object, Lisp_Object);