unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Auto-resizing of images in image-mode
Date: Fri, 17 Apr 2020 00:53:48 +0300	[thread overview]
Message-ID: <87eesnayhf.fsf@mail.linkov.net> (raw)
In-Reply-To: <83r1wqgcl1.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 14 Apr 2020 21:13:30 +0300")

> 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	other threads:[~2020-04-16 21:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-14 18:13 Auto-resizing of images in image-mode Eli Zaretskii
2020-04-16 21:53 ` Juri Linkov [this message]
2020-04-17  6:45   ` Eli Zaretskii
2020-04-18 23:45     ` Juri Linkov
2020-04-19  6:58       ` Štěpán Němec
2020-04-19 23:17         ` Juri Linkov
2020-04-20 10:31           ` Štěpán Němec
2020-04-20 15:29             ` Eli Zaretskii
2020-04-20 23:44             ` Juri Linkov
2020-04-20 13:09           ` Stefan Monnier
2020-04-21 21:28             ` Juri Linkov
2020-04-22  5:34               ` Tassilo Horn
2020-04-19 12:34       ` Alan Third
2020-04-19 23:18         ` Juri Linkov
2020-04-19 14:06       ` Eli Zaretskii
2020-04-19 23:19         ` Juri Linkov
2020-04-19 23:58           ` Juri Linkov
2020-04-20 14:39             ` Eli Zaretskii
2020-04-20 23:43               ` Juri Linkov
2020-04-21 13:51                 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eesnayhf.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).