Keybinding for mu4e-update-index

154 views
Skip to first unread message

Eduardo Mercovich

unread,
Apr 10, 2017, 1:37:41 PM4/10/17
to mu-discuss
Dear all.

I found myself executing the function mu4e-update-index something
more that once in a while.

For example, after a quick inbox check, or after sending some
mails, or they won't be indexed until next
mu4e-update-mail-and-index.

For this I found that if:
+ big "U" is for mu4e-update-mail-and-index, then
+ small "u" could be just mu4e-update-index only...

... at least in the main screen, where the shortcuts are.

If some others find this useful, it may be added to the next
release.
However, even if is just for me, I still don't know enough to
define that keybind precisely.

As a global key is easy, but the idea is to restrict it's use to
the main screen only.

How does this gets done? Does anyone uses the same funcion with
some frequency?

Thanks a lot for sharing your thoughts...

Best. :)


--
Eduardo Mercovich

Donde se cruzan tus talentos
con las necesidades del mundo,
ahí está tu vocación.
(Anónimo)

Marcin Borkowski

unread,
Apr 11, 2017, 11:54:37 AM4/11/17
to mu-di...@googlegroups.com

On 2017-04-10, at 19:37, Eduardo Mercovich <eduardo....@gmail.com> wrote:

> Dear all.
>
> I found myself executing the function mu4e-update-index something more
> that once in a while.
>
> For example, after a quick inbox check, or after sending some mails,
> or they won't be indexed until next mu4e-update-mail-and-index.
>
> For this I found that if:
> + big "U" is for mu4e-update-mail-and-index, then
> + small "u" could be just mu4e-update-index only...
>
> ... at least in the main screen, where the shortcuts are.

Nice idea.

> If some others find this useful, it may be added to the next release.
> However, even if is just for me, I still don't know enough to define
> that keybind precisely.

Look for the mu4e-main-mode-map keymap and add the binding to it. See
(info "(emacs) Init Rebinding") for an example how to set this up in
your init.el.

Hth,

--
Marcin Borkowski

Eduardo Mercovich

unread,
Apr 11, 2017, 4:45:33 PM4/11/17
to mu-di...@googlegroups.com
Hi Marcin.

[...]

>> For this I found that if:
>> + big "U" is for mu4e-update-mail-and-index, then
>> + small "u" could be just mu4e-update-index only...
>> ... at least in the main screen, where the shortcuts are.

[...]

> Look for the mu4e-main-mode-map keymap and add the binding to
> it. See
> (info "(emacs) Init Rebinding") for an example how to set this
> up in
> your init.el.

Worked as a charm, thank you very much. :)

Althought the exercise helps to learn emacs, for the total newbies
like me, just add:

--8<---------------cut here---------------start------------->8---
(define-key mu4e-main-mode-map "u" 'mu4e-update-index)
--8<---------------cut here---------------end--------------->8---

Best...
Reply all
Reply to author
Forward
0 new messages