From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Juanma Barranquero" Newsgroups: gmane.emacs.devel Subject: Re: user-init-file source vs. compiled Date: Fri, 2 Feb 2007 17:03:35 +0100 Message-ID: References: <87abzxve6v.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1170432243 15212 80.91.229.12 (2 Feb 2007 16:04:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 2 Feb 2007 16:04:03 +0000 (UTC) Cc: Chong Yidong , Emacs Devel To: "Stefan Monnier" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 02 17:03:54 2007 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 1HD0tF-0001hV-QN for ged-emacs-devel@m.gmane.org; Fri, 02 Feb 2007 17:03:54 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HD0tF-00078x-Bv for ged-emacs-devel@m.gmane.org; Fri, 02 Feb 2007 11:03:53 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HD0t2-00078i-PW for emacs-devel@gnu.org; Fri, 02 Feb 2007 11:03:40 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HD0sz-00078T-8l for emacs-devel@gnu.org; Fri, 02 Feb 2007 11:03:39 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HD0sz-00078Q-41 for emacs-devel@gnu.org; Fri, 02 Feb 2007 11:03:37 -0500 Original-Received: from an-out-0708.google.com ([209.85.132.246]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HD0sy-0006kj-I8 for emacs-devel@gnu.org; Fri, 02 Feb 2007 11:03:36 -0500 Original-Received: by an-out-0708.google.com with SMTP id b8so556967ana for ; Fri, 02 Feb 2007 08:03:35 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=KsQKVwWa/10Xbdt5CYxJ10Hp40D3WOqYdI4lRwk2P+Y0PTZj6tpY9yqjK6Levq7FMcuHscGsCvnb79rvz8vzCag9HpokKboT1+0LkcI8kZNiyYrGokaoea/vb18OiYWuzX6DL1b28DE5lBItDSLv+I2ktTPS9MoJ9rxf+Mc5ms4= Original-Received: by 10.115.77.1 with SMTP id e1mr302025wal.1170432215226; Fri, 02 Feb 2007 08:03:35 -0800 (PST) Original-Received: by 10.115.93.4 with HTTP; Fri, 2 Feb 2007 08:03:35 -0800 (PST) In-Reply-To: Content-Disposition: inline X-detected-kernel: 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:65774 Archived-At: On 2/2/07, Stefan Monnier wrote: > 10% smaller will result in a non-measurably faster load, and will still take > 90% more disk space. So what's the advantage again? The wonderful, perhaps subjective feeling that it is loading faster :) > I don't want to make it impossible to byte-compile your .emacs. If that's > really what you want, go for it. I've been using Emacs for nine years and I just started to byte-compile my .emacs a week ago, so it's not a matter of me "really wanting". This thread was about a variable's description being inaccurate (fortunately it is now fixed). > I'm just saying that we should discourage > people from doing that, because too many users think "oh Emacs takes a long > time to start, I bet if I byte-compile it it'll start faster", but it turns > out it's not faster and next time they forget to re-compile their .emacs > they get bitten. I've added this to my site-start.el: (catch 'init-file (dolist (source-file '("~/.emacs.el" "~/.emacs." "~/_emacs.el" "~/_emacs" "~/.emacs.d/init.el")) (when (file-exists-p source-file) (require 'bytecomp) (unless (fboundp 'time-less-p) (require 'time-date)) (let ((byte-file (byte-compile-dest-file source-file))) (when (and (file-exists-p byte-file) (time-less-p (nth 5 (file-attributes byte-file)) (nth 5 (file-attributes source-file)))) (unless (byte-compile-file source-file) (setq init-file-user nil)))) (throw 'init-file t)))) which recompiles my .emacs.el if needed (the compilation log is quite visible, so I don't miss that something happened), with the added benefit that .emacs(.elc?)? is not loaded if the compilation fails. > It's not the most common problem on gnu.emacs.help, but > it's sufficiently common that I think the potential very minor advantage(s) > is just not worth it. By all means, if you think users should not compile their .emacs unless they know what they're doing, just add a prominent notice to the relevant docs. You're talking about what should we recommend; I was just talking about not misleading people, given the fact that bytecompiling .emacs is *allowed*. I have no opinion on whether we should en- or discourage bytecompiling the init file. > OTOH I'm in favor of adding some kind of hack so that the .emacs file > automatically goes through the byte-compiler's sanity checks when you save > it (so they user might can warnings about using obsolete > variables/functions). That's a really nice idea. /L/e/k/t/u