From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id +LzDE+BXHl+rfwAA0tVLHw (envelope-from ) for ; Mon, 27 Jul 2020 04:28:16 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id UIprD+BXHl9yVQAAbx9fmQ (envelope-from ) for ; Mon, 27 Jul 2020 04:28:16 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A08DC94004E for ; Mon, 27 Jul 2020 04:28:15 +0000 (UTC) Received: from localhost ([::1]:33236 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jzukG-0007Bu-Vj for larch@yhetil.org; Mon, 27 Jul 2020 00:28:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53278) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jzujw-0007Bo-KE for emacs-orgmode@gnu.org; Mon, 27 Jul 2020 00:27:52 -0400 Received: from mail-vs1-xe32.google.com ([2607:f8b0:4864:20::e32]:33841) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jzuju-0005l9-Sz for emacs-orgmode@gnu.org; Mon, 27 Jul 2020 00:27:52 -0400 Received: by mail-vs1-xe32.google.com with SMTP id 1so2941254vsl.1 for ; Sun, 26 Jul 2020 21:27:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=k1Rwr86SeTBaE3yOSxsOTln9frLKy+vbm5VD7f4QygA=; b=AEsViIbZXuOixqWMEaVOMmnz89vE7+cWlqwsz0NvUsgwsw3w69lKnPtxNAW4fzStr4 8UfSwfypbQMcfUDLIKpsYVae4nLLRPb+oq/J7xthbKpYd39QjioI02B5qd43IlinBZ4D x/mO/bIUz9d8DIhCaXBnLWQOmkPCCOrbtO2bFOVN6V/yvM70bLoNllloBKALONZP/7xR KAVbcrHft7AyK/bj/pT0RqZFs0Uabedz3iDltf74eY/QKHj3wR+zSW8b46qOF5dgugv/ tw6p69WRyFgOL9G/x+WYbgLnlR1WzS+x3z71tMdxqCvYLKilRTzDZup53nsp2/Haxn96 7g1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=k1Rwr86SeTBaE3yOSxsOTln9frLKy+vbm5VD7f4QygA=; b=N7uV3ViLRLP/8z8FFe9RAIE9Y/6sSUKzU4EtMJk4eyjGpFSdGxmMf4QfKXXXCa8gS5 p71hXpEW9NElLfpsMeBbKNvudglbh9MS2Ra12YRKxuhRQdyT027U2X0iWrjOyxnlNLWo QggbQhPrbDMDMOYJOQZHCK5oky6W+LAg8k75HJGk54+Q81R9AwoteIoZR5X2sWHNB1sf ThxE9nh+BIJChqdRfRLTf5yiYWQ9/WiJDZgJVYFgGNLKi4XgSpeeg3CG11SYAt1k75vS vdgcf+X2+SlPHi4C5g4AZxdqKDViwRnTze6to9+e6hQGHY7CRhbeaITR9qklPyYtvd93 x9jg== X-Gm-Message-State: AOAM530wnRo+IAFWVploRPAwpVGn3eZ+RHiACaF95CBNhN3iaC4foobr xypQtSe965Gr+7Dl1sToGc2OEXhNQYkvzCkF/ZfZNo1dJkPM X-Google-Smtp-Source: ABdhPJyJXHRCnrcN9KGxxru6gVEiHh0blIQl2dhep1yyxeIdcgDvCePaCP/Ih1YmCwfciMscNcPzi9JKeAcRo/gVNNc= X-Received: by 2002:a05:6102:53c:: with SMTP id m28mr14736866vsa.118.1595824069369; Sun, 26 Jul 2020 21:27:49 -0700 (PDT) MIME-Version: 1.0 From: "numbchild@gmail.com" Date: Mon, 27 Jul 2020 12:27:23 +0800 Message-ID: Subject: [Discuss] separate (recenter window-line) out of org-agenda-redo To: Org-mode Content-Type: multipart/alternative; boundary="000000000000c762dc05ab64be65" Received-SPF: pass client-ip=2607:f8b0:4864:20::e32; envelope-from=numbchild@gmail.com; helo=mail-vs1-xe32.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.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_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=AEsViIbZ; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: 0.29 X-TUID: kwlGrIx7Il9b --000000000000c762dc05ab64be65 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I try to add an idle timer to auto refresh org agenda views. Here is what I code: #+begin_src emacs-lisp ;;; auto refresh `*Org Agenda*' buffer (defun my/org-agenda-auto-refresh () "Rebuild all agenda views buffers." (org-agenda-redo-all t)) (run-with-idle-timer (* 60 20) t #'my/org-agenda-auto-refresh) #+end_src But I got error: #+begin_example Error running timer =E2=80=98my/org-agenda-auto-refresh=E2=80=99: (error "= =E2=80=98recenter=E2=80=99ing a window that does not display current-buffer.") #+end_example I dive into source code of ~org-agenda-redo~ function. Found this error is caused by ~(recenter window-line)~. I'm thinking what about to separate this code out? So function ~org-agenda-redo~ can be used to non-interactive usage? [stardiviner] GPG key ID: 47C32433 IRC(freeenode): stardiviner Twitter: @numbchild Key fingerprint =3D 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433 Blog: http://stardiviner.github.io/ --000000000000c762dc05ab64be65 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I try to add an idle timer to auto refresh org agenda view= s.

Here is what I code:

#+begin_src emacs-lis= p
;;; auto refresh `*Org Agenda*' buffer
(defun my/org-agenda-aut= o-refresh ()
=C2=A0 "Rebuild all agenda views buffers."
=C2= =A0 (org-agenda-redo-all t))

(run-with-idle-timer (* 60 20) t #'= my/org-agenda-auto-refresh)
#+end_src

But I got error:

#+begin_example
Error running timer =E2=80=98my/org-agenda-= auto-refresh=E2=80=99: (error "=E2=80=98recenter=E2=80=99ing a window = that does not display current-buffer.")
#+end_example

Found this er= ror is caused by ~(recenter window-line)~.

I'm thinking = what about to separate this code out? So function ~org-agenda-redo~ can be = used to non-interactive usage?

[stardiviner]=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <Hack this world!>=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 GPG key ID: 47C32433
IRC(freeenode): stardiviner =C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Twitter:=C2=A0 @numbchild
Key finge= rprint =3D 9BAA 92BC CDDD B9EF 3B36=C2=A0 CB99 B8C4 B8E5 47C3 2433
Blog:= http://stardiv= iner.github.io/
--000000000000c762dc05ab64be65--