emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Rakestraw <lists@johnrakestraw.com>
To: emacs-orgmode@gnu.org
Subject: org-protocol and missing server-delete-client function
Date: Thu, 16 Apr 2009 16:29:20 -0400	[thread overview]
Message-ID: <20090416162920.093e8cb3@johnrakestraw.com> (raw)

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)?

-- 
John Rakestraw

             reply	other threads:[~2009-04-16 20:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-16 20:29 John Rakestraw [this message]
2009-04-16 21:09 ` org-protocol and missing server-delete-client function Sebastian Rose
2009-04-16 23:22 ` Sebastian Rose
2009-04-17  0:36   ` Sebastian Rose

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090416162920.093e8cb3@johnrakestraw.com \
    --to=lists@johnrakestraw.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).