[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#4399: simple way to identify top-level --script file
From: |
Lars Ingebrigtsen |
Subject: |
bug#4399: simple way to identify top-level --script file |
Date: |
Mon, 07 Feb 2022 01:54:48 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Tom Tromey <tromey@redhat.com> writes:
> I was hoping for something like the python idiom:
>
> if __name__ == "__main__":
>
> ... this lets a file determine if it was invoked "as the main program".
>
> My specific use was for tests: I want "emacs --script test.el" to run
> the tests, but I want to be able to load the file just to get the defuns
> without running the test suite.
(I'm going through old bug reports that unfortunately weren't resolved
at the time.)
In my opinion, I think it would be too niche to add a special mechanism
for this. You can use --eval '(setq something-to-react-to t)' --script
... if you want to have different things happening in this case.
So I'm closing this bug report.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug#4399: simple way to identify top-level --script file,
Lars Ingebrigtsen <=