From: layer <layer@known.net>
To: emacs-devel@gnu.org
Subject: problems with emacsclient started by cygwin programs (mswindows)
Date: Fri, 24 Jun 2011 13:14:53 -0700 [thread overview]
Message-ID: <5530.1308946493@relay.known.net> (raw)
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
next reply other threads:[~2011-06-24 20:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-24 20:14 layer [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-06-27 20:43 problems with emacsclient started by cygwin programs (mswindows) layer
2011-06-30 16:17 ` Stefan Monnier
2011-07-01 15:00 ` layer
2011-07-01 17:21 ` Stefan Monnier
2011-07-01 18:26 ` layer
2011-07-04 15:15 ` Stefan Monnier
2011-07-04 23:46 ` layer
2011-07-05 16:11 ` Stefan Monnier
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5530.1308946493@relay.known.net \
--to=layer@known.net \
--cc=emacs-devel@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.