+2010-05-01 Chong Yidong <cyd@stupidchicken.com>
+
+ * server.el (server-sentinel, server-start, server-force-delete):
+
+ * jka-compr.el (jka-compr-partial-uncompress)
+ (jka-compr-call-process, jka-compr-write-region, jka-compr-load):
+
+ * epg.el (epg--make-temp-file, epg-decrypt-string)
+ (epg-encrypt-string, epg-verify-string, epg-sign-string):
+
+ * diff.el (diff-sentinel): Bind delete-by-moving-to-trash to nil
+ before deleting (Bug#6070).
+
2010-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
* bindings.el (mode-line-abbrev-mode, mode-line-auto-fill-mode):
"Code run when the diff process exits.
CODE is the exit code of the process. It should be 0 only if no diffs
were found."
- (if diff-old-temp-file (delete-file diff-old-temp-file))
- (if diff-new-temp-file (delete-file diff-new-temp-file))
+ (let (delete-by-moving-to-trash)
+ (if diff-old-temp-file (delete-file diff-old-temp-file))
+ (if diff-new-temp-file (delete-file diff-new-temp-file)))
(save-excursion
(goto-char (point-max))
(let ((inhibit-read-only t))
;; Cleanup the tempfile.
(and tempfile
(file-exists-p tempfile)
- (delete-file tempfile))
+ (let (delete-by-moving-to-trash)
+ (delete-file tempfile)))
;; Cleanup the tempdir.
(and tempdir
(file-directory-p tempdir)
(epg-read-output context))
(epg-delete-output-file context)
(if (file-exists-p input-file)
- (delete-file input-file))
+ (let (delete-by-moving-to-trash)
+ (delete-file input-file)))
(epg-reset context))))
(defun epg-start-verify (context signature &optional signed-text)
(epg-delete-output-file context)
(if (and input-file
(file-exists-p input-file))
- (delete-file input-file))
+ (let (delete-by-moving-to-trash)
+ (delete-file input-file)))
(epg-reset context))))
(defun epg-start-sign (context plain &optional mode)
(epg-read-output context))
(epg-delete-output-file context)
(if input-file
- (delete-file input-file))
+ (let (delete-by-moving-to-trash)
+ (delete-file input-file)))
(epg-reset context))))
(defun epg-start-encrypt (context plain recipients
(epg-read-output context))
(epg-delete-output-file context)
(if input-file
- (delete-file input-file))
+ (let (delete-by-moving-to-trash)
+ (delete-file input-file)))
(epg-reset context))))
(defun epg-start-export-keys (context keys)
null-device))
jka-compr-acceptable-retval-list)
(jka-compr-error prog args infile message err-file))
- (jka-compr-delete-temp-file err-file)))
+ (let (delete-by-moving-to-trash)
+ (delete-file err-file))))
+
;; Run the uncompression program directly.
;; We get the whole file and must delete what we don't want.
(jka-compr-call-process prog message infile t nil args))
"")))
jka-compr-acceptable-retval-list)
(jka-compr-error prog args infile message err-file))
- (jka-compr-delete-temp-file err-file)))
+ (let (delete-by-moving-to-trash)
+ (delete-file err-file))))
(or (eq 0
(apply 'call-process
prog infile (if (stringp output) temp output)
"This routine will return the name of a new file."
(make-temp-file jka-compr-temp-name-template))
-(defalias 'jka-compr-delete-temp-file 'delete-file)
-
-
(defun jka-compr-write-region (start end file &optional append visit)
(let* ((filename (expand-file-name file))
(visit-file (if (stringp visit) (expand-file-name visit) filename))
(and append can-append) 'dont))
(erase-buffer)) )
- (jka-compr-delete-temp-file temp-file)
+ (let (delete-by-moving-to-trash)
+ (delete-file temp-file))
(and
compress-message
(setq file (file-name-sans-extension file)))
(setcar l file)))
- (jka-compr-delete-temp-file local-copy))
+ (let (delete-by-moving-to-trash)
+ (delete-file local-copy)))
t))
;; for possible servers before doing anything, so it *should* be ours.
(and (process-contact proc :server)
(eq (process-status proc) 'closed)
- (ignore-errors (delete-file (process-get proc :server-file))))
+ (ignore-errors
+ (let (delete-by-moving-to-trash)
+ (delete-file (process-get proc :server-file)))))
(server-log (format "Status changed to %s: %s" (process-status proc) msg) proc)
(server-delete-client proc))
;; Delete the socket files made by previous server invocations.
(if (not (eq t (server-running-p server-name)))
;; Remove any leftover socket or authentication file
- (ignore-errors (delete-file server-file))
+ (ignore-errors
+ (let (delete-by-moving-to-trash)
+ (delete-file server-file)))
(setq server-mode nil) ;; already set by the minor mode code
(display-warning
'server
server-auth-dir
server-socket-dir))))
(condition-case nil
- (progn
+ (let (delete-by-moving-to-trash)
(delete-file file)
(message "Connection file %S deleted" file))
(file-error