I'd like to run mu4e in a dedicated frame but on the same emacs server. The following function gets me almost there:

(defun malb/mail ()
 (select-frame (make-frame-command))
 (toggle-frame-maximized) ;; HACK, I usually run maximised
 (sleep-for 0.1) ;; this is a HACK
 (set-frame-size (selected-frame) 200 64)

That is, it creates a new frame in which mu4e is started. However, that frame is just like any other emacs frame and might visit any buffer when I close a buffer created by mu4e. How can I dedicate this frame to mu4e and mu4e only?

  • The following link to a thread -- entitled How to intercept a file before it opens and decide which frame -- contains an example that works with non-file-visiting buffers: stackoverflow.com/questions/18346785/… Consider incorporating frame-bufs to associate the buffer with the frame so that you can have frame-local buffer associations: github.com/alpaker/Frame-Bufs If you like frame-bufs, just add (frame-bufs--add-buffer buf frame) at the appropriate sections of the above-mentioned example. – lawlist Jan 6 '16 at 20:44
  • A new feature (21415) was implemented about a month ago by Anders and Martin that permits Emacs to create a frame with precise pixel specifications, if that is something that interests you. [In other words, the frame is absolutely perfect (at whatever pixel dimension a user wants) from the time it is created -- no resizing, no waiting, no moving, etc.] It is available in Emacs 25 and also the master branch. Here is the feature thread: debbugs.gnu.org/cgi/bugreport.cgi?bug=21415 – lawlist Jan 6 '16 at 20:50
  • You'll need to use dedicated windows within the frame. – Dan Jan 6 '16 at 22:01
  • If you need assistance with a custom kill-buffer function that works with the concepts mentioned in the first comment above, then let me know. I use it to check to see if there is an existing buffer associated with the open frame (if so, then default kill-buffer behavior) -- if there is more than one frame and the buffer being killed is the last associated with the open frame, then delete the open frame. [I have also configured tabbar to work with the frame-bufs, if that is something that interests you -- i.e., dynamic groupings of tabs based on frame-bufs associated buffers.] – lawlist Jan 6 '16 at 23:18
  • I think set-window-dedicated-p won't work, as I'd want any mu4e window to be permissible, but nothing else, I'd need something which takes a list of elisp function to decide. – Martin R. Albrecht Jan 7 '16 at 10:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.