`company-complete` results in `(evil-repeat-post-hook): (wrong-type-argument number-or-marker-p nil)`
- Dominant language
- Emacs Lisp
- Stars
- 3.9k
- Forks
- 307
- PR merge metrics
- No merged PRs in 30d
Description
# Issue type
- Bug report
# Environment
Emacs version:
29.1.5
Operating System:
macos ventura 13.4
Evil version:
1.15.0
Evil installation type:
MELPA
Graphical/Terminal:
graphical
Tested in a `make emacs` session (see [CONTRIBUTING.md](https://github.com/emacs-evil/evil/blob/master/CONTRIBUTING.md#bug-reports)):
No
# Reproduction steps
- Start Emacs
1. starting with `emacs -Q -nw -l ~/.emacs.d/minimal-init.el`
2. the content of `~/.emacs.d/minimal-init.el` is as following:
```lisp
(progn
(require 'package)
(setq package-list '(evil company))
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(package-initialize)
(unless package-archive-contents
(package-refresh-contents))
(dolist (package package-list)
(unless (package-installed-p package)
(package-install package)))
(setq warning-minimum-level :error)
(dolist (fun '(menu-bar-mode tool-bar-mode scroll-bar-mode))
(when (fboundp fun)
(funcall fun -1)))
(unless (display-graphic-p)
(xterm-mouse-mode 1))
(setq scroll-step 1)
(setq scroll-conservatively 10000)
(setq auto-window-vscroll nil)
(evil-mode 1)
(global-company-mode)
(setq company-frontends '(company-pseudo-tooltip-frontend company-echo-metadata-frontend))
;; set M-i as company-complete
(define-key company-mode-map (kbd "M-i") 'company-complete)
)
```
3. In the scratch buffer, type `thi` and enter the normal state.
4. Entert insert state again, then type `M-i`.
5. `C-x b *Messages*, see the following error: `Error in post-command-hook (evil-repeat-post-hook): (wrong-type-argument number-or-marker-p nil)`
# Expected behavior
the error should not appear
# Actual behavior
get the error: `Error in post-command-hook (evil-repeat-post-hook): (wrong-type-argument number-or-marker-p nil)`
# Further notes
Here is a reproduction video
https://github.com/emacs-evil/evil/assets/45728125/4451fdf2-6163-4784-9ac7-a3b58035c6cf
Contributor guide
Research direction
Start with the minimal-init.el reproduction and the company-complete interaction described in the issue, then trace the evil-repeat-post-hook entry point that reports the error. Run the reproduction in the requested Emacs setup; done means invoking company-complete no longer produces the wrong-type-argument error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- emacs-lisp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100