From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Ehud Karni" Newsgroups: gmane.emacs.devel Subject: Re: M-x compile for different file extensions Date: Tue, 22 Oct 2002 21:03:48 +0200 Organization: Mivtach-Simon Insurance agencies Sender: emacs-devel-admin@gnu.org Message-ID: <200210221903.g9MJ3mQw026787@beta.mvs.co.il> References: <200210200000.g9K00B5d021923@beta.mvs.co.il> <200210201807.g9KI7H02011888@beta.mvs.co.il> <84fzuzvumh.fsf@crybaby.cs.uni-dortmund.de> <3DB58821.3030102@ihs.com> Reply-To: ehud@unix.mvs.co.il NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-8 Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1035313517 2672 80.91.224.249 (22 Oct 2002 19:05:17 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 22 Oct 2002 19:05:17 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1844L5-0000gW-00 for ; Tue, 22 Oct 2002 21:05:15 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 1844MP-0008KF-00 for ; Tue, 22 Oct 2002 21:06:38 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 1844JO-0002IN-00; Tue, 22 Oct 2002 15:03:30 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 1844Ii-0001w0-00 for emacs-devel@gnu.org; Tue, 22 Oct 2002 15:02:48 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 1844Ig-0001ut-00 for emacs-devel@gnu.org; Tue, 22 Oct 2002 15:02:48 -0400 Original-Received: from unix.simonwiesel.co.il ([192.114.178.12] helo=unix.mvs.co.il) by monty-python.gnu.org with esmtp (Exim 4.10) id 1844If-0001t1-00 for emacs-devel@gnu.org; Tue, 22 Oct 2002 15:02:46 -0400 Original-Received: from beta.mvs.co.il (beta [10.253.0.3]) by unix.mvs.co.il (8.11.6/8.11.6) with ESMTP id g9MJ2Ih18483; Tue, 22 Oct 2002 21:02:19 +0200 Original-Received: from beta.mvs.co.il (localhost [127.0.0.1]) by beta.mvs.co.il (8.12.5/8.12.5) with ESMTP id g9MJ3oed026793; Tue, 22 Oct 2002 21:03:51 +0200 Original-Received: (from ehud@localhost) by beta.mvs.co.il (8.12.5/8.12.5/Submit) id g9MJ3mQw026787; Tue, 22 Oct 2002 21:03:48 +0200 X-Authentication-Warning: beta.mvs.co.il: ehud set sender to ehud@unix.mvs.co.il using -f Original-To: kevinr@ihs.com In-reply-to: <3DB58821.3030102@ihs.com> (message from Kevin Rodgers on Tue, 22 Oct 2002 11:17:21 -0600) X-Mailer: Emacs 21.2.91.3 rmail (send-msg 1.106) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:8665 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:8665 On Tue, 22 Oct 2002 11:17:21 -0600, Kevin Rodgers wrote: > > > There is one argument in favor of automatically selecting the right > > compile command. Suppose a user has a lot of *.giggle files and they > > want to run "mumblefrotz" on them to produce *.stiffle files. > > Suppose that the *.giggle files are all over the place, not just in > > one directory. Then it might be convenient for these users to select > > the compile-command based on the major mode of the buffer, instead of > > writing makefiles everywhere with basically the same contents. (The > > user might not have the right to edit the global make.rules file.) > > > Yes, and the doc string for compile-command and the Compilation node of > the manual both point the user in toward using a buffer local value for > the variable. Perhaps the documentation just needs to be a little more > explicit for novice users, but I had no trouble figuring out: > > (add-hook 'giggle-mode-hook > (lambda () > (let ((giggle-file (file-name-nondirectory buffer-file-name))) > (set (make-local-variable 'compile-command) > (format "mumblefrotz -o %s.stiggle %s" > (file-name-sans-extension giggle-file) > giggle-file))))) > > But it might be nice if the user could just do something like > > (add-to-list 'auto-compile-command-alist > '("\\.giggle\\'" . "mumblefrotz -o %s.stiggle %s.giggle")) This needs a fair knowledge of emacs lisp (It requires to define major mode). It should be customizable to let lay people use it for their own extensions. The ekcompl.el let the lay user do it interactively (by the `compile-ext-edit' command). Ehud. -- Ehud Karni Tel: +972-3-7966-561 /"\ Mivtach - Simon Fax: +972-3-7966-667 \ / ASCII Ribbon Campaign Insurance agencies (USA) voice mail and X Against HTML Mail http://www.mvs.co.il FAX: 1-815-5509341 / \ mailto:ehud@unix.mvs.co.il Better Safe Than Sorry