From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol Date: Tue, 19 Sep 2023 13:16:58 +0000 Message-ID: <87a5tinvzp.fsf@localhost> References: <87v8d66r7l.fsf@localhost> <87led53q0c.fsf@thaodan.de> <87fs3bkho4.fsf@localhost> <835y47g2b2.fsf@gnu.org> <83r0mveel5.fsf@gnu.org> <87cyyfnkvf.fsf@thaodan.de> <837comevw5.fsf@gnu.org> <877comr3te.fsf@thaodan.de> <8334zae81i.fsf@gnu.org> <87o7hyo1bs.fsf@localhost> <83v8c6cpwe.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5440"; mail-complaints-to="usenet@ciao.gmane.io" Cc: bjorn.bidar@thaodan.de, stefankangas@gmail.com, 65469@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 19 15:17:21 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiabO-000130-M7 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 19 Sep 2023 15:17:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qiab3-0001k0-3f; Tue, 19 Sep 2023 09:16:57 -0400 Original-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 1qiab0-0001jr-ER for bug-gnu-emacs@gnu.org; Tue, 19 Sep 2023 09:16:54 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qiab0-0002Rr-5v for bug-gnu-emacs@gnu.org; Tue, 19 Sep 2023 09:16:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qiab8-0006CI-Iu for bug-gnu-emacs@gnu.org; Tue, 19 Sep 2023 09:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Sep 2023 13:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65469 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 65469-submit@debbugs.gnu.org id=B65469.169512936223722 (code B ref 65469); Tue, 19 Sep 2023 13:17:02 +0000 Original-Received: (at 65469) by debbugs.gnu.org; 19 Sep 2023 13:16:02 +0000 Original-Received: from localhost ([127.0.0.1]:55617 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qiaa9-0006AR-FL for submit@debbugs.gnu.org; Tue, 19 Sep 2023 09:16:02 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:58341) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qiaa5-0006AC-ME for 65469@debbugs.gnu.org; Tue, 19 Sep 2023 09:16:00 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 372AE240028 for <65469@debbugs.gnu.org>; Tue, 19 Sep 2023 15:15:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1695129343; bh=WrLXOnZXktysg48HXW/kg7h1F12O3BBtYRh9GmlUz4c=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=Iir1yfebAL+ZkOe+ENccWxCh6PuiiHQ6vFNR9f3ZPeTG7VD67chnyH2cesilDRyQF Lv0sshnt+Xay/DGochrM+sydPtOSVokrI1m4AdSwRwxc754sm+jY86XhnUVPEzuv7S H52EhlRuzc3GAUMuTPVtWMvVLnX3ktDFHn6sT+w3oAXQZ8L9oWd0LWCM4x6kYCCJEI 2VnoO+2VX83JIr8weY/AtVXR/h+Ogi3aJwa++67dkVb66Mmo2mTX1Jyn0g9xJdbuKx 7kZmT7wO5htKYWHflwpN/Ic+giI4HmAVSMwYEVduQzliZbCLqZ/RvsV4Y7q3KPZjpO X0M0MqKI+CJvg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RqhxB2prMz6tw5; Tue, 19 Sep 2023 15:15:42 +0200 (CEST) In-Reply-To: <83v8c6cpwe.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:270872 Archived-At: Eli Zaretskii writes: > Specifically, with the following wording be accurate and clear? > > ** On capable systems, Emacs is now the default application for 'org-protocol'. > Org mode provides a way to quickly capture bookmarks, notes, and links > using 'emacsclient': > > emacsclient "org-protocol://store-link?url=URL&title=TITLE" > > Previously, users had to manually configure their desktop environment > to open 'org-protocol' links in Emacs. On any XDG-compliant system, > including GNU/Linux and some others, these links should now open in > Emacs automatically, as the "emacsclient.desktop" file now arranges > for Emacs to be the default application for the 'org-protocol' URI > scheme. See the Org mode manual, Info node "(org) Protocols" for more > details. Sounds good to me. May also add about Android (Po Lu implemented the relevant handler in d286f6889cf). >> Also, a number of applications, expect xdg-open executable to be >> available on GNU/Linux systems as a generic way to open files using >> "right" application. Including Emacs itself - see >> `browse-url-can-use-xdg-open', for example. > > Is this related to the issue with org-protocol? Yes. For example, a browser bookmarklet like javascript:location.href='org-protocol://capture?' + new URLSearchParams({ template: 'x', url: window.location.href, title: document.title, body: window.getSelection()}); will, by default, leverage xdg-open to handle org-protocol://... link type. xdg-open consults mime-database, built using .desktop files provided by installed applications. With the discussed patch, e.g. Firefox will automatically use Emacs when clicking on the above bookmarklet. Then, strictly speaking, it is not necessary for the GNU/Linux system to be fully XDG-compiant. It will be enough that (1) Emacs provides .desktop file; (2) Linux has xdg-open and its dependencies installed; (3) Firefox makes use of xdg-open. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at