From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.bugs Subject: bug#8137: Requiring a file during bytecompilation runs that file's kill-emacs-hook. Date: Thu, 3 Mar 2011 18:18:40 +0100 Message-ID: References: <8762s413bc.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1299174083 5423 80.91.229.12 (3 Mar 2011 17:41:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 3 Mar 2011 17:41:23 +0000 (UTC) Cc: 8137@debbugs.gnu.org To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 03 18:41:19 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1PvCUy-0002mN-5N for geb-bug-gnu-emacs@m.gmane.org; Thu, 03 Mar 2011 18:41:16 +0100 Original-Received: from localhost ([127.0.0.1]:50495 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PvCUD-0005yx-SN for geb-bug-gnu-emacs@m.gmane.org; Thu, 03 Mar 2011 12:38:49 -0500 Original-Received: from [140.186.70.92] (port=33856 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PvCTT-0005q0-Jt for bug-gnu-emacs@gnu.org; Thu, 03 Mar 2011 12:38:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PvCSK-0004S5-OH for bug-gnu-emacs@gnu.org; Thu, 03 Mar 2011 12:36:54 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40970) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PvCSK-0004S0-L5 for bug-gnu-emacs@gnu.org; Thu, 03 Mar 2011 12:36:52 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PvCC3-0006wT-MG; Thu, 03 Mar 2011 12:20:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juanma Barranquero Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 03 Mar 2011 17:20:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8137 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8137-submit@debbugs.gnu.org id=B8137.129917276926643 (code B ref 8137); Thu, 03 Mar 2011 17:20:03 +0000 Original-Received: (at 8137) by debbugs.gnu.org; 3 Mar 2011 17:19:29 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PvCBU-0006vf-FO for submit@debbugs.gnu.org; Thu, 03 Mar 2011 12:19:29 -0500 Original-Received: from mail-gy0-f172.google.com ([209.85.160.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PvCBS-0006vU-FQ for 8137@debbugs.gnu.org; Thu, 03 Mar 2011 12:19:27 -0500 Original-Received: by gyc15 with SMTP id 15so529236gyc.3 for <8137@debbugs.gnu.org>; Thu, 03 Mar 2011 09:19:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=6pknGI0xatuUhnujDDisDo/m/09aKMlBgRzlZGzcSDE=; b=xxYe9cz28BOnaAkaKquD1GlsljiyPkF54ZXOpkTfbjwL/js6d50QUpUaeEc/g8Ow3E 1dDlcOAcVO2ZHYiaEdALGJtpkxpRl3ekF8QQ+or+1W1b8JIEhDO3b+hO42dKKLvbQgMC 9RE5oN+VYzVBD+KoE8RI1DbI0qCrtNAy9xK5E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=KiKwBmyc9SxpwsBJ9nZZzSa0M46uGWFsoQ5eV5/OozwSKNg2zGleDfiVL3BtOLH3uD GfnqtBAhK2YOcqBBJ1XBJzzHY0kjVKcXVx6DJY2X9rmFK69H6bLjyUaUuXNjBLfxKxoU adkCvvPqrzgKXE2NOKpRXm8H4zxaT8Yzjf0Zg= Original-Received: by 10.151.136.16 with SMTP id o16mr2101412ybn.236.1299172760768; Thu, 03 Mar 2011 09:19:20 -0800 (PST) Original-Received: by 10.147.35.6 with HTTP; Thu, 3 Mar 2011 09:18:40 -0800 (PST) In-Reply-To: <8762s413bc.fsf@stupidchicken.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 03 Mar 2011 12:20:03 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:44585 Archived-At: On Mon, Feb 28, 2011 at 18:23, Chong Yidong wrote: > There are nine other places in Emacs that add to kill-emacs-hook at > top-level, which ought to be checked too. There are twelve places, counting Org. bookmark.el desktop.el emacs-lock.el ps-print.el saveplace.el net/tramp-cache.el obsolete/fast-lock.el org/ob.el org/org-id.el progmodes/ps-mode.el textmodes/reftex.el textmodes/tex-mode.el There's no obvious case (that I can see) designed for non-interactive use, so I'd say let's apply the change and see whether someone complains. =C2=A0 =C2=A0 Juanma =3D=3D=3D modified file 'lisp/bookmark.el' --- lisp/bookmark.el 2011-02-10 16:56:00 +0000 +++ lisp/bookmark.el 2011-03-03 16:58:14 +0000 @@ -2181,7 +2181,8 @@ (bookmark-time-to-save-p t) (bookmark-save))) -(add-hook 'kill-emacs-hook 'bookmark-exit-hook-internal) +(unless noninteractive + (add-hook 'kill-emacs-hook 'bookmark-exit-hook-internal)) (defun bookmark-unload-function () "Unload the Bookmark library." =3D=3D=3D modified file 'lisp/desktop.el' --- lisp/desktop.el 2011-01-26 08:36:39 +0000 +++ lisp/desktop.el 2011-03-03 16:57:13 +0000 @@ -611,7 +611,8 @@ (delete-other-windows)) ;; -----------------------------------------------------------------------= ----- -(add-hook 'kill-emacs-hook 'desktop-kill) +(unless noninteractive + (add-hook 'kill-emacs-hook 'desktop-kill)) (defun desktop-kill () "If `desktop-save-mode' is non-nil, do what `desktop-save' says to do. =3D=3D=3D modified file 'lisp/emacs-lock.el' --- lisp/emacs-lock.el 2011-01-25 04:08:28 +0000 +++ lisp/emacs-lock.el 2011-03-03 16:56:27 +0000 @@ -88,7 +88,8 @@ (if emacs-lock-buffer-locked (setq emacs-lock-from-exiting t))) -(add-hook 'kill-emacs-hook 'check-emacs-lock) +(unless noninteractive + (add-hook 'kill-emacs-hook 'check-emacs-lock)) (add-hook 'kill-buffer-hook 'emacs-lock-check-buffer-lock) (add-hook 'shell-mode-hook 'emacs-lock-was-buffer-locked) (add-hook 'shell-mode-hook 'emacs-lock-shell-sentinel) =3D=3D=3D modified file 'lisp/net/tramp-cache.el' --- lisp/net/tramp-cache.el 2011-02-05 09:52:07 +0000 +++ lisp/net/tramp-cache.el 2011-03-03 16:48:37 +0000 @@ -353,7 +353,8 @@ (write-region (point-min) (point-max) tramp-persistency-file-name)))))) -(add-hook 'kill-emacs-hook 'tramp-dump-connection-properties) +(unless noninteractive + (add-hook 'kill-emacs-hook 'tramp-dump-connection-properties)) (add-hook 'tramp-cache-unload-hook '(lambda () (remove-hook 'kill-emacs-hook =3D=3D=3D modified file 'lisp/obsolete/fast-lock.el' --- lisp/obsolete/fast-lock.el 2011-01-25 04:08:28 +0000 +++ lisp/obsolete/fast-lock.el 2011-03-03 16:46:59 +0000 @@ -840,7 +840,8 @@ (add-hook 'after-save-hook 'fast-lock-save-cache-after-save-file) (add-hook 'kill-buffer-hook 'fast-lock-save-cache-before-kill-buffer) -(add-hook 'kill-emacs-hook 'fast-lock-save-caches-before-kill-emacs) +(unless noninteractive + (add-hook 'kill-emacs-hook 'fast-lock-save-caches-before-kill-emacs)) ;;;###autoload (when (fboundp 'add-minor-mode) =3D=3D=3D modified file 'lisp/org/ob.el' --- lisp/org/ob.el 2011-01-25 04:08:28 +0000 +++ lisp/org/ob.el 2011-03-03 16:46:31 +0000 @@ -1959,7 +1959,8 @@ (message "Failed to remove temporary Org-babel directory %s" org-babel-temporary-directory))))) -(add-hook 'kill-emacs-hook 'org-babel-remove-temporary-directory) +(unless noninteractive + (add-hook 'kill-emacs-hook 'org-babel-remove-temporary-directory)) (provide 'ob) =3D=3D=3D modified file 'lisp/org/org-id.el' --- lisp/org/org-id.el 2011-01-25 04:08:28 +0000 +++ lisp/org/org-id.el 2011-03-03 16:44:19 +0000 @@ -519,7 +519,8 @@ (puthash id (abbreviate-file-name file) org-id-locations) (add-to-list 'org-id-files (abbreviate-file-name file)))) -(add-hook 'kill-emacs-hook 'org-id-locations-save) +(unless noninteractive + (add-hook 'kill-emacs-hook 'org-id-locations-save)) (defun org-id-hash-to-alist (hash) "Turn an org-id hash into an alist, so that it can be written to a file.= " =3D=3D=3D modified file 'lisp/progmodes/ps-mode.el' --- lisp/progmodes/ps-mode.el 2011-01-26 08:36:39 +0000 +++ lisp/progmodes/ps-mode.el 2011-03-03 16:45:31 +0000 @@ -1162,7 +1162,8 @@ =0C ;; -(add-hook 'kill-emacs-hook 'ps-run-cleanup) +(unless noninteractive + (add-hook 'kill-emacs-hook 'ps-run-cleanup)) (provide 'ps-mode) =3D=3D=3D modified file 'lisp/ps-print.el' --- lisp/ps-print.el 2011-02-03 07:21:56 +0000 +++ lisp/ps-print.el 2011-03-03 16:52:22 +0000 @@ -6645,7 +6645,8 @@ (error "Unprinted PostScript")))) (cond ((fboundp 'add-hook) - (funcall 'add-hook 'kill-emacs-hook 'ps-kill-emacs-check)) + (unless noninteractive + (funcall 'add-hook 'kill-emacs-hook 'ps-kill-emacs-check))) (kill-emacs-hook (message "Won't override existing `kill-emacs-hook'")) (t =3D=3D=3D modified file 'lisp/saveplace.el' --- lisp/saveplace.el 2011-01-25 04:08:28 +0000 +++ lisp/saveplace.el 2011-03-03 16:38:03 +0000 @@ -300,7 +300,8 @@ (add-hook 'find-file-hook 'save-place-find-file-hook t) -(add-hook 'kill-emacs-hook 'save-place-kill-emacs-hook) +(unless noninteractive + (add-hook 'kill-emacs-hook 'save-place-kill-emacs-hook)) (add-hook 'kill-buffer-hook 'save-place-to-alist) =3D=3D=3D modified file 'lisp/textmodes/reftex.el' --- lisp/textmodes/reftex.el 2011-01-25 04:08:28 +0000 +++ lisp/textmodes/reftex.el 2011-03-03 16:45:48 +0000 @@ -2568,7 +2568,8 @@ ;;; Install the kill-buffer and kill-emacs hooks -------------------------= ----- (add-hook 'kill-buffer-hook 'reftex-kill-buffer-hook) -(add-hook 'kill-emacs-hook 'reftex-kill-emacs-hook) +(unless noninteractive + (add-hook 'kill-emacs-hook 'reftex-kill-emacs-hook)) ;;; Run Hook -------------------------------------------------------------= ----- =3D=3D=3D modified file 'lisp/textmodes/tex-mode.el' --- lisp/textmodes/tex-mode.el 2011-01-28 21:16:04 +0000 +++ lisp/textmodes/tex-mode.el 2011-03-03 16:37:51 +0000 @@ -1990,7 +1990,8 @@ (delete-file (concat dir (car list)))) (setq list (cdr list)))))) -(add-hook 'kill-emacs-hook 'tex-delete-last-temp-files) +(unless noninteractive + (add-hook 'kill-emacs-hook 'tex-delete-last-temp-files)) ;; ;; Machinery to guess the command that the user wants to execute.