lordpretzel / mu4e-views

GNU General Public License v3.0
107 stars 6 forks source link

Cannot use gnus-based view with old view loaded; restart emacs #21

Closed zw963 closed 2 years ago

zw963 commented 3 years ago

I get this error when use with newest mu4e 1.5.14

error in process filter: if: Cannot use gnus-based view with old view loaded; restart emacs.

i guess this issue caused by require mu4e-view-old

(if (version-list-<=  '(1 5 0) (version-to-list mu4e-mu-version))
    (require 'mu4e-view-old))

and, then this message come from mu4e-view.el in the offical package.

lordpretzel commented 3 years ago

Hi,

there are some bugs with using it with 1.5.x currently that I need to fix since I have not move to 1.5.x yet.

lordpretzel commented 3 years ago

I've just updated my docker test environment to include the new 1.6.0 release of mu which is a start. That will enable me to work on fixing the bugs with the new release.

lordpretzel commented 3 years ago

ok, with a running 1.6 version I was able to debug and fix this. Hopefully there are no breaking changes from 1.5.14 to 1.6.0. Please let me know whether this works with the newest mu4e-views.el from the master branch (typically takes a few hours to show up in melpa).

zw963 commented 3 years ago

I tested it use master f3f454c.

because this is my first time use this package, following is some question.(not sure if issue)

It's seem like works when i select to use html method. but

  1. After i read one email, it can't be marked as read automatically as default way.
  2. I often use SPACE key to read email, and when i reach the end of current email, it will skip to next email automatically, but it not works.
lordpretzel commented 3 years ago

... also may be good to update the mu4e 1.6.1 release

zw963 commented 3 years ago

... also may be good to update the mu4e 1.6.1 release

Yes, i use 1.6.1

* about 1), I need some more information: what is your environment and how are you opening the emails / moving between emails. Opening an email should mark it as read.

I use Arch linux, self-compiled emacs 27.2,

This is my config about mu4e and plugins.

I use RET(return) to view email, and then q to quit to email list menu.

(setq
 ;; smtpmail-stream-type 'ssl                  ; SMTP 连接类型
 smtpmail-smtp-server "smtp.gmail.com"       ;不确定是否可以使用环境变量.
 smtpmail-default-smtp-server "smtp.gmail.com"
 smtpmail-smtp-service 587                   ; 587 是 gmail 的 smtp 端口.
 user-full-name "Billy.Zheng"           ;发件人姓名, $NAME 环境变量指定
 user-mail-address "vil963@gmail.com"      ;发件人默认邮件地址, 可以通过 $EMAIL 来指定.
 smtpmail-smtp-user "vil963@gmail.com"
 smtpmail-queue-mail t  ;; start in queuing mode
 smtpmail-queue-dir   "~/Maildir/queue/cur"
 starttls-use-gnutls t
 smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))
 send-mail-function 'smtpmail-send-it
 message-confirm-send t                 ;当发送一个 message 时, 会有确认提示.
 smtpmail-debug-info t
 auth-source-save-behavior nil     ;不提示保存密码到 ~/.authinfo
 ;; auth-sources '("~/.netrc.gpg" "~/.authinfo.gpg" "~/.netrc" "~/.authinfo")
 ;; mail-archive-file-name "~/.mailbak"       ;指定发送邮件时,密抄一份到某个文件,作为备份。
 message-kill-buffer-on-exit  t              ;当发送消息成功后, 将 kill 消息 buffer.
 )

(add-hook 'message-mode-hook
          '(lambda ()
             (define-key message-mode-map [(control c) (control K)] 'message-kill-buffer)
             (define-key message-mode-map [(control c) (control c)] 'message-fill-paragraph)
             (define-key message-mode-map [(control x) (control s)] 'message-send-and-exit)
             (turn-on-flyspell)
             (set (make-local-variable 'ac-auto-show-menu) t)
             (set (make-local-variable 'ac-use-menu-map) t)
             ))

;; ============================== mu4e 设置 ==============================
(require 'mu4e)
(require 'mu4e-contrib)                 ; Need by mu4e-html2text-command
(require 'mu4e-alert)
(mu4e-alert-set-default-style 'libnotify)
(add-hook 'after-init-hook #'mu4e-alert-enable-notifications)
(add-hook 'after-init-hook #'mu4e-alert-enable-mode-line-display)

;; 所有未读邮件, 不含邮件列表, 及其他特殊分类。
(setq mu4e-bookmarks '(("flag:unread" "Unread mail" ?u)))
;; 添加今天、最近七天未读邮件, 这两个分类,包含所有类型邮件。
(add-to-list 'mu4e-bookmarks '("date:today..now" "Today's messages" ?t))
(add-to-list 'mu4e-bookmarks '("date:7d..now" "Last 7 days" ?w))

;; 以上所有分类,均不含标记为 Spam 的邮件, 需要单独进这个分类查找。
;; (add-github-watch '("maildir:/trash" "Spam email" ?s))

;; 所有邮件,主要用作自定义查找。
(add-to-list 'mu4e-bookmarks '("" "All mail" ?a))

;; (setq mu4e-maildir-shortcuts '(("/maillist". ?m)
;;                                ("/github" . ?g)
;;                                ("/sent" . ?s)
;;                                ("/unknown" . ?u)
;;                                ("/trash" . ?t)
;;                                ("/all" . ?a)
;;                                ("/chinese" . ?c)
;;                                ))

(setq mu4e-maildir-shortcuts
      '( ("/INBOX"               . ?i)
         ("/[Gmail].Sent Mail"   . ?s)
         ("/[Gmail].Trash"       . ?t)
         ("/[Gmail].All Mail"    . ?a)
         ))

(setq
 ;; mu4e-compose-complete-ignore-address-regexp "no-?reply" ;;默认值
 ;; mu4e-headers-show-threads t            ;; 显示邮件之间的关系, 默认值
 ;; mu4e-headers-include-related t          ;; 显示所有相关的邮件, 默认值,  W 开关。
 ;; mu4e-headersq-skip-duplicates t        ;; 跳过重复的邮件, 默认值

 ;; mu4e-headers-results-limit  500  ;; 默认值, 太大影响性能

 ;; mu4e-headers-show-target  t  ;; 默认值

 mail-user-agent 'mu4e-user-agent    ;; 当按下 C-x m 时,使用 mu4e 代替 compose-mail
 mu4e-compose-dont-reply-to-self t  ;; 当使用 replaying to all 时,跳过自己
 mu4e-update-interval 300             ;; 5 minutes
 mu4e-compose-signature (concat
                         "Billy"
                         ;; "Geek, Nerd, Rubyist\n"
                         ;; "程序员中的牛逼运维, 运维中的牛逼程序员。"
                         )
 mu4e-attachment-dir "~/Downloads"   ;; attachment save to ~/Download
 mu4e-drafts-folder "/gmail/[Gmail].Drafts"
 mu4e-sent-folder   "/gmail/[Gmail].Sent Mail"
 mu4e-trash-folder  "/gmail/[Gmail].Trash"

 ;; 默认值, 不使用 mu4e 手动获取 mail, 我们使用 crontab.
 ;; mu4e-get-mail-command "true"

 ;; don't save message to Sent Messages, Gmail/IMAP takes care of this
 mu4e-sent-messages-behavior 'delete
 mu4e-headers-auto-update nil           ;; 我自己手动刷新 headers
 ;; mu4e-confirm-quit            nil      ;; 退出是无需确认。
 )

(add-hook 'mu4e-compose-mode-hook 'auto-fill-mode)

(define-key mu4e-headers-mode-map (kbd "v") #'mu4e-views-mu4e-select-view-msg-method)

(require 'mu4e-views)

(require 'NetworkManager)

(NetworkManager-add-listener
 (lambda (state)
   (setq smtpmail-queue-mail (not state))
   (when (eq major-mode 'mu4e-main-mode)
     (let ((pos (point)))
       (mu4e~main-view-real nil nil)
       (goto-char pos)))))

(provide 'mu4e_init)
;;; mu4e_init.el ends here
zw963 commented 3 years ago

I thought mu4e-views have some bug

after i (require 'mu4e-view), which cause when i press RET on a email, the cursor can't skip to the email body automatially. if not require it, works as expected.

lordpretzel commented 3 years ago

you mean (require 'mu4e-views)?

Note that mu4e-views has a settings that controls which buffer get focused you end up when opening an email:

Note also the xwidgets windows do not have a cursor (or did you just mean that the xwidgets window showing the message does not get focus?)

zw963 commented 3 years ago

after i set mu4e-views-next-previous-message-behaviour to always-switch-to-view, it works as before.

but, as i describe before, after read done email, and press q to quit to headers view, the opened email not be marked as read.

zw963 commented 3 years ago

Note also the xwidgets windows do not have a cursor (or did you just mean that the xwidgets window showing the message does not get focus?)

In fact, it focused, but no cursor, anyway, the issue is, i read done email, it should be mark as read.