From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rodrigo Morales Newsgroups: gmane.emacs.help Subject: Re: Instruct emacs --batch to wait for something Date: Thu, 18 Nov 2021 14:05:26 -0500 Message-ID: <87sfvti8sp.fsf@gmail.com> References: <87czmy91l2.fsf@gmail.com> <87lf1la10j.fsf@mbork.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8946"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Marcin Borkowski Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 18 20:08:37 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mnmlw-000292-5w for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 18 Nov 2021 20:08:36 +0100 Original-Received: from localhost ([::1]:52536 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mnmlv-0007cC-7w for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 18 Nov 2021 14:08:35 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:38276) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnmlB-0007c3-R5 for help-gnu-emacs@gnu.org; Thu, 18 Nov 2021 14:07:49 -0500 Original-Received: from [2607:f8b0:4864:20::733] (port=43706 helo=mail-qk1-x733.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mnml8-0004Fo-Lm for help-gnu-emacs@gnu.org; Thu, 18 Nov 2021 14:07:49 -0500 Original-Received: by mail-qk1-x733.google.com with SMTP id 193so7507009qkh.10 for ; Thu, 18 Nov 2021 11:07:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=noKFVQx+itOVORWH3MoUB8+DY5H7HIZzArUkGtMznlc=; b=jVR4atCHzyWzGLrcpaHzs4lfawqI+aF+eMtg0azPYcFIDkHGL73KCTEJGFisb+bTOE 0NROv2og+pOXVUxv82j5e7+/fXoFX1bxfD/nNl9plzdpTbhCvfs6bQit8S8hLXtF0Kde 6XYf/ROmsyL+F30B0VGkuvoDzFAilDEAMhzZq5HJtSzhmBSNt0HSVNk40EzWOXqjab72 F9U9QRpf90RJnv8wfQKoK718NxxEu3zENQcSm9CK/jE1d+VdDgcvX0/41Jy46JE3qsgJ v7P3MlTEZBZtQk8Mo/Mepuiet/yn/LzkgtmGZzqnlgSScA4EgXT54d0kliHHmmNxgSER 9Epg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=noKFVQx+itOVORWH3MoUB8+DY5H7HIZzArUkGtMznlc=; b=2NEVrzeaFRtdgzrpfwo0JaLTWkCe+/EPEwh8aXzi67UPLjJZSXB5UeQY19bvmE1NF5 3SQ5DeuD8Qm1kVrU+MSLJ473cPXTpp8poo4+FIeQcqpFWUYt3aoUU9yotNOhMWQJY2p3 3p0AiMW5i1CjRhI0X+YuHRZc+ty2wFO6Z/ZTpqvSpH68Rx6I0hv5Qw9xyhTqNCYYxbcg 2n2fJHKJhoCiy7dBXu+huSSrt/louyZsA1Rb/mcgPUXOiivz9E/aSDTXaKOxKBIYegO6 GG9FAqQc2+0dj5PAR4N0PcG6VOb1HgnRjJvs265lfYwyi7t5xxrJgaZEMzKzGG4t1+Iw T8mw== X-Gm-Message-State: AOAM5328L4A68R6JL0cCtSk2bjloj4tj25UwwU/6tAoxfJnmPXlNXnME RMmO6jPXwWVOWiyP9ESXPxR/Y6z42UM= X-Google-Smtp-Source: ABdhPJxluOBSwau9mZbU3enZbdwks6IxU+abLTPnTXfwG+xiCJNJWAqhEugMwOI8g5uQRtqJVHL60A== X-Received: by 2002:a05:620a:1929:: with SMTP id bj41mr23858094qkb.34.1637262465171; Thu, 18 Nov 2021 11:07:45 -0800 (PST) Original-Received: from r1 ([181.65.25.152]) by smtp.gmail.com with ESMTPSA id w185sm350350qkd.30.2021.11.18.11.07.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Nov 2021 11:07:44 -0800 (PST) In-Reply-To: <87lf1la10j.fsf@mbork.pl> (Marcin Borkowski's message of "Thu, 18 Nov 2021 17:20:44 +0100") X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::733 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::733; envelope-from=moralesrodrigo1100@gmail.com; helo=mail-qk1-x733.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:134650 Archived-At: Marcin Borkowski writes: > I don't know, but did you try something blunt like > --eval=3D'(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=3D"(setq _ (symbol-function 'kill-emacs))" \ --eval=3D"(fset 'kill-emacs 'ignore)" \ --eval=3D'(eww "https://www.gnu.org/software/emacs/manual/html_node/org/I= ntroduction.html")' \ --eval=3D"(add-hook 'eww-after-render-hook (lambda () (with-current-buffe= r \"*eww*\" (princ (buffer-string))) (funcall _)))" #+end_src #+RESULTS: #+begin_example Next: Document Structure, Previous: Top, Up: Top =20 [Contents][Index] 1 Introduction =E2=80=A2 Summary Brief summary of what Org does.=20=20=20 =E2=80=A2 Installation Installing Org.=20=20=20 =E2=80=A2 Activation How to activate Org for certain buffers.=20=20=20 =E2=80=A2 Feedback Bug reports, ideas, patches, etc.=20=20=20 =E2=80=A2 Conventions Typesetting conventions used in this manual.=20= =20=20 #+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 =E2=80=A2 Summary Brief summary of what Org does.=20=20=20 =E2=80=A2 Installation Installing Org.=20=20=20 =E2=80=A2 Activation How to activate Org for certain buffers.=20=20=20 =E2=80=A2 Feedback Bug reports, ideas, patches, etc.=20=20=20 =E2=80=A2 Conventions Typesetting conventions used in this manual.=20= =20=20 #+END_SRC Do you know what might be causing this? Any help is appreciated.