From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "B. T. Raven" Newsgroups: gmane.emacs.help Subject: Re: emacsclient and gnuclient on msw2000 Date: Sun, 13 Jan 2008 16:16:25 -0600 Message-ID: References: <7sidnVBknf9_wxfanZ2dnUVZ_gmdnZ2d@sysmatrix.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1200264039 23818 80.91.229.12 (13 Jan 2008 22:40:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 13 Jan 2008 22:40:39 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 13 23:40:59 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JEBVg-00032e-JZ for geh-help-gnu-emacs@m.gmane.org; Sun, 13 Jan 2008 23:40:56 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JEBVI-00060k-Es for geh-help-gnu-emacs@m.gmane.org; Sun, 13 Jan 2008 17:40:32 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.sysmatrix.net!news.sysmatrix.net.POSTED!not-for-mail Original-NNTP-Posting-Date: Sun, 13 Jan 2008 16:13:55 -0600 User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) Original-Newsgroups: gnu.emacs.help In-Reply-To: Original-Lines: 89 X-Usenet-Provider: http://www.giganews.com Original-NNTP-Posting-Host: 65.45.140.31 Original-X-Trace: sv3-rkhZmqaPKuf54HB0XKuyfoUzzHNNeud4xOASpyzxfwMS1bIWHIW66kySk9BuaA3UeiEJcvdJxfGP1NZ!HXPOB6UV48UeB1UFeXrKMoNxsvDWNarI8HcrDEO/lN1gfBeaGyZdLoyUon2kviDY8kL7dE56CkeV!3LpDRM4+sXlfKpNbiFWsBkokbmffcw== Original-X-Complaints-To: abuse@sysmatrix.net X-DMCA-Complaints-To: abuse@sysmatrix.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.37 Original-Xref: shelby.stanford.edu gnu.emacs.help:155290 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:50701 Archived-At: 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