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)
[EMAIL PROTECTED]
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/

Reply via email to