From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#12081: 24.1; buffer-predicate often not called Date: Tue, 31 Jul 2012 10:40:15 +0200 Message-ID: <501799EF.1060600@gmx.at> References: <5015411C.30803@gmx.at> <50156DFA.8030104@gmx.at> <5016502A.8060300@gmx.at> <5016C790.1030406@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1343724057 20927 80.91.229.3 (31 Jul 2012 08:40:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 31 Jul 2012 08:40:57 +0000 (UTC) Cc: 12081@debbugs.gnu.org To: Alp Aker Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 31 10:40:56 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Sw80e-0001lw-45 for geb-bug-gnu-emacs@m.gmane.org; Tue, 31 Jul 2012 10:40:56 +0200 Original-Received: from localhost ([::1]:34899 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sw80d-00085U-En for geb-bug-gnu-emacs@m.gmane.org; Tue, 31 Jul 2012 04:40:55 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:33063) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sw80Y-00081A-AQ for bug-gnu-emacs@gnu.org; Tue, 31 Jul 2012 04:40:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sw80T-0005mL-AX for bug-gnu-emacs@gnu.org; Tue, 31 Jul 2012 04:40:50 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42595) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sw80T-0005mF-2b for bug-gnu-emacs@gnu.org; Tue, 31 Jul 2012 04:40:45 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Sw87W-0004Tg-LU for bug-gnu-emacs@gnu.org; Tue, 31 Jul 2012 04:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 31 Jul 2012 08:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12081 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12081-submit@debbugs.gnu.org id=B12081.134372445017170 (code B ref 12081); Tue, 31 Jul 2012 08:48:02 +0000 Original-Received: (at 12081) by debbugs.gnu.org; 31 Jul 2012 08:47:30 +0000 Original-Received: from localhost ([127.0.0.1]:52139 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sw86x-0004Sp-K6 for submit@debbugs.gnu.org; Tue, 31 Jul 2012 04:47:29 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.23]:56697) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1Sw86v-0004Sh-1I for 12081@debbugs.gnu.org; Tue, 31 Jul 2012 04:47:26 -0400 Original-Received: (qmail invoked by alias); 31 Jul 2012 08:40:06 -0000 Original-Received: from 62-47-57-234.adsl.highway.telekom.at (EHLO [62.47.57.234]) [62.47.57.234] by mail.gmx.net (mp033) with SMTP; 31 Jul 2012 10:40:06 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18Gqk4Nfd8GwvY6VA5qTVG98DNadbr8W7CddStfg7 DYLC0+iTNZZ9wC In-Reply-To: X-Y-GMX-Trusted: 0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:62671 Archived-At: > So, would something like the following patch be ok (after adding > appropriate documentation changes)? Sure. Can you write a ChangeLog entry, one additional sentence for the doc-strings and a more useful documentation of buffer-predicate for the Elisp manual? > Note that with these changes, > there might still be some potentially odd behavior. Here's a > contrived example. From Emacs -Q, evaluating the following in > *scratch*: > > (progn > (set-frame-parameter nil 'buffer-predicate (lambda (x) nil)) > (switch-to-buffer (get-buffer-create "foo")) > (switch-to-prev-buffer)) > > will leave buffer "foo" displayed in the selected window, but the > return value of of `switch-to-prev-buffer' will be # *scratch*>, because `next-buffer' was assigned during the scan of the > previous buffers even though we did not switch to it. Is such a > misleading return value ok? No. It's an obvious bug not related to `buffer-predicate'. It went unnoticed so far because the return value of `switch-to-prev-buffer' is neither documented nor used anywhere. But in the case you describe `switch-to-prev-buffer' should return nil just as in all other cases resulting from (dolist (entry (window-prev-buffers window)) (when (and (setq new-buffer (car entry)) when new-buffer is rejected. I hope I fixed that now. Please have a look. Thanks, martin