From debbugs-submit-bounces@debbugs.gnu.org Wed May 11 03:05:59 2022 Received: (at submit) by debbugs.gnu.org; 11 May 2022 07:05:59 +0000 Received: from localhost ([127.0.0.1]:35812 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nogQ3-0005Vf-He for submit@debbugs.gnu.org; Wed, 11 May 2022 03:05:59 -0400 Received: from lists.gnu.org ([209.51.188.17]:49144) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nogQ1-0005VX-Up for submit@debbugs.gnu.org; Wed, 11 May 2022 03:05:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39414) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nogQ1-0007dJ-PS for bug-gnu-emacs@gnu.org; Wed, 11 May 2022 03:05:57 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]:45779) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nogPz-0001xt-D7 for bug-gnu-emacs@gnu.org; Wed, 11 May 2022 03:05:57 -0400 Received: by mail-pl1-x62a.google.com with SMTP id q18so989957pln.12 for ; Wed, 11 May 2022 00:05:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:mime-version:subject:message-id:date:to; bh=MorxrWTrGE0F1RytYHTULR/wjWMKdMdH287n8JKlqbk=; b=jUKgA715fbeP/yQm7MVATQC1oZ/U15L07Bxv2CrEN4K5zMWz4yCWuz2eHC/X9J8WkY hoPrfNPBkLz3uoX2/1sBP/Qj+FbVIe6W82Y/RaOLDCnogprWZff8eszwYzC5ju7sSl2w DYLJJHUoBjcww8KGPuNAVLLazd0W5j0aSM+5KX+O+WN8ZbAUQJcgJgLjFVZT/T6Vy9wf 0km4SMyJK7VLffVqQQmQdQ3zsI0f/3LYT0GGBGKqhfgKB75LDZJ2CBNnCYI/U5qA7Oja 5k5/G+N54lwqYuvcnSS1dNiwSD8vnLasUudCvUxKaXLg8Wzlqka6WM2uxxgMUDNx0UG7 Wf4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:mime-version:subject:message-id:date:to; bh=MorxrWTrGE0F1RytYHTULR/wjWMKdMdH287n8JKlqbk=; b=s3L5FmmQCsGPDYyKB6nwxd/DdbxWbziPM7OjtcK7HlchwYTa1t73DKlMa69X2qykoQ KjyUaaCs36bH4JF2VOWEbTb6s/avPymXDhgeE35PBf8Gl1A9Yv7UkbSpZUbZRw1gHuVE i4GVAL5chAxgorJpBU9qPUKh85mFGErDOLOUyooyDz/W/DdMZZhXLqHVblWrF4gWigEw OcmZ44aCPwxwtjHj60IKVuE1WI/XZIptEphkqLybtZbM0Ogx0tXzTl9Z0vVjBGEjak5v tYbLr2ZcJYLHoCK3txQgE+POvMsFrGd5vt7dM6wmOn7Q5oSLHbpuAFkNeWexESzE3Rci xP3A== X-Gm-Message-State: AOAM531JmPJH0Wfflb77cUPj/oK4pItvLpnP1b+YUHc8Vb2QezzbrgwA R6lNO9FPbIC435up7pW02XvOiEZMqpo= X-Google-Smtp-Source: ABdhPJwZBQ80T0SIPg004jLCmjyP29KFwnteYno/ALGalavU2pOMZE/fIz8eh/sCCf46sVq+2QNyFw== X-Received: by 2002:a17:90b:1e05:b0:1dc:575e:6211 with SMTP id pg5-20020a17090b1e0500b001dc575e6211mr3839276pjb.120.1652252753589; Wed, 11 May 2022 00:05:53 -0700 (PDT) Received: from smtpclient.apple ([2600:1700:2ec7:8c90:7cb3:8483:26c4:aa26]) by smtp.gmail.com with ESMTPSA id q1-20020a170902bd8100b0015e8d4eb28esm892553pls.216.2022.05.11.00.05.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 May 2022 00:05:53 -0700 (PDT) From: Yuan Fu Content-Type: multipart/mixed; boundary="Apple-Mail=_EAC0D797-2FAB-4799-88E4-4937434036D8" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.80.82.1.1\)) Subject: 29.0.50; [PATCH] Fix browse-url-emacs on file:// urls Message-Id: Date: Wed, 11 May 2022 00:05:50 -0700 To: Bug Report Emacs X-Mailer: Apple Mail (2.3696.80.82.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=casouri@gmail.com; helo=mail-pl1-x62a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit 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: -2.3 (--) --Apple-Mail=_EAC0D797-2FAB-4799-88E4-4937434036D8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 If you call browse-url-emacs with a file:// url, Emacs does not open the = correct file: (browse-url-emacs "file://~/a/b") opens /a/b (browse-url-emacs "file://a/b") opens /b Basically unless the path is an absolute path, the first level is = chopped because url parses it as host and throws it away. This patch = concats the host back. If the path is absolute, host is empty string so = it=E2=80=99s ok. Yuan --Apple-Mail=_EAC0D797-2FAB-4799-88E4-4937434036D8 Content-Disposition: attachment; filename=file-url.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="file-url.patch" Content-Transfer-Encoding: 7bit diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 66898d7707..393ed76e8b 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -1250,7 +1250,9 @@ browse-url-emacs (func (if same-window 'find-file 'find-file-other-window))) (if (equal (url-type parsed) "file") ;; It's a file; just open it. - (let ((file (url-unhex-string (url-filename parsed)))) + (let ((file (url-unhex-string + (concat (url-host parsed) + (url-filename parsed))))) (when-let ((coding (browse-url--file-name-coding-system))) (setq file (decode-coding-string file 'utf-8))) (funcall func file)) --Apple-Mail=_EAC0D797-2FAB-4799-88E4-4937434036D8-- From debbugs-submit-bounces@debbugs.gnu.org Wed May 11 03:54:04 2022 Received: (at 55357) by debbugs.gnu.org; 11 May 2022 07:54:04 +0000 Received: from localhost ([127.0.0.1]:35958 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nohAa-0006s0-2O for submit@debbugs.gnu.org; Wed, 11 May 2022 03:54:04 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:58820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nohAY-0006rh-J5 for 55357@debbugs.gnu.org; Wed, 11 May 2022 03:54:03 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4KynGx1DKcz1s761; Wed, 11 May 2022 09:54:00 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4KynGw5yn4z1qqkC; Wed, 11 May 2022 09:54:00 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id pJlnt-0Zot2h; Wed, 11 May 2022 09:54:00 +0200 (CEST) X-Auth-Info: lnXdyiWqODXLkDZamPE73nRYfY/7YehwHXgvHhcs3wahpA7jER5/kS7DBUyN56pQ Received: from igel.home (ppp-46-244-167-40.dynamic.mnet-online.de [46.244.167.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Wed, 11 May 2022 09:54:00 +0200 (CEST) Received: by igel.home (Postfix, from userid 1000) id 99BD42C361F; Wed, 11 May 2022 09:53:59 +0200 (CEST) From: Andreas Schwab To: Yuan Fu Subject: Re: bug#55357: 29.0.50; [PATCH] Fix browse-url-emacs on file:// urls References: X-Yow: Let's climb to the TOP of that MOUNTAIN and think about STRIP MINING!! Date: Wed, 11 May 2022 09:53:59 +0200 In-Reply-To: (Yuan Fu's message of "Wed, 11 May 2022 00:05:50 -0700") Message-ID: <87czgkwlm0.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 55357 Cc: 55357@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: -1.5 (-) On Mai 11 2022, Yuan Fu wrote: > (browse-url-emacs "file://~/a/b") opens /a/b > (browse-url-emacs "file://a/b") opens /b That is correct. The component after file:// is always the host part. See RFC8089 for the full specification. > Basically unless the path is an absolute path, the first level is chopped because url parses it as host and throws it away. This patch concats the host back. If the path is absolute, host is empty string so it’s ok. The host part can be non-empty, too. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Wed May 11 07:37:24 2022 Received: (at 55357) by debbugs.gnu.org; 11 May 2022 11:37:24 +0000 Received: from localhost ([127.0.0.1]:36255 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nokei-0002Wh-ED for submit@debbugs.gnu.org; Wed, 11 May 2022 07:37:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33326) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nokeg-0002WT-KF for 55357@debbugs.gnu.org; Wed, 11 May 2022 07:37:23 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37324) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nokeb-0008Ok-AX; Wed, 11 May 2022 07:37:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=jpvhP3zOEhtKS2hPYh3+vE8qTAg1YwO1xtIy7i7r3dQ=; b=a/s3vheAbhf2mCfYZgIW nNHPFsPbejuLjT3euYb7k1GU6FVaCZfYSPs1ck4EYN+nBg2UkusApZFm7IYIRqy+6uLWrAt1BN7q+ p1stuHJ4EY5rqW98k1ztHBvArz9mX5RYhC9qnGacQYEsMHRloD2htQIF5e0e7Li5QKtrZYGlgM3QE M259teaE+hNigMB2dEFhGdqehwQMCNkT6z7c+GgrQ0vkJ8WO9m8g9QCq+WEqpG4HJSNKhki8/9MlS SK59SpQ4D70BwNgAkdOw9mcml37TpoGr104Sx5VUADP5i41g9hNAOVbKeTP6eJkn0kPQ9rGclW5Qb xJjidpbxrGgm0A==; Received: from [87.69.77.57] (port=2304 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nokea-0001ln-Q0; Wed, 11 May 2022 07:37:17 -0400 Date: Wed, 11 May 2022 14:37:17 +0300 Message-Id: <837d6ss3ki.fsf@gnu.org> From: Eli Zaretskii To: Yuan Fu In-Reply-To: (message from Yuan Fu on Wed, 11 May 2022 00:05:50 -0700) Subject: Re: bug#55357: 29.0.50; [PATCH] Fix browse-url-emacs on file:// urls References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 55357 Cc: 55357@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: -3.3 (---) > Resent-From: Yuan Fu > Original-Sender: "Debbugs-submit" > Resent-CC: bug-gnu-emacs@gnu.org > Resent-Sender: help-debbugs@gnu.org > From: Yuan Fu > Date: Wed, 11 May 2022 00:05:50 -0700 > > > [1:text/plain Hide] > > > If you call browse-url-emacs with a file:// url, Emacs does not open the correct file: > > (browse-url-emacs "file://~/a/b") opens /a/b > (browse-url-emacs "file://a/b") opens /b > > Basically unless the path is an absolute path, the first level is chopped because url parses it as host and throws it away. This patch concats the host back. If the path is absolute, host is empty string so it’s ok. I think your URLs lack one or two more slashes. See https://en.wikipedia.org/wiki/File_URI_scheme#How_many_slashes? From debbugs-submit-bounces@debbugs.gnu.org Wed May 11 08:09:28 2022 Received: (at control) by debbugs.gnu.org; 11 May 2022 12:09:28 +0000 Received: from localhost ([127.0.0.1]:36353 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nol9j-0007pY-Sg for submit@debbugs.gnu.org; Wed, 11 May 2022 08:09:28 -0400 Received: from quimby.gnus.org ([95.216.78.240]:40468) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nol9i-0007pI-7J for control@debbugs.gnu.org; Wed, 11 May 2022 08:09:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=7MidCFGLjoJqZ40g1tbLKvobLB4tY+BT7H0kjByEIJY=; b=F0+AABsOd5dq4OfcXcnttlTQlk W1KVdmH7FgTXmATK5vtTRTlhBzTL2+XOiOCF8qIJYbZrqeues9KOxm9GvPUyHZJ8CdRkA8SnHYgRm zPp4QemMhxN6P/cYOC1q7vXdyaWB8tnT+JYdlO6v/R9ANzU1WjeVTLRvI63bE81q7wmk=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nol9a-0007y5-KN for control@debbugs.gnu.org; Wed, 11 May 2022 14:09:20 +0200 Date: Wed, 11 May 2022 14:09:17 +0200 Message-Id: <87ee10b79u.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #55357 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 55357 + moreinfo quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) 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: -3.3 (---) tags 55357 + moreinfo quit From debbugs-submit-bounces@debbugs.gnu.org Wed May 11 14:35:43 2022 Received: (at 55357) by debbugs.gnu.org; 11 May 2022 18:35:43 +0000 Received: from localhost ([127.0.0.1]:38442 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1norBX-00042W-7y for submit@debbugs.gnu.org; Wed, 11 May 2022 14:35:43 -0400 Received: from mail-pj1-f54.google.com ([209.85.216.54]:51119) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1norBV-00042H-U6 for 55357@debbugs.gnu.org; Wed, 11 May 2022 14:35:42 -0400 Received: by mail-pj1-f54.google.com with SMTP id iq10so3059408pjb.0 for <55357@debbugs.gnu.org>; Wed, 11 May 2022 11:35:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=f3vLtACwGngbRSNj5lcZJzoXgOy46rdhqYdFJFU5TLc=; b=eOUrhr9LqPkpQ1AQoMaAv8hL6eCOjDuB80oMTdvooOjMk1dj7Vtzgf9QqMcsr1N4M2 4lFTT2/OJT1sq3eh6yJnkC3hcWyNTJ2vgh5nlkENmcV+apl20qZeBC+ulkwoG89DMwHr pvxM8+jOGiSlpsPYUOkQeHVzE+Afv+1P0gU3Joy+mmCBtb5UllhWaE06RLmnUvtH7wff ZleuzJUwhZ/2aUMN6eO7DTpswLnaE/XPliLTn5p9eAPkoIBZxA/QMuvKzeJXy8QF14Sl /KOjVM2xheCnTKvAQ5xSzV9D4GrHZM/MjV7R+TaK9hnZMvGqYCK4tjwF28dyvGZxTb0e Jleg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=f3vLtACwGngbRSNj5lcZJzoXgOy46rdhqYdFJFU5TLc=; b=DStGvHKHKt4NCyDvQic9BT7Bpcdvt8J17tz351bma8cCUCavpMb41ETS0O95ECvmya smeBAGaUOB9/ORRqytEfYQMXAVqXLSjGEg/7stTsi/mc7u6m9oQ887/+a9rWJ26wSm6b 8RqHXiuJYKtkgTGREwiJX/3D+R6Z+vomfYv9/0qpVSQj8kQtnPOw+QiOlLoWRdSbhI4q 7K+iE4QO1CPHqn5Fw4o68FkhEMqbW9NbCheNFJqezRB70F5Yhd5kHRPVzhU/4XS637GF arRzm0VE/xf7tRm9eKpQ+hJoeawi+u1/aEaj3Mxaq9zDEgqpCNU5Uhqx6d48b01tCnXL mKig== X-Gm-Message-State: AOAM532Lzo/uPAHcUYtG38fhvyg37zJjVN3Io2K9I3slG9j5Abnbex7S 5n9zBY2JlxkeeQAE9cyifL9TaZ/U1xsWtw== X-Google-Smtp-Source: ABdhPJwZA2+Z6Iq5A3YZG2m5UzAqYEllVIK6lfAvhnAhmndlPEbSeXJqjEVgpTDDJe0/M0MAFQMaJw== X-Received: by 2002:a17:902:cec7:b0:15e:b8b0:b9c8 with SMTP id d7-20020a170902cec700b0015eb8b0b9c8mr27268984plg.155.1652294135973; Wed, 11 May 2022 11:35:35 -0700 (PDT) Received: from smtpclient.apple ([2600:1700:2ec7:8c90:7cb3:8483:26c4:aa26]) by smtp.gmail.com with ESMTPSA id r12-20020a63440c000000b003c6ab6ba06csm178921pga.79.2022.05.11.11.35.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 May 2022 11:35:35 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.80.82.1.1\)) Subject: Re: bug#55357: 29.0.50; [PATCH] Fix browse-url-emacs on file:// urls From: Yuan Fu In-Reply-To: <837d6ss3ki.fsf@gnu.org> Date: Wed, 11 May 2022 11:35:32 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <107F905D-8D3C-4572-8C08-17B64DFB31C1@gmail.com> References: <837d6ss3ki.fsf@gnu.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.3696.80.82.1.1) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55357 Cc: 55357@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: -1.0 (-) > On May 11, 2022, at 4:37 AM, Eli Zaretskii wrote: >=20 >> Resent-From: Yuan Fu >> Original-Sender: "Debbugs-submit" = >> Resent-CC: bug-gnu-emacs@gnu.org >> Resent-Sender: help-debbugs@gnu.org >> From: Yuan Fu >> Date: Wed, 11 May 2022 00:05:50 -0700 >>=20 >>=20 >> [1:text/plain Hide] >>=20 >>=20 >> If you call browse-url-emacs with a file:// url, Emacs does not open = the correct file: >>=20 >> (browse-url-emacs "file://~/a/b") opens /a/b >> (browse-url-emacs "file://a/b") opens /b >>=20 >> Basically unless the path is an absolute path, the first level is = chopped because url parses it as host and throws it away. This patch = concats the host back. If the path is absolute, host is empty string so = it=E2=80=99s ok. >=20 > I think your URLs lack one or two more slashes. See >=20 > https://en.wikipedia.org/wiki/File_URI_scheme#How_many_slashes? Ah! My bad. Closing. Yuan From debbugs-submit-bounces@debbugs.gnu.org Wed May 11 14:36:06 2022 Received: (at 55357-done) by debbugs.gnu.org; 11 May 2022 18:36:06 +0000 Received: from localhost ([127.0.0.1]:38446 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1norBu-00043h-GG for submit@debbugs.gnu.org; Wed, 11 May 2022 14:36:06 -0400 Received: from mail-pf1-f175.google.com ([209.85.210.175]:37588) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1norBt-000430-KL for 55357-done@debbugs.gnu.org; Wed, 11 May 2022 14:36:06 -0400 Received: by mail-pf1-f175.google.com with SMTP id bo5so2721046pfb.4 for <55357-done@debbugs.gnu.org>; Wed, 11 May 2022 11:36:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:content-transfer-encoding:mime-version:subject:date:references :to:in-reply-to:message-id; bh=qgcmcXPMDtikwOs2QPT+Rv/ES7DgyQjo4BYhHLyafP8=; b=bW+6dgWaJXhrLOyE07mw3GDWHjvH3TEehJEQUVk7RA2Ci7JukAL8LST3+D/LiujO42 gdHuOGSMsIP0uIL+G8ui0mw0/dXFC7qqHvxG+FxNJtD/xCI4n2ChysNlRuYG+rS95ksg z70x6RMojCu6bdAxa3YbPo60wvuV3Lt49lbnBwXBuPO0S5BXkDhrN4HTDwt1pmYO69uD t4/6lSb1JW/z2AZX03tCZAK65ZwOpKBh/PhT6CyFdnWG/DJYeAXtLHHKIFH7m+5bzXEM tH9HqgAvLurrKrh8lqbZ5NCAIJjCLgAn9k92X06qlIy24bkGL2ZEosSB5t5lkx4qvF07 Lkjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:date:references:to:in-reply-to:message-id; bh=qgcmcXPMDtikwOs2QPT+Rv/ES7DgyQjo4BYhHLyafP8=; b=eyU+qJfLErBk5ZQeyh9XDuyDbKCr44raxJhreErdkWs/hJMc1EbWNk4w9l0zY32wem X9S+GkXvIUf8U+k8HSxRUTN6piNodX30B0cVJKQ+1kXFOxX245zzkFQeDTdtnTKakpsa ypvCyMA+uIZONuDD0PZbojbP5xGFGCa0/3IT5nRCVLsH5QXI+tcboFYoQD43+aMdLxUp 24WblII004gW1tW0H/UPF20gwEOGLiopfjLhwSBCA6lTr3mfssepeXkxEKwGqEwap3HA qdgmBTqb+Ag0C6rYHENdHehiTzfMA+ayifXLO3URUVZ7D8mneCOQTc5zYJLgDcjR4fdq n9TQ== X-Gm-Message-State: AOAM531epPVHTXexdJyz5r7wpsWs6uh9Udyb7k1kdSPT/D7g67DaINIh IZw8MwO76lg5Jrk6S71CYgtceNpHMORALQ== X-Google-Smtp-Source: ABdhPJzghv9y+wpCgQHpxcVqqhjae2nY9b9Ephw4H/HZ4NTAuGmuFq+z0f4UHnZZE9qo1Bw2Ez1mfw== X-Received: by 2002:a05:6a00:1a8d:b0:510:510f:d8e1 with SMTP id e13-20020a056a001a8d00b00510510fd8e1mr26023612pfv.83.1652294159742; Wed, 11 May 2022 11:35:59 -0700 (PDT) Received: from smtpclient.apple ([2600:1700:2ec7:8c90:7cb3:8483:26c4:aa26]) by smtp.gmail.com with ESMTPSA id r12-20020a63440c000000b003c6ab6ba06csm178921pga.79.2022.05.11.11.35.58 for <55357-done@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 May 2022 11:35:58 -0700 (PDT) From: Yuan Fu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.80.82.1.1\)) Subject: Re: bug#55357: 29.0.50; [PATCH] Fix browse-url-emacs on file:// urls Date: Wed, 11 May 2022 11:35:58 -0700 References: <837d6ss3ki.fsf@gnu.org> <107F905D-8D3C-4572-8C08-17B64DFB31C1@gmail.com> To: 55357-done@debbugs.gnu.org In-Reply-To: <107F905D-8D3C-4572-8C08-17B64DFB31C1@gmail.com> Message-Id: X-Mailer: Apple Mail (2.3696.80.82.1.1) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55357-done 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: -1.0 (-) > On May 11, 2022, at 11:35 AM, Yuan Fu wrote: >=20 >=20 >=20 >> On May 11, 2022, at 4:37 AM, Eli Zaretskii wrote: >>=20 >>> Resent-From: Yuan Fu >>> Original-Sender: "Debbugs-submit" = >>> Resent-CC: bug-gnu-emacs@gnu.org >>> Resent-Sender: help-debbugs@gnu.org >>> From: Yuan Fu >>> Date: Wed, 11 May 2022 00:05:50 -0700 >>>=20 >>>=20 >>> [1:text/plain Hide] >>>=20 >>>=20 >>> If you call browse-url-emacs with a file:// url, Emacs does not open = the correct file: >>>=20 >>> (browse-url-emacs "file://~/a/b") opens /a/b >>> (browse-url-emacs "file://a/b") opens /b >>>=20 >>> Basically unless the path is an absolute path, the first level is = chopped because url parses it as host and throws it away. This patch = concats the host back. If the path is absolute, host is empty string so = it=E2=80=99s ok. >>=20 >> I think your URLs lack one or two more slashes. See >>=20 >> https://en.wikipedia.org/wiki/File_URI_scheme#How_many_slashes? >=20 > Ah! My bad. Closing. >=20 > Yuan >=20 From unknown Sat Jun 21 05:12:42 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 09 Jun 2022 11: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