From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#54038: 29.0.50; doc-view cannot show different pages in different tabs Date: Fri, 18 Feb 2022 09:46:03 +0200 Organization: LINKOV.NET Message-ID: <86r180mxss.fsf@mail.linkov.net> References: <874k4xrgu5.fsf@gmail.com> <86wnhtjrb4.fsf@mail.linkov.net> <87fsohouaw.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="606"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: 54038@debbugs.gnu.org To: Visuwesh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 18 08:56:35 2022 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 1nKy83-000Aax-Bw for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Feb 2022 08:56:35 +0100 Original-Received: from localhost ([::1]:56862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nKy82-0000pj-6P for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Feb 2022 02:56:34 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nKy5a-00081L-MZ for bug-gnu-emacs@gnu.org; Fri, 18 Feb 2022 02:54:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59468) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nKy5a-0005HM-D7 for bug-gnu-emacs@gnu.org; Fri, 18 Feb 2022 02:54:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nKy5a-0001vO-Dt for bug-gnu-emacs@gnu.org; Fri, 18 Feb 2022 02:54:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 18 Feb 2022 07:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54038 X-GNU-PR-Package: emacs Original-Received: via spool by 54038-submit@debbugs.gnu.org id=B54038.16451707937331 (code B ref 54038); Fri, 18 Feb 2022 07:54:02 +0000 Original-Received: (at 54038) by debbugs.gnu.org; 18 Feb 2022 07:53:13 +0000 Original-Received: from localhost ([127.0.0.1]:53364 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKy4m-0001uB-Uq for submit@debbugs.gnu.org; Fri, 18 Feb 2022 02:53:13 -0500 Original-Received: from relay7-d.mail.gandi.net ([217.70.183.200]:38791) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKy4k-0001tj-QR for 54038@debbugs.gnu.org; Fri, 18 Feb 2022 02:53:11 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 1A60F2000F; Fri, 18 Feb 2022 07:53:01 +0000 (UTC) In-Reply-To: <87fsohouaw.fsf@gmail.com> (Visuwesh's message of "Fri, 18 Feb 2022 06:36:18 +0530") 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" Xref: news.gmane.io gmane.emacs.bugs:227142 Archived-At: >>> 2. Open a pdf file. >>> 3. Clone the tab using C-x t n. >>> 4. Move to the next page (n). >>> 5. Switch back to the original tab C-x t o. >>> 6. The page is changed here too. >>> >>> Expected: The original and the cloned tabs should show different pages, >>> just like how you can show different pages in different windows/frames. >> >> This is expected behavior when you use 'C-x t n' that clones >> the current tab. A new clone has exactly the same window. >> You can confirm this by evaluating in each tab: 'M-: >> (selected-window)'. >> It will show the same window number. But doc-view can show different pages >> only in different windows. > > I see, thanks. I didn't know that. If that is the case, the current > behaviour makes sense. I was confused primarily because tabs created > this showing regular buffers were allowed to have different points. Hmm, maybe 'C-x t n' should not reuse the same window, but should create a new window with exactly the same state. This will avoid such problems. Ok, I'll try to use window-state-put/get while cloning tabs. > But, how can I get my desired behaviour tho? If I create a new tab > using C-x t 2, it breaks doc-view in a different way. I am finding it > hard to describe it in text, so I would appreciate it if you can try it > out for yourself: essentially, C-x t 2, and then try changing pages. > Doc-view doesn't show the correct image but the page number in the > modeline changes. You are right, it fails with 'C-x t 2' too, so there is a problem in interaction between doc-view and tab switching. The current handling of different windows in doc-view is quite hackish, so it should be rewritten. This comment in doc-view.el proposes a good idea how this should be properly implemented: ;; FIXME: This should be done for all windows restored that show ;; this buffer. Basically, the page/slice should be saved as ;; window-parameters in the window-state(s) and then restoring this ;; window-state should call us back (to interpret/use those parameters).