From: Juri Linkov <juri@linkov.net>
To: Visuwesh <visuweshm@gmail.com>
Cc: 54038@debbugs.gnu.org
Subject: bug#54038: 29.0.50; doc-view cannot show different pages in different tabs
Date: Fri, 18 Feb 2022 09:46:03 +0200 [thread overview]
Message-ID: <86r180mxss.fsf@mail.linkov.net> (raw)
In-Reply-To: <87fsohouaw.fsf@gmail.com> (Visuwesh's message of "Fri, 18 Feb 2022 06:36:18 +0530")
>>> 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).
next prev parent reply other threads:[~2022-02-18 7:46 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-17 9:18 bug#54038: 29.0.50; doc-view cannot show different pages in different tabs Visuwesh
2022-02-17 18:12 ` Juri Linkov
2022-02-18 1:06 ` Visuwesh
2022-02-18 7:46 ` Juri Linkov [this message]
2022-02-19 17:31 ` Juri Linkov
2022-02-20 9:17 ` martin rudalics
2022-02-23 17:59 ` Juri Linkov
2022-02-18 8:11 ` Juri Linkov
2022-02-18 12:19 ` Visuwesh
2022-02-19 17:35 ` Juri Linkov
2022-02-20 9:17 ` martin rudalics
2022-02-20 18:51 ` Juri Linkov
2022-02-21 9:08 ` martin rudalics
2022-02-23 17:46 ` Juri Linkov
2022-02-24 9:18 ` martin rudalics
2024-07-29 18:12 ` Juri Linkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86r180mxss.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=54038@debbugs.gnu.org \
--cc=visuweshm@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).