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 gN8FEz6Gs192MQAA0tVLHw (envelope-from ) for ; Tue, 17 Nov 2020 08:13:50 +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 aJ7qDj6Gs18zUQAAbx9fmQ (envelope-from ) for ; Tue, 17 Nov 2020 08:13:50 +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 BA0CA9402A2 for ; Tue, 17 Nov 2020 08:13:49 +0000 (UTC) Received: from localhost ([::1]:33236 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kew7Y-0007Sr-OW for larch@yhetil.org; Tue, 17 Nov 2020 03:13:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kew6n-00074i-Le for emacs-orgmode@gnu.org; Tue, 17 Nov 2020 03:13:01 -0500 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]:35721) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kew6l-00082Y-OQ for emacs-orgmode@gnu.org; Tue, 17 Nov 2020 03:13:01 -0500 Received: by mail-lf1-x136.google.com with SMTP id a9so27880429lfh.2 for ; Tue, 17 Nov 2020 00:12:59 -0800 (PST) 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=lSOWJ8QX42CRJETnx4T+U2VTIPBCCOKQmCxThlXpuS4=; b=MmpvsqNJ8LZaosphqMDp7G7YRuXS/xSU+C2shKQPA9uUqWen0LiEocLdFW+R3sUJx+ w1ycV34DwWMli+uXgTzwD5hBkr+CbAfX3rb2GUSmG+AtUdBsQ2QdNeXT2cGBd7wEy7Vh J+lyjczuLj6ECJZcgz75ipM5GxR2548P2niLKNJMql+Jex0WC9d8Ne6nHCbhlgqg64it TycOK2J4doXUdyExBVGBgn+/eStFZpCf57GBELCV877NLgFtux99lAHU9zWXNm/XSQhD ovBpgKGKEe/C0LEIlwNAn66GQ4UXuEAeoPFdqEh/Q0PoZxCkUbGnSJwYi31m0f09cPuo A5HA== 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=lSOWJ8QX42CRJETnx4T+U2VTIPBCCOKQmCxThlXpuS4=; b=PXWaDN7xRNZJfhrubuwWpB3XAUKfFA/rtK/aKdVl8qcdDmuTpBIAZXFqpxxLKWf5BB NWRoIIJAu08EXjH6UDohKzVZpEGxS9Qg0zu0sen4+LrqTyUyqzAwtvCdi7DJuFZ0D3KZ IOxFpwHF+gwyuONUy3iRW7QmFDRygrBTB9l7HAFHRV4s1lEkGAuO+ti5/tzjDyAG01uC Qd8LVPKLP2Sg3sblTjxovNOHKVBvsSsadBovfoCCf+vl6iJqQawSEPCN8nDiGhbw8XEf pThRER++jfZR04sqvGhBnw3SXhO5TE3bli+68/J/uYcjuBDDmN3bTfzxx89tyyLj3UVY Dydw== X-Gm-Message-State: AOAM530rszryVgOBXPc1xL7eoHNxFv0I48XBC7RTVnRrxlzBsUR5pV/h r7MR61Me4ii6H197AcyNdb+cspfHVbLvAhWOThM= X-Google-Smtp-Source: ABdhPJz8Z00GevHNs6EX4kp8qOQ11DgltV3SJE1NZkBDjcAgQD9tEK23cRaBO4RzTsrXqvXzJsoPfoYRqwjAM1XcKBE= X-Received: by 2002:ac2:490d:: with SMTP id n13mr1111778lfi.108.1605600777733; Tue, 17 Nov 2020 00:12:57 -0800 (PST) MIME-Version: 1.0 References: <875z64shzd.fsf@kyleam.com> <5de10fa9.2de7.175d48f6e70.Coremail.tumashu@163.com> In-Reply-To: <5de10fa9.2de7.175d48f6e70.Coremail.tumashu@163.com> From: Gerardo Moro Date: Tue, 17 Nov 2020 10:12:46 +0200 Message-ID: Subject: Re: Re: Agenda follow mode + indirect window settings To: tumashu Content-Type: multipart/alternative; boundary="00000000000002292805b4491030" Received-SPF: pass client-ip=2a00:1450:4864:20::136; envelope-from=gerardomoro37@gmail.com; helo=mail-lf1-x136.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: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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, 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: Kyle Meyer , emacs-orgmode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=MmpvsqNJ; 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: -1.71 X-TUID: uonfuP4YeFJE --00000000000002292805b4491030 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Very nice! I don't know much elisp as I am a new Emacs user. What in short would this code do? :) Thanks a million! El mar., 17 nov. 2020 a las 6:56, tumashu () escribi=C3=B3= : > > > > > > > > > > > > > > > > > > At 2020-11-17 12:52:06, "Kyle Meyer" wrote: > >Gerardo Moro writes: > > > >> Hi, > >> > >> I want my agenda to have follow-mode active when starting Emacs. > >> I suppose this would do the trick? > >> > >> (setq org-agenda-start-with-follow-mode t) > >> (setq org-agenda-follow-indirect t) > >> > >> 1) Do I need both? I have observed that having only the second one doe= s > not > >> work. > > > >The first one causes new agenda buffers to start with > >org-agenda-follow-mode enabled. Even if it's not enabled initially, you > >can toggle it with F. > > > >The second is in effect when org-agenda-follow-mode is enabled. > > > >> 2) Is there a way to make the "indirect" window populate the verticall= y > >> existing window (I always work with the frame split in two vertically)= . > >> Right now it shows in a very small window beneath the agenda. > > > >I think with the way things are written at the moment you're best bet > >would be to try to rearrange afterwards (say with advice after > >org-agenda-tree-to-indirect-buffer). Ideally the current behavior would > >be achieved in a way that would allow the user to control the result > >with things like display-buffer-overriding-action and > >display-buffer-alist, but I suspect that'd take a substantial rework. > > I use the below config, maybe useful... > > > (define-key org-agenda-mode-map (kbd "SPC") > 'eh-org-agenda-show-and-scroll-up) > (define-key org-agenda-mode-map (kbd "") > 'eh-org-agenda-show-and-scroll-up) > > (defvar eh-org-agenda-show-window-point nil) > (defun eh-org-agenda-show-and-scroll-up (&optional arg) > (interactive "P") > (let ((win (selected-window))) > (if (and (window-live-p org-agenda-show-window) > (eq this-command last-command)) > (progn > (select-window org-agenda-show-window) > (if (eq eh-org-agenda-show-window-point (window-point)) > (progn > (goto-char (point-min)) > (message "=E5=B7=B2=E7=BB=8F=E6=BB=9A=E5=8A=A8=E5=88=B0= =E5=BA=95=EF=BC=8C=E8=BF=94=E5=9B=9E=E7=AC=AC=E4=B8=80=E8=A1=8C=EF=BC=81")) > (ignore-errors (scroll-up)) > (setq eh-org-agenda-show-window-point (window-point)))) > (org-agenda-goto t) > (org-show-entry) > (let ((org-indirect-buffer-display 'current-window)) > (org-tree-to-indirect-buffer) > ;; =E9=9A=90=E8=97=8F indirect buffer > (rename-buffer (concat " " (buffer-name)))) > (if arg (org-cycle-hide-drawers 'children) > (org-with-wide-buffer > (narrow-to-region (org-entry-beginning-position) > (org-entry-end-position)) > (org-show-all '(drawers)))) > (setq org-agenda-show-window (selected-window))) > (select-window win))) > > --00000000000002292805b4491030 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Very nice! I don't know much elisp as I am a new Emacs= user. What in short would this code do? :)
Thanks a million!

El m= ar., 17 nov. 2020 a las 6:56, tumashu (<tumashu@163.com>) escribi=C3=B3:

















At 2020-11-17 12:52:06, "Kyle Meyer" <kyle@kyleam.com> wrote:
>Gerardo Moro writes:
>
>> Hi,
>>
>> I want my agenda to have follow-mode active when starting Emacs. >> I suppose this would do the trick?
>>
>> (setq org-agenda-start-with-follow-mode t)
>> (setq org-agenda-follow-indirect t)
>>
>> 1) Do I need both? I have observed that having only the second one= does not
>> work.
>
>The first one causes new agenda buffers to start with
>org-agenda-follow-mode enabled.=C2=A0 Even if it's not enabled init= ially, you
>can toggle it with F.
>
>The second is in effect when org-agenda-follow-mode is enabled.
>
>> 2) Is there a way to make the "indirect" window populate= the vertically
>> existing window (I always work with the frame split in two vertica= lly).
>> Right now it shows in a very small window beneath the agenda.
>
>I think with the way things are written at the moment you're best b= et
>would be to try to rearrange afterwards (say with advice after
>org-agenda-tree-to-indirect-buffer).=C2=A0 Ideally the current behavior= would
>be achieved in a way that would allow the user to control the result >with things like display-buffer-overriding-action and
>display-buffer-alist, but I suspect that'd take a substantial rewor= k.

I use the below config, maybe useful...


(define-key org-agenda-mode-map (kbd "SPC") 'eh-org-agenda-sh= ow-and-scroll-up)
(define-key org-agenda-mode-map (kbd "<return>") 'eh-or= g-agenda-show-and-scroll-up)

(defvar eh-org-agenda-show-window-point nil)
(defun eh-org-agenda-show-and-scroll-up (&optional arg)
=C2=A0 (interactive "P")
=C2=A0 (let ((win (selected-window)))
=C2=A0 =C2=A0 (if (and (window-live-p org-agenda-show-window)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(eq this-command last-comma= nd))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (progn
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (select-window org-agenda-show-window) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (eq eh-org-agenda-show-window-point = (window-point))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (progn
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (goto-char (point-m= in))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (message "=E5= =B7=B2=E7=BB=8F=E6=BB=9A=E5=8A=A8=E5=88=B0=E5=BA=95=EF=BC=8C=E8=BF=94=E5=9B= =9E=E7=AC=AC=E4=B8=80=E8=A1=8C=EF=BC=81"))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (ignore-errors (scroll-up))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq eh-org-agenda-show-window-p= oint (window-point))))
=C2=A0 =C2=A0 =C2=A0 (org-agenda-goto t)
=C2=A0 =C2=A0 =C2=A0 (org-show-entry)
=C2=A0 =C2=A0 =C2=A0 (let ((org-indirect-buffer-display 'current-window= ))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-tree-to-indirect-buffer)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; =E9=9A=90=E8=97=8F indirect buffer
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (rename-buffer (concat " " (buffer-na= me))))
=C2=A0 =C2=A0 =C2=A0 (if arg (org-cycle-hide-drawers 'children)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-with-wide-buffer
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(narrow-to-region (org-entry-beginning-po= sition)
=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(org-entry-end-position))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(org-show-all '(drawers))))
=C2=A0 =C2=A0 =C2=A0 (setq org-agenda-show-window (selected-window)))
=C2=A0 =C2=A0 (select-window win)))

--00000000000002292805b4491030--