unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#51961: image-mode: advertize viewing an image as hex less eagerly
@ 2021-11-19  3:38 Stefan Kangas
  2021-11-19  7:16 ` Eli Zaretskii
  2021-11-19  8:25 ` Juri Linkov
  0 siblings, 2 replies; 6+ messages in thread
From: Stefan Kangas @ 2021-11-19  3:38 UTC (permalink / raw)
  To: 51961

Severity: minor

This is a usability bug:

I don't think image mode should advertize it's capability to view an
image as hex in a message every time it is enabled:

    Type C-c C-c or C-c C-x to view the image as text or hex

Editing the hex or "text" of something like a JPEG does not strike me as
something most people will be able to do usefully by hand.  For bitmap
formats maybe, but even then, won't people just use an image editor?

And for those users that do know what bits to flip, can't we expect them
to be able to figure out that Emacs has a command to quickly flip to the
built-in hex editor or to "text mode"?  For example by reading the mode
help?  IOW, I think this message confuses more than it helps (but see
the final paragraph below).

Why not advertize some useful commands instead, like "Press h for help",
or "Use + and - to scale up and down"?

Or, even better perhaps, just say nothing?  It's already all there in
`describe-mode', right?

There is a minority of image types where it is obviously useful,
i.e. XPM and similar formats where the image is actually just a plain
text file.  I think we could consider keeping the message for those.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#51961: image-mode: advertize viewing an image as hex less eagerly
  2021-11-19  3:38 bug#51961: image-mode: advertize viewing an image as hex less eagerly Stefan Kangas
@ 2021-11-19  7:16 ` Eli Zaretskii
  2021-11-19  7:32   ` Lars Ingebrigtsen
  2021-11-19  7:59   ` Stefan Kangas
  2021-11-19  8:25 ` Juri Linkov
  1 sibling, 2 replies; 6+ messages in thread
From: Eli Zaretskii @ 2021-11-19  7:16 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 51961

> From: Stefan Kangas <stefan@marxist.se>
> Date: Fri, 19 Nov 2021 04:38:10 +0100
> 
> There is a minority of image types where it is obviously useful,
> i.e. XPM and similar formats where the image is actually just a plain
> text file.  I think we could consider keeping the message for those.

SVG is the prominent example of those where there's a significant
ambiguity in the user's intent.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#51961: image-mode: advertize viewing an image as hex less eagerly
  2021-11-19  7:16 ` Eli Zaretskii
@ 2021-11-19  7:32   ` Lars Ingebrigtsen
  2021-12-03 14:56     ` Stefan Kangas
  2021-11-19  7:59   ` Stefan Kangas
  1 sibling, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2021-11-19  7:32 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 51961, Stefan Kangas

Eli Zaretskii <eliz@gnu.org> writes:

>> There is a minority of image types where it is obviously useful,
>> i.e. XPM and similar formats where the image is actually just a plain
>> text file.  I think we could consider keeping the message for those.
>
> SVG is the prominent example of those where there's a significant
> ambiguity in the user's intent.

Yup.  I think we should keep the message for SVG and XPM and ditch if
for everything else.  (If there's more of these formats, we can add them
back.  Perhaps make a defcustom to allow tweaking?)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#51961: image-mode: advertize viewing an image as hex less eagerly
  2021-11-19  7:16 ` Eli Zaretskii
  2021-11-19  7:32   ` Lars Ingebrigtsen
@ 2021-11-19  7:59   ` Stefan Kangas
  1 sibling, 0 replies; 6+ messages in thread
From: Stefan Kangas @ 2021-11-19  7:59 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 51961

Eli Zaretskii <eliz@gnu.org> writes:

> SVG is the prominent example of those where there's a significant
> ambiguity in the user's intent.

Ah, but of course.  I forgot about the most important one!

Given my recent experience in working with SVG files, I'd say we would
do well to keep a message for such files.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#51961: image-mode: advertize viewing an image as hex less eagerly
  2021-11-19  3:38 bug#51961: image-mode: advertize viewing an image as hex less eagerly Stefan Kangas
  2021-11-19  7:16 ` Eli Zaretskii
@ 2021-11-19  8:25 ` Juri Linkov
  1 sibling, 0 replies; 6+ messages in thread
From: Juri Linkov @ 2021-11-19  8:25 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 51961

> There is a minority of image types where it is obviously useful,
> i.e. XPM and similar formats where the image is actually just a plain
> text file.  I think we could consider keeping the message for those.

I agree that this message should be displayed only for modes
where `(major-mode-restore '(image-mode image-mode-as-text))'
in `image-mode-to-text' doesn't change mode to 'fundamental-mode'
or 'so-long-mode'.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#51961: image-mode: advertize viewing an image as hex less eagerly
  2021-11-19  7:32   ` Lars Ingebrigtsen
@ 2021-12-03 14:56     ` Stefan Kangas
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Kangas @ 2021-12-03 14:56 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 51961

close 51961 29.1
thanks

> Yup.  I think we should keep the message for SVG and XPM and ditch if
> for everything else.  (If there's more of these formats, we can add them
> back.  Perhaps make a defcustom to allow tweaking?)

Now done on master (commit 8fda6770af).

Thanks to everyone who contributed to the discussion.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-12-03 14:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-19  3:38 bug#51961: image-mode: advertize viewing an image as hex less eagerly Stefan Kangas
2021-11-19  7:16 ` Eli Zaretskii
2021-11-19  7:32   ` Lars Ingebrigtsen
2021-12-03 14:56     ` Stefan Kangas
2021-11-19  7:59   ` Stefan Kangas
2021-11-19  8:25 ` Juri Linkov

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).