Fix DocView's text conversion on tty Emacs

* lisp/doc-view.el (doc-view-open-text): Defaults to first page
should `doc-view-current-page' return nil.  (Bug#72305)
This commit is contained in:
Manuel Giraud 2024-07-26 17:37:02 +02:00 committed by Stefan Kangas
parent 71a4670a9f
commit 93f62f10f7

View file

@ -1798,7 +1798,7 @@ For now these keys are useful:
(if doc-view--current-converter-processes
(message "DocView: please wait till conversion finished.")
(let ((txt (expand-file-name "doc.txt" (doc-view--current-cache-dir)))
(page (doc-view-current-page)))
(page (or (doc-view-current-page) 1)))
(if (file-readable-p txt)
(let ((dv-bfn doc-view--buffer-file-name)
(dv-text-buffer-name (format "%s/text" (buffer-name))))