Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

You know you've landed gear-up when it takes full power to taxi.


devel / comp.unix.shell / Re: Start Emacs with a minimal bash and emacs lisp mix script for testing.

SubjectAuthor
* Re: Start Emacs with a minimal bash and emacs lisp mix script for testing.hongy...@gmail.com
`* Re: Start Emacs with a minimal bash and emacs lisp mix script for testing.Javier
 `- Re: Start Emacs with a minimal bash and emacs lisp mix script for testing.hongy...@gmail.com

1
Re: Start Emacs with a minimal bash and emacs lisp mix script for testing.

<7138ff1d-98f7-4ed3-b363-db070beb8075n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4217&group=comp.unix.shell#4217

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:a05:620a:4089:: with SMTP id f9mr25450419qko.441.1628086314859;
Wed, 04 Aug 2021 07:11:54 -0700 (PDT)
X-Received: by 2002:ac8:7a86:: with SMTP id x6mr1340988qtr.284.1628086314655;
Wed, 04 Aug 2021 07:11:54 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Wed, 4 Aug 2021 07:11:54 -0700 (PDT)
In-Reply-To: <yJOdnZmU-OFs5Zf8nZ2dnUU78TnNnZ2d@brightview.co.uk>
Injection-Info: google-groups.googlegroups.com; posting-host=103.138.53.239; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 103.138.53.239
References: <ed03caf8-1f5f-4ca7-ad83-042a9035901bn@googlegroups.com>
<8335rqzbpq.fsf@helmutwaitzmann.news.arcor.de> <f2cbc203-b13f-4dab-801c-e2b7f62564aan@googlegroups.com>
<yJOdnZmU-OFs5Zf8nZ2dnUU78TnNnZ2d@brightview.co.uk>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7138ff1d-98f7-4ed3-b363-db070beb8075n@googlegroups.com>
Subject: Re: Start Emacs with a minimal bash and emacs lisp mix script for testing.
From: hongyi.z...@gmail.com (hongy...@gmail.com)
Injection-Date: Wed, 04 Aug 2021 14:11:54 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: hongy...@gmail.com - Wed, 4 Aug 2021 14:11 UTC

On Wednesday, August 4, 2021 at 7:24:38 PM UTC+8, Javier wrote:
> hongy...@gmail.com <hongy...@gmail.com> wrote:
> >> Please make use of your return key to avoid overly long lines
> >> (maximum of 78 characters) when posting via the google web.
> >
> > What about the long URL? Does this break the URL auto recognition by
> > web browser?
> The long URLS you don't need to break, but please break the text
> pararagraphs at 72 chars (or at maximum 78).
> > Another question: how to do the same job with the `--script' option of
> > Emacs? I've tried with the following command, but failed to start
> > Emacs:
> >
> > :; exec emacs -Q --script $(realpath -e $0) -- "$@"
> >
> >> rather than
> >> :; emacs -Q --load "$(realpath -e $0)" -- "$@"
> >> in that script and see whether that works for you.
> You just use --script it in the shebang line with no bash code
>
> #!/usr/bin/emacs --script

Based on my tries, the only shebang line can't start Emacs, while the following can

#!/usr/local/bin/emacs -Q --script
or
#!/usr/local/bin/emacs -q --script

But they all will load the already existing configurations.

> ; elisp code here
> ; ...

OTOH, I also tried the following method:

------------------- begin ---------------------------
#!/usr/bin/env bash
emacs -Q --load <(tail -n +4 "$0")
exit

;;Bootstrap straight
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 5))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
(straight-use-package 'use-package)
(setq straight-use-package-by-default t)
------------------- end ---------------------------

Though the above method can start Emacs, but I'll see the following info in the *Messages* buffer:

For information about GNU Emacs and the GNU system, type C-h C-a.
eval-buffer: Symbol’s function definition is void: straight-use-package


> But with --script emacs is executed in batch mode and does not enter
> interactive mode as your previous example, so it might not be what you
> are looking for.

Thank you for your explanation.

Re: Start Emacs with a minimal bash and emacs lisp mix script for testing.

<Y9Cdna6DhrKjJ5f8nZ2dnUU78cHNnZ2d@brightview.co.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4218&group=comp.unix.shell#4218

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!border2.nntp.ams1.giganews.com!nntp.giganews.com!buffer2.nntp.ams1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Wed, 04 Aug 2021 11:03:10 -0500
From: inva...@invalid.invalid (Javier)
Subject: Re: Start Emacs with a minimal bash and emacs lisp mix script for testing.
Newsgroups: comp.unix.shell
References: <ed03caf8-1f5f-4ca7-ad83-042a9035901bn@googlegroups.com> <8335rqzbpq.fsf@helmutwaitzmann.news.arcor.de> <f2cbc203-b13f-4dab-801c-e2b7f62564aan@googlegroups.com> <yJOdnZmU-OFs5Zf8nZ2dnUU78TnNnZ2d@brightview.co.uk> <7138ff1d-98f7-4ed3-b363-db070beb8075n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Message-ID: <Y9Cdna6DhrKjJ5f8nZ2dnUU78cHNnZ2d@brightview.co.uk>
Date: Wed, 04 Aug 2021 11:03:10 -0500
Lines: 30
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-FCXI1b5CCleWwEF8v5Y6rJoE6VigtHa2wLnWMuyEi6fTqg8Pu1wE2E4fko7WqZnvLcxzkr+lOrn0xXU!FGK+w3vrJZIYnLpZeBTchANtj0idXAzxO/oeB+3WGvE+dw9WCqS9kyzZPwJWhvM9Wb/cGi+K8kyg!0hnhlAO/3dt+UZ5w2OX2z/zDrk5v
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2320
 by: Javier - Wed, 4 Aug 2021 16:03 UTC

hongy...@gmail.com <hongyi.zhao@gmail.com> wrote:
> On Wednesday, August 4, 2021 at 7:24:38 PM UTC+8, Javier wrote:
>> You just use --script it in the shebang line with no bash code
>>
>> #!/usr/bin/emacs --script
>
> Based on my tries, the only shebang line can't start Emacs

As I told you before '#!/usr/bin/emacs --script' will start emacs in
batch mode. This means that emacs will exectute the elisp code and
exit without asking for anything interactive. You will not see an
emacs window popping up with --script.

> while the following can
>
> #!/usr/local/bin/emacs -Q --script
>
> But they all will load the already existing configurations.

You see an emacs window that loads the existing (~/.emacs I guess)
configuration because neither of the -Q nor --script configurations

You will most likely see a error message in emacs at startup

Unknown option ‘-Q --script’

That's because the shebang line can only send 1 command-line option to
emacs. The shebang line is unable to send two options to emacs (or
any other program for the matter).

Re: Start Emacs with a minimal bash and emacs lisp mix script for testing.

<6b0f9056-d102-42f1-a6c7-a394bacd5142n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4219&group=comp.unix.shell#4219

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:a05:620a:204c:: with SMTP id d12mr2023893qka.417.1628120557837;
Wed, 04 Aug 2021 16:42:37 -0700 (PDT)
X-Received: by 2002:ae9:eb97:: with SMTP id b145mr1983701qkg.111.1628120557665;
Wed, 04 Aug 2021 16:42:37 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Wed, 4 Aug 2021 16:42:37 -0700 (PDT)
In-Reply-To: <Y9Cdna6DhrKjJ5f8nZ2dnUU78cHNnZ2d@brightview.co.uk>
Injection-Info: google-groups.googlegroups.com; posting-host=172.105.229.161; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 172.105.229.161
References: <ed03caf8-1f5f-4ca7-ad83-042a9035901bn@googlegroups.com>
<8335rqzbpq.fsf@helmutwaitzmann.news.arcor.de> <f2cbc203-b13f-4dab-801c-e2b7f62564aan@googlegroups.com>
<yJOdnZmU-OFs5Zf8nZ2dnUU78TnNnZ2d@brightview.co.uk> <7138ff1d-98f7-4ed3-b363-db070beb8075n@googlegroups.com>
<Y9Cdna6DhrKjJ5f8nZ2dnUU78cHNnZ2d@brightview.co.uk>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6b0f9056-d102-42f1-a6c7-a394bacd5142n@googlegroups.com>
Subject: Re: Start Emacs with a minimal bash and emacs lisp mix script for testing.
From: hongyi.z...@gmail.com (hongy...@gmail.com)
Injection-Date: Wed, 04 Aug 2021 23:42:37 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: hongy...@gmail.com - Wed, 4 Aug 2021 23:42 UTC

On Thursday, August 5, 2021 at 12:03:15 AM UTC+8, Javier wrote:
> hongy...@gmail.com <hongy...@gmail.com> wrote:
> > On Wednesday, August 4, 2021 at 7:24:38 PM UTC+8, Javier wrote:
> >> You just use --script it in the shebang line with no bash code
> >>
> >> #!/usr/bin/emacs --script
> >
> > Based on my tries, the only shebang line can't start Emacs
> As I told you before '#!/usr/bin/emacs --script' will start emacs in
> batch mode. This means that emacs will exectute the elisp code and
> exit without asking for anything interactive. You will not see an
> emacs window popping up with --script.
> > while the following can
> >
> > #!/usr/local/bin/emacs -Q --script
> >
> > But they all will load the already existing configurations.
> You see an emacs window that loads the existing (~/.emacs I guess)
> configuration because neither of the -Q nor --script configurations
>
> You will most likely see a error message in emacs at startup
>
> Unknown option ‘-Q --script’

I confirm that the following info is shown in *Messages* buffer:

command-line-1: Unknown option ‘-Q --script’
> That's because the shebang line can only send 1 command-line option to
> emacs. The shebang line is unable to send two options to emacs (or
> any other program for the matter).

Then, what about the following trick, as I've posted:

#!/usr/bin/env bash
emacs -Q --load <(tail -n +4 "$0")
exit

[elisp code comes here]

HY

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor