--- a/.emacs-my Thu Sep 29 15:54:05 2011 +0300
+++ b/.emacs-my Fri Sep 30 18:24:32 2011 +0300
@@ -255,11 +255,25 @@
"If t 'cmdproxy.exe' will be used as shell. Affect on M-x shell like
commands. If nil, 'sh' will be used." )
+(defun follow-cygwin-symlink ()
+ "Follow new-style (and also UCS-16) Cygwin symlinks."
+ (save-excursion
+ (goto-char 0)
+ (when (looking-at "!<symlink>\xff\xfe")
+ (find-alternate-file
+ (substring
+ (decode-coding-string
+ (buffer-substring (match-end 0) (point-max))
+ 'utf-16-le)
+ 0 -1) ; -1 for stripping final \0.
+ ))))
+
(when (eq system-type 'windows-nt)
(ignore-errors
(require 'cygwin-mount)
(cygwin-mount-activate)
)
+ (add-hook 'find-file-hooks 'follow-cygwin-symlink)
;; Workaround for Cygwin shell, when set 'CYGWIN=noglob'. By default 'shell-quote-argument'
;; quoted by double '\' chars this cause failure.
(defun shell-quote-argument (argument)