GNU bug report logs - #29451
emacs should export $buffer_file_name

Previous Next

Package: emacs;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Sun, 26 Nov 2017 06:39:01 UTC

Severity: wishlist

Merged with 6615, 34130, 35373

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 29451 in the body.
You can then email your comments to 29451 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#29451; Package emacs. (Sun, 26 Nov 2017 06:39:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 26 Nov 2017 06:39:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: bug-gnu-emacs <at> gnu.org
Subject: emacs should export $buffer_file_name
Date: Sun, 26 Nov 2017 14:08:06 +0800
(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.)




Merged 6615 29451. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 26 Nov 2017 18:00:02 GMT) Full text and rfc822 format available.

Merged 6615 29451 34130. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 19 Jan 2019 11:23:02 GMT) Full text and rfc822 format available.

Merged 6615 29451 34130 35373. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 22 Apr 2019 02:09:01 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 6615 <at> debbugs.gnu.org and jidanni <at> jidanni.org Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 01 Oct 2019 19:29:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 02 Nov 2019 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 149 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.