delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/03/21/11:24:20

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: "Markus Hoenicka" <Markus DOT Hoenicka AT uth DOT tmc DOT edu>
MIME-Version: 1.0
Message-ID: <15514.2765.724000.689613@gargle.gargle.HOWL>
Date: Thu, 21 Mar 2002 16:31:09 +0000
To: cygwin AT cygwin DOT com
Subject: new FAQ entry for GNU Emacs
In-Reply-To: <1215-Thu21Mar2002001827+0000-starksb@ebi.ac.uk>
References: <1215-Thu21Mar2002001827+0000-starksb AT ebi DOT ac DOT uk>
X-Mailer: VM 7.03 under Emacs 20.6.1

Hi,

While you're at it, you might consider mentioning the following Emacs
Lisp hack in the FAQ. This allows GNU Emacs to follow Cygwin
symlinks. This hack is based on a version covering only the !<symlink>
style symlinks that was posted by someone else to the list years ago,
but I think I never posted this extended version which also covers the
.lnk style symlinks. While it appears to work for me, I'd appreciate
some testing by other GNU Emacs/Cygwin users.

;; follow cygwin symlinks. Handles old-style (text file) symlinks and new-style
;; (.lnk file) symlinks
(defun follow-cygwin-symlink ()
  (save-excursion
    (goto-char 0)
    (if (looking-at "L\x000\x000\x000\x001\x014\x002\x000\x000\x000\x000\x000\x0C0\x000\x000\x000\x000\x000\x000\x046\x00C")
        (progn
          (re-search-forward "\x000\\([-A-Za-z0-9_\\.\\\\\\$%@(){}~!#^'`][-A-Za-z0-9_\\.\\\\\\$%@(){}~!#^'`]+\\)")
          (find-alternate-file (match-string 1)))
      (if (looking-at "!<symlink>")
      (progn
        (re-search-forward "!<symlink>\\(.*\\)\0")
        (find-alternate-file (match-string 1))))
      )))
(add-hook 'find-file-hooks 'follow-cygwin-symlink)
   



regards,
Markus

David Starks-Browning writes:
 > There is a new FAQ entry about GNU Emacs and Cygwin, addressing the
 > common questions.  In addition, it tells you where to find
 > cygwin-mount.el, by Klaus Berndl.  This bit of elisp makes Emacs aware
 > of your Cygwin mount table.

-- 
Markus Hoenicka, PhD
UT Houston Medical School
Dept. of Integrative Biology and Pharmacology
6431 Fannin MSB4.114
Houston, TX 77030
(713) 500-6313, -7477
(713) 500-7444 (fax)
Markus DOT Hoenicka AT uth DOT tmc DOT edu
http://ourworld.compuserve.com/homepages/hoenicka_markus/


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019