-
Notifications
You must be signed in to change notification settings - Fork 28
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
The eldoc-box-frame-hook might be broken and how to draw a border around the child frame #100
Comments
I looked at my config and I just have
Give that a try and see it if works for you. |
I still wonder if the hook is being called with a reference to the correct child frame or not. |
It's working as expected; the docstring says "Each function runs inside the new frame and receives the main frame as argument". So if you want to reference the childframe, you should use If my config doesn't work, then it's probably Emacs 29 on Mac not drawing the border properly. (I remember it not working in the past but I don't remember since when it starts to work :-) Maybe try Emacs master? |
I'll keep at it. |
This works for me BUT I still don't get why the hook is being passed the frame of the buffer window vs. the child frame. (defun my/eldoc-box-post-frame-hook (frame)
(modify-frame-parameters
;; the hook sends the parent frame this is not what we want we force the child frame
eldoc-box--frame
`(
(background-color . "white")
(internal-border-width . ,1)
)
)
)
(add-hook 'eldoc-box-frame-hook #'my/eldoc-box-post-frame-hook) |
FYI, this cosmetic hack now also eliminates fringes because they create weird visual artifacts in the child frame. (defun my/eldoc-box-post-frame-hook (_frame)
(modify-frame-parameters
;; the hook sends the parent frame this is not what we want we force the child frame
eldoc-box--frame
`(
(left-fringe . ,0)
(right-fringe . ,0)
(background-color . "white")
(internal-border-width . ,1)
)))
(add-hook 'eldoc-box-frame-hook #'my/eldoc-box-post-frame-hook)
|
What kind of visual artifacts? Maybe I can fix it without disabling fringes. I kept the left and right fringe so there's a little gap between the text and the border, otherwise the text is right against the border and it doesn't look good. Internal border would've been the best way to create padding around the text, but we use it for displaying border because childframe doesn't support external border IIRC. |
Regarding that, it's mainly to have access to both the original buffer and the childframe. Since the hook is called in the child frame (so we already have access to it), we pass the original frame as a parameter. |
Hmm, so it's the line-wrap marker. But as you observed, the line shouldn't wrap in the first place. eldoc-box should resize the frame to fit all content, and in this case there're clearly enough room. Could you send me this text? Just click inside the childframe, and C-x h copy all the text in the buffer. I want to see if there's anything funny in the text. |
Verbatim:
|
Thank you for this nice little package. Curious if the following is a bug, and, if not, what one should do instead. I'd like to draw a white border in the child frame. I'm emacs 29.3 on an intel mac, in case the mac drawing code is at fault. I do not have another platform on which to test.
In the function
it seems to me that the hook should be called with the child frame and not the main frame?
Shouldn't this work?
By the way, the hacked version doesn't seem to work, either. So maybe it is the mac drawing code at fault?
The text was updated successfully, but these errors were encountered: