Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
fixed #1218 aggressive debounce for dynamic-collection #2678
fixed #1218 aggressive debounce for dynamic-collection #2678
Changes from all commits
143266a
e0f57dd
7889102
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 Emacs convention (as per
(info "(elisp) Documentation Tips")
) is to have a complete summary sentence fit on the first line, keep the body wrapped at under 70 columns (seeemacs-lisp-docstring-fill-column
and M-q (fill-paragraph
)), and generally refer to non-nil
rather thant
, unlesst
has a specific meaning. For example:Which leads to a follow-up question: what if the contents of
ivy-text
have changed, but its length is unchanged?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.
Hmm the case would be when the
ivy-set-text
has been called from functions that are not commands, the predicate would "lag" behind. It could leads to bad ui updates.I'd sync the
last-len
gth by callivy--input-changed-p
inivy-set-text', and allow
ivy--input-changed-pto take an optional
update` argument to update change state when non-nil, otherwise it would return the cached change state, and set change state to nil.Shall I commit this idea for you to review, or should we go with something different?
The doc string would look like this for the new predicate:
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.
Sorry, I'm not familiar with the relevant semantics of
ivy-text
, so I can't comment on the high-level design.I don't understand what "all consequents calls before
ivy-text
is changed` means.The fact that you're exposing an internal lexical variable via an optional argument, and have to document this in the docstring, makes it sound like we're trying too hard to use a closure here. Wouldn't a simple
defvar
+defun
be simpler?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 would argue the two implementation is fairly similar, with the difference being the latter would expose the two internal variables.
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.
Ah if we want to introduce a new
change
state to counter the following issue:The change state after re-computation, i.e the synchronization function call placed within
ivy-set-text
. After accessing this state, should be set back to nil, otherwise it would bet
all the time, when accessed, which would defeat the purpose of its implementation.Therefore, I thought expose a flag to use the closure predicate as an update function when non-nil otherwise, it acts like the normal predicate function before we adding implementation to consider this issue: