On 20201115, Franck Richter wrote:
I wish to hide the sidebar when viewing emails, because copying >1 line of text
with the mouse unfortunately includes the content of the sidebar in the copy
buffer.
Currently I am using following tricks that unfortunately fail time to time to
show the sidebar again :
message-hook ~A 'set sidebar_visible=no'
macro pager q '<enter-command>set sidebar_visible=yes<enter><exit>'
(adapted from
https://jhutar.blogspot.com/2018/09/hide-sidebar-when-viewing-message-in.html)
macro index \CB '<enter-command>toggle sidebar_visible<enter><refresh>'
macro pager \CB '<enter-command>toggle sidebar_visible<enter><redraw-screen>'
To increase the cases where sidebar_visible=yes happens, I had to make other
hooks I use more complex, ex:
folder-hook "$my_mailboxname/in$" macro index d
'<save-message>+$my_mailboxname/trash<enter><enter-command>"set
sidebar_visible=yes"<enter>'
folder-hook "$my_mailboxname/trash$" macro index d '<delete-message><enter-command>"set
sidebar_visible=yes"<enter>'
folder-hook "$my_mailboxname/old$" macro index <F12>
'<save-message>+$my_mailboxname/in<enter><enter-command>"set sidebar_visible=yes"<enter>'
folder-hook "$my_mailboxname/in$" macro index <F12>
'<save-message>+$my_mailboxname/old<enter><enter-command>"set sidebar_visible=yes"<enter>'
folder-hook "$my_mailboxname/trash$" macro index <F12>
'<save-message>+$my_mailboxname/in<enter><enter-command>"set sidebar_visible=yes"<enter>'
Even with above, when manually saving mails in other mailboxes (via 's' or
';s'), I have to manually make sidebar visible again.
[ Name alternatives ]
screen-hook, context-hook, mode-hook... (doesn't matter)
I use the basic scheme you have of manually toggling visibility, and it is
plenty fast and easy. I use it for the same reason: copying multi-line text.
# b toggles sidebar visibility
macro index b '<enter-command>toggle sidebar_visible<enter>'
macro pager b '<enter-command>toggle sidebar_visible<enter>'
# Remap bounce-message function to "B"
bind index B bounce-message
I've never needed any of the folder-hooks. The sidebar is always visible
unless I've toggled it off.
(It annoys me no end that gnome-terminal-server does not recognize that URLs
can span multiple lines for the right click copy/open menu.)
--
... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
Felix Finch: scarecrow repairman & wood chipper / fe...@crowfix.com
GPG = E987 4493 C860 246C 3B1E 6477 7838 76E9 182E 8151 ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o