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

gptel-transient: Polish gptel--read-with-prefix user experience #652

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pabl0
Copy link
Contributor

@pabl0 pabl0 commented Feb 18, 2025

  • gptel-transient.el (gptel--read-with-prefix-help): Turn into a function to show one function.
    (gptel--read-with-prefix): Enable resizing minibuffer (to make cycling the ov meaningful). Drop make-separator-line' which is buggy. Move the prompt to the last line, which looks better and avoids cursor jumping. Use window-max-chars-per-line' instead of `window-width' (which is incorrect in terminal). Replace newlines with return symbol. Calculate the multi-line layoyt correctly to use all available space on the last line. Cycle between just two modes: one line and multiple lines (hiding one line does not add much value). Don't show the TAB help if the whole prefix fits into one line. (gptel--infix-add-directive): Use simple prompt.

  • gptel-rewrite.el (gptel--infix-rewrite-extra): Use simple prompt.

Replace RETURN LEFT (U+2C90) with smaller RETURN SYMBOL (U+23CE), which looks more readable (with many typefaces) between two pieces of text.

* gptel-transient.el (gptel--read-with-prefix-help): Drop variable.
(gptel--read-with-prefix): Enable resizing minibuffer (to make cycling
the ov meaningful). Drop `make-separator-line' which is buggy. Move
the prompt to the last line, which looks better and avoids cursor
jumping. Use `window-max-chars-per-line' instead of
`window-width' (which is incorrect in terminal). Replace newlines with
return symbol. Calculate the multi-line layoyt correctly to use all
available space on the last line. Cycle between just two modes: one
line and multiple lines (hiding one line does not add much value).
Don't show the TAB help if the whole prefix fits into one line.
(gptel--infix-add-directive): Use simple prompt.

* gptel-rewrite.el (gptel--infix-rewrite-extra): Use simple prompt.

Replace RETURN LEFT (U+2C90) with smaller RETURN SYMBOL (U+23CE),
which looks more readable (with many typefaces) between two pieces of
text.
@pabl0
Copy link
Contributor Author

pabl0 commented Feb 18, 2025

I made slight refactoring changes (use cl-flet) and fixed a bug related to calling gptel--read-with-prefix with a nil value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant