emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: tumashu  <tumashu@163.com>
To: "Kyle Meyer" <kyle@kyleam.com>
Cc: Gerardo Moro <gerardomoro37@gmail.com>,
	emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re:Re: Agenda follow mode + indirect window settings
Date: Tue, 17 Nov 2020 12:56:11 +0800 (CST)	[thread overview]
Message-ID: <5de10fa9.2de7.175d48f6e70.Coremail.tumashu@163.com> (raw)
In-Reply-To: <875z64shzd.fsf@kyleam.com>


















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.  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 vertically
>> 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 "<return>") '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 "已经滚动到底,返回第一行!"))
            (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)
        ;; 隐藏 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)))


  reply	other threads:[~2020-11-17  5:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-12  9:07 Agenda follow mode + indirect window settings Gerardo Moro
2020-11-17  4:52 ` Kyle Meyer
2020-11-17  4:56   ` tumashu [this message]
2020-11-17  8:12     ` Gerardo Moro
2020-11-17  8:12   ` Gerardo Moro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5de10fa9.2de7.175d48f6e70.Coremail.tumashu@163.com \
    --to=tumashu@163.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=gerardomoro37@gmail.com \
    --cc=kyle@kyleam.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).