all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marcin Borkowski <mbork@mbork.pl>
To: Rodrigo Morales <moralesrodrigo1100@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Instruct emacs --batch to wait for something
Date: Thu, 18 Nov 2021 17:20:44 +0100	[thread overview]
Message-ID: <87lf1la10j.fsf@mbork.pl> (raw)
In-Reply-To: <87czmy91l2.fsf@gmail.com>


On 2021-11-17, at 17:41, Rodrigo Morales <moralesrodrigo1100@gmail.com> wrote:

> I'm trying to use Emacs as a tool for getting the text representation of
> a website. For doing this, I'm using "eww" and I've written the
> following command that I intend to use in the command line.
>
> #+begin_src bash
> emacs \
>   --batch \
>   --eval='(eww "https://www.gnu.org/software/emacs/manual/html_node/emacs/Intro.html")' \
>   --eval='(with-current-buffer "*eww*" (princ (buffer-string)))'
> #+end_src
>
> The problem with this command is that it shows the following instead of
> showing the website.
>
> #+RESULTS:
> #+begin_example
> Loading https://www.gnu.org/software/emacs/manual/html_node/emacs/Intro.html...
> #+end_example
>
> My question is: How can I instruct Emacs to wait for something when the
> =--batch= flag is used?

I don't know, but did you try something blunt like
--eval='(sleep-for 5)'?
Of course, this would be very fragile and far from good practice...
Alternatively, maybe `eww-after-render-hook' would be useful?

Hth,

-- 
Marcin Borkowski
http://mbork.pl



  reply	other threads:[~2021-11-18 16:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-17 16:41 Instruct emacs --batch to wait for something Rodrigo Morales
2021-11-18 16:20 ` Marcin Borkowski [this message]
2021-11-18 19:05   ` Rodrigo Morales

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lf1la10j.fsf@mbork.pl \
    --to=mbork@mbork.pl \
    --cc=help-gnu-emacs@gnu.org \
    --cc=moralesrodrigo1100@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.