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

To reply to this bug, email your comments to 72305 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#72305; Package emacs. (Fri, 26 Jul 2024 15:51:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Manuel Giraud <manuel <at> ledu-giraud.fr>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 26 Jul 2024 15:51:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Fix DocView's text conversion on tty Emacs
Date: Fri, 26 Jul 2024 17:49:47 +0200
[Message part 1 (text/plain, inline)]
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'

[0001-Fix-DocView-s-text-conversion-on-tty-Emacs.patch (text/patch, attachment)]
[Message part 3 (text/plain, inline)]
-- 
Manuel Giraud

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72305; Package emacs. (Fri, 26 Jul 2024 21:49:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jeremy Bryant <jb <at> jeremybryant.net>
To: Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of
 text editors" <bug-gnu-emacs <at> gnu.org>
Cc: 72305 <at> debbugs.gnu.org, Manuel Giraud <manuel <at> ledu-giraud.fr>
Subject: Re: bug#72305: [PATCH] Fix DocView's text conversion on tty Emacs
Date: Fri, 26 Jul 2024 22:48:00 +0100
Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org> writes:

> 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.

I can't reproduce this bug on 29.4, could you provide a more complete
recipe starting from emacs -Q?
>
> 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'
>
> [2. text/patch; 0001-Fix-DocView-s-text-conversion-on-tty-Emacs.patch]...




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72305; Package emacs. (Fri, 26 Jul 2024 21:49:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72305; Package emacs. (Sat, 27 Jul 2024 15:18:02 GMT) Full text and rfc822 format available.

Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Jeremy Bryant <jb <at> jeremybryant.net>
Cc: "Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of
 text editors" <bug-gnu-emacs <at> gnu.org>, 72305 <at> debbugs.gnu.org
Subject: Re: bug#72305: [PATCH] Fix DocView's text conversion on tty Emacs
Date: Sat, 27 Jul 2024 17:17:24 +0200
Jeremy Bryant <jb <at> jeremybryant.net> writes:

> Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org> writes:
>
>> 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.
>
> I can't reproduce this bug on 29.4, could you provide a more complete
> recipe starting from emacs -Q?

You're right but I see an error nevertheless.  Here is my recipe:

       - emacs -Q -nw
       - C-x C-f "a_doc_for_example_a.pdf"
       - M-x doc-view-mode ;; No automatic mode detection (I think it
                           ;; would be the object of another bug report)
       - Answer "y" to the question "Unable to render file.  View
         extracted text instead? "

Here I see an error in 29.4 but the text version is rendered anyway.  In
30 (or master), I see an error and the text version is not rendered.
-- 
Manuel Giraud




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72305; Package emacs. (Sat, 27 Jul 2024 15:18:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72305; Package emacs. (Sat, 27 Jul 2024 17:02:02 GMT) Full text and rfc822 format available.

Message #20 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Jeremy Bryant <jb <at> jeremybryant.net>
Cc: "Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of
 text editors" <bug-gnu-emacs <at> gnu.org>, 72305 <at> debbugs.gnu.org
Subject: Re: bug#72305: [PATCH] Fix DocView's text conversion on tty Emacs
Date: Sat, 27 Jul 2024 19:01:13 +0200
Manuel Giraud <manuel <at> ledu-giraud.fr> writes:

> Jeremy Bryant <jb <at> jeremybryant.net> writes:
>
>> Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org> writes:
>>
>>> 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.
>>
>> I can't reproduce this bug on 29.4, could you provide a more complete
>> recipe starting from emacs -Q?
>
> You're right but I see an error nevertheless.  Here is my recipe:
>
>        - emacs -Q -nw
>        - C-x C-f "a_doc_for_example_a.pdf"
>        - M-x doc-view-mode ;; No automatic mode detection (I think it
>                            ;; would be the object of another bug report)
>        - Answer "y" to the question "Unable to render file.  View
>          extracted text instead? "
>
> Here I see an error in 29.4 but the text version is rendered anyway.  In
> 30 (or master), I see an error and the text version is not rendered.

Erratum

   - 29.4 and 30 behave the same: an error but shows the text version anyway
   - master: error and no text version shown
-- 
Manuel Giraud




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72305; Package emacs. (Sat, 27 Jul 2024 17:02:02 GMT) Full text and rfc822 format available.

This bug report was last modified 82 days ago.

Previous Next


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