alphapapa / org-super-agenda

Supercharge your Org daily/weekly agenda by grouping items
GNU General Public License v3.0
1.33k stars 107 forks source link

Placing cursor on top of group heading changes the keymap and replaces the org-agenda buffer with a calendar when pressed `j ` both on Spacemacs and Doom Emacs #239

Closed onurcanbektas closed 1 year ago

onurcanbektas commented 1 year ago

Here is the steps that I take:

  1. Open org-agenda 1
  2. Move to the next line with j image
  3. Now I press j again and the org-agenda buffer is replaced with a calendar. 3 And when I mean "replaced", I mean the content of the org-agenda buffer has changed. The calendar on the picture is just text that I can modify and delete. When I look at the command logs, I see that once the cursor is on top of the group heading (Research in this case), the active keymap changes also. That is why pressingj` doesn't make the cursor move to the next line.

I have the same problem both in Spacemacs and Doom emacs. Here are my config files for the doom emacs.


(add-hook 'org-agenda-mode-hook 'evil-org-agenda-mode)
(use-package! org-super-agenda
  :after org-agenda
  :init
  (setq org-agenda-files '("~/junction/brain/todo.org"
                           "~/junction/brain/todo.proj_axolotl_rulands_yun.org"
                           "~/junction/brain/todo.proj_smarticles_rulands.org"
                           "~/junction/brain/todo.proj_reversible_graining_bektas.org"))
  (defun my-redo-all-agenda-buffers ()
    (interactive)
    (dolist (buffer (buffer-list))
      (with-current-buffer buffer
        (when (derived-mode-p 'org-agenda-mode)
          (org-agenda-redo t)))))
  (setq org-todo-sort-order '("INTR" "PROG" "NEXT" "TODO" "WAITING" "DONE"))
  (defun my:user-todo-sort (a b)
    "Sort todo based on which I want to see first"
    (when-let ((state-a (get-text-property 14 'todo-state a))
               (state-b (get-text-property 14 'todo-state b))
               (cmp (--map (cl-position-if (lambda (x)
                                             (equal x it))
                                           org-todo-sort-order)
                           (list state-a state-b))))
      (cond ((apply '> cmp) 1)
            ((apply '< cmp) -1)
            (t nil))))
  (setq org-agenda-cmp-user-defined 'my:user-todo-sort)
  (setq org-agenda-sorting-strategy '(user-defined-up))

  (setq org-agenda-time-grid
        '((daily today require-timed)
          ()
          "......"
          "------"
          ))
  (setq org-agenda-skip-scheduled-if-done t)
  (setq org-agenda-skip-deadline-if-done t)
  (setq org-agenda-include-deadlines t)
  (setq org-agenda-include-diary t)
  (setq org-agenda-block-separator nil)
  (setq org-agenda-compact-blocks t)
  (setq org-agenda-start-with-log-mode t)
  (setq org-agenda-log-mode-items '(closed clock state))
  (setq org-agenda-span 'day)

  (setq org-agenda-custom-commands
        '(("q" "Super zaen view"
           ((agenda "" ((org-agenda-span 'day)
                        (org-super-agenda-groups
                         '((:name "Today"
                            :time-grid t
                            :date today
                            :todo "TODAY"
                            :scheduled today
                            :order 1)
                           (:name "Future scheduled"
                            :scheduled future
                            :order 3)
                           (:name "Future deadline"
                            :deadline future
                            :order 4)
                           (:name "Overdue"
                            :deadline past
                            :order 2)
                           ))))
            (alltodo "" ((org-agenda-overriding-header "")
                         (org-super-agenda-groups
                          '((:name "Next to do"
                             :todo "next"
                             :priority "A"
                             :order 3)
                            (:name "Now"
                             :tag "now"
                             :priority "A"
                             :order 2)
                            (:name "Ideas"
                             :tag "idea"
                             :priority "B"
                             :order 9)
                            (:name "To read"
                             :tag "read"
                             :order 27)
                            (:name "Organisational work"
                             :tag "organisational"
                             :order 12)
                            (:name "Write down"
                             :tag "write"
                             :order 20)
                            (:name "Meetings"
                             :tag "meeting"
                             :order 30)
                            (:name "question"
                             :tag "question"
                             :order 10)
                            (:name "Research"
                             :tag "research"
                             :order 4)
                            (:name "Paper work"
                             :tag "paperwork"
                             :order 60)
                            (:name "trivial"
                             :priority<= "C"
                             :tag ("trivial" "unimportant")
                             :todo ("SOMEDAY")
                             :order 90)
                            (:discard (:tag ("Chore" "Routine" "Daily")))))))))))

  :config
  (org-super-agenda-mode)

  )

(defun toggle-window-dedicated ()
  "Toggle whether the current active window is dedicated or not"
  (interactive)
  (message
   (if (let (window (get-buffer-window (current-buffer)))
         (set-window-dedicated-p window
                                 (not (window-dedicated-p window))))
       "Window '%s' is dedicated"
     "Window '%s' is normal")
   (current-buffer)))
alphapapa commented 1 year ago

The issue you're reporting is the responsibility of Doom, Spacemacs, and/or your personal configuration, not this package. See also the package evil-collection.

FrostyX commented 1 year ago

I was dealing with same issue just yesterday and found @alphapapa's suggestion from som other discussion:

(setq org-super-agenda-header-map (make-sparse-keymap))

Worked perfectly.

onurcanbektas commented 1 year ago

@FrostyX ah thank you!!