[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/files.el [lexbind]
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/files.el [lexbind] |
Date: |
Tue, 06 Jul 2004 07:11:56 -0400 |
Index: emacs/lisp/files.el
diff -c emacs/lisp/files.el:1.583.2.10 emacs/lisp/files.el:1.583.2.11
*** emacs/lisp/files.el:1.583.2.10 Tue Jul 6 09:14:18 2004
--- emacs/lisp/files.el Tue Jul 6 09:23:36 2004
***************
*** 293,299 ****
:group 'auto-save)
(defcustom auto-save-file-name-transforms
! `(("\\`/[^/]*:\\(.+/\\)*\\(.*\\)"
;; Don't put "\\2" inside expand-file-name, since it will be
;; transformed to "/2" on DOS/Windows.
,(concat temporary-file-directory "\\2") t))
--- 293,299 ----
:group 'auto-save)
(defcustom auto-save-file-name-transforms
! `(("\\`/[^/]*:\\([^/]*/\\)*\\([^/]*\\)\\'"
;; Don't put "\\2" inside expand-file-name, since it will be
;; transformed to "/2" on DOS/Windows.
,(concat temporary-file-directory "\\2") t))
***************
*** 1357,1397 ****
rawfile truename number))))))
(defun find-file-noselect-1 (buf filename nowarn rawfile truename number)
! (let ((inhibit-read-only t)
! error)
(with-current-buffer buf
(kill-local-variable 'find-file-literally)
;; Needed in case we are re-visiting the file with a different
;; text representation.
(kill-local-variable 'buffer-file-coding-system)
(kill-local-variable 'cursor-type)
! (erase-buffer)
! (and (default-value 'enable-multibyte-characters)
! (not rawfile)
! (set-buffer-multibyte t))
! (if rawfile
! (condition-case ()
! (insert-file-contents-literally filename t)
! (file-error
! (when (and (file-exists-p filename)
! (not (file-readable-p filename)))
! (kill-buffer buf)
! (signal 'file-error (list "File is not readable"
! filename)))
! ;; Unconditionally set error
! (setq error t)))
! (condition-case ()
! (insert-file-contents filename t)
! (file-error
! (when (and (file-exists-p filename)
! (not (file-readable-p filename)))
! (kill-buffer buf)
! (signal 'file-error (list "File is not readable"
! filename)))
! ;; Run find-file-not-found-hooks until one returns non-nil.
! (or (run-hook-with-args-until-success 'find-file-not-found-functions)
! ;; If they fail too, set error.
(setq error t)))))
;; Record the file's truename, and maybe use that as visited name.
(if (equal filename buffer-file-name)
(setq buffer-file-truename truename)
--- 1357,1398 ----
rawfile truename number))))))
(defun find-file-noselect-1 (buf filename nowarn rawfile truename number)
! (let (error)
(with-current-buffer buf
(kill-local-variable 'find-file-literally)
;; Needed in case we are re-visiting the file with a different
;; text representation.
(kill-local-variable 'buffer-file-coding-system)
(kill-local-variable 'cursor-type)
! (let ((inhibit-read-only t))
! (erase-buffer)
! (and (default-value 'enable-multibyte-characters)
! (not rawfile)
! (set-buffer-multibyte t))
! (if rawfile
! (condition-case ()
! (insert-file-contents-literally filename t)
! (file-error
! (when (and (file-exists-p filename)
! (not (file-readable-p filename)))
! (kill-buffer buf)
! (signal 'file-error (list "File is not readable"
! filename)))
! ;; Unconditionally set error
(setq error t)))))
+ (condition-case ()
+ (let ((inhibit-read-only t))
+ (insert-file-contents filename t))
+ (file-error
+ (when (and (file-exists-p filename)
+ (not (file-readable-p filename)))
+ (kill-buffer buf)
+ (signal 'file-error (list "File is not readable"
+ filename)))
+ ;; Run find-file-not-found-hooks until one returns non-nil.
+ (or (run-hook-with-args-until-success 'find-file-not-found-functions)
+ ;; If they fail too, set error.
+ (setq error t))))
;; Record the file's truename, and maybe use that as visited name.
(if (equal filename buffer-file-name)
(setq buffer-file-truename truename)
***************
*** 4486,4495 ****
(directory-file-name . nil)
(file-name-sans-versions . nil)
;; `identity' means just return the first arg
! ;; as stripped of its quoting.
! (substitute-in-file-name . identity)
(file-name-completion 1)
(file-name-all-completions 1)
(rename-file 0 1)
(copy-file 0 1)
(make-symbolic-link 0 1)
--- 4487,4498 ----
(directory-file-name . nil)
(file-name-sans-versions . nil)
;; `identity' means just return the first arg
! ;; not stripped of its quoting.
! (substitute-in-file-name identity)
(file-name-completion 1)
(file-name-all-completions 1)
+ ;; t means add "/:" to the result.
+ (file-truename t 0)
(rename-file 0 1)
(copy-file 0 1)
(make-symbolic-link 0 1)
***************
*** 4497,4505 ****
;; For all other operations, treat the first argument only
;; as the file name.
'(nil 0))))
;; Copy ARGUMENTS so we can replace elements in it.
(arguments (copy-sequence arguments)))
! ;; Strip off the /: from the file names that have this handler.
(save-match-data
(while (consp file-arg-indices)
(let ((pair (nthcdr (car file-arg-indices) arguments)))
--- 4500,4511 ----
;; For all other operations, treat the first argument only
;; as the file name.
'(nil 0))))
+ method
;; Copy ARGUMENTS so we can replace elements in it.
(arguments (copy-sequence arguments)))
! (if (symbolp (car file-arg-indices))
! (setq method (pop file-arg-indices)))
! ;; Strip off the /: from the file names that have it.
(save-match-data
(while (consp file-arg-indices)
(let ((pair (nthcdr (car file-arg-indices) arguments)))
***************
*** 4510,4518 ****
"/"
(substring (car pair) 2)))))
(setq file-arg-indices (cdr file-arg-indices))))
! (if (eq file-arg-indices 'identity)
! (car arguments)
! (apply operation arguments))))
(define-key ctl-x-map "\C-f" 'find-file)
(define-key ctl-x-map "\C-r" 'find-file-read-only)
--- 4516,4527 ----
"/"
(substring (car pair) 2)))))
(setq file-arg-indices (cdr file-arg-indices))))
! (cond ((eq method 'identity)
! (car arguments))
! (method
! (concat "/:" (apply operation arguments)))
! (t
! (apply operation arguments)))))
(define-key ctl-x-map "\C-f" 'find-file)
(define-key ctl-x-map "\C-r" 'find-file-read-only)
- [Emacs-diffs] Changes to emacs/lisp/files.el [lexbind], Miles Bader, 2004/07/06
- [Emacs-diffs] Changes to emacs/lisp/files.el [lexbind], Miles Bader, 2004/07/06
- [Emacs-diffs] Changes to emacs/lisp/files.el [lexbind], Miles Bader, 2004/07/06
- [Emacs-diffs] Changes to emacs/lisp/files.el [lexbind], Miles Bader, 2004/07/06
- [Emacs-diffs] Changes to emacs/lisp/files.el [lexbind], Miles Bader, 2004/07/06
- [Emacs-diffs] Changes to emacs/lisp/files.el [lexbind], Miles Bader, 2004/07/06
- [Emacs-diffs] Changes to emacs/lisp/files.el [lexbind], Miles Bader, 2004/07/06
- [Emacs-diffs] Changes to emacs/lisp/files.el [lexbind],
Miles Bader <=
- [Emacs-diffs] Changes to emacs/lisp/files.el [lexbind], Miles Bader, 2004/07/06
- [Emacs-diffs] Changes to emacs/lisp/files.el [lexbind], Miles Bader, 2004/07/16