unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Tom Breton \(Tehom\)" <tehom@panix.com>
Cc: emacs-devel@gnu.org
Subject: Re: ewoc patch
Date: Tue, 08 Dec 2009 23:40:47 -0500	[thread overview]
Message-ID: <jwvocm8dazy.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <ed316819349eabc924b737854ab2af3b.squirrel@mail.panix.com> (Tom Breton's message of "Tue, 8 Dec 2009 23:03:12 -0500")

> I like the ewoc package, but I found it somewhat inflexible.  I am
> submitting this diff (attached) in the hope of improving it.

> In particular:

>  * ewoc always wants every entry to be separated from the other
>    entries by a newline.

>  * It does not work properly with blank entries.  These become a real
>    problem when a blank separator is allowed.  Nodes often get printed
>    out of order.

Not sure what you mean by "blank" entries.  If you mean entries which
don't get printed (i.e. "invisilbe" entries), then yes, it's
a limitation that it would be good to lift.  IIUC you lift it by:

> * Design: Nodes that have no text have no start marker.

which I think is a good solution (when I tried to lift that limitation
it didn't occur to me, so I tried to manually separate the markers that
needed to move from those that needed to stay put and it was messy).

>  * ewoc-map is slightly misnamed; it doesn't map, it's more like
>    for-each.

It's the historical name.  To fit with other macros (like dotimes,
dolist), we could call it ewoc-do rather than ewoc-foreach.

>  * Added a version number.  I didn't have much to go on, so I just
>    said it was "2.0".  I will gladly change it to correspond to an
>    official version number.

The Emacs package generally doesn't like version numbers, so I'd rather
not introduce one here, unless there's really a good reason for it.

>  * Added a new field to the ewoc, "separator".  That's the string that
>    separates entries.  It defaults to "\n".

IIUC it can also be the empty string, right?  IIUC, the current ewoc.el
already makes it possible to get rid of the separator.  Making it
an argument might be a good idea as well.

> Testing:

>  * Created a test suite.  The suite relies on rtest, which
>    unfortunately is still between releasable versions.

We still don't have a testsuite in Emacs, but we'll gladly add the
testsuite to our repository (we have a `test' subdirectory for that).

> diff -c -b /home/tehom/emacs-21.4/lisp/emacs-lisp/ewoc.el /home/tehom/projects/emtest/lisp/viewers/ewoc.el
> --- /home/tehom/emacs-21.4/lisp/emacs-lisp/ewoc.el	2001-07-16 08:22:59.000000000 -0400
> +++ /home/tehom/projects/emtest/lisp/viewers/ewoc.el	2009-12-08 22:57:46.000000000 -0500
> @@ -129,6 +129,8 @@
 
Emacs-21.4 is rather old.  ewoc hasn't seen much development, but it's
still substantially different.  Could you try and adapt your changes to
our latest code?


        Stefan




  parent reply	other threads:[~2009-12-09  4:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-09  4:03 ewoc patch Tom Breton (Tehom)
2009-12-09  4:19 ` ewoc patch (Was wrong patch, right one attached) Tom Breton (Tehom)
2009-12-09  4:40 ` Stefan Monnier [this message]
2009-12-09 20:57   ` ewoc patch Tom Breton (Tehom)
2009-12-09 21:25     ` Stefan Monnier
2009-12-10  4:52       ` Tom Breton (Tehom)
2009-12-10  7:28         ` Stefan Monnier
2009-12-11  1:23           ` Tom Breton (Tehom)
2009-12-11  5:09             ` Stefan Monnier
2010-08-21 10:52             ` 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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=jwvocm8dazy.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=tehom@panix.com \
    /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 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).