]> git.eshelyaron.com Git - emacs.git/commitdiff
(copy_overlays): Use EMACS_INT for positions.
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 15 Jul 2003 19:32:05 +0000 (19:32 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 15 Jul 2003 19:32:05 +0000 (19:32 +0000)
(Fswitch_to_buffer): Don't signal an error when switching to the same
buffer in a dedicated window.

src/buffer.c

index c14d874f1d68d30461762aa07dd6fdac4aa1e191..cbbe41531066ad32f626d26f484b2d6d854fb300 100644 (file)
@@ -447,7 +447,7 @@ copy_overlays (b, list)
   for (; list; list = list->next)
     {
       Lisp_Object overlay, start, end, old_overlay;
-      int charpos;
+      EMACS_INT charpos;
 
       XSETMISC (old_overlay, list);
       charpos = marker_position (OVERLAY_START (old_overlay));
@@ -1630,6 +1630,11 @@ the window-buffer correspondences.  */)
 {
   char *err;
 
+  if (EQ (buffer, Fwindow_buffer (selected_window)))
+    /* Basically a NOP.  Avoid signalling an error if the selected window
+       is dedicated, or a minibuffer, ...  */
+    return Fset_buffer (buffer);
+
   err = no_switch_window (selected_window);
   if (err) error (err);
 
@@ -4098,6 +4103,14 @@ report_overlay_modification (start, end, after, arg1, arg2, arg3)
   overlay = Qnil;
   tail = NULL;
 
+  /* We used to run the functions as soon as we found them and only register
+     them in last_overlay_modification_hooks for the purpose of the `after'
+     case.  But running elisp code as we traverse the list of overlays is
+     painful because the list can be modified by the elisp code so we had to
+     copy at several places.  We now simply do a read-only traversal that
+     only collects the functions to run and we run them afterwards.  It's
+     simpler, especially since all the code was already there.  -stef  */
+
   if (!after)
     {
       /* We are being called before a change.