From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.devel Subject: Re: Generic Elisp mechanism to declare file/URI handlers for Emacs (was: bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol) Date: Tue, 19 Sep 2023 09:28:07 -0700 Message-ID: <04929221-5a28-c404-c5f2-0b8227be53d6@gmail.com> References: <87v8d66r7l.fsf@localhost> <87led53q0c.fsf@thaodan.de> <87fs3bkho4.fsf@localhost> <835y47g2b2.fsf@gnu.org> <874jjrk48q.fsf@localhost> <87cyyfwqs5.fsf@yahoo.com> <87sf7ao1o0.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10870"; mail-complaints-to="usenet@ciao.gmane.io" Cc: =?UTF-8?Q?Bj=c3=b6rn_Bidar?= , eliz@gnu.org, stefankangas@gmail.com, emacs-devel@gnu.org To: Ihor Radchenko , Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 19 18:28:52 2023 Return-path: Envelope-to: ged-emacs-devel@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 1qidam-0002aQ-2b for ged-emacs-devel@m.gmane-mx.org; Tue, 19 Sep 2023 18:28:52 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qida8-0002fj-NW; Tue, 19 Sep 2023 12:28:12 -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 1qida6-0002fa-Uo for emacs-devel@gnu.org; Tue, 19 Sep 2023 12:28:11 -0400 Original-Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qida5-0001dC-3h; Tue, 19 Sep 2023 12:28:10 -0400 Original-Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-68fb79ef55eso5310147b3a.0; Tue, 19 Sep 2023 09:28:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695140887; x=1695745687; darn=gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=0VtCvdj9LiyQahf/k7kUCoVvqj9gKIPCTsh97IE8aTY=; b=cGSBnsWjjRHw2jEkeDkqRyn+ShRlrTespWrzqiaKBA5v6kiTpTWP3jbakDCjW/2Svu XHqWvOvyatrOfcDVBN1Venxcq3g3sph778/3mNCxKES/18cb/GqqdfIW1snu3ub/d71+ 3Oomr7459Y+af/8CmqtAZMB7Zf/7oPXSgGxQZsptDZX1QhNonxL8zt0ax5kNUBnp+HeM X5L+wakqrs/MoDz0H/iMKAKPZ5f8eB/6oEn11fvYkAyUM5Xadb3Es5G4RT96hig6bBf4 nt51G65L2/Z1rqpZ7bqW7AZ4ugcikO5Syjq9NyJaxKNz2vH0DuaSF9FzkRtTvIsd1iLI XMPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695140887; x=1695745687; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0VtCvdj9LiyQahf/k7kUCoVvqj9gKIPCTsh97IE8aTY=; b=Cm53AVbKyNBoZNvGfNlXDjrnN0maL+Vjjo/OvELzWhnYfpBLYyVg+pIBMycNDvtoAD iHjlspd+fRf/D209dkrSlsrN6i4p+5qWST+s7h0fAFCXlSlYDYLCnVJ9IlUfa3ayT9aX r6D2eWpZLUSTQAh+kn/zmpTbUPYeadnEtcH4a2+q+M8NnZPM9XA6mKpp9cZriJsuAIZ0 YJFRJ3/ShGcS3x02LULce0qDl5ODFaoftfrKR0CJN9rb+DAEqJDHMA43C4/VoTfqhesh i5Wx68yfdkD6jqjv+SBD6t0fYjwC7fCZP6NwzPpLQKoR8eXEjMi8pSnbkWrhPubJIxWb wzHw== X-Gm-Message-State: AOJu0Yyo9wLe1Yk8JZYdWcM1QgqyWHPp1W+5begLc6SFGteIEyCxnf/H hn+mGj2sXCq/MY0ZLKysDhCw1Wv0lWxkcQ== X-Google-Smtp-Source: AGHT+IGfapca39m2h678sfvnlZXmGknZEqi0ERZuc1BDKZzx/KfH50bV7Sg+ktvje4EZKczP65kpFQ== X-Received: by 2002:a05:6a20:7288:b0:135:7975:f55 with SMTP id o8-20020a056a20728800b0013579750f55mr16586pzk.47.1695140886791; Tue, 19 Sep 2023 09:28:06 -0700 (PDT) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id q23-20020a62e117000000b00688435a9915sm8720809pfh.189.2023.09.19.09.28.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Sep 2023 09:28:06 -0700 (PDT) Content-Language: en-US In-Reply-To: <87sf7ao1o0.fsf@localhost> Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=jporterbugs@gmail.com; helo=mail-pf1-x42d.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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:310785 Archived-At: On 9/19/2023 4:14 AM, Ihor Radchenko wrote: > Would it make sense to create a more generic mechanism to collect a list > of handlers from all the Elisp sources in Emacs and then generate > Linux/Android/etc-specific definitions automatically when Emacs is > compiled? > > I imagine something akin how ;;;###autoload works - Elisp libraries that > implement handling of certain file types or URI protocols declare this > fact and then Emacs automatically pick this info, generating .desktop > files and relevant parts of Andoid > (java/org/gnu/emacs/EmacsOpenActivity.java) and whatever else necessary. Yes please. Based on your imaginings, I'm in turn imagining something where I can type "emacs protocol://foo.bar" into my shell, and if I've enabled Emacs' handling for "protocol:" URLs somehow, this would now do some "protocol"-specific magic. (For org-protocol, that would be to start an Org capture or something; for mailto, that would be to compose a new message; etc.) This would neatly resolve bug#65902 without having to mess around with emacsclient or the Emacs server protocol, and would hopefully let us remove the 'server-visit-files' advice in org-protocol. I'm sure there would be other interesting things we could do with an easy way of specifying URL handlers too (IRC links, HTTP(S) for EWW[1], etc). [1] Probably not as the system-wide default, but "emacs https://example.com" could work.