bug#74467: 30.1; emacsclient.desktop: x-scheme-handler/org-protocol is inconsistent with %F
Björn Lindqvist <[email protected]>
| Newsgroups | gmane.emacs.bugs |
|---|---|
| Message-ID | <CALG+76eeP5XTch-Bpd5TKcFZzosddB8eZdH=hoosFp=4k4AHgg@mail.gmail.com> |
Den tis 22 juli 2025 kl 10:26 skrev Ulrich Müller <[email protected]>: > > >>>>> On Mon, 21 Jul 2025, Ihor Radchenko wrote: > > > Ulrich Müller <[email protected]> writes: > >> A possible solution would be to drop x-scheme-handler/org-protocol > >> from emacsclient.desktop, and split it off into its own desktop file: > >> ... > >> > >> However, adding yet another desktop file looks like overkill. > >> (And considering Eli's reply in bug #79066 it won't be a viable option.) > > > Also see bug#74467. > > Sorry for the duplicate bug. Continuing in #74467. > > Looking at the last comments: > > >> I'm not sure I understand the proposal. One problem with having the > >> uri handler active at all times is that it subtly changes how local > >> files whose names just happen to start with "http://" (rare, but > >> still legitimate) are handled. > > > My proposal is to add the url-file-handler as ur-file-handler by > > default and change url-handler-mode to add the url's to the URI > > handler. That would make so that file URI's a handled always and the > > existing behavior of url-handler-mode is kept. > > > Have encountered files starting with a URI prefix such as http? > > I haven't had that so far. I workaround would be to always first check > > if a file with such a prefix exist in the url-file-handler before > > trying to process the URL/URI. > > Such heuristic methods tend to be brittle. IMHO it would be much cleaner > if emacsclient continued to interpret its arguments as plain filenames > by default. > > Instead, add an option --uri that would interpret them as URIs in a > well-defined manner. This could then be used in the desktop file > together with the %U field code. > > Alternatively (or in addition), emacsclient could have a more general > option like --desktop-file that would do the right thing in that > context: > - process arguments as URIs > - when called without arguments, create a new frame (instead of > signalling an error) > > There's also no good reason for that horrible shell wrapper in the > desktop file; it should just do > "Exec=emacsclient [options]... desktop-file %U" > and leave the rest to emacsclient itself. FWIW, changing %F to %U works just fine in KDE Plasma. Dolphin is nice enough not to (needlessly) wrap local paths as file URIs when it doesn't have to. I.e., %U is a "white lie" advertising support for the specified URIs, but shouldn't affect how (sane) desktops interact with the application. Though, I'm very much not an expert. -- mvh/best regards Björn Lindqvist