Re: [BUG] Org agenda misbehaves in a side window [9.5 (9.5-g0a86ad @ /home/zellerin/.emacs.d/elpa/org-9.5/)]

2024-04-07 Thread Ihor Radchenko
Ihor Radchenko  writes:

> Confirmed.
>
>> Other failing commands are for example changes of todo state in agenda
>> buffer.
>>
>> The reason seems that org-agenda-get-restriction-and-command calls
>> delete-other-window; however, this is not something user observes and
>> expects as effect of those commands.
>
> Sure, but what can we do in order to both fix this and also not break
> the existing behaviour?

I found a way.
Fixed, on main. And we now honour `display-buffer-alist' everywhere as a
bonus (or rather this bug is fixed as a bonus of honouring 
`display-buffer-alist').
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=18fbb9985

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] Org agenda misbehaves in a side window [9.5 (9.5-g0a86ad @ /home/zellerin/.emacs.d/elpa/org-9.5/)]

2023-01-07 Thread Jean Louis
* Ihor Radchenko  [2023-01-06 17:56]:
> Tomas Zellerin  writes:
> 
> > When Agenda buffer is in a side window, several actions fail with
> > "Cannot make side window the only window".
> >
> > Example:
> >
> > emacs -Q
> > in *scratch*, (setq display-buffer-alist '(("\\*Org Agenda\\*"
> > display-buffer-in-side-window)))
> > M-x org-agenda t to display Todo agenda
> > in org-agenda buffer, another M-x org-agenda is observed fails with error 
> > above,
> > expected is display the menu to select agenda command
> 
> Confirmed.
> 
> > Other failing commands are for example changes of todo state in agenda
> > buffer.
> >
> > The reason seems that org-agenda-get-restriction-and-command calls
> > delete-other-window; however, this is not something user observes and
> > expects as effect of those commands.
> 
> Sure, but what can we do in order to both fix this and also not break
> the existing behaviour?

You can do this:

GNU Emacs package: rcd-org-agenda-dashboard.el -- RCD Org Agenda Dashboard:
https://gnu.support/gnu-emacs/packages/GNU-Emacs-package-rcd-org-agenda-dashboard-el-RCD-Org-Agenda-Dashboard-76669.html

Follow same principles for Org Agenda, liberate it into derived mode
where people use it just as any other Emacs buffer.


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



Re: [BUG] Org agenda misbehaves in a side window [9.5 (9.5-g0a86ad @ /home/zellerin/.emacs.d/elpa/org-9.5/)]

2023-01-06 Thread Tomas Zellerin
Ihor Radchenko  writes:

>> The reason seems that org-agenda-get-restriction-and-command calls
>> delete-other-window; however, this is not something user observes and
>> expects as effect of those commands.
>
> Sure, but what can we do in order to both fix this and also not break
> the existing behaviour?

The simplest solution seems to bind (ignore-window-parameters t) inside
the save-window-excursion in `org-agenda-get-restriction-and-command`,
see below. But I do not know what all can be broken, or whether
something cleaner is possible.

Best regards,

Tomas

--- /tmp/org-agenda.orig2023-01-06 19:43:03.528884719 +0100
+++ /tmp/org-agenda.el  2023-01-06 19:41:23.493330904 +0100
@@ -3112,13 +3112,14 @@
   c entry key type match prefixes rmheader header-end custom1 desc
   line lines left right n n1)
   (save-window-excursion
-   (delete-other-windows)
-   (org-switch-to-buffer-other-window " *Agenda Commands*")
-   (erase-buffer)
-   (insert (eval-when-compile
- (let ((header
-(copy-sequence
- "Press key for an agenda command:
+(let ((ignore-window-parameters t))
+  (delete-other-windows)
+  (org-switch-to-buffer-other-window " *Agenda Commands*")
+  (erase-buffer)
+  (insert (eval-when-compile
+(let ((header
+   (copy-sequence
+"Press key for an agenda command:
 <   Buffer, subtree/region restriction
 a   Agenda for current week or day  >   Remove restriction
 t   List of all TODO entriese   Export agenda views
@@ -3128,14 +3129,14 @@
 ?   Find :FLAGGED: entries  C   Configure custom agenda commands
 *   Toggle sticky agenda views  #   List stuck projects (!=configure)
 "))
-   (start 0))
-   (while (string-match
-   "\\(^\\|   \\|(\\)\\(\\S-\\)\\( \\|=\\)"
-   header start)
- (setq start (match-end 0))
- (add-text-properties (match-beginning 2) (match-end 2)
-  '(face bold) header))
-   header)))
+  (start 0))
+  (while (string-match
+  "\\(^\\|   \\|(\\)\\(\\S-\\)\\( \\|=\\)"
+  header start)
+(setq start (match-end 0))
+(add-text-properties (match-beginning 2) (match-end 2)
+ '(face bold) header))
+  header
(setq header-end (point-marker))
(while t
  (setq custom1 custom)



Re: [BUG] Org agenda misbehaves in a side window [9.5 (9.5-g0a86ad @ /home/zellerin/.emacs.d/elpa/org-9.5/)]

2023-01-06 Thread Ihor Radchenko
Tomas Zellerin  writes:

> When Agenda buffer is in a side window, several actions fail with
> "Cannot make side window the only window".
>
> Example:
>
> emacs -Q
> in *scratch*, (setq display-buffer-alist '(("\\*Org Agenda\\*"
> display-buffer-in-side-window)))
> M-x org-agenda t to display Todo agenda
> in org-agenda buffer, another M-x org-agenda is observed fails with error 
> above,
> expected is display the menu to select agenda command

Confirmed.

> Other failing commands are for example changes of todo state in agenda
> buffer.
>
> The reason seems that org-agenda-get-restriction-and-command calls
> delete-other-window; however, this is not something user observes and
> expects as effect of those commands.

Sure, but what can we do in order to both fix this and also not break
the existing behaviour?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



[BUG] Org agenda misbehaves in a side window [9.5 (9.5-g0a86ad @ /home/zellerin/.emacs.d/elpa/org-9.5/)]

2023-01-05 Thread Tomas Zellerin


When Agenda buffer is in a side window, several actions fail with
"Cannot make side window the only window".

Example:

emacs -Q
in *scratch*, (setq display-buffer-alist '(("\\*Org Agenda\\*"
display-buffer-in-side-window)))
M-x org-agenda t to display Todo agenda
in org-agenda buffer, another M-x org-agenda is observed fails with error above,
expected is display the menu to select agenda command

Other failing commands are for example changes of todo state in agenda
buffer.

The reason seems that org-agenda-get-restriction-and-command calls
delete-other-window; however, this is not something user observes and
expects as effect of those commands.

Observed on Org 9.6 as well.

Emacs  : GNU Emacs 29.0.60 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 
3.24.35, cairo version 1.17.6)
 of 2022-12-22
Package: Org mode version 9.5 (9.5-g0a86ad @ 
/home/zellerin/.emacs.d/elpa/org-9.5/)