From mboxrd@z Thu Jan 1 00:00:00 1970 From: rrandresf@gmail.com Subject: Bug: calling org-agenda-list programatically when starting with emacs --daemon [9.1.9 (release_9.1.9-65-g5e4542 @ /usr/share/emacs/26.3/lisp/org/)] Date: Thu, 17 Oct 2019 13:32:11 +0000 Message-ID: <86imon4hwk.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:36737) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iL5t5-0002N8-11 for emacs-orgmode@gnu.org; Thu, 17 Oct 2019 09:32:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iL5t3-0003LV-4M for emacs-orgmode@gnu.org; Thu, 17 Oct 2019 09:32:18 -0400 Received: from mail-ua1-x92e.google.com ([2607:f8b0:4864:20::92e]:37667) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iL5t2-0003L4-W7 for emacs-orgmode@gnu.org; Thu, 17 Oct 2019 09:32:17 -0400 Received: by mail-ua1-x92e.google.com with SMTP id w7so663762uag.4 for ; Thu, 17 Oct 2019 06:32:16 -0700 (PDT) Received: from sacsa.n800.arm.processor.yandex.fm ([190.239.244.220]) by smtp.gmail.com with ESMTPSA id x123sm499053vsb.9.2019.10.17.06.32.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2019 06:32:14 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Remember to cover the basics, that is, what you expected to happen and what in fact did happen. You don't know how to make a good report? See https://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org mailing list. ------------------------------------------------------------------------ Hi. I usually start emacs with --daemon. At the end of my dot emacs I have a funct that calls or-agenda-list on a thread. When I call emacsclient for opening a frame (the first frame) and try to visit a buffer (any buffer). I have an opened buffer *Backtrace* with this content: --8<---------------cut here---------------start------------->8--- Debugger entered--Lisp error: (error "=E2=80=98recenter=E2=80=99ing a windo= w that does not display current-buffer.") recenter(-1) org-agenda-list(nil) funcall-interactively(org-agenda-list nil) call-interactively(org-agenda-list) (if buf (if (setq wind (get-buffer-window buf)) (select-window wind) (if = (called-interactively-p) (progn (select-window (display-buffer buf t t)) (o= rg-fit-window-to-buffer)) (let ((save-selected-window--state (internal--bef= ore-with-selected-window (display-buffer buf)))) (save-current-buffer (unwi= nd-protect (progn (select-window ... ...) (org-fit-window-to-buffer)) (inte= rnal--after-with-selected-window save-selected-window--state)))))) (call-in= teractively (quote org-agenda-list))) (let ((buf (get-buffer "*Org Agenda*")) wind) (if buf (if (setq wind (get= -buffer-window buf)) (select-window wind) (if (called-interactively-p) (pro= gn (select-window (display-buffer buf t t)) (org-fit-window-to-buffer)) (le= t ((save-selected-window--state (internal--before-with-selected-window ...)= )) (save-current-buffer (unwind-protect (progn ... ...) (internal--after-wi= th-selected-window save-selected-window--state)))))) (call-interactively (q= uote org-agenda-list)))) (if (boundp (quote org-agenda-files)) (let ((buf (get-buffer "*Org Agenda= *")) wind) (if buf (if (setq wind (get-buffer-window buf)) (select-window w= ind) (if (called-interactively-p) (progn (select-window (display-buffer buf= t t)) (org-fit-window-to-buffer)) (let ((save-selected-window--state ...))= (save-current-buffer (unwind-protect ... ...))))) (call-interactively (quo= te org-agenda-list))))) emacswikino/jump-to-org-agenda() funcall(emacswikino/jump-to-org-agenda) apply(funcall emacswikino/jump-to-org-agenda) timer-event-handler([t 23977 128 0 86400 funcall (emacswikino/jump-to-org= -agenda) nil 0]) --8<---------------cut here---------------end--------------->8--- Hint: perhaps something like this could help before (recenter -1) on org-agenda-list function: --8<---------------cut here---------------start------------->8--- (when (get-buffer-window org-agenda-buffer-name) (recenter -1)) --8<---------------cut here---------------end--------------->8--- Best Regards Emacs : GNU Emacs 26.3 (build 1, armv7l-unknown-linux-gnueabihf, X toolkit= , Xaw3d scroll bars) Package: Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @ /usr/share/emac= s/26.3/lisp/org/)