Discussion:
few questions
Martin Vegter
2013-11-29 11:24:33 UTC
Permalink
hello,

could somebody please advise on the following issues?

when in run mutt in terminal emulator, it reacts to the scroll wheel of
my mouse. Is it possible to disable mouse entirely? There is no mention
of the word "mouse" in man mutt.

What is the correct way to cancel an operation? For example, when I
press 'm' in index by mistake, how do I exit from the 'new mail
operation'. When I pres 'CTRL+c' mutt asks 'Exit mutt?' (with default
yes), so I have to press n all the time. Is there no better way to undo
a wrong key press?

I have a macro to move message to my archive folder:
macro index,pager S "<save-message>=archive<enter>" "move messages"
it works, but there are two small problems:
1) It operates only on one (the current) message, not on all tagged
messages.
2) it actually does not move the message immediately. It copies it to
archive and tags it as deleted in the inbox. Is there a way to execute
the "move" immediately (without having them in inbox selected as deleted)?

thanks,
Martin
LEVAI Daniel
2013-11-29 11:40:52 UTC
Permalink
Post by Martin Vegter
hello,
could somebody please advise on the following issues?
when in run mutt in terminal emulator, it reacts to the scroll wheel of my
mouse. Is it possible to disable mouse entirely? There is no mention of the
word "mouse" in man mutt.
Well, not sure if this is Mutt specific, but terminal emulator specific.
If you're on a tty, perhaps gpm is running? If you're on a pseudo
terminal, just disable the mouse input in your terminal emulator (xterm,
urxvt etc... see their corresponding manuals).
Post by Martin Vegter
What is the correct way to cancel an operation? For example, when I press
'm' in index by mistake, how do I exit from the 'new mail operation'. When I
pres 'CTRL+c' mutt asks 'Exit mutt?' (with default yes), so I have to press
n all the time. Is there no better way to undo a wrong key press?
To cancel a question or anything that had put you into the Mutt command
input, just press CTRL+g.
Not sure what you mean by the new mail operation, but you can back out
from the composer by exiting your editor, and exiting from the 'compose'
screen (answering no to "postpone this message", if you wish).
On any screen, just use the question mark to invoke the online key
bingind help to figure out how to exit.
Post by Martin Vegter
macro index,pager S "<save-message>=archive<enter>" "move messages"
1) It operates only on one (the current) message, not on all tagged
messages.
There is a generic binding:
; tag-prefix apply next function to tagged messages

Pressing ';' before 'S' would execute 'S' on every tagged message.
btw, this works with any function, of course.
Post by Martin Vegter
2) it actually does not move the message immediately. It copies it to
archive and tags it as deleted in the inbox. Is there a way to execute the
"move" immediately (without having them in inbox selected as deleted)?
This is how it works. You must sync the mailbox to purge the messages
that were being marked for deletion. You can append the <sync-mailbox>
function to the macro (but then 'S' will of course purge any other
messages marked for delete and all-in-all do everything that eg. '$'
would have done).
Post by Martin Vegter
thanks,
Martin
No problem, hope this helps; enjoy Mutt! :)


Daniel
--
LÉVAI Dániel
PGP key ID = 0x83B63A8F
Key fingerprint = DBEC C66B A47A DFA2 792D 650C C69B BE4C 83B6 3A8F
Martin Vegter
2013-11-29 13:07:18 UTC
Permalink
Post by LEVAI Daniel
Post by Martin Vegter
hello,
could somebody please advise on the following issues?
when in run mutt in terminal emulator, it reacts to the scroll wheel of my
mouse. Is it possible to disable mouse entirely? There is no mention of the
word "mouse" in man mutt.
Well, not sure if this is Mutt specific, but terminal emulator specific.
If you're on a tty, perhaps gpm is running? If you're on a pseudo
terminal, just disable the mouse input in your terminal emulator (xterm,
urxvt etc... see their corresponding manuals).
I had similar problem with midnight commander and I solved it by using
mc --nomouse. So I was hoping for similar command line option for mutt.
Post by LEVAI Daniel
Post by Martin Vegter
What is the correct way to cancel an operation? For example, when I press
'm' in index by mistake, how do I exit from the 'new mail operation'. When I
pres 'CTRL+c' mutt asks 'Exit mutt?' (with default yes), so I have to press
n all the time. Is there no better way to undo a wrong key press?
To cancel a question or anything that had put you into the Mutt command
input, just press CTRL+g.
Not sure what you mean by the new mail operation, but you can back out
from the composer by exiting your editor, and exiting from the 'compose'
screen (answering no to "postpone this message", if you wish).
On any screen, just use the question mark to invoke the online key
bingind help to figure out how to exit.
Post by Martin Vegter
macro index,pager S "<save-message>=archive<enter>" "move messages"
1) It operates only on one (the current) message, not on all tagged
messages.
; tag-prefix apply next function to tagged messages
Pressing ';' before 'S' would execute 'S' on every tagged message.
btw, this works with any function, of course.
Post by Martin Vegter
2) it actually does not move the message immediately. It copies it to
archive and tags it as deleted in the inbox. Is there a way to execute the
"move" immediately (without having them in inbox selected as deleted)?
This is how it works. You must sync the mailbox to purge the messages
that were being marked for deletion. You can append the <sync-mailbox>
function to the macro (but then 'S' will of course purge any other
messages marked for delete and all-in-all do everything that eg. '$'
would have done).
I have modified my macro, but <sync-mailbox> seems to make no
difference. I still see the message in inbox as marked deleted.

macro index,pager S
"<tag-prefix><save-message>=archive<enter><sync-mailbox>"
Post by LEVAI Daniel
Post by Martin Vegter
thanks,
Martin
No problem, hope this helps; enjoy Mutt! :)
Daniel
LEVAI Daniel
2013-11-29 13:35:17 UTC
Permalink
Post by LEVAI Daniel
Post by Martin Vegter
hello,
could somebody please advise on the following issues?
when in run mutt in terminal emulator, it reacts to the scroll wheel of my
mouse. Is it possible to disable mouse entirely? There is no mention of the
word "mouse" in man mutt.
Well, not sure if this is Mutt specific, but terminal emulator specific.
If you're on a tty, perhaps gpm is running? If you're on a pseudo
terminal, just disable the mouse input in your terminal emulator (xterm,
urxvt etc... see their corresponding manuals).
I had similar problem with midnight commander and I solved it by using mc
--nomouse. So I was hoping for similar command line option for mutt.
Not that I know of, but maybe someone more versed in Mutt can bring hope
:)

[...]
Post by LEVAI Daniel
This is how it works. You must sync the mailbox to purge the messages
that were being marked for deletion. You can append the <sync-mailbox>
function to the macro (but then 'S' will of course purge any other
messages marked for delete and all-in-all do everything that eg. '$'
would have done).
I have modified my macro, but <sync-mailbox> seems to make no difference. I
still see the message in inbox as marked deleted.
macro index,pager S "<tag-prefix><save-message>=archive<enter><sync-mailbox>"
Oh, right. You must set delete=yes, if you want <sync-mailbox> to actually
purge the deleted mails. I forgot about this.

muttrc(5):
delete
Type: quadoption
Default: ask-yes

Controls whether or not messages are really deleted when closing or
synchronizing a mail‐ box. If set to yes, messages marked for deleting
will automatically be purged without prompting. If set to no, messages marked
for deletion will be kept in the mailbox.


So eg.:
macro index,pager S \
"<tag-prefix><save-message>=archive<enter>:set delete=yes<enter><sync-mailbox>:set delete=no<enter>"

... that is 'no' at the end, or whatever value you've set for option
'delete' beforehand.

And a fair warning to this macro: You would actually have to use two
<enter> commands after '=archive', if it would ask you if you want to
append the message to the =archive folder. If you have a setup not to
ask you this, then one <enter> is sufficient.
After one or two tries it'll work like a charm ;-)


Daniel
--
LÉVAI Dániel
PGP key ID = 0x83B63A8F
Key fingerprint = DBEC C66B A47A DFA2 792D 650C C69B BE4C 83B6 3A8F
Martin Vegter
2013-11-29 20:26:32 UTC
Permalink
Post by LEVAI Daniel
Post by LEVAI Daniel
Post by Martin Vegter
hello,
could somebody please advise on the following issues?
when in run mutt in terminal emulator, it reacts to the scroll wheel of my
mouse. Is it possible to disable mouse entirely? There is no mention of the
word "mouse" in man mutt.
Well, not sure if this is Mutt specific, but terminal emulator specific.
If you're on a tty, perhaps gpm is running? If you're on a pseudo
terminal, just disable the mouse input in your terminal emulator (xterm,
urxvt etc... see their corresponding manuals).
I had similar problem with midnight commander and I solved it by using mc
--nomouse. So I was hoping for similar command line option for mutt.
Not that I know of, but maybe someone more versed in Mutt can bring hope
:)
[...]
Post by LEVAI Daniel
This is how it works. You must sync the mailbox to purge the messages
that were being marked for deletion. You can append the <sync-mailbox>
function to the macro (but then 'S' will of course purge any other
messages marked for delete and all-in-all do everything that eg. '$'
would have done).
I have modified my macro, but <sync-mailbox> seems to make no difference. I
still see the message in inbox as marked deleted.
macro index,pager S "<tag-prefix><save-message>=archive<enter><sync-mailbox>"
Oh, right. You must set delete=yes, if you want <sync-mailbox> to actually
purge the deleted mails. I forgot about this.
delete
Type: quadoption
Default: ask-yes
Controls whether or not messages are really deleted when closing or
synchronizing a mail‐ box. If set to yes, messages marked for deleting
will automatically be purged without prompting. If set to no, messages marked
for deletion will be kept in the mailbox.
macro index,pager S \
"<tag-prefix><save-message>=archive<enter>:set delete=yes<enter><sync-mailbox>:set delete=no<enter>"
unfortunately, this still does not work:
1) the messages-to-be-deleted are still in my inbox
2) the <enter> at the end actually acts <display-message>, so when I
pres S, I end up in the pager.
Post by LEVAI Daniel
... that is 'no' at the end, or whatever value you've set for option
'delete' beforehand.
And a fair warning to this macro: You would actually have to use two
<enter> commands after '=archive', if it would ask you if you want to
append the message to the =archive folder. If you have a setup not to
ask you this, then one <enter> is sufficient.
After one or two tries it'll work like a charm ;-)
Daniel
Patrick Shanahan
2013-11-29 23:57:48 UTC
Permalink
[...]
Post by Martin Vegter
Post by LEVAI Daniel
Post by Martin Vegter
Post by LEVAI Daniel
This is how it works. You must sync the mailbox to purge the messages
that were being marked for deletion. You can append the
<sync-mailbox> function to the macro (but then 'S' will of course
purge any other messages marked for delete and all-in-all do
everything that eg. '$' would have done).
I have modified my macro, but <sync-mailbox> seems to make no
difference. I still see the message in inbox as marked deleted.
macro index,pager S "<tag-prefix><save-message>=archive<enter><sync-mailbox>"
Oh, right. You must set delete=yes, if you want <sync-mailbox> to
actually purge the deleted mails. I forgot about this.
delete
Type: quadoption
Default: ask-yes
Controls whether or not messages are really deleted when closing or
synchronizing a mail‐ box. If set to yes, messages marked for
deleting will automatically be purged without prompting. If set to
no, messages marked for deletion will be kept in the mailbox.
macro index,pager S \
"<tag-prefix><save-message>=archive<enter>:set delete=yes<enter><sync-mailbox>:set delete=no<enter>"
1) the messages-to-be-deleted are still in my inbox
2) the <enter> at the end actually acts <display-message>, so when I pres S,
I end up in the pager.
A little trimming is in order or your posts really become somewhat
confusing, and it is good netiquette. Some spacing might also be an
improvement.

Perhaps you should analyze a little of what you have done. You included
in your macro "set delete=no", and have not read the resulting action
according to the quoted doc, and that was not what the OP instructed.

If I have read correctly....
--
(paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri
http://en.opensuse.org openSUSE Community Member facebook/ptilopteri
http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2
Registered Linux User #207535 @ http://linuxcounter.net
David Champion
2013-11-29 17:10:11 UTC
Permalink
Post by LEVAI Daniel
Post by Martin Vegter
hello,
could somebody please advise on the following issues?
when in run mutt in terminal emulator, it reacts to the scroll wheel of my
mouse. Is it possible to disable mouse entirely? There is no mention of the
word "mouse" in man mutt.
Well, not sure if this is Mutt specific, but terminal emulator specific.
If you're on a tty, perhaps gpm is running? If you're on a pseudo
terminal, just disable the mouse input in your terminal emulator (xterm,
urxvt etc... see their corresponding manuals).
I had similar problem with midnight commander and I solved it by using mc
--nomouse. So I was hoping for similar command line option for mutt.
Midnight Commander has support for mouse input events, so they can be
disabled. Mutt does not read mouse events. What you see is probably
your terminal emulator's scrollback buffer (the scrollbar). Mutt has
no influence on this -- you need to disable it in your term emulator.
--
David Champion • ***@bikeshed.us
Dave Dodge
2013-12-01 22:02:23 UTC
Permalink
Post by David Champion
Post by LEVAI Daniel
Post by Martin Vegter
when in run mutt in terminal emulator, it reacts to the scroll wheel of my
mouse. Is it possible to disable mouse entirely? There is no mention of the
word "mouse" in man mutt.
Well, not sure if this is Mutt specific, but terminal emulator specific.
If you're on a tty, perhaps gpm is running? If you're on a pseudo
terminal, just disable the mouse input in your terminal emulator (xterm,
urxvt etc... see their corresponding manuals).
I had similar problem with midnight commander and I solved it by using mc
--nomouse. So I was hoping for similar command line option for mutt.
Midnight Commander has support for mouse input events, so they can be
disabled. Mutt does not read mouse events. What you see is probably
your terminal emulator's scrollback buffer (the scrollbar).
If it's the same thing that happens to me, it's not the scrollback
buffer. Mutt actually reacts to the scroll wheel, intentionally or
not.

For example I might be in the pager reading a long message and
instinctively roll the the wheel a bit to try to scroll the text.
Mutt responds by moving through 9 messages forward/backward for every
wheel event, so at least 9 nearby messages flicker on the screen and
also get marked read. Then I have to go back to the folder and figure
out which ones I haven't seen yet and manually re-mark them "U".

If I'm in the folder itself and use the mouse wheel, the position in
the folder jumps 9 messages forward/backward in the list for each
wheel event. That's not so bad; it's the pager reaction that causes
problems. For example earlier today I was reading a message and went
to copy/paste a URL with the mouse, and accidentally touched the wheel
sending me several messages away and marking them all read along the
way.

If I use the wheel while composing a message in emacs in the same
terminal window, it scrolls 9 lines forward/backward for each wheel
event. I don't know if the 9 is significant or just a coincidence.
Emacs does know that it's getting mouse events, for example C-h k
reports that it's seeing "mouse-4" and "mouse-5" from the wheel.

I've seen this sort of thing happen in both gnome-terminal and
xfce4-terminal, both locally and over ssh.

-Dave Dodge/***@dododge.net
David Champion
2013-12-02 00:39:38 UTC
Permalink
Post by Dave Dodge
Post by David Champion
Post by LEVAI Daniel
Post by Martin Vegter
when in run mutt in terminal emulator, it reacts to the scroll wheel of my
mouse. Is it possible to disable mouse entirely? There is no mention of the
word "mouse" in man mutt.
Well, not sure if this is Mutt specific, but terminal emulator specific.
If you're on a tty, perhaps gpm is running? If you're on a pseudo
terminal, just disable the mouse input in your terminal emulator (xterm,
urxvt etc... see their corresponding manuals).
I had similar problem with midnight commander and I solved it by using mc
--nomouse. So I was hoping for similar command line option for mutt.
Midnight Commander has support for mouse input events, so they can be
disabled. Mutt does not read mouse events. What you see is probably
your terminal emulator's scrollback buffer (the scrollbar).
If it's the same thing that happens to me, it's not the scrollback
buffer. Mutt actually reacts to the scroll wheel, intentionally or
not.
Interesting - admittedly I don't use an X desktop. I just scanned
mutt's source code for mouse, click, and button events. Maybe these
events translate into something else at a lower layer of the window
system?

In any case I don't think mutt is specifically responding to the mouse;
it's responding to a signal that a mouse generate for some unclear
reason, but that could be generated in another way.
--
David Champion • ***@bikeshed.us
Andre Klärner
2013-12-02 10:35:51 UTC
Permalink
Hi Dave,

Actually mutt is just partly involved. It switches to the alternative screen in your terminal emulator. This switches in some terminals the behaviour. Gnome-terminal than disables its scroll back and reports mouse scroll events as repeated presses of the up or down key. The 9 lines/messages you experience come from the X11 wide setting for the mouse - the typical scroll distance.

This alternates for example in mc. Mc uses the mouse reporting like aptitude also does, and if you disable it via the command line switch it chooses to ignore the received events.

Your fix would involve just setting pager_stop in mutt, so that upon reaching a messages end you won't touch other messages. Alteratively you can disable (or remove from the coding) the switch of the mouse behaviour in your terminal emulator, but this might be a huge effort.

I for myself decided a while ago to ditch the scroll back of my terminal (urxvt) and only use the one from the screen sessions I have running inside it anyway. This allows me to use the scroll wheel of my mouse nearly always as replacement for repeated long-distance scrolling in any app and doesn't bother me as much as the scroll back getting mixed up by the many screen windows I have open in each screen window.

Regards, Andre
Post by Dave Dodge
I've seen this sort of thing happen in both gnome-terminal and
xfce4-terminal, both locally and over ssh.
--
Andre Klärner

Telefon: 0351/79666546
Fax: 0351/79688547
Mobil: 0172/9838653

Anschrift:
Prohliser Allee 43
01239 Dresden
Dave Dodge
2013-12-02 20:22:38 UTC
Permalink
Post by Andre Klärner
Gnome-terminal than disables its scroll back and reports mouse
scroll events as repeated presses of the up or down key.
That definitely explains the behavior, thanks.
Post by Andre Klärner
Your fix would involve just setting pager_stop in mutt, so that upon
reaching a messages end you won't touch other messages.
pager_stop isn't enough, because in the pager <Up> and <Down> jump
directly to the previous/next unread message. Now that I know what is
being sent to mutt, if I also change some pager bindings it solves the
problem and makes the wheel actually scroll the text:

set pager_stop=yes
bind pager <Down> next-line
bind pager <Up> previous-line

-Dave Dodge/***@dododge.net

Loading...