From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: xref and leaving "temporary" buffers open Date: Sat, 25 Jul 2015 16:36:14 +0300 Message-ID: <55B390CE.6020104@yandex.ru> References: <55B2DC8F.3050305@yandex.ru> <55B3489C.2070009@gmx.at> 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 1437831398 25116 80.91.229.3 (25 Jul 2015 13:36:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 25 Jul 2015 13:36:38 +0000 (UTC) To: martin rudalics , emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 25 15:36:37 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 1ZIzcx-0001Cj-9o for ged-emacs-devel@m.gmane.org; Sat, 25 Jul 2015 15:36:35 +0200 Original-Received: from localhost ([::1]:48137 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIzcw-00013H-Ps for ged-emacs-devel@m.gmane.org; Sat, 25 Jul 2015 09:36:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49929) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIzck-000132-4s for emacs-devel@gnu.org; Sat, 25 Jul 2015 09:36:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZIzcg-0001Sj-Vq for emacs-devel@gnu.org; Sat, 25 Jul 2015 09:36:22 -0400 Original-Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:37076) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIzcg-0001SU-Os for emacs-devel@gnu.org; Sat, 25 Jul 2015 09:36:18 -0400 Original-Received: by wibud3 with SMTP id ud3so63689962wib.0 for ; Sat, 25 Jul 2015 06:36:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=lieZRdm9+CKQxftxCQbMY/ydwKQFicreflGH+hCLYv4=; b=cf5xQt6A2oKXlkcsmtJ//E0Y9u/hv22K1BnG0uWi04WFSgwcE/0B314Gf5nWMOsYjZ 5/O/LXkInVZoAQJmckPSA/tT+BMv34VzsFy75TYC/645w7DZYKGl7p+PauBsC1I/uqb6 XMjxhNEcLXTvM4wgxj6mgOMNJBzDKyUBPlWjeX+xyK60ziCvB+FfPToxfQFfPlDdq7OT Xt1OKmCKzBiKhCBJ9JLQOv4g4ywp7N2fkAs46HkAfGscMo9ViYO8r7jOJJqCWp7TLQRA 5ZcC2Ifc8qPnF2EBlAQtXj+DGwhKykhIl1GDGOlCotxf7/LeAQ9LLyc2Az18td3eLKxY rzfQ== X-Received: by 10.180.215.8 with SMTP id oe8mr3341070wic.0.1437831378115; Sat, 25 Jul 2015 06:36:18 -0700 (PDT) Original-Received: from [192.168.1.2] ([185.105.175.24]) by smtp.googlemail.com with ESMTPSA id l14sm17640538wjq.21.2015.07.25.06.36.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Jul 2015 06:36:17 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0 In-Reply-To: <55B3489C.2070009@gmx.at> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22a 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:188063 Archived-At: On 07/25/2015 11:28 AM, martin rudalics wrote: > I'd try to implement some sort of heuristics, like adding a buffer to > some sort of a cache only after its file has been visited by an > application (like xref) at least N times and removing a buffer from that > cache if it has not been visited by an application (like xref) for at > least T minutes. N > 1 won't help too much. I'm talking about a situation like xref-find-references followed by xref-query-replace. It already gives a performance hit (if there are matches in a lot of different files). And xref-find-references only opens each buffer once already. What kind of cache? > [Automatic reverting] should be made customizable. I suppose a user option might govern whether xref will prompt before reverting. But then, will it prompt for each file? There might be a lot. > I think so. Each buffer should maintain a list of all the applications > that visited its file and all operations on buffer lists should be aware > of it. You might want to elaborate. This seems to go further than my suggestion.