emacs_chrome
emacs_chrome copied to clipboard
Wishlist: Match the emacs frame's look with the text box
It would be awesome if the popup frame's font, width and height could exactly match with the text box. I tried for a while but didn't get anywhere.
Here's some idea:
In the content script, get the textarea's clientWidth and clientHeight properties in pixels. In Emacs, use frame-char-height and frame-char-width to convert them to units of characters. Then it's easy to set the frame's height and width.
A remaining issue is to communicate the width/height information to Emacs server. How do we achieve this? Can we pass json and use a json library on the Emacs side? Or are we going to append the information before the text, and hand-parse it in Emacs?
I suppose font can be handled similarly.
Awesome! I've finished implementing this feature, except for the font part.
If you implement this, I'd prefer it be optional. One reason I prefer an external editor is to have an editing region that stays visually consistent and is frequently much larger than what appears in the browser.