From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: xref and leaving "temporary" buffers open Date: Sun, 26 Jul 2015 13:27:53 +0200 Message-ID: <55B4C439.1040909@gmx.at> References: <55B2DC8F.3050305@yandex.ru> <55B3489C.2070009@gmx.at> <55B390CE.6020104@yandex.ru> <55B3994A.5010709@gmx.at> <55B3A0B6.6080101@yandex.ru> <55B3B0FC.3080004@gmx.at> <55B3EDBD.8050409@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1437910100 13190 80.91.229.3 (26 Jul 2015 11:28:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 26 Jul 2015 11:28:20 +0000 (UTC) To: Dmitry Gutov , emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 26 13:28:14 2015 Return-path: Envelope-to: ged-emacs-devel@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 1ZJK6G-0000dd-B1 for ged-emacs-devel@m.gmane.org; Sun, 26 Jul 2015 13:28:12 +0200 Original-Received: from localhost ([::1]:49853 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJK6F-0005wj-Re for ged-emacs-devel@m.gmane.org; Sun, 26 Jul 2015 07:28:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJK6C-0005tj-C9 for emacs-devel@gnu.org; Sun, 26 Jul 2015 07:28:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZJK69-0005CU-4T for emacs-devel@gnu.org; Sun, 26 Jul 2015 07:28:08 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:55750) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJK68-0005CF-Qr for emacs-devel@gnu.org; Sun, 26 Jul 2015 07:28:05 -0400 Original-Received: from [178.190.23.96] ([178.190.23.96]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0MQR3s-1ZTBzE0oRQ-00TlA5; Sun, 26 Jul 2015 13:28:04 +0200 In-Reply-To: <55B3EDBD.8050409@yandex.ru> X-Provags-ID: V03:K0:v9r9M24shGPrrBj96SdchHc2h/2nXL518q/0LUzqsWZglSWgNft 3F3lBqj2Wn1nm4XGxxSEsDLxR9TwXCzw1GwfcC/F8d8fW3jzRLIWBMEZNKfTL7TKh+7PJCU NMuHEKlylb7zg5HXq6yoVQNPdqml2TWYf0yJ2sIk0/fm2rGNcBmmHHdmhv434neN1lbQEJ5 DRushCtRTYyRCrDUd1/mA== X-UI-Out-Filterresults: notjunk:1;V01:K0:0yJr0jC9bdI=:CYlj6q9IU6MezdJj5xZVM0 dj/rd0vxydeydl01Fa5N97fMeQC9LpOEoOewYiVn0ZKoA6dCed7StU5RTqv0hnVgWTw0KxK5U Scc6qNpTeG5OocltGtBB6ECFK5seD4A3WfXHP43SFAfNKPtXaZkqRY8+XCZAfraU2GBD8oJJY UZZDHvMCoEYxNwWu8UhU/hDN69yYO69vPT9c4advt5Bbh2kN0kareUBeSrXBQfvoL/8rzD2Wn 7Fcia712PgTiBawXUmG/nctJc+dtvDibg2St5KOdHJnCe9RquEHR0DRy9Ndwy25z4yzMCuzhW AECNsD47UcAghNLYE0jgHxjrVqGWUssCZUVRGuZZgNIcf/edDxwg8m7ed0Nrsi3ntqeoL2n0G GyB4atSUiG842v15Y9IIR8VpsDL1Nf18IlurH2sUOhIGNclkj8oETYWbTKpvvX/YspG2wQO8l OnFXScrhZuoEZSnKJJrXX8Ak2WQfoUWwB9ehrQqGx7cYRBPsJrLznN548yfn3msVNmYlgLKYk HWiWAl73LlfOIEFRFyoqrKqwZnxKYnS8Uildga71Q3JtHn8HId5F9CwFz+G6cdsqQm90B+0Zf 73ygCi+ctNiDokky/VQcs/669Pxj/BwcRgwATPisqk4ACX/GS4SREdoanzbTflBAprb5nbAiQ FiS/3xHE/rGJwgUruRKs2Wtu7u7r5tkQRiNyRBf+RozB1L9NGlcU+M+PXEr2QQWeH/Xc= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.15.15 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:188094 Archived-At: > How about this: > > (defvar-local buffer-hidden nil > "When non-nil, this buffer is not returned by `buffer-list', > unless passed a non-nil INCLUDE-HIDDEN argument.") Good (if you fix the doc-string). We should then rewrite and change the name of BUFFER_HIDDEN_P to avoid confusions. > (defvar-local buffer-hidden-last-access nil > "The time when this buffer was last accessed.") Good. I'm not yet sure whether there could be problems with dead buffers but I don't think so. > (defun buffer-list (&optional frame include-hidden) Good. Maybe the second argument could be used to not include buffers starting with a space either. > (defvar find-file-hidden nil > "When non-nil, new file buffers are marked as hidden. > `find-file-noselect', when creating a new buffer, will set > `buffer-hidden' to t, and `buffer-hidden-last-access' to the > current time. > When it's nil, `find-file-noselect' will set `buffer-hidden' and > `buffer-hidden-last-accessed' to nil in the buffer it returns.") Good. This should be the only hairy part to implement. > `find-file-noselect' might also become a problem with large amounts of > hidden buffers, because `find-buffer-visiting' iterates through all > buffers (and thus is O(N)). Although we should see whether it's an > actual problem in practice. We can always prune the list when it gets too large. > "never auto-revert" sounds like "always ask", but without the option > "yes", because xref should abort in this case rather than return wrong > results, Does this remark only apply to `xref-query-replace'? For a pure `xref' search we should allow stale contents IMHO. And does xref always check the file modification data? Does it re-run etags? > The time when `find-file-noselect' was last called seems like a good > approximation of the most recent access time. Agreed. martin