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.devel Subject: Multi image PDF continuous mode Date: Thu, 09 Dec 2021 19:05:53 +0200 Organization: LINKOV.NET Message-ID: <86lf0tq5zy.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2129"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 09 18:22:11 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mvN7S-0000Jo-Tm for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Dec 2021 18:22:10 +0100 Original-Received: from localhost ([::1]:43920 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mvN7R-0003i7-TP for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Dec 2021 12:22:09 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46272) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvN6H-0002Lo-FV for emacs-devel@gnu.org; Thu, 09 Dec 2021 12:20:57 -0500 Original-Received: from relay11.mail.gandi.net ([217.70.178.231]:49295) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvN6A-0006sl-WC for emacs-devel@gnu.org; Thu, 09 Dec 2021 12:20:52 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 67A2D10000B for ; Thu, 9 Dec 2021 17:20:46 +0000 (UTC) Received-SPF: pass client-ip=217.70.178.231; envelope-from=juri@linkov.net; helo=relay11.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:281516 Archived-At: Doc-view has such a long-standing shortcoming that it doesn't allow continuous scrolling of PDF pages when one PDF page at the top of the window smoothly flows into the next PDF page at the bottom of the window. But it seems there is no inherent limitation in Emacs that would prevent implementing this. And indeed after doc-view generates PNG images in /tmp/docview*/*pdf/*.png it's possible to insert absolute filenames of all PNG files into some buffer, then enable two modes: M-x iimage-mode RET that replaces filenames with images, and after M-x pixel-scroll-precision-mode RET wheel-mouse scrolls consecutive PDF images smoothly like all decent PDF viewers do. OTOH, scrolling keys are not so nice, and PgUp/PgDn insist on jumping to the top of the next image. But maybe image-scroll-up and image-scroll-down could be adapted to multi image buffers, possibly by creating a new mode multi-image-mode. Also mouse dragging could help in scrolling. Now when looking at this problem from another point of view, browsing a list of image files is what image-dired.el is intended to do. After doc-view generates a gallery of PDF images, image-dired could be invoked on the output directory of PNG images, and indeed in this case the window layout of image-dired looks like what most PDF viewers do: on the left side there is a narrow window with thumbnails of PDF pages, and on the right side a larger window with PDF pages. PS: Actually, there is some weird problem in image-dired: when the thumbnail window is resized to a width less than half-frame, then image-dired creates a new thumbnail window. But surely this could be fixed.