keep mu4e in a separate emacs frame

133 views
Skip to first unread message

Massimo D'Antoni

unread,
Nov 20, 2021, 5:41:43 AM11/20/21
to mu-di...@googlegroups.com
Sorry if this has already been asked. I'd like to open mu4e in a separate frame
and keep it in that frame, not letting it mix up with other buffers in my "main"
emacs working frame. I use C-x 5 2 to open a frame where I call mu4e. But then?
I am sure this has been solved by many, so I am curious to know what is your
approach.

Massimo

Benjamin Slade

unread,
Nov 20, 2021, 12:55:57 PM11/20/21
to mu-di...@googlegroups.com, Massimo D'Antoni
Perhaps not the solution you're looking for, but I actually run mu4e in a separate Emacs daemon (emacs --daemon=mu4e).

Norm Tovey-Walsh

unread,
Nov 20, 2021, 1:03:01 PM11/20/21
to mu-di...@googlegroups.com
> Perhaps not the solution you're looking for, but I actually run mu4e
> in a separate Emacs daemon (emacs --daemon=mu4e).

That was the only solution I ever found. Recently, I’ve started to use
perspectives[1] and I find that the buffer grouping is sufficient. I
have key bindings for walking “left” and “right” through perspectives
and their names appear in the mode line so I always know where I am.

Currently, FWIW, I have

Agenda | Mail | Work | XProc | home

So if I’m in the “Work” perspective, mu4e is one perspective “left”.

Be seeing you,
norm

[1] https://github.com/nex3/perspective-el

--
Norman Tovey-Walsh <n...@nwalsh.com>
https://nwalsh.com/

> Lawyers, I suppose, were children once.--Charles Lamb
signature.asc

Eduardo Mercovich

unread,
Nov 23, 2021, 7:58:32 AM11/23/21
to mu-di...@googlegroups.com, Massimo D'Antoni, Benjamin Slade
Hello Benjamin and everyone.

>> Sorry if this has already been asked. I'd like to open mu4e in a
>> separate frame and keep it in that frame [...]

> Perhaps not the solution you're looking for, but I actually run mu4e in a
> separate Emacs daemon (emacs --daemon=mu4e).

Sorry I'm late (a small holiday here in Argentina), but I do something
similar.

I run emacs as daemon (one only, to rule them all) ;) and open mu4e calling a new frame and running:
--8<---------------cut here---------------start------------->8---
emacsclient -c -e '(set-frame-name "@mail")' '(mu4e)'
--8<---------------cut here---------------end--------------->8---

BTW, since I use i3 as window manager, the full incantation is:
--8<---------------cut here---------------start------------->8---
bindsym $mod+m exec --no-startup-id emacsclient -c -e '(set-frame-name "@mail")' '(mu4e)'
--8<---------------cut here---------------end--------------->8---

This open a new frame, set it's title to "@mail", and runs mu4e. In i3 there
is a rule for this window name that opens that window always in the same desktop
(number 1, called "@mail"), so it is always in the same place, similar
to what Norm uses.

HTH... :)


--
Eduardo Mercovich

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

Massimo D'Antoni

unread,
Nov 23, 2021, 8:39:55 AM11/23/21
to Eduardo Mercovich, mu-di...@googlegroups.com, Benjamin Slade
Thank you.
However, I wonder how you deal with an org-link pointing to an email when the
link is in a buffer open in a different instance of emacs.
This is something I very often have to do: I store a link to an email in mu4e
(with C-c l) and put the link in my main org-mode agenda, so that I can easily
find the email when I need it. Does it work with different emacs clients?
Massimo


Il 23/11/21 13:52, Eduardo Mercovich ha scritto:

Benjamin Slade

unread,
Nov 23, 2021, 10:24:15 AM11/23/21
to Massimo D'Antoni, Eduardo Mercovich, mu-di...@googlegroups.com
On Tue, 23 Nov 2021 06:39:51 -0700 (1 hour, 42 minutes, 9 seconds ago), Massimo D'Antoni <massimo...@gmail.com> wrote:

> Thank you.
> However, I wonder how you deal with an org-link pointing to an email when the
> link is in a buffer open in a different instance of emacs.
> This is something I very often have to do: I store a link to an email in mu4e
> (with C-c l) and put the link in my main org-mode agenda, so that I can easily
> find the email when I need it. Does it work with different emacs clients?
> Massimo

It works with different emacs client frames connected to the same daemon, but not between different emacs daemon instances. I don't copy links to email enough for it to be a major issue to me, plus my mu4e-daemon instance still has access to my org files anyway. (Though maybe one could set up a hook to copy the org-link to the system clipboard?)

Jeroen Tiebout

unread,
Nov 23, 2021, 10:43:04 AM11/23/21
to mu-di...@googlegroups.com
This is the reason I stopped using a separate daemon for mu4e.
Storing links, in my experience, does not carry over to another instance.
There may be a way with org-protocol to bridge the gap?
--
Jeroen Tiebout

Derek Feichtinger

unread,
Nov 23, 2021, 11:29:39 AM11/23/21
to mu-di...@googlegroups.com, Jeroen Tiebout
Hi,

For me the possibility to link was one of the reasons why I migrated
from Thunderbird to mu4e... (there you had thunderlinks, but Thunderbird
got more and more brittle regarding integrations). Linking is so
immensely useful, e.g. many of my tasks read like logs, sometimes
spawned by an email from somebody, or referencing emails over the task's
completion. The ability to link most everything in emacs is really
powerful. Often my tasks also reference files on other servers (via
TRAMP), so you can directly jump to them.

As mentioned in my reply to the "open org-mode link to a message in the
mu4e frame" thread by Massimo, I wrote a small patch originally for
mu-1.4.9 that worked very well, that would alway open a mu-link in the
frame that was displaying the headers buffer (patch is in that thread).
That patch still works quite nicely with my current 1.6.2, except that
it seems that the enclosing function is now called at each mail update,
i.e. ever 10 min (for me) the header buffer gets focus... I need to
repair it. It would really be cool if we could get a clean solution that
then also can be merged into mu.

I've been using for a long time the emacs "workgroups", and despite some
attempts to jump to something else, this is the way I organize my frames
(and save the layout). It would be great, not just for this use-case
with email, to better control the buffers of each frame. For me it's
really central that I can arrange my screen into different frames with
"emacs-applications" while I also want to steer the windows displays
within each frame. That for me gives the nicest overview...
I can live with workgroups and some occasional hacks, but it's not yet
anywhere near to a golden bullet...

Cheers,
Derek
--
Paul Scherrer Institut
Dr. Derek Feichtinger Phone: +41 56 310 47 33
Group Head HPC and Emerging Technologies Email: derek.fe...@psi.ch
Building/Room No. OHSA/D17
Forschungsstrasse 111
CH-5232 Villigen PSI

Eduardo Mercovich

unread,
Nov 23, 2021, 11:33:12 AM11/23/21
to Massimo D'Antoni, mu-di...@googlegroups.com, Benjamin Slade
Hello Massimo.

> [...] I wonder how you deal with an org-link pointing to an email when the
> link is in a buffer open in a different instance of emacs. [...] Does
> it work with different emacs clients?

Perfectly. It's only 1 emacs (the daemon) with many frames. :)

Massimo D'Antoni

unread,
Nov 23, 2021, 12:00:04 PM11/23/21
to mu-di...@googlegroups.com, Derek Feichtinger, Jeroen Tiebout
I have exactly the same needs, this is why I first asked about links management
(thanks again for yous patch, Derek) and now about how to effectively organize
buffers into frames so that they do not mix up.
I will try "workgroups" while waiting for the "golden bullet" solution. Is it
easy to setup or, having gone though it, do you have some example on how to set
it up for mu4e?
Massimo


Il 23/11/21 17:12, Derek Feichtinger ha scritto:

Derek Feichtinger

unread,
Nov 23, 2021, 12:48:46 PM11/23/21
to Massimo D'Antoni, mu-di...@googlegroups.com, Jeroen Tiebout
Hi Massimo,

The workgroup package is ancient, though.

https://github.com/tlh/workgroups.el
It has a nice tutorial in the README.

Basically you can store a frame's window layout and give it a name (a
new "workgroup"). At any point you can choose to update the workgroup to
the current frames contents, or you can revert back to the original
layout. This also includes the frame's size.

I use this e.g. for agenda, mail, programming projects,...

E.g. when working on provisioning servers using things like
puppet/ansible, I have some windows that contain remote buffers on the
target servers while also having some buffers display the relevant local
files. When I start my emacs (once every month or so.. my sessions last
long), I can just open the relevant workgroup, and it will connect to
all those remote files and bring me back to my session view.

This is my use-package setup for the basic workgroups

;;; * workgroups minor mode for saving window layouts
;; kept towards end, since upgrades may corrupt the profiles
;; C-z v : switch to workgroup
;; c : create workgroup
;; A : rename workgroup
;; k : kill current workgroup
;; r : revert frame to base configuration of this workgroup
;; u or C-u : update base configuration to current frame configuration
;; C-s : save all workgroups to file
;; b : switch to wg based on choice of a buffer visible in it
;; ? : show help
(use-package workgroups
:ensure t
:config (progn
(wg-load "~/.emacs.d/workgroups" )
(setq wg-morph-on nil) ;; nice effect but sucks with tramp
(put 'erase-buffer 'disabled nil)
(workgroups-mode 1)))



There's a newer rewrite "workgroups2", but that one has problems with
frames (https://github.com/pashinin/workgroups2/issues/89#), defeating
its usefulness for me. This is why I still use the old workgroups.

There's some other ideas where you somehow can bind a list of buffers to
certain frames, so that within a single frame only some buffers are
displayed when cycling... that may also be an interesting idea.


Cheers,
Derek

manuel.a...@gmail.com

unread,
Dec 1, 2021, 3:31:56 AM12/1/21
to mu-di...@googlegroups.com
Hi,

Sorry for the late reply, but maybe you could check https://depp.brause.cc/eyebrowse/ eyebrowse, it’s what spacemacs uses to separate workspaces and at least for me, it works great.

On 11/23/2021, at 20:58, Eduardo Mercovich <eduardo....@gmail.com> wrote:

Hello Benjamin and everyone.
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/mu-discuss/87k0gzowpg.fsf%40gmail.com.
Reply all
Reply to author
Forward
0 new messages