Subject: bug#74467: 31.0.50; org-protocol emacsclient.desktop change is not fully functional

From: Björn Bidar <[email-masked]>
Date: Sun, 05 Jan 2025 00:07:37 +0200

Eli Zaretskii <[email-masked]> writes:

>> From: Björn Bidar <[email-masked]>
>> Cc: [email-masked],  [email-masked],  [email-masked]
>> Date: Thu, 02 Jan 2025 22:02:05 +0200
>> 
>> Eli Zaretskii <[email-masked]> writes:
>> 
>> >> Cc: [email-masked], [email-masked]
>> >> Date: Mon, 16 Dec 2024 22:01:56 +0200
>> >> From: Eli Zaretskii <[email-masked]>
>> >> 
>> >> > From: Ihor Radchenko <[email-masked]>
>> >> > Cc: Alexey Lebedeff <[email-masked]>, [email-masked]
>> >> > Date: Mon, 16 Dec 2024 19:34:01 +0000
>> >> > 
>> >> > Eli Zaretskii <[email-masked]> writes:
>> >> > 
>> >> > >> One solution would be introducing separate  .desktop file
>> >> > >> (i.e. 'etc/emacsclient-org-protocol.desktop'), analoguous to the already
>> >> > >> existing 'etc/emacsclient-mail.desktop' (which uses '%u').
>> >> > >
>> >> > > Ihor, could you please look into this?
>> >> > 
>> >> > I am attaching an *untested* patch that implements a new .desktop file.
>> >> 
>> >> Thanks.  Let's see if someone objects.
>> >> 
>> >> > Note that an alternative could be handling file:// URIs by Emacs. Your call.
>> >> 
>> >> I thought we already did?
>> >
>> > Ping!  Since we already know how to handle file:// UTIs, what would
>> > the solution using that look like?
>> 
>> Would it work to add a file-handler for uris to call?
>
> Isn't that what we already do when we visit files given by file://
> URI?

No not for file argument when Emacs stars or in emacsclient. We append
/: and then call find_file_handler.

Is the .*:/ part ignore when calling find-file-file interactively?

When I call find-file in eshell with someting like
"file:///etc/os-release" I get this:

Debugger entered--entering a function:
* directory-abbrev-apply("/home/bidar/dev/emacs/emacs/src/file:/etc/os-release")
* abbreviate-file-name("/home/bidar/dev/emacs/emacs/src/file:/etc/os-release")
* find-file-noselect("file:///etc/os-release" nil nil nil)
* #<subr find-file>("file:///etc/os-release")
* apply(#<subr find-file> "file:///etc/os-release")
* find-file("file:///etc/os-release")
  eval((find-file "file:///etc/os-release"))