unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Alp Aker <alptekin.aker@gmail.com>
Cc: Dave Abrahams <dave@boostpro.com>, 12081@debbugs.gnu.org
Subject: bug#12081: 24.1; buffer-predicate often not called
Date: Mon, 30 Jul 2012 19:42:34 +0200	[thread overview]
Message-ID: <5016C78A.3020001@gmx.at> (raw)
In-Reply-To: <CACxch4rRHHSmV=fMD_ynJWppywKvKp1t=RnK2ueN-j-O76XZSg@mail.gmail.com>

 > Adding a buffer predicate test creates a new edge case, which the
 > above code is intended to handle.

It doesn't.  The edge case is already here.

 > With the existing code, it's guaranteed that either (1) we switch to a
 > new buffer while scanning the next buffers or the prev buffers, or (2)
 > we finish those scans with `visible' set to a buffer we can switch to.

No.  Try killing *scratch* with *scratch* the only buffer one can switch
to.

 >  By adding a buffer predicate test to the loops, we break that
 > guarantee; it becomes possible to finish the scan without switching to
 > a new buffer and without setting `visible' to a candidate new buffer.
 > This would break the function unless we provide for that case.

Let's hope not.

 > The question then becomes, how to deal with such a case (when the scan
 > of prev and next buffers does not switch to a new buffer and does not
 > set `visible').  One obvious option is:  Do nothing, and adjust the
 > rest of the function to accomodate that possibility.  Another is to
 > choose *scratch* as the fallback value for `new-buffer', when no other
 > buffer passes all the tests.  The latter seemed to me to be
 > preferable, as it makes replace-buffer-in-windows and
 > replace_buffer_in_windows_safely have similar fallback behavior, and
 > agrees with the fallback behavior of other-buffer as well.

With Emacs 23 I had a scenario (which is much too complicated to repeat
here) to crash Emacs by repeatedly trying to kill all buffers.  That's
why I wrote replace_buffer_in_windows_safely which relies on
other_buffer_safely to reliably recreate *scratch* if needed.  I don't
want to play with Elisp code called by C code recreating the buffer the
C code is just about to delete.  Let's keep other_buffer_safely the only
routine allowed to auto-recreate *scratch* and let's not call routines
like replace_buffer_in_windows_safely and other_buffer_safely from
Elisp.

If you really experience problems after applying the rest of the patch,
we'll find a solution ;-)

martin





      parent reply	other threads:[~2012-07-30 17:42 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-28 20:47 bug#12081: 24.1; buffer-predicate often not called Dave Abrahams
2012-07-29 13:56 ` martin rudalics
2012-07-29 15:05   ` Dave Abrahams
2012-07-29 17:08     ` martin rudalics
2012-07-29 17:31       ` Alp Aker
2012-07-29 18:24         ` Dave Abrahams
2012-07-29 21:37         ` Dave Abrahams
2012-07-29 23:30           ` Alp Aker
2012-07-29 23:53             ` Dave Abrahams
2012-07-30  9:13         ` martin rudalics
2012-07-30  9:35           ` Dave Abrahams
2012-07-30 17:42             ` martin rudalics
2012-07-30 20:13               ` Dave Abrahams
2012-07-31  8:39                 ` martin rudalics
2012-08-13 22:13                   ` Dave Abrahams
2012-08-14  9:09                     ` martin rudalics
2012-08-14 16:07                       ` Dave Abrahams
2012-07-30 16:22           ` Alp Aker
2012-07-30 16:33             ` Alp Aker
2012-07-30 17:42               ` martin rudalics
2012-07-31  6:59                 ` Alp Aker
2012-07-31  8:40                   ` martin rudalics
2012-08-31 17:15                   ` martin rudalics
2012-09-05 14:30                     ` martin rudalics
2012-07-30 17:42             ` martin rudalics [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5016C78A.3020001@gmx.at \
    --to=rudalics@gmx.at \
    --cc=12081@debbugs.gnu.org \
    --cc=alptekin.aker@gmail.com \
    --cc=dave@boostpro.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).