On Saturday, May 27th, 2023 at 14:33, Eli Zaretskii wrote: > > From: Jimmy Yuen Ho Wong wyuenho@gmail.com > > > Date: Sat, 27 May 2023 18:38:29 +0100 > > > > Reproduction: > > > > 0. Open a Emacs GUI, i.e. NS port > > 1. C-x C-f /some/nonexistent/Dockerfile > > 2. M-x toggle-debug-on-error > > 2. M-x imenu-add-menubar-index > > 3. Click on the Index > Stage menu item > > 4. Observe the following error pops up > > > > Expectation: > > > > If the dockerfile-ts-mode buffer is empty, there should not be an extra > > item preset in the imenu index that when clicked on will jump to a > > non-existent location and result in an error. > > > > `Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil) imenu-default-goto-function("Stage" nil) imenu(("Stage" nil imenu-default-goto-function)) imenu(("Stage")) imenu--menubar-select(("Stage")) #f(compiled-function () (interactive nil) #)() funcall-interactively(#f(compiled-function () (interactive nil) #)) #(#f(compiled-function () (interactive nil) #) nil nil) call-interactively@ido-cr+-record-current-command(# #f(compiled-function () (interactive nil) #) nil nil) apply(call-interactively@ido-cr+-record-current-command # (#f(compiled-function () (interactive nil) #) nil nil)) call-interactively(#f(compiled-function () (interactive nil) #) nil nil) command-execute(#f(compiled-function () (interactive nil) #))` > > > Thanks. > > Randy, can you p-lease look into this? Thanks for the report Jimmy. Patch attached.