From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Dan Jacobson Newsgroups: gmane.emacs.bugs Subject: Re: longish Local Variables in Files Date: Fri, 10 Sep 2004 05:19:37 +0800 Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87d60vywba.fsf@jidanni.org> References: <412A5A6B.6000508@yahoo.com> <41337037.5030802@yahoo.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1094769512 8558 80.91.224.253 (9 Sep 2004 22:38:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 9 Sep 2004 22:38:32 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 10 00:38:23 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1C5XYd-00028o-00 for ; Fri, 10 Sep 2004 00:38:23 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C5Xdy-0005qy-HU for geb-bug-gnu-emacs@m.gmane.org; Thu, 09 Sep 2004 18:43:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C5Xdw-0005qc-2H for bug-gnu-emacs@gnu.org; Thu, 09 Sep 2004 18:43:52 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C5Xdt-0005pn-Ty for bug-gnu-emacs@gnu.org; Thu, 09 Sep 2004 18:43:50 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C5Xdt-0005pI-Rt for bug-gnu-emacs@gnu.org; Thu, 09 Sep 2004 18:43:49 -0400 Original-Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1C5XYC-0004xR-K7 for bug-gnu-emacs@gnu.org; Thu, 09 Sep 2004 18:37:56 -0400 Original-Received: from [203.79.224.62] (helo=smtp1.apol.com.tw) by mx20.gnu.org with esmtp (Exim 4.34) id 1C5XXT-0002aU-JA for bug-gnu-emacs@gnu.org; Thu, 09 Sep 2004 18:37:12 -0400 Original-Received: from jidanni1 (TC218-187-81-164.2-7.dynamic.apol.com.tw [218.187.81.164]) by smtp1.apol.com.tw (8.9.3/8.9.3) with ESMTP id GAA1034879 for ; Fri, 10 Sep 2004 06:36:57 +0800 (CST) Original-Received: from jidanni by jidanni1 with local (Exim 4.34) id 1C5WKP-0001U3-HF for bug-gnu-emacs@gnu.org; Fri, 10 Sep 2004 05:19:37 +0800 Original-To: bug-gnu-emacs@gnu.org 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:8982 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:8982 Here's perhaps another example for the Local Variables examples, which you can put on the info Node "Locals", which by the way should be renamed "Local Variables", ;Local Variables: ;compile-command: "emacs -batch -l .emacs -f batch-byte-compile .emacs" ;End: (No I don't know how to use current-buffer instead of hardwiring ".emacs".) Now even the beginner can get into the obsessive-compulsive habit of byte-compiling his .emacs. Wait. Wrap this around your .emacs instead: (let ((el (expand-file-name "~/.emacs")) (elc (expand-file-name "~/.gnus.elc"))) (if (file-newer-than-file-p el elc) (progn (message "%s is not up to date, byte-compiling %s..." el elc) (sit-for 1) (byte-compile-file el) (load elc nil t t)) ;ELSE: to the end of the file! ;;guts of .emacs go here )) I wanted to not hardwire the file names in but they are needed in during byte-compile apparently, buffer-file-name can't be used.