Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running timer ‘ahs-idle-function’: (wrong-type-argument number-or-marker-p nil) #10

Open
duianto opened this issue Jul 8, 2021 · 4 comments

Comments

@duianto
Copy link

duianto commented Jul 8, 2021

An error appears when enabling auto-highlight-symbol-mode in a new buffer:

Error running timer ‘ahs-idle-function’: (wrong-type-argument number-or-marker-p nil)

Reproduction steps

  • Create a new buffer test
  • Type:
abc
abc
  • Enable ahs mode: M-x auto-highlight-symbol-mode RET
  • Wait 1 second

Observed

Error running timer ‘ahs-idle-function’: (wrong-type-argument number-or-marker-p nil)

Expected

The symbol at the cursor should be highlighted

Notes

Moving the cursor to another line, either up or down,
highlights the symbol under the cursor.

In the issue:
#8 (comment)
It was suggested to require the package first.

Make sure you require auto-higlight-symbol before calling these functions. These functions aren't autoload.

It didn't help to add:

(require 'auto-highlight-symbol)

to the init.el

It wasn't caused by the most recent update either,
because it also happened with the previous version:
auto-highlight-symbol-20210705.1351

The symbol is highlighted directly,
without the timer error message,
if the test buffer, is switched to: M-x emacs-lisp-mode RET
before enabling: M-x auto-highlight-symbol-mode RET

The default major mode when creating a new buffer is: fundamental-mode

System info

auto-highlight-symbol-20210708.1057
GNU Emacs 27.2 (build 1, x86_64-w64-mingw32) of 2021-03-26
Windows 21H1

@jcs090218
Copy link
Member

Can you set debug-on-error to t and post the backtrace here? Thanks!

@duianto
Copy link
Author

duianto commented Jul 8, 2021

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  jit-lock--run-functions(1 8)
  jit-lock-fontify-now(1 8)
  ahs-fontify()
  ahs-highlight("abc" 5 8)
  ahs--do-hl()
  #f(compiled-function (win) #<bytecode 0x210731d>)(#<window 3 on test>)
  walk-windows(#f(compiled-function (win) #<bytecode 0x210731d>))
  ahs-idle-function()
  apply(ahs-idle-function nil)
  timer-event-handler([t 24807 19581 827983 nil ahs-idle-function nil nil 0])

@jcs090218
Copy link
Member

I can't reproduce this and the backtrace does not make sense...

I have temporarily disabled with ignore-errors, 03cfc2f. Let me know if this would help? 😕

@duianto
Copy link
Author

duianto commented Jul 9, 2021

The latest version does not show the error running timer message.

Since you weren't able to reproduce the issue.

I also tested it in Manjaro (the test above was in Windows 21H1).

There is no error there either with the latest version of ahs.

But in both Manjaro and Win 21H1:
When those ignore-errors commands are removed,
then the error running timer message returns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants