From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: rfn-eshadow Date: Thu, 03 Jan 2008 23:12:34 +0100 Message-ID: <877iiqblt9.fsf@gmx.de> References: <87k5mq60y8.fsf@jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1199398210 27008 80.91.229.12 (3 Jan 2008 22:10:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 3 Jan 2008 22:10:10 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 03 23:10:29 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JAYGg-0001xM-0i for ged-emacs-devel@m.gmane.org; Thu, 03 Jan 2008 23:10:26 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JAYGJ-0002UN-LI for ged-emacs-devel@m.gmane.org; Thu, 03 Jan 2008 17:10:03 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JAYFx-0002K7-7A for emacs-devel@gnu.org; Thu, 03 Jan 2008 17:09:41 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JAYFu-0002J4-Jk for emacs-devel@gnu.org; Thu, 03 Jan 2008 17:09:40 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JAYFu-0002Ix-Gl for emacs-devel@gnu.org; Thu, 03 Jan 2008 17:09:38 -0500 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1JAYFt-0005Q7-MR for emacs-devel@gnu.org; Thu, 03 Jan 2008 17:09:38 -0500 Original-Received: (qmail invoked by alias); 03 Jan 2008 22:09:30 -0000 Original-Received: from p57A22143.dip0.t-ipconnect.de (EHLO arthur.local) [87.162.33.67] by mail.gmx.net (mp021) with SMTP; 03 Jan 2008 23:09:30 +0100 X-Authenticated: #3708877 X-Provags-ID: V01U2FsdGVkX1+48KptQRO4uHH+xYzPMThWLSwz0IMz46tk35XvbS Uqcl1OGZK/joTi In-Reply-To: <87k5mq60y8.fsf@jurta.org> (Juri Linkov's message of "Thu, 03 Jan 2008 23:42:07 +0200") User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:86018 Archived-At: Juri Linkov writes: > The problem is that even if ffap is disabled, when typing an URL in the > minibuffer, rfn-eshadow.el threats it as a file name, and puts a shadow > over the `http:' part because it contains double slashes //. > > I think the right way to fix this problem is the following patch that > prevents handling of URLs by file-name-shadow-mode: > > Index: lisp/rfn-eshadow.el > =================================================================== > RCS file: /sources/emacs/emacs/lisp/rfn-eshadow.el,v > retrieving revision 1.26 > diff -u -w -b -r1.26 rfn-eshadow.el > --- lisp/rfn-eshadow.el 21 Sep 2007 05:24:05 -0000 1.26 > +++ lisp/rfn-eshadow.el 3 Jan 2008 21:36:44 -0000 > @@ -177,7 +177,10 @@ > `file-name-shadow-mode'; the minibuffer should have already > been set up by `rfn-eshadow-setup-minibuffer'." > (condition-case nil > - (let ((goal (substitute-in-file-name (minibuffer-contents))) > + (let* ((mc (minibuffer-contents)) > + (goal (if (string-match-p "\\`\\(https?\\|ftp\\|file\\)://" mc) > + mc > + (substitute-in-file-name mc))) I'm not in favour of this solution, because it introduces file name handling at a place we won't remember in the future. The clean way would be to add a file name handler, which offers its own implementation of substitute-in-file-name. Doesn't exist something like this already in the url package? Best regards, Michael.