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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Manuel Giraud <manuel@HIDDEN>; Keywords: patch; dated Fri, 26 Jul 2024 15:51:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 72305 <at> debbugs.gnu.org:


Received: (at 72305) by debbugs.gnu.org; 27 Jul 2024 17:01:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 27 13:01:41 2024
Received: from localhost ([127.0.0.1]:42299 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sXkna-0007Lr-8F
	for submit <at> debbugs.gnu.org; Sat, 27 Jul 2024 13:01:41 -0400
Received: from ledu-giraud.fr ([51.159.28.247]:7261)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <manuel@HIDDEN>) id 1sXknT-0007L2-PP
 for 72305 <at> debbugs.gnu.org; Sat, 27 Jul 2024 13:01:36 -0400
DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=Vu/Gs3db
 EQA351lgozGD0aqdtLNYS1s/Yb7grnQ/V1s=;
 h=date:references:in-reply-to:
 subject:cc:to:from; d=ledu-giraud.fr; b=tEuF9cXNpMUoWTAiI5LaTC41fBGKwM
 dwsNABjTeY/Lb5ZIIFFGoBZUT7RZMMZ8WgOHSwQ/pM3i2xCY+hHTjDDg==
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=Vu/Gs3dbEQA351lg
 ozGD0aqdtLNYS1s/Yb7grnQ/V1s=;
 h=date:references:in-reply-to:subject:
 cc:to:from; d=ledu-giraud.fr; b=Z2K/Njg/heNWasj/2Xbn4kW+yacG01EBLjpbrV
 4FC9Nv1/YvkFqGu86losaJwLvmtN7Cac587MkMRbC2W1mnPqcnElO1hM07DlLfKRk/9qOX
 CAOGXE0DsUfMc8bnCmf6T9Gw1vCNDGSJ/fmMlfH//8HWj/RIZUClkQjh4/heP2sRw7kFnh
 cH5J98cZRKWBcxxclz/ptaKiOgB5z9trVNIe+U/SlEIhjzvfTtS5K9MnVsSb9H6mLR/TF3
 NXUuQJRUS5WvHlBuWCzfjJd+c6kMYhVRzprffWisXNqjH1vIbSLydcM3gxgG4Sl5brthAm
 Zezs658oERNjF+qX4fzg1OKg==
Received: from computer (<unknown> [10.1.1.1])
 by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id a60d72dc
 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); 
 Sat, 27 Jul 2024 19:01:17 +0200 (CEST)
From: Manuel Giraud <manuel@HIDDEN>
To: Jeremy Bryant <jb@HIDDEN>
Subject: Re: bug#72305: [PATCH] Fix DocView's text conversion on tty Emacs
In-Reply-To: <871q3esw3f.fsf@HIDDEN> (Manuel Giraud's message of "Sat, 
 27 Jul 2024 17:17:24 +0200")
References: <878qxorw4k.fsf@HIDDEN> <87cymzakq7.fsf@HIDDEN>
 <871q3esw3f.fsf@HIDDEN>
Date: Sat, 27 Jul 2024 19:01:13 +0200
Message-ID: <877cd6lqg6.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 1.7 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: Manuel Giraud <manuel@HIDDEN> writes: > Jeremy Bryant
 <jb@HIDDEN> writes: > >> Manuel Giraud via "Bug reports for GNU
 Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> writes:
 >> >>> Tags: patch >>> >>> Hi, >> [...] 
 Content analysis details:   (1.7 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 1.7 URIBL_BLACK            Contains an URL listed in the URIBL blacklist
 [URIs: jeremybryant.net]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 T_SPF_HELO_TEMPERROR   SPF: test of HELO record failed (temperror)
X-Debbugs-Envelope-To: 72305
Cc: "Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of
 text editors" <bug-gnu-emacs@HIDDEN>, 72305 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.7 (/)

Manuel Giraud <manuel@HIDDEN> writes:

> Jeremy Bryant <jb@HIDDEN> writes:
>
>> Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> 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@HIDDEN:
bug#72305; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 27 Jul 2024 17:01:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 27 13:01:44 2024
Received: from localhost ([127.0.0.1]:42302 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sXknf-0007Nj-Rd
	for submit <at> debbugs.gnu.org; Sat, 27 Jul 2024 13:01:44 -0400
Received: from lists.gnu.org ([209.51.188.17]:38482)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <manuel@HIDDEN>) id 1sXkne-0007N2-5F
 for submit <at> debbugs.gnu.org; Sat, 27 Jul 2024 13:01:42 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <manuel@HIDDEN>)
 id 1sXknN-0003gz-Ug
 for bug-gnu-emacs@HIDDEN; Sat, 27 Jul 2024 13:01:28 -0400
Received: from ledu-giraud.fr ([51.159.28.247])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <manuel@HIDDEN>)
 id 1sXknL-0001s2-Tj
 for bug-gnu-emacs@HIDDEN; Sat, 27 Jul 2024 13:01:25 -0400
DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=Vu/Gs3db
 EQA351lgozGD0aqdtLNYS1s/Yb7grnQ/V1s=;
 h=date:references:in-reply-to:
 subject:cc:to:from; d=ledu-giraud.fr; b=tEuF9cXNpMUoWTAiI5LaTC41fBGKwM
 dwsNABjTeY/Lb5ZIIFFGoBZUT7RZMMZ8WgOHSwQ/pM3i2xCY+hHTjDDg==
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=Vu/Gs3dbEQA351lg
 ozGD0aqdtLNYS1s/Yb7grnQ/V1s=;
 h=date:references:in-reply-to:subject:
 cc:to:from; d=ledu-giraud.fr; b=Z2K/Njg/heNWasj/2Xbn4kW+yacG01EBLjpbrV
 4FC9Nv1/YvkFqGu86losaJwLvmtN7Cac587MkMRbC2W1mnPqcnElO1hM07DlLfKRk/9qOX
 CAOGXE0DsUfMc8bnCmf6T9Gw1vCNDGSJ/fmMlfH//8HWj/RIZUClkQjh4/heP2sRw7kFnh
 cH5J98cZRKWBcxxclz/ptaKiOgB5z9trVNIe+U/SlEIhjzvfTtS5K9MnVsSb9H6mLR/TF3
 NXUuQJRUS5WvHlBuWCzfjJd+c6kMYhVRzprffWisXNqjH1vIbSLydcM3gxgG4Sl5brthAm
 Zezs658oERNjF+qX4fzg1OKg==
Received: from computer (<unknown> [10.1.1.1])
 by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id a60d72dc
 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); 
 Sat, 27 Jul 2024 19:01:17 +0200 (CEST)
From: Manuel Giraud <manuel@HIDDEN>
To: Jeremy Bryant <jb@HIDDEN>
Subject: Re: bug#72305: [PATCH] Fix DocView's text conversion on tty Emacs
In-Reply-To: <871q3esw3f.fsf@HIDDEN> (Manuel Giraud's message of "Sat, 
 27 Jul 2024 17:17:24 +0200")
References: <878qxorw4k.fsf@HIDDEN> <87cymzakq7.fsf@HIDDEN>
 <871q3esw3f.fsf@HIDDEN>
Date: Sat, 27 Jul 2024 19:01:13 +0200
Message-ID: <877cd6lqg6.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=51.159.28.247; envelope-from=manuel@HIDDEN;
 helo=ledu-giraud.fr
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: submit
Cc: "Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of
 text editors" <bug-gnu-emacs@HIDDEN>, 72305 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Manuel Giraud <manuel@HIDDEN> writes:

> Jeremy Bryant <jb@HIDDEN> writes:
>
>> Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> 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@HIDDEN:
bug#72305; Package emacs. Full text available.

Message received at 72305 <at> debbugs.gnu.org:


Received: (at 72305) by debbugs.gnu.org; 27 Jul 2024 15:17:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 27 11:17:44 2024
Received: from localhost ([127.0.0.1]:42117 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sXjB1-000242-Rf
	for submit <at> debbugs.gnu.org; Sat, 27 Jul 2024 11:17:44 -0400
Received: from ledu-giraud.fr ([51.159.28.247]:14621)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <manuel@HIDDEN>) id 1sXjAz-00022u-6z
 for 72305 <at> debbugs.gnu.org; Sat, 27 Jul 2024 11:17:43 -0400
DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=h8dy+2OA
 hhFAgco+fnjjALiopzaNfb1FCD1M9krVXRA=;
 h=date:references:in-reply-to:
 subject:cc:to:from; d=ledu-giraud.fr; b=YG4kGJDZPY2YQ31/Fygpo4mD5XbaSy
 zILrSw57zc8ylsXkxkt/rJpFnzIfBzjuSF2TeVa6FB5HuELTIHS6FzBQ==
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=h8dy+2OAhhFAgco+
 fnjjALiopzaNfb1FCD1M9krVXRA=;
 h=date:references:in-reply-to:subject:
 cc:to:from; d=ledu-giraud.fr; b=0Loq2+YaAbuP/0FkAVM7UFntVdbTH6V3Aizgpp
 iA9UImtNLVvYh/0I5OtF7D+dGA51GyOFlus2Xz3VTdAls/FbdZSTrPiAc4La5aQfMuuY+J
 iP8HiVqvlnOoeVNTgoYY39BcAmzSmqZjaNFExq689mHQOTqrAwRPzsid45MaAW6IFwXU3G
 phi0qqfeTs8taMoX3ycJSAdboZ6PfUAgvVv6AxTWRvxDxuAYRFkLmM8P+5nbupGxRAVdv6
 fzE6Q7cdHGBa28N57qut+lbYjv5G4Uv5qYpnBW/a9mkx5udlwx2lzGlWqHYThEMDBtRZKU
 S6DNzq+Mesi1psbv9NtM3NHg==
Received: from computer (<unknown> [10.1.1.1])
 by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 54e9b331
 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); 
 Sat, 27 Jul 2024 17:17:27 +0200 (CEST)
From: Manuel Giraud <manuel@HIDDEN>
To: Jeremy Bryant <jb@HIDDEN>
Subject: Re: bug#72305: [PATCH] Fix DocView's text conversion on tty Emacs
In-Reply-To: <87cymzakq7.fsf@HIDDEN> (Jeremy Bryant's message of
 "Fri, 26 Jul 2024 22:48:00 +0100")
References: <878qxorw4k.fsf@HIDDEN> <87cymzakq7.fsf@HIDDEN>
Date: Sat, 27 Jul 2024 17:17:24 +0200
Message-ID: <871q3esw3f.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 1.7 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: Jeremy Bryant <jb@HIDDEN> writes: > Manuel Giraud
 via "Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
 writes: > >> Tags: patch >> >> Hi, >> >> When doing 'M-x doc-view-mode' on
 document buffer [...] 
 Content analysis details:   (1.7 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 1.7 URIBL_BLACK            Contains an URL listed in the URIBL blacklist
 [URIs: jeremybryant.net]
X-Debbugs-Envelope-To: 72305
Cc: "Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of
 text editors" <bug-gnu-emacs@HIDDEN>, 72305 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.7 (/)

Jeremy Bryant <jb@HIDDEN> writes:

> Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> 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@HIDDEN:
bug#72305; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 27 Jul 2024 15:17:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 27 11:17:48 2024
Received: from localhost ([127.0.0.1]:42119 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sXjB6-00024p-6y
	for submit <at> debbugs.gnu.org; Sat, 27 Jul 2024 11:17:48 -0400
Received: from lists.gnu.org ([209.51.188.17]:44064)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <manuel@HIDDEN>) id 1sXjB1-00023K-3q
 for submit <at> debbugs.gnu.org; Sat, 27 Jul 2024 11:17:43 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <manuel@HIDDEN>)
 id 1sXjAq-000403-LP
 for bug-gnu-emacs@HIDDEN; Sat, 27 Jul 2024 11:17:32 -0400
Received: from ledu-giraud.fr ([51.159.28.247])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <manuel@HIDDEN>)
 id 1sXjAo-0001gw-Q1
 for bug-gnu-emacs@HIDDEN; Sat, 27 Jul 2024 11:17:32 -0400
DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=h8dy+2OA
 hhFAgco+fnjjALiopzaNfb1FCD1M9krVXRA=;
 h=date:references:in-reply-to:
 subject:cc:to:from; d=ledu-giraud.fr; b=YG4kGJDZPY2YQ31/Fygpo4mD5XbaSy
 zILrSw57zc8ylsXkxkt/rJpFnzIfBzjuSF2TeVa6FB5HuELTIHS6FzBQ==
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=h8dy+2OAhhFAgco+
 fnjjALiopzaNfb1FCD1M9krVXRA=;
 h=date:references:in-reply-to:subject:
 cc:to:from; d=ledu-giraud.fr; b=0Loq2+YaAbuP/0FkAVM7UFntVdbTH6V3Aizgpp
 iA9UImtNLVvYh/0I5OtF7D+dGA51GyOFlus2Xz3VTdAls/FbdZSTrPiAc4La5aQfMuuY+J
 iP8HiVqvlnOoeVNTgoYY39BcAmzSmqZjaNFExq689mHQOTqrAwRPzsid45MaAW6IFwXU3G
 phi0qqfeTs8taMoX3ycJSAdboZ6PfUAgvVv6AxTWRvxDxuAYRFkLmM8P+5nbupGxRAVdv6
 fzE6Q7cdHGBa28N57qut+lbYjv5G4Uv5qYpnBW/a9mkx5udlwx2lzGlWqHYThEMDBtRZKU
 S6DNzq+Mesi1psbv9NtM3NHg==
Received: from computer (<unknown> [10.1.1.1])
 by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 54e9b331
 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); 
 Sat, 27 Jul 2024 17:17:27 +0200 (CEST)
From: Manuel Giraud <manuel@HIDDEN>
To: Jeremy Bryant <jb@HIDDEN>
Subject: Re: bug#72305: [PATCH] Fix DocView's text conversion on tty Emacs
In-Reply-To: <87cymzakq7.fsf@HIDDEN> (Jeremy Bryant's message of
 "Fri, 26 Jul 2024 22:48:00 +0100")
References: <878qxorw4k.fsf@HIDDEN> <87cymzakq7.fsf@HIDDEN>
Date: Sat, 27 Jul 2024 17:17:24 +0200
Message-ID: <871q3esw3f.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=51.159.28.247; envelope-from=manuel@HIDDEN;
 helo=ledu-giraud.fr
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: submit
Cc: "Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of
 text editors" <bug-gnu-emacs@HIDDEN>, 72305 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Jeremy Bryant <jb@HIDDEN> writes:

> Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> 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@HIDDEN:
bug#72305; Package emacs. Full text available.

Message received at 72305 <at> debbugs.gnu.org:


Received: (at 72305) by debbugs.gnu.org; 26 Jul 2024 21:48:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 26 17:48:50 2024
Received: from localhost ([127.0.0.1]:40185 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sXSnx-0007Ji-Ok
	for submit <at> debbugs.gnu.org; Fri, 26 Jul 2024 17:48:50 -0400
Received: from out-172.mta1.migadu.com ([95.215.58.172]:12171)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jb@HIDDEN>) id 1sXSnv-0007JU-Pz
 for 72305 <at> debbugs.gnu.org; Fri, 26 Jul 2024 17:48:48 -0400
X-Report-Abuse: Please report any abuse attempt to abuse@HIDDEN and
 include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jeremybryant.net;
 s=key1; t=1722030482;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=k/KX6I5wgC2R21yIYRr1bpGqg8cL6Hy04WDifb3zIAM=;
 b=MVns1qqkNLRObCBLiHaN4grK0EfBBh2aR5ZuNPZj76QJ007FAvCWzcRJCw+3wbAi05/lUf
 OMeFqD0sSOARkgIZkCnynpFKoBWtXlajhCsOrsGWih3ILk7AEamgwJNcZmHKTgpYV8U/40
 P4hD1dIM9c/yI134R063gCPhow2dse3qL9v26wYWgz3wp5bAVaKYKriPfrxMvRlKbADG1G
 V25N8JBIK4P5PirUkEmivvenJjZrEvbNRQc9c5dpEUyNdnG/evX4+aqGFVE2irnR1r+UKI
 Du1gdsk6aB8BCx7NYcJcfm6pHYi3OpKr7jtx3xowfYpgyGFgjY2QyRf3WxIC2g==
From: Jeremy Bryant <jb@HIDDEN>
To: Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of
 text editors" <bug-gnu-emacs@HIDDEN>
Subject: Re: bug#72305: [PATCH] Fix DocView's text conversion on tty Emacs
In-Reply-To: <878qxorw4k.fsf@HIDDEN> (Manuel Giraud via's message of
 "Fri, 26 Jul 2024 17:49:47 +0200")
References: <878qxorw4k.fsf@HIDDEN>
Date: Fri, 26 Jul 2024 22:48:00 +0100
Message-ID: <87cymzakq7.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Migadu-Flow: FLOW_OUT
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 72305
Cc: 72305 <at> debbugs.gnu.org, Manuel Giraud <manuel@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> 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@HIDDEN:
bug#72305; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 26 Jul 2024 21:48:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 26 17:48:24 2024
Received: from localhost ([127.0.0.1]:40181 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sXSnY-0007J4-89
	for submit <at> debbugs.gnu.org; Fri, 26 Jul 2024 17:48:24 -0400
Received: from lists.gnu.org ([209.51.188.17]:54278)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jb@HIDDEN>) id 1sXSnV-0007Iw-65
 for submit <at> debbugs.gnu.org; Fri, 26 Jul 2024 17:48:23 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <jb@HIDDEN>)
 id 1sXSnL-0001q8-7d
 for bug-gnu-emacs@HIDDEN; Fri, 26 Jul 2024 17:48:11 -0400
Received: from out-179.mta1.migadu.com ([2001:41d0:203:375::b3])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <jb@HIDDEN>)
 id 1sXSnG-0007Y5-TL
 for bug-gnu-emacs@HIDDEN; Fri, 26 Jul 2024 17:48:10 -0400
X-Report-Abuse: Please report any abuse attempt to abuse@HIDDEN and
 include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jeremybryant.net;
 s=key1; t=1722030482;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=k/KX6I5wgC2R21yIYRr1bpGqg8cL6Hy04WDifb3zIAM=;
 b=MVns1qqkNLRObCBLiHaN4grK0EfBBh2aR5ZuNPZj76QJ007FAvCWzcRJCw+3wbAi05/lUf
 OMeFqD0sSOARkgIZkCnynpFKoBWtXlajhCsOrsGWih3ILk7AEamgwJNcZmHKTgpYV8U/40
 P4hD1dIM9c/yI134R063gCPhow2dse3qL9v26wYWgz3wp5bAVaKYKriPfrxMvRlKbADG1G
 V25N8JBIK4P5PirUkEmivvenJjZrEvbNRQc9c5dpEUyNdnG/evX4+aqGFVE2irnR1r+UKI
 Du1gdsk6aB8BCx7NYcJcfm6pHYi3OpKr7jtx3xowfYpgyGFgjY2QyRf3WxIC2g==
From: Jeremy Bryant <jb@HIDDEN>
To: Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of
 text editors" <bug-gnu-emacs@HIDDEN>
Subject: Re: bug#72305: [PATCH] Fix DocView's text conversion on tty Emacs
In-Reply-To: <878qxorw4k.fsf@HIDDEN> (Manuel Giraud via's message of
 "Fri, 26 Jul 2024 17:49:47 +0200")
References: <878qxorw4k.fsf@HIDDEN>
Date: Fri, 26 Jul 2024 22:48:00 +0100
Message-ID: <87cymzakq7.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Migadu-Flow: FLOW_OUT
Received-SPF: pass client-ip=2001:41d0:203:375::b3;
 envelope-from=jb@HIDDEN; helo=out-179.mta1.migadu.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: submit
Cc: 72305 <at> debbugs.gnu.org, Manuel Giraud <manuel@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> 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@HIDDEN:
bug#72305; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 26 Jul 2024 15:50:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 26 11:50:10 2024
Received: from localhost ([127.0.0.1]:39882 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sXNCr-0001G2-Tk
	for submit <at> debbugs.gnu.org; Fri, 26 Jul 2024 11:50:10 -0400
Received: from lists.gnu.org ([209.51.188.17]:45336)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <manuel@HIDDEN>) id 1sXNCq-0001Ft-1g
 for submit <at> debbugs.gnu.org; Fri, 26 Jul 2024 11:50:08 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <manuel@HIDDEN>)
 id 1sXNCh-000771-08
 for bug-gnu-emacs@HIDDEN; Fri, 26 Jul 2024 11:49:59 -0400
Received: from ledu-giraud.fr ([51.159.28.247])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <manuel@HIDDEN>)
 id 1sXNCe-0007K7-82
 for bug-gnu-emacs@HIDDEN; Fri, 26 Jul 2024 11:49:57 -0400
DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=TnPld7wa
 OarbFdSniYqsmDK6F5p+x+maGF35/FlFXYM=; h=date:subject:to:from; 
 d=ledu-giraud.fr;
 b=cfGnLxg/xP+yrAISme7ofAtNRnebpSUc8KFyBnC25bt7q2uyFG
 JHG05xWymi2VqfJ7B8jxZrwM4CXsFR+6pUAw==
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=TnPld7waOarbFdSn
 iYqsmDK6F5p+x+maGF35/FlFXYM=; h=date:subject:to:from;
 d=ledu-giraud.fr; b=Zvit1Tf7MphlKIh03tOeu9EWVXwaS3lkrUUypeNlpZuAGY3zGa
 XcomHy5cXNxA34WlwrIbZ38mzcjriHvnpy4ompUQUkDY4ReXyThr1+TfrEHJm8Kf0tskOj
 twZYpwVCYdVgxKYpsHD1/GQLZ3QjWH5NJNh9FetnRfJNv/Wvk26cE35V55m9iUDjS/RUyf
 VT0kwFuOXYITOLtsVtG6qxgmoZlsSy03EnaxEODGE5PgSeLx2nUL+AaY5O6OOfkkgHMcCS
 e5g+eylRCXIBILBqEbYD9KunTSvfWFyAMRufsO74pua7pBKYdD9jnRGKvcS4ZnKNsZmzLE
 tppkIIGHOFxA==
Received: from computer (<unknown> [10.1.1.1])
 by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 273cffd5
 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for <bug-gnu-emacs@HIDDEN>;
 Fri, 26 Jul 2024 17:49:49 +0200 (CEST)
From: Manuel Giraud <manuel@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] Fix DocView's text conversion on tty Emacs
Date: Fri, 26 Jul 2024 17:49:47 +0200
Message-ID: <878qxorw4k.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=51.159.28.247; envelope-from=manuel@HIDDEN;
 helo=ledu-giraud.fr
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

--=-=-=
Content-Type: text/plain

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'


--=-=-=
Content-Type: text/patch
Content-Disposition: attachment;
 filename=0001-Fix-DocView-s-text-conversion-on-tty-Emacs.patch

From 645544da19787ac6a79c7b8d63cd1b037cedbf32 Mon Sep 17 00:00:00 2001
From: Manuel Giraud <manuel@HIDDEN>
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


--=-=-=
Content-Type: text/plain


-- 
Manuel Giraud

--=-=-=--




Acknowledgement sent to Manuel Giraud <manuel@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#72305; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 12 Jan 2025 05:45:02 UTC

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