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: Wed, 26 Aug 2020 11:53:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

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

>> --script requires at least one readable form in the script, and that
>> seems OK to me.
>
> A script with no commands should be valid in any language, in my
> opinion.  As a matter of principle, but also for practical reasons:
> You may want to comment by chance all code.  I think this way the
> matter appeared to me.  You may also want to write a template with all
> code commented initially.

Sure, that's true.

I think the way to fix this is to tell the reader that we're reading
from a script file and then do the appropriate thing instead of altering
the reader unconditionally.  That is,

  if (argmatch (argv, argc, "-script", "--script", 3, &junk, &skip_args))
    {
      noninteractive = 1;       /* Set batch mode.  */

in emacs.c should set some global variable, and then readevalloop (I
think?) shouldn't signal an error if it turns out that there are no
forms to read.

-- 
(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]