jwiegley / emacs-async

Simple library for asynchronous processing in Emacs
GNU General Public License v3.0
828 stars 68 forks source link

Fix error from reverting to nonexistent directories #107

Closed CeleritasCelery closed 5 years ago

CeleritasCelery commented 5 years ago

when a dired buffer exists for a directory that has been deleted, dired-async's callback will throw an error. This is a simple fix for that.

thierryvolpiatto commented 5 years ago

Troy Hinckley notifications@github.com writes:

when a dired buffer exists for a directory that has been deleted, dired-async's callback will throw an error. This is a simple fix for that.

  • do (with-current-buffer b
  • (when (file-exists-p default-directory)
  • (revert-buffer nil t)))))

What about something like

(when (and (not (file-remote-p default-directory nil t))
           (file-exists-p default-directory))
  (revert-buffer nil t)))))

to avoid trigerring a new tramp connection to a possible remote default-directory?

-- Thierry

CeleritasCelery commented 5 years ago

Won’t revert-buffer trigger a new connection anyways?

thierryvolpiatto commented 5 years ago

Troy Hinckley notifications@github.com writes:

Won’t revert-buffer trigger a new connection anyways?

Yes, I think so, but file-directory-p triggers a connection too, so if the dired buffer results from an old connection, IMO it is not needed to reenable the connection in the back of user.

-- Thierry

CeleritasCelery commented 5 years ago

done

thierryvolpiatto commented 5 years ago

Thanks.