From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Tomas Hlavaty Newsgroups: gmane.emacs.devel Subject: Re: eww and bookmarks Date: Sun, 07 Jun 2020 18:36:05 +0200 Message-ID: <87v9k27s0a.fsf@logand.com> References: <87k1163jz5.fsf@gmail.com> <87tv0a5k5b.fsf@web.de> <87mu5ec3pf.fsf@web.de> <87mu5e3ncg.fsf@tcd.ie> <87img2c0rv.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="129385"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , emacs-devel@gnu.org To: Michael Heerdegen , "Basil L. Contovounesios" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jun 07 18:36:48 2020 Return-path: Envelope-to: ged-emacs-devel@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 1jhyHw-000XZo-DA for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Jun 2020 18:36:48 +0200 Original-Received: from localhost ([::1]:60542 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhyHv-0008BK-Ex for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Jun 2020 12:36:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44514) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhyHM-0007lG-S7 for emacs-devel@gnu.org; Sun, 07 Jun 2020 12:36:12 -0400 Original-Received: from logand.com ([37.48.87.44]:47522) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhyHI-0005A3-Rq for emacs-devel@gnu.org; Sun, 07 Jun 2020 12:36:12 -0400 Original-Received: by logand.com (Postfix, from userid 1001) id 6900D1ACD9A; Sun, 7 Jun 2020 18:36:07 +0200 (CEST) X-Mailer: emacs 26.3 (via feedmail 11-beta-1 I) In-Reply-To: <87img2c0rv.fsf@web.de> Received-SPF: pass client-ip=37.48.87.44; envelope-from=tom@logand.com; helo=logand.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/07 12:36:07 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:252017 Archived-At: Michael Heerdegen writes: > "Basil L. Contovounesios" writes: > >> There's eww-after-render-hook. Sample usage: >> https://emacs.stackexchange.com/a/36287/15748 > > Yes, I know about the hook. But just binding it will not be enough > because the binding will be gone when it is consulted. We would have to > add a self-removing function at least to the local binding of the hook. > That's what I would call a hack. eww-after-render-hook does not seem to be useable because it runs in the wrong buffer at the wrong time. I hit the issue when implementing the following use-case: 1) Open login page URL 2) Automatically fill in username and password 3) Automatically submit the login form My workaround something like this: (defun login-fn-delayed () (with-current-buffer "*eww*" (fill-in-username-and-password) (submit-login-form))) (defun login-fn () (interactive) (eww some-url) (run-with-timer "1 sec" nil 'login-fn-delayed)) It would be nice, if there was no need for run-with-timer and no need for (with-current-buffer "*eww*"...).