[Conkeror] Getting informations about the current buffer in interactive commands
Jeremy Maitin-Shepard
jeremy at jeremyms.com
Mon Apr 6 16:34:58 PDT 2009
Sebastian Rose <sebastian_rose at gmx.de> writes:
> Jeremy Maitin-Shepard <jeremy at jeremyms.com> writes:
>>> Additionally, I need to url-encode these informations. How do I do
>>> that?
>>
>> There are the standard global JavaScript functions encodeURI and
>> encodeURIComponent.
> encodeURI does _NOT_ hexify slahses! Please use
> encodeURIComponent().
> emacsclient compresses double and tripple slashes, that's why. Double
> slashes in the selection or title would not survive a call to
> emacsclient otherwise.
>> As a sidenote, looking at org-protocol, it is not clear what advantage
>> it offers over emacsclient -e. Some of the protocols it actually
>> implements surely are useful, but the special filename interception it
>> does just seems like extra infrastructure for no gain.
> The hand full of small functions, that make up the `extra
> infrastructure', may be changed in the future, without affecting the
> handlers we use.
> You are not an Org-user, are you?
I do use org, but perhaps not very heavily.
> Only one protocol has to be registered to use an arbitrary number of
> sub-protocols to do anything you want.
> Before, we had the remember and bookmark stuff in org-mode/contrib,
> which is now included in org-protocol.el. For each of those, a protocol
> had to be registered with every browser (MS is easier here), and a shell
> script in different flavours was needed (Bash/DOS/...).
In the context of interacting with existing software that you don't want
to or is hard to modify, I can see how it would be useful. In the
context of Conkeror, there are no limitations about how external
programs can be called, so there is no advantage to using a "URL-like"
command-line syntax.
[snip]
> org-protocol/emacsclient doesn't look like the best way to do that
> stuff, but what `infrastructure' does emacs provide?
You can invoke arbitrary Elisp code via emacsclient -e, so in
particular. That is the infrastructure that Emacs provides.
--
Jeremy Maitin-Shepard
More information about the Conkeror
mailing list