joaotavora / sly

Sylvester the Cat's Common Lisp IDE
1.25k stars 142 forks source link

Error on sly-mrepl--teardown-comint-isearch #39

Closed PuercoPop closed 9 years ago

PuercoPop commented 9 years ago

How to Reproduce

  1. C-r in the repl
  2. type somethin
  3. Press Enter

Btw the search 'works', the selecting is left in the repl but it is annoying to have to press an extra q everytime.

The appears to be that sly-mrepl--eli-input-overlay seems to be nil when the isearch-mode-end-hooks are called. A Quick fix would be to check if the input overlay if nil before trying to delete it.

(defun sly-mrepl--teardown-comint-isearch ()
  (when sly-mrepl--eli-input-overlay
    (delete-overlay sly-mrepl--eli-input-overlay))
  (setq sly-mrepl--eli-input-overlay nil)
  (sly-mrepl--surround-with-eli-input))

However I'm not qualified to determine if the overlay being nil is the real issue or just a symptom of another problem.

The backtrace

Debugger entered--Lisp error: (wrong-type-argument overlayp nil)
  delete-overlay(nil)
  sly-mrepl--teardown-comint-isearch()
  run-hooks(isearch-mode-end-hook)
  isearch-done()
  isearch-exit()
  call-interactively(isearch-exit nil nil)
  command-execute(isearch-exit)
joaotavora commented 9 years ago

Should be fixed, but please test. Your fix is fine (I just used overlayp). This is a minor misdesign of the eli-like input feature, which you aren't using, but it isn't very serious.

I don't understand your "btw" comment, can you explain? Do you mean the "q" you have to press to get out of the elisp debugger that pops when you hit this bug?

PuercoPop commented 9 years ago

Yeah, precisely.

PuercoPop commented 9 years ago

The fix works. Thanks!