-
-
Notifications
You must be signed in to change notification settings - Fork 389
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
Space appended to completion when :annotation-function returns string #2360
Comments
non-Jedi
changed the title
Content from :annotation-function passed to :exit-function
Space appended to completion when :annotation-function returns string
Aug 12, 2020
Actually the space gets appended to the completion result if (defun my-capf ()
(list (line-beginning-position) (point) '("foo" "foobar")
:annotation-function (lambda (_) "")
:exit-function (lambda (string _status)
(message ":exit-function string: %s, length: %d" string (length string)))))
(setq completion-at-point-functions (list 'my-capf)) The above shows the same output of |
thierryvolpiatto
added a commit
that referenced
this issue
Aug 13, 2020
Adam B <notifications@github.com> writes:
Actually the space gets appended to the completion result if :annotation-function returns any string. The value returned by :annotation-function seems to be irrelevant for
this bug:
(defun my-capf ()
(list (line-beginning-position) (point) '("foo" "foobar")
:annotation-function (lambda (_) "")
:exit-function (lambda (string _status)
(message ":exit-function string: %s, length: %d" string (length string)))))
(setq completion-at-point-functions (list 'my-capf))
The above shows the same output of :exit-function string: foo , length: 4.
The space at end is added to display annotation in a display property
added to this space (not by helm, but by minibuffer.el).
I fixed this but at insertion only, that's mean the recipe above will
still return :length 4, this to preserve properties that may be needed
by the :exit-function, up to you to modify this in your :exit-function
if needed.
Let me know if this is correct for you.
Thanks.
…--
Thierry
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected behavior
The first argument that
:exit-function
receives should be the un-annotated string that is being completed-to.Actual behavior (from
emacs-helm.sh
if possible, see note at the bottom)At least part of the the value returned from
:annotation-function
is appended to the completion name when its passed to:exit-function
. The annotation also appears to be included in the final in-buffer completion.The docstring for
completion-extra-properties
says:Steps to reproduce (recipe)
The message when completing "foo" should be
:exit-function string: foo, length: 3
; instead it is:exit-function string: foo , length: 4
. "foo" should be inserted into the buffer by itself; instead a space is inserted after "foo".Backtraces if any (
M-x toggle-debug-on-error
)Describe versions of Helm, Emacs, operating system, etc.
Helm master, Emacs 26.3, Linux
Are you using
emacs-helm.sh
to reproduce this bug? (yes/no):Yes
Are you using Spacemacs? (yes/no):
No
The text was updated successfully, but these errors were encountered: