aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2011-02-19 00:10:33 -0500
committerStefan Monnier2011-02-19 00:10:33 -0500
commite0f57e65692ed73a86926f737388b60faec92767 (patch)
treecd119f7a6f2a04673f304fbf8cfaf8fc7c0896f2 /src
parent9a05edc4fcf1eff8966ac327e479bb8f9ca219a9 (diff)
downloademacs-e0f57e65692ed73a86926f737388b60faec92767.tar.gz
emacs-e0f57e65692ed73a86926f737388b60faec92767.zip
* lisp/subr.el (save-window-excursion): New macro, moved from C.
* lisp/emacs-lisp/lisp-mode.el (save-window-excursion): Don't touch. * lisp/emacs-lisp/cconv.el (cconv-closure-convert-rec, cconv-analyse-form): Don't handle save-window-excursion any more. * lisp/emacs-lisp/bytecomp.el (interactive-p, save-window-excursion): Don't use the byte-code any more. (byte-compile-form): Check macro expansion was done. (byte-compile-save-window-excursion): Remove. * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Ignore save-window-excursion. Don't macroepand any more. * src/window.c (Fsave_window_excursion): Remove. Moved to Lisp. (syms_of_window): Don't defsubr it. * src/window.h (Fsave_window_excursion): Don't declare it. * src/bytecode.c (exec_byte_code): Inline Fsave_window_excursion.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/bytecode.c32
-rw-r--r--src/window.c23
-rw-r--r--src/window.h1
4 files changed, 27 insertions, 36 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 0b2ee8550ca..6bebce0abaa 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12011-02-19 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * window.c (Fsave_window_excursion): Remove. Moved to Lisp.
4 (syms_of_window): Don't defsubr it.
5 * window.h (Fsave_window_excursion): Don't declare it.
6 * bytecode.c (exec_byte_code): Inline Fsave_window_excursion.
7
12011-02-17 Stefan Monnier <monnier@iro.umontreal.ca> 82011-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
2 9
3 * eval.c (Vinternal_interpreter_environment): Remove. 10 * eval.c (Vinternal_interpreter_environment): Remove.
diff --git a/src/bytecode.c b/src/bytecode.c
index 1ad01aaf8f7..ad2f7d18ade 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -138,7 +138,7 @@ extern Lisp_Object Qand_optional, Qand_rest;
138 138
139#define Bpoint 0140 139#define Bpoint 0140
140/* Was Bmark in v17. */ 140/* Was Bmark in v17. */
141#define Bsave_current_buffer 0141 141#define Bsave_current_buffer 0141 /* Obsolete. */
142#define Bgoto_char 0142 142#define Bgoto_char 0142
143#define Binsert 0143 143#define Binsert 0143
144#define Bpoint_max 0144 144#define Bpoint_max 0144
@@ -158,7 +158,7 @@ extern Lisp_Object Qand_optional, Qand_rest;
158#define Bsave_current_buffer_1 0162 /* Replacing Bsave_current_buffer. */ 158#define Bsave_current_buffer_1 0162 /* Replacing Bsave_current_buffer. */
159#define Bread_char 0162 /* No longer generated as of v19 */ 159#define Bread_char 0162 /* No longer generated as of v19 */
160#define Bset_mark 0163 /* this loser is no longer generated as of v18 */ 160#define Bset_mark 0163 /* this loser is no longer generated as of v18 */
161#define Binteractive_p 0164 /* Needed since interactive-p takes unevalled args */ 161#define Binteractive_p 0164 /* Obsolete. */
162 162
163#define Bforward_char 0165 163#define Bforward_char 0165
164#define Bforward_word 0166 164#define Bforward_word 0166
@@ -183,7 +183,7 @@ extern Lisp_Object Qand_optional, Qand_rest;
183#define Bdup 0211 183#define Bdup 0211
184 184
185#define Bsave_excursion 0212 185#define Bsave_excursion 0212
186#define Bsave_window_excursion 0213 186#define Bsave_window_excursion 0213 /* Obsolete. */
187#define Bsave_restriction 0214 187#define Bsave_restriction 0214
188#define Bcatch 0215 188#define Bcatch 0215
189 189
@@ -192,7 +192,7 @@ extern Lisp_Object Qand_optional, Qand_rest;
192#define Btemp_output_buffer_setup 0220 192#define Btemp_output_buffer_setup 0220
193#define Btemp_output_buffer_show 0221 193#define Btemp_output_buffer_show 0221
194 194
195#define Bunbind_all 0222 195#define Bunbind_all 0222 /* Obsolete. */
196 196
197#define Bset_marker 0223 197#define Bset_marker 0223
198#define Bmatch_beginning 0224 198#define Bmatch_beginning 0224
@@ -763,7 +763,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
763 AFTER_POTENTIAL_GC (); 763 AFTER_POTENTIAL_GC ();
764 break; 764 break;
765 765
766 case Bunbind_all: 766 case Bunbind_all: /* Obsolete. */
767 /* To unbind back to the beginning of this frame. Not used yet, 767 /* To unbind back to the beginning of this frame. Not used yet,
768 but will be needed for tail-recursion elimination. */ 768 but will be needed for tail-recursion elimination. */
769 BEFORE_POTENTIAL_GC (); 769 BEFORE_POTENTIAL_GC ();
@@ -891,16 +891,24 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
891 save_excursion_save ()); 891 save_excursion_save ());
892 break; 892 break;
893 893
894 case Bsave_current_buffer: 894 case Bsave_current_buffer: /* Obsolete. */
895 case Bsave_current_buffer_1: 895 case Bsave_current_buffer_1:
896 record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); 896 record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ());
897 break; 897 break;
898 898
899 case Bsave_window_excursion: 899 case Bsave_window_excursion: /* Obsolete. */
900 BEFORE_POTENTIAL_GC (); 900 {
901 TOP = Fsave_window_excursion (TOP); /* FIXME: lexbind */ 901 register Lisp_Object val;
902 AFTER_POTENTIAL_GC (); 902 register int count = SPECPDL_INDEX ();
903 break; 903
904 record_unwind_protect (Fset_window_configuration,
905 Fcurrent_window_configuration (Qnil));
906 BEFORE_POTENTIAL_GC ();
907 TOP = Fprogn (TOP);
908 unbind_to (count, TOP);
909 AFTER_POTENTIAL_GC ();
910 break;
911 }
904 912
905 case Bsave_restriction: 913 case Bsave_restriction:
906 record_unwind_protect (save_restriction_restore, 914 record_unwind_protect (save_restriction_restore,
@@ -1412,7 +1420,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
1412 AFTER_POTENTIAL_GC (); 1420 AFTER_POTENTIAL_GC ();
1413 break; 1421 break;
1414 1422
1415 case Binteractive_p: 1423 case Binteractive_p: /* Obsolete. */
1416 PUSH (Finteractive_p ()); 1424 PUSH (Finteractive_p ());
1417 break; 1425 break;
1418 1426
diff --git a/src/window.c b/src/window.c
index abf01758c3f..c90cc268a92 100644
--- a/src/window.c
+++ b/src/window.c
@@ -6400,28 +6400,6 @@ redirection (see `redirect-frame-focus'). */)
6400 return (tem); 6400 return (tem);
6401} 6401}
6402 6402
6403DEFUN ("save-window-excursion", Fsave_window_excursion, Ssave_window_excursion,
6404 0, UNEVALLED, 0,
6405 doc: /* Execute BODY, preserving window sizes and contents.
6406Return the value of the last form in BODY.
6407Restore which buffer appears in which window, where display starts,
6408and the value of point and mark for each window.
6409Also restore the choice of selected window.
6410Also restore which buffer is current.
6411Does not restore the value of point in current buffer.
6412usage: (save-window-excursion BODY...) */)
6413 (Lisp_Object args)
6414{
6415 register Lisp_Object val;
6416 register int count = SPECPDL_INDEX ();
6417
6418 record_unwind_protect (Fset_window_configuration,
6419 Fcurrent_window_configuration (Qnil));
6420 val = Fprogn (args);
6421 return unbind_to (count, val);
6422}
6423
6424
6425 6403
6426/*********************************************************************** 6404/***********************************************************************
6427 Window Split Tree 6405 Window Split Tree
@@ -7195,7 +7173,6 @@ frame to be redrawn only if it is a tty frame. */);
7195 defsubr (&Swindow_configuration_frame); 7173 defsubr (&Swindow_configuration_frame);
7196 defsubr (&Sset_window_configuration); 7174 defsubr (&Sset_window_configuration);
7197 defsubr (&Scurrent_window_configuration); 7175 defsubr (&Scurrent_window_configuration);
7198 defsubr (&Ssave_window_excursion);
7199 defsubr (&Swindow_tree); 7176 defsubr (&Swindow_tree);
7200 defsubr (&Sset_window_margins); 7177 defsubr (&Sset_window_margins);
7201 defsubr (&Swindow_margins); 7178 defsubr (&Swindow_margins);
diff --git a/src/window.h b/src/window.h
index 491ffa30bd1..473a43bbc3c 100644
--- a/src/window.h
+++ b/src/window.h
@@ -860,7 +860,6 @@ EXFUN (Fwindow_minibuffer_p, 1);
860EXFUN (Fdelete_window, 1); 860EXFUN (Fdelete_window, 1);
861EXFUN (Fwindow_buffer, 1); 861EXFUN (Fwindow_buffer, 1);
862EXFUN (Fget_buffer_window, 2); 862EXFUN (Fget_buffer_window, 2);
863EXFUN (Fsave_window_excursion, UNEVALLED);
864EXFUN (Fset_window_configuration, 1); 863EXFUN (Fset_window_configuration, 1);
865EXFUN (Fcurrent_window_configuration, 1); 864EXFUN (Fcurrent_window_configuration, 1);
866extern int compare_window_configurations (Lisp_Object, Lisp_Object, int); 865extern int compare_window_configurations (Lisp_Object, Lisp_Object, int);