From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.devel Subject: Re: Cleanup of byte-compiled files missing? Date: Tue, 21 Sep 2010 21:33:47 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1285119237 32214 80.91.229.12 (22 Sep 2010 01:33:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 22 Sep 2010 01:33:57 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 22 03:33:55 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OyEDa-0000jQ-J3 for ged-emacs-devel@m.gmane.org; Wed, 22 Sep 2010 03:33:54 +0200 Original-Received: from localhost ([127.0.0.1]:38541 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OyEDZ-0005ga-VA for ged-emacs-devel@m.gmane.org; Tue, 21 Sep 2010 21:33:54 -0400 Original-Received: from [140.186.70.92] (port=59805 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OyEDU-0005eA-Ff for emacs-devel@gnu.org; Tue, 21 Sep 2010 21:33:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OyEDT-0006Zo-Cy for emacs-devel@gnu.org; Tue, 21 Sep 2010 21:33:48 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]:34208) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OyEDT-0006Zi-9j for emacs-devel@gnu.org; Tue, 21 Sep 2010 21:33:47 -0400 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1OyEDT-0001S1-3d; Tue, 21 Sep 2010 21:33:47 -0400 X-Spook: Watergate JPL chameleon man Merlin AMEMB NSA MD2 UOP X-Ran: %B;x@iI!m`$PR=S%-BHuwmMx+&mt;CqGlG&}|@[frtB"|Ljn]mSaZ{:{Om\O4IpXM25Rs% X-Hue: green X-Attribution: GM In-Reply-To: (Glenn Morris's message of "Fri\, 17 Sep 2010 13\:41\:05 -0400") User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:130591 Archived-At: 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,