emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG] Org agenda misbehaves in a side window [9.5 (9.5-g0a86ad @ /ho


From: Tomas Zellerin
Subject: Re: [BUG] Org agenda misbehaves in a side window [9.5 (9.5-g0a86ad @ /home/zellerin/.emacs.d/elpa/org-9.5/)]
Date: Fri, 06 Jan 2023 19:48:57 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Ihor Radchenko <yantar92@posteo.net> 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.orig        2023-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 entries            e   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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]