summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2010-10-01 19:30:11 -0700
committerGlenn Morris <rgm@gnu.org>2010-10-01 19:30:11 -0700
commit9c524fcb89871b321844de7297a1baee0bde0376 (patch)
tree8be5dae3c4db4410ab1be600696164b7a5bfb020 /lisp
parent08b8ba9fae180c04036b748d5838a5768b013c1d (diff)
downloademacs-9c524fcb89871b321844de7297a1baee0bde0376.tar.gz
Run kill-emacs-hook in batch mode, and on SIGINT in batch mode.
See thread http://lists.gnu.org/archive/html/emacs-devel/2010-09/msg00795.html * src/emacs.c (fatal_error_signal): Also run Fkill_emacs on SIGINT. (main) [!WINDOWSNT]: Handle SIGINT with fatal_error_signal in batch-mode. (Fkill_emacs): Doc fix. Also run the hook in batch mode. (kill-emacs-hook): Doc fix. * lisp/emacs-lisp/bytecomp.el (byte-compile-file): Use kill-emacs-hook to delete tempfile if interrupted during compilation. * doc/lispref/os.texi (Killing Emacs): Hook now runs in batch mode. * etc/NEWS: Mention these changes.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/emacs-lisp/bytecomp.el15
2 files changed, 14 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 235aec2f478..b780f0b0fd6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2010-10-02 Glenn Morris <rgm@gnu.org>
+
+ * emacs-lisp/bytecomp.el (byte-compile-file): Use kill-emacs-hook to
+ delete tempfile if interrupted during compilation.
+
2010-10-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
* net/tls.el (tls-starttls-switches): Give up on using starttls with
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index e6ca7f66546..56661b6afcd 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1698,12 +1698,15 @@ The value is non-nil if there were no errors, nil if errors."
(insert "\n") ; aaah, unix.
(if (file-writable-p target-file)
;; We must disable any code conversion here.
- (let ((coding-system-for-write 'no-conversion)
- ;; Write to a tempfile so that if another Emacs
- ;; process is trying to load target-file (eg in a
- ;; parallel bootstrap), it does not risk getting a
- ;; half-finished file. (Bug#4196)
- (tempfile (make-temp-name target-file)))
+ (let* ((coding-system-for-write 'no-conversion)
+ ;; Write to a tempfile so that if another Emacs
+ ;; process is trying to load target-file (eg in a
+ ;; parallel bootstrap), it does not risk getting a
+ ;; half-finished file. (Bug#4196)
+ (tempfile (make-temp-name target-file))
+ (kill-emacs-hook
+ (cons (lambda () (ignore-errors (delete-file tempfile)))
+ kill-emacs-hook)))
(if (memq system-type '(ms-dos 'windows-nt))
(setq buffer-file-type t))
(write-region (point-min) (point-max) tempfile nil 1)