[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Proposal: emacsclient --readonly
From: |
Rüdiger Sonderfeld |
Subject: |
Re: Proposal: emacsclient --readonly |
Date: |
Fri, 27 Sep 2013 20:22:01 +0200 |
User-agent: |
KMail/4.10.5 (Linux/3.8.0-30-generic; KDE/4.10.5; x86_64; ; ) |
Hello,
what happened to this patch? It would be very useful to me right now.
There should probably be a way to add functions to `commands' (in server-
process-filter) though. With this patch it could be done by adding an "--
eval" statement to the args. But there should probably be a clean way.
I'm currently attempting to write an info(1) like program which loads the info
page in the running Emacs session. I need this to support the "doc" comment
in `inferior-octave'. With this patch it could be done without a lot of
hacks.
Regards,
Rüdiger
> === modified file 'lisp/server.el'
> --- lisp/server.el 2013-02-13 04:31:09 +0000
> +++ lisp/server.el 2013-03-25 13:07:44 +0000
> @@ -909,6 +909,12 @@
>
> (process-put proc 'continuation nil)
> (if continuation (ignore-errors (funcall continuation)))))
>
> +(defvar server-custom-option-function #'identity
> + "Function to process additional emacsclient arguments.
> +The function is called with a single argument (a list of args received
> +from emacsclient) and returns the list of args left to process.
> +The easiest way to modify this variable is through `add-function'.")
> +
>
> (cl-defun server-process-filter (proc string)
>
> "Process a request from the server to edit some files.
>
> PROC is the server process. STRING consists of a sequence of
>
> @@ -1067,7 +1076,8 @@
>
> (setq string (substring string (match-end 0)))
> (setq args-left
>
> (mapcar 'server-unquote-arg (split-string request " " t)))
>
> - (while args-left
> + (while (setq arg-left (funcall server-custom-option-function
> + args-left))
>
> (pcase (pop args-left)
>
> ;; -version CLIENT-VERSION: obsolete at birth.
> (`"-version" (pop args-left))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: Proposal: emacsclient --readonly,
Rüdiger Sonderfeld <=