From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:5f26::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id gC2MOQTcjmXLSwAAkFu2QA (envelope-from ) for ; Fri, 29 Dec 2023 15:47:33 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id gPR0NATcjmXyQQAAqHPOHw (envelope-from ) for ; Fri, 29 Dec 2023 15:47:32 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; none Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C7387590B1 for ; Fri, 29 Dec 2023 15:47:32 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rJE88-0003NS-8X; Fri, 29 Dec 2023 09:46:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rJE85-0003Ll-8z for emacs-orgmode@gnu.org; Fri, 29 Dec 2023 09:46:29 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rJE7z-0000Gz-Vg for emacs-orgmode@gnu.org; Fri, 29 Dec 2023 09:46:29 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 0670E240027 for ; Fri, 29 Dec 2023 15:46:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1703861179; bh=HcWEaw4NggnR4tHlmd/82F1t5QHuuiHbL/JYOvD7csw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=XW30dt2Yl7viBTGGuZLhG4ms+uY8EMe7o9VzAGEjWDkVPIyVVBqNTuvOez+uHlgjw a4VWWHZLMODUKQulJnIpL8YzRDPTrEqSFh1kQ8a7hcxN5l0ABu8n9rFdsk8renG6jb 9flQicv/aBzec4ID9qlaUiZQ6uZOQ29fRZiC2WDtbaoj6pvs8nyOsLagw9pvasHsAM 7pdP8zpwJRgNEOn6pJq8di2ciCzkfvtF5G/v21G2CHIbYTCTJjq1owx4Mbxpe6OHo6 rHwvAWrc/xOKCWi1mIwTu/ygZV6NdifxIGCZuC5Pb18rzcxRSYERZfG25bK1E/OsuB ru6hGQf6pFdfg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4T1p96171bz6tmv; Fri, 29 Dec 2023 15:46:17 +0100 (CET) From: Ihor Radchenko To: Joseph Turner Cc: emacs-orgmode@gnu.org, Adam Porter Subject: Re: Should org-link-parser add type "file" when link has no "file:" prefix? In-Reply-To: <87o7e9ei3p.fsf@ushin.org> References: <87o7e9ei3p.fsf@ushin.org> Date: Fri, 29 Dec 2023 14:49:31 +0000 Message-ID: <87wmsx3vyc.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -4.00 X-Spam-Score: -4.00 X-Migadu-Queue-Id: C7387590B1 X-Migadu-Scanner: mx10.migadu.com X-TUID: cv8CqO1WxymB Joseph Turner writes: > I expect the following to return "[[/foobar]]": > > (with-temp-buffer > (delay-mode-hooks (org-mode)) > (insert "[[/foobar]]") > (goto-char (point-min)) > (let ((link (org-element-link-parser))) > (org-element-link-interpreter link nil))) > > Instead, it returns "[[file:/foobar]]". Thanks for reporting! Fixed, on main. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=d15e52fef > In hyperdrive.el currently, "[[/foobar]]" and "[[file:/foobar]]" have > different meanings: a link with no protocol prefix, like "[[/foobar]]", > points to a file inside of the same hyperdrive (virtual p2p folder), > whereas a link with the "file" protocol prefix, like "[[file:/foobar]]", > points to a file on the local filesystem: I do not recommend such approach. From the point of view of most of the Org mode code, it makes no difference whether file link has file: or not. So, you may face unexpected issues. It would be more reliable to provide a separate link type. We might even extend the special file+application: link type syntax that already allows special behavior for opening file links. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at