rougier/mu4e-thread-folding

Error when moving down with thread-folding enabled.

Closed this issue · 2 comments

For some reason, when I enable thread-folding and opening mu4e, I get the following error when pressing the j, q.

Debugger entered--Lisp error: (error #("[mu4e] Must be in mu4e-headers-mode (mu4e-main-mode)" 1 5 (face mu4e-title-face)))
  error("%s" #("[mu4e] Must be in mu4e-headers-mode (mu4e-main-mode)" 1 5 (face mu4e-title-face)))
  mu4e-error("Must be in mu4e-headers-mode (%S)" mu4e-main-mode)
  mu4e~headers-move(1)
  mu4e-headers-next(nil)
  funcall-interactively(mu4e-headers-next nil)
  command-execute(mu4e-headers-next)

Any idea what am I missing? This is installed on Doom emacs.

(use-package! mu4e-thread-folding
  :when (featurep! :email mu4e)
  :after mu4e
  :config
  (map! :map mu4e-headers-mode-map
        :ne "<tab>" #'mu4e-headers-toggle-at-point
        :ne "<left>" #'mu4e-headers-fold-at-point
        :ne "<S-left>" #'mu4e-headers-fold-all
        :ne "<right>" #'mu4e-headers-unfold-at-point
        :ne "<S-right>" #'mu4e-headers-unfold-all)


  (add-to-list 'mu4e-header-info-custom
               '(:empty . (:name "Empty"
                           :shortname ""
                           :function (lambda (msg) "  "))))

  (setq mu4e-headers-fields
        '((:empty . 2)
          (:account-stripe . 1)
          (:human-date . 8)
          (:flags . 6) ; 3 icon flags
          (:from-or-to . 25)
          (:subject)))

  (defun benmezger/mu4e-thread-hook()
    (when (featurep! :email mu4e)
      (message "Enabling mu4e-thread-folding...")
      (mu4e-thread-folding-mode +1)))

  (add-hook 'mu4e-main-mode-hook 'benmezger/mu4e-thread-hook)

  (when (featurep! :editor evil)
    (defadvice! +mu4e-thread-folding-move-to-column-1-a (&rest _)
      "Move the point to column 1.
When using evil, having the cursor at column 0 causes issues,
so we make sure that it's put a column 1 so everything works nicely."
      :before #'mu4e-headers-toggle-at-point
      :before #'mu4e-headers-fold-at-point
      :before #'mu4e-headers-unfold-at-point
      :before #'mu4e-headers-view-message
      :before #'mu4e-compose-reply
      :before #'mu4e-compose-forward
      (unless (= (current-column) 1)
        (move-to-column 1 t)))))

Sorry for being late to answer you. I guess you find the reason behind the faulty behavior?