Subject: bug#72305: closed (Re: bug#72305: [PATCH] Fix DocView's text conversion on tty Emacs)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 23 Feb 2025 13:45:02 +0000

Your bug report

#72305: [PATCH] Fix DocView's text conversion on tty Emacs

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
72305: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=72305
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#72305: [PATCH] Fix DocView's text conversion on tty Emacs
From: Stefan Kangas <[email-masked]>
To: Tassilo Horn <[email-masked]>
Cc: [email-masked], Manuel Giraud <[email-masked]>
Date: Sun, 23 Feb 2025 13:44:26 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 31.1

Tassilo Horn <[email-masked]> writes:

>> Tassilo, any comments on this patch?
>
> It's so simple that it's obviously right.

Thanks, installed on master as commit 09bef781326.

I'm therefore closing this bug report.

Subject: [PATCH] Fix DocView's text conversion on tty Emacs
From: Manuel Giraud <[email-masked]>
To: [email-masked]
Date: Fri, 26 Jul 2024 17:49:47 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Tags: patch

Hi,

When doing 'M-x doc-view-mode' on document buffer in "emacs -nw", Emacs
proposes to convert this document to the text version and if the user
says "yes" it calls `doc-view-open-text'.

`doc-view-open-text' tries to get the current page by calling the
`doc-view-current-page' but this latter relies on
`image-mode-window-get' which most probably return nil on a tty.

In GNU Emacs 31.0.50 (build 1, x86_64-unknown-openbsd7.5, cairo version
 1.18.0) of 2024-07-26 built on computer
Repository revision: 52cae67e1e73615fff184abcc8e635d80f8846ad
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101013
System Description: OpenBSD computer 7.5 GENERIC.MP#207 amd64

Configured using:
 'configure CC=egcc CPPFLAGS=-I/usr/local/include
 LDFLAGS=-L/usr/local/lib MAKEINFO=gmakeinfo --prefix=/home/manuel/emacs
 --bindir=/home/manuel/bin --with-x-toolkit=no --with-cairo
 --without-compress-install'

>From 645544da19787ac6a79c7b8d63cd1b037cedbf32 Mon Sep 17 00:00:00 2001
From: Manuel Giraud <[email-masked]>
Date: Fri, 26 Jul 2024 17:37:02 +0200
Subject: [PATCH] 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.
---
 lisp/doc-view.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index 63e0de9afe3..72a9ec16c45 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -1766,7 +1766,7 @@ doc-view-open-text
   (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))))
-- 
2.45.2

-- 
Manuel Giraud