emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: report-emacs-bug not working on cygwin: reporting again


From: Eli Zaretskii
Subject: Re: report-emacs-bug not working on cygwin: reporting again
Date: Sat, 29 Jul 2006 15:08:23 +0300

> From: "emacs user" <address@hidden>
> Cc: address@hidden
> Bcc: 
> Date: Fri, 28 Jul 2006 07:17:23 -0400
> 
> >From: Eli Zaretskii <address@hidden>
> >Type this:
> >
> >   M-: (convert-standard-filename "/home/eli/#*mail*#1160WPf#") RET
> >
> >and tell me what it prints.
> 
> echo line shows:
> "/home/eli/#*mail*#1160WPf#"

Does the patch below give good results?  (Note that files.el is
preloaded, so you will need to recompile it and rebuild Emacs after
patching files.el.)

2006-07-29  Eli Zaretskii  <address@hidden>

        * files.el (convert-standard-filename): For Cygwin, replace
        characters not allowed in Windows file names.
        (make-auto-save-file-name): Add Cygwin to the list of systems
        where the auto-save file name needs to be run through
        convert-standard-filename.

Index: lisp/files.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/files.el,v
retrieving revision 1.853
retrieving revision 1.854
diff -u -r1.853 -r1.854
--- lisp/files.el       16 Jul 2006 04:28:10 -0000      1.853
+++ lisp/files.el       29 Jul 2006 12:05:28 -0000      1.854
@@ -540,13 +540,21 @@
 
 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, turn Cygwin names into native names, and also turn
-slashes into backslashes if the shell requires it (see
+characters.  On DOS, make sure to obey the 8.3 limitations.
+In the native Windows build, turn Cygwin names into native names,
+and also turn slashes into backslashes if the shell requires it (see
 `w32-shell-dos-semantics').
 
 See Info node `(elisp)Standard File Names' for more details."
-  filename)
+  (if (eq system-type 'cygwin)
+      (let ((name (copy-sequence filename))
+           (start 0))
+       ;; Replace invalid filename characters with !
+       (while (string-match "[?*:<>|\"\000-\037]" name start)
+         (aset name (match-beginning 0) ?!)
+         (setq start (match-end 0)))
+       name)
+    filename))
 
 (defun read-directory-name (prompt &optional dir default-dirname mustmatch 
initial)
   "Read directory name, prompting with PROMPT and completing in directory DIR.
@@ -4368,7 +4376,7 @@
                            "#")))
            ;; Make sure auto-save file names don't contain characters
            ;; invalid for the underlying filesystem.
-           (if (and (memq system-type '(ms-dos windows-nt))
+           (if (and (memq system-type '(ms-dos windows-nt cygwin))
                     ;; Don't modify remote (ange-ftp) filenames
                     (not (string-match "^/address@hidden:" result)))
                (convert-standard-filename result)
@@ -4403,7 +4411,7 @@
                      ((file-writable-p default-directory) default-directory)
                      ((file-writable-p "/var/tmp/") "/var/tmp/")
                      ("~/")))))
-              (if (and (memq system-type '(ms-dos windows-nt))
+              (if (and (memq system-type '(ms-dos windows-nt cygwin))
                        ;; Don't modify remote (ange-ftp) filenames
                        (not (string-match "^/address@hidden:" fname)))
                   ;; The call to convert-standard-filename is in case




reply via email to

[Prev in Thread] Current Thread [Next in Thread]