Source

net-utils / shadowfile.el

Diff from to

shadowfile.el

   (shadow-invalidate-hashtable)
   (if shadow-info-file
       (save-excursion
-	(if (not shadow-info-buffer)
+	(or (buffer-live-p shadow-info-buffer)
 	    (setq shadow-info-buffer (find-file-noselect shadow-info-file)))
 	(set-buffer shadow-info-buffer)
 	(delete-region (point-min) (point-max))
   "Write out information to shadow-todo-file.  
 With nonnil argument also saves the buffer."
   (save-excursion
-    (if (not shadow-todo-buffer)
+    (or (buffer-live-p shadow-todo-buffer)
 	(setq shadow-todo-buffer (find-file-noselect shadow-todo-file)))
     (set-buffer shadow-todo-buffer)
     (delete-region (point-min) (point-max))
     (if save (shadow-save-todo-file))))
 
 (defun shadow-save-todo-file ()
-  (if (and shadow-todo-buffer (buffer-modified-p shadow-todo-buffer))
+  (if (and (buffer-live-p shadow-todo-buffer)
+	   (buffer-modified-p shadow-todo-buffer))
       (save-excursion
 	(set-buffer shadow-todo-buffer)
 	(condition-case nil		; have to continue even in case of