From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: dalanicolai Newsgroups: gmane.emacs.bugs Subject: bug#42824: 26.3; Feature request: implement 'smooth scroll' in djvu.el package Date: Tue, 27 Oct 2020 02:32:32 +0100 Message-ID: References: <8916ad6c75c76829bc0b43d6abc88f70e79ee816.camel@gmail.com> <87d014u0im.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000001f1905b29d0671" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29792"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Roland Winkler , 42824@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 27 02:33:15 2020 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 1kXDrP-0007cP-6Q for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 27 Oct 2020 02:33:15 +0100 Original-Received: from localhost ([::1]:40694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kXDrN-0006sK-Mx for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 26 Oct 2020 21:33:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kXDrC-0006rw-Eg for bug-gnu-emacs@gnu.org; Mon, 26 Oct 2020 21:33:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58872) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kXDrC-0006Is-5O for bug-gnu-emacs@gnu.org; Mon, 26 Oct 2020 21:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kXDrC-0006x0-1X for bug-gnu-emacs@gnu.org; Mon, 26 Oct 2020 21:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: dalanicolai Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Oct 2020 01:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42824 X-GNU-PR-Package: emacs Original-Received: via spool by 42824-submit@debbugs.gnu.org id=B42824.160376237026699 (code B ref 42824); Tue, 27 Oct 2020 01:33:01 +0000 Original-Received: (at 42824) by debbugs.gnu.org; 27 Oct 2020 01:32:50 +0000 Original-Received: from localhost ([127.0.0.1]:42185 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kXDr0-0006wY-CI for submit@debbugs.gnu.org; Mon, 26 Oct 2020 21:32:50 -0400 Original-Received: from mail-ua1-f45.google.com ([209.85.222.45]:46070) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kXDqz-0006wN-EC for 42824@debbugs.gnu.org; Mon, 26 Oct 2020 21:32:49 -0400 Original-Received: by mail-ua1-f45.google.com with SMTP id r9so6824uat.12 for <42824@debbugs.gnu.org>; Mon, 26 Oct 2020 18:32:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=l9oXeeUjRKsGy04/y0S7rXLW+IkIbC0GzVqkAqZ2ZvM=; b=JmBrk7dsuBbsh4QiQbF1qCh4K3/ImnNagYksiL0JGVjHGUkoGQKic/5Hno1pNeilbd XtGIuugK2yTePHGDcT8BLz82cpB9r5J/wF6c0wwF2OmcZ8Rc5aNYioIXuqaVG5vex6f1 8NVPTD4mkRpDoQxM71cg+G7JaYP7shN/AU/ImouFc4HsOOKXLl2MrYoMr91fmlNR1m7m qARBs4O1Fste7dyCojN7K7LGkqLS5eYcOPUPESeuZMJL5fnmrQ6aZz9Db6tp7SEjO9Ja XIGLdRy/srLC0kLKmmAags/bsZY7FKLM+JvdP/1/f/pqCVWbCEz4tdRhWxAJhTnn8jQy BWRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=l9oXeeUjRKsGy04/y0S7rXLW+IkIbC0GzVqkAqZ2ZvM=; b=Ge5w3ttKvAkLN8xiX4BbcxvoT9BqnPBh/A6TLdmkK1MBGkIzkm6A/LfE7Llx8Uzgwp eN2n8pn1pBjI68jGnjXUBmGiwjQZLjIZ+SlB3nWfU9Q9cRqpBKwNu5kyBFGAHLXkuRgX TtCt5xxEkJNkYRFBmQHFogxcqRkGVyAx1gzkIBsaebl+cQdGZ2BSiiJosQ2cOq2DoqNH QR8WnsDhtHJ9BZ3YGfIT96E5gP5fqTuZCk9bxfrHM/CR1kUXfp07eIl/enEVXvVzO5OU XYJiDdc4danvMmk8SkWcQ0ehDJ2xrENM2h/4lKGs369dkQ+38FKrgOXPZhznCQilGOpW hjGQ== X-Gm-Message-State: AOAM5313uCp4N/w/A5th3uC0OZOxjj6jK+CgDfYA1YjzUs6YQghdc4AS uSjpw5E/hFRxSAJzWS69Ej/7wPgl0svtO1UNqvI= X-Google-Smtp-Source: ABdhPJzGZIbIWPKnMI+R7DMfMujgLfwvdiW824skylhybtwmCWYVcS7mzNJucaKeraZv+M4p977Bg6AekhyM6/eQMIk= X-Received: by 2002:ab0:7598:: with SMTP id q24mr14935378uap.109.1603762363832; Mon, 26 Oct 2020 18:32:43 -0700 (PDT) In-Reply-To: <87d014u0im.fsf@gnus.org> 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:191693 Archived-At: --000000000000001f1905b29d0671 Content-Type: text/plain; charset="UTF-8" FYI it is inspired by `pdf-view-next-line-or-next-page` (and complement) of the pdf-tools package. On Mon, 26 Oct 2020 at 22:43, Lars Ingebrigtsen wrote: > Roland, could you take a look at this suggestion -- I've not used > djvu.el myself, so I'm not sure whether this would make sense or not: > > dalanicolai@gmail.com writes: > > > The djvu.el pacakge is a beautiful package but unfortunately it is not > > designed for reading djvu documents (The comments in the file say it is > > meant to be used with DjView). Probably for that reason there is no > > smooth scroll over pages implemented (at least I am not aware of that > > functionality), i.e. you can scroll smoothly over a > > single page but you can only do a full page jump to a next or previous > > page. > > This means that when you are at the bottom/top of a page and jump to > > the > > next/previous page then you end up at the bottom/top of that page, > > which is annoying. Anyway, smooth scrolling can be implemented with > > only > > a view simple lines. So I would like to propose to add the following > > lines to djvu.el: > > > > (defun djvu-scroll-up-or-next-page () > > (interactive) > > (scroll-up-line 5) > > (when (= (window-vscroll) 0) > > (djvu-next-page 1))) > > > > (defun djvu-scroll-down-or-previous-page () > > (interactive) > > (if (not (= (window-vscroll) 0)) > > (scroll-down-line 5) > > (djvu-prev-page 1) > > (scroll-up-command)))) > > > > By adding these lines emacs can be perfectly used as a djvu reader > > (although it does not show annotations). > > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no > --000000000000001f1905b29d0671 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
FYI it is inspired by `pdf-view-next-line-or-next-pag= e` (and complement) of the pdf-tools package.

On Mon, 26 Oct 2020 = at 22:43, Lars Ingebrigtsen <larsi@gnu= s.org> wrote:
Roland, could you take a look at this suggestion -- I've not used<= br> djvu.el myself, so I'm not sure whether this would make sense or not:
dalanicolai@gmai= l.com writes:

> The djvu.el pacakge is a beautiful package but unfortunately it is not=
> designed for reading djvu documents (The comments in the file say it i= s
> meant to be used with DjView). Probably for that reason there is no > smooth scroll over pages implemented (at least I am not aware of that<= br> > functionality), i.e. you can scroll smoothly over a
> single page but you can only do a full page jump to a next or previous=
> page.
> This means that when you are at the bottom/top of a page and jump to > the
> next/previous page then you end up at the bottom/top of that page,
> which is annoying. Anyway, smooth scrolling can be implemented with > only
> a view simple lines. So I would like to propose to add the following > lines to djvu.el:
>
>=C2=A0 =C2=A0 =C2=A0(defun djvu-scroll-up-or-next-page ()
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(interactive)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(scroll-up-line 5)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(when (=3D (window-vscroll) 0)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(djvu-next-page 1)))
>
>=C2=A0 =C2=A0 =C2=A0(defun djvu-scroll-down-or-previous-page ()
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(interactive)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(if (not (=3D (window-vscroll) 0))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(scroll-down-line 5)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(djvu-prev-page 1)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(scroll-up-command))))
>
> By adding these lines emacs can be perfectly used as a djvu reader
> (although it does not show annotations).

--
(domestic pets only, the antidote for overdose, milk.)
=C2=A0 =C2=A0bloggy blog: http://lars.ingebrigtsen.no
--000000000000001f1905b29d0671--