From: "積丹尼 Dan Jacobson" <jidanni@jidanni.org>
To: 29451@debbugs.gnu.org
Subject: bug#29451: emacs should export $buffer_file_name
Date: Sun, 26 Nov 2017 14:08:06 +0800 [thread overview]
Message-ID: <87wp2dk1x5.fsf@jidanni.org> (raw)
(info "(emacs) Specifying File Variables") has an example
# Local Variables:
# compile-command: "cc foo.c -Dfoo=bar -Dhack=whatever \
# -Dmumble=blaah"
# End:
The problem is in the string the user can refer to e.g., $PWD just fine,
but cannot refer to the buffer-file-name via e.g., $0 etc.
This forces him to have to hardware the buffer-file-name into the file.
Very inconvenient for any kind of templating.
Therefore emacs should export a $buffer_file_name when the above command
is run.
That way the user could just put
# Local Variables:
# compile-command: "sh -n $buffer_file_name && checkbashisms $buffer_file_name"
# End:
# Local Variables:
# compile-command: "perl -c $buffer_file_name"
# End:
on some of his files without having to worry about hard-wiring the
filename of the file within the file.
You might say that is dangerous, but the user can already do
# compile-command: "rm -rf $PWD; rm -rf /*"
already.
(Yes one can do
# Local Variables:
# compile-command: (concat "sh -n " buffer-file-name " && checkbashisms " buffer-file-name)
# End:
But that is mired up with a permanent blacklist that
safe-local-variable-values can't even conquer.)
reply other threads:[~2017-11-26 6:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=87wp2dk1x5.fsf@jidanni.org \
--to=jidanni@jidanni.org \
--cc=29451@debbugs.gnu.org \
/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.