Show
Ignore:
Timestamp:
09/10/05 10:16:00 (3 years ago)
Author:
miyoshi
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lisp/files.el

    r3828 r3863  
    3030 
    3131;;; Code: 
     32 
     33(defvar font-lock-keywords) 
     34 
    3235 
    3336(defgroup backup nil 
     
    24082411  (let ((safep (get sym 'safe-local-variable))) 
    24092412    (or (get sym 'risky-local-variable) 
    2410         (and (string-match "-hooks?$\\|-functions?$\\|-forms?$\\|-program$\\|-command$\\|-predicate$\\|font-lock-keywords$\\|font-lock-keywords-[0-9]+$\\|font-lock-syntactic-keywords$\\|-frame-alist$\\|-mode-alist$\\|-map$\\|-map-alist$" 
     2413        (and (string-match "-hooks?$\\|-functions?$\\|-forms?$\\|-program$\\|-commands?$\\|-predicates?$\\|font-lock-keywords$\\|font-lock-keywords-[0-9]+$\\|font-lock-syntactic-keywords$\\|-frame-alist$\\|-mode-alist$\\|-map$\\|-map-alist$" 
    24112414                           (symbol-name sym)) 
    24122415             (not safep)) 
     
    40634066See also `auto-save-file-name-p'." 
    40644067  (if buffer-file-name 
    4065       (let ((list auto-save-file-name-transforms) 
    4066             (filename buffer-file-name) 
    4067             result uniq) 
    4068         ;; Apply user-specified translations 
    4069         ;; to the file name. 
    4070         (while (and list (not result)) 
    4071           (if (string-match (car (car list)) filename) 
    4072               (setq result (replace-match (cadr (car list)) t nil 
    4073                                           filename) 
    4074                     uniq (car (cddr (car list))))) 
    4075           (setq list (cdr list))) 
    4076         (if result 
    4077             (if uniq 
    4078                 (setq filename (concat 
    4079                                 (file-name-directory result) 
    4080                                 (subst-char-in-string 
    4081                                  ?/ ?! 
    4082                                  (replace-regexp-in-string "!" "!!" 
    4083                                                            filename)))) 
    4084               (setq filename result))) 
    4085         (setq result 
    4086               (if (and (eq system-type 'ms-dos) 
    4087                        (not (msdos-long-file-names))) 
    4088                   ;; We truncate the file name to DOS 8+3 limits 
    4089                   ;; before doing anything else, because the regexp 
    4090                   ;; passed to string-match below cannot handle 
    4091                   ;; extensions longer than 3 characters, multiple 
    4092                   ;; dots, and other atrocities. 
    4093                   (let ((fn (dos-8+3-filename 
    4094                              (file-name-nondirectory buffer-file-name)))) 
    4095                     (string-match 
    4096                      "\\`\\([^.]+\\)\\(\\.\\(..?\\)?.?\\|\\)\\'" 
    4097                      fn) 
    4098                     (concat (file-name-directory buffer-file-name) 
    4099                             "#" (match-string 1 fn) 
    4100                             "." (match-string 3 fn) "#")) 
    4101                 (concat (file-name-directory filename) 
    4102                         "#" 
    4103                         (file-name-nondirectory filename) 
    4104                         "#"))) 
    4105         ;; Make sure auto-save file names don't contain characters 
    4106         ;; invalid for the underlying filesystem. 
    4107         (if (and (memq system-type '(ms-dos windows-nt)) 
    4108                  ;; Don't modify remote (ange-ftp) filenames 
    4109                  (not (string-match "^/\\w+@[-A-Za-z0-9._]+:" result))) 
    4110             (convert-standard-filename result) 
    4111           result)) 
     4068      (let ((handler (find-file-name-handler buffer-file-name 
     4069                                             'make-auto-save-file-name))) 
     4070        (if handler 
     4071            (funcall handler 'make-auto-save-file-name) 
     4072          (let ((list auto-save-file-name-transforms) 
     4073                (filename buffer-file-name) 
     4074                result uniq) 
     4075            ;; Apply user-specified translations 
     4076            ;; to the file name. 
     4077            (while (and list (not result)) 
     4078              (if (string-match (car (car list)) filename) 
     4079                  (setq result (replace-match (cadr (car list)) t nil 
     4080                                              filename) 
     4081                        uniq (car (cddr (car list))))) 
     4082              (setq list (cdr list))) 
     4083            (if result 
     4084                (if uniq 
     4085                    (setq filename (concat 
     4086                                    (file-name-directory result) 
     4087                                    (subst-char-in-string 
     4088                                     ?/ ?! 
     4089                                     (replace-regexp-in-string "!" "!!" 
     4090                                                               filename)))) 
     4091                  (setq filename result))) 
     4092            (setq result 
     4093                  (if (and (eq system-type 'ms-dos) 
     4094                           (not (msdos-long-file-names))) 
     4095                      ;; We truncate the file name to DOS 8+3 limits 
     4096                      ;; before doing anything else, because the regexp 
     4097                      ;; passed to string-match below cannot handle 
     4098                      ;; extensions longer than 3 characters, multiple 
     4099                      ;; dots, and other atrocities. 
     4100                      (let ((fn (dos-8+3-filename 
     4101                                 (file-name-nondirectory buffer-file-name)))) 
     4102                        (string-match 
     4103                         "\\`\\([^.]+\\)\\(\\.\\(..?\\)?.?\\|\\)\\'" 
     4104                         fn) 
     4105                        (concat (file-name-directory buffer-file-name) 
     4106                                "#" (match-string 1 fn) 
     4107                                "." (match-string 3 fn) "#")) 
     4108                    (concat (file-name-directory filename) 
     4109                            "#" 
     4110                            (file-name-nondirectory filename) 
     4111                            "#"))) 
     4112            ;; Make sure auto-save file names don't contain characters 
     4113            ;; invalid for the underlying filesystem. 
     4114            (if (and (memq system-type '(ms-dos windows-nt)) 
     4115                     ;; Don't modify remote (ange-ftp) filenames 
     4116                     (not (string-match "^/\\w+@[-A-Za-z0-9._]+:" result))) 
     4117                (convert-standard-filename result) 
     4118              result)))) 
    41124119 
    41134120    ;; Deal with buffers that don't have any associated files.  (Mail