comparison lisp/diff.el @ 108183:b67d7273ec18

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).
author Chong Yidong <cyd@stupidchicken.com>
date Fri, 30 Apr 2010 22:19:40 -0400
parents 1d1d5d9bd884
children 261591829d04
comparison
equal deleted inserted replaced
108182:7aa45e6e5f62 108183:b67d7273ec18
62 62
63 (defun diff-sentinel (code) 63 (defun diff-sentinel (code)
64 "Code run when the diff process exits. 64 "Code run when the diff process exits.
65 CODE is the exit code of the process. It should be 0 only if no diffs 65 CODE is the exit code of the process. It should be 0 only if no diffs
66 were found." 66 were found."
67 (if diff-old-temp-file (delete-file diff-old-temp-file)) 67 (let (delete-by-moving-to-trash)
68 (if diff-new-temp-file (delete-file diff-new-temp-file)) 68 (if diff-old-temp-file (delete-file diff-old-temp-file))
69 (if diff-new-temp-file (delete-file diff-new-temp-file)))
69 (save-excursion 70 (save-excursion
70 (goto-char (point-max)) 71 (goto-char (point-max))
71 (let ((inhibit-read-only t)) 72 (let ((inhibit-read-only t))
72 (insert (format "\nDiff finished%s. %s\n" 73 (insert (format "\nDiff finished%s. %s\n"
73 (cond ((equal 0 code) " (no differences)") 74 (cond ((equal 0 code) " (no differences)")