Skip to content

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

@mentalisttraceur

Description

@mentalisttraceur

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions