I discovered a difference in between when running a command from the avy package (available on GNU Elpa).
I verified that this issue did not exist on emacs 25.1 or emacs 25.2.1.
But it does exist on emacs 26.0.50.
How to recreate the problem:
1. emacs -Q
2. Install the avy package from GNU Elpa
3. M-x toggle-debug-on-error
4. M-x avy-goto-line
5. Enter the number 10
You will get a backtrace like this:
Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
call-interactively(avy-goto-line record nil)
execute-extended-command(nil "avy-goto-line" nil)
funcall-interactively(execute-extended-command nil "avy-goto-line" nil)
call-interactively(execute-extended-command nil nil)
By edebugging the avy.el code, I figured out that the problem was that this function was returning nil when it should in fact be returning t.
The difficulty in debugging this further is that if I evaluate that function (avy--process), then the problem goes away.
With point in that function, after I do C-M-x, M-x avy-goto-line starts working fine.
This problem repeats after each emacs restart; and goes away after C-M-x on avy--process.
This means that when the compiled version of avy--process is loaded, that function returns nil incorrectly. But after manually evaluating it, it starts returning t when expected.
(defun avy--process (candidates overlay-fn)
"Select one of CANDIDATES using `avy-read'.
Use OVERLAY-FN to visualize the decision overlay."
(unless (and (consp (car candidates))
(windowp (cdar candidates)))
(mapcar (lambda (x) (cons x (selected-window)))
(let ((len (length candidates))
(cands (copy-sequence candidates))
(if (= len 0)
(message "zero candidates")
(if (= len 1)
(setq res (car candidates))
(setq res (if (eq avy-style 'de-bruijn)
(avy-read (avy-tree candidates avy-keys)
(cond ((eq res 'restart)
(avy--process cands overlay-fn))
;; ignore exit from `avy-handler-function'
((eq res 'exit))
(when (and (consp res)
(windowp (cdr res)))
(let* ((window (cdr res))
(frame (window-frame window)))
(unless (equal frame (selected-frame))
(setq res (car res)))
(funcall (or avy-action 'avy-action-goto)
(if (consp res)
The avy--process is called via avy--line when doing M-x avy-goto-line. Below is the relevant snippet from the avy-goto-line fn. Notice the r variable.
When numbers are entered as input after M-x avy-goto-line, that (avy--line (eq arg 4) form should return t. But it is returning nil instead. So avy-action-goto gets called when it shouldn't be.
After manually evaluating avy--process, r is set to t instead of nil as expected and the problem goes away.
===== snippet from avy-goto-line fn definition =====
(r (avy--line (eq arg 4))))
(unless (eq r t)
But realizing that the same package version works fine on emacs 25.x but not on the master build, I am filing this report.
In GNU Emacs 26.0.50 (build 52, x86_64-unknown-linux-gnu, GTK+ Version 2.24.23)
Repository revision: d0d26c1379598983d2163deb13ba8ab13b14ba2c
Windowing system distributor 'The X.Org Foundation', version 11.0.60900000
System Description: Red Hat Enterprise Linux Workstation release 6.6 (Santiago)
-I/usr/include/freetype2 -I/usr/include' 'CFLAGS=-ggdb3 -O0'
'CXXFLAGS=-ggdb3 -O0' 'LDFLAGS=-L/home/kmodi/usr_local/6/lib
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK2 X11 MODULES
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: @im=none