From unknown Tue Jun 17 01:48:44 2025 X-Loop: don@donarmstrong.com Subject: bug#940: Is there a way to quit loading of ~/.emacs please? Reply-To: "Yiyi Hu" , 940@debbugs.gnu.org Resent-From: "Yiyi Hu" Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 09 Sep 2008 07:00:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 940 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.122094302813410 (code B ref -1); Tue, 09 Sep 2008 07:00:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.9 required=4.0 tests=BAYES_00,FOURLA, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 9 Sep 2008 06:50:28 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m896oOgp013308 for ; Mon, 8 Sep 2008 23:50:25 -0700 Received: from mail.gnu.org ([199.232.76.166]:56391 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1Kcx1i-0006gV-6l for emacs-pretest-bug@gnu.org; Tue, 09 Sep 2008 02:48:38 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Kcx3N-0003jQ-4s for emacs-pretest-bug@gnu.org; Tue, 09 Sep 2008 02:50:23 -0400 Received: from mx20.gnu.org ([199.232.41.8]:42339) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kcx3M-0003jE-Kk for emacs-pretest-bug@gnu.org; Tue, 09 Sep 2008 02:50:20 -0400 Received: from mail-gx0-f12.google.com ([209.85.217.12]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kcx3K-0003NP-Hh for emacs-pretest-bug@gnu.org; Tue, 09 Sep 2008 02:50:18 -0400 Received: by gxk5 with SMTP id 5so9428226gxk.18 for ; Mon, 08 Sep 2008 23:50:16 -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:mime-version:content-type:content-transfer-encoding :content-disposition; bh=cNFjcHpV6CkpsPJhdrnfdXOS8+ELfEK7DM8y9c0sRac=; b=LsReYc2cbEE6O31d5NFv0EDE8ZZV4xSqH/7oGRwWZjnrsw++jOI6o6VbWBmMxC9aqH bkjQoirleAs+CD2NWxYRqbnsYkhOpaFsYC+LOqoOvssXSoQ7aA5gFq+L1lw5Drm1hxPf 6P4K3kJl/EisZA6tw2q8dT6Lkr2FIc6rJijFo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=VAMrdln79kL2tFIZAP98g9ozsMeQg3F0qAjd3vzp0fV2MY3ljkRUVRI+aGRV07Pru+ izjqGxuKZAbYu1dXdB1LTB37amMwkKJ+qINVMS5wNzpQhs3h3bBsIs85qKmyOMhKuG/n ULIK5ygNGi4T18HIGge4FXOclMBsCCztIdolQ= Received: by 10.150.12.3 with SMTP id 3mr22892773ybl.14.1220943015854; Mon, 08 Sep 2008 23:50:15 -0700 (PDT) Received: by 10.150.98.15 with HTTP; Mon, 8 Sep 2008 23:50:15 -0700 (PDT) Message-ID: Date: Tue, 9 Sep 2008 14:50:15 +0800 From: "Yiyi Hu" To: emacs-pretest-bug@gnu.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-detected-kernel: by mx20.gnu.org: Linux 2.6 (newer, 2) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) Hi, all. For now, I got a problem on how to do this. Here is the sample ~/.emacs (defun byte-compile-file-if-newer (src) (let ((result (concat src ".elc"))) (when (file-newer-than-file-p src result) (byte-compile-file src) (load-file result)))) (byte-compile-file-if-newer "~/.emacs") (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(auto-compression-mode t) '(column-number-mode t) '(cperl-indent-level 4) '(delete-selection-mode t) '(display-battery-mode t) '(display-time-24hr-format t) '(display-time-day-and-date t) '(display-time-mode t) '(encoded-kbd-mode t) '(gnus-nntp-server "news.readfreenews.net") '(indent-tabs-mode nil) '(inferior-lisp-program "sbcl") '(inhibit-eol-conversion t) '(inhibit-startup-screen t) '(initial-scratch-message nil) '(menu-bar-mode nil) '(mouse-avoidance-mode (quote exile) nil (avoid))) Is there a way to quit the loading after we compile the ~/.emacs and load the ~/.emacs.elc file? Ok, please don't bother talking about It's worthy or not for compiling ~/.emacs, I am talking a feature which *should* be supported by elisp IMHO. Yes, we can have a big condition around the rest of the ~/.emacs, But that's not good practise. And If I do this, It will also confuse things in M-x customize-group. It's a bit like 'if' statements in emacs, 'if' is enough, but 'when' and 'cond' statements is still there for supporting programming more practically. Also, I've ever done considering split ~/.emacs. To me, It's not a good journey. There will be other problem when manage multiple start up file. I've tried add (return) to ~/.emacs, But there will be error as It's not in a defun. So, other possibility to quit the load of lib? Or enhance elisp by adding a new 'keyword' or 'statement' to do this kind of job. I also tried with (signal 'error nil) and (keyboard-quit), This worked when you invoke emacs without any args. But when there is no ~/.emacs.elc file, and you invoke emacs with args, The passing args won't be process by emacs. I am using the newest emacs-cvs BTW. Thanks. From unknown Tue Jun 17 01:48:44 2025 X-Loop: don@donarmstrong.com Subject: bug#940: Is there a way to quit loading of ~/.emacs please? Reply-To: "Juanma Barranquero" , 940@debbugs.gnu.org Resent-From: "Juanma Barranquero" Resent-To: bug-submit-list@lists.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: Received: via spool by 940-submit@emacsbugs.donarmstrong.com id=B940.122096837132012 (code B ref 940); Tue, 09 Sep 2008 14:00:04 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.1 required=4.0 tests=AWL,BAYES_00,GMAIL, HAS_BUG_NUMBER autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 940) by emacsbugs.donarmstrong.com; 9 Sep 2008 13:52:51 +0000 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 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= Received: by 10.100.250.12 with SMTP id x12mr17333699anh.59.1220968363336; Tue, 09 Sep 2008 06:52:43 -0700 (PDT) Received: by 10.100.13.13 with HTTP; Tue, 9 Sep 2008 06:52:43 -0700 (PDT) Message-ID: Date: Tue, 9 Sep 2008 15:52:43 +0200 From: "Juanma Barranquero" To: "Yiyi Hu" , 940@debbugs.gnu.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: 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 From unknown Tue Jun 17 01:48:44 2025 X-Loop: don@donarmstrong.com Subject: bug#940: Is there a way to quit loading of ~/.emacs please? Reply-To: "Lennart Borgman (gmail)" , 940@debbugs.gnu.org Resent-From: "Lennart Borgman (gmail)" Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 09 Sep 2008 14:25: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: Received: via spool by 940-submit@emacsbugs.donarmstrong.com id=B940.12209699849063 (code B ref 940); Tue, 09 Sep 2008 14:25:04 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.4 required=4.0 tests=AWL,BAYES_00,FOURLA, HAS_BUG_NUMBER,RCVD_IN_DNSWL_LOW autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 940) by emacsbugs.donarmstrong.com; 9 Sep 2008 14:19:44 +0000 Received: from ch-smtp02.sth.basefarm.net (ch-smtp02.sth.basefarm.net [80.76.149.213]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m89EJeMf009057 for <940@emacsbugs.donarmstrong.com>; Tue, 9 Sep 2008 07:19:42 -0700 Received: from c83-254-151-87.bredband.comhem.se ([83.254.151.87]:64345 helo=[127.0.0.1]) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1Kd44B-00060F-8S; Tue, 09 Sep 2008 16:19:39 +0200 Message-ID: <48C685F3.60001@gmail.com> Date: Tue, 09 Sep 2008 16:19:31 +0200 From: "Lennart Borgman (gmail)" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Yiyi Hu , 940@debbugs.gnu.org References: In-Reply-To: X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 080908-0, 2008-09-08), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.151.87 X-Scan-Result: No virus found in message 1Kd44B-00060F-8S. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1Kd44B-00060F-8S faef7b187ee2803f2e076b201c19d0c2 Yiyi Hu wrote: > (byte-compile-file-if-newer "~/.emacs") ... > Is there a way to quit the loading after we compile the ~/.emacs and > load the ~/.emacs.elc file? > > Ok, please don't bother talking about It's worthy or not for compiling > ~/.emacs, I am talking a feature which *should* be supported by elisp > IMHO. There are many ways to do similar things and it is a bit hard to understand what you really want. I can't imagine that it is the behaviour you specified that you really want, or? A simple way to do something similar is of course just to split .emacs. From unknown Tue Jun 17 01:48:44 2025 X-Loop: don@donarmstrong.com Subject: bug#940: Is there a way to quit loading of ~/.emacs please? Reply-To: Stefan Monnier , 940@debbugs.gnu.org Resent-From: Stefan Monnier Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 09 Sep 2008 15: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: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.122097195021085 (code B ref -1); Tue, 09 Sep 2008 15:00:04 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-8.8 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 9 Sep 2008 14:52:30 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m89EqQmP021076 for ; Tue, 9 Sep 2008 07:52:28 -0700 Received: from mail.gnu.org ([199.232.76.166]:47500 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1Kd4YC-0007hb-JG for emacs-pretest-bug@gnu.org; Tue, 09 Sep 2008 10:50:40 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Kd4Zq-0008O6-8K for emacs-pretest-bug@gnu.org; Tue, 09 Sep 2008 10:52:25 -0400 Received: from ironport2-out.pppoe.ca ([206.248.154.182]:15196 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kd4Zp-0008Nf-Fb for emacs-pretest-bug@gnu.org; Tue, 09 Sep 2008 10:52:21 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsAEADMqxkhFxIqP/2dsb2JhbACBZbRYgWSBBw X-IronPort-AV: E=Sophos;i="4.32,365,1217822400"; d="scan'208";a="26560186" Received: from 69-196-138-143.dsl.teksavvy.com (HELO pastel.home) ([69.196.138.143]) by ironport2-out.teksavvy.com with ESMTP; 09 Sep 2008 10:52:20 -0400 Received: by pastel.home (Postfix, from userid 20848) id 8737F54279; Tue, 9 Sep 2008 10:52:20 -0400 (EDT) From: Stefan Monnier To: Yiyi Hu Cc: 940@debbugs.gnu.org, emacs-pretest-bug@gnu.org Message-ID: References: Date: Tue, 09 Sep 2008 10:52:20 -0400 In-Reply-To: (Yiyi Hu's message of "Tue, 9 Sep 2008 14:50:15 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-CrossAssassin-Score: 2 > Is there a way to quit the loading after we compile the ~/.emacs and > load the ~/.emacs.elc file? Of course: (defun byte-compile-file-if-newer (src) (let ((result (concat src ".elc"))) (when (file-newer-than-file-p src result) (byte-compile-file src) (load-file result) t))) (unless (byte-compile-file-if-newer "~/.emacs") ... the rest of your .emacs... ) -- Stefan From unknown Tue Jun 17 01:48:44 2025 X-Loop: don@donarmstrong.com Subject: bug#940: Is there a way to quit loading of ~/.emacs please? Reply-To: "Yiyi Hu" , 940@debbugs.gnu.org Resent-From: "Yiyi Hu" Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 09 Sep 2008 18:30: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: Received: via spool by 940-submit@emacsbugs.donarmstrong.com id=B940.122098470530797 (code B ref 940); Tue, 09 Sep 2008 18:30:04 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.5 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 940) by emacsbugs.donarmstrong.com; 9 Sep 2008 18:25:05 +0000 Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.239]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m89IOrvu030644 for <940@emacsbugs.donarmstrong.com>; Tue, 9 Sep 2008 11:24:55 -0700 Received: by rv-out-0506.google.com with SMTP id k40so2010019rvb.1 for <940@emacsbugs.donarmstrong.com>; Tue, 09 Sep 2008 11:24:53 -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:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=z64N+97bEjoRp0MPjUUa7QUe+U+QukNSuMBnw4TGG8k=; b=SCrSJAzfuG1Upy+nJ2ewEz7rFiMncK9JkTTOvbnDXMlBwAksY4kBbhxSydtXIFavqR UMxM+VoLn6aOPUrU66wgxDDjx4+Syb5CSVG9rQS0Y71NTa4QjJTyh44msyaOwRETSrbK 5Yv6hnGN0ltRrKxtITk2wBVOyh/LGnBI/6qo0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=xyZveNdIEbHPkpAJR+R11qd7iLT8IT9lrp09awd0M3yRL68P13NV477I035AKFBDrh PCtRbYYexRdIVArO1Pjy6+851CDyYBVRmhYAvPAcjI7zY35h2Rq6xnq/7vQnlTBIByVV fipHrBLFqtPILrGwEXfO99ezAAtNt3Gf0vUts= Received: by 10.140.192.9 with SMTP id p9mr37985rvf.114.1220984693461; Tue, 09 Sep 2008 11:24:53 -0700 (PDT) Received: by 10.141.145.12 with HTTP; Tue, 9 Sep 2008 11:24:53 -0700 (PDT) Message-ID: Date: Wed, 10 Sep 2008 02:24:53 +0800 From: "Yiyi Hu" To: "Lennart Borgman (gmail)" Cc: 940@debbugs.gnu.org In-Reply-To: <48C685F3.60001@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48C685F3.60001@gmail.com> This is not a bug, Just a feature request for elisp language. Ok, thanks for your replies, I'll explain this is *great* detail. What I want to do is simple: When emacs starts, It checks if ~/.emacs is newer than ~/.emacs.elc, if it does, then it recompiles the ~/.emacs, and load ~/.emacs.elc on the fly. But skip the rest of ~/.emacs, The reason why I want this will be explained. Here the story begins: If I do something like: (if (byte-compile-file-if-newer "~/.emacs") (load-file "~/.emacs.elc")) Here is a situation depends on wether ~/.emacs.elc exists. If ~/.emacs.elc exists and ever being compiled with a line (defalias 'perl-mode 'cperl-mode), and we remove (defalias 'perl-mode 'cperl-mode) in ~/.emacs, then, cperl-mode will still be in effect for the first time we start emacs use the new ~/.emacs, we have to restart emacs again or manually byte-compile the ~/.emacs. The reason which causes this is, the side effect created in old ~/.emacs.elc will still in effect. Why not use 'unless' statement version? (unless (byte-compile-file-if-newer "~/.emacs") remaining lisp code ...) Because, This will confuse M-x customize-* series functions. Eg, when you put (customize-set-variables ....) things within (unless (byte-compile-file-if-newer "~/.emacs") ) When you do M-x customzie-variable again, It will crate another list which is like (customize-set-variables ...) outside of the file level (unless () ...) statement. If you think It's ok, Please check the example above. (customize-set-variables ..) will take effect and last a session. Why not splitting ~/.emacs? I did this, and It's not a happy journey. Eg, when change something, I have to think wether I should put here or there, or within ~/.emacs. At last, I choose using one ~/.emacs, Also, even if we split ~/.emacs, we still need to recompiling ~/.emacs after we do customize-variable. That's why I think the problem still exists. I ever used (signal 'quit nil) to skiping loading the rest of ~/.emacs, It works fine except the time when we invoke emacs with file name args. (signal 'quit nil) will cancel loading of files we specified in args. In fact, This is not a bug, Just a elisp language feature request. Hope if we can have a function named (leave-load t) which we can manually control when to stop loading the lisp source file. How this function is used is as below: (if (byte-compile-file-if-newer "~/.emacs") (load-file "~/.emacs") (leave-load t)) Then, the ~/.emacs.elc will always be populated, and processed. To me, this is almost the _perfect_ version for auto byte-compile and loading for ~/.emacs. :-) And this language feature IMO, is useful for people who want to control the library loading process. If you have any questions, don't hesitate, I've been thinking on how to make ~/.emacs auto re-compiling procedure perfect for 3 days. Thanks for reading. ;-) From unknown Tue Jun 17 01:48:44 2025 X-Loop: don@donarmstrong.com Subject: bug#940: Is there a way to quit loading of ~/.emacs please? Reply-To: "Lennart Borgman (gmail)" , 940@debbugs.gnu.org Resent-From: "Lennart Borgman (gmail)" Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 09 Sep 2008 22:20:02 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 940 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: notabug Received: via spool by 940-submit@emacsbugs.donarmstrong.com id=B940.122099823514055 (code B ref 940); Tue, 09 Sep 2008 22:20:02 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.5 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, RCVD_IN_DNSWL_LOW autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 940) by emacsbugs.donarmstrong.com; 9 Sep 2008 22:10:35 +0000 Received: from ch-smtp01.sth.basefarm.net (ch-smtp01.sth.basefarm.net [80.76.149.212]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m89MAVch014049 for <940@emacsbugs.donarmstrong.com>; Tue, 9 Sep 2008 15:10:33 -0700 Received: from c83-254-151-87.bredband.comhem.se ([83.254.151.87]:60091 helo=[127.0.0.1]) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1KdBPq-0005WJ-6J; Wed, 10 Sep 2008 00:10:31 +0200 Message-ID: <48C6F44D.2050407@gmail.com> Date: Wed, 10 Sep 2008 00:10:21 +0200 From: "Lennart Borgman (gmail)" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Yiyi Hu CC: 940@debbugs.gnu.org References: <48C685F3.60001@gmail.com> In-Reply-To: X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 080908-0, 2008-09-08), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.151.87 X-Scan-Result: No virus found in message 1KdBPq-0005WJ-6J. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1KdBPq-0005WJ-6J 9979e31e6292d4190653389e5b820179 Yiyi Hu wrote: > Why not use 'unless' statement version? > (unless (byte-compile-file-if-newer "~/.emacs") > remaining lisp code ...) > Because, This will confuse M-x customize-* series functions. Just set custom-file to store customizations in another file. > Why not splitting ~/.emacs? > I did this, and It's not a happy journey. Eg, when change something, I > have to think wether I should put here or there, or within ~/.emacs. Not if you just put everything there. But the main question is: Why do you want to compile absolutely everything? I feel there must be some misunderstanding somewhere. How much time to you win? How many times do you start Emacs? I think most users just start Emacs one they boot their computer. From unknown Tue Jun 17 01:48:44 2025 X-Loop: don@donarmstrong.com Subject: bug#940: Is there a way to quit loading of ~/.emacs please? Reply-To: "Yiyi Hu" , 940@debbugs.gnu.org Resent-From: "Yiyi Hu" Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 09 Sep 2008 23:55:05 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 940 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: notabug Received: via spool by 940-submit@emacsbugs.donarmstrong.com id=B940.122100393414594 (code B ref 940); Tue, 09 Sep 2008 23:55:05 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.0 required=4.0 tests=BAYES_00,GMAIL,HAS_BUG_NUMBER autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 940) by emacsbugs.donarmstrong.com; 9 Sep 2008 23:45:34 +0000 Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.29]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m89NjU4r014588 for <940@emacsbugs.donarmstrong.com>; Tue, 9 Sep 2008 16:45:31 -0700 Received: by yx-out-2324.google.com with SMTP id 8so1408785yxg.31 for <940@emacsbugs.donarmstrong.com>; Tue, 09 Sep 2008 16:45:30 -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:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=i2nrt658E0WKp9t3saWlnl33AdxRrCIFoAv9AU65wk4=; b=qTC14u0N0RUm5q+0Afal9PHd+JifH31/p/RdxEJttn0qKhEPtehXCp7LyvlzHacl1f EaP+k13IliLqj9E2M0A/CTaXWo385z9jWKcw+8fbnKybAD8egRRy4GLocL0nl5C0xQ5R Hhw6SGHmOYrdqEHTMq6jtN9azRnxZ4HaivcoU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=SeWyC1a1pSziZ71x71sqIdr8mpJ3hUXPHlJuptkOcGXnqemsmo6iZnUqIIuKaqfpbx l9mSYPxHIPykKaPELBcd+NNj8pIuU8GK5NRbKtZDhtN5ai9gv/fRMmR3hpoV2pWkuvGq K0ua2otaZ1XNIv0Vve671mo578d05KxE4fARU= Received: by 10.150.204.12 with SMTP id b12mr864885ybg.160.1221003930086; Tue, 09 Sep 2008 16:45:30 -0700 (PDT) Received: by 10.150.98.15 with HTTP; Tue, 9 Sep 2008 16:45:30 -0700 (PDT) Message-ID: Date: Wed, 10 Sep 2008 07:45:30 +0800 From: "Yiyi Hu" To: "Lennart Borgman (gmail)" Cc: 940@debbugs.gnu.org In-Reply-To: <48C6F44D.2050407@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48C685F3.60001@gmail.com> <48C6F44D.2050407@gmail.com> The reason I request this feature is just trying to make elisp and emacs more flexible. With this or without this feature won't hurt emacs' perfections in my mind. What I want is, if we can make best get better. Compile ~/.emacs won't take much time, even I do byte-compile-file within emacs, and bind it to a key doesn't spend much. It doesn't hurt either when press this key every time I want to compile ~/.emacs. But this is not the perfect sollution, The perfect sollution should be, let computer do what we want. You still have to specify custom-file within ~/.emacs and split ~/.emacs, don't you? For ~/.emacs, I ever have really big ~/.emacs.d, because of copying every interesting into ~/.emacs.d, and load it within ~/.emacs, As time goes, It grew beyond my control, I can find what I want to change easily. So, I choose to use only one ~/.emacs for better maintainablity, and let ~/.emacs to compile itself on demand. You didn't misunderstand anything, You just don't understand why people sometimes will like to stick in polar direction. :-) On Wed, Sep 10, 2008 at 6:10 AM, Lennart Borgman (gmail) wrote: > Yiyi Hu wrote: >> Why not use 'unless' statement version? >> (unless (byte-compile-file-if-newer "~/.emacs") >> remaining lisp code ...) >> Because, This will confuse M-x customize-* series functions. > > Just set custom-file to store customizations in another file. > >> Why not splitting ~/.emacs? >> I did this, and It's not a happy journey. Eg, when change something, I >> have to think wether I should put here or there, or within ~/.emacs. > > Not if you just put everything there. > > But the main question is: Why do you want to compile absolutely > everything? I feel there must be some misunderstanding somewhere. How > much time to you win? > > How many times do you start Emacs? I think most users just start Emacs > one they boot their computer. > From unknown Tue Jun 17 01:48:44 2025 X-Loop: don@donarmstrong.com Subject: bug#940: Is there a way to quit loading of ~/.emacs please? Reply-To: "Yiyi Hu" , 940@debbugs.gnu.org Resent-From: "Yiyi Hu" Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 10 Sep 2008 08:00:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 940 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: notabug Received: via spool by 940-submit@emacsbugs.donarmstrong.com id=B940.122103323623177 (code B ref 940); Wed, 10 Sep 2008 08:00:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 940) by emacsbugs.donarmstrong.com; 10 Sep 2008 07:53:56 +0000 Received: from rn-out-0910.google.com (rn-out-0910.google.com [64.233.170.185]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8A7rqtl023171 for <940@emacsbugs.donarmstrong.com>; Wed, 10 Sep 2008 00:53:53 -0700 Received: by rn-out-0910.google.com with SMTP id k56so874731rnd.20 for <940@emacsbugs.donarmstrong.com>; Wed, 10 Sep 2008 00:53:52 -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:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=D0BCvatMhkGZvjUYNdDSdB+fSQ2D48WRyS47tr5tHX0=; b=LUulxIrQ8nWpVSyel7HKlJfEABKYDkIPo8taPRTvj4HByNqz15Aqi9miIw4en4e17g kBhO9L/Am+QbZxxn8Xu6NnAqusdWJXy1vu/937Sg6Sd4o4myZOhwHTEH7YXhEXdhy/oO 92Ai1jAsfI58ueZj9j6q+gbknZTuJNLdNKo0I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=GY0EZrHk+Jit/GN+71p2HNOI7xIsBmdOfdPNLONMZfkVkaFCzjHsSovwpqWLml4Wvi M5kl3KndN3z7EHHlpXMpo8QIsGdMdSMuqCm9tfcsRJYOswP2xImDDKmzHkKvHCGhgqBn hVcOTm2RL9fGkEzcVdft9UJa9BmbKQoYpT12c= Received: by 10.150.182.16 with SMTP id e16mr1483973ybf.230.1221033231640; Wed, 10 Sep 2008 00:53:51 -0700 (PDT) Received: by 10.150.98.15 with HTTP; Wed, 10 Sep 2008 00:53:51 -0700 (PDT) Message-ID: Date: Wed, 10 Sep 2008 15:53:51 +0800 From: "Yiyi Hu" To: "Nick Roberts" Cc: 940@debbugs.gnu.org In-Reply-To: <18631.27735.100063.263157@kahikatea.snap.net.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48C685F3.60001@gmail.com> <18631.27735.100063.263157@kahikatea.snap.net.nz> Oh, sorry, I followed emacswiki and it says using M-x report-emacs-bug is enough. I'll write there. thanks. On Wed, Sep 10, 2008 at 2:42 PM, Nick Roberts wrote: > Yiyi Hu writes: > > This is not a bug, Just a feature request for elisp language. > > Ok, thanks for your replies, I'll explain this is *great* detail. > > In that case could you use help-gnu-emacs instead of making a bug report > which creates an unnecaessary audit trail. > > -- > Nick http://www.inet.net.nz/~nickrob > From unknown Tue Jun 17 01:48:44 2025 X-Loop: help-debbugs@gnu.org Subject: bug#940: Is there a way to quit loading of ~/.emacs please? Resent-From: Glenn Morris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 04 Oct 2011 19:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 940 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug To: "Yiyi Hu" Cc: 940@debbugs.gnu.org Received: via spool by 940-submit@debbugs.gnu.org id=B940.13177567791627 (code B ref 940); Tue, 04 Oct 2011 19:33:01 +0000 Received: (at 940) by debbugs.gnu.org; 4 Oct 2011 19:32:59 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RBAjb-0000QA-1n for submit@debbugs.gnu.org; Tue, 04 Oct 2011 15:32:59 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RBAjX-0000Q0-Rs; Tue, 04 Oct 2011 15:32:57 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1RBAi4-0004tP-8u; Tue, 04 Oct 2011 15:31:24 -0400 From: Glenn Morris References: X-Spook: secure pipeline sweep DES SSL Belknap CIA gamma X-Ran: +e|RKB^Po@z(8%c6#Q]/\*<=W%)Y20{dA};(\3k'.w7V0>-+:K6Mck0s|S>\p[}JnmHwz] X-Hue: green X-Attribution: GM Date: Tue, 04 Oct 2011 15:31:24 -0400 In-Reply-To: (Yiyi Hu's message of "Tue, 9 Sep 2008 14:50:15 +0800") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.4 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.4 (------) tags 940 wontfix close 940 stop "Yiyi Hu" wrote: > Is there a way to quit the loading after we compile the ~/.emacs and > load the ~/.emacs.elc file? I understand what you are asking for (it's not just "load ~/.emacs.elc if newer", which is bug#2577), but I don't see a need for such a feature.