unofficial mirror of emacs-orgmode@gnu.org
 help / color / mirror / Atom feed
* Agenda follow mode + indirect window settings
@ 2020-11-12  9:07 Gerardo Moro
  2020-11-17  4:52 ` Kyle Meyer
  0 siblings, 1 reply; 5+ messages in thread
From: Gerardo Moro @ 2020-11-12  9:07 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 496 bytes --]

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.
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.

Thank you so much,
G

[-- Attachment #2: Type: text/html, Size: 665 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Agenda follow mode + indirect window settings
  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
  2020-11-17  8:12   ` Gerardo Moro
  0 siblings, 2 replies; 5+ messages in thread
From: Kyle Meyer @ 2020-11-17  4:52 UTC (permalink / raw)
  To: Gerardo Moro; +Cc: emacs-orgmode

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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re:Re: Agenda follow mode + indirect window settings
  2020-11-17  4:52 ` Kyle Meyer
@ 2020-11-17  4:56   ` tumashu
  2020-11-17  8:12     ` Gerardo Moro
  2020-11-17  8:12   ` Gerardo Moro
  1 sibling, 1 reply; 5+ messages in thread
From: tumashu @ 2020-11-17  4:56 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: Gerardo Moro, emacs-orgmode


















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)))


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Agenda follow mode + indirect window settings
  2020-11-17  4:52 ` Kyle Meyer
  2020-11-17  4:56   ` tumashu
@ 2020-11-17  8:12   ` Gerardo Moro
  1 sibling, 0 replies; 5+ messages in thread
From: Gerardo Moro @ 2020-11-17  8:12 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1349 bytes --]

Thanks a lot for this. Will think about it.

El mar., 17 nov. 2020 a las 6:52, Kyle Meyer (<kyle@kyleam.com>) escribió:

> 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.
>

[-- Attachment #2: Type: text/html, Size: 1740 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Re: Agenda follow mode + indirect window settings
  2020-11-17  4:56   ` tumashu
@ 2020-11-17  8:12     ` Gerardo Moro
  0 siblings, 0 replies; 5+ messages in thread
From: Gerardo Moro @ 2020-11-17  8:12 UTC (permalink / raw)
  To: tumashu; +Cc: Kyle Meyer, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 3043 bytes --]

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 (<tumashu@163.com>) escribió:

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> 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)))
>
>

[-- Attachment #2: Type: text/html, Size: 3916 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-17  8:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2020-11-17  8:12     ` Gerardo Moro
2020-11-17  8:12   ` Gerardo Moro

unofficial mirror of emacs-orgmode@gnu.org

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/orgmode/0 orgmode/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 orgmode orgmode/ https://yhetil.org/orgmode \
		emacs-orgmode@gnu.org
	public-inbox-index orgmode

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git