-
-
Notifications
You must be signed in to change notification settings - Fork 429
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
Rename prompter concepts #2655
Rename prompter concepts #2655
Conversation
ea49055
to
4aff268
Compare
I can only change the status of this PR by the time I finish a draft on the prompt buffer's manual section. |
4aff268
to
f370a77
Compare
I've added a draft of the prompt buffer manual section. It's in org, since I can't imagine myself editing big chunks of text directly with Too early to take a look. |
a780625
to
d65a087
Compare
First acceptable draft concluded. |
d65a087
to
ca3595d
Compare
ca3595d
to
3775689
Compare
@aartaka has convinced me to keep the concept of marks, instead of renaming it to selection as I've proposed. I remind that we can only be sure if the concepts make sense globally when judging how easy it is to write a manual section on the topic of prompt buffer. @aartaka take a first look at the draft org file please. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only reviewed the .org file :)
source/manual-prompt-buffer.org
Outdated
instance, while searching on a buffer the search match corresponding to the | ||
current suggestion is highlighted in a distinctive way. | ||
|
||
** Passwords |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like the name of the section, but I don't like the non-descriptive and unintuitive name of the slot either. So meybe we can find some other name? StumpWM uses :password t
, which is overly narrow, I believe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding the section name, we're on the same page.
Regarding the slot, that's a fair point. A suggestion that comes to mind is conceal-input-p
. It's better but not much better perhaps.
Generally speaking, me and @aartaka have agreed on most topics. To move forward, I need input from @jmercouris and @Ambrevar. Let me summarize all of it in a table. The last table features a third column. If the row is non-empty, it means @aartaka has a different suggestion. I'm not happy about
|
Well, I'll take the silence as approval and continue the work :p |
|
Sorry for the delay, I'll come back to this as soon as possible. |
3775689
to
7ffe703
Compare
The renaming was done as per the table below. I now need to go back to the manual to see if everything makes sense.
|
I've reviewed the renaming. It seems to make sense conceptually, and it passed all of my inspection routines to ensure that I'm not introducing bugs. If it looks good then I will merge, but only after:
Waiting for review. @jmercouris @aartaka @Ambrevar |
source/manual-prompt-buffer.org
Outdated
|
||
** Concealing information | ||
You may need to enter a password or other sensitive information in Nyxt. When | ||
invisible-input-p is non-nil, the input is replaced by a placeholder character |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe mention that it's a keyword argument to prompt(1)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, according to my words, since this is not a user option, I should not refer to it!
I didn't explain myself very well so let me make it clearer. I drafted the manual together with the renaming to ensure that the renaming actually makes sense. Imagine if I had made the renaming first only to realize later, while writing the manual section, that I needed to re-do some renaming. When I mentioned the bit below, I was expecting a review of the renaming itself.
My plan is to get feedback on the renaming. If it's ok then rebase, delete Since @aartaka reviewed this incomplete draft of the manual (sorry for the incomplete sections, I wasn't expecting a review there), I will answer all of his comments in this PR but the changes will be reflected in the PR I will open later. Is that ok @aartaka? |
Ohhh, sorry about that |
62c811c
to
2609489
Compare
Thank you @aadcg for this amazing work, and very sorry for taking so long to get back to it! :/ Here are the few names I would like to work on:
|
2609489
to
933265d
Compare
I agree with all of your comments and made the changes accordingly @Ambrevar. Now, I need to review this huge diff from top to bottom with extra care (I've already spotted issues)! I'll come back to this in some days. |
933265d
to
9afd5e5
Compare
467fdc4
to
3dee983
Compare
I've reviewed it and it looks good to me. Would you like to have a final look @aartaka? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All in all, my comments are rather requests for future work. One significant thing: get return
back. Rationale:
- We have
actions-on-return
, but we have noreturn
that these happenon
. Which is quite a gap in our prompter concepts. run-action-on-on-return
is concerned with much more than just running the actions. Which is a bad sign. There should be some other infrastructural function to do channel and history management, likereturn
. Action runner should not be concerned with anything beyond actions.return
is just so good of a name and API point in general, whilerun-actions-on-return
feels like quite a specialized thing. No amount of documentation can fix the confusing API structure, so we better have a single point of exit that's clearly named—return
.
On the subject on naming, you seem to have renamed cancel-input
to quit-prompt-buffer
, but left the prompt-buffer-canceled
error with its old name. Why so? Maybe rename it too? What I'd personally do is:
- Retain the meaningful
cancel
in the name of the command, so it's something likecancel-prompt-buffer
.cancel-input
is not perfect, but it conveys a clear message of bailing out, instead of awfully neutralquit-*
. - Don't rename the condition, leave it as is. It's clear enough.
(assert-equal `(("URL" ,(url url2) )) | ||
(prompter:active-attributes | ||
(prompter:selected-suggestion prompter) | ||
:source (prompter:selected-source prompter)))))) | ||
(prompter:%current-suggestion prompter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole thing with %current-suggestion
business feels wrong. What if we stored the actual suggestion
object inside current-suggestion
slot? This way we can get rid of all the indexing and math, and simply get to list search.
This is not perfect design either, especially on the side of performance and needing to store the reference to source
inside every suggestion
. But it's much cleaner conceptually, I believe.
Obviously, not the change to do in this PR. @Ambrevar, does that sound like a plausible idea moving forward with prompter
?
@@ -194,7 +194,7 @@ | |||
:constructor '("foo" "bar"))))) | |||
(setf (prompter:input prompter) "bar") | |||
(when (prompter:all-ready-p prompter) | |||
(prompter:return-selection prompter) | |||
(prompter:run-action-on-return prompter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I liked the actionability that return-selection
had. It's quite an obvious part of the API that was beneficial for REPL-exploration. And run-action-on-return
seems to do a lot of stuff that actually is not about actions on return at all..
How about resurrecting return-selection
as, say, return
, encapsulating all the channel management and the actual run-action-on-return
inside it?
The key observation motivating the renaming is (in the old parlance): marks are valid when multi-selection-p is non-nil, which makes us think of a selection (a set of items). But that collides with the concept of "the current suggestion", which we call selection. Concepts renamed according to table: | selection | current-suggestion | | return-action | actions-on-return | | marks-actions | actions-on-marks | | selection-actions | actions-on-current-suggestion | Slot multi-selection-p renamed to enable-marks-p. Functions renamed according to table: | select-next | next-suggestion | | select-previous | previous-suggestion | | select-next-source | next-source | | select-previous-source | previous-source | | select-first | first-suggestion | | select-last | last-suggestion | | selected-suggestion | %current-suggestion | | selected-source | current-source | | selected-suggestion-position | current-suggestion-position | | select | set-current-suggestion |
The key observation motivating the renaming is (in the old parlance): marks are valid when multi-selection-p is non-nil, which makes us think of a selection (a set of items). But that collides with the concept of "the current suggestion", which we call selection. Concepts renamed according to table: | selection | current-suggestion | | return-action | actions-on-return | | marks-actions | actions-on-marks | | selection-actions | actions-on-current-suggestion | Slot multi-selection-p renamed to enable-marks-p. Functions renamed according to table: | select-previous | previous-suggestion | | select-next | next-suggestion | | select-first | first-suggestion | | select-last | last-suggestion | | select-previous-page | previous-page | | select-next-page | next-page | | select-previous-source | previous-source | | select-next-source | next-source | | toggle-mark | toggle-mark-forwards | | cancel-input | quit-prompt-buffer | | return-selection | run-action-on-return | | set-selection-action | set-action-on-return | | selected-suggestion | %current-suggestion | | selected-source | current-source | | selected-suggestion-position | current-suggestion-position | | select | set-current-suggestion | | insert-selection | insert-current-suggestion | Uniformize references to prompt buffer in docstrings. For the purpose of documentation, the hyphen should not be used.
3dee983
to
cfbd85d
Compare
This was discussed above when @Ambrevar mentioned:
I don't see much a problem in the fact that we have a command called |
This was discussed in the context of you renaming
To exemplify it with a more down-to-earth example:
|
Now there is: atlas-engineer/prompter#26
Yay! |
@aartaka, since December 2 I have suggested and renamed If there's any topic that needs to be further discussed, please open an issue. |
Yes, that I agree with—I was not attentive enough when reviewing this PR, and was unable to spot this naming thing earlier. Sorry about that. Still, I noteced it now, and, as they say, it's better late than never. I've been in a rush, so sorry if I sounded off. I didn't intend to downplay your work on this PR—it's huge and it made a lot of things much more consistent
Yes, see atlas-engineer/prompter#27. |
Thanks for the manual review @aartaka. I'll make a new version of it. I'll probably open a PR with the org file so that we continue to go through it. At the last minute, I'll integrate it in |
Description
Fixes #2601 #2527
Checklist:
Everything in this checklist is required for each PR. Please do not approve a PR that does not have all of these items.
cd /path/to/nyxt/checkout git submodule add https://gitlab.common-lisp.net/nyxt/py-configparser _build/py-configparser
:documentation
s written in the aforementioned style. (It's OK to skip the docstring for really trivial parts.)changelog.lisp
with my changes if it's anything user-facing (new features, important bug fix, compatibility breakage).migration.lisp
entry for all compatibility-breaking changes.