From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.bugs Subject: bug#72241: 31.0.50; [PATCH] Use a dedicated buffer for `doc-view-open-text' Date: Tue, 23 Jul 2024 12:39:35 +0200 Message-ID: <87ttggl7dk.fsf@gnu.org> References: <87jzhd4ysy.fsf@ledu-giraud.fr> <87v80xwb3d.fsf@gnu.org> <86le1t9t5p.fsf@gnu.org> <87r0blw9s5.fsf@gnu.org> <87a5i8jzpj.fsf@ledu-giraud.fr> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4941"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 72241@debbugs.gnu.org To: Manuel Giraud Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 23 12:41:27 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sWCxR-00016b-CF for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 23 Jul 2024 12:41:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWCx2-0006G8-IN; Tue, 23 Jul 2024 06:41:00 -0400 Original-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 1sWCx0-0006Fi-S0 for bug-gnu-emacs@gnu.org; Tue, 23 Jul 2024 06:40:58 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWCx0-0006t5-7y for bug-gnu-emacs@gnu.org; Tue, 23 Jul 2024 06:40:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sWCx4-0008GV-2c for bug-gnu-emacs@gnu.org; Tue, 23 Jul 2024 06:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tassilo Horn Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Jul 2024 10:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 72241-submit@debbugs.gnu.org id=B72241.172173120131681 (code B ref 72241); Tue, 23 Jul 2024 10:41:02 +0000 Original-Received: (at 72241) by debbugs.gnu.org; 23 Jul 2024 10:40:01 +0000 Original-Received: from localhost ([127.0.0.1]:59280 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sWCw5-0008Ej-20 for submit@debbugs.gnu.org; Tue, 23 Jul 2024 06:40:01 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43666) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sWCw2-0008ER-Kr for 72241@debbugs.gnu.org; Tue, 23 Jul 2024 06:39:59 -0400 Original-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 1sWCvr-0006Xm-RH; Tue, 23 Jul 2024 06:39:47 -0400 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=FUV4sTcg1JyM0cW7wVGOJnI7WQwgCc1hzTEaAESeScQ=; b=gK4F5HBnhs29UI/9ON0t AdVZ9HVGSpmPvK3U0IsI4kBee1oHXSc3YT883/sENQnFx1JbWIh79fe3CkvLKmGCOdQWS/h0tG0u0 SsZFMGVm0bs0lFColTx2SaFfpM2N7ZpEcf3Du1yNtR9VlUVevTESalv/SmHjRBidGTEncZ1Vk9Y+N gAFWO5ZR1F6p7yTbyT7qSjAH6JgmY3IAtj1ZteDU+gux8+HPXCWGrQ+w+Iub7toP2Yy6ZnwIGhmUI usmAJfE4a/HIZX9KwUrt2iMuAFU2cqEJ9/yeMmgRpHB93x9B3oARAR1htZB70lZG0T9bX/t0KkFAo 3+jEMY8xj+d73A==; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrheelgdefudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufgjfhffkfggtgesthdtredttddttdenucfhrhhomhepvfgrshhsihhl ohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenucggtffrrghtthgvrhhnpeetle dtgeehfffhteekkeevkeekvefggeekteeuffelieehkefhgfffueeugeeiffenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhorhhnodhmvg hsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdekieejfeekjeekgedqieefhedvleek qdhtshguhheppehgnhhurdhorhhgsehfrghsthhmrghilhdrfhhmpdhnsggprhgtphhtth hopedt X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail In-Reply-To: <87a5i8jzpj.fsf@ledu-giraud.fr> (Manuel Giraud's message of "Tue, 23 Jul 2024 10:10:32 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:289150 Archived-At: Manuel Giraud writes: Hi, >>> Can you tell in what way the behavior will change after this? I'd >>> like to think whether a NEWS entry is necessary and what to day there. >> >> Right now, when you open foo.pdf you see the images generated from >> the PDF. When you do C-c C-t, it'll replace the foo.pdf buffer >> contents with the plain text contents of the PDF. With another C-c >> C-c, the contents are again replaced with the PDF and you see the >> images again. > > FWIW, this is not the current behaviour that I see: > > - C-c C-t replace the buffer contents with the text version > > - C-c C-c, DocView switches back to the "edit" view: the raw > content of a PDF for instance is displayed into the buffer. > > - another C-c C-c, DocView switches to the "display" view where > you see the images again That's right and my answer was aproximately correct. The beef is that for the "text version", you get a separate buffer with your patch. "edit" and "display" are in the same buffer because the contents (raw PDF, DVI, PostScript,...) are the same, just how they are presented to the user differs. > Maybe while here, we should clarify how DocView cycles through those 3 > view: display, edit and text. Or maybe, there is no 3-states cycling > and the "text contents" view is just considered a "side" view. WDYT? Here's a state machine describing the current behavior. display <-- C-c C-c --> edit \ ^ \ \ C-c C-t C-c C-c \ \ `> text So with C-c C-c you can toggle between "display" and "edit" which just changes how the buffer contents are presented to the user (images or raw text). In the "display" state C-c C-t one gets a plain text version of the contents, and that's in a separate foo.pdf/text buffer with Manuel's patch. In there, C-c C-c kills the foo.pdf/text buffer and returns to the original foo.pdf buffer. However, that now one can switch between foo.pdf and foo.pdf/text independently, there is no guarantee that C-c C-c in the foo.pdf/text buffer will return to foo.pdf in "display" state. One could have toggled to edit state there or even killed the foo.pdf buffer, so there's nothing to return to. So I'd say: right now it is a state machine with 3 states but with Manuel's patch the current "text" state becomes an auxiliary view. Bye, Tassilo