From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.devel Subject: Re: M-x compile for different file extensions Date: Tue, 22 Oct 2002 11:17:21 -0600 Sender: emacs-devel-admin@gnu.org Message-ID: <3DB58821.3030102@ihs.com> References: <200210200000.g9K00B5d021923@beta.mvs.co.il> <200210201807.g9KI7H02011888@beta.mvs.co.il> <84fzuzvumh.fsf@crybaby.cs.uni-dortmund.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1035308019 24061 80.91.224.249 (22 Oct 2002 17:33:39 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 22 Oct 2002 17:33:39 +0000 (UTC) Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1842uP-0006Fx-00 for ; Tue, 22 Oct 2002 19:33:37 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 1842vi-0006JL-00 for ; Tue, 22 Oct 2002 19:34:58 +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 1842t2-0000Qy-00; Tue, 22 Oct 2002 13:32:12 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 1842s6-0008DL-00 for emacs-devel@gnu.org; Tue, 22 Oct 2002 13:31:14 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 1842s3-00088u-00 for emacs-devel@gnu.org; Tue, 22 Oct 2002 13:31:13 -0400 Original-Received: from main.gmane.org ([80.91.224.249]) by monty-python.gnu.org with esmtp (Exim 4.10) id 1842s2-00088L-00 for emacs-devel@gnu.org; Tue, 22 Oct 2002 13:31:11 -0400 Original-Received: from root by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1842r1-0005oh-00 for ; Tue, 22 Oct 2002 19:30:07 +0200 Original-To: emacs-devel@gnu.org X-Injected-Via-Gmane: http://gmane.org/ Original-Received: from news by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1842dc-00040W-00 for ; Tue, 22 Oct 2002 19:16:16 +0200 Original-Path: not-for-mail Original-Lines: 33 Original-NNTP-Posting-Host: 170.207.51.80 Original-X-Trace: main.gmane.org 1035306976 15406 170.207.51.80 (22 Oct 2002 17:16:16 GMT) Original-X-Complaints-To: usenet@main.gmane.org Original-NNTP-Posting-Date: Tue, 22 Oct 2002 17:16:16 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us 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:8658 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:8658 Kai Großjohann 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")) -- Kevin