emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can we add a function which is used to returned immediately within a


From: Yiyi Hu
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

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 <address@hidden> 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 <RET> 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,  <address@hidden> wrote:
>> "Yiyi Hu" <address@hidden> 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
>>
>>
>>
>>
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]