helm-company
helm-company copied to clipboard
Company: An error occurred in post-command
Hi, thank you for developing this awesome package. Just have a quick question in regards to an error message I receive when executing helm-company
.
When I execute helm-company
via a keybinding, I am able to view completion candidates. After selecting a candidate (successfully), I receive the following error message: Wrong type argument: number-or-marker-p, nil
.
In my *Messages*
buffer, I see the following error messages:
Company: An error occurred in post-command
Wrong type argument: number-or-marker-p, nil
I noticed the following segment which seems to address this issue:
https://github.com/Sodel-the-Vociferous/helm-company/blob/6eb5c2d730a60e394e005b47c1db018697094dde/helm-company.el#L127-L137
However, I am unsure as to why I still receive this error message. Any insights or suggestions?
Below are my (relevant) emacs
specifications:
emacs: 27.1
(spacemacs develop branch: https://github.com/syl20bnr/spacemacs/commit/c629534013f7fb7690a68e47356e19adcc5fc079)
company: company-20201120.1115
helm-company: helm-company-20190812.1429
Unsure why this was closed. Did you solve the issue?
Personally I'm still experiencing this.
It may have been my lack of a reply. I apologize for that.
I will try to reproduce this issue in the coming days.
I cannot reproduce this, unfortunately. I have the latest packages that I can get on emacs-29.1.
Any idea of how I can reproduce this issue so I can solve it? Or, can anyone give me a backtrace after running `toggle-debug-on-error'?
Updated to Emacs 29.1 along with latest package versions as of today. Can still reproduce the error.
MWE
-
Copy the emacs configuration below, eg. to
~/test/init.el
.;;------------------------------------------------------------------------------ ;; use-package and quelpa ;;------------------------------------------------------------------------------ ;; setup archives (require 'package) (setq package-user-dir (file-name-directory (or load-file-name (buffer-file-name)))) (add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/")) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) (package-initialize) ;; setup use-package (unless (package-installed-p 'use-package) (package-refresh-contents) (package-install 'use-package)) (eval-and-compile (setq use-package-always-ensure t use-package-expand-minimally t)) ;; setup quelpa (unless (package-installed-p 'quelpa) (with-temp-buffer (url-insert-file-contents "https://raw.githubusercontent.com/quelpa/quelpa/master/quelpa.el") (eval-buffer) (quelpa-self-upgrade))) (quelpa '(helm-company :fetcher git :url "https://github.com/Sodel-the-Vociferous/helm-company" :branch "main")) ;;------------------------------------------------------------------------------ ;; company and helm-company ;;------------------------------------------------------------------------------ ;; install and enable helm-company (use-package company :config (setq company-idle-delay nil)) (global-company-mode t) (use-package helm-company)
-
Start Emacs with
emacs -q --load ~/test/init.el
-
Open
~/test/init.el
and complete a string (eg. "set") usinghelm-company
-
When the
helm
window opens, select any suggestion and observe the error message in the panel below
Backtrace
As requested:
Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
company--continue()
company--perform()
company-post-command()
Thank you, @atreyasha. I can reproduce this issue now.
It looks like this happens when `company-idle-delay' is nil. I have this delay set to 0.1, which is why I never saw this error.
You could set your `company-idle-delay' to 0.1 as a temporary workaround, but I will need to figure out why a non-nil idle delay has any effect on this at all.
That was a challenging gremlin to track down. I hope this works for you now! :)
Works for me now, thanks! :)