emacs-helm / helm

Emacs incremental completion and selection narrowing framework
https://emacs-helm.github.io/helm/
GNU General Public License v3.0
3.37k stars 389 forks source link

capf "\bet" completed to "\eta" #2355

Closed non-Jedi closed 4 years ago

non-Jedi commented 4 years ago

Cross-reference https://github.com/JuliaEditorSupport/julia-emacs/pull/100#issuecomment-668108891

Expected behavior

M-TAB completes \bet to \beta.

Actual behavior (from emacs-helm.sh if possible, see note at the bottom)

M-TAB completes \bet to \eta.

This result was with an emacs session run with emacs -q and then helm manually loaded.

Steps to reproduce (recipe)

Evaluate the following:

(defun my-capf ()
  ;; find backslash preceding current word
  (let ((beg (save-excursion
               (while (and (not (bobp))
                           (= (char-syntax (char-before)) ?w))
                 (backward-char))
               (when (= (char-before) ?\\)
                 (- (point) 1)))))
    (when beg
      (list beg (point) '("\\beta" "\\eta")))))

(add-hook 'completion-at-point-functions #'my-capf nil t)

Then (with helm-mode active) type "\bet" and invoke completion-at-point (M-TAB).

Backtraces if any (M-x toggle-debug-on-error)

N/A

Describe versions of Helm, Emacs, operating system, etc.

Linux, Emacs 26.3, helm commit fb1c4411

Are you using emacs-helm.sh to reproduce this bug? (yes/no):

No. Used emacs -q because I wasn't aware of emacs-helm.sh when trying to reproduce.

EDIT: Yes. This behavior exists when using emacs-helm.sh.

Are you using Spacemacs? (yes/no):

No.

thierryvolpiatto commented 4 years ago

Adam B notifications@github.com writes:

Cross-reference JuliaEditorSupport/julia-emacs#100 (comment)

Expected behavior

M-TAB completes \bet to \beta.

Actual behavior (from emacs-helm.sh if possible, see note at the bottom)

M-TAB completes \bet to \eta.

Seems to work now.

Thanks.

-- Thierry

Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997

non-Jedi commented 4 years ago

Yep. Works now. Thanks for fixing this Thierry! :)