ankurdave / color-identifiers-mode

Emacs minor mode to highlight each source code identifier uniquely based on its name
308 stars 23 forks source link

Hangs on Elisp buffers with circular structures #84

Open eush77 opened 2 years ago

eush77 commented 2 years ago

color-identifiers:refresh hangs on buffers with circular structures.

Steps to reproduce:

  1. Create an emacs-lisp-mode buffer.

  2. Add text containing reader syntax for a circular structure:

    (-take 5 '#0=(1 . #0#))
  3. Call color-identifiers:refresh.

  4. The command hangs and does not return.

Backtrace:

Debugger entered--Lisp error: (quit)
  #f(compiled-function (sexp) #<bytecode 0x1577820639a9>)((1 . #1))
  color-identifiers:elisp-declarations-in-sexp((1 . #1))
  #f(compiled-function (sexp) #<bytecode 0x1577820639a9>)('(1 . #2))
  color-identifiers:elisp-declarations-in-sexp('(1 . #2))
  #f(compiled-function (sexp) #<bytecode 0x1577820639a9>)((-take 5 '(1 . #5)))
  color-identifiers:elisp-declarations-in-sexp((-take 5 '(1 . #5)))
  color-identifiers:elisp-get-declarations()
  color-identifiers:list-identifiers()
  color-identifiers:refresh()
  funcall-interactively(color-identifiers:refresh)
  call-interactively(color-identifiers:refresh record nil)
  command-execute(color-identifiers:refresh record)
  counsel-M-x-action("color-identifiers:refresh")