Do not move to next message wehn marking from mu4e-view

18 views
Skip to first unread message

Mat

unread,
Aug 15, 2025, 9:40:41 AMAug 15
to mu-discuss
Hi list,

I'm new to mu4e and in the process of configuring everything to my liking, hope I won't have to send to many messages to that list.

I have read the documentation but I have not found a way to prevent
marking (from the mu4e-view-mode) from moving to the next message. It seems that every mark triggered from the `mu4e-view-mode` relies on `mu4e-headers-mark-and-next`, and I couldn't find an alternative `mu4e-headers-mark` or `mu4e-headers-mark-at-point`.

While I like that marking moves to the next message when in the `mu4e-headers-view`, moving to next from the `mu4e-view-mode` will automatically mark this message as read, and this clashes with my workflow whereby I like to keep some messages as unread if I want to snooze them.

Is there a variable I can change to get this behaviour without altering that of mu4e-headers?

Thanks!

M

P.S. I was not able to subscribe to this list without a Google account. Is that expected? I did send the subscription request from another email address and then confirmed by replying to the message as requested, but nothing happened.

Dirk-Jan C. Binnema

unread,
Aug 15, 2025, 10:05:11 AMAug 15
to mu-di...@googlegroups.com
On Wednesday Aug 13 2025, Mat wrote:
>
> While I like that marking moves to the next message when in the
> `mu4e-headers-view`, moving to next from the `mu4e-view-mode` will
> automatically mark this message as read, and this clashes with my workflow
> whereby I like to keep some messages as unread if I want to snooze them.
>
> Is there a variable I can change to get this behaviour without altering
> that of mu4e-headers?

There's `mu4e-headers-advance-after-mark'; but that doesn't know whether
your command originated from mu4e-view.

You might be able to get near what you want with some mode-hooks for
headers/view mode.

> P.S. I was not able to subscribe to this list without a Google account. Is
> that expected? I did send the subscription request from another email
> address and then confirmed by replying to the message as requested, but
> nothing happened.

I think you need a google account for subscribing but you can use any
e-mail address. But if you sent something and got a confirmation, it
should work.

Kind regards,
Dirk.

--
Dirk-Jan C. Binnema Helsinki, Finland
e:dj...@djcbsoftware.nl w:www.djcbsoftware.nl
gpg: 6987 9CED 1745 9375 0F14 DA98 11DD FEA9 DCC4 A036

Mat

unread,
Aug 21, 2025, 7:46:26 PMAug 21
to mu-discuss
Thanks, the following seems to do what I want:

```
;; Do not advance to next message when marking from mu4e-view-mode
(defvar-local mu4e-advance-after-mark nil
  "Whether to advance to next message after marking in current buffer.")

;; Set the variable based on mode
(add-hook 'mu4e-headers-mode-hook
          (lambda () (setq mu4e-advance-after-mark t)))

(add-hook 'mu4e-view-mode-hook
          (lambda () (setq mu4e-advance-after-mark nil)))

;; Advice to conditionally advance
(defun my-mu4e-advance-conditionally (&rest _)
  "Advance only if `mu4e-advance-after-mark' is non-nil."
  (when mu4e-advance-after-mark
    (mu4e-headers-next-message)))

(advice-add 'mu4e-headers-mark-and-next :after #'my-mu4e-advance-conditionally)
```

Reply all
Reply to author
Forward
0 new messages