From: Adalbert Perbandt <adalbert.perbandt@infineon.com>
Subject: Major Mode Determination from File Contents
Date: 23 Apr 2003 15:55:40 +0200 [thread overview]
Message-ID: <ypfq7k9lqpwj.fsf@oak.muc.infineon.com> (raw)
Hi there,
I have a serious problem with automatically setting a specific mode
for files depending on their contents.
Due to some good reason we had to insert this header into our Perl
script files:
#!/bin/sh
exec $IW_PERL -x -w -S $0 ${1+"$@"}
Now I no longer could place -*- cperl -*- into the first line because
this would confuse the execve system call which executes some of these
files.
Until now I know these ways to specify the mode for a file
automagically:
1. By extension -- Doesn't fit here because the perl scripts do not
have any extension.
2. By placing the above given line in the first nonempty line of the
file -- No longer possible.
3. Local Variable list at the end of the file -- Would work but looks
somewhat ugly.
4. Setup of interpreter-mode-alist Variable -- Doesn't work because
only the first line is processed by this mechanism.
Is their any other way to put the "-*- cperl -*-" line near the top of
the file and get it processed by some mode determination mechanism?
Any ideas would be welcome.
Thanks,
Adalbert Perbandt.
next reply other threads:[~2003-04-23 13:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-23 13:55 Adalbert Perbandt [this message]
2003-04-23 14:48 ` Major Mode Determination from File Contents Glenn Morris
2003-04-25 8:04 ` Adalbert Perbandt
2003-04-25 9:34 ` Glenn Morris
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ypfq7k9lqpwj.fsf@oak.muc.infineon.com \
--to=adalbert.perbandt@infineon.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.