From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Constantin Kulikov Newsgroups: gmane.emacs.devel Subject: Re: kill-buffer calls frame's buffer-predicate for all buffers even if the killed buffer was not shown in any window. Date: Mon, 16 Jan 2017 11:14:10 +0300 Message-ID: References: <83inpg9ib5.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c055d18aff69d054631c418 X-Trace: blaine.gmane.org 1484554510 6691 195.159.176.226 (16 Jan 2017 08:15:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 16 Jan 2017 08:15:10 +0000 (UTC) Cc: emacs-devel To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 16 09:15:05 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cT2RN-0000kt-LY for ged-emacs-devel@m.gmane.org; Mon, 16 Jan 2017 09:14:57 +0100 Original-Received: from localhost ([::1]:54902 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cT2RS-0005iH-5B for ged-emacs-devel@m.gmane.org; Mon, 16 Jan 2017 03:15:02 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cT2Qf-0005hU-Sc for emacs-devel@gnu.org; Mon, 16 Jan 2017 03:14:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cT2Qe-0001it-Uc for emacs-devel@gnu.org; Mon, 16 Jan 2017 03:14:13 -0500 Original-Received: from mail-io0-x236.google.com ([2607:f8b0:4001:c06::236]:35955) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cT2Qd-0001id-Hj; Mon, 16 Jan 2017 03:14:11 -0500 Original-Received: by mail-io0-x236.google.com with SMTP id j13so86401011iod.3; Mon, 16 Jan 2017 00:14:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=0OPj/F+TT3Ron+TzR2zJmwt+2RLVzyar0uWwhvN3NDA=; b=VErZ/2bBNbMAuzm3l1Iyds912D2VYT4X+EcpqdaJDzrhFkkRq8nTvNRnF14zS94E4p MhLGBeK0Eyp2OPfAbsrHTMXkhTSzQIGS2sS/Eijw7I5m6cqOMQLrN0qhiVTRlROSgtvP e9Y/i0upFxcKEHi+EwU62FfXrQjUNikZKky8UDiVB4PaDV9RnMpIECnkqAKXC3GRndy3 GLDlwRy46Grpq2WFeP1nI8aS68blhieo00SnFe5m076wG/2Gpw7wbJenjOffGDrIUg07 17UpL5Gl9Mn9+XJdlXf5F1pQWa+wlaZHHwhLmWG3RVgIdVivVsL9lq4eUANGLMUs3hVS u2Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=0OPj/F+TT3Ron+TzR2zJmwt+2RLVzyar0uWwhvN3NDA=; b=KO6EPJHH7bRAF8bE1R2XW/V2qp/8dRE7UsqWe1f2T+M/BgpTnr185IFzAdtI5P4S/j eCIBUDCs3JX5y8e1PN0KR8pSnreyE/ipksk69/BU11wHkp6ARxfvLpYh23tOm9Hw2ceP e3mWj2EfqQ2eZgHVOXQvXAP9AMn9JYuss1jfurHOf/1BTzma5DNwWYPxMX0kQFUmKJ5n TlZGm+7V5c8eEgcrmTOsi2smq3j/5e8Jmha2uQDpC9GvxviViDNkVY7Vktm/Y+ItUUL8 P04zgQkzuk/zSJG5lCW1sW8chlMpp16RlLGnb4s48MM55rLMoeysJeqHP5tBQHQCQnvh B5pQ== X-Gm-Message-State: AIkVDXIR+hbkYu3BgWd7YMbMEu3ZosX4kIF5V+1v3ycUF6HMjcV2YLv8pfR103GPq1m5x9E8KaqRvPppzU+QYg== X-Received: by 10.107.147.134 with SMTP id v128mr28297645iod.75.1484554450759; Mon, 16 Jan 2017 00:14:10 -0800 (PST) Original-Received: by 10.79.172.7 with HTTP; Mon, 16 Jan 2017 00:14:10 -0800 (PST) In-Reply-To: <83inpg9ib5.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4001:c06::236 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:211319 Archived-At: --94eb2c055d18aff69d054631c418 Content-Type: text/plain; charset=UTF-8 > it needs to find another buffer to become the current one The current in what sense? In the sense of 1)(current-buffer) or 2) (windown-buffer (selected-window))? If 1) then why require that this buffer is not visible? If 2) then why call the buffer-predicate in the case where the killed buffer was not shown in any window? What I understand of how kill-buffer must work: First call kill-buffer hooks Then find windows with the buffer and replace it, here the call to buffer-predicate it legit if the buffer was visible in any window. Then really kill the buffer. At this point we can set selected window buffer as current because we already have called the replace-buffer-in-window. If there is no selected window, then we can take the first buffer in (buffer-list) as current or create the *sctatch* and set it as current. I can not see why there is a need to call buffer-predicate when killing a buffer that was not visible in any window.) --94eb2c055d18aff69d054631c418 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
> it needs to find ano= ther buffer to become the current one
The current in what sense? In the sense of 1)(current-buffer) or= 2) (windown-buffer (selected-window))?
If 1) then why require that this buffer is not visible?
If 2) then why call the buffe= r-predicate in the case where the killed buffer was not shown in any window= ?

What I understand of how ki= ll-buffer must work:
First call kill-buffer hooks
Then find= windows with the buffer and replace it, here the call to buffer-predicate = it legit if the buffer was visible in any window.
Then really kill the buffer.
At this= point we can set selected window buffer as current because we already have= called the replace-buffer-in-window.
If th= ere is no selected window, then we can take the first buffer in (buffer-lis= t) as current
or create the *sctatch* and s= et it as current.

I can not see why there is a need to call buffer-predicate when= killing a buffer that was not visible in any window.)
--94eb2c055d18aff69d054631c418--