[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Instruct emacs --batch to wait for something
From: |
Rodrigo Morales |
Subject: |
Re: Instruct emacs --batch to wait for something |
Date: |
Thu, 18 Nov 2021 14:05:26 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Marcin Borkowski <mbork@mbork.pl> writes:
> 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?
Thanks for the help!
I was able to do what I was looking for with this hack (see code block
below), but now I have another problem: Some newlines are misplaced in
the *eww* buffer, for some reason. Please, continue reading.
#+begin_src dash
emacs \
-batch \
--eval="(setq _ (symbol-function 'kill-emacs))" \
--eval="(fset 'kill-emacs 'ignore)" \
--eval='(eww
"https://www.gnu.org/software/emacs/manual/html_node/org/Introduction.html")' \
--eval="(add-hook 'eww-after-render-hook (lambda () (with-current-buffer
\"*eww*\" (princ (buffer-string))) (funcall _)))"
#+end_src
#+RESULTS:
#+begin_example
Next:
Document
Structure,
Previous:
Top,
Up:
Top
[Contents][Index]
1
Introduction
• Summary Brief summary of what Org does.
• Installation Installing Org.
• Activation How to activate Org for certain buffers.
• Feedback Bug reports, ideas, patches, etc.
• Conventions Typesetting conventions used in this manual.
#+end_example
I can confirm that newlines are misplaced because when I open the same
URL in a running Emacs instance (the one that I'm also using to write
this response), the following is shown in the *eww* buffer when visiting
the same URL
(https://www.gnu.org/software/emacs/manual/html_node/org/Introduction.html).
#+BEGIN_SRC text
Next: Document Structure, Previous: Top, Up: Top [Contents][Index]
1 Introduction
• Summary Brief summary of what Org does.
• Installation Installing Org.
• Activation How to activate Org for certain buffers.
• Feedback Bug reports, ideas, patches, etc.
• Conventions Typesetting conventions used in this manual.
#+END_SRC
Do you know what might be causing this? Any help is appreciated.