bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#4616: 23.1.50; empty script files


From: Lars Ingebrigtsen
Subject: bug#4616: 23.1.50; empty script files
Date: Tue, 25 Aug 2020 15:58:58 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Markus Rost <rost@math.uni-bielefeld.de> writes:

>> The Emacs Lisp reader always requires at least one sexp in the input.
>> This is independent of the source of the input.
>
> Oh yes.  My patch would violate this.  But the Emacs Lisp "loader"
> doesn't require any input.
>
> I think, somebody without knowledge of Emacs internals will be
> surprised that
>
> ===File ~/x.el==============================================
> #!/home/rost/build/cvs/emacs/src/emacs --script
> ;; (some-valid-elisp-expression)
> ============================================================
>
> yields an "End of file during parsing" error and returns with positive
> exit status.

It's not quite clear to me what the issue here is.

--script requires at least one readable form in the script, and that
seems OK to me.  Is the problem the exit status?

> And I think, somebody executing pure elisp will be surprised that
>
> (read "#!\n(foo)")
>
> does not yield an "Invalid read syntax" error.
>
> It seems that the basic read function has a *general* feature in order
> to get --script and the "#!"-syntax working.

Heh.  That is quite amusing...

But can we change that at this point?  Presumably Emacs has had this
quirk for generations, so perhaps there's some code out there that
relies on the accidental comment-ness of #!...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]