Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements and bug fixes for the compose buffer enhancements #270

Merged
merged 3 commits into from
Mar 19, 2024

Conversation

phil-s
Copy link

@phil-s phil-s commented Mar 18, 2024

A handful of bug fixes and enhancements following on from #236.

- Use the "dispatch" commands consistently.
- Re-order to have the two "Write message" bindings adjacent.
- Fix bug wrt the S-<return> binding in the transient menu (see also alphapapa#269).
@phil-s
Copy link
Author

phil-s commented Mar 18, 2024

I've cleaned up the earlier WIP commits (just removing the debugging messages and writing proper commit messages), and otherwise this code is what I've been using for the past several days.

I've decided not to worry about the remaining auto-height edge case that I'd seen while testing -- it is harmless, and I believe it is unlikely to affect people in practice in any case, and I didn't wish to complicate the code further on that account.

Phil Sainty added 2 commits March 18, 2024 22:50
A variety of changes to address edge-cases which might cause compose
buffer windows to be the wrong height.

(ement-room-compose-buffer-window-auto-height-fixed) New variable.

(ement-room-compose-buffer-window-state-change-handler)
(ement-room-compose-buffer-window-buffer-change-handler) New handler
functions used in buffer-local window change hooks.

(ement-room-init-compose-buffer) Apply the fixes.

(ement-room-compose-buffer-window-auto-height) Prevent recursion.
A dedicated window will not be used to display any other buffer, and
will be deleted by `quit-restore-window' (both of which are desirable,
as our default auto-height behaviour generally keeps compose buffer
windows too small to usefully display other buffers.)

Fix: Use consistent window handling when exiting compose buffers.

(ement-room-compose-buffer-window-dedicated) New option.
(ement-room-compose-buffer-window-buffer-change-handler) Make window
dedicated when appropriate.

(ement-room-compose-buffer-quit-restore-window) New function.
(ement-room-compose-send-direct, ement-room-compose-abort) Use it.
@phil-s
Copy link
Author

phil-s commented Mar 18, 2024

Force-pushed to squash this addition into the "More robust auto-height behaviour" commit:

          ;; Ask Emacs to "preserve" the new height.  So long as the window
          ;; maintains this height and is displaying this specific buffer, Emacs
          ;; will avoid unnecessary height changes from side-effects of commands
          ;; such as `balance-windows'.  Explicit height changes are allowed.
          ;; We must update this parameter every time we change the height so
          ;; that the "preserved" height value is always correct.
          (window-preserve-size nil nil t)

@alphapapa alphapapa merged commit 639665f into alphapapa:master Mar 19, 2024
0 of 4 checks passed
@alphapapa
Copy link
Owner

Thanks, Phil!

@alphapapa alphapapa added this to the 0.15 milestone Mar 19, 2024
@alphapapa alphapapa added the enhancement New feature or request label Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants