`symbol-value' for backward compatibility.
* net/tramp.el (tramp-handle-make-symbolic-link)
(tramp-handle-load)
(tramp-do-copy-or-rename-file-via-buffer)
(tramp-do-copy-or-rename-file-directly)
(tramp-do-copy-or-rename-file-out-of-band)
(tramp-handle-process-file, tramp-handle-call-process-region)
(tramp-handle-shell-command, tramp-handle-file-local-copy)
(tramp-handle-insert-file-contents, tramp-handle-write-region)
(tramp-delete-temp-file-function): Use `delete-file' instead
of `tramp-compat-delete-file'.
* net/tramp-fish.el (tramp-fish-handle-delete-directory)
(tramp-fish-handle-make-symbolic-link)
(tramp-fish-handle-process-file): Use `delete-file' instead
of `tramp-compat-delete-file'.
* net/tramp-ftp.el (tramp-ftp-file-name-handler): Use
`delete-file' instead of `tramp-compat-delete-file'.
* net/tramp-gvfs.el (tramp-gvfs-handle-delete-file): Rename arg.
(tramp-gvfs-handle-write-region): Use `delete-file' instead of
`tramp-compat-delete-file'.
* net/tramp-imap.el (tramp-imap-do-copy-or-rename-file): Use
`delete-file' instead of `tramp-compat-delete-file'.
* net/tramp-smb.el (tramp-smb-handle-copy-file)
(tramp-smb-handle-file-local-copy, tramp-smb-handle-rename-file)
(tramp-smb-handle-write-region): Use `delete-file' instead of
`tramp-compat-delete-file'.
(tramp-smb-handle-delete-directory): Use 'trash as arg.
+2010-05-28 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-compat.el (tramp-compat-delete-file): Use
+ `symbol-value' for backward compatibility.
+
+ * net/tramp.el (tramp-handle-make-symbolic-link)
+ (tramp-handle-load)
+ (tramp-do-copy-or-rename-file-via-buffer)
+ (tramp-do-copy-or-rename-file-directly)
+ (tramp-do-copy-or-rename-file-out-of-band)
+ (tramp-handle-process-file, tramp-handle-call-process-region)
+ (tramp-handle-shell-command, tramp-handle-file-local-copy)
+ (tramp-handle-insert-file-contents, tramp-handle-write-region)
+ (tramp-delete-temp-file-function): Use `delete-file' instead
+ of `tramp-compat-delete-file'.
+
+ * net/tramp-fish.el (tramp-fish-handle-delete-directory)
+ (tramp-fish-handle-make-symbolic-link)
+ (tramp-fish-handle-process-file): Use `delete-file' instead
+ of `tramp-compat-delete-file'.
+
+ * net/tramp-ftp.el (tramp-ftp-file-name-handler): Use
+ `delete-file' instead of `tramp-compat-delete-file'.
+
+ * net/tramp-gvfs.el (tramp-gvfs-handle-delete-file): Rename arg.
+ (tramp-gvfs-handle-write-region): Use `delete-file' instead of
+ `tramp-compat-delete-file'.
+
+ * net/tramp-imap.el (tramp-imap-do-copy-or-rename-file): Use
+ `delete-file' instead of `tramp-compat-delete-file'.
+
+ * net/tramp-smb.el (tramp-smb-handle-copy-file)
+ (tramp-smb-handle-file-local-copy, tramp-smb-handle-rename-file)
+ (tramp-smb-handle-write-region): Use `delete-file' instead of
+ `tramp-compat-delete-file'.
+ (tramp-smb-handle-delete-directory): Use 'trash as arg.
+
2010-05-27 Chong Yidong <cyd@stupidchicken.com>
* dired.el (dired-delete-file): New arg TRASH.
(wrong-number-of-arguments
(let ((delete-by-moving-to-trash
(and (boundp 'delete-by-moving-to-trash)
- delete-by-moving-to-trash
+ (symbol-value 'delete-by-moving-to-trash)
trash)))
(delete-file filename)))))
(lambda (file)
(if (file-directory-p file)
(tramp-compat-delete-directory file recursive)
- (tramp-compat-delete-file file)))
+ (delete-file file)))
;; We do not want to delete "." and "..".
(directory-files
directory 'full "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*")))
(with-parsed-tramp-file-name
- (directory-file-name (expand-file-name directory)) nil
- (tramp-flush-directory-property v localname)
- (tramp-fish-send-command-and-check v (format "#RMD %s" localname)))))
+ (directory-file-name (expand-file-name directory)) nil
+ (tramp-flush-directory-property v localname)
+ (tramp-fish-send-command-and-check v (format "#RMD %s" localname)))))
(defun tramp-fish-handle-delete-file (filename &optional trash)
"Like `delete-file' for Tramp files."
localname)))))
(tramp-error
v 'file-already-exists "File %s already exists" localname)
- (tramp-compat-delete-file linkname)))
+ (delete-file linkname)))
;; If FILENAME is a Tramp name, use just the localname component.
(when (tramp-tramp-file-p filename)
;; Provide error file.
(when tmpstderr (rename-file tmpstderr (cadr destination) t))
;; Cleanup.
- (when tmpinput (tramp-compat-delete-file tmpinput))
- (when tmpoutput (tramp-compat-delete-file tmpoutput))
+ (when tmpinput (delete-file tmpinput))
+ (when tmpoutput (delete-file tmpoutput))
;; Return exit status.
ret)))
(unwind-protect
(rename-file tmpfile newname (car args))
;; Cleanup.
- (ignore-errors (tramp-compat-delete-file tmpfile)))))
+ (ignore-errors (delete-file tmpfile)))))
;; Normally, the handlers must be discarded.
;; `inhibit-file-name-handlers' isn't sufficient, because the
(tramp-compat-delete-directory
(tramp-gvfs-fuse-file-name directory) recursive))
-(defun tramp-gvfs-handle-delete-file (filename &optional tramp)
+(defun tramp-gvfs-handle-delete-file (filename &optional trash)
"Like `delete-file' for Tramp files."
- (tramp-compat-delete-file (tramp-gvfs-fuse-file-name filename) tramp))
+ (tramp-compat-delete-file (tramp-gvfs-fuse-file-name filename) trash))
(defun tramp-gvfs-handle-directory-files
(directory &optional full match nosort)
"gvfs-save" tmpfile (tramp-get-buffer v) nil
(tramp-gvfs-url-file-name filename)))
(signal (car err) (cdr err)))
- (tramp-compat-delete-file tmpfile)))))
+ (delete-file tmpfile)))))
;; Set file modification time.
(when (or (eq visit t) (stringp visit))
(insert-file-contents filename)
(write-region (point-min) (point-max) newname)))))
- (when (eq op 'rename)
- (tramp-compat-delete-file filename))))
+ (when (eq op 'rename) (delete-file filename))))
;; TODO: revise this much
(defun tramp-imap-handle-expand-file-name (name &optional dir)
(condition-case err
(rename-file tmpfile newname ok-if-already-exists)
((error quit)
- (tramp-compat-delete-file tmpfile)
+ (delete-file tmpfile)
(signal (car err) (cdr err))))
;; Remote newname.
(lambda (file)
(if (file-directory-p file)
(tramp-compat-delete-directory file recursive)
- (tramp-compat-delete-file file t)))
+ (tramp-compat-delete-file file 'trash)))
;; We do not want to delete "." and "..".
(directory-files
directory 'full "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*")))
v (format "get \"%s\" \"%s\""
(tramp-smb-get-localname v) tmpfile))
;; Oops, an error. We shall cleanup.
- (tramp-compat-delete-file tmpfile)
+ (delete-file tmpfile)
(tramp-error
v 'file-error "Cannot make local copy of file `%s'" filename)))
tmpfile)))
(condition-case err
(rename-file tmpfile newname ok-if-already-exists)
((error quit)
- (tramp-compat-delete-file tmpfile)
+ (delete-file tmpfile)
(signal (car err) (cdr err))))
;; Remote newname.
filename (tramp-smb-get-localname v)))
(tramp-error v 'file-error "Cannot rename `%s'" filename)))))
- (tramp-compat-delete-file filename)))
+ (delete-file filename)))
(defun tramp-smb-handle-set-file-modes (filename mode)
"Like `set-file-modes' for Tramp files."
v (format "put %s \"%s\""
tmpfile (tramp-smb-get-localname v)))
(tramp-error v 'file-error "Cannot write `%s'" filename))
- (tramp-compat-delete-file tmpfile)))
+ (delete-file tmpfile)))
(unless (equal curbuf (current-buffer))
(tramp-error
l-localname)))))
(tramp-error
l 'file-already-exists "File %s already exists" l-localname)
- (tramp-compat-delete-file linkname)))
+ (delete-file linkname)))
;; If FILENAME is a Tramp name, use just the localname component.
(when (tramp-tramp-file-p filename)
;; MUST-SUFFIX doesn't exist on XEmacs, so let it default to nil.
(unwind-protect
(load local-copy noerror t t)
- (tramp-compat-delete-file local-copy)))))
+ (delete-file local-copy)))))
t)))
;; Localname manipulation functions that grok Tramp localnames...
;; Set the mode.
(set-file-modes newname (tramp-default-file-modes filename))
;; If the operation was `rename', delete the original file.
- (unless (eq op 'copy) (tramp-compat-delete-file filename)))
+ (unless (eq op 'copy) (delete-file filename)))
(defun tramp-do-copy-or-rename-file-directly
(op filename newname ok-if-already-exists keep-date preserve-uid-gid)
;; Save exit.
(condition-case nil
- (tramp-compat-delete-file tmpfile)
+ (delete-file tmpfile)
(error)))))))))
;; Set the time and mode. Mask possible errors.
(if dir-flag
(tramp-compat-delete-directory
(expand-file-name ".." tmpfile) 'recursive)
- (tramp-compat-delete-file tmpfile))
+ (delete-file tmpfile))
(error))))
;; Expand hops. Might be necessary for gateway methods.
;; If the operation was `rename', delete the original file.
(unless (eq op 'copy)
(if (file-regular-p filename)
- (tramp-compat-delete-file filename)
+ (delete-file filename)
(tramp-compat-delete-directory filename 'recursive))))))
(defun tramp-handle-make-directory (dir &optional parents)
(defun tramp-handle-delete-file (filename &optional trash)
"Like `delete-file' for Tramp files."
+ ;; TRASH needs to be implemented. See `move-file-to-trash'.
(setq filename (expand-file-name filename))
(with-parsed-tramp-file-name filename nil
(tramp-flush-file-property v (file-name-directory localname))
;; Cleanup. We remove all file cache values for the connection,
;; because the remote process could have changed them.
- (when tmpinput (tramp-compat-delete-file tmpinput))
+ (when tmpinput (delete-file tmpinput))
;; `process-file-side-effects' has been introduced with GNU
;; Emacs 23.2. If set to `nil', no remote file will be changed
(when delete (delete-region start end))
(unwind-protect
(apply 'call-process program tmpfile buffer display args)
- (tramp-compat-delete-file tmpfile))))
+ (delete-file tmpfile))))
(defun tramp-handle-shell-command
(command &optional output-buffer error-buffer)
(when (listp buffer)
(with-current-buffer error-buffer
(insert-file-contents (cadr buffer)))
- (tramp-compat-delete-file (cadr buffer)))
+ (delete-file (cadr buffer)))
(if current-buffer-p
;; This is like exchange-point-and-mark, but doesn't
;; activate the mark. It is cleaner to avoid activation,
(unwind-protect
(tramp-call-local-coding-command
loc-dec tmpfile2 tmpfile)
- (tramp-compat-delete-file tmpfile2)))))
+ (delete-file tmpfile2)))))
;; Set proper permissions.
(set-file-modes tmpfile (tramp-default-file-modes filename))
;; Error handling.
((error quit)
- (tramp-compat-delete-file tmpfile)
+ (delete-file tmpfile)
(signal (car err) (cdr err))))
(run-hooks 'tramp-handle-file-local-copy-hook)
(set-buffer-modified-p nil))
(when (and (stringp local-copy)
(or remote-copy (null tramp-temp-buffer-file-name)))
- (tramp-compat-delete-file local-copy))
+ (delete-file local-copy))
(when (stringp remote-copy)
- (tramp-compat-delete-file
+ (delete-file
(tramp-make-tramp-file-name method user host remote-copy))))))
;; Result.
(list start end tmpfile append 'no-message lockname confirm))
((error quit)
(setq tramp-temp-buffer-file-name nil)
- (tramp-compat-delete-file tmpfile)
+ (delete-file tmpfile)
(signal (car err) (cdr err))))
;; Now, `last-coding-system-used' has the right value. Remember it.
(copy-file tmpfile filename t)
((error quit)
(setq tramp-temp-buffer-file-name nil)
- (tramp-compat-delete-file tmpfile)
+ (delete-file tmpfile)
(signal (car err) (cdr err)))))
(setq tramp-temp-buffer-file-name nil)
;; Don't rename, in order to keep context in SELinux.
(unwind-protect
(copy-file tmpfile filename t)
- (tramp-compat-delete-file tmpfile))))
+ (delete-file tmpfile))))
;; Use inline file transfer.
(rem-dec
filename rem-dec)))))
;; Save exit.
- (tramp-compat-delete-file tmpfile)))
+ (delete-file tmpfile)))
;; That's not expected.
(t
"Remove temporary files related to current buffer."
(when (stringp tramp-temp-buffer-file-name)
(condition-case nil
- (tramp-compat-delete-file tramp-temp-buffer-file-name)
+ (delete-file tramp-temp-buffer-file-name)
(error nil))))
(add-hook 'kill-buffer-hook 'tramp-delete-temp-file-function)