Skip to content

pdf-view-next-page-command and pdf-view-previous-page-command scroll the wrong window #340

Description

@YueRen

Describe the bug
When having one pdf open in two windows in a single frame, pdf-view-next-page-command and pdf-view-previous-page-command scroll the wrong window.

Steps to Reproduce the behaviour

  1. Open any pdf with two or more pages.
  2. Split your frame (e.g. C-x 3 to split your window vertically), you should now have the pdf open in two windows.
  3. Press PageUp and PageDown, and notice the pdf in the other window scrolling

(Note: The bug does not occur when opening the same pdf in two windows, i.e., first splitting my frame then opening the same pdf in each window via find-file. It also does not occur when scrolling up and down on a single page, it is only triggered on page switching.)

Your pdf-tools install
I have Emacs installed via snap:

GNU Emacs 30.2
Development version ff7d3f02b943 on master branch; build date 2025-12-17.
Copyright (C) 2025 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

This is my pdf-tools version:

     Status: Installed in ‘pdf-tools-20260102.1101/’ (unsigned).
    Version: 20260102.1101
     Commit: e4b7f1f37cf59ddf025d609ffcdabe732a6e99ba
    Summary: Support library for PDF documents.
   Requires: emacs-26.3, tablist-1.0, let-alist-1.0.4
Required by: org-pdftools-20250714.1631
    Website: http://github.com/vedang/pdf-tools/
   Keywords: files multimedia 
     Author: Andreas Politz <mail@andreas-politz.de>
Other versions: 20260102.1101 (melpa).

And the bug can be reproduced with the following init.el:

(require 'package)
(setq package-archives '(("elpa" . "https://elpa.gnu.org/packages/")
                         ("melpa" . "https://melpa.org/packages/")
                         ("org" . "https://orgmode.org/elpa/")))
(package-initialize)
(unless package-archive-contents (package-refresh-contents))

(require 'use-package-ensure)
(setopt use-package-always-ensure t)

(use-package pdf-tools
  :mode "\\.pdf\\'"
  :init
  (pdf-loader-install))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions