emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Auto-resizing of images in image-mode


From: Juri Linkov
Subject: Re: Auto-resizing of images in image-mode
Date: Fri, 17 Apr 2020 00:53:48 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

> Lately I noticed that visiting an image file automatically resizes it
> to fit in the window, and resizing the window then scales the image to
> fit.
>
> This is a good feature (at least IMO), but:
>
>   . It is completely undocumented, AFAICT: not a word about this in
>     NEWS, and nothing in the manual.  So much so that I originally
>     thought it was some inadvertent side effect of an unrelated
>     change.

Strange, I remember adding a NEWS entry for this feature, but now
after checking I see a NEWS entry in b31a966e88 but it's for another
feature installed in 1805b4cc08.  Sorry for messing up.
How about this:

  ** Image mode

  *** 'image-mode' now on resizing the window automatically resizes the
      image to fit in the new dimensions of the window.

>   . Moreover, the manual makes a point of describing what cursor
>     motion commands do when an image is displayed that is larger than
>     the window, but this can no longer be seen when visiting an image
>     file, because it is always smaller than the window.

It was difficult to find this place in the manual.  I failed to find
a node about images in the Table of Contents.  Then I tried other
commands to search the manual for the string "image" and finally found
the node about images in an unexpected place named "File Conveniences".
I propose to create a separate node "Images" or "Image mode".

But still can't find anything about motion commands in this node.

>   . There's no way to turn this behavior off, so it's practically
>     impossible to view an image in its original size (unless you
>     manually invoke insert-image).  It is not outlandish to envision
>     users who might want to opt out.

It's impossible to view an image in its original size even without this feature.
A few years ago image-mode was changed to resize the image to fit in the
window when visiting an image file.  What I added to this in emacs-27 is
only to do the same (fit the image in the window) on window resizing
as well.

There is an option 'image-transform-resize' added a long ago,
but I don't understand its logic: when it's 'nil' then an image
is resized initially after visiting.  And it has this comment:

  ;; FIXME this doesn't seem mature yet. Document in manual when it is.

Maybe a new emacs-27 feature (resize image on window resize) should
depend on the same option using the same logic.  IOW, first we need
to decide how to disable the initial image resizing, then use the
same solution to disable the image resizing on window resize.

>   . The time interval after which the idle timer resizes the image is
>     fixed and cannot be customized.  The 1 sec interval looks too long
>     to me, FWIW, but if it were customizable, my personal preferences
>     would not have mattered.

A new option could be added with a name like image-transform-resize-delay.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]