[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r100100: Avoid using trash for certai
From: |
Chong Yidong |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r100100: Avoid using trash for certain temp files (Bug#6070). |
Date: |
Fri, 30 Apr 2010 22:19:40 -0400 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 100100
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Fri 2010-04-30 22:19:40 -0400
message:
Avoid using trash for certain temp files (Bug#6070).
* 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).
modified:
lisp/ChangeLog
lisp/diff.el
lisp/epg.el
lisp/jka-compr.el
lisp/server.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2010-05-01 01:39:58 +0000
+++ b/lisp/ChangeLog 2010-05-01 02:19:40 +0000
@@ -1,3 +1,16 @@
+2010-05-01 Chong Yidong <address@hidden>
+
+ * 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 <address@hidden>
* bindings.el (mode-line-abbrev-mode, mode-line-auto-fill-mode):
=== modified file 'lisp/diff.el'
--- a/lisp/diff.el 2010-01-13 08:35:10 +0000
+++ b/lisp/diff.el 2010-05-01 02:19:40 +0000
@@ -64,8 +64,9 @@
"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))
=== modified file 'lisp/epg.el'
--- a/lisp/epg.el 2010-01-13 08:35:10 +0000
+++ b/lisp/epg.el 2010-05-01 02:19:40 +0000
@@ -1898,7 +1898,8 @@
;; 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)
@@ -1998,7 +1999,8 @@
(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)
@@ -2095,7 +2097,8 @@
(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)
@@ -2202,7 +2205,8 @@
(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
@@ -2322,7 +2326,8 @@
(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)
=== modified file 'lisp/jka-compr.el'
--- a/lisp/jka-compr.el 2010-01-22 10:23:25 +0000
+++ b/lisp/jka-compr.el 2010-05-01 02:19:40 +0000
@@ -181,7 +181,9 @@
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))
@@ -222,7 +224,8 @@
"")))
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)
@@ -248,9 +251,6 @@
"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))
@@ -337,7 +337,8 @@
(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
@@ -603,7 +604,8 @@
(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))
=== modified file 'lisp/server.el'
--- a/lisp/server.el 2010-01-13 08:35:10 +0000
+++ b/lisp/server.el 2010-05-01 02:19:40 +0000
@@ -344,7 +344,9 @@
;; 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))
@@ -517,7 +519,9 @@
;; 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
@@ -600,7 +604,7 @@
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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r100100: Avoid using trash for certain temp files (Bug#6070).,
Chong Yidong <=