all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Vitalie Spinu <spinuvit@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Michael Heerdegen <michael_heerdegen@web.de>,
	Glenn Morris <rgm@gnu.org>,
	emacs-devel@gnu.org
Subject: Re: image-transform.el and image-mode.el rewrite
Date: Thu, 18 Dec 2014 15:23:44 -0800	[thread overview]
Message-ID: <87oar0tudb.fsf@gmail.com> (raw)
In-Reply-To: <jwvegrxow3i.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Thu, 18 Dec 2014 10:15:07 -0500")

 >>> Stefan Monnier on Thu, 18 Dec 2014 10:15:07 -0500 wrote:

 > - You seem to have rename a few "image-mode-FOO" to "image-BAR" and also
 >   a few "image-TOTO" to "image-mode-TITI".  I'm not necessarily opposed
 >   to those changes, but I'm not sure I understand the rationale behind
 >   it.  I think it would be good to document (e.g. in the "Commentary:"
 >   section) the convention used to decide whether the name should be
 >   "image-mode-FOO" or "image-BAR".

With the exception of `image-mode-fit-frame` all renames either added or
removed -mode- from the name. The rationale is very simple. Functions
that operate on images and are meaningful outside of `image-mode` don't
have -mode- in the name. Eventually, it would be nice to extract all
these functions into a separate `image-manip.el`.

The recently added image-mode-fit-frame was renamed into
image-scale-frame-to-fit-image because I wanted to place it on "s"
prefix in `image-manipulation-map' with all other scaling commands:

      "ss" 'image-scale-to-fit-window
      "sh" 'image-scale-to-fit-height
      "sw" 'image-scale-to-fit-width
      "sS" 'image-stretch-to-fit-window
      "sf" 'image-scale-frame-to-fit-image

The "f" in `image-mode-map`, which is arguably more suitable for this
functionality, has been used for `image-next-frame` for long time. So I
decided to use -scale- as a new mnemonic.

 > I recommend you take a look at doc-view.el and plan on sharing some
 > of the code there as well. E.g. the image-scale-step should probably
 > be merged with doc-view-shrink-factor.

Eventually all of the doc-view scaling and fitting should be based on
image-manip. I plan to look into that once this patch is done with.

 > - The :flatten arg to image-transform looks wrong.  Instead of
 > ":flatten" it should be ":flatten t" (i.e. all keywords should be
 > followed by a value and a nil value should be equivalent to not
 > having mentioned the keyword).  IOW the "Boolean specs can miss the
 > value, in which case t is assumed" is a misfeature.

It mimics convert/bash specification where boolean parameters are either
there or not. I would be happy to remove this feature, as it brings some
additional complexities.

 > - The image-transform-features:convert seems over-engineered.  I think
 >   I'd rather have a ":convert-args" that provides a mechanism to pass
 >   any args to "convert" and then remove the bulk of those keywords.

The `image-transform-features:convert' in the current form is at the
core of image-transform.el. Convert specification is used as a canonical
description of the transformations, thus ensuring compatibility between
backeds. This allows for writing of generic code independently of the
applied backend. Currently, any transformation chain that works under
'native backend will work with 'convert. If 'native backend is extended
in the future with more transformations, or new backends are added, old
code will work happily with all of the new features.

Also, a comprehensive list of transforms and their types makes possible
interactive application of transforms as in `image-add-transform`. This
essentially makes from Emacs a lightweight image editor.


  Vitalie



  reply	other threads:[~2014-12-18 23:23 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-14  7:25 imagemagic in image-mode and image-dired-thumbnail-mode? Vitalie Spinu
2013-07-14  8:32 ` joakim
2013-07-14 11:48   ` Vitalie Spinu
2013-07-14 12:40     ` joakim
2013-07-14 13:01       ` Vitalie Spinu
2013-07-14 12:42     ` Lars Magne Ingebrigtsen
2013-07-14 18:21       ` Glenn Morris
2013-07-14 19:50         ` Lars Magne Ingebrigtsen
2013-07-14 20:06           ` Eli Zaretskii
2013-07-14 20:11             ` Lars Magne Ingebrigtsen
2013-07-14 22:00             ` Vitalie Spinu
2013-07-15  4:38               ` Eli Zaretskii
2013-07-15  4:15             ` Stephen J. Turnbull
2013-07-15  4:46               ` Eli Zaretskii
2013-07-15  5:45                 ` Stephen J. Turnbull
2013-07-15 10:39                   ` Óscar Fuentes
2013-08-02 15:32                     ` Steinar Bang
2013-07-15 15:50                   ` Eli Zaretskii
2013-07-14 18:33   ` Glenn Morris
2013-07-14 19:17     ` joakim
2013-07-15 10:51       ` Vitalie Spinu
2013-07-16 15:57         ` Glenn Morris
2013-07-16 21:26         ` Stefan Monnier
2013-07-17  7:29           ` Vitalie Spinu
2013-07-17 15:51             ` Vitalie Spinu
2013-07-18  8:47               ` Lars Magne Ingebrigtsen
2013-07-18 22:27                 ` Vitalie Spinu
2013-07-19  9:22                   ` Stefan Monnier
2013-07-20  7:25                     ` Vitalie Spinu
2013-07-22 20:17                 ` Vitalie Spinu
2013-07-22 20:31                   ` Lars Magne Ingebrigtsen
2013-07-23  8:31                     ` Vitalie Spinu
2013-07-18 23:22               ` image-transform.el and image-mode.el rewrite Vitalie Spinu
2013-07-19 11:52                 ` Wolfgang Jenkner
2013-07-19 12:21                   ` Wolfgang Jenkner
2013-07-20  7:18                     ` Vitalie Spinu
2013-07-22 20:37                 ` Glenn Morris
2013-07-22 21:05                   ` Vitalie Spinu
2013-10-08 18:08                   ` Glenn Morris
2013-10-08 23:43                     ` Vitalie Spinu
2013-10-09  0:02                       ` Michael Heerdegen
2014-12-15  9:33                         ` Vitalie Spinu
2014-12-18 14:17                           ` Michael Heerdegen
2014-12-18 21:32                             ` Vitalie Spinu
2014-12-18 15:15                           ` Stefan Monnier
2014-12-18 23:23                             ` Vitalie Spinu [this message]
2014-12-19  4:19                               ` Stefan Monnier
2014-12-19  4:46                                 ` Vitalie Spinu
2014-12-19  8:56                                 ` Eli Zaretskii
2014-12-19 17:50                                   ` Stefan Monnier
2014-12-19 19:37                                     ` Eli Zaretskii
2014-12-19 21:31                                       ` Stefan Monnier
2014-12-19 21:49                                         ` Eli Zaretskii
2014-12-19 10:24                                 ` Vitalie Spinu
2014-12-19 17:51                                   ` Stefan Monnier

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

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

  git send-email \
    --in-reply-to=87oar0tudb.fsf@gmail.com \
    --to=spinuvit@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=michael_heerdegen@web.de \
    --cc=monnier@iro.umontreal.ca \
    --cc=rgm@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.