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

aw--done assumes all buffers in aw-empty-buffers-list are still alive #242

Open
mentalisttraceur opened this issue Sep 6, 2023 · 0 comments

Comments

@mentalisttraceur
Copy link

mentalisttraceur commented Sep 6, 2023

aw--done goes through the buffers in aw-empty-buffers-list, but doesn't handle the possibility of them getting killed since they were added to the list.

aw--done could fix this with a simple buffer-live-p check:

   (dolist (b aw-empty-buffers-list)
+    (when (buffer-live-p b)
       (with-current-buffer b
         (when (string= (buffer-string) " ")
           (let ((inhibit-read-only t))
             (delete-region (point-min) (point-max))))))
+    )

In the meantime, for anyone else hitting this problem, here's the workaround I'm using:

(defun fixed-aw--done (&rest _)
    (setq aw-empty-buffers-list
        (seq-filter 'buffer-live-p aw-empty-buffers-list)))
(advice-add 'aw--done :before 'fixed-aw--done)
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

1 participant