[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r109798: Always use set_buffer_if_liv
From: |
Dmitry Antipov |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r109798: Always use set_buffer_if_live to restore original buffer at unwind. |
Date: |
Tue, 28 Aug 2012 10:20:08 +0400 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 109798
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Tue 2012-08-28 10:20:08 +0400
message:
Always use set_buffer_if_live to restore original buffer at unwind.
* buffer.h (record_unwind_current_buffer): New function.
* bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
* keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
* undo.c, window.c: Adjust users.
* buffer.c (set_buffer_if_live): Fix comment.
modified:
src/ChangeLog
src/buffer.c
src/buffer.h
src/bytecode.c
src/dispnew.c
src/editfns.c
src/fileio.c
src/fns.c
src/insdel.c
src/keyboard.c
src/keymap.c
src/minibuf.c
src/print.c
src/process.c
src/textprop.c
src/undo.c
src/window.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2012-08-28 05:49:02 +0000
+++ b/src/ChangeLog 2012-08-28 06:20:08 +0000
@@ -1,5 +1,14 @@
2012-08-28 Dmitry Antipov <address@hidden>
+ Always use set_buffer_if_live to restore original buffer at unwind.
+ * buffer.h (record_unwind_current_buffer): New function.
+ * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
+ * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
+ * undo.c, window.c: Adjust users.
+ * buffer.c (set_buffer_if_live): Fix comment.
+
+2012-08-28 Dmitry Antipov <address@hidden>
+
Fix usage of set_buffer_internal.
* buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
* buffer.c (set_buffer_if_live): Use set_buffer_internal.
=== modified file 'src/buffer.c'
--- a/src/buffer.c 2012-08-28 05:49:02 +0000
+++ b/src/buffer.c 2012-08-28 06:20:08 +0000
@@ -2204,7 +2204,7 @@
return buffer;
}
-/* Set the current buffer to BUFFER provided it is alive. */
+/* Set the current buffer to BUFFER provided if it is alive. */
Lisp_Object
set_buffer_if_live (Lisp_Object buffer)
=== modified file 'src/buffer.h'
--- a/src/buffer.h 2012-08-28 05:49:02 +0000
+++ b/src/buffer.h 2012-08-28 06:20:08 +0000
@@ -1038,6 +1038,15 @@
set_buffer_internal_1 (b);
}
+/* Arrange to go back to the original buffer after the next
+ call to unbind_to if the original buffer is still alive. */
+
+BUFFER_INLINE void
+record_unwind_current_buffer (void)
+{
+ record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ());
+}
+
/* Get overlays at POSN into array OVERLAYS with NOVERLAYS elements.
If NEXTP is non-NULL, return next overlay there.
See overlay_at arg CHANGE_REQ for meaning of CHRQ arg. */
=== modified file 'src/bytecode.c'
--- a/src/bytecode.c 2012-08-25 03:11:12 +0000
+++ b/src/bytecode.c 2012-08-28 06:20:08 +0000
@@ -1051,7 +1051,7 @@
CASE (Bsave_current_buffer): /* Obsolete since ??. */
CASE (Bsave_current_buffer_1):
- record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ());
+ record_unwind_current_buffer ();
NEXT;
CASE (Bsave_window_excursion): /* Obsolete since 24.1. */
=== modified file 'src/dispnew.c'
--- a/src/dispnew.c 2012-08-28 00:33:56 +0000
+++ b/src/dispnew.c 2012-08-28 06:20:08 +0000
@@ -5762,7 +5762,7 @@
UNBLOCK_INPUT;
- record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
+ record_unwind_current_buffer ();
run_window_configuration_change_hook (f);
=== modified file 'src/editfns.c'
--- a/src/editfns.c 2012-08-21 23:39:56 +0000
+++ b/src/editfns.c 2012-08-28 06:20:08 +0000
@@ -946,13 +946,10 @@
usage: (save-current-buffer &rest BODY) */)
(Lisp_Object args)
{
- Lisp_Object val;
ptrdiff_t count = SPECPDL_INDEX ();
- record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ());
-
- val = Fprogn (args);
- return unbind_to (count, val);
+ record_unwind_current_buffer ();
+ return unbind_to (count, Fprogn (args));
}
DEFUN ("buffer-size", Fbufsize, Sbufsize, 0, 1, 0,
=== modified file 'src/fileio.c'
--- a/src/fileio.c 2012-08-28 05:49:02 +0000
+++ b/src/fileio.c 2012-08-28 06:20:08 +0000
@@ -3480,7 +3480,7 @@
Lisp_Object workbuf;
struct buffer *buf;
- record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
+ record_unwind_current_buffer ();
workbuf = Fget_buffer_create (build_string ("
*code-converting-work*"));
buf = XBUFFER (workbuf);
=== modified file 'src/fns.c'
--- a/src/fns.c 2012-08-28 05:49:02 +0000
+++ b/src/fns.c 2012-08-28 06:20:08 +0000
@@ -4656,7 +4656,7 @@
{
struct buffer *prev = current_buffer;
- record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
+ record_unwind_current_buffer ();
CHECK_BUFFER (object);
=== modified file 'src/insdel.c'
--- a/src/insdel.c 2012-08-28 05:49:02 +0000
+++ b/src/insdel.c 2012-08-28 06:20:08 +0000
@@ -2117,7 +2117,7 @@
return Qnil;
}
- record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
+ record_unwind_current_buffer ();
Fset_buffer (combine_after_change_buffer);
=== modified file 'src/keyboard.c'
--- a/src/keyboard.c 2012-08-28 05:49:02 +0000
+++ b/src/keyboard.c 2012-08-28 06:20:08 +0000
@@ -9572,7 +9572,7 @@
because we may get input from a subprocess which
wants to change the selected window and stuff (say,
emacsclient). */
- record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
+ record_unwind_current_buffer ();
if (! FRAME_LIVE_P (XFRAME (selected_frame)))
Fkill_emacs (Qnil);
=== modified file 'src/keymap.c'
--- a/src/keymap.c 2012-08-18 06:06:39 +0000
+++ b/src/keymap.c 2012-08-28 06:20:08 +0000
@@ -1570,9 +1570,7 @@
would not be a problem here, but it is easier to keep
things the same.
*/
-
- record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
-
+ record_unwind_current_buffer ();
set_buffer_internal (XBUFFER (XWINDOW (window)->buffer));
}
}
=== modified file 'src/minibuf.c'
--- a/src/minibuf.c 2012-08-18 06:06:39 +0000
+++ b/src/minibuf.c 2012-08-28 06:20:08 +0000
@@ -817,7 +817,7 @@
while the buffer doesn't know about them any more. */
delete_all_overlays (XBUFFER (buf));
reset_buffer (XBUFFER (buf));
- record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
+ record_unwind_current_buffer ();
Fset_buffer (buf);
if (!NILP (Ffboundp (intern ("minibuffer-inactive-mode"))))
call0 (intern ("minibuffer-inactive-mode"));
=== modified file 'src/print.c'
--- a/src/print.c 2012-08-28 05:49:02 +0000
+++ b/src/print.c 2012-08-28 06:20:08 +0000
@@ -487,7 +487,7 @@
register struct buffer *old = current_buffer;
register Lisp_Object buf;
- record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ());
+ record_unwind_current_buffer ();
Fset_buffer (Fget_buffer_create (build_string (bufname)));
=== modified file 'src/process.c'
--- a/src/process.c 2012-08-27 17:23:48 +0000
+++ b/src/process.c 2012-08-28 06:20:08 +0000
@@ -5196,7 +5196,7 @@
/* There's no good reason to let process filters change the current
buffer, and many callers of accept-process-output, sit-for, and
friends don't expect current-buffer to be changed from under them. */
- record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ());
+ record_unwind_current_buffer ();
/* Read and dispose of the process output. */
outstream = p->filter;
@@ -6587,7 +6587,7 @@
/* There's no good reason to let sentinels change the current
buffer, and many callers of accept-process-output, sit-for, and
friends don't expect current-buffer to be changed from under them. */
- record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ());
+ record_unwind_current_buffer ();
sentinel = p->sentinel;
if (NILP (sentinel))
=== modified file 'src/textprop.c'
--- a/src/textprop.c 2012-08-17 21:12:11 +0000
+++ b/src/textprop.c 2012-08-28 06:20:08 +0000
@@ -760,7 +760,7 @@
if (BUFFERP (object) && current_buffer != XBUFFER (object))
{
- record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
+ record_unwind_current_buffer ();
Fset_buffer (object);
}
@@ -843,7 +843,7 @@
if (BUFFERP (object) && current_buffer != XBUFFER (object))
{
- record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
+ record_unwind_current_buffer ();
Fset_buffer (object);
}
=== modified file 'src/undo.c'
--- a/src/undo.c 2012-08-18 06:06:39 +0000
+++ b/src/undo.c 2012-08-28 06:20:08 +0000
@@ -324,7 +324,7 @@
/* Make the buffer current to get its local values of variables such
as undo_limit. Also so that Vundo_outer_limit_function can
tell which buffer to operate on. */
- record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ());
+ record_unwind_current_buffer ();
set_buffer_internal (b);
list = BVAR (b, undo_list);
=== modified file 'src/window.c'
--- a/src/window.c 2012-08-27 21:07:32 +0000
+++ b/src/window.c 2012-08-28 06:20:08 +0000
@@ -3101,7 +3101,7 @@
/* Use the right buffer. Matters when running the local hooks. */
if (current_buffer != XBUFFER (Fwindow_buffer (Qnil)))
{
- record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
+ record_unwind_current_buffer ();
Fset_buffer (Fwindow_buffer (Qnil));
}
@@ -3205,7 +3205,7 @@
because that might itself be a local variable. */
if (window_initialized)
{
- record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
+ record_unwind_current_buffer ();
Fset_buffer (buffer);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r109798: Always use set_buffer_if_live to restore original buffer at unwind.,
Dmitry Antipov <=