From unknown Sat Jun 21 05:08:22 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#72305 <72305@debbugs.gnu.org> To: bug#72305 <72305@debbugs.gnu.org> Subject: Status: [PATCH] Fix DocView's text conversion on tty Emacs Reply-To: bug#72305 <72305@debbugs.gnu.org> Date: Sat, 21 Jun 2025 12:08:22 +0000 retitle 72305 [PATCH] Fix DocView's text conversion on tty Emacs reassign 72305 emacs submitter 72305 Manuel Giraud severity 72305 normal tag 72305 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 26 11:50:10 2024 Received: (at submit) by debbugs.gnu.org; 26 Jul 2024 15:50:10 +0000 Received: from localhost ([127.0.0.1]:39882 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXNCr-0001G2-Tk for submit@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 ) id 1sXNCq-0001Ft-1g for submit@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 ) id 1sXNCh-000771-08 for bug-gnu-emacs@gnu.org; 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 ) id 1sXNCe-0007K7-82 for bug-gnu-emacs@gnu.org; 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 ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 273cffd5 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Fri, 26 Jul 2024 17:49:49 +0200 (CEST) From: Manuel Giraud To: bug-gnu-emacs@gnu.org Subject: [PATCH] Fix DocView's text conversion on tty Emacs Date: Fri, 26 Jul 2024 17:49:47 +0200 Message-ID: <878qxorw4k.fsf@ledu-giraud.fr> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=51.159.28.247; envelope-from=manuel@ledu-giraud.fr; 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@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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 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 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 26 17:48:24 2024 Received: (at submit) by debbugs.gnu.org; 26 Jul 2024 21:48:24 +0000 Received: from localhost ([127.0.0.1]:40181 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXSnY-0007J4-89 for submit@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 ) id 1sXSnV-0007Iw-65 for submit@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 ) id 1sXSnL-0001q8-7d for bug-gnu-emacs@gnu.org; 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 ) id 1sXSnG-0007Y5-TL for bug-gnu-emacs@gnu.org; Fri, 26 Jul 2024 17:48:10 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com 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 To: Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Subject: Re: bug#72305: [PATCH] Fix DocView's text conversion on tty Emacs In-Reply-To: <878qxorw4k.fsf@ledu-giraud.fr> (Manuel Giraud via's message of "Fri, 26 Jul 2024 17:49:47 +0200") References: <878qxorw4k.fsf@ledu-giraud.fr> Date: Fri, 26 Jul 2024 22:48:00 +0100 Message-ID: <87cymzakq7.fsf@jeremybryant.net> 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@jeremybryant.net; 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@debbugs.gnu.org, Manuel Giraud X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" 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]... From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 27 11:17:48 2024 Received: (at submit) by debbugs.gnu.org; 27 Jul 2024 15:17:48 +0000 Received: from localhost ([127.0.0.1]:42119 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXjB6-00024p-6y for submit@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 ) id 1sXjB1-00023K-3q for submit@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 ) id 1sXjAq-000403-LP for bug-gnu-emacs@gnu.org; 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 ) id 1sXjAo-0001gw-Q1 for bug-gnu-emacs@gnu.org; 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 ( [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 To: Jeremy Bryant Subject: Re: bug#72305: [PATCH] Fix DocView's text conversion on tty Emacs In-Reply-To: <87cymzakq7.fsf@jeremybryant.net> (Jeremy Bryant's message of "Fri, 26 Jul 2024 22:48:00 +0100") References: <878qxorw4k.fsf@ledu-giraud.fr> <87cymzakq7.fsf@jeremybryant.net> Date: Sat, 27 Jul 2024 17:17:24 +0200 Message-ID: <871q3esw3f.fsf@ledu-giraud.fr> 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@ledu-giraud.fr; 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" , 72305@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Jeremy Bryant writes: > Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" 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 From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 27 13:01:44 2024 Received: (at submit) by debbugs.gnu.org; 27 Jul 2024 17:01:44 +0000 Received: from localhost ([127.0.0.1]:42302 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXknf-0007Nj-Rd for submit@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 ) id 1sXkne-0007N2-5F for submit@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 ) id 1sXknN-0003gz-Ug for bug-gnu-emacs@gnu.org; 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 ) id 1sXknL-0001s2-Tj for bug-gnu-emacs@gnu.org; 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 ( [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 To: Jeremy Bryant Subject: Re: bug#72305: [PATCH] Fix DocView's text conversion on tty Emacs In-Reply-To: <871q3esw3f.fsf@ledu-giraud.fr> (Manuel Giraud's message of "Sat, 27 Jul 2024 17:17:24 +0200") References: <878qxorw4k.fsf@ledu-giraud.fr> <87cymzakq7.fsf@jeremybryant.net> <871q3esw3f.fsf@ledu-giraud.fr> Date: Sat, 27 Jul 2024 19:01:13 +0200 Message-ID: <877cd6lqg6.fsf@ledu-giraud.fr> 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@ledu-giraud.fr; 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" , 72305@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Manuel Giraud writes: > Jeremy Bryant writes: > >> Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" 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 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 22 19:50:49 2025 Received: (at 72305) by debbugs.gnu.org; 23 Feb 2025 00:50:50 +0000 Received: from localhost ([127.0.0.1]:58048 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tm0Cn-0000OA-Gl for submit@debbugs.gnu.org; Sat, 22 Feb 2025 19:50:49 -0500 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]:52488) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tm0Ck-0000Np-8l for 72305@debbugs.gnu.org; Sat, 22 Feb 2025 19:50:47 -0500 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5ded6c31344so4669863a12.1 for <72305@debbugs.gnu.org>; Sat, 22 Feb 2025 16:50:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740271840; x=1740876640; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=76srrPV6ubcRNxell3alwqgVHlAVAYMPLDja7RRGKM8=; b=Pfl5t/9mn+TL46INAaYgMggNee+Gx9y7Gu0Nwk9gc9MvZkdE+FpzUBQf/EGpS2YM+T WpPPDrd46TyM2zSELGZCZe/1N4MVkS9HiKiM6+g0hAg7m3WVhk0OTjjQbfYvqHVephkg Mk4VesMdWSvgSWUr8b3mkouDXqWazKEHLplTiTwhc+XZxJAWREUspR1qcfY7Q99u4pGT k+VNRTQJqzMBSHfBMERr7JpINqMdCB71rEWXSehaWqXBWtgVWis5C9CzzSATLmEFdDKx o6sfEi3NjorqHtT2yqOx758JpfxFzyJv3h4Ws0+g8u6LCHK5AslMBffOCQ8BkNVuJvvK xl7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740271840; x=1740876640; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=76srrPV6ubcRNxell3alwqgVHlAVAYMPLDja7RRGKM8=; b=DKT2aBAToMyFSXpUO2zV1v7y35Cr0UkgyBUWAiWj8li4/B45rDnZHSWpwv+29jbJqQ K1YxxodqYt6Sp4LjyMpvJBk9HmclKIFXEOeoTZEPch0u+eCfjnHxgmC+I30p6AasjUrS Sf60EQSQOGkMQQbFn5f1uNDVq4cB7qwrg9p2NjfojiySpU35Vs5NAXpY/UMc9qMGQzdN sS3GRdn4/g6x6ryTYz9IcD1lcobgco2kfNW+04/w6lM4pQIEhMkF5wa2YwmnOJLrdVdG 7nuLtmRwN0/9a4m5taTADd11vS1Jn31bGimGZF/FCqAj9H+WejqkgMJip6izygMhnxVb hk+A== X-Gm-Message-State: AOJu0YyADXvLq3cWzNx6n2/Gj3nulA4MK/H2QJIykXLAqK6JVLEsccOi wGGFp3CJOrt4nVr/2D4N57wyHkcy/SgiEx6IEHHzSLjrroauV5aOStZJJeAZC1TsBY5E07CV3Mw 2T7+PG+WD6HmyWZLAaezMO0lW0gY= X-Gm-Gg: ASbGncslC2bajYVfyGIhAmLhazDfiZ7iEYQgY2TcThYLT82Ez8IZwNA4aOR/laIDJmh 0YrYwvu/QlRRjVznklUFkoEQxll46yWDnNlWQHhOlhjGnOjg453zYfV7C9TibIGSlwRYO7svhzw TiDqjctCEe X-Google-Smtp-Source: AGHT+IGAdE2buUVsFnzVofVISqpbhrGO99aorO5mJKJmZ3zpHIXbJcnQ1ecPIFWd6rlyOorenxK+6jh59o4wjW7Cxsg= X-Received: by 2002:a05:6402:3202:b0:5dc:796f:fc86 with SMTP id 4fb4d7f45d1cf-5e0b71121bfmr20965358a12.16.1740271840125; Sat, 22 Feb 2025 16:50:40 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 23 Feb 2025 00:50:39 +0000 From: Stefan Kangas In-Reply-To: <878qxorw4k.fsf@ledu-giraud.fr> References: <878qxorw4k.fsf@ledu-giraud.fr> MIME-Version: 1.0 Date: Sun, 23 Feb 2025 00:50:39 +0000 X-Gm-Features: AWEUYZnCUHf3vcqO7KudewP1_e7BM-MOtFW6531cxHf4uEyovq8msNhv9YLXrI0 Message-ID: Subject: Re: bug#72305: [PATCH] Fix DocView's text conversion on tty Emacs To: Manuel Giraud Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 72305 Cc: 72305@debbugs.gnu.org, Tassilo Horn X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Manuel Giraud 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? >>>From 645544da19787ac6a79c7b8d63cd1b037cedbf32 Mon Sep 17 00:00:00 2001 > From: Manuel Giraud > 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 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 23 04:15:48 2025 Received: (at 72305) by debbugs.gnu.org; 23 Feb 2025 09:15:48 +0000 Received: from localhost ([127.0.0.1]:59298 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tm85U-0004nN-5e for submit@debbugs.gnu.org; Sun, 23 Feb 2025 04:15:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46236) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tm85R-0004n4-Oy for 72305@debbugs.gnu.org; Sun, 23 Feb 2025 04:15:46 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tm85M-0006ya-Ej; Sun, 23 Feb 2025 04:15:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=ltQuodgbCnyGuXJ1aecaySOQ4YgUfBZiMZ0cmRuAuRI=; b=QAAcRsgdVCgilso7Opvs dybRnaZlGZQwZFFuy4ffXIJw1qB1/b9/KJLIWTJz2RghW76fNw716uO34SfRDIKuUZ2XX8ewhpXGw +OfFAr0uvvKYdOfyfKjVFN3b+eDHhurzyZ6FjvWW3w29mWZ+5UBaCgCPJob7ngeGw7hPV8oTLsk3h /zLM9lTbM+a9XpMkGUsnOYbw1LP3aiN8NnEjgCI67MYA7MhfnvPAPkIT4NBIQ70WPp8f6EfN/vULa 6OWzYVK7s5cPqnDBaXdXS+hrvo7c9Iuz8hXFIXlWIWidXExs8g4nF4r70w93BtogwOtaTdSdgMRAK AdTIzc+TDPAVvg==; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdejheegvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufgjfhgffffkgggtsehttdertddtredt necuhfhrohhmpefvrghsshhilhhoucfjohhrnhcuoehtshguhhesghhnuhdrohhrgheqne cuggftrfgrthhtvghrnhepleduvdegfeduvdejkeefteelgeetgfevhefhueffueffgeeh gfeufefgvdffgedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepthhhohhrnhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqkeei jeefkeejkeegqdeifeehvdelkedqthhsughhpeepghhnuhdrohhrghesfhgrshhtmhgrih hlrdhfmhdpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthht ohepjedvfedtheesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopehmrghnuh gvlheslhgvughuqdhgihhrrghuugdrfhhrpdhrtghpthhtohepshhtvghfrghnkhgrnhhg rghssehgmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail From: Tassilo Horn To: Stefan Kangas Subject: Re: bug#72305: [PATCH] Fix DocView's text conversion on tty Emacs In-Reply-To: References: <878qxorw4k.fsf@ledu-giraud.fr> User-Agent: mu4e 1.12.8; emacs 31.0.50 Date: Sun, 23 Feb 2025 10:15:35 +0100 Message-ID: <87tt8lowco.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 72305 Cc: 72305@debbugs.gnu.org, Manuel Giraud X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Kangas 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 >> 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 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 23 08:44:34 2025 Received: (at 72305-done) by debbugs.gnu.org; 23 Feb 2025 13:44:35 +0000 Received: from localhost ([127.0.0.1]:59948 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tmCHa-0001px-KW for submit@debbugs.gnu.org; Sun, 23 Feb 2025 08:44:34 -0500 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]:56559) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tmCHZ-0001pk-38 for 72305-done@debbugs.gnu.org; Sun, 23 Feb 2025 08:44:33 -0500 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-5e02eba02e8so4812679a12.0 for <72305-done@debbugs.gnu.org>; Sun, 23 Feb 2025 05:44:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740318267; x=1740923067; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=Hy8pVRULSfzDTl1DuuYLLNjYZFS+vVoV/okBG1dtN0A=; b=QyINAnvr93chzukbDy9IrUn97fyQ5KaaNx4/RNFr1TKrOYKfwZjkk0NAZU20fRopY4 y/mJ42f/KZTzN7uGRzX1QGvvRNU8NqzNYaTT/WQOI71cEvw/zkNaaxzKvxpTd6NT75Q3 nUxP0InzbGjBRHM5zBW411TXb5TNUaqACmGWyF4ELBA4xzwlOcr6iWOeIwnojfuo0QQt Ynvl1HJh5vvBXkUePmgfgcH5SYMlqaTsqwk3IlS8tCQBd8AyDweCoQqQPKnn/OBKmRvT CaJ3wH29ZHzjLQ7gzOOYr5vYR2FjBVDhsI3yFXt6WFRqb/4zThca3DC8UU/C5PWweJBw Vc4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740318267; x=1740923067; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Hy8pVRULSfzDTl1DuuYLLNjYZFS+vVoV/okBG1dtN0A=; b=ZE1vTsPOtPIjqRlVEXzWE/CQsubJunjUQays4SAM/o9EoWNg/AB8UOzwzg2tUm7fA3 DzvF/7+EMo+6K/6t58t8y4FA8MVjkRqFx/EZrm7Ysvp+myLJN+arqQQxX00FzP8Ft6BQ NAO9E5tboLE9wowCdsJIs9dG+PsONeA7gUN5sAIzGsZXMDildwzb/BQzPdukrx/oR4dw 0361AnNLDIyx/L6A2sEer6geH489LvAYOZzBInACjSwamiaicA6WEmLP7MzYH7++Yobu gXnkVOkHncz/Hi5JWYWJzcUHN5V09JLpk3mTAjntsr3NT+bzGW80g/ijXSgmtBY22cNn H7sg== X-Forwarded-Encrypted: i=1; AJvYcCXxULsVjsHURABZMA52mvJJCbB23R3TZ9PFSGwQJvHAnUp2wNeG4Ykccap7q5a+iDbwN5boThEZm20T@debbugs.gnu.org X-Gm-Message-State: AOJu0YwlrcypbEg0s3NGuGLwHtCyJHgmDOhSR2RNHlh45xmaVQ30l13N NY0kGlQJwxtH99mHNiPvw42hTnrFjSBj1itavmNp/MDn804+ai7jBhYpGWzQEAL9VqbR+KkPkhF NNmEBDV/JO0t/XfOBHrsN5gd2sJA= X-Gm-Gg: ASbGncsK6qhhMx/YIvzm82QvdbmdRRNQY99HVBF5BMRUknUs7kyojvCaqBqvQ9UcZS+ v80NHqSQyO5uGQuxEyX/H7e3Axl8w9085yFtoHSla2Lm8CuFIsnczuXtaiyNtGLhqFUsr+S8MP3 R3CIperm0Z X-Google-Smtp-Source: AGHT+IFkHE3f6I9JHZM42mTTMDVsU58aB/UinLZ/B5nTiOdmnoBhbuSoojDwaxzx7MgNknpdWTUji4CHdawxEO1Lx6o= X-Received: by 2002:a05:6402:430c:b0:5e0:82a0:50c8 with SMTP id 4fb4d7f45d1cf-5e0b7236f0bmr9696678a12.27.1740318266579; Sun, 23 Feb 2025 05:44:26 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 23 Feb 2025 13:44:26 +0000 From: Stefan Kangas In-Reply-To: <87tt8lowco.fsf@gnu.org> References: <878qxorw4k.fsf@ledu-giraud.fr> <87tt8lowco.fsf@gnu.org> MIME-Version: 1.0 Date: Sun, 23 Feb 2025 13:44:26 +0000 X-Gm-Features: AWEUYZmcFiJ0FtR9WpH-3hbcmbybisB0sou7NZBcxhPNmfIJo-Gl_FDN-uVByO0 Message-ID: Subject: Re: bug#72305: [PATCH] Fix DocView's text conversion on tty Emacs To: Tassilo Horn Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 72305-done Cc: 72305-done@debbugs.gnu.org, Manuel Giraud X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Version: 31.1 Tassilo Horn 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. From unknown Sat Jun 21 05:08:22 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 24 Mar 2025 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator