From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.tramp,gmane.emacs.devel Subject: Re: Reverting *Locate* buffers. Date: Mon, 03 Jul 2006 15:43:10 +0200 Message-ID: References: <200606260327.k5Q3Rfpd013691@jane.dms.auburn.edu> <853bdsmkey.fsf@lola.goethe.zz> <200606280158.k5S1wJCu004606@jane.dms.auburn.edu> <17569.64920.191861.355581@localhost.localdomain> <200606290313.k5T3DwTj002620@jane.dms.auburn.edu> <873bdjwwzu.fsf@gmx.de> <200607030251.k632pKhp018621@jane.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1151934281 20071 80.91.229.2 (3 Jul 2006 13:44:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 3 Jul 2006 13:44:41 +0000 (UTC) Cc: pbreton@cs.umb.edu, tramp-devel@gnu.org, raman@users.sourceforge.net, emacs-devel@gnu.org Original-X-From: tramp-devel-bounces+tramp=quimby.gnus.org@gnu.org Mon Jul 03 15:44:36 2006 Return-path: Envelope-to: tramp@deer.gmane.org Original-Received: from quimby.gnus.org ([80.91.224.244]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FxOiz-0007D6-UC for tramp@deer.gmane.org; Mon, 03 Jul 2006 15:44:29 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1FxOiz-0003qP-00 for ; Mon, 03 Jul 2006 15:44:29 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FxOiu-0004l6-SO for tramp@quimby.gnus.org; Mon, 03 Jul 2006 09:44:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FxOin-0004kB-Tb for tramp-devel@gnu.org; Mon, 03 Jul 2006 09:44:17 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FxOil-0004jq-4W for tramp-devel@gnu.org; Mon, 03 Jul 2006 09:44:16 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FxOik-0004jn-W4; Mon, 03 Jul 2006 09:44:15 -0400 Original-Received: from [194.113.59.96] (helo=mailrelay2.alcatel.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FxOwD-0005sH-2I; Mon, 03 Jul 2006 09:58:09 -0400 Original-Received: from slbhac.alcatel.de (slbhac.bln.sel.alcatel.de [149.204.63.216]) by mailrelay2.alcatel.de (8.12.11.20060308/8.12.11/ICT TSC MAIL 2005) with ESMTP id k63DhCJU002652; Mon, 3 Jul 2006 15:43:13 +0200 Original-To: Luc Teirlinck In-Reply-To: <200607030251.k632pKhp018621@jane.dms.auburn.edu> (Luc Teirlinck's message of "Sun, 2 Jul 2006 21:51:20 -0500 (CDT)") User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/20.7 (hpux) X-Scanned-By: MIMEDefang 2.49 on 149.204.45.73 X-BeenThere: tramp-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: tramp-devel.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: tramp-devel-bounces+tramp=quimby.gnus.org@gnu.org Errors-To: tramp-devel-bounces+tramp=quimby.gnus.org@gnu.org Xref: news.gmane.org gmane.emacs.tramp:5037 gmane.emacs.devel:56416 Archived-At: Luc Teirlinck writes: > Michael Albinus wrote: > > The solution would be to set temporarily default-directory to "/" or > whatover local during loading of Tramp. But I have no idea how to say > it > > I did not think hard about the problem and hence I may not understand > it, but is I guess that there must be some reason why just saving the > default directory at the start of tramp, setting it to "/" and setting > it back to the saved value at the end of tramp does not work? The problem is that default directory must not be a remote filename when (auto)loading tramp.el. Any counter measure "at the start of tramp" (i.e. inside tramp.el) is too late. > Anyway, assuming that the problem really is hard to solve, I propose > the following patch. The main difference with what you proposed is > that the default value of `locate-update-path' is "/" and that Tramp > does not get loaded if `locate-update-path' has that default value. > > There are two reasons for this. It makes it easier to revert to the > old default and that default does not load Tramp (it does not need > to). Secondly, I would be very hesitant about asking for a root > password without the user having explicitly asked for that behavior > (through setting `locate-update-path'). If the user has no authority > to be root and inadvertently gives his own password at the prompt, > then mail may be sent to the "appropriate authorities", possibly > embarrassing the user. That's OK for me. > I propose the following patch and if nobody objects, I will install > it. if the recursive load problem would be solved some other way, > then obviously, the requiring of Tramp could be undone. It's really too hot these days. One obvious solution avoiding to require Tramp explicitely coould be this: ;; From Stephen Eglen (defun locate-update (ignore1 ignore2) "Revert the *Locate* buffer. If `locate-update-when-revert' is non-nil, offer to update the locate database using the shell command in `locate-update-command'." (let ((str (car locate-history-list))) (and locate-update-when-revert (yes-or-no-p "Update locate database (may take a few seconds)? ") ;; `expand-file-name' is used in order to autoload Tramp if ;; necessary. It cannot be loaded when `default-directory' ;; is remote. (let ((default-directory (expand-file-name locate-update-path))) (shell-command locate-update-command))) (locate str))) Best regards, Michael.