Added reset-home-directory.

Pascal J. Bourguignon [2020-10-20 17:00]
Added reset-home-directory.
Filename
pjb-emacs.el
diff --git a/pjb-emacs.el b/pjb-emacs.el
index bf84be6..a71de92 100644
--- a/pjb-emacs.el
+++ b/pjb-emacs.el
@@ -212,6 +212,13 @@ RETURN: the buffer which has as name `name'.
   (interactive "DDirectory for this buffer: ")
   (setf default-directory path))

+(defun reset-home-directory ()
+  "Set the default directory of all non-file buffers to ~/."
+  (interactive)
+  (dolist (buffer (buffer-list))
+    (unless (buffer-file-name buffer)
+      (with-current-buffer buffer
+        (set-default-directory "~/")))))

 ;;;----------------------------------------------------------------------------
 ;;; Editing functions:
ViewGit