-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Truncated org-attach popup #34
Comments
Ok, I think I understand what the problem is. In (save-excursion
(save-window-excursion
....
(org-switch-to-buffer-other-window "*Org Attach*")
;; write menu and stuff
)) ;; end excursions
(org-fit-window-to-buffer (get-buffer-window "*Org Attach*")) Then That said, I'd assumed that
This left me thinking whether window creation should be advised with the forced redisplay instead of PS: in |
Ah, one more thing, not specially relevant for the above but something that I realized along the way. In (height (+ (cdr (window-text-pixel-size
window nil t nil (frame-pixel-height frame) t))
(window-scroll-bar-height window)
(window-bottom-divider-width window))))
...
(unless pixelwise ; <--- pixelwise is nil
(setq height (/ (+ height char-height -1) char-height))) So even when the result of EDIT: at first I had ignored the |
Me again. I just kept thinking about this. I believe the tag selection menu case could also be explained because of redisplay not running early in some popup windows. The current advice is deactivating itself after its first run in a buffer, but while popup windows come and go their buffers may remain lurking hidden. So what about using a window parameter in lieu of the buffer local? Nevertheless that won't suffice to solve the problem described above concerning the attach menu, because in that case the fit is done from another window. The general solution is to run early just once upon window creation. I'm asking upstream if that would be an overkill, but I don't believe it is. |
I'm experimenting with something as simple as (defun redisplay-hack (&rest _)
(when mode-line-format
(redisplay t)))
(advice-add #'split-window :after #'redisplay-hack) and so far it seems to cover all cases. Notice that Notice also that there is no obvious hook based solution, since all relevant hooks are called by redisplay itself. Some features:
There still is a visual glitch because the window is displayed before the fit and then immediately replaced by the fitted version. But this is a problem shared by all the proposed solutions, since all require to redisplay before fitting, so I see no way around that glitch, we probably will have to live with it. I'm still discussing other options with upstream, but I believe this is the best one. |
Maybe related to the
org-set-tags-command
case but worse and doesn't get fixed with the previous redisplay.I've seen this in both moody and doom modelines.
Also disabled the redisplay advice just in case but to no avail.
Recipe:
C-c C-a
instead of (without customized modeline):
The text was updated successfully, but these errors were encountered: