From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 14 13:26:07 2013 Received: (at submit) by debbugs.gnu.org; 14 Mar 2013 17:26:07 +0000 Received: from localhost ([127.0.0.1]:54447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UGBuo-0008JG-MC for submit@debbugs.gnu.org; Thu, 14 Mar 2013 13:26:07 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33724) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UGBul-0008Im-CL for submit@debbugs.gnu.org; Thu, 14 Mar 2013 13:26:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UGBtP-0000nW-AV for submit@debbugs.gnu.org; Thu, 14 Mar 2013 13:24:45 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:48518) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGBtP-0000mp-0Z for submit@debbugs.gnu.org; Thu, 14 Mar 2013 13:24:39 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGBtG-0003cz-Tq for bug-gnu-emacs@gnu.org; Thu, 14 Mar 2013 13:24:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UGBtD-0000cl-Vq for bug-gnu-emacs@gnu.org; Thu, 14 Mar 2013 13:24:30 -0400 Received: from zivm-wwu1-1.uni-muenster.de ([128.176.192.4]:29071 helo=zivm-wwu1.uni-muenster.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGBtD-0000cP-PN for bug-gnu-emacs@gnu.org; Thu, 14 Mar 2013 13:24:27 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EAEAHQlGAsLwY/2dsb2JhbABDiCy+OhZ0glWBCwIFIQIRAQQoiEigaoZah3uSVIEjjhCCF4ETA6dagws X-IPAS-Result: Av8EAEAHQlGAsLwY/2dsb2JhbABDiCy+OhZ0glWBCwIFIQIRAQQoiEigaoZah3uSVIEjjhCCF4ETA6dagws X-IronPort-AV: E=Sophos;i="4.84,845,1355094000"; d="scan'208";a="30928408" Received: from mail.uni-muenster.de ([128.176.188.24]) by zivm-relay1.uni-muenster.de with ESMTP; 14 Mar 2013 18:24:25 +0100 Received: from pcwi7557.uni-muenster.de (PCWI7557.UNI-MUENSTER.DE [128.176.159.107]) by mail.uni-muenster.de (Postfix) with ESMTP id 2895DBF402 for ; Thu, 14 Mar 2013 18:24:25 +0100 (CET) Received: from lechten by pcwi7557.uni-muenster.de with local (Exim 4.71) (envelope-from ) id 1UGBt9-0001bF-RK for bug-gnu-emacs@gnu.org; Thu, 14 Mar 2013 18:24:23 +0100 From: Jens Lechtenboerger To: bug-gnu-emacs@gnu.org Subject: 24.3; ffap-url-unwrap-remote fails for remote file URIs Date: Thu, 14 Mar 2013 18:24:23 +0100 Message-ID: <871ubh7v3s.fsf@pcwi7557.uni-muenster.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Jens Lechtenboerger List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) Hi there, I=E2=80=99d like to access remote file URIs via ffap and ssh, e.g., /bar on host foo via =E2=80=9Cfile://foo/bar=E2=80=9D. However, the behavior of ffap-url-unwrap-remote has changed from Emacs 23 to 24. I=E2=80=99m using: src/emacs -Q (ffap-bindings) (setq ffap-ftp-default-user nil) In Emacs 23.4, with point in =E2=80=9Cfile://foo/bar=E2=80=9D, =E2=80=9CC-x= C-f=E2=80=9D shows =E2=80=9C/foo:/bar=E2=80=9D in=20=20 the minibuffer, and RET retrieves the file via ssh, which is good. In Emacs 24.3, =E2=80=9CC-x C-f=E2=80=9D shows =E2=80=9Cfile://foo/bar=E2= =80=9D, and RET opens a browser, which tries to access =E2=80=9Cfile:///bar=E2=80=9D, which is inco= rrect as it misses the host. The file scheme is not recognized as remote one. Thus: (setq ffap-url-unwrap-remote '("ftp" "file")) Now, =E2=80=9CC-x C-f=E2=80=9D shows =E2=80=9C/file:foo:/bar=E2=80=9D, and = RET leads to the error: =E2=80=9CHost `foo' looks like a remote host, `file' can only use the local= host=E2=80=9D I=E2=80=99m not sure whether the previous result should be changed somewhere. Why should file only use the local host? However, the problem can be avoided by the following version of ffap-url-unwrap-remote. Moreover, changing ffap-ftp-default-user is not necessary any more. (defun ffap-url-unwrap-remote (url) "Return URL as a remote file name, or nil." (let* ((obj (url-generic-parse-url url)) (scheme (url-type obj)) (valid-schemes (if (listp ffap-url-unwrap-remote) ffap-url-unwrap-remote '("ftp"))) (host (url-host obj)) (port (url-port-if-non-default obj)) (user (url-user obj)) (filename (car (url-path-and-query obj)))) (when (and (member scheme valid-schemes) (string-match "\\`[a-zA-Z][-a-zA-Z0-9+.]*\\'" scheme) (not (equal host ""))) (concat "/" (if (not (string=3D scheme "file")) (concat scheme ":")) (if user (concat user "@")) host (if port (concat "#" (number-to-string port))) ":" filename)))) Best wishes Jens From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 14 17:59:02 2013 Received: (at 13961) by debbugs.gnu.org; 14 Mar 2013 21:59:02 +0000 Received: from localhost ([127.0.0.1]:54824 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UGGAv-0007Jw-6F for submit@debbugs.gnu.org; Thu, 14 Mar 2013 17:59:01 -0400 Received: from mout.gmx.net ([212.227.17.22]:61217) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UGGAs-0007Je-5q for 13961@debbugs.gnu.org; Thu, 14 Mar 2013 17:58:59 -0400 Received: from mailout-de.gmx.net ([10.1.76.27]) by mrigmx.server.lan (mrigmx001) with ESMTP (Nemesis) id 0MB0kk-1UQBmw2XVk-009ueF for <13961@debbugs.gnu.org>; Thu, 14 Mar 2013 22:57:38 +0100 Received: (qmail invoked by alias); 14 Mar 2013 21:57:37 -0000 Received: from p57BB985B.dip0.t-ipconnect.de (EHLO detlef.gmx.de) [87.187.152.91] by mail.gmx.net (mp027) with SMTP; 14 Mar 2013 22:57:37 +0100 X-Authenticated: #3708877 X-Provags-ID: V01U2FsdGVkX1+rBA58pGqrWNON7gG7ho2Ug5RYBt47ZHiBEUcwfY AdxO3XIFSRSciD From: Michael Albinus To: Jens Lechtenboerger Subject: Re: bug#13961: 24.3; ffap-url-unwrap-remote fails for remote file URIs References: <871ubh7v3s.fsf@pcwi7557.uni-muenster.de> Date: Thu, 14 Mar 2013 22:57:34 +0100 In-Reply-To: <871ubh7v3s.fsf@pcwi7557.uni-muenster.de> (Jens Lechtenboerger's message of "Thu, 14 Mar 2013 18:24:23 +0100") Message-ID: <871ubh8x0x.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Y-GMX-Trusted: 0 X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 13961 Cc: 13961@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Jens Lechtenboerger writes: > Hi there, Hi Jens, > I=E2=80=99d like to access remote file URIs via ffap and ssh, e.g., /bar = on > host foo via =E2=80=9Cfile://foo/bar=E2=80=9D. However, the behavior of > ffap-url-unwrap-remote has changed from Emacs 23 to 24. Yes. See the NEWS file of Emacs 24.3: --8<---------------cut here---------------start------------->8--- ** The FFAP option `ffap-url-unwrap-remote' can now be a list of strings, specifying URL types that should be converted to remote file names at the FFAP prompt. The default is now '("ftp"). --8<---------------cut here---------------end--------------->8--- > I=E2=80=99m using: > > src/emacs -Q > (ffap-bindings) > (setq ffap-ftp-default-user nil) > > In Emacs 23.4, with point in =E2=80=9Cfile://foo/bar=E2=80=9D, =E2=80=9CC= -x C-f=E2=80=9D shows > =E2=80=9C/foo:/bar=E2=80=9D in=20=20 > the minibuffer, and RET retrieves the file via ssh, which is good. In Emacs 23, ffap-url-unwrap-remote had the intention to unwrap to an ftp file name. It uses the ange-ftp syntax "/host:/remote/path". Tramp is bundled with Emacs 23, and it uses an extended syntax "/method:host:/remote/path". The "method:" part is optional; in this case the default method ("ssh" in your case) will be used. So it did work for you due to an unintended side effect. > In Emacs 24.3, =E2=80=9CC-x C-f=E2=80=9D shows =E2=80=9Cfile://foo/bar=E2= =80=9D, and RET opens a > browser, which tries to access =E2=80=9Cfile:///bar=E2=80=9D, which is in= correct as > it misses the host. ffap-url-unwrap-remote has been changed to handle the scheme part of the url as Tramp method, when it is known in ffap-url-unwrap-remote. "file" does not belong to this list by default; therefore the url is regarded as url, and it is sent to the browser. > The file scheme is not recognized as remote one. Thus: > (setq ffap-url-unwrap-remote '("ftp" "file")) > Now, =E2=80=9CC-x C-f=E2=80=9D shows =E2=80=9C/file:foo:/bar=E2=80=9D, an= d RET leads to the error: > =E2=80=9CHost `foo' looks like a remote host, `file' can only use the loc= al host=E2=80=9D In this case, you declare "file" as Tramp method. The resulting "/file:foo:/bar" is not accepted by Tramp; it doesn't know of any method "file". > I=E2=80=99m not sure whether the previous result should be changed > somewhere. Why should file only use the local host? > > However, the problem can be avoided by the following version of > ffap-url-unwrap-remote. Moreover, changing ffap-ftp-default-user is > not necessary any more. > > (defun ffap-url-unwrap-remote (url) > "Return URL as a remote file name, or nil." > (let* ((obj (url-generic-parse-url url)) > (scheme (url-type obj)) > (valid-schemes (if (listp ffap-url-unwrap-remote) > ffap-url-unwrap-remote > '("ftp"))) > (host (url-host obj)) > (port (url-port-if-non-default obj)) > (user (url-user obj)) > (filename (car (url-path-and-query obj)))) > (when (and (member scheme valid-schemes) > (string-match "\\`[a-zA-Z][-a-zA-Z0-9+.]*\\'" scheme) > (not (equal host ""))) > (concat "/" > (if (not (string=3D scheme "file")) > (concat scheme ":")) > (if user (concat user "@")) > host > (if port (concat "#" (number-to-string port))) > ":" filename)))) This patch tries to conserve the side effect of ffap in Emacs 23. I'm not a user of ffap, so I don't know whether it is acceptable to add such a kludge. > Best wishes > Jens Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 25 16:09:31 2015 Received: (at 13961) by debbugs.gnu.org; 25 Dec 2015 21:09:31 +0000 Received: from localhost ([127.0.0.1]:35540 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aCZcB-0006tB-HS for submit@debbugs.gnu.org; Fri, 25 Dec 2015 16:09:31 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:52391) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aCZc9-0006t2-8l for 13961@debbugs.gnu.org; Fri, 25 Dec 2015 16:09:29 -0500 Received: from 2.150.58.24.tmi.telenormobil.no ([2.150.58.24] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aCZbm-0004Ts-6q; Fri, 25 Dec 2015 22:09:06 +0100 From: Lars Ingebrigtsen To: Michael Albinus Subject: Re: bug#13961: 24.3; ffap-url-unwrap-remote fails for remote file URIs References: <871ubh7v3s.fsf@pcwi7557.uni-muenster.de> <871ubh8x0x.fsf@gmx.de> Date: Fri, 25 Dec 2015 22:09:05 +0100 In-Reply-To: <871ubh8x0x.fsf@gmx.de> (Michael Albinus's message of "Thu, 14 Mar 2013 22:57:34 +0100") Message-ID: <878u4i1bim.fsf@gnus.org> User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-MailScanner-ID: 1aCZbm-0004Ts-6q X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1451682546.51704@RUm2N6DJ4FW6Wy+PR5Wecg X-Spam-Status: No X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13961 Cc: Jens Lechtenboerger , 13961@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Michael Albinus writes: > Tramp is bundled with Emacs 23, and it uses an extended syntax > "/method:host:/remote/path". The "method:" part is optional; in this > case the default method ("ssh" in your case) will be used. > > So it did work for you due to an unintended side effect. Since this has been working this way for almost three years now, I think we probably shouldn't change this back now (if I understood this thread correctly). So I'm closing the bug report. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 25 16:09:35 2015 Received: (at control) by debbugs.gnu.org; 25 Dec 2015 21:09:36 +0000 Received: from localhost ([127.0.0.1]:35543 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aCZcF-0006tS-OU for submit@debbugs.gnu.org; Fri, 25 Dec 2015 16:09:35 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:52397) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aCZcE-0006tL-IJ for control@debbugs.gnu.org; Fri, 25 Dec 2015 16:09:34 -0500 Received: from 2.150.58.24.tmi.telenormobil.no ([2.150.58.24] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aCZbs-0004U2-5h for control@debbugs.gnu.org; Fri, 25 Dec 2015 22:09:12 +0100 Date: Fri, 25 Dec 2015 22:09:11 +0100 Message-Id: <877fk21big.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #13961 X-MailScanner-ID: 1aCZbs-0004U2-5h X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1451682552.80857@EaO2mStnJ51SvNc9hQ9ejQ X-Spam-Status: No X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) close 13961 From unknown Sat Jun 21 03:30:30 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 23 Jan 2016 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator