From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mathias Dahl Newsgroups: gmane.emacs.bugs Subject: bug#10758: thumbs and image-dired to use built-in ImageMagick Date: Mon, 25 Oct 2021 21:02:42 +0200 Message-ID: References: <8xfwemx6yr.fsf@fencepost.gnu.org> <87k18jw6w0.fsf@marxist.se> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000013d84905cf3202a4" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23324"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Glenn Morris , 10758@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 25 21:03:23 2021 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 1mf5Fj-0005v0-5O for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 Oct 2021 21:03:23 +0200 Original-Received: from localhost ([::1]:47722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mf5Fh-0004Wb-PH for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 Oct 2021 15:03:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39274) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mf5FO-0004Si-QR for bug-gnu-emacs@gnu.org; Mon, 25 Oct 2021 15:03:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60986) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mf5FO-00050H-H2 for bug-gnu-emacs@gnu.org; Mon, 25 Oct 2021 15:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mf5FO-0007rl-D1 for bug-gnu-emacs@gnu.org; Mon, 25 Oct 2021 15:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mathias Dahl Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Oct 2021 19:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10758 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 10758-submit@debbugs.gnu.org id=B10758.163518858130231 (code B ref 10758); Mon, 25 Oct 2021 19:03:02 +0000 Original-Received: (at 10758) by debbugs.gnu.org; 25 Oct 2021 19:03:01 +0000 Original-Received: from localhost ([127.0.0.1]:44299 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mf5FN-0007rW-Da for submit@debbugs.gnu.org; Mon, 25 Oct 2021 15:03:01 -0400 Original-Received: from mail-yb1-f171.google.com ([209.85.219.171]:40655) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mf5FL-0007rK-Ce for 10758@debbugs.gnu.org; Mon, 25 Oct 2021 15:02:59 -0400 Original-Received: by mail-yb1-f171.google.com with SMTP id m63so28494228ybf.7 for <10758@debbugs.gnu.org>; Mon, 25 Oct 2021 12:02:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2tq1RYvhpNnL2I13mM8Tc91NLwIVdMRHhvr4AGbI+xo=; b=BxxkT0a871Ng/om1M2QWdrGCgQepfnkIUX6cDSlc1JtWkzUIIlfqsUs4jicT6fxgHC TOQWCkacbSDJWtdUFNlJ50iHuRZI0cY50xOZ7Cf9XnK0zZ/pMOtrCBl5a+cZY38RICaq 6IXJbEmBngmpiVh6SPwW6W+g0yPROzgox6CpU7FFfKnUxakOI1Kf5657nF0dabt9FmdI dY0BdqiQU8+Kno4Ft6FovMNMapdcz7ryqip8zstwcscvzmLhHW5AVRF3n+NmaTvLFoTv XnKnFIkqtfBIYJSMPi1/GdG8CJgM+wXWsyIW5Rpy6WVdFd6ZZTYhv1HRnuwbMvFJNkD9 sp6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2tq1RYvhpNnL2I13mM8Tc91NLwIVdMRHhvr4AGbI+xo=; b=y9A9GLgZU3hCL3jhHMSIyJghd5IdmH5x2xIAnmUwcV0gE8KUgTxjOMNWhnZBuK760N MN+dxXSfkEFK5odq3eKNuzh+tQuG5acChFU+PtKdJZQlAPU4wAi4S0kAu7NHb77aIyiv B93nUb02MWFNB7xgUZ8pFyRb7bNxjHm+TLdVR+uODLJnnT6mlm0q6y6HjrFUQg8OIieA E0hPKUmc+N3bcvTtLQzI54ik7zAMHR9G0dZmAElu0ocBnhrU1M9fdUQxdIYw9grAERtL nxfEVGVmsScZCA5ePqFjtxcoHA2L5B5Mqb4V+mOTQwVjti83Bey+QZnnpktAZfLrXqJQ /BjA== X-Gm-Message-State: AOAM533LsP7q8BGlwTQ0dpXARxhJ9ipgFkdDh/fjv5hZg1kWLOmf4YyJ 3PBA9Naq3V/Sw8Mu8TA475G5T/E1UbwZTZ8TjuU= X-Google-Smtp-Source: ABdhPJwact+DYgS9RzlN6wK+OZmQY/Bs9MLmhUrkDptD//H9Cmz7JHJziUYhraOTYEoACjFzGHoFoGdbq60IAqDr/A4= X-Received: by 2002:a25:9d01:: with SMTP id i1mr19534538ybp.88.1635188573721; Mon, 25 Oct 2021 12:02:53 -0700 (PDT) In-Reply-To: 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:218337 Archived-At: --00000000000013d84905cf3202a4 Content-Type: text/plain; charset="UTF-8" On Sun, Oct 24, 2021 at 11:45 AM Stefan Kangas wrote: > Stefan Kangas writes: > > > Stefan Kangas writes: > > > >> So perhaps this feature request is relevant anymore. WDYT? > > > > I now see that Glenn mentioned resizing as well, where using the > > built-in image scaling seems very relevant. We currently jump through > > some unnecessary hoops in `image-dired-display-image' when we could just > > resize the image in memory. > > > > Is there any reason why `image-dired-display-image-mode' doesn't just > > inherit `image-mode'? That would avoid code duplication and also allow > > us to immediately benefit from any improvements to `image-mode'. Hi, sorry for coming late to the party. I cannot remember any good reason for not inheriting from `image-mode', but I opened image-dired.el now and found this: (defvar image-dired-display-image-mode-map (let ((map (make-sparse-keymap))) ;; `image-mode-map' has bindings that do not make sense in image-dired ;; (set-keymap-parent map image-mode-map) (define-key map "f" 'image-dired-display-current-image-full) (define-key map "s" 'image-dired-display-current-image-sized) (define-key map "g" nil) ;; Useful bindings from `image-mode-map' (define-key map [remap forward-char] 'image-forward-hscroll) (define-key map [remap backward-char] 'image-backward-hscroll) ... It seems I knew about `image-mode' but perhaps it never crossed my mind to inherit from it. 16 years later, my memory fails me... At any rate I have nothing against it, if someone wants to give it a try. /Mathias --00000000000013d84905cf3202a4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Sun, Oct 24, 2021 at 11:45 AM Stefan K= angas <stefan@marxist.se> wr= ote:
Stefan Kang= as <stefan@marxis= t.se> writes:

> Stefan Kangas <stefan@marxist.se> writes:
>
>> So perhaps this feature request is relevant anymore.=C2=A0 WDYT? >
> I now see that Glenn mentioned resizing as well, where using the
> built-in image scaling seems very relevant.=C2=A0 We currently jump th= rough
> some unnecessary hoops in `image-dired-display-image' when we coul= d just
> resize the image in memory.
>
> Is there any reason why `image-dired-display-image-mode' doesn'= ;t just
> inherit `image-mode'?=C2=A0 That would avoid code duplication and = also allow
> us to immediately benefit from any improvements to `image-mode'.

Hi, sorry for coming late to the party.

I cannot remember any good reason for not inheriting f= rom `image-mode', but
I opened image-dired.el now and found t= his:

(defvar image-dired-display-image-mode-map
=C2= =A0 (let ((map (make-sparse-keymap)))
=C2=A0 =C2=A0 ;; `image-mode-map&#= 39; has bindings that do not make sense in image-dired
=C2=A0 =C2=A0 ;; = (set-keymap-parent map image-mode-map)
=C2=A0 =C2=A0 (define-key map &qu= ot;f" 'image-dired-display-current-image-full)
=C2=A0 =C2=A0 (d= efine-key map "s" 'image-dired-display-current-image-sized)=C2=A0 =C2=A0 (define-key map "g" nil)

=C2=A0 =C2=A0 ;; = Useful bindings from `image-mode-map'
=C2=A0 =C2=A0 (define-key map = [remap forward-char] 'image-forward-hscroll)
=C2=A0 =C2=A0 (define-k= ey map [remap backward-char] 'image-backward-hscroll)
...
=

It seems I knew about `image-mode' but perhaps it n= ever crossed my mind
to inherit from it. 16 years later, my memor= y fails me...=C2=A0

At any rate I have nothing aga= inst it, if someone wants to give it a try.

/Mathi= as

--00000000000013d84905cf3202a4--