Code Monkey home page Code Monkey logo

Comments (15)

purcell avatar purcell commented on August 18, 2024

I just pushed a commit which I suspect should avoid this: my guess is that the timer was triggering while a different buffer was current.

from symbol-overlay.

purcell avatar purcell commented on August 18, 2024

The failing code was narrowing to (window-start) and (window-end), and this causes an error like the one you saw if (window-end) is larger than (point-max). I'm not exactly sure how this happened though. :-/

from symbol-overlay.

manuel-uberti avatar manuel-uberti commented on August 18, 2024

I am not sure this is related, but after upgrading the package I get:

Debugger entered--Lisp error: (error "Selecting deleted buffer")
  set-buffer(#<killed buffer>)
  (save-current-buffer (set-buffer buf) (symbol-overlay-maybe-put-temp))
  (lambda (buf) (save-current-buffer (set-buffer buf) (symbol-overlay-maybe-put-temp)))(#<killed buffer>)
  apply((lambda (buf) (save-current-buffer (set-buffer buf) (symbol-overlay-maybe-put-temp))) #<killed buffer>)
  timer-event-handler([t 0 0 500000 t (lambda (buf) (save-current-buffer (set-buffer buf) (symbol-overlay-maybe-put-temp))) (#<killed buffer>) idle 0])

from symbol-overlay.

seagle0128 avatar seagle0128 commented on August 18, 2024

Unfortunately I still encountered this error, and also got the new error @manuel-uberti mentioned.

from symbol-overlay.

purcell avatar purcell commented on August 18, 2024

Hmm, I did push a follow-up commit that checked for liveness of the buffer before invoking with-current-buffer. It looks like the code in the backtrace above is from before that fix. Are you still seeing this with the very latest MELPA package?

from symbol-overlay.

purcell avatar purcell commented on August 18, 2024

(See 66eaaef)

from symbol-overlay.

galeo avatar galeo commented on August 18, 2024

I've met the same error. Here is the backtrace log:

Debugger entered--Lisp error: (args-out-of-range 13655 15402)
  narrow-to-region(13655 15402)
  (progn (narrow-to-region (window-start) (window-end)))
  (if window (progn (narrow-to-region (window-start) (window-end))))
  (if scope (let ((pt (point)) min max p) (save-excursion (save-restriction (narrow-to-defun) (setq min (point-min) max (point-max) p (or (/= pt (point)) (= pt (point-max)))))) (save-excursion (and p (setq min (progn (backward-paragraph) (point)) max (progn (forward-paragraph) (point)))) (narrow-to-region min max))) (if window (progn (narrow-to-region (window-start) (window-end)))))
  symbol-overlay-narrow(nil t)
  (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 (match-data))) (unwind-protect (progn (while (re-search-forward re nil t) (symbol-overlay-put-one symbol) (or p (setq p t)))) (set-match-data save-match-data-internal 'evaporate))) (if p (progn (symbol-overlay-put-one symbol) (setq symbol-overlay-temp-symbol symbol)))))
  (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 (match-data))) (unwind-protect (progn (while (re-search-forward re nil t) (symbol-overlay-put-one symbol) (or p ...))) (set-match-data save-match-data-internal 'evaporate))) (if p (progn (symbol-overlay-put-one symbol) (setq symbol-overlay-temp-symbol 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 (match-data))) (unwind-protect (progn (while ... ... ...)) (set-match-data save-match-data-internal 'evaporate))) (if p (progn (symbol-overlay-put-one symbol) (setq symbol-overlay-temp-symbol 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 (buffer-live-p buf) (progn (save-current-buffer (set-buffer buf) (symbol-overlay-maybe-put-temp))))
  (lambda (buf) (if (buffer-live-p buf) (progn (save-current-buffer (set-buffer buf) (symbol-overlay-maybe-put-temp)))))(#<buffer *Pp Eval Output*>)
  apply((lambda (buf) (if (buffer-live-p buf) (progn (save-current-buffer (set-buffer buf) (symbol-overlay-maybe-put-temp))))) #<buffer *Pp Eval Output*>)
  timer-event-handler([t 0 0 500000 t (lambda (buf) (if (buffer-live-p buf) (progn (save-current-buffer (set-buffer buf) (symbol-overlay-maybe-put-temp))))) (#<buffer *Pp Eval Output*>) idle 0])

Tested with the latest code (8aa6b11) in master branch.

from symbol-overlay.

purcell avatar purcell commented on August 18, 2024

Yeah, I've been looking into this - thanks folks! I think ca3b02c should help. It turns out that when some of these timers fire, they are for in buffers that are not currently visible, yet the previous code assumed that (selected-window) would also contain the buffer that fired the timer.

from symbol-overlay.

purcell avatar purcell commented on August 18, 2024

You'll have to restart Emacs for the fix to work, btw, because old broken timer functions will still be present in buffers.

from symbol-overlay.

purcell avatar purcell commented on August 18, 2024

Latest version is now in MELPA btw, in case anyone would like to try it out and confirm that the issue is fixed. :-)

from symbol-overlay.

manuel-uberti avatar manuel-uberti commented on August 18, 2024

Thank you for working on this, Steve. I've been trying the latest changes and so far so good. I'll report back here whether I find problems or not to give a feedback. Thanks again!

from symbol-overlay.

galeo avatar galeo commented on August 18, 2024

I can also confirm it works. Thanks.

from symbol-overlay.

manuel-uberti avatar manuel-uberti commented on August 18, 2024

OK, I've been using it all day at work with no problem. 👍

from symbol-overlay.

seagle0128 avatar seagle0128 commented on August 18, 2024

I can confirm it works fine now. Close it. Thank you! @purcell

from symbol-overlay.

purcell avatar purcell commented on August 18, 2024

Thanks folks!

from symbol-overlay.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.