;; -*- mode: emacs-lisp; coding: hebrew-iso-8bit-unix; -*- ;; added functions for use with the Cygnus tools for Win9x/NT (Cygwin32) ;; Copyright (C) 1992-1999 Ehud karni ;; This file is part of Ehud Karni (EK)'s additives for GNU Emacs. ;; GNU (EK) Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY. No author or distributor ;; accepts responsibility to anyone for the consequences of using it ;; or for whether it serves any particular purpose or works at all, ;; unless he says so in writing. Refer to the GNU Emacs General Public ;; License for full details. ;; ;; EHUD KARNI ינרק דוהא ;; Ben Gurion st' 14 ןוירוג ןב 'חר ;; Kfar - Sava 44 257 אבס - רפכ ;; =================================== ;; 972-(0)9-7659599 ;; =================================== ;; RCS: $Id: cygwin32.el,v 1.100 2000/03/05 12:47:09 ehud work ehud $ ;; ;; LOG: $Log: cygwin32.el,v $ ;; LOG: Revision 1.100 2000/03/05 12:47:09 ehud ;; LOG: Initial RCS version - For Emacs 20.4/5 ;; LOG: ;; Everyone is granted permission to copy, modify and redistribute ;; GNU Emacs, but only under the conditions described in the ;; GNU Emacs General Public License. A copy of this license is ;; supposed to have been given to you along with GNU Emacs so you ;; can know your rights and responsibilities. It should be in a ;; file named COPYING. Among other things, the copyright notice ;; and this notice must be preserved on all copies. (defun convert-standard-filename (filename) "Convert a standard file's name to something suitable for the OS. This means to guarantee valid names and perhaps to canonicalize certain patterns. FILENAME should be an absolute file name since the conversion rules sometimes vary depending on the position in the file name. E.g. c:/foo is a valid DOS file name, but c:/bar/c:/foo is not. This function's standard definition is trivial; it just returns the argument. However, on Windows and DOS, replace invalid characters. On DOS, make sure to obey the 8.3 limitations. On Windows (native), turn Cygwin names into native names, and also turn slashes into backslashes if the shell requires it (see `w32-shell-dos-semantics'). On Cygwin, replace invalid Windows characters. See Info node `(elisp)Standard File Names' for more details." (let ((name filename) (start 0)) ;; destructively replace invalid filename characters with % (while (string-match "[?*:<>|\"\000-\037]" name start) (aset name (match-beginning 0) ?%) (setq start (match-end 0))) name)) (convert-standard-filename "#*mail*#abcdefg#") ;; ========================================================================