tags 469017 + fixed-upstream
thanks
On 2008-03-02 17:41 +0100, Petri Kaurinkoski wrote:
> Package: emacs
> Version: 22.1+1-2.3
> Severity: normal
>
> The problem I have occurrs every time I start emacs so that my current
> directory is either on a vfat fileystem or ntfs filesystem. Emacs
> starts, but it complains about errors when opening output file while
> processing my .emacs file and the other files it tries to load.
>
> I do not have emacs runing in a debugger, but I started it with
> '--debug-init' as instructed, and the resulting output is attached
> to this e-mail.
Thanks for the report. The problem is that Emacs is trying to autosave
your *scratch* buffer and constructs a filename for it that is invalid
on VFAT and NTFS filesystems (they do not allow the *).
The issue had recently been reported upstream and was fixed with the
following change:
2008-02-26 Jason Rumney <[EMAIL PROTECTED]>
* files.el (make-auto-save-file-name): Encode more characters in
non-file buffer names. Use url-encoding.
--8<---------------cut here---------------start------------->8---
Index: files.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/files.el,v
retrieving revision 1.896.2.39
retrieving revision 1.896.2.40
diff -u -r1.896.2.39 -r1.896.2.40
--- files.el 25 Feb 2008 17:40:42 -0000 1.896.2.39
+++ files.el 26 Feb 2008 16:52:02 -0000 1.896.2.40
@@ -4561,15 +4561,18 @@
(let ((buffer-name (buffer-name))
(limit 0)
file-name)
- ;; Eliminate all slashes and backslashes by
- ;; replacing them with sequences that start with %.
- ;; Quote % also, to keep distinct names distinct.
- (while (string-match "[/\\%]" buffer-name limit)
+ ;; Restrict the characters used in the file name to those which
+ ;; are known to be safe on all filesystems, url-encoding the
+ ;; rest.
+ ;; We do this on all platforms, because even if we are not
+ ;; running on DOS/Windows, the current directory may be on a
+ ;; mounted VFAT filesystem, such as a USB memory stick.
+ (while (string-match "[^A-Za-z0-9-_.~#+]" buffer-name limit)
(let* ((character (aref buffer-name (match-beginning 0)))
(replacement
- (cond ((eq character ?%) "%%")
- ((eq character ?/) "%+")
- ((eq character ?\\) "%-"))))
+ ;; For multibyte characters, this will produce more than
+ ;; 2 hex digits, so is not true URL encoding.
+ (format "%%%02X" character)))
(setq buffer-name (replace-match replacement t t buffer-name))
(setq limit (1+ (match-end 0)))))
;; Generate the file name.
--8<---------------cut here---------------end--------------->8---
Unfortunately this patch does not seem to apply to the version of
files.el in Emacs 22.1, so you're on your own if you want to backport
it.
In the meantime, you can work around the bug by commenting out the line
with
(auto-save-mode 1)
in your .emacs. Note that your *scratch* buffer will then not be
autosaved, so don't put important stuff into it.
Regards,
Sven
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]