From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vitalie Spinu Newsgroups: gmane.emacs.devel Subject: Re: image-transform.el and image-mode.el rewrite Date: Thu, 18 Dec 2014 15:23:44 -0800 Organization: UCLA Anderson School of Management Message-ID: <87oar0tudb.fsf@gmail.com> References: <87a9lp8uxk.fsf@gmail.com> <87ppuk6qqb.fsf@gmail.com> <87vc49y793.fsf@gmail.com> <87ppuhxk04.fsf@gmail.com> <87ehavihbp.fsf_-_@gmail.com> <1a7ggiwcta.fsf@fencepost.gnu.org> <1uwqlnr5yh.fsf@fencepost.gnu.org> <87siwbnxan.fsf@gmail.com> <878uy348h3.fsf@web.de> <87tx0xdzqo.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1418945075 23998 80.91.229.3 (18 Dec 2014 23:24:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Dec 2014 23:24:35 +0000 (UTC) Cc: Michael Heerdegen , Glenn Morris , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 19 00:24:25 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Y1kQQ-0001AL-Hh for ged-emacs-devel@m.gmane.org; Fri, 19 Dec 2014 00:24:06 +0100 Original-Received: from localhost ([::1]:56029 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1kQP-0001fr-HU for ged-emacs-devel@m.gmane.org; Thu, 18 Dec 2014 18:24:05 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1kQC-0001fl-Dr for emacs-devel@gnu.org; Thu, 18 Dec 2014 18:23:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y1kQB-0005nR-DV for emacs-devel@gnu.org; Thu, 18 Dec 2014 18:23:52 -0500 Original-Received: from mail-pd0-x236.google.com ([2607:f8b0:400e:c02::236]:50172) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1kQ9-0005mY-Nw; Thu, 18 Dec 2014 18:23:49 -0500 Original-Received: by mail-pd0-f182.google.com with SMTP id p10so2361016pdj.27; Thu, 18 Dec 2014 15:23:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=QkIhG9z/b1sHE5VHjWc2BuF12ciGdB22uUZJX2lNuAQ=; b=dleG6uXmAribljYhmPNM3WpRGR6TuIRcGvfmQs43l5lip2FYxnywHIyqcwvf4ItqJK ZLER16G+bKh19CThErqoCIx8h67/QilNq9+n7J4fGxOa4usmTddOM7Chy2WUrF1diUTy 23tuMPIBZmJMF9fPGb5p8bCYp/97OmvDkYpLoYz2rSF8ogY8xPWTDqVKW96HhJAsqx4I KhIsGlMtU0yM/zyikHVLAxul5Jx/0xIeZivJRdk9El4vI9LsJlD/CAwQKYzLGOpTR7oH dlVMhvaSbCfVklCLT6GzgZyPXZ7vq01FvY+xjVuQ/fPT5pboEUCLU7HM+7W3C/o7O2dk zHqw== X-Received: by 10.68.220.68 with SMTP id pu4mr7359128pbc.109.1418945028914; Thu, 18 Dec 2014 15:23:48 -0800 (PST) Original-Received: from localhost ([2607:f010:2e9:9:ccfc:7291:1bea:568c]) by mx.google.com with ESMTPSA id f1sm7684046pds.93.2014.12.18.15.23.45 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Dec 2014 15:23:46 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Thu, 18 Dec 2014 10:15:07 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c02::236 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:180300 Archived-At: >>> 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