From bb36dc67df4de4af9cefd3882f9998f4f78e2b8f Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sat, 22 Dec 2018 00:03:20 +0000 Subject: doc-view: disregard non-existing files when loading sessions --- doc/jao-doc-view.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/doc/jao-doc-view.el b/doc/jao-doc-view.el index a4a16c5..8fce662 100644 --- a/doc/jao-doc-view.el +++ b/doc/jao-doc-view.el @@ -1,6 +1,6 @@ ;; jao-doc-view.el -- Remembering visited documents -;; Copyright (c) 2013, 2015, 2017 Jose Antonio Ortega Ruiz +;; Copyright (c) 2013, 2015, 2017, 2018 Jose Antonio Ortega Ruiz ;; This file is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -52,12 +52,11 @@ (defun jao-doc-view-purge-bmks () (interactive) - (let ((ht jao-doc-view--current-bmks)) - (when ht - (maphash (lambda (k v) - (when (or (= 1 v) (not (file-exists-p k))) - (remhash k ht))) - ht)))) + (when jao-doc-view--current-bmks + (maphash (lambda (k v) + (when (or (= 1 v) (not (file-exists-p k))) + (remhash k jao-doc-view--current-bmks))) + jao-doc-view--current-bmks))) (defun jao-doc-view-goto-bmk () (interactive) @@ -76,7 +75,9 @@ (when (string-equal (buffer-file-name (car buffs)) file) (throw 'done (car buffs))) (setq buffs (cdr buffs)))))) - (if b (pop-to-buffer b) (find-file file)))) + (if b + (pop-to-buffer b) + (when (file-exists-p file) (find-file file))))) (defun jao-doc-view-session (&optional file) (let ((file (or file jao-doc-view-session-file))) -- cgit v1.2.3