X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_NEUTRAL X-Spam-Check-By: sourceware.org Message-ID: <4ED69D75.1040707@cornell.edu> Date: Wed, 30 Nov 2011 16:17:41 -0500 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Emacs in Cygwin: (file-exists-p "c:/")? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On 11/30/2011 4:08 PM, Tim McDaniel wrote: > I dunno whether anyone here know about Emacs, but I thought I would > ask. > > In a previous setup (Windows XP, 32-bit), I believe that running the > Emacs function > (file-exists-p "c:/") > produced t. > > Now, with the latest Cygwin, Windows 7, 64-bit, emacs-version > "23.3.1", > (file-exists-p "c:/") > nil > (file-exists-p "c:\\") > nil > I notice it because it broke some code, my .emacs startup file to be > precise. It was a quick and easy way to check whether it was running > under Windows. > > I have a workaround, > (file-exists-p "/mnt/c") > but that only "works" because I "know" that I have changed the drive > prefix from /cygdrive to /mnt. > > Can it be made to work again? Any suggestions on how to tell in Emacs > whether I'm running under Windows? I'm not sure what you mean by "running under Windows", but I think the variable `system-type' should do whatever you need. For example, I do system-specific customization by putting the following in my .emacs file: (cond ((eq system-type 'cygwin) (load "cygwin-init")) ((eq system-type 'windows-nt) (load "nt-init")) ((eq system-type 'gnu/linux) (load "linux-init"))) Ken -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple