GNU bug report logs -
#29451
emacs should export $buffer_file_name
Previous Next
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
(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.)
This bug report was last modified 5 years and 229 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.