emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/files.el


From: Michael Albinus
Subject: [Emacs-diffs] Changes to emacs/lisp/files.el
Date: Tue, 30 Aug 2005 18:41:06 -0400

Index: emacs/lisp/files.el
diff -c emacs/lisp/files.el:1.786 emacs/lisp/files.el:1.787
*** emacs/lisp/files.el:1.786   Tue Aug 30 10:36:17 2005
--- emacs/lisp/files.el Tue Aug 30 22:41:01 2005
***************
*** 4062,4114 ****
  before calling this function.  You can redefine this for customization.
  See also `auto-save-file-name-p'."
    (if buffer-file-name
!       (let ((list auto-save-file-name-transforms)
!           (filename buffer-file-name)
!           result uniq)
!       ;; Apply user-specified translations
!       ;; to the file name.
!       (while (and list (not result))
!         (if (string-match (car (car list)) filename)
!             (setq result (replace-match (cadr (car list)) t nil
!                                         filename)
!                   uniq (car (cddr (car list)))))
!         (setq list (cdr list)))
!       (if result
!           (if uniq
!               (setq filename (concat
!                               (file-name-directory result)
!                               (subst-char-in-string
!                                ?/ ?!
!                                (replace-regexp-in-string "!" "!!"
!                                                          filename))))
!             (setq filename result)))
!       (setq result
!             (if (and (eq system-type 'ms-dos)
!                      (not (msdos-long-file-names)))
!                 ;; We truncate the file name to DOS 8+3 limits
!                 ;; before doing anything else, because the regexp
!                 ;; passed to string-match below cannot handle
!                 ;; extensions longer than 3 characters, multiple
!                 ;; dots, and other atrocities.
!                 (let ((fn (dos-8+3-filename
!                            (file-name-nondirectory buffer-file-name))))
!                   (string-match
!                    "\\`\\([^.]+\\)\\(\\.\\(..?\\)?.?\\|\\)\\'"
!                    fn)
!                   (concat (file-name-directory buffer-file-name)
!                           "#" (match-string 1 fn)
!                           "." (match-string 3 fn) "#"))
!               (concat (file-name-directory filename)
!                       "#"
!                       (file-name-nondirectory filename)
!                       "#")))
!       ;; Make sure auto-save file names don't contain characters
!       ;; invalid for the underlying filesystem.
!       (if (and (memq system-type '(ms-dos windows-nt))
!                ;; Don't modify remote (ange-ftp) filenames
!                (not (string-match "^/address@hidden:" result)))
!           (convert-standard-filename result)
!         result))
  
      ;; Deal with buffers that don't have any associated files.  (Mail
      ;; mode tends to create a good number of these.)
--- 4062,4118 ----
  before calling this function.  You can redefine this for customization.
  See also `auto-save-file-name-p'."
    (if buffer-file-name
!       (let ((handler (find-file-name-handler buffer-file-name
!                                            'make-auto-save-file-name)))
!       (if handler
!           (funcall handler 'make-auto-save-file-name)
!         (let ((list auto-save-file-name-transforms)
!               (filename buffer-file-name)
!               result uniq)
!           ;; Apply user-specified translations
!           ;; to the file name.
!           (while (and list (not result))
!             (if (string-match (car (car list)) filename)
!                 (setq result (replace-match (cadr (car list)) t nil
!                                             filename)
!                       uniq (car (cddr (car list)))))
!             (setq list (cdr list)))
!           (if result
!               (if uniq
!                   (setq filename (concat
!                                   (file-name-directory result)
!                                   (subst-char-in-string
!                                    ?/ ?!
!                                    (replace-regexp-in-string "!" "!!"
!                                                              filename))))
!                 (setq filename result)))
!           (setq result
!                 (if (and (eq system-type 'ms-dos)
!                          (not (msdos-long-file-names)))
!                     ;; We truncate the file name to DOS 8+3 limits
!                     ;; before doing anything else, because the regexp
!                     ;; passed to string-match below cannot handle
!                     ;; extensions longer than 3 characters, multiple
!                     ;; dots, and other atrocities.
!                     (let ((fn (dos-8+3-filename
!                                (file-name-nondirectory buffer-file-name))))
!                       (string-match
!                        "\\`\\([^.]+\\)\\(\\.\\(..?\\)?.?\\|\\)\\'"
!                        fn)
!                       (concat (file-name-directory buffer-file-name)
!                               "#" (match-string 1 fn)
!                               "." (match-string 3 fn) "#"))
!                   (concat (file-name-directory filename)
!                           "#"
!                           (file-name-nondirectory filename)
!                           "#")))
!           ;; Make sure auto-save file names don't contain characters
!           ;; invalid for the underlying filesystem.
!           (if (and (memq system-type '(ms-dos windows-nt))
!                    ;; Don't modify remote (ange-ftp) filenames
!                    (not (string-match "^/address@hidden:" result)))
!               (convert-standard-filename result)
!             result))))
  
      ;; Deal with buffers that don't have any associated files.  (Mail
      ;; mode tends to create a good number of these.)




reply via email to

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