From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Rose Subject: Re: org-protocol and missing server-delete-client function Date: Thu, 16 Apr 2009 23:09:00 +0200 Message-ID: <87d4bcb91v.fsf@kassiopeya.MSHEIMNETZ> References: <20090416162920.093e8cb3@johnrakestraw.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LuYmD-0002Ji-Cj for emacs-orgmode@gnu.org; Thu, 16 Apr 2009 17:05:41 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LuYm8-0002Am-Sz for emacs-orgmode@gnu.org; Thu, 16 Apr 2009 17:05:40 -0400 Received: from [199.232.76.173] (port=53404 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LuYm8-0002AY-Oy for emacs-orgmode@gnu.org; Thu, 16 Apr 2009 17:05:36 -0400 Received: from mail.gmx.net ([213.165.64.20]:53908) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1LuYm7-00054o-Vu for emacs-orgmode@gnu.org; Thu, 16 Apr 2009 17:05:36 -0400 In-Reply-To: <20090416162920.093e8cb3@johnrakestraw.com> (John Rakestraw's message of "Thu, 16 Apr 2009 16:29:20 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: John Rakestraw Cc: emacs-orgmode@gnu.org Hi John, looks like I have to install emacs22 too - it's the current stable... I wonder which function will delete the client in emacs-22. Does anyone here know? I will take a look in emacs 22 and be back. Sebastian John Rakestraw writes: > Hi -- > > I'm a simple guy, not a coder, and only a little emacs-savvy. However, > this post might save some people some frustration. (And it might prompt > someone more emacs-savvy than I to teach me something.) > > I faced a challenge getting org-protocol to work. > > I'm running the latest org-mode from git on a Fedora 10 box. Emacs > version 22.3.1. I set up for org-protocol in emacs and in firefox > (following the instructions at > http://orgmode.org/worg/org-contrib/org-protocol.php). Then when I > tried to execute the org-protocol-remember handler, emacs pitched back > this error message: > > *** > error in process filter: symbol's function definition is void: > server-delete-client > *** > > I looked in server.el, and didn't find server-delete-client defined > there. I found a copy of server.el for emacs 23 online at > http://zchan.homeunix.net/pub/Nevada.APP/Build/emacs-23.0.60/lisp/server.el/server. > It includes this definition of server-delete-client: > > *** > (defun server-delete-client (proc &optional noframe) > "Delete CLIENT, including its buffers, terminals and frames. > If NOFRAME is non-nil, let the frames live. (To be used from > `delete-frame-functions'.)" > (server-log (concat "server-delete-client" (if noframe " noframe")) > proc) > ;; Force a new lookup of client (prevents infinite recursion). > (when (memq proc server-clients) > (let ((buffers (process-get proc 'buffers))) > > ;; Kill the client's buffers. > (dolist (buf buffers) > (when (buffer-live-p buf) > (with-current-buffer buf > ;; Kill the buffer if necessary. > (when (and (equal server-buffer-clients > (list proc)) > (or (and server-kill-new-buffers > (not server-existing-buffer)) > (server-temp-file-p)) > (not (buffer-modified-p))) > (let (flag) > (unwind-protect > (progn (setq server-buffer-clients nil) > (kill-buffer (current-buffer)) > (setq flag t)) > (unless flag > ;; Restore clients if user pressed C-g in > `kill-buffer'. (setq server-buffer-clients (list proc))))))))) > > ;; Delete the client's frames. > (unless noframe > (dolist (frame (frame-list)) > (when (and (frame-live-p frame) > (equal proc (frame-parameter frame 'client))) > ;; Prevent `server-handle-delete-frame' from calling us > ;; recursively. > (set-frame-parameter frame 'client nil) > (delete-frame frame)))) > > (setq server-clients (delq proc server-clients)) > > ;; Delete the client's tty. > (let ((terminal (process-get proc 'terminal))) > ;; Only delete the terminal if it is non-nil. > (when (and terminal (eq (terminal-live-p terminal) t)) > (delete-terminal terminal))) > > ;; Delete the client's process. > (if (eq (process-status proc) 'open) > (delete-process proc)) > > (server-log "Deleted" proc)))) > *** > > When I add this definition to my config files and reload, then > org-protocol-remember works as expected. > > Surely there are still others using emacs 22.3? Is there another way > around this (short of upgrading to emacs 23 -- I might do that, but I'm > so swamped with other things right now and I know so little about > what I'm doing that I don't want to move on that yet)? -- Sebastian Rose, EMMA STIL - mediendesign, Niemeyerstr.6, 30449 Hannover Tel.: +49 (0)511 - 36 58 472 Fax: +49 (0)1805 - 233633 - 11044 mobil: +49 (0)173 - 83 93 417 Email: s.rose@emma-stil.de, sebastian_rose@gmx.de Http: www.emma-stil.de