I read the elisp rules as inspiration, and here is what I think we
should do with Scheme scripts, comments / doubts with []:

- use prefixes for your own functions, so you avoid problems. [does
Gimp's Scheme provide "encapsulation"? if not, this is a must]

- indent in Emacs style, with spaces instead of tabs. [maybe we should
provide pointers to indent apps that do it, not everybody has Emacs.
Also instructions for common editor, like vim]

- put "(" & ")" in the same line that "text", not alone in other

- cut lines that are longer than 80. [70?]

- write documentation strings, so the PDB can show something. And
something useful, not "no info yet".

- for comments use ";" (right), ";;" (code level), ";;;" (left) and
";;;;" (left, separate areas of file).

- first line of files ";;; filename --- one line description".

- one blank line, and third ";; Copyright (C) the owner" (the script
owner(s), not the Gimp owner).

- license, with the blank lines as separation.

- another blank line, and headers like ";; header: content". See
for the list. [put here the list]

- end files with ";;; filename ends here"

- do not add "Copyright" to the copyright field in the register
function, it look weird to see "Copyright: Copyright (C) owner".

- the path, if the script launchs a dialog, must end with "...", if
automatic action, do not put "...". [people complain about UI, no? so
start applying this basic concept]

- data format as yyyy-mm-dd. Fill with "x" if unknown (2001-05-xx),
but only if applicable (Copyright is yyyy, not yyyy-xx-xx).

- add "_" before strings, so can they be translated.

- provide nice ranges for variables, all that will work, not more (it
could cause errors), not less (just cos the effect looks weird too
big, does not mean it can not be used as base for other thing).

- provide sane defaults, at least for normal uses. Take the common
cases and apply the script. If a script to remove red eyes look poor
when you try to remove the red of a car, it is fine, but not if the
input are faces, and all them "fail".

- use "foo" string for logos. [which string? logo name? "the gimp"?]

- use constant names when you call plugins, not numbers, if they exist
(DISCARD is better than 1). Look script-fu-constants.c for them.
[include a list?]

Make a pointer to elisp doc, so we give credit about inspiration.
Explain why, so everyone knows it (the draft is too short). Put it in
CVS and Gimp site (aka this can be one of the test docs for the new

I am not a Scheme guru at all, so I guess I have put something stupid
or miss a basic item. I would like to see comments from Scheme people,
or lisp users in general.

Fixes? Changes? Who decides?

Gimp-developer mailing list

Reply via email to