From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Yiyi Hu" Newsgroups: gmane.emacs.devel Subject: Re: Can we add a function which is used to returned immediately within an source file for lib? Date: Fri, 12 Sep 2008 02:51:51 +0000 Message-ID: References: <87y71zemnp.fsf@justinbogner.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 1221187925 17799 80.91.229.12 (12 Sep 2008 02:52:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 12 Sep 2008 02:52:05 +0000 (UTC) Cc: emacs-devel@gnu.org To: mail@justinbogner.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 12 04:53:01 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 1KdymK-0001EX-K0 for ged-emacs-devel@m.gmane.org; Fri, 12 Sep 2008 04:53:00 +0200 Original-Received: from localhost ([127.0.0.1]:50188 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KdylK-00082j-2X for ged-emacs-devel@m.gmane.org; Thu, 11 Sep 2008 22:51:58 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KdylF-000812-HC for emacs-devel@gnu.org; Thu, 11 Sep 2008 22:51:53 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KdylF-00080R-4K for emacs-devel@gnu.org; Thu, 11 Sep 2008 22:51:53 -0400 Original-Received: from [199.232.76.173] (port=50416 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KdylE-00080H-Ra for emacs-devel@gnu.org; Thu, 11 Sep 2008 22:51:52 -0400 Original-Received: from yw-out-1718.google.com ([74.125.46.157]:28915) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KdylE-0000UH-Lg for emacs-devel@gnu.org; Thu, 11 Sep 2008 22:51:52 -0400 Original-Received: by yw-out-1718.google.com with SMTP id 9so240328ywk.66 for ; Thu, 11 Sep 2008 19:51:51 -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=NtC1gsJ09zZBdRnFaJ3YFzrSDuRFLROGoX1C4gRBjr4=; b=fbCQvxeX8LCGdf47mP9yLJtx9IyycrBF8l6o6lHv0KsCqM0lEL8IR0PFz2LoPNEdD+ iTPJsmvbfEwpGfNm0tSGHDrGueFETjOmScC3nfJ0WcYQMgfLAM0El3gm1gv4AsqiXP6q GuC+gyinl5VmrPi167NfG3OQVBPb4cN8Cre4Y= 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=tFFtHXC554WsFLrb6elQrDCg1rZS+njzUOFz2Ci6Shc5xGilzUm+tA+JsKXgJLwNju wdcwb7zrkqrja44zm3oxlVuMqEXnw9NQdWnKcre99c92WrrKqPJfSp6yIjTa2ozay54B vPBN2BvhXEiM9C5dJn+Hf+zv6X5DpVMO5hcKQ= Original-Received: by 10.151.45.2 with SMTP id x2mr5223416ybj.76.1221187911503; Thu, 11 Sep 2008 19:51:51 -0700 (PDT) Original-Received: by 10.150.98.15 with HTTP; Thu, 11 Sep 2008 19:51:51 -0700 (PDT) In-Reply-To: Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:103835 Archived-At: The example is, 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. On Fri, Sep 12, 2008 at 2:37 AM, Yiyi Hu wrote: > 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. > > The unless version has this problem. > (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. > > returning while loading source is a good feature to have. > > On Wed, Sep 10, 2008 at 9:06 PM, wrote: >> "Yiyi Hu" writes: >> >>> Can we add a function or extend (return t) to skip loading the rest of >>> source please? >> >> What's wrong with `if'? >> >> -- >> BOFH excuse #77: >> >> Typo in the code >> >> >> >> >