aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorStefan Monnier2003-07-15 19:32:05 +0000
committerStefan Monnier2003-07-15 19:32:05 +0000
commit27c6b98e3b0c7a89a41bfcc6a66e0ad63860dabe (patch)
tree0151cc389a6a1d6df047ca35465805883a034b94 /src/buffer.c
parent08b7c2cbf381616c51799da3981e32c442655a6b (diff)
downloademacs-27c6b98e3b0c7a89a41bfcc6a66e0ad63860dabe.tar.gz
emacs-27c6b98e3b0c7a89a41bfcc6a66e0ad63860dabe.zip
(copy_overlays): Use EMACS_INT for positions.
(Fswitch_to_buffer): Don't signal an error when switching to the same buffer in a dedicated window.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c
index c14d874f1d6..cbbe4153106 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -447,7 +447,7 @@ copy_overlays (b, list)
447 for (; list; list = list->next) 447 for (; list; list = list->next)
448 { 448 {
449 Lisp_Object overlay, start, end, old_overlay; 449 Lisp_Object overlay, start, end, old_overlay;
450 int charpos; 450 EMACS_INT charpos;
451 451
452 XSETMISC (old_overlay, list); 452 XSETMISC (old_overlay, list);
453 charpos = marker_position (OVERLAY_START (old_overlay)); 453 charpos = marker_position (OVERLAY_START (old_overlay));
@@ -1630,6 +1630,11 @@ the window-buffer correspondences. */)
1630{ 1630{
1631 char *err; 1631 char *err;
1632 1632
1633 if (EQ (buffer, Fwindow_buffer (selected_window)))
1634 /* Basically a NOP. Avoid signalling an error if the selected window
1635 is dedicated, or a minibuffer, ... */
1636 return Fset_buffer (buffer);
1637
1633 err = no_switch_window (selected_window); 1638 err = no_switch_window (selected_window);
1634 if (err) error (err); 1639 if (err) error (err);
1635 1640
@@ -4098,6 +4103,14 @@ report_overlay_modification (start, end, after, arg1, arg2, arg3)
4098 overlay = Qnil; 4103 overlay = Qnil;
4099 tail = NULL; 4104 tail = NULL;
4100 4105
4106 /* We used to run the functions as soon as we found them and only register
4107 them in last_overlay_modification_hooks for the purpose of the `after'
4108 case. But running elisp code as we traverse the list of overlays is
4109 painful because the list can be modified by the elisp code so we had to
4110 copy at several places. We now simply do a read-only traversal that
4111 only collects the functions to run and we run them afterwards. It's
4112 simpler, especially since all the code was already there. -stef */
4113
4101 if (!after) 4114 if (!after)
4102 { 4115 {
4103 /* We are being called before a change. 4116 /* We are being called before a change.