all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* emacsclient under windows
@ 2012-06-20 13:53 Doug Lewan
  2012-06-20 14:00 ` Juanma Barranquero
  2012-06-21 15:57 ` Doug Lewan
  0 siblings, 2 replies; 8+ messages in thread
From: Doug Lewan @ 2012-06-20 13:53 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

[-- Attachment #1: Type: text/plain, Size: 488 bytes --]

I'd like to use emacsclient as an editor under windows. That is I'd like to have it be the default editor for an application that we use.

Of course, that application [sometimes] uses windows-style paths and those paths aren't handled well by either emacs or emacsclient. (It looks like both, I'm guessing.)

Is there a "correct" and "natural way" of getting emacs to recognize things like X:\your\name\here?

,Douglas
Douglas Lewan
Shubert Ticketing
(201) 489-8600 ext 224



[-- Attachment #2: Type: text/html, Size: 2541 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: emacsclient under windows
  2012-06-20 13:53 emacsclient under windows Doug Lewan
@ 2012-06-20 14:00 ` Juanma Barranquero
  2012-06-20 14:01   ` Juanma Barranquero
  2012-06-20 14:23   ` Doug Lewan
  2012-06-21 15:57 ` Doug Lewan
  1 sibling, 2 replies; 8+ messages in thread
From: Juanma Barranquero @ 2012-06-20 14:00 UTC (permalink / raw)
  To: Doug Lewan; +Cc: help-gnu-emacs@gnu.org

On Wed, Jun 20, 2012 at 3:53 PM, Doug Lewan <dougl@shubertticketing.com> wrote:

> Of course, that application [sometimes] uses windows-style paths and those
> paths aren't handled well by either emacs or emacsclient. (It looks like
> both, I'm guessing.)

What version of Emacs are you using, and which problem are you seeing
with windows-style paths?

    Juanma



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: emacsclient under windows
  2012-06-20 14:00 ` Juanma Barranquero
@ 2012-06-20 14:01   ` Juanma Barranquero
  2012-06-20 14:23   ` Doug Lewan
  1 sibling, 0 replies; 8+ messages in thread
From: Juanma Barranquero @ 2012-06-20 14:01 UTC (permalink / raw)
  To: Doug Lewan; +Cc: help-gnu-emacs@gnu.org

> What version of Emacs are you using, and which problem are you seeing
> with windows-style paths?

[Or perhaps "which version" and "what problem". Damn impersonal
interrogative pronouns.]

    Juanma



^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: emacsclient under windows
  2012-06-20 14:00 ` Juanma Barranquero
  2012-06-20 14:01   ` Juanma Barranquero
@ 2012-06-20 14:23   ` Doug Lewan
  2012-06-20 14:29     ` Juanma Barranquero
                       ` (2 more replies)
  1 sibling, 3 replies; 8+ messages in thread
From: Doug Lewan @ 2012-06-20 14:23 UTC (permalink / raw)
  To: Juanma Barranquero, help-gnu-emacs@gnu.org

Juanma,

Thanks for catching my transgression.

emacs-version: 23.4
OS: CYGWIN on Windows 7

The symptom:

If I run  emacsclient X:\your\name\here  in one place, then emacs sees that as a simple filename, so it tries to find, e.g. /home/dougl/src/X:\your\name\here (if the client was run in C:\cygwin\home\dougl\src).

> -----Original Message-----
> From: Juanma Barranquero [mailto:lekktu@gmail.com]
> Sent: Wednesday, 2012 June 20 10:01
> To: Doug Lewan
> Cc: help-gnu-emacs@gnu.org
> Subject: Re: emacsclient under windows
> 
> On Wed, Jun 20, 2012 at 3:53 PM, Doug Lewan
> <dougl@shubertticketing.com> wrote:
> 
> > Of course, that application [sometimes] uses windows-style paths and
> those
> > paths aren't handled well by either emacs or emacsclient. (It looks
> like
> > both, I'm guessing.)
> 
> What version of Emacs are you using, and which problem are you seeing
> with windows-style paths?
> 
>     Juanma

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: emacsclient under windows
  2012-06-20 14:23   ` Doug Lewan
@ 2012-06-20 14:29     ` Juanma Barranquero
  2012-06-20 16:41     ` Eli Zaretskii
  2012-06-21 19:42     ` Ken Goldman
  2 siblings, 0 replies; 8+ messages in thread
From: Juanma Barranquero @ 2012-06-20 14:29 UTC (permalink / raw)
  To: Doug Lewan; +Cc: help-gnu-emacs@gnu.org

On Wed, Jun 20, 2012 at 4:23 PM, Doug Lewan <dougl@shubertticketing.com> wrote:

> Thanks for catching my transgression.

Transgression?

> emacs-version: 23.4
> OS: CYGWIN on Windows 7

I confess I know next to nothing about the Cygwin port, but, are you
mixing Cygwin with a non-Cygwin Emacs build, perhaps?

    Juanma



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: emacsclient under windows
  2012-06-20 14:23   ` Doug Lewan
  2012-06-20 14:29     ` Juanma Barranquero
@ 2012-06-20 16:41     ` Eli Zaretskii
  2012-06-21 19:42     ` Ken Goldman
  2 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2012-06-20 16:41 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Doug Lewan <dougl@shubertticketing.com>
> Date: Wed, 20 Jun 2012 14:23:08 +0000
> 
> emacs-version: 23.4
> OS: CYGWIN on Windows 7
> 
> The symptom:
> 
> If I run  emacsclient X:\your\name\here  in one place, then emacs sees that as a simple filename, so it tries to find, e.g. /home/dougl/src/X:\your\name\here (if the client was run in C:\cygwin\home\dougl\src).

That's because you are using a Cygwin build of Emacs, which doesn't
recognize native Windows file names without help.

Use the native Windows build of Emacs, and your problems will be gone.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: emacsclient under windows
  2012-06-20 13:53 emacsclient under windows Doug Lewan
  2012-06-20 14:00 ` Juanma Barranquero
@ 2012-06-21 15:57 ` Doug Lewan
  1 sibling, 0 replies; 8+ messages in thread
From: Doug Lewan @ 2012-06-21 15:57 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

[-- Attachment #1: Type: text/plain, Size: 2240 bytes --]

Well, I never found a "natural" way to handle DOS pathnames, but the following seems to do what I want.

(defun dos-find-file-hook ()
  "Handle DOS path names by converting them to CYGWIN paths."
  (let ((fname "dos-find-file-hook")
     (dos-path-re ".+/\\(?1:.\\):\\(?2:.+$\\)")
     (dos-drive)
     (dos-path)
     (cygwin-path)
     (filename (buffer-file-name))
     (dos-to-cygwin-path (lambda (p)
                      (let ((ret p))
                     (while (string-match (regexp-quote "\\") ret)
                       (setq ret (concat (substring ret 0 (match-beginning 0)) "/" (substring ret (match-end 0)))))
                     ret))))
    (cond ((string-match dos-path-re filename)
        (setq dos-drive (substring filename (match-beginning 1) (match-end 1)))
        (setq dos-path  (substring filename (match-beginning 2) (match-end 2)))
        (setq cygwin-path (concat "/cygdrive/"
                          dos-drive
                          ;; Ensure a '/' here.
                          (unless (string-match (concat "^" (regexp-quote "\\")) dos-path) "/")
                          (funcall dos-to-cygwin-path dos-path)))
        (find-file cygwin-path)
        ;; emacs under CYGWIN is smart enough to know that this is the same file,
        ;; so we don't have to clean up.
        ;; I.e. No need to kill a buffer named after a DOS file.
        )
       (t t))))

(add-hook 'find-file-hooks 'dos-find-file-hook)

,Doug


From: help-gnu-emacs-bounces+dougl=shubertticketing.com@gnu.org [mailto:help-gnu-emacs-bounces+dougl=shubertticketing.com@gnu.org] On Behalf Of Doug Lewan
Sent: Wednesday, 2012 June 20 09:54
To: help-gnu-emacs@gnu.org
Subject: emacsclient under windows

I'd like to use emacsclient as an editor under windows. That is I'd like to have it be the default editor for an application that we use.

Of course, that application [sometimes] uses windows-style paths and those paths aren't handled well by either emacs or emacsclient. (It looks like both, I'm guessing.)

Is there a "correct" and "natural way" of getting emacs to recognize things like X:\your\name\here?

,Douglas
Douglas Lewan
Shubert Ticketing
(201) 489-8600 ext 224



[-- Attachment #2: Type: text/html, Size: 9354 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: emacsclient under windows
  2012-06-20 14:23   ` Doug Lewan
  2012-06-20 14:29     ` Juanma Barranquero
  2012-06-20 16:41     ` Eli Zaretskii
@ 2012-06-21 19:42     ` Ken Goldman
  2 siblings, 0 replies; 8+ messages in thread
From: Ken Goldman @ 2012-06-21 19:42 UTC (permalink / raw)
  To: help-gnu-emacs

I stay away from cygwin.  I use gnuserv/gnuclient and it works well
under windows.  I set many file associations to gnuclientw, and double
click works.  Drag and drop from the desktop or Windows Explorer also 
works.  Tilde works.  Etc.

On 6/20/2012 10:23 AM, Doug Lewan wrote:
> Juanma,
>
> Thanks for catching my transgression.
>
> emacs-version: 23.4 OS: CYGWIN on Windows 7
>
> The symptom:
>
> If I run  emacsclient X:\your\name\here  in one place, then emacs
> sees that as a simple filename, so it tries to find, e.g.
> /home/dougl/src/X:\your\name\here (if the client was run in
> C:\cygwin\home\dougl\src).






^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-06-21 19:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-20 13:53 emacsclient under windows Doug Lewan
2012-06-20 14:00 ` Juanma Barranquero
2012-06-20 14:01   ` Juanma Barranquero
2012-06-20 14:23   ` Doug Lewan
2012-06-20 14:29     ` Juanma Barranquero
2012-06-20 16:41     ` Eli Zaretskii
2012-06-21 19:42     ` Ken Goldman
2012-06-21 15:57 ` Doug Lewan

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.