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

Source buffers may be killed, before reselected in the system browser -> clear the caches #4

Open
informatimago opened this issue Jul 30, 2021 · 2 comments

Comments

@informatimago
Copy link

  • select a function: the file is visited
  • C-x C-k : kill the visited file buffer
  • select the same function again:
Debugger entered--Lisp error: (error "Selecting deleted buffer")
  set-buffer(#<killed buffer>)
  (save-current-buffer (set-buffer esb:definition-buffer) (wlf:select esb:wm 'definition) (switch-to-buffer esb:definition-buffer nil t) (esb:set-definition-buffer-file file position))
  (if (and file position) (save-current-buffer (set-buffer esb:definition-buffer) (wlf:select esb:wm 'definition) (switch-to-buffer esb:definition-buffer nil t) (esb:set-definition-buffer-file file position)) (message "Definition source not found."))
  (let* ((definition-properties (slime-eval (list 'esb:serialize-for-emacs (cons definition-function (cons (list ... ...) '...))))) (source (find :source definition-properties :key 'car)) (file (and source (or (car (cdr (find :file ... :key ...))) (car (cdr (cdr ...)))))) (position (and source (or (car (cdr (find :position ... :key ...))) (car (cdr (find :offset ... :key ...))))))) (if (and file position) (save-current-buffer (set-buffer esb:definition-buffer) (wlf:select esb:wm 'definition) (switch-to-buffer esb:definition-buffer nil t) (esb:set-definition-buffer-file file position)) (message "Definition source not found.")))
  (let ((definition-type (cond ((string= category "functions") :function) ((string= category "variables") :variable) ((string= category "macros") :macro) ((string= category "classes") :class) ((string= category "generic functions") :generic-function) (t (error "Invalid category: %s" category)))) (definition-function (cond ((string= category "functions") 'def-properties:function-properties) ((string= category "variables") 'def-properties:variable-properties) ((string= category "macros") 'def-properties:macro-properties) ((string= category "classes") 'def-properties:class-properties) ((string= category "generic functions") 'def-properties:generic-function-properties) (t (error "Invalid category: %s" category))))) (let* ((definition-properties (slime-eval (list 'esb:serialize-for-emacs (cons definition-function (cons ... ...))))) (source (find :source definition-properties :key 'car)) (file (and source (or (car (cdr ...)) (car (cdr ...))))) (position (and source (or (car (cdr ...)) (car (cdr ...)))))) (if (and file position) (save-current-buffer (set-buffer esb:definition-buffer) (wlf:select esb:wm 'definition) (switch-to-buffer esb:definition-buffer nil t) (esb:set-definition-buffer-file file position)) (message "Definition source not found."))))
  esb:update-definition-buffer("COM.INFORMATIMAGO.COMMON-LISP.ARITHMETIC.ALGEBRA" "functions" "CARDANO")
  esb:select-definition("COM.INFORMATIMAGO.COMMON-LISP.ARITHMETIC.ALGEBRA" "functions" "CARDANO")
  (closure ((definition . "CARDANO") (--dolist-tail--) (category . "functions") (package . "COM.INFORMATIMAGO.COMMON-LISP.ARITHMETIC.ALGEBRA") esb:documentation-buffer esb:definitions-buffer esb:definitions-buffer esb:catgories-buffer esb:packages-buffer t) (btn) (esb:select-definition package category definition))(#<overlay from 11 to 18 in *esb-definitions*>)
  button-activate(#<overlay from 11 to 18 in *esb-definitions*> nil)
  push-button(11)
  funcall-interactively(push-button 11)
  call-interactively(push-button nil nil)
  command-execute(push-button)

@mmontone
Copy link
Owner

Are you sent to the Emacs debugger when one of these errors occur? Because I'm not, but I would like to. I just get the error message in Emacs status bar.

I have debug-on-error set to true, but the debugger does not appear when I run things from a command or interactively (it seems ...)

@informatimago
Copy link
Author

informatimago commented Jul 30, 2021

For some reason, my debug-on-error was set to true, not to t. Perhaps only t is ignored from call-interactive, but other true values are not? I should reboot my emacs, there are strange things occuring. "Up 17d 13h 9m 28s (Tue 2021-07-13 12:03:11), 142 buffers, 42 files"
But I believe it should show the Backtrace when debug-on-error is true even for interactive calls.

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

No branches or pull requests

2 participants