From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?R=FCdiger?= Sonderfeld Newsgroups: gmane.emacs.devel Subject: Re: Proposal: emacsclient --readonly Date: Fri, 27 Sep 2013 20:22:01 +0200 Message-ID: <2142801.kzSLt3AetH@descartes> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1380306145 27011 80.91.229.3 (27 Sep 2013 18:22:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 Sep 2013 18:22:25 +0000 (UTC) Cc: emacs-devel@gnu.org To: monnier@iro.umontreal.ca Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 27 20:22:28 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VPcgN-0004Ks-Ht for ged-emacs-devel@m.gmane.org; Fri, 27 Sep 2013 20:22:27 +0200 Original-Received: from localhost ([::1]:37955 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPcgN-0004zy-23 for ged-emacs-devel@m.gmane.org; Fri, 27 Sep 2013 14:22:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33189) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPcgE-0004yv-Ax for emacs-devel@gnu.org; Fri, 27 Sep 2013 14:22:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VPcg5-00078U-37 for emacs-devel@gnu.org; Fri, 27 Sep 2013 14:22:18 -0400 Original-Received: from ptmx.org ([178.63.28.110]:32782) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPcg4-00078J-TD for emacs-devel@gnu.org; Fri, 27 Sep 2013 14:22:09 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by ptmx.org (Postfix) with ESMTP id 70BB42AA84; Fri, 27 Sep 2013 20:22:07 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at ptmx.org Original-Received: from ptmx.org ([127.0.0.1]) by localhost (ptmx.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rQyUjioPr9SR; Fri, 27 Sep 2013 20:22:06 +0200 (CEST) Original-Received: from descartes.localnet (chello080108246092.7.14.vie.surfer.at [80.108.246.92]) by ptmx.org (Postfix) with ESMTPSA id 7FE722221B; Fri, 27 Sep 2013 20:22:05 +0200 (CEST) User-Agent: KMail/4.10.5 (Linux/3.8.0-30-generic; KDE/4.10.5; x86_64; ; ) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 178.63.28.110 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:163687 Archived-At: 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 serve= r- 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 t= he info=20 page in the running Emacs session. I need this to support the "doc" co= mment=20 in `inferior-octave'. With this patch it could be done without a lot o= f=20 hacks. Regards, R=C3=BCdiger > =3D=3D=3D 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 @@ >=20 > (process-put proc 'continuation nil) > (if continuation (ignore-errors (funcall continuation))))) >=20 > +(defvar server-custom-option-function #'identity > + "Function to process additional emacsclient arguments. > +The function is called with a single argument (a list of args receiv= ed > +from emacsclient) and returns the list of args left to process. > +The easiest way to modify this variable is through `add-function'.")= > + >=20 > (cl-defun server-process-filter (proc string) > =20 > "Process a request from the server to edit some files. > =20 > PROC is the server process. STRING consists of a sequence of >=20 > @@ -1067,7 +1076,8 @@ >=20 > (setq string (substring string (match-end 0))) > (setq args-left > =20 > (mapcar 'server-unquote-arg (split-string request "= " t))) >=20 > - (while args-left > + (while (setq arg-left (funcall server-custom-option-funct= ion > + args-left)) >=20 > (pcase (pop args-left) > =20 > ;; -version CLIENT-VERSION: obsolete at birth. > (`"-version" (pop args-left))