Discussion:
Initialization function to (defvar mu4e-bookmarks ...) before calling (add-to-list 'mu4e-bookmarks ...)?
Jeff Kowalczyk
2018-09-18 19:26:00 UTC
Permalink
Is there a recommended initialization function which will call the
default (defvar mu4e-bookmarks ...) after which I can make calls
to (add-to-list 'mu4e-bookmarks ...)?

I have bookmark definitions in init.el, with the minimal example as per
manual 7.2.1 Setting up bookmarks:

(add-to-list 'mu4e-bookmarks
(make-mu4e-bookmark
:name "Big messages"
:query "size:5M..500M"
:key ?b))

These run at startup, before I interactively start M-x mu4e for the first
time . As a result, each fails with error:

Symbol's value as variable is void: mu4e-bookmarks

Thanks,
Jeff
--
You received this message because you are subscribed to the Google Groups "mu-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mu-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Yuri D'Elia
2018-09-18 21:12:06 UTC
Permalink
Post by Jeff Kowalczyk
These run at startup, before I interactively start M-x mu4e for the first
Symbol's value as variable is void: mu4e-bookmarks
Maybe mu4e-bookmarks needs an ###autoload definition?

If you're fine loading mu4e, just use (require 'mu4e) before
'add-to-list. Probably the most pragmatic solution.

You can perform some initialization using mu4e-main-mode-hook:

(add-hook 'mu4e-main-mode-hook
(lambda () do-some-stuff))

I use eval-after-load to avoid loading mu4e too soon:

(with-eval-after-load 'mu4e
(add-to-list ...))
--
You received this message because you are subscribed to the Google Groups "mu-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mu-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Vladimir Sedach
2018-09-19 03:45:26 UTC
Permalink
And don't forget use-package. It's not just for ELPA. Here is how I
use it with mu4e:

(use-package mu4e
:ensure nil
:commands mu4e
:config
(setf xyz)
:bind (:map ctl-x-map
("m" . mu4e-compose-new)
:map mu4e-headers-mode-map
("D" . mu4e-headers-mark-for-trash)
("d" . mu4e-headers-mark-for-delete)
…))

Vladimir
--
You received this message because you are subscribed to the Google Groups "mu-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mu-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...