Dynamic vertically-adjacent gravity#1371
Conversation
extensions/lisp-mode/completion.lisp
Outdated
| :region-completion)) | ||
| (in-package :lem-lisp-mode/completion) | ||
|
|
||
| (defvar *documentation-popup-gravity* :vertically-adjacent-window-dynamic) |
There was a problem hiding this comment.
Even if the setting might not be user facing, a docstring would help documentors and users: what does this solve and what are the possible values? 🙏
There was a problem hiding this comment.
I would actually like this setting to be user facing, so you are right some documentation is necessary.
Is there a better way to expose user facing variables?
Does lem have something like settings page that I missed?
There was a problem hiding this comment.
would you be fine with this as documentation?
(setf (documentation '*documentation-popup-gravity* 'variable)
(format nil "Set the gravity of the documentation popup. Possibilities are:~%~s"
(handler-case (lem/popup-window::ensure-gravity nil)
(condition (arg) (cdr (type-error-expected-type arg))))))I don't really want people to have to change the documentation just because they added a new gravity, since it's not really related to the gravities themselves.
There was a problem hiding this comment.
oh, this, really? cxxxr will judge^^
set the gravity
I didn't really follow what this does, so I'm a good guinea ping: what does the gravity solve for the documentation popup?
"Set the gravity of the documentation popup. By default, we ensure the popup is displayed like this to prevent this."
It might enough to give a couple default possibilities and refer to a function to know more.
Future doc generators might want an existing docstring in the defvar. It really depends.
You can pick cxxxr as reviewer when you're ready.
There was a problem hiding this comment.
For now, I think it is better to prepare docstrings as static strings.
There was a problem hiding this comment.
I understand. I was mostly intrigued by the possibility of programmatic doc-strings, it does seem like an extremely powerful feature to autogenerate part of the documentation.
I hope the new doc-string is more helpful. There should probably be some documentation for grativies in general. But I'm not sure how it can be presented well to the user, since gravities are created from keyword symbols. One could do something along the lines of: (setf (documentation :my-cool-gravity 'variable) "the best gravity") for all the gravity-keywords, lem would then display the doc-string during completion.
Slightly off topic: Are there any plans for a better config-system? Figuring out what can be set in .lem/config.lisp is somewhat annoying.
|
I think it's very good! |
Documentation popups going over the edge of the screen have been driving me mad recently.
This adds a new gravity
vertically-adjacent-window-dynamic, that ensures the popup is visible, and sets it as the default gravity for documentation popups.It also makes the gravity type for documentation popups configurable with
*documentation-popup-gravity*I thought about replacing
vertically-adjacent-windowbut figure some people prefer the old way.