From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id eGn0AQb49mRmTQEA9RJhRA:P1 (envelope-from ) for ; Tue, 05 Sep 2023 11:42:30 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id eGn0AQb49mRmTQEA9RJhRA (envelope-from ) for ; Tue, 05 Sep 2023 11:42:30 +0200 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 E507851E69 for ; Tue, 5 Sep 2023 11:42:29 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=p497j2DX; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1693906949; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=VGlpMRBvJtnf22+cQevTWmGBhTCGi8wmbaJr0+7xg0A=; b=YvzQIlvYOLE1H35z6235FGxn5BbfZyTGYCXh0rSAgnahTsBi0YSKgCkXWsVHdOFBq5OsXD 5jFLeODENl7pml4TQaYFu+ovAEP2JTyDOBoYrxAGukcv9sjH55cc6JhpZZl8pIDP1jVKmQ 5CiTGUjSfOOSDNj6VttsQahpLyKVroCUsAwn+4UjgQ5hP+y7c+k+PQm0hjbaVMOmSFIWpn B7Qj4/3R8/oxiQVdLCybSh+4G/FGS3gJr69N/75xyV7wNBZ1GA9nVHfqlgTmCRK5pETuu6 hD826o5Cz0qIs8otcNJOzQD3jxMUYku4DZ8YzBhNr/xqK0m19mJ70avcwNQTww== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1693906949; a=rsa-sha256; cv=none; b=Gqx8lLlOXjurc8onHqJYapHR21N12dMq70m554sSxPEALZbKis/yHCnwx0cIl1OYtkbZQU sqNYaurfrD1DKD58818zkNFl4Y8pO9XAK64bS+cDGnf2cooRy1gc24zigcNOxJPKGhJd3H oLR4WP0fx9Jhp4a2oZeF5yTURcuw36dDR4BAkWpIE612LknFJ91g61fdO//wSTPTZQocPv 2UCjBkCDZp0HgmhySChdJH4Ca10IEb9KAYaOroBJOSa346Ln7hOw2v8EThZOg8TETkbXul B9DWMbBSvPep5+4MbGWfLo2S2jkU5oE9OO/xeYNAIgcm7k+ManHHQTNW1ztwIQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=p497j2DX; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qdSZ5-0003oa-Ny; Tue, 05 Sep 2023 05:41:43 -0400 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 1qdSZ3-0003oA-MW for emacs-orgmode@gnu.org; Tue, 05 Sep 2023 05:41:41 -0400 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 1qdSZ0-0001Qw-GY for emacs-orgmode@gnu.org; Tue, 05 Sep 2023 05:41:41 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 69D16240029 for ; Tue, 5 Sep 2023 11:41:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1693906895; bh=VrXwgv7SuXkK7HDke21kd+476umLqHkxwHoe5cyCcvk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=p497j2DX0bNwARzcWqztHguzREUbASK+XqNHgaUoSavEDgLav+PZOzBdUp416Muvz iFQtirg3jkYXW1CTCZ5GBmhQWH7pQ0lHCIHg9WZhK6E/bdfCD7+oTPDiPs2rRRU9SI vZYoUGAHwqtpMec1FVYxxQMPgKsxBgHA9kIspfx2kie9UTEciGOXxV/uENWwyZEWEc jHrkxvWBDfNFWOZdfJCG7GUGoGWWBvd1KDHuwBze4CxMWmputH4+TKPAsS2PszrYoY cCsv9f9+DT2D0yP+oX24QlsLrxI/sxokNRAquzV1e07ht4IfRp1YXZIzSoAwT3pVDG lf3Ctzx9d0YDw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Rg0rZ4WdDz9rxY; Tue, 5 Sep 2023 11:41:34 +0200 (CEST) From: Ihor Radchenko To: Max Nikulin Cc: emacs-orgmode@gnu.org Subject: Re: [BUG] URI handling is overly complicated and nonstandard [9.6.7 (N/A @ /gnu/store/mg7223g8mw90lccp6mm5g6f3mpjk70si-emacs-org-9.6.7/share/emacs/site-lisp/org-9.6.7/)] In-Reply-To: References: <87il8v2q00.fsf@riseup.net> <89434f4f-8aea-23f2-bbfc-3961c18f2154@gmail.com> <87a5u6tgb3.fsf@localhost> <878r9nofpw.fsf@localhost> Date: Tue, 05 Sep 2023 09:42:23 +0000 Message-ID: <8734ztvtvk.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 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-Scanner: mx2.migadu.com X-Spam-Score: -6.85 X-Migadu-Queue-Id: E507851E69 X-Migadu-Spam-Score: -6.85 X-TUID: fC8tUWgYsUQI Max Nikulin writes: >>> (org-link-set-parameters "tel") > ... >>> \href{321}{call} >>> >>> "tel:" is missed. > > I have realized that it is possible to take advantage of current behavior: > > (org-link-set-parameters > "browse" > :follow > (lambda (url arg) (browse-url url arg))) > > so [[browse:tel:+321][call]] with *any* protocol is properly exported > and opened. The only inconvenience is that the "browse:" type must be > added when a link is inserted or stripped down to copy a URL. I strongly discourage abusing internal implementation details. This behaviour is not documented. Moreover, I just suggested changing it. >> (path (org-latex--protect-text >> (pcase type >> ((or "http" "https" "ftp" "mailto" "doi") >> (concat type ":" raw-path)) >> ("file" >> (org-export-file-uri raw-path)) >> (_ >> raw-path)))) >> >> is fishy. > > I do not like that lists of types in ox backends are not the same as in > ol.el: > > (dolist (scheme '("ftp" "http" "https" "mailto" "news")) > (org-link-set-parameters scheme My suggestion will avoid the very need to have this list. >> We may simply use (org-element-property :raw-link link) and leave >> special handling to "file" links only. >> >> Does it make sense? > > From my point of view it will be more sane behavior. However it may > require update of 3rd party ox backends. Yes. The main problem is that I fail to understand the motivation behind the current behaviour. git logs reveal that the code is there from the initial version of the library. For now, the current behaviour looks like an oversight. Also, only ox-latex-derived backends that worked around the current undocumented behaviour might be affected. >>> Actually I had in mind more flexible delegation. :export functions >>> should be able to alter URI, attributes and to provide description if it >>> is missed, but did not care if '' or '\href{}{}' should >>> be used. >> >> I'd call that :filter rather than :export :) > > It is an option, the only disadvantage is that `org-link-properties' can > not set an export filter directly. What I meant is a new link property called :filter. >>> Easy way to add protocol/scheme should include :follow with `browse-url' >>> as well. >> >> Sorry, but I do not understand what you are referring to. >> May you elaborate? > > My reading of the bug report subject is that it should be easy to define > a link type for a protocol not supported by Org mode out of the box. > Minimal features are export and follow using a handler configured > desktop-wide or Emacs-wide. This is not what the bug report was about. I'd prefer to focus this particular discussion closer to the bug report reproducer. Feel free to branch off a new feature request about :follow with more details on what you have in mind. I'd prefer a more concrete proposal, because I have no good ideas how to make things easier. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at