Git Product home page Git Product logo

Comments (10)

mickeynp avatar mickeynp commented on August 15, 2024 1

No worries. We should continue support the window/frame switches in mu4e as display-buffer-alist is a bit too complex, IMO, to expect people to set up out of the box.

Thanks for raising this issue. I think the diff you posted would work out OK. Can you raise a PR with it?

from mu.

djcb avatar djcb commented on August 15, 2024

@mickeynp: should we update mu4e-display-buffer for this?

from mu.

malb avatar malb commented on August 15, 2024

FWIW, this worked for me:

@@ -285,22 +285,30 @@ for BUFFER-OR-NAME to be displayed in."
             ('(view . vertical) '((window-min-width . fit-window-to-buffer)))
             (`(,_ . t) nil)))
          (window-action (cond
-                         ((eq buffer-type 'main) '(display-buffer-full-frame))
+                         ((eq buffer-type 'main) '(display-buffer-reuse-window
+                                                   display-buffer-reuse-mode-window
+                                                   display-buffer-full-frame))
                          ((and (eq buffer-type 'compose) mu4e-compose-in-new-frame)
                           '(display-buffer-pop-up-frame))
                          ((memq buffer-type '(headers compose))
-                          '(display-buffer-reuse-mode-window display-buffer-same-window))
+                          '(display-buffer-reuse-window
+                            display-buffer-reuse-mode-window
+                            display-buffer-same-window))
                          ((memq mu4e-split-view '(horizontal vertical))
-                          '(display-buffer-in-direction))
+                          '(display-buffer-reuse-window
+                            display-buffer-reuse-mode-window
+                            display-buffer-in-direction))
                          ((memq mu4e-split-view '(single-window))
-                          '(display-buffer-same-window))
+                          '(display-buffer-reuse-window
+                            display-buffer-reuse-mode-window
+                            display-buffer-same-window))
                          ;; I cannot discern a difference between
                          ;; `single-window' and "anything else" in
                          ;; `mu4e-split-view'.
-                         (t '(display-buffer-same-window))))
-         (arg `((display-buffer-reuse-window
-                 display-buffer-reuse-mode-window
-                 ,@window-action)
+                         (t '(display-buffer-reuse-window
+                              display-buffer-reuse-mode-window
+                              display-buffer-same-window))))
+         (arg `((,@window-action)
                 ,@window-size
                 ,direction
                 )))

from mu.

mickeynp avatar mickeynp commented on August 15, 2024

@djcb updating the function makes sense. Ideally, people would write their own display buffer actions to handle window display --- but that horse has bolted already.

Malb's patch seems like a good fit too. We'll just need to watch out for regressions in other areas.

from mu.

malb avatar malb commented on August 15, 2024

Is there a way to replace the display buffer actions, i.e. override the choices made in mu4e-display-buffer?

from mu.

mickeynp avatar mickeynp commented on August 15, 2024

Yes, with display-buffer-alist. That is the purpose of the new display logic in mu4e: to facilitate complete customisation by the user.

from mu.

malb avatar malb commented on August 15, 2024

Ah, I didn't get that! I thought a user can only add to but not supersede what is hardcoded in mu4e-display-buffer. But reading the documentation of display-buffer (sorry for failing to do that properly earlier), I see that display-buffer-alist takes precedence over ACTION. So perhaps the "correct fix" is to add a documentation entry showing how to achieve what e.g. I want above?

from mu.

malb avatar malb commented on August 15, 2024

Another issue is, unless I'm overlooking something here, that display-buffer-alist is buffer name based but the compose buffers don't have a predictable name (they're named after the subject). This can be handled by writing a custom handler for ".*" but this adds complexity.

FWIW I do the latter in malb/frame-dispatch in https://github.com/malb/emacs.d/blob/master/malb.org#dispatch-buffers-to-frames and malb/display-mu4e-draft-buffer in https://github.com/malb/emacs.d/blob/master/malb.org#window-management-1

from mu.

djcb avatar djcb commented on August 15, 2024

I guess a few more examples in the documentation would help, and some mu4e-specific predicate functions to match various buffer types. I'm only slowly learning the magic of display-buffer-alist...

from mu.

mickeynp avatar mickeynp commented on August 15, 2024

You can pass a function to display-buffer-alist so it uses that to determine eligibility.

I've written about how to do that here for Magit (a million modes and different buffer names) and how to make windows "project-specific" using Emacs's project.el:

https://www.masteringemacs.org/article/demystifying-emacs-window-manager

So I agree with DJ that a simple mu4e-buffer-p function that checks if it's any one of mu4e's modes would be useful. If only to save people some typing.

from mu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.