diff options
author | Vasilij Schneidermann <mail@vasilij.de> | 2020-05-02 00:59:45 +0200 |
---|---|---|
committer | Vasilij Schneidermann <mail@vasilij.de> | 2020-05-02 00:59:45 +0200 |
commit | 20bac1a7b4f4546bde0344d9df3bab941cf21aa7 (patch) | |
tree | 1ede1a5e9697e93698089b2080e4c623df7607f0 /nov.el | |
parent | 2eec3f2e713baec814999359bb4580fbf2efd5b9 (diff) |
Revisit relative files visiting logic again
Diffstat (limited to 'nov.el')
-rw-r--r-- | nov.el | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -648,17 +648,17 @@ the HTML is rendered with `nov-render-html-function'." (defun nov-visit-relative-file (filename target) "Visit the document as specified by FILENAME and TARGET." - (let ((index nov-documents-index) - (shr-target-id target)) - (when (not (zerop (length filename))) - (let* ((current-path (cdr (aref nov-documents nov-documents-index))) - (directory (file-name-directory current-path)) - (path (file-truename (nov-make-path directory filename))) - (index (nov-find-document - (lambda (doc) (equal path (file-truename (cdr doc))))))) - (when (not index) - (error "Couldn't locate document")) - (nov-goto-document index)))) + (when (not (zerop (length filename))) + (let* ((current-path (cdr (aref nov-documents nov-documents-index))) + (directory (file-name-directory current-path)) + (path (file-truename (nov-make-path directory filename))) + (index (nov-find-document + (lambda (doc) (equal path (file-truename (cdr doc))))))) + (when (not index) + (error "Couldn't locate document")) + (setq nov-documents-index index))) + (let ((shr-target-id target)) + (nov-goto-document nov-documents-index)) (when target (let ((pos (next-single-property-change (point-min) 'shr-target-id))) (when (not pos) |