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: Tue, 17 Jan 2017 01:21:14 +0300 Message-ID: References: <83inpg9ib5.fsf@gnu.org> <83d1fn9dio.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11414d7016bc0405463d9a65 X-Trace: blaine.gmane.org 1484605342 8288 195.159.176.226 (16 Jan 2017 22:22:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 16 Jan 2017 22:22:22 +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 23:22:15 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 1cTFf8-0000ST-4J for ged-emacs-devel@m.gmane.org; Mon, 16 Jan 2017 23:22:02 +0100 Original-Received: from localhost ([::1]:59998 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cTFfC-00089C-UA for ged-emacs-devel@m.gmane.org; Mon, 16 Jan 2017 17:22:06 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39078) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cTFeW-00088d-RX for emacs-devel@gnu.org; Mon, 16 Jan 2017 17:21:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cTFeV-00073U-AZ for emacs-devel@gnu.org; Mon, 16 Jan 2017 17:21:24 -0500 Original-Received: from mail-io0-x22d.google.com ([2607:f8b0:4001:c06::22d]:33379) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cTFeQ-0006x6-Cc; Mon, 16 Jan 2017 17:21:18 -0500 Original-Received: by mail-io0-x22d.google.com with SMTP id v96so101748729ioi.0; Mon, 16 Jan 2017 14:21:16 -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=JDHlwDXOFi8LQs5hcy2pD7IJ4Z2gtDFgnKhUC0mrbR4=; b=PX0hixLfzsazyyojd/pc/EB3ERFH99U5ZPm2D7xVDNPftkhe3eB6IXw8N2eTqT0dsG pZTghHodDdnTIIOcqU3Un4f+iYYSRyy3Lhmo09TqQtEJoXHWf2GnlLQ2l1fa1qgvMhPx SuyDNSwDIdzB0OKn/QWUcZw+UdKx9QpuFoICFfTJBhpaGz89WSk6VhEjSJMNg6QwMYB7 hBmjaQHd6SW87WFxlbXAL+JHFbeIRWHJRb9rdCp0m7C//QvUgAlNW4rtLWUzs+hYxyVW FPxHNkrxlCF9egOdnQnOZ66rwpY1sQDVJQBeQ7iIaXjiexOLceBsr3jwwMBl34N3Eoop 2r5g== 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=JDHlwDXOFi8LQs5hcy2pD7IJ4Z2gtDFgnKhUC0mrbR4=; b=c+Ozn4HcQ+ZnZuRtmNCgYQ27mXjVw9T3JCAkMAH0Js0HCFr/zCqCPfAHXeps77HUnC c+cLgYn2ErCGF9czDsIVzfqpHepsRcC5lTXktvXQpdTPzihGAAfBOjzxEZozpa4lSu4B 3rzmIKzxbajctiyKzxyKPKUX/z9jkTPg2yaUOaq0qsSY81V1tqz6sos3ziQBbhR3HRU4 GW9PNwVue4sgBwRM7ms8XuGfszpTDqV3/D+i/THoRInkiydDSHiaXMzHmDsQjANODOQT mjpjrTMYn/wI/nLZFoJTQf+DMss3ZIrCAt2qAabp5HVakm4DEN5J/WvjlHjL9HQLEdDe 3jDg== X-Gm-Message-State: AIkVDXLoN9cgSNDPBR3M4uGPAmwZ60MgGM3HFYXpFCkRtHVwKEGu3dA7fPsd0e+1aEKnSVpAD3Z4LUOyQJc2GA== X-Received: by 10.107.167.204 with SMTP id q195mr9159395ioe.170.1484605275679; Mon, 16 Jan 2017 14:21:15 -0800 (PST) Original-Received: by 10.79.172.7 with HTTP; Mon, 16 Jan 2017 14:21:14 -0800 (PST) In-Reply-To: <83d1fn9dio.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::22d 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:211339 Archived-At: --001a11414d7016bc0405463d9a65 Content-Type: text/plain; charset=UTF-8 Ok, here is my attempt to code this: https://github.com/Bad-ptr/emacs/commit/cf6b0d9f08dbdc5dd685dbc6a5ef9ff18575e2b2 This seem to work for my example from the start of discussion(not tested it much for now). > you didn't describe the use case where this issue got in your way, so perhaps you should. If you set a 'heay' buffer-predicate like here https://github.com/Bad-ptr/persp-mode.el/blob/master/persp-mode.el#L2793 (This package provide a way to switch between 'projects', each project has a list of buffers, it is essential to set a buffer-predicate that will constrain buffer switching to the current 'project' so it needs to check if a buffer is a member of the current project list. There may be many buffers from many projects) And if you are the user of a package that overuse the with-temp-buffer(like helm or if you run down the list of candidates of the company-mode) you can notice a slowdown. https://github.com/Bad-ptr/persp-mode.el/issues/35 And I just think that this behavior of the kill-buffer is wrong and could be fixed quite easily and without introducing new functions or breaking user experience. Maybe I'm wrong. And I'm not saying that this is a critical bug or somehow urgent, just wanted to discuss the idea. --001a11414d7016bc0405463d9a65 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Ok, here is my attempt to code this:
https://github.com/Bad-ptr/emacs/commit/cf6b0d9f08dbdc5dd685dbc6a5ef= 9ff18575e2b2
This seem to work for my example from the start of= discussion(not tested it much for now).

> you didn't describe the use case where thi= s issue got in your
way, so perhaps you should.=C2=A0

If you set a 'heay= 9; buffer-predicate like here
(This package= provide a way to switch between 'projects',
each project= has a list of buffers, it is essential to set a buffer-predicate that
will constrain buffer switching to the current 'project' so i= t needs to check if a
buffer is a member of the current project l= ist. There may be many buffers from
many projects)
And = if you are the user of a package that overuse the with-temp-buffer(like hel= m
or if you run down the list of candidates of the company-mode) = you can notice a
slowdown.

And I just think that this beha= vior of the kill-buffer is wrong and could be fixed
quite easily = and without introducing new functions or breaking user experience.
Maybe I'm wrong.
And I'm not saying that this is a crit= ical bug or somehow urgent, just wanted to
discuss the idea.

--001a11414d7016bc0405463d9a65--