bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#6454: 24.0.50; kill-buffer switches current-buffer


From: martin rudalics
Subject: bug#6454: 24.0.50; kill-buffer switches current-buffer
Date: Mon, 21 Jun 2010 12:46:05 +0200
User-agent: Thunderbird 2.0.0.21 (Windows/20090302)

> Below are two patches.  The first essentially adds a save-excursion
> around the whole function.
>
> The second patch adds a function run_hook_in_buffer. It iterates over
> the functions in the hook and for each function explicitly sets the
> buffer before calling it.  I had to introduce a new macro
> DO_HOOK_FUNCTIONS which is a big hammer for this, but I couldn't find a
> better way.

Thanks.  I applied them here and will run them for a while to see
whether and what they change.  BTW run_window_scroll_functions in
xdisp.c has

      run_hook_with_args_2 (Qwindow_scroll_functions, window,
                            make_number (CHARPOS (startp)));
      SET_TEXT_POS_FROM_MARKER (startp, w->start);
      /* In case the hook functions switch buffers.  */
      if (current_buffer != XBUFFER (w->buffer))
        set_buffer_internal_1 (XBUFFER (w->buffer));

so with your patch this is probably no more needed?

Now, when a function run by a hook wants to change the current buffer it
cannot do so any more.  Admittedly this was unreliable before so we
probably won't lose much ...

martin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]