changelog shortlog tags changeset files revisions annotate raw

cygwin-mount.el

changeset 66: 5b737eefe5ea
author: kim.vanwyk
date: Wed Nov 10 15:19:03 2010 +0200 (18 months ago)
permissions: -rw-r--r--
description: Adding CSharp Mode and Google Weather
1;;; cygwin-mount.el --- Teach EMACS about cygwin styles and mount points.
2
3;; Copyright (C) 1997 Michael Cook <mcook@ieee.org>.
4;; 2001 Klaus Berndl <berndl@sdm.de>
5
6;; Author: Michael Cook <mcook@ieee.org>
7;; Keywords: files, mount, cygwin
8
9;; This file is *NOT* (yet?) part of GNU Emacs.
10;;
11;; This program is free software; you can redistribute it and/or modify
12;; it under the terms of the GNU General Public License as published by
13;; the Free Software Foundation; either version 2, or (at your option)
14;; any later version.
15;;
16;; This program is distributed in the hope that it will be useful,
17;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;; GNU General Public License for more details.
20;;
21;; You should have received a copy of the GNU General Public License
22;; along with GNU Emacs; see the file COPYING. If not, write to the
23;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24;; Boston, MA 02111-1307, USA.
25
26;; Additional info:
27;; $Date: 2004-01-14 07:35:04 -0800 (Wed, 14 Jan 2004) $
28;; Maintenance: Eric Hanchrow <offby1@blarg.net>
29;; Additional code by: Stephane Rollandin <hepta@zogotounga.net>
30;; Michael Mauger <mmaug@yahoo.com>
31;; Keisuke Mori <ksk@ntts.com>
32;; Drew Moseley (drewmoseley@mindspring.com)
33;; James Ganong (jeg@bigseal.ucsc.edu)
34;; Jeff Juliano <juliano@cs.unc.edu>
35;; Klaus Berndl <berndl@sdm.de>
36;; Nick Sieger <nsieger@bitstream.net>
37;; Richard Y. Kim <ryk@dspwiz.com>
38;; Karel Sprenger <karel.sprenger@compaq.com>
39;;
40;; When submitting patches, please try to also submit an automated
41;; test that demonstrates the need for the patch -- i.e., one that
42;; fails with the unpatched code, but passes with the patched code.
43;; This will make is easier for the maintainer to decide if your patch
44;; duplicates functionality from other patches. Patching `tests.el'
45;; would be good.
46;;; Availabilty
47
48;; The latest version of cygwin-mount.el can always be found at
49;; http://www.blarg.net/~offby1/cygwin-mount/
50
51;; ----------------------------------------------------------------------
52;;; Commentary
53
54;; This package lets you use cygwin-style filenames like
55;; "//D/any/path/to/file" or "/cygdrive/D/any/path/to/file" in exactly
56;; the same manner as the normal Windows-style filenames like
57;; "D:\any\path\to\file" or "D:/any/path/to/file". NOTE: "/cygdrive/"
58;; is only an example for the cygdrive-prefix \(see
59;; `cygwin-mount-cygdrive-prefix--internal'). cygwin-mount can handle
60;; every cygdrive-prefix set by "mount --change-cygdrive-prefix"
61;; (e.g. "/" is also a valid cygdrive-prefix). UNC paths work
62;; too. Furthermore, this package lets you use all your cygwin mounts
63;; in file operations. For example, you can use (e.g. find-file) for
64;; a file named "/usr/bin/anyfile" if you have mounted the related
65;; Windows-path to /usr/bin. Ange-ftp also works correctly.
66
67;;; Installation:
68
69;; Put in your .emacs or site-start.el file the following lines:
70;; (require 'cygwin-mount)
71;; (cygwin-mount-activate)
72
73;;; Customization and using
74
75;; + All customization is done in the customize-group `cygwin-mount'.
76;; Do not set the user-options via `setq' but only via customize because
77;; otherwise the package will not work correct!!
78;; Important: Now the cygwin mountpoints are stored in the variable
79;; `cygwin-mount-table--internal'. This variable must not be set by the user
80;; but it is only set by customizing `cygwin-mount-table'!
81;; + Activating: cygwin-mount-activate
82;; + Deactivating: cygwin-mount-deactivate
83
84;;; Compatibility
85
86;; The cygwin-mount.el package is only tested with NTEmacs >= 20.6.1.
87;; It has also been tested with the native port of XEmacs 21.1 but not
88;; very intensive! The package has been tested with Cygwin 1.1.8 and
89;; >= 1.3.1. It reportedly also works with at least some versions of
90;; MinGW.
91
92;; How it works:
93;; basically we push some functions onto file-name-handler-alist.
94;; They detect filenames expressed in cygwin style, and translate
95;; those names into native Win32 style.
96
97;;; Code:
98
99(defconst cygwin-mount-version "1.4.8")
100
101(defgroup cygwin-mount nil
102 "Proper handling of cygwin mounts and filenames."
103 :prefix "cygwin-"
104 :group 'files)
105
106;; some constants
107
108(defconst cygwin-mount-program "mount.exe")
109(defconst cygwin-mount-uname-program "uname.exe")
110(defconst cygwin-mount-buffername " *mount*")
111
112;; internal variables. These variables are only set by calling
113;; `cygwin-mount-activate' or by customizing `cygwin-mount-table'.
114
115(defvar cygwin-mount-table--internal nil
116 "Do not set this variable directly but customize `cygwin-mount-table'!")
117
118(defvar cygwin-mount-cygdrive-prefix--internal ""
119 "Prefix for the \"/cygdrive/X/\" style of cygwin.
120A cygwin-user can change the \"/cygdrive\" to whatever he wants to access
121files at MS-DOS drives. For example many people seem to like to have the
122drives accessible as a directory so that c: == /c, which means the
123cygdrive-prefix is \"/\" instead of \"/cygdrive\". This prefix must end
124with a '/'! Do not set this variable because the value of this variable is
125determined at activation-time of cygwin-mount \(see
126`cygwin-mount-activate')")
127
128;; user options
129
130(defcustom cygwin-mount-cygwin-bin-directory nil
131 "*The directory where the cygwin binaries reside.
132If nil then the cygwin-binary-directory must be into the PATH."
133 :group 'cygwin-mount
134 :type '(radio (const :tag "Cygwin is into PATH" :value nil)
135 (directory :tag "Cygwin-Binary-Dir" :value "")))
136
137(defcustom cygwin-mount-build-mount-table-asynch nil
138 "*When non-nil, `cygwin-mount-table' is built at load-time.
139If you change the value via customize you must deactivate and activate the
140package again to take effect."
141 :group 'cygwin-mount
142 :type 'boolean)
143
144(defcustom cygwin-mount-table t
145 "*Alist of custom cygwin mount points or t.
146If t if all the current mount-points returned by the cygwin mount-program
147should be used. If set to nil then there are no mount-points. An element of
148the alist has the form \(<mounted windows-device> . <cygwin-directory>),
149e.g. \(\"D:\\\\programs\\\\cygwin\\\\bin\" . \"/usr/bin/\") or
150\(\"D:/programs/cygwin\" . \"/\")."
151 :group 'cygwin-mount
152 :set (function (lambda (symbol value)
153 (set symbol value)
154 (if (equal value t)
155 (cygwin-mount-build-table-internal)
156 (setq cygwin-mount-table--internal value))))
157 :initialize 'custom-initialize-default
158 :type '(radio (const :tag "Automatic"
159 :value t)
160 (repeat :tag "Custom mounts"
161 (cons (directory :tag "Mounted device")
162 (string :tag "Cygwin directory")))))
163
164;; copied from executable.el because this library is not included in all
165;; Emacsen by default.
166(defvar cygwin-mount-executable-binary-suffixes
167 (if (memq system-type '(ms-dos windows-nt))
168 '(".exe" ".com" ".bat" ".cmd" ".btm" "")
169 '("")))
170(defun cygwin-mount-executable-find (command)
171 "Search for COMMAND in `exec-path' and return the absolute file name.
172Return nil if COMMAND is not found anywhere in `exec-path'."
173 (let ((list exec-path)
174 file)
175 (while list
176 (setq list
177 (if (and (setq file (expand-file-name command (car list)))
178 (let ((suffixes cygwin-mount-executable-binary-suffixes)
179 candidate)
180 (while suffixes
181 (setq candidate (concat file (car suffixes)))
182 (if (and (file-executable-p candidate)
183 (not (file-directory-p candidate)))
184 (setq suffixes nil)
185 (setq suffixes (cdr suffixes))
186 (setq candidate nil)))
187 (setq file candidate)))
188 nil
189 (setq file nil)
190 (cdr list))))
191 file))
192
193;; functions
194
195(defun cygwin-mount-get-full-progname (program)
196 "Return the full path of PROGRAM if possible or nil."
197 (let ((fullname
198 (if (and cygwin-mount-cygwin-bin-directory
199 (stringp cygwin-mount-cygwin-bin-directory)
200 (file-directory-p cygwin-mount-cygwin-bin-directory))
201 (concat (file-name-as-directory cygwin-mount-cygwin-bin-directory)
202 program)
203 (expand-file-name (or (cygwin-mount-executable-find program)
204 program)))))
205 (if (file-executable-p fullname)
206 fullname
207 nil)))
208
209(defun cygwin-mount-get-cygdrive-prefix ()
210 "Return prefix used for the \"/cygdrive/X/\" style of cygwin.
211This is done by calling \"mount --show-cygdrive-prefixes\".
212The result is either \"/\" or \"/<string>/\"."
213 (let ((buf (get-buffer-create " *cygdrive*"))
214 (fullname (cygwin-mount-get-full-progname cygwin-mount-program)))
215 (if (null fullname)
216 (error "Cannot find the program '%s', please check 'cygwin-mount-cygwin-bin-directory'!" cygwin-mount-program)
217 (save-excursion
218 (set-buffer buf)
219
220 (or
221 (progn
222 (erase-buffer)
223 (zerop (call-process fullname nil buf nil "--show-cygdrive-prefix")))
224 (progn
225 (erase-buffer)
226 (zerop (call-process fullname nil buf nil "--show-cygdrive-prefixes")))
227 (error "Cannot run %s" fullname))
228 (goto-char (point-min))
229 (prog1
230 (let ((regexp-prefix "\\(/[^ \t]*\\)[ \t]+")
231 cygdrive-prefix)
232 ;; we search first for the user prefix and if there isn't any we
233 ;; search for the system prefix.
234 (if (or (search-forward-regexp (concat regexp-prefix "user") nil t)
235 (search-forward-regexp (concat regexp-prefix "system") nil t))
236 (progn
237 (setq cygdrive-prefix (match-string 1))
238 (if (string= cygdrive-prefix "/")
239 cygdrive-prefix
240 (concat cygdrive-prefix "/")))
241 "/cygdrive/"))
242 (kill-buffer buf))))))
243
244(defun trim-trailing-whitespace (str)
245 (string-match "^\\(.*\\S-\\)\\s-*$" str )
246 (replace-match "\\1" nil nil str))
247
248(defun cygwin-mount-parse-one-line (line)
249 "Parse the output from one line of the Cygwin `mount' command;
250 return a pair containing the windows directory and the corresponding
251 Cygwin path."
252
253 ;; can't use non-greedy regular expressions because versions of
254 ;; Emacs older than 21.1 lack them.
255 (if (or (string-match "\\(.*\\) on \\(/.*\\) type .* (.*)" line)
256 (string-match "\\(.*\\)\\s-+\\(/.*\\)\\s-+\\(user\\|system\\)\\s-+\\(textmode\\|binmode\\)" line))
257
258 (let ((win (match-string 1 line))
259 (cyg (match-string 2 line)))
260 (setq win (trim-trailing-whitespace win))
261 (setq cyg (trim-trailing-whitespace cyg))
262 (cons win cyg))
263 (error "Cannot parse output from `mount': %s" line)))
264
265(defun cygwin-mount-parse-mount ()
266 "Parse buffer `cygwin-mount-buffername' and return alist of
267mount-points, sorted with longest \"device\" names first. For the
268format of this alist see `cygwin-mount-table'. Precondition of this
269function is current buffer must be the buffer named
270`cygwin-mount-buffername'."
271 (if (equal (current-buffer) (get-buffer cygwin-mount-buffername))
272 (let ((case-fold-search t)
273 mounts)
274 (goto-char (point-min))
275 (while (not (eobp))
276 (let* ((parsed (cygwin-mount-parse-one-line
277 (buffer-substring
278 (progn (beginning-of-line) (point))
279 (progn (end-of-line) (point)))))
280 (device (car parsed))
281 (direct (cdr parsed)))
282 (setq mounts (cons (cons (file-name-as-directory device)
283 (file-name-as-directory direct))
284 mounts))
285 (forward-line 1)))
286
287 ;; now sort the alist so that the longest directories come first.
288 (setq mounts (sort mounts (function (lambda (pair1 pair2)
289 (> (length (cdr pair1))
290 (length (cdr pair2)))))) )
291 mounts)))
292
293(defun cygwin-mount-sentinel (proc msg)
294 "Process sentinel for PROC with MSG."
295 (if (or (eq (process-status proc) 'exit)
296 (eq (process-status proc) 'signal))
297 (let ((buf (get-buffer-create cygwin-mount-buffername)))
298 (save-excursion
299 (set-buffer buf)
300 (setq cygwin-mount-table--internal (cygwin-mount-parse-mount)))
301 (kill-buffer buf)
302 (message "Build of mount table completed"))))
303
304(defun cygwin-mount-build-table-internal ()
305 "Determine cygwin mount points.
306This function sets `cygwin-mount-table--internal'
307either synchronously or asynchronously \(see
308`cygwin-mount-build-mount-table-asynch'). If asynchronously then the set is
309really done by `cygwin-mount-sentinel'."
310 (let ((fullname (cygwin-mount-get-full-progname cygwin-mount-program)))
311 (if (null fullname)
312 (error "Cannot find the program '%s', please check 'cygwin-mount-cygwin-bin-directory'!" cygwin-mount-program)
313 (if cygwin-mount-build-mount-table-asynch
314 ;; asynchron building
315 (let ((proc (start-process "mount" cygwin-mount-buffername fullname)))
316 (set-process-sentinel proc 'cygwin-mount-sentinel)
317 (process-kill-without-query proc))
318 ;; synchron building
319 (let ((buf (get-buffer-create cygwin-mount-buffername)))
320 (save-excursion
321 (set-buffer buf)
322 (erase-buffer)
323 (call-process fullname nil buf)
324 (prog1
325 (setq cygwin-mount-table--internal (cygwin-mount-parse-mount))
326 (kill-buffer buf))))))))
327
328(defun cygwin-mount-name-hook-function (operation &rest args)
329 "Run OPERATION with ARGS."
330 (let ((fn (get operation 'cygwin-mount-name)))
331 (if fn (apply fn operation args)
332 (cygwin-mount-run-real-handler operation args))))
333
334(defun cygwin-mount-map-drive-hook-function (operation &rest args)
335 "Run OPERATION with ARGS."
336 (let ((fn (get operation 'cygwin-mount-map-drive)))
337 (if fn (apply fn operation args)
338 (cygwin-mount-run-real-handler operation args))))
339
340(defun cygwin-mount-run-real-handler (operation args)
341 "Run OPERATION with ARGS."
342 (let ((inhibit-file-name-handlers
343 (append '(cygwin-mount-name-hook-function
344 cygwin-mount-map-drive-hook-function)
345 (and (eq inhibit-file-name-operation operation)
346 inhibit-file-name-handlers)))
347 (inhibit-file-name-operation operation))
348 (apply operation args)))
349
350
351(defun cygwin-mount-name-expand (operation name &rest args)
352 "Run OPERATION NAME with ARGS.
353 first ARG is either nil or a file name"
354 (when (and args (car args))
355 (setq args (copy-sequence args)) ; TODO: determine if this call is really necessary
356 (setcar args (cygwin-mount-substitute-longest-mount-name (car args))))
357 (cygwin-mount-run-real-handler
358 operation
359 (cons (cygwin-mount-substitute-longest-mount-name name) args)))
360
361(defun cygwin-mount-substitute-longest-mount-name (name)
362 "Substitute NAME with mount device or return NAME."
363 (and name
364 (save-match-data
365 (if (or (string-match "^//.+" name) (string-match "/\\[.+\\]" name))
366 ;; Added by Klaus: if name beginns with "//" then it can never contain
367 ;; a cygwin mount point! Therefore we must not check for contained
368 ;; mount points because if / is mounted then this will always match
369 ;; and we get an incorrect substitution for network devices like
370 ;; //Host/path
371 name
372 (let ((mounts cygwin-mount-table--internal)
373 (len (length (file-name-as-directory name)))
374 match)
375 (while mounts
376 (let ((mount (file-name-as-directory (cdar mounts))))
377 (and (>= len (length mount))
378 (string= mount
379 (file-name-as-directory
380 (substring (file-name-as-directory name)
381 0 (length mount))))
382 (or (null match)
383 (> (length (cdar mounts)) (length (cdr match))))
384 (setq match (car mounts))))
385 (setq mounts (cdr mounts)))
386 (if match
387 (concat (file-name-as-directory (car match))
388 (if (>= (length (file-name-as-directory (cdr match))) len)
389 ""
390 (substring name (length (file-name-as-directory (cdr match))))))
391 name))))))
392
393;; Added by Klaus
394(defconst cygwin-mount-cygwin-style1-regexp "^/[^:@]*$\\|^/|/[^/:]+\\(\\'\\|/\\)")
395
396;; This appears to work with ancient versions of cygwin, on which the
397;; cygwin path `//x' was shorthand for the Win32 path `x:'.
398(defconst cygwin-mount-cygwin-style2-regexp "^//[A-Za-z]/")
399
400;; will be set by `cygwin-mount-activate'.
401(defvar cygwin-mount-cygwin-style3-regexp nil)
402
403;; We cannot assume that NAME matched cygwin-mount-cygwin-style1-regexp,
404;; cygwin-mount-cygwin-style2-regexp nor cygwin-mount-cygwin-style3-regexp,
405;; because this function could be called with either argument to
406;; `expand-file-name', but only one argument to `expand-file-name' may
407;; have matched a regexp.
408;; For example, `(expand-file-name ".." "/cygdrive/c/")' will trigger
409;; `(cygwin-mount-convert-file-name "..")' and
410;; `(cygwin-mount-convert-file-name "/cygdrive/c/")' to be called.
411(defun cygwin-mount-convert-file-name ( name )
412 "Convert file NAME, to cygwin format.
413`//x/' to `x:/' and `/cygdrive/x/' to `x:/'.
414NOTE: \"/cygdrive/\" is only an example for the cygdrive-prefix \(see
415`cygwin-mount-cygdrive-prefix--internal')."
416 (let ((cygdrive-prefix-len (length cygwin-mount-cygdrive-prefix--internal)))
417 (save-match-data
418 (cond ((string-match cygwin-mount-cygwin-style2-regexp name)
419 (concat (substring name 2 3) ":" (substring name 3)))
420 ((string-match cygwin-mount-cygwin-style3-regexp name)
421 (concat (substring name cygdrive-prefix-len
422 (1+ cygdrive-prefix-len))
423 ":" (substring name (1+ cygdrive-prefix-len) nil)))
424 (t name)))))
425
426(defun cygwin-mount-map-drive (operation name &rest args)
427 "Run OPERATION on cygwin NAME with ARGS.
428Map cygwin name to the dos-style \"[A-Za-z]:/\" and call
429OPERATION with the mapped filename\(s). NAME must have the format looks like
430\"^//[A-Za-z]/\" or \"/cygdrive/[A-Za-z]/\" here. Note that at least the first
431element of ARGS could be a filename too \(then it must have the same syntax
432like NAME!) which must be converted \(e.g. `expand-file-name' can be called
433with two filenames).
434NOTE: \"/cygdrive/\" is only an example for the cygdrive-prefix \(see
435`cygwin-mount-cygdrive-prefix--internal')."
436 (cygwin-mount-run-real-handler
437 operation
438 (cons (cygwin-mount-convert-file-name name)
439 (if (stringp (car args))
440 (cons (cygwin-mount-convert-file-name (car args))
441 (cdr args))
442 args))))
443
444;;; TODO -- see if we need to do stuff for Tramp that is similar to
445;;; what we're about to do for ange-ftp. If so, perhaps we can use
446;;; `advice' to clean up those forms below whose comments describe
447;;; them as "real hacks".
448
449;;; ange-ftp
450(if (locate-library "ange-ftp")
451 (require 'ange-ftp))
452
453;;; save the original function definition of ange-ftp-run-real-handler
454(defconst cygwin-mount-original-ange-ftp-handler
455 (if (featurep 'ange-ftp)
456 (symbol-function 'ange-ftp-run-real-handler)
457 nil))
458
459;;; This version of ange-ftp-run-real-handler also inhibits the
460;;; cygwin file name expansion when we are doing ange-ftp expansion.
461;;;
462;;; This is a real hack. If the real definition of this function
463;;; changes, we have to modify this function
464(defun cygwin-mount-ange-ftp-run-real-handler (operation args)
465 "Run OPERATION with ARGS."
466 (let ((inhibit-file-name-handlers
467 (append '(ange-ftp-hook-function
468 ange-ftp-completion-hook-function
469 cygwin-mount-name-hook-function
470 cygwin-mount-map-drive-hook-function)
471 (and (eq inhibit-file-name-operation
472 operation)
473 inhibit-file-name-handlers)))
474 (inhibit-file-name-operation operation))
475 (apply operation args)))
476
477;; Added by Klaus
478(defvar cygwin-mount-activated nil)
479(defun cygwin-mount-activate ()
480 "Activate cygwin-mount- and cygwin-style-handling."
481 (interactive)
482 (if (not (eq system-type 'windows-nt))
483 (message "cygwin-mount is only available for Emacs for NT!")
484
485 (unless cygwin-mount-activated
486 ;; initialize the internal variables
487
488 (if (equal cygwin-mount-table t)
489 (cygwin-mount-build-table-internal)
490 (setq cygwin-mount-table--internal cygwin-mount-table))
491 (setq cygwin-mount-cygdrive-prefix--internal
492 (cygwin-mount-get-cygdrive-prefix))
493 (setq cygwin-mount-cygwin-style3-regexp
494 (concat "^" cygwin-mount-cygdrive-prefix--internal "[A-Za-z]/"))
495
496 ;; add the cygwin-filehandlers
497 (or (assoc cygwin-mount-cygwin-style1-regexp file-name-handler-alist)
498 (setq file-name-handler-alist
499 (cons `(,cygwin-mount-cygwin-style1-regexp
500 . cygwin-mount-name-hook-function)
501 file-name-handler-alist)))
502
503 (or (assoc cygwin-mount-cygwin-style2-regexp file-name-handler-alist)
504 (setq file-name-handler-alist
505 (cons `(,cygwin-mount-cygwin-style2-regexp
506 . cygwin-mount-map-drive-hook-function)
507 file-name-handler-alist)))
508 (or (assoc cygwin-mount-cygwin-style3-regexp file-name-handler-alist)
509 (setq file-name-handler-alist
510 (cons `(,cygwin-mount-cygwin-style3-regexp
511 . cygwin-mount-map-drive-hook-function)
512 file-name-handler-alist)))
513
514 ;; add cygwin-properties
515 (put 'substitute-in-file-name 'cygwin-mount-name
516 'cygwin-mount-name-expand)
517 (put 'expand-file-name 'cygwin-mount-name 'cygwin-mount-name-expand)
518 (put 'substitute-in-file-name
519 'cygwin-mount-map-drive 'cygwin-mount-map-drive)
520 (put 'expand-file-name 'cygwin-mount-map-drive
521 'cygwin-mount-map-drive)
522 ;; rebind ange-ftp-run-real-handler to our version
523 (if (featurep 'ange-ftp)
524 (fset 'ange-ftp-run-real-handler 'cygwin-mount-ange-ftp-run-real-handler))
525
526 (setq cygwin-mount-activated t))))
527
528;; Added by Klaus
529(defun cygwin-mount-deactivate ()
530 "Deactivate cygwin-mount- and cygwin-style-handling."
531 (interactive)
532 (if (not (eq system-type 'windows-nt))
533 (message "cygwin-mount is only available for (X)Emacs for NT!")
534 (unless (not cygwin-mount-activated)
535 ;; reset the internal variables
536 (setq cygwin-mount-table--internal nil)
537
538 (setq cygwin-mount-cygdrive-prefix--internal "")
539
540 ;; remove the cygwin-filehandlers
541 (setq file-name-handler-alist
542 (delete (assoc cygwin-mount-cygwin-style1-regexp file-name-handler-alist)
543 file-name-handler-alist))
544 (setq file-name-handler-alist
545 (delete (assoc cygwin-mount-cygwin-style2-regexp file-name-handler-alist)
546 file-name-handler-alist))
547 (setq file-name-handler-alist
548 (delete (assoc cygwin-mount-cygwin-style3-regexp file-name-handler-alist)
549 file-name-handler-alist))
550 ;; remove the cygwin properties
551 (put 'substitute-in-file-name 'cygwin-mount-name nil)
552 (put 'expand-file-name 'cygwin-mount-name nil)
553 (put 'substitute-in-file-name 'cygwin-mount-map-drive nil)
554 (put 'expand-file-name 'cygwin-mount-map-drive nil)
555 ;; rebind ange-ftp-run-real-handler to its original definition.
556 (if (featurep 'ange-ftp)
557 (fset 'ange-ftp-run-real-handler cygwin-mount-original-ange-ftp-handler))
558 (setq cygwin-mount-activated nil))))
559
560(provide 'cygwin-mount)
561
562;;; cygwin-mount.el ends here