From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: test whether init file loaded without error Date: Fri, 11 Apr 2008 12:43:12 -0700 Message-ID: <008501c89c0c$477a7f10$0200a8c0@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1207943055 29339 80.91.229.12 (11 Apr 2008 19:44:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Apr 2008 19:44:15 +0000 (UTC) To: Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 11 21:44:48 2008 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.50) id 1JkPB1-0002sV-EQ for ged-emacs-devel@m.gmane.org; Fri, 11 Apr 2008 21:44:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JkPAN-00030v-PB for ged-emacs-devel@m.gmane.org; Fri, 11 Apr 2008 15:44:07 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JkPAK-00030S-7f for emacs-devel@gnu.org; Fri, 11 Apr 2008 15:44:04 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JkPAI-0002yp-L3 for emacs-devel@gnu.org; Fri, 11 Apr 2008 15:44:03 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JkPAI-0002yj-Bq for emacs-devel@gnu.org; Fri, 11 Apr 2008 15:44:02 -0400 Original-Received: from agminet01.oracle.com ([141.146.126.228]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JkPAI-0004e2-5G for emacs-devel@gnu.org; Fri, 11 Apr 2008 15:44:02 -0400 Original-Received: from agmgw1.us.oracle.com (agmgw1.us.oracle.com [152.68.180.212]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id m3BJhx8A007795 for ; Fri, 11 Apr 2008 14:43:59 -0500 Original-Received: from acsmt351.oracle.com (acsmt351.oracle.com [141.146.40.151]) by agmgw1.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id m3A3Vxa7006185 for ; Fri, 11 Apr 2008 13:43:59 -0600 Original-Received: from inet-141-146-46-1.oracle.com by acsmt350.oracle.com with ESMTP id 3647452601207942991; Fri, 11 Apr 2008 12:43:11 -0700 Original-Received: from dradamslap1 (/141.144.88.79) by bhmail.oracle.com (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 11 Apr 2008 12:43:11 -0700 X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 Thread-Index: AciLc4N6SlbwWQk8RO2K/0rOn4mcpwHHvzNQAl5r9AA= X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 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:94994 Archived-At: Resending - ---- From: Drew Adams Sent: Friday, March 21, 2008 9:49 AM Is there an easy way for Lisp code to test whether a user's init file was loaded without error? I imagine that it could try to use `after-init-hook' in some way (not sure how, though), but is there some straightforward way to test this? For example: A user's init file might use code that sets up `kill-emacs-hook' to save some custom variable. But it might be inappropriate to do that if the init file was not loaded successfully. The init file might, for example, define `custom-file' at the end, and if an error were raised during load, before the `custom-file' definition, then exiting Emacs would cause `kill-emacs-hook' to write the customization (incorrectly) to the init file instead of the `custom-file'.