wolray / symbol-overlay

Highlight symbols with keymap-enabled overlays
332 stars 42 forks source link

void-variable clojure-font-lock-extra-keywords #72

Closed manuel-uberti closed 3 years ago

manuel-uberti commented 3 years ago

Hi,

first of all thanks for this package, one of the most used ones for me.

I updated it this morning, and in a Clojure buffer now I get this:

Debugger entered--Lisp error: (void-variable clojure-font-lock-extra-keywords)
  (append clojure-font-lock-extra-keywords '("defn" "def" "let" "deftest" "is"))
  (symbol-overlay-match-keyword-list symbol (append clojure-font-lock-extra-keywords '("defn" "def" "let" "deftest" "is")))
  symbol-overlay-ignore-function-clojure(#("cases.details/get-details" 0 13 (face font-lock-type-face cider-locals ("woz-check-type" "previous-user-flow" "case-id" "request" "body" "ctx" "valuation-config" "woz-scraper" "db" "params" "case-details" "prev-input" "woz-year" "tax-year" "case-ref" "property-id") fontified t help-echo cider--help-echo) 13 25 (cider-locals ("woz-check-type" "previous-user-flow" "case-id" "request" "body" "ctx" "valuation-config" "woz-scraper" "db" "params" "case-details" "prev-input" "woz-year" "tax-year" "case-ref" "property-id") fontified t help-echo cider--help-echo)))
  funcall(symbol-overlay-ignore-function-clojure #("cases.details/get-details" 0 13 (face font-lock-type-face cider-locals ("woz-check-type" "previous-user-flow" "case-id" "request" "body" "ctx" "valuation-config" "woz-scraper" "db" "params" "case-details" "prev-input" "woz-year" "tax-year" "case-ref" "property-id") fontified t help-echo cider--help-echo) 13 25 (cider-locals ("woz-check-type" "previous-user-flow" "case-id" "request" "body" "ctx" "valuation-config" "woz-scraper" "db" "params" "case-details" "prev-input" "woz-year" "tax-year" "case-ref" "property-id") fontified t help-echo cider--help-echo)))
  (progn (funcall f symbol))
  (if f (progn (funcall f symbol)))
  (let ((f (cdr (assoc major-mode symbol-overlay-ignore-functions)))) (if f (progn (funcall f symbol))))
  symbol-overlay-ignored-p(#("cases.details/get-details" 0 13 (face font-lock-type-face cider-locals ("woz-check-type" "previous-user-flow" "case-id" "request" "body" "ctx" "valuation-config" "woz-scraper" "db" "params" "case-details" "prev-input" "woz-year" "tax-year" "case-ref" "property-id") fontified t help-echo cider--help-echo) 13 25 (cider-locals ("woz-check-type" "previous-user-flow" "case-id" "request" "body" "ctx" "valuation-config" "woz-scraper" "db" "params" "case-details" "prev-input" "woz-year" "tax-year" "case-ref" "property-id") fontified t help-echo cider--help-echo)))
  (not (symbol-overlay-ignored-p symbol))
  (and symbol (not (symbol-overlay-assoc symbol)) (not (symbol-overlay-ignored-p symbol)))
  (if (and symbol (not (symbol-overlay-assoc symbol)) (not (symbol-overlay-ignored-p symbol))) (progn (symbol-overlay-remove-temp) (save-excursion (save-restriction (symbol-overlay-narrow symbol-overlay-scope symbol-overlay-displayed-window) (goto-char (point-min)) (let ((re (symbol-overlay-regexp symbol))) (re-search-forward re nil t) (let ((save-match-data-internal ...)) (unwind-protect (progn ...) (set-match-data save-match-data-internal ...))) (if p (progn (symbol-overlay-put-one symbol) (setq symbol-overlay-temp-symbol symbol))))))))
  (let* ((case-fold-search nil) (symbol (symbol-overlay-get-symbol t)) p) (if (and symbol (not (symbol-overlay-assoc symbol)) (not (symbol-overlay-ignored-p symbol))) (progn (symbol-overlay-remove-temp) (save-excursion (save-restriction (symbol-overlay-narrow symbol-overlay-scope symbol-overlay-displayed-window) (goto-char (point-min)) (let ((re ...)) (re-search-forward re nil t) (let (...) (unwind-protect ... ...)) (if p (progn ... ...))))))))
  (progn (let* ((case-fold-search nil) (symbol (symbol-overlay-get-symbol t)) p) (if (and symbol (not (symbol-overlay-assoc symbol)) (not (symbol-overlay-ignored-p symbol))) (progn (symbol-overlay-remove-temp) (save-excursion (save-restriction (symbol-overlay-narrow symbol-overlay-scope symbol-overlay-displayed-window) (goto-char (point-min)) (let (...) (re-search-forward re nil t) (let ... ...) (if p ...))))))))
  (if symbol-overlay-mode (progn (let* ((case-fold-search nil) (symbol (symbol-overlay-get-symbol t)) p) (if (and symbol (not (symbol-overlay-assoc symbol)) (not (symbol-overlay-ignored-p symbol))) (progn (symbol-overlay-remove-temp) (save-excursion (save-restriction (symbol-overlay-narrow symbol-overlay-scope symbol-overlay-displayed-window) (goto-char ...) (let ... ... ... ...))))))))
  symbol-overlay-maybe-put-temp()
  (save-current-buffer (set-buffer buf) (symbol-overlay-maybe-put-temp))
  (progn (save-current-buffer (set-buffer buf) (symbol-overlay-maybe-put-temp)))
  (if (and (buffer-live-p buf) (eq (window-buffer) buf)) (progn (save-current-buffer (set-buffer buf) (symbol-overlay-maybe-put-temp))))
  symbol-overlay-idle-timer(#<buffer public_api.clj>)
  apply(symbol-overlay-idle-timer #<buffer public_api.clj>)
  timer-event-handler([t 0 0 500000 t symbol-overlay-idle-timer (#<buffer public_api.clj>) idle 0])

These are some extra details about my system to add more context:

GNU Emacs 28.0.50

➤ Master branch commit:
   b215e83a784be1118bb5d729f17597c4f1c62b52
   Improve support for the Cham script and languages

➤ Configured with the following options:
   --with-harfbuzz
   --with-json
   --with-mailutils

➤ Configured with the following features:
   ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM
   GSETTINGS GTK3 HARFBUZZ INOTIFY JPEG JSON LCMS2 LIBOTF LIBSELINUX
   LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY PDUMPER PNG RSVG SOUND
   THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM ZLIB

➤ Running on:
   Ubuntu 20.04 LTS
   GNOME Shell 3.36.4 (x11)
   GTK+ Version 3.24.18, cairo version 1.16.0
purcell commented 3 years ago

Was this in a clojure-mode buffer?

manuel-uberti commented 3 years ago

Yes, with CIDER connected.

purcell commented 3 years ago

Alright, I've reverted that change and rebuilt the MELPA package.

manuel-uberti commented 3 years ago

Thank you for the quick fix. FWIW, I can't find any reference to clojure-font-lock-extra-keywords in clojure-mode. There is a clojure-font-lock-keywords, though.

purcell commented 3 years ago

Yeah, I took a look too and I came to the same conclusion. /cc @mpenet

purcell commented 3 years ago

The extra keywords are in a separate package of that name, so not all users with clojure-mode buffers will have that var available.

manuel-uberti commented 3 years ago

Just tried your fix. It works now. Thanks again!