From: Kevin Rodgers <kevinr@ihs.com>
Subject: Re: M-x compile for different file extensions
Date: Tue, 22 Oct 2002 11:17:21 -0600 [thread overview]
Message-ID: <3DB58821.3030102@ihs.com> (raw)
In-Reply-To: 84fzuzvumh.fsf@crybaby.cs.uni-dortmund.de
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
next prev parent reply other threads:[~2002-10-22 17:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <iPgs9.26259$wU3.2299106@news0.telusplanet.net>
[not found] ` <200210200000.g9K00B5d021923@beta.mvs.co.il>
2002-10-20 16:59 ` M-x compile for different file extensions Richard Stallman
2002-10-20 18:07 ` Ehud Karni
2002-10-20 19:51 ` Stefan Monnier
2002-10-22 3:12 ` Richard Stallman
2002-10-22 6:46 ` Kai Großjohann
2002-10-22 17:17 ` Kevin Rodgers [this message]
2002-10-22 19:03 ` Ehud Karni
2002-10-23 7:11 ` Richard Stallman
2002-10-22 18:23 ` Ehud Karni
2002-10-23 7:10 ` Richard Stallman
2002-10-20 19:52 ` Stefan Monnier
2002-10-20 22:05 ` Ehud Karni
2002-10-22 3:12 ` Richard Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3DB58821.3030102@ihs.com \
--to=kevinr@ihs.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).