all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Oliver Scholz <alkibiades@gmx.de>
Cc: emacs-devel@gnu.org
Subject: Re: XPM images
Date: Mon, 30 Sep 2002 14:10:45 +0200	[thread overview]
Message-ID: <m3ptuvekze.fsf@ID-87814.user.dfncis.de> (raw)
In-Reply-To: <E17vqca-0004T0-00@fencepost.gnu.org> (Richard Stallman's message of "Sun, 29 Sep 2002 22:49:20 -0400")

Richard Stallman <rms@gnu.org> writes:

>     ;; `defstruct' generates a bunch of ugly byte-compiler warnings, so we
>     ;; do this manually.
>     (defun make-xpm-pixmap (&rest keyword-args)
>       "Create and return a `xpm-pixmap'.
>
> I am having trouble understanding the code because nothing says
> what purpose this data structure is used for.  

It is only an intermediate storage format, because I wanted the
functions that generate the PPM-string and the final image to be as
ignorant as possible of what the parsing-functions do. This was my
idea of cleanness at that time and it has proven to be at least
valuable for myself during the course of writing. But if this
separation seems unnecessary, it is quite possible to remove this
code.

> The file needs an overall description of the logic.

I see. I will add such a commentary section.

> It also needs the info on what the entry points are and what they do.

My apologies. Only two functions are supposed to be used from the
"outside": `xpm-image-from-file' and `xpm-image-from-string'. But now
that I am currently looking at images.el again, I think that I should
merge them into a single function `xpm-create-image' which takes
similar arguments as `create-image'. This makes a patch to images.el
simpler.

> None of the functions says it produces or outputs a PPM,
> and I can't figure out which function is supposed to do that.

The only place where PPM occurs is the function
`xpm-pixmap-to-ppm-string' which takes the data structure you
mentioned above as argument and returns a string (which, when saved to
a file, would be a valid PPM image.) PPM is, again, only an
intermediate format (as the format was indeed invented only to be an
intermediate format in image conversion). Besides that, the whole
process of converting to and applying PPM was meant to be
transparent. What the two main functions `xpm-image-from-string' and
`xpm-image-from-file' actually return is an image descriptor, as a
function like `insert-image' takes it as an argument. But I refer to
the image descriptors in the doc-strings only as "images"; thus
mimicking the documentation strings of `insert-image', `create-image'
or `find-image'.

    -- Oliver

-- 
Oliver Scholz               9 Vendémiaire an 211 de la Révolution
Taunusstr. 25               Liberté, Egalité, Fraternité!
60329 Frankfurt a. M.       http://www.jungdemokratenhessen.de
Tel. (069) 97 40 99 42      http://www.jdjl.org

  reply	other threads:[~2002-09-30 12:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-26  2:32 XPM images Oliver Scholz
2002-09-26 21:45 ` Richard Stallman
2002-09-26 23:45   ` Oliver Scholz
2002-09-28  3:20     ` Richard Stallman
2002-09-30  2:49 ` Richard Stallman
2002-09-30 12:10   ` Oliver Scholz [this message]
2002-10-01  6:17     ` Richard Stallman

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=m3ptuvekze.fsf@ID-87814.user.dfncis.de \
    --to=alkibiades@gmx.de \
    --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 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.