GNU bug report logs - #72305
[PATCH] Fix DocView's text conversion on tty Emacs

Previous Next

Package: emacs;

Reported by: Manuel Giraud <manuel <at> ledu-giraud.fr>

Date: Fri, 26 Jul 2024 15:51:01 UTC

Severity: normal

Tags: patch

Fixed in version 31.1

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Tassilo Horn <tsdh <at> gnu.org>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 72305 <at> debbugs.gnu.org, Manuel Giraud <manuel <at> ledu-giraud.fr>
Subject: bug#72305: [PATCH] Fix DocView's text conversion on tty Emacs
Date: Sun, 23 Feb 2025 10:15:35 +0100
Stefan Kangas <stefankangas <at> gmail.com> writes:

>> 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.
>
> Tassilo, any comments on this patch?

It's so simple that it's obviously right.

Bye,
Tassilo

>>>From 645544da19787ac6a79c7b8d63cd1b037cedbf32 Mon Sep 17 00:00:00 2001
>> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
>> 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




This bug report was last modified 88 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.