From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id B9pkH3vFIl/UGAAA0tVLHw (envelope-from ) for ; Thu, 30 Jul 2020 13:04:59 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id EEn/GnvFIl+nZwAAB5/wlQ (envelope-from ) for ; Thu, 30 Jul 2020 13:04:59 +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 015199403EC for ; Thu, 30 Jul 2020 13:04:59 +0000 (UTC) Received: from localhost ([::1]:42982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k18Ez-0003CY-V9 for larch@yhetil.org; Thu, 30 Jul 2020 09:04:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k18DV-0001N8-S9 for emacs-orgmode@gnu.org; Thu, 30 Jul 2020 09:03:25 -0400 Received: from mail-vs1-xe2b.google.com ([2607:f8b0:4864:20::e2b]:43669) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k18DQ-0002gn-Ad for emacs-orgmode@gnu.org; Thu, 30 Jul 2020 09:03:25 -0400 Received: by mail-vs1-xe2b.google.com with SMTP id j186so13859716vsd.10 for ; Thu, 30 Jul 2020 06:03:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=so7K3foqQzRjGH1pxnmKxNuGki5DSgZiejrCI3Iiw/Y=; b=ubUJkjQzI/yV5ZotuBVAOaXiyEmf+L7owuvBWerTk8gP6XQYYChKVu/QdD9RLr0G81 HjpiCUxJVcrEjh4Of0VS2ajKGm4NOa6IUD0wcQlX10Xmih6hNkT/hPBVm47h7kmYhrX4 7Dgz7vPe/Zg9KaEyeu+CMBrQZZJr3uay2L471SHb6vG068+l52iZv2/8UhtvXfM3bB4h RJ7rZdhgWhX/YhYN6EGI5WdAvIxuUIuFhcuoPq/lTWotK60YweGHwYNu00lZTK6GCnAG zLMOrzmhBKn2AlDUoO//mM2SJHHq0kWHfz7fS5DqiM5yf9bbqzYASnzA7oTQBss4tyc8 z6fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=so7K3foqQzRjGH1pxnmKxNuGki5DSgZiejrCI3Iiw/Y=; b=oQUx7wqR/FjF9zNiOIyWZkggTcJzgprXjWzJDfFiJkTkV0oLaAAYuSHnaPShtjaUKa YOy90FTVXr/xY1ZeCz7QqYDf3vpMGjGIc4kdrsNLivqb4zLsSIehnVqqYwyeeFl5FHQa HLSWTtHoMRisJHEU92k2rXab6K1jCKsyEXF0lMwCaJtJnR3bVcbNQJKF5MCPP6nbsP5Q DPKd8JFiYABCUoDCCNKPWs+aX+P9/33yHYjYynUvOBt4sX5RDleoOz0aTvYVzDvJVLAJ ugQRgu7bokaxHqSkHxMHmoCCi0ztjCCMB9fC+AKO0SBUYcTFr7mX68JDBVTqxGbvnjyO V0Jw== X-Gm-Message-State: AOAM531jilTpDRFhQKwFekqut6y/5kF3oExkm+nFN5TK4+X0S95+/Eqd ybXu4yDzthskFZTtG4uXm5ZGhVqsFCngC6WiGQ== X-Google-Smtp-Source: ABdhPJxdy0QqjuERiGdIxrFn3ElutGF0vOfWLRtNM7JZUcixMX2JnR+rHIGyYJxVNQYeSvJqQ7vOxkm7aMkKUP6sddM= X-Received: by 2002:a67:d184:: with SMTP id w4mr1817602vsi.17.1596114198798; Thu, 30 Jul 2020 06:03:18 -0700 (PDT) MIME-Version: 1.0 References: <87lfj35r1c.fsf@gmail.com> In-Reply-To: <87lfj35r1c.fsf@gmail.com> From: "numbchild@gmail.com" Date: Thu, 30 Jul 2020 21:02:50 +0800 Message-ID: Subject: [SOLVED] Re: [Discuss] separate (recenter window-line) out of org-agenda-redo To: Marco Wahl Content-Type: multipart/alternative; boundary="000000000000d724ce05aba84bbe" Received-SPF: pass client-ip=2607:f8b0:4864:20::e2b; envelope-from=numbchild@gmail.com; helo=mail-vs1-xe2b.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: , Cc: Org-mode 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=ubUJkjQz; 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: VisixRrBZzy9 --000000000000d724ce05aba84bbe Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable This is very useful, thanks Marco. [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/ On Wed, Jul 29, 2020 at 4:21 AM Marco Wahl wrote: > "numbchild@gmail.com" writes: > > > 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: (erro= r "=E2=80=98recenter=E2=80=99ing a > > window that does not display current-buffer.") > > #+end_example > > Coming back to your original issue. Possibly it's enough to just > suppress the error. > > You could change the function to > > --8<---------------cut here---------------start------------->8--- > > (defun my/org-agenda-auto-refresh-1 () > "Rebuild all agenda views buffers." > (ignore-errors (org-agenda-redo-all t))) > > --8<---------------cut here---------------end--------------->8--- > > > HTH, > -- > Marco > --000000000000d724ce05aba84bbe Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
This is very useful, thanks Marco.


[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 fingerprint =3D 9BAA 92BC CDDD B9EF= 3B36=C2=A0 CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/
<= /div>


On Wed, Jul 29, 2020 at 4:21 AM Marco Wahl <<= a href=3D"mailto:marcowahlsoft@gmail.com">marcowahlsoft@gmail.com> w= rote:
"numbchild@gmail.com" <numbch= ild@gmail.com> writes:

> 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 ()
>=C2=A0 =C2=A0"Rebuild all agenda views buffers."
>=C2=A0 =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: (err= or "=E2=80=98recenter=E2=80=99ing a
> window that does not display current-buffer.")
> #+end_example

Coming back to your original issue. Possibly it's enough to just
suppress the error.

You could change the function to

--8<---------------cut here---------------start------------->8---

(defun my/org-agenda-auto-refresh-1 ()
=C2=A0 "Rebuild all agenda views buffers."
=C2=A0 (ignore-errors (org-agenda-redo-all t)))

--8<---------------cut here---------------end--------------->8---


HTH,
--
Marco
--000000000000d724ce05aba84bbe--