help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: emacsclient and gnuclient on msw2000


From: B. T. Raven
Subject: Re: emacsclient and gnuclient on msw2000
Date: Sun, 13 Jan 2008 16:16:25 -0600
User-agent: Thunderbird 2.0.0.9 (Windows/20071031)

Lennart Borgman (gmail) wrote:
B. T. Raven wrote:
I want to associate certain file extensions with Emacs so that a new instance of Emacs is not opened when a file is clicked on. Is it possible to do this in a w32 environment? Recently I saw this in the ng but I don't understand it:

"
REM $Id: emacsassoc.bat,v 1.1 2003/01/10 08:21:27 reichr Exp $
REM You should adjust the path to gnuclientw.exe
REM %%1 is needed for 4nt, %1 can be used for cmd.exe

ftype emacs-file=c:\emacs\bin\gnuclientw.exe -q -F "%%1"
assoc .vhdl=emacs-file
assoc .vhd=emacs-file
assoc .v=emacs-file
assoc .c=emacs-file
assoc .txt=emacs-file
assoc .el=emacs-file
assoc .tex=emacs-file
"

I have changed the path to match my local one but I see that in the bin directory I have emacsclientw and not gnuclient.

I have deleted the .txt association (with Notepad) from the w2000 extensions and I wanted to do something like in the above example to have any .txt file opened in a buffer in an already open emacs instance.
Is that possible?

My version is 22.1

Hi Ed,

There are some brief instructions here

  http://www.emacswiki.org/cgi-bin/wiki/WThirtyTwoFileAssociations

Notice that with Emacs 22 you can use emacsclientw.exe instead of gnuclientw.exe.




Thanks, Lennart. I couldn't figure out how to do the following and I was nervous about diddling with the registry anyway:

1. Add the registry key as described above, i.e.

[HKEY_CLASSES_ROOT\*\shell\openwemacs\command] ;;; I don't understand this

2. Set the value of command to the following, adjusting the path as necessary:

  C:\emacs-22\emacs\bin\emacsclientw.exe -n "%1"

The fact that this might not work if emacs weren't running wouldn't be a problem since emacs is the first thing I start anyway after booting.

What I did in a cmd shell was:

ftype emacs=c:\emacs\bin\emacsclientw.exe -n "%1"

and then

assoc .txt=emacs

and now from regedit I see:

hkey_classes_root > .txt
emacs

but below .txt > shell > open > command

there is still notepad.exe

If for now I am satisfied with having only .txt files automatically opened with emacsclient, what other registry surgery do I have to do? My assigning a value to directly to .txt seems to be short circuiting the notepad command.

Anyway it works as long as I do M-x server-start (or put (server-start) in .emacs

Thanks again,

Ed



reply via email to

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