emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

problems with emacsclient started by cygwin programs (mswindows)


From: layer
Subject: problems with emacsclient started by cygwin programs (mswindows)
Date: Fri, 24 Jun 2011 13:14:53 -0700

I have a general problem with emacsclient on mswindows, when the
program calling emacsclient is a cygwin program (e.g., git).  The
cygwin program passes command line arguments to emacsclient using
cygwin path conventions (e.g., /home/layer/...) and emacs doesn't know
what to do with them.

So, I propose and will implement the agreed upon changes to server.el
which add a hook that people can define that will take care of this
situation.

I'm mailing the list because I want to declare I'm interested in
solving this problem and give people a chance to comment.

I think the changes are pretty straightforward.  The section of the
code in question (from emacs 23.2) is:

(defun* server-process-filter (proc string)
  ...
                 ;; -file FILENAME:  Load the given file.
                 ((and (equal "-file" arg)
                       command-line-args-left)
                  (let ((file (pop command-line-args-left)))
                    (if coding-system
                        (setq file (decode-coding-string file coding-system)))
                    (setq file (expand-file-name file dir))
                    (push (cons file filepos) files)
                    (server-log (format "New file: %s %s"
                                        file (or filepos "")) proc))
                  (setq filepos nil))

The place for the hook, IMO, is just before the expand-file-name.

I've read 
  http://www.gnu.org/software/emacs/elisp/html_node/Hooks.html
and regarding the name for the hook... I can't think of a really good
name, but something like

  server-filename-frob-function

is all that comes to mind.  `frob' does appear a few other times in
23.2, and my use does appear to be in line with what's there.  I'm
certainly receptive to other names.  Being an "abnormal" hook function
(according to the definition at the URL above), I suffixed it with
-function, as suggested.  The hook will take a single argument, the
filename given to -file by emacsclient, and return the new filename to
use.

Comments?  Questions?

Thanks.

Kevin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]