From 9c524fcb89871b321844de7297a1baee0bde0376 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 1 Oct 2010 19:30:11 -0700 Subject: 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. --- lisp/emacs-lisp/bytecomp.el | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'lisp/emacs-lisp/bytecomp.el') 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) -- cgit v1.2.3 From 986d19df1f2a63d8aa443f2132a6dced3bb9a4a4 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sat, 2 Oct 2010 19:10:41 -0400 Subject: Add minor comment (Bug#7001). --- lisp/emacs-lisp/bytecomp.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lisp/emacs-lisp/bytecomp.el') diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 56661b6afcd..c0dc1764647 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1801,12 +1801,13 @@ With argument ARG, insert value in current buffer after the form." (erase-buffer) ;; (emacs-lisp-mode) (setq case-fold-search nil) - ;; This is a kludge. Some operating systems (OS/2, DOS) need to - ;; write files containing binary information specially. + ;; This is a kludge. Some operating systems (OS/2, DOS) need + ;; to write files containing binary information specially. ;; Under most circumstances, such files will be in binary ;; overwrite mode, so those OS's use that flag to guess how ;; they should write their data. Advise them that .elc files - ;; need to be written carefully. + ;; need to be written carefully. (There's no point running the + ;; mode hook, so don't call `binary-overwrite-mode'.) (setq overwrite-mode 'overwrite-mode-binary)) (displaying-byte-compile-warnings (with-current-buffer bytecomp-inbuffer -- cgit v1.2.3 From 96bcef2ec619f55bf30d929f2da8d920f3c5540d Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 3 Oct 2010 00:31:59 -0400 Subject: Remove obsolete use of binary-overwrite-mode in bytecomp (Bug#7001). * emacs-lisp/bytecomp.el (byte-compile-from-buffer): Remove obsolete use of binary-overwrite-mode (Bug#7001). --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/bytecomp.el | 10 +--------- 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'lisp/emacs-lisp/bytecomp.el') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 23be6ed8c28..076c3ef3fac 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-10-03 Chong Yidong + + * emacs-lisp/bytecomp.el (byte-compile-from-buffer): Remove + obsolete use of binary-overwrite-mode (Bug#7001). + 2010-10-03 Glenn Morris * obsolete/x-menu.el: Remove file, obsolete since 21.1 diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index c0dc1764647..b3ac7b83d79 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1800,15 +1800,7 @@ With argument ARG, insert value in current buffer after the form." (set-buffer-multibyte t) (erase-buffer) ;; (emacs-lisp-mode) - (setq case-fold-search nil) - ;; This is a kludge. Some operating systems (OS/2, DOS) need - ;; to write files containing binary information specially. - ;; Under most circumstances, such files will be in binary - ;; overwrite mode, so those OS's use that flag to guess how - ;; they should write their data. Advise them that .elc files - ;; need to be written carefully. (There's no point running the - ;; mode hook, so don't call `binary-overwrite-mode'.) - (setq overwrite-mode 'overwrite-mode-binary)) + (setq case-fold-search nil)) (displaying-byte-compile-warnings (with-current-buffer bytecomp-inbuffer (and bytecomp-filename -- cgit v1.2.3