Skip to content
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

Support completion-lazy-hilit and completion-lazy-hilit-fn for Emacs 30. #153

Merged
merged 1 commit into from
Dec 5, 2023

Conversation

okamsn
Copy link
Contributor

@okamsn okamsn commented Nov 12, 2023

This feature allows highlighting to occur later instead of being
performed by the completion style immediately.

  • Move logic for highlighting a single candidate from
    prescient--highlight-matches to prescient--highlight-candidate.

  • Rename prescient--highlight-matches to
    prescient--highlight-candidates, which now applies the new
    function to a list of candidates.

    • Keep this function to support
      prescient-completion-highlight-matches, which is now obsolete.

See:

okamsn added a commit to okamsn/prescient.el that referenced this pull request Nov 12, 2023
…acs 30.

This feature allows highlighting to occur later instead of being
performed by the completion style immediately.

- Move logic for highlighting a single candidate from
  `prescient--highlight-matches` to `prescient--highlight-candidate`.

- Rename `prescient--highlight-matches` to
  `prescient--highlight-candidates`, which now applies the new
  function to a list of candidates.
  - Keep this function to support
    `prescient-completion-highlight-matches`, which is now obsolete.

See:
- Prescient issue radian-software#152
  (radian-software#152)

- Emacs bug #47711
  (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=47711)

- Emacs commit dfffb91a70532ac0021648ba692336331cbe0499
  (https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=dfffb91a70532ac0021648ba692336331cbe0499),

- Vertico commit b11040e1e9c1a4e5178800a0d0925aeeb72dd027
  (minad/vertico@b11040e)

- This Prescient PR radian-software#153
  (radian-software#153).
okamsn added a commit to okamsn/prescient.el that referenced this pull request Nov 12, 2023
…acs 30.

This feature allows highlighting to occur later instead of being
performed by the completion style immediately.

- Move logic for highlighting a single candidate from
  `prescient--highlight-matches` to `prescient--highlight-candidate`.

- Rename `prescient--highlight-matches` to
  `prescient--highlight-candidates`, which now applies the new
  function to a list of candidates.
  - Keep this function to support
    `prescient-completion-highlight-matches`, which is now obsolete.

See:
- Prescient issue radian-software#152
  (radian-software#152)

- Emacs bug #47711
  (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=47711)

- Emacs commit dfffb91a70532ac0021648ba692336331cbe0499
  (https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=dfffb91a70532ac0021648ba692336331cbe0499),

- Vertico commit b11040e1e9c1a4e5178800a0d0925aeeb72dd027
  (minad/vertico@b11040e)

- This Prescient PR radian-software#153
  (radian-software#153).
okamsn added a commit to okamsn/prescient.el that referenced this pull request Nov 12, 2023
…acs 30.

This feature allows highlighting to occur later instead of being
performed by the completion style immediately.

- Move logic for highlighting a single candidate from
  `prescient--highlight-matches` to `prescient--highlight-candidate`.

- Rename `prescient--highlight-matches` to
  `prescient--highlight-candidates`, which now applies the new
  function to a list of candidates.
  - Keep this function to support
    `prescient-completion-highlight-matches`, which is now obsolete.

See:
- Prescient issue radian-software#152
  (radian-software#152)

- Emacs bug #47711
  (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=47711)

- Emacs commit dfffb91a70532ac0021648ba692336331cbe0499
  (https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=dfffb91a70532ac0021648ba692336331cbe0499),

- Vertico commit b11040e1e9c1a4e5178800a0d0925aeeb72dd027
  (minad/vertico@b11040e)

- This Prescient PR radian-software#153
  (radian-software#153).
okamsn added a commit to okamsn/prescient.el that referenced this pull request Nov 12, 2023
…acs 30.

This feature allows highlighting to occur later instead of being
performed by the completion style immediately.

- Move logic for highlighting a single candidate from
  `prescient--highlight-matches` to `prescient--highlight-candidate`.

- Rename `prescient--highlight-matches` to
  `prescient--highlight-candidates`, which now applies the new
  function to a list of candidates.
  - Keep this function to support
    `prescient-completion-highlight-matches`, which is now obsolete.

See:
- Prescient issue radian-software#152
  (radian-software#152)

- Emacs bug #47711
  (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=47711)

- Emacs commit dfffb91a70532ac0021648ba692336331cbe0499
  (https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=dfffb91a70532ac0021648ba692336331cbe0499),

- Vertico commit b11040e1e9c1a4e5178800a0d0925aeeb72dd027
  (minad/vertico@b11040e)

- This Prescient PR radian-software#153
  (radian-software#153).
Copy link
Member

@raxod502 raxod502 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we really label the variable as obsolete if it is still needed in older Emacs versions which we still support?

Perhaps it would be better to use the new variable if available, but otherwise fall back to prescient-completion-highlight-matches, until we stop supporting versions of Emacs that don't have the new variable?

okamsn added a commit to okamsn/prescient.el that referenced this pull request Nov 24, 2023
…acs 30.

This feature allows highlighting to occur later instead of being
performed by the completion style immediately.

- Move logic for highlighting a single candidate from
  `prescient--highlight-matches` to `prescient--highlight-candidate`.

- Rename `prescient--highlight-matches` to
  `prescient--highlight-candidates`, which now applies the new
  function to a list of candidates.
  - Keep this function to support
    `prescient-completion-highlight-matches`, which we're also
    keeping.

See:
- Prescient issue radian-software#152
  (radian-software#152)

- Emacs bug #47711
  (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=47711)

- Emacs commit dfffb91a70532ac0021648ba692336331cbe0499
  (https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=dfffb91a70532ac0021648ba692336331cbe0499),

- Vertico commit b11040e1e9c1a4e5178800a0d0925aeeb72dd027
  (minad/vertico@b11040e)

- This Prescient PR radian-software#153
  (radian-software#153).
…acs 30.

This feature allows highlighting to occur later instead of being
performed by the completion style immediately.

- Move logic for highlighting a single candidate from
  `prescient--highlight-matches` to `prescient--highlight-candidate`.

- Rename `prescient--highlight-matches` to
  `prescient--highlight-candidates`, which now applies the new
  function to a list of candidates.
  - Keep this function to support
    `prescient-completion-highlight-matches`, which we're also
    keeping.

See:
- Prescient issue radian-software#152
  (radian-software#152)

- Emacs bug #47711
  (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=47711)

- Emacs commit dfffb91a70532ac0021648ba692336331cbe0499
  (https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=dfffb91a70532ac0021648ba692336331cbe0499),

- Vertico commit b11040e1e9c1a4e5178800a0d0925aeeb72dd027
  (minad/vertico@b11040e)

- This Prescient PR radian-software#153
  (radian-software#153).
@okamsn
Copy link
Contributor Author

okamsn commented Nov 24, 2023

Can we really label the variable as obsolete if it is still needed in older Emacs versions which we still support?

Perhaps it would be better to use the new variable if available, but otherwise fall back to prescient-completion-highlight-matches, until we stop supporting versions of Emacs that don't have the new variable?

That seems reasonable to me. I tried searching for uses of it on GitHub, but didn't find any.

How does it look now?

@minad
Copy link

minad commented Nov 28, 2023

Perhaps it would be better to use the new variable if available, but otherwise fall back to prescient-completion-highlight-matches, until we stop supporting versions of Emacs that don't have the new variable?

That seems reasonable to me. I tried searching for uses of it on GitHub, but didn't find any.

completion-lazy-hilit can be used even on old versions of Emacs, see the implementation of Vertico. Given that prescient-completion-highlight-matches is not used anywhere one can as well remove the variable. It doesn't really function as a fallback for lazy highlighting.

On the other hand it may make sense to keep the variable as is, such that it always disables highlighting completely (even if completion-lazy-hilit is set). This would preserve the current meaning and could be helpful if users don't want highlighting at all.

How does it look now?

Looks good to me!

@raxod502
Copy link
Member

raxod502 commented Dec 2, 2023

I tried searching for uses of it on GitHub, but didn't find any.

Yea, I would just be worried because it's actually kind of uncommon for people to put their Emacs configs on the public internet, there are a lot, but probably the vast majority are just on people's laptops or private servers.

Copy link
Member

@raxod502 raxod502 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@okamsn okamsn merged commit b701032 into radian-software:main Dec 5, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants