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#940: Is there a way to quit loading of ~/.emacs please? Date: Tue, 9 Sep 2008 15:52:43 +0200 Message-ID: References: Reply-To: Juanma Barranquero , 940@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1220969300 23692 80.91.229.12 (9 Sep 2008 14:08:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 9 Sep 2008 14:08:20 +0000 (UTC) To: "Yiyi Hu" , 940@emacsbugs.donarmstrong.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 09 16:09:06 2008 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.50) id 1Kd3tb-0002hI-6m for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Sep 2008 16:08:43 +0200 Original-Received: from localhost ([127.0.0.1]:53676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kd3sa-00046S-So for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Sep 2008 10:07:40 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kd3sX-00046N-HO for bug-gnu-emacs@gnu.org; Tue, 09 Sep 2008 10:07:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kd3sU-000469-Ue for bug-gnu-emacs@gnu.org; Tue, 09 Sep 2008 10:07:37 -0400 Original-Received: from [199.232.76.173] (port=54564 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kd3sU-000465-Ri for bug-gnu-emacs@gnu.org; Tue, 09 Sep 2008 10:07:34 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:57828) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kd3sU-0004vL-DO for bug-gnu-emacs@gnu.org; Tue, 09 Sep 2008 10:07:34 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m89E7W3k005362; Tue, 9 Sep 2008 07:07:32 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m89E04Qa001555; Tue, 9 Sep 2008 07:00:04 -0700 X-Loop: don@donarmstrong.com Resent-From: "Juanma Barranquero" Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 09 Sep 2008 14:00:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 940 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 940-submit@emacsbugs.donarmstrong.com id=B940.122096837132012 (code B ref 940); Tue, 09 Sep 2008 14:00:04 +0000 Original-Received: (at 940) by emacsbugs.donarmstrong.com; 9 Sep 2008 13:52:51 +0000 Original-Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.232]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m89DqhJ6032006 for <940@emacsbugs.donarmstrong.com>; Tue, 9 Sep 2008 06:52:45 -0700 Original-Received: by wr-out-0506.google.com with SMTP id c57so2145524wra.9 for <940@emacsbugs.donarmstrong.com>; Tue, 09 Sep 2008 06:52:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=adFm1g18GqW+YXSB0aVxvhBLTlD1ucvgAEI9ZohP3SQ=; b=QzMRxYPv6/r/s/SKLHE/isDogI3DdvpEHxHnc4oypQlaYxloT4n1B7K3UP80gBrV+K zbp19zCAZUsFSvCdT7LX91tMcJy/P8s8r6SMmVtmzDqsf89mR/IjdgWvezoHxO/ybzkF hHhxQpkJWS+rnxn8Ie3QXev1oQdYKKhikRTfk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=JMHLA2rAr4PdhDvmuPiSoCIZaG8dr2Q/f3OPpRQJdg3CfXUoQ3WkWAB9AOC1kqtQrT 3hIPdCS4jxb6kiDKhfkoQvLxwwamKME9CHXL7ikTzQWB7uAx3y434lWIx8Iu67ncvetv Es39Q/n6DK1V9CMYJrUjHEPNR0sQh3kg16ja4= Original-Received: by 10.100.250.12 with SMTP id x12mr17333699anh.59.1220968363336; Tue, 09 Sep 2008 06:52:43 -0700 (PDT) Original-Received: by 10.100.13.13 with HTTP; Tue, 9 Sep 2008 06:52:43 -0700 (PDT) In-Reply-To: Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Tue, 09 Sep 2008 10:07:37 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list 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:20388 Archived-At: On Tue, Sep 9, 2008 at 08:50, Yiyi Hu wrote: > Is there a way to quit the loading after we compile the ~/.emacs and > load the ~/.emacs.elc file? If you can modify site-start.el, you can use something similar to this code, which compiles the init source file only when the .elc exists and is stale, or compiled with a newer Emacs (which could easily cause trouble). ;; site-start.el ;; (catch 'init-file (dolist (source-file '("~/.emacs.el" "~/.emacs" ;; ~/.emacs.elc "~/_emacs.el" "~/_emacs" ;; ~/_emacs.elc (if on Windows) "~/.emacs.d/init.el")) ;; ~/.emacs.d/init.elc (when (file-exists-p source-file) (require 'bytecomp) (let ((byte-file (byte-compile-dest-file source-file))) (unless (file-exists-p byte-file) (throw 'init-file nil)) (when (or (time-less-p (nth 5 (file-attributes byte-file)) (nth 5 (file-attributes source-file))) (with-temp-buffer (insert-file-contents-literally byte-file nil 0 5) (and (looking-at ";ELC") (> (char-after 5) emacs-major-version)))) (let* ((split-width-threshold nil) ;; 23.1+ (window (display-buffer (get-buffer-create "*Compile-Log*")))) (fit-window-to-buffer window) (set-window-dedicated-p window t) (unwind-protect (or (byte-compile-file source-file) (y-or-n-p-with-timeout (format "Error bytecompiling %s; do you want to load it? " source-file) 10 nil) (setq init-file-user nil)) (fit-window-to-buffer window))))) Juanma