[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Cleanup of byte-compiled files missing?
From: |
Glenn Morris |
Subject: |
Re: Cleanup of byte-compiled files missing? |
Date: |
Tue, 21 Sep 2010 21:33:47 -0400 |
User-agent: |
Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) |
Here's a patch that seems to work, but I do not know if it is the
right thing to do. As well as running kill-emacs-hook in batch mode,
it is necessary to trap SIGINT.
Maybe it would be better to write the tempfiles to temporary-file-directory?
Still, if you interrupt make a lot, at least the current behaviour
must be better than the old, which would have left you wih
half-written .elc files.
=== modified file 'lisp/emacs-lisp/bytecomp.el'
*** lisp/emacs-lisp/bytecomp.el 2010-09-17 14:31:06 +0000
--- lisp/emacs-lisp/bytecomp.el 2010-09-20 22:44:37 +0000
***************
*** 1698,1709 ****
(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)))
(if (memq system-type '(ms-dos 'windows-nt))
(setq buffer-file-type t))
(write-region (point-min) (point-max) tempfile nil 1)
--- 1698,1712 ----
(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))
! (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)
=== modified file 'src/emacs.c'
*** src/emacs.c 2010-09-21 11:13:36 +0000
--- src/emacs.c 2010-09-21 20:31:42 +0000
***************
*** 374,380 ****
{
fatal_error_in_progress = 1;
! if (sig == SIGTERM || sig == SIGHUP)
Fkill_emacs (make_number (sig));
shut_down_emacs (sig, 0, Qnil);
--- 374,380 ----
{
fatal_error_in_progress = 1;
! if (sig == SIGTERM || sig == SIGHUP || sig == SIGINT)
Fkill_emacs (make_number (sig));
shut_down_emacs (sig, 0, Qnil);
***************
*** 1236,1241 ****
--- 1236,1242 ----
#ifdef SIGSYS
signal (SIGSYS, fatal_error_signal);
#endif
+ if ( noninteractive ) signal (SIGINT, fatal_error_signal);
signal (SIGTERM, fatal_error_signal);
#ifdef SIGXCPU
signal (SIGXCPU, fatal_error_signal);
***************
*** 1992,1998 ****
if (feof (stdin))
arg = Qt;
! if (!NILP (Vrun_hooks) && !noninteractive)
call1 (Vrun_hooks, intern ("kill-emacs-hook"));
UNGCPRO;
--- 1993,1999 ----
if (feof (stdin))
arg = Qt;
! if (!NILP (Vrun_hooks))
call1 (Vrun_hooks, intern ("kill-emacs-hook"));
UNGCPRO;
***************
*** 2413,2419 ****
expect to be able to interact with the user. To ask for confirmation,
see `kill-emacs-query-functions' instead.
! The hook is not run in batch mode, i.e., if `noninteractive' is non-nil. */);
Vkill_emacs_hook = Qnil;
DEFVAR_INT ("emacs-priority", &emacs_priority,
--- 2414,2421 ----
expect to be able to interact with the user. To ask for confirmation,
see `kill-emacs-query-functions' instead.
! Before Emacs 24.1, the hook was not run in batch mode, i.e., if
! `noninteractive' was non-nil. */);
Vkill_emacs_hook = Qnil;
DEFVAR_INT ("emacs-priority", &emacs_priority,