Re: Lazy load of org-protocol

2022-02-10 Thread Max Nikulin
On 10/02/2022 02:22, Jim Porter wrote: On 2/9/2022 8:46 AM, Max Nikulin wrote: On a related note, there is still an issue with `--eval' in some cases. It fails to work with emacsclient when invoking an alternate editor:    emacsclient --alternate-editor emacs --eval '(message "hi")' If Emac

Re: Lazy load of org-protocol

2022-02-09 Thread Jim Porter
On 2/9/2022 8:46 AM, Max Nikulin wrote: It is not a problem to implement --apply in addition to --arg. [snip] For the purposes of this issue, I think either solution would probably work. It probably depends on what people think on emacs-devel. On a related note, there is still an issue with

Re: Lazy load of org-protocol

2022-02-09 Thread Max Nikulin
On 08/02/2022 17:44, Tianshu Wang wrote: Max Nikulin writes: Thank you, such approach, unlike mine example, does not have code duplication. On the other hand it loads org-protocol on any remote command, not only for "files" representing org-protocol URIs. Maybe defadvice in org-protocol.el sh

Re: Lazy load of org-protocol

2022-02-07 Thread Jim Porter
On 2/7/2022 6:57 AM, Max Nikulin wrote: Maybe another option would be to add an --apply argument that really *does* consume the other command-line args and turns them into a properly-quoted function call. Roughly speaking, it would turn this:    emacs --apply func foo bar baz into this:    (

Re: Lazy load of org-protocol

2022-02-07 Thread Max Nikulin
On 06/02/2022 09:40, Tianshu Wang wrote: (defadvice server-execute (before enable-org-protocol activate) (unless (featurep 'org-protocol) (require 'org-protocol))) Thank you, such approach, unlike mine example, does not have code duplication. On the other hand it loads org-protocol on any r

Re: Lazy load of org-protocol

2022-02-06 Thread Jim Porter
On 2/6/2022 8:42 AM, Max Nikulin wrote: On 06/02/2022 01:27, Jim Porter wrote: As a result, I think a good first step might be to add support for "--funcall" to emacsclient, just like the regular emacs binary. (The "-f" shorthand won't work though, since emacsclient already uses that for "--se

Re: Lazy load of org-protocol

2022-02-06 Thread Max Nikulin
On 06/02/2022 01:27, Jim Porter wrote: On 2/5/2022 3:54 AM, Max Nikulin wrote: etc/emacsclient-mail.desktop in the Emacs repo does this.) The command to use for a new Emacs instance is simple:   emacs -f message-mailto %u However, doing this for emacsclient is harder:   emacsclient --alter

Re: Lazy load of org-protocol (Max Nikulin)

2022-02-05 Thread Tianshu Wang
ite-lisp/packages/org/)]) (Uwe Brauer) >3. Re: [BUG] org-bibtex-yank does not recognise bibtex entry > [9.6 (9.6-??-e7ea951 ] (Ihor Radchenko) >4. Re: Problem with org-babel and geiser (Ihor Radchen

Re: Lazy load of org-protocol

2022-02-05 Thread Jim Porter
On 2/5/2022 3:54 AM, Max Nikulin wrote: I would prefer to avoid    (require 'org-protocol) in emacs init file and to postpone loading till invocation of emacsclient with org-protocol URI. The problem is a hack in org-protocol. URIs are actually treated as (relative) file names and magic is a

Lazy load of org-protocol

2022-02-05 Thread Max Nikulin
Hi. I would prefer to avoid (require 'org-protocol) in emacs init file and to postpone loading till invocation of emacsclient with org-protocol URI. The problem is a hack in org-protocol. URIs are actually treated as (relative) file names and magic is achieved in an advice for `server-vis