summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-04-09 16:16:16 +0100
committerjao <jao@gnu.org>2021-04-09 16:16:16 +0100
commit21d52e5271490866eda6aa4cd735e9f3bb3d5d62 (patch)
treed6f3c823db1833c2d5d71018a75957351c351b3c /lib
parent4775d22fd80895029378dce7467cb422570897c6 (diff)
downloadelibs-21d52e5271490866eda6aa4cd735e9f3bb3d5d62.tar.gz
elibs-21d52e5271490866eda6aa4cd735e9f3bb3d5d62.tar.bz2
fix for pdf title guesser
Diffstat (limited to 'lib')
-rw-r--r--lib/doc/jao-doc-view.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/doc/jao-doc-view.el b/lib/doc/jao-doc-view.el
index 713caf9..93bf316 100644
--- a/lib/doc/jao-doc-view.el
+++ b/lib/doc/jao-doc-view.el
@@ -121,7 +121,7 @@
(let ((page (or page (jao-doc-view-current-page)))
(outline jao--pdf-outline)
(cur-page 0)
- (cur-title (jao-doc-view-title)))
+ (cur-title (jao-doc-view-title buffer-file-name)))
(while (and (car outline) (< cur-page page))
(setq cur-page (cdr (assoc 'page (car outline))))
(when (<= cur-page page)
@@ -133,7 +133,8 @@
(if (or fname (not (derived-mode-p 'doc-view-mode 'pdf-view-mode)))
(let ((base (file-name-base (or fname (buffer-file-name)))))
(capitalize (replace-regexp-in-string "-" " " base)))
- (or (jao-doc-view-section-title) (jao-doc-view-title buffer-file-name))))
+ (or (jao-doc-view-section-title)
+ (when buffer-file-name (jao-doc-view-title buffer-file-name)))))
;;; imenu