From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14701 invoked from network); 23 Oct 2007 21:13:05 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 23 Oct 2007 21:13:05 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 46099 invoked from network); 23 Oct 2007 21:12:59 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 23 Oct 2007 21:12:59 -0000 Received: (qmail 13379 invoked by alias); 23 Oct 2007 21:12:56 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24012 Received: (qmail 13361 invoked from network); 23 Oct 2007 21:12:55 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 23 Oct 2007 21:12:55 -0000 Received: (qmail 45788 invoked from network); 23 Oct 2007 21:12:55 -0000 Received: from acolyte.scowler.net (216.254.112.45) by a.mx.sunsite.dk with SMTP; 23 Oct 2007 21:12:49 -0000 Received: by acolyte.scowler.net (Postfix, from userid 1000) id D0C115C735; Tue, 23 Oct 2007 17:12:47 -0400 (EDT) Date: Tue, 23 Oct 2007 17:12:47 -0400 From: Clint Adams To: Peter Stephenson Cc: Zsh hackers list Subject: Re: PATCH: zcurses stuff Message-ID: <20071023211247.GA9492@scowler.net> Mail-Followup-To: Peter Stephenson , Zsh hackers list References: <9462.1193172355@pws-pc.ntlworld.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9462.1193172355@pws-pc.ntlworld.com> User-Agent: Mutt/1.5.16 (2007-06-11) On Tue, Oct 23, 2007 at 09:45:55PM +0100, Peter Stephenson wrote: > Other things I've thought about, but not done: > 1. I think I prefer "end" to "endwin". As I said, curses naming > is horrible and "endwin" to me suggests it applies to a single > window (indeed, what else could it logically mean?) > 2. I think I prefer "char" and "string" to "c" and "s", which are > the names of the subcommands internally anyway. I'm still wondering if we should handle both char and string with a single subcommand. > 3. I'm not sure we actually need both "attr" and "color"; we > can easily discriminate between types and as far as the user is > concerned it's natural to set them in a single command, > zcurses attr +bold red/black > Also, I think we could assume the "+" if not present; other > bits of the shell do this. Sounds fine to me. > 4. I think we can be more verbose with errors in places, for > example if colo[u]rs or attributes aren't found. The fact that > it messes up the screen is neither here nor there if the result > didn't work anyway. We should expose some kind of interface for the caller to determine which colo[u]rs (if any) and attributes (when/if we start supporting optional ones) are available before trying to use them then. Index: Doc/Zsh/mod_curses.yo =================================================================== RCS file: /cvsroot/zsh/zsh/Doc/Zsh/mod_curses.yo,v retrieving revision 1.7 diff -u -r1.7 mod_curses.yo --- Doc/Zsh/mod_curses.yo 21 Oct 2007 19:53:44 -0000 1.7 +++ Doc/Zsh/mod_curses.yo 23 Oct 2007 21:03:06 -0000 @@ -7,18 +7,18 @@ findex(zcurses) cindex(windows, curses) xitem(tt(zcurses) tt(init)) -xitem(tt(zcurses) tt(endwin)) +xitem(tt(zcurses) tt(end)) xitem(tt(zcurses) tt(addwin) var(targetwin) var(nlines) var(ncols) var(begin_y) var(begin_x) ) xitem(tt(zcurses) tt(delwin) var(targetwin) ) xitem(tt(zcurses) tt(refresh) [ var(targetwin) ] ) xitem(tt(zcurses) tt(move) var(targetwin) var(new_y) var(new_x) ) -xitem(tt(zcurses) tt(c) var(targetwin) var(character) ) -xitem(tt(zcurses) tt(s) var(targetwin) var(string) ) +xitem(tt(zcurses) tt(char) var(targetwin) var(character) ) +xitem(tt(zcurses) tt(string) var(targetwin) var(string) ) xitem(tt(zcurses) tt(border) var(targetwin) var(border) )( item(tt(zcurses) tt(addwin) var(targetwin) var({+/-}attribute) [var({+/-}attribute)] [...])( Manipulate curses windows. All uses of this command should be bracketed by `tt(zcurses init)' to initialise use of curses, and -`tt(zcurses endwin)' to end it; omitting `tt(zcurses endwin)' can cause +`tt(zcurses end)' to end it; omitting `tt(zcurses end)' can cause the terminal to be in an unwanted state. With tt(addwin), create a window with var(nlines) lines and var(ncols) columns. @@ -30,13 +30,13 @@ The tt(refresh) command will refresh window var(targetwin); this is necessary to make any pending changes (such as characters you have prepared for output -with tt(c)) visible on the screen. If no argument is given, +with tt(char)) visible on the screen. If no argument is given, all windows are refreshed; this is necessary after deleting a window. tt(move) moves the cursor position in var(targetwin) to new coordinates var(new_y) and var(new_x). -Outputting characters and strings are achieved by tt(c) and tt(s) +Outputting characters and strings are achieved by tt(char) and tt(string) respectively. To draw a border around window var(targetwin), use tt(border). Index: Src/Modules/curses.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Modules/curses.c,v retrieving revision 1.18 diff -u -r1.18 curses.c --- Src/Modules/curses.c 23 Oct 2007 20:55:42 -0000 1.18 +++ Src/Modules/curses.c 23 Oct 2007 21:03:07 -0000 @@ -612,10 +612,10 @@ {"delwin", zccmd_delwin, 1, 1}, {"refresh", zccmd_refresh, 0, 1}, {"move", zccmd_move, 3, 3}, - {"c", zccmd_char, 2, 2}, - {"s", zccmd_string, 2, 2}, + {"char", zccmd_char, 2, 2}, + {"string", zccmd_string, 2, 2}, {"border", zccmd_border, 1, 1}, - {"endwin", zccmd_endwin, 0, 0}, + {"end", zccmd_endwin, 0, 0}, {"attr", zccmd_attr, 2, -1}, {"color", zccmd_color, 2, 2}, {NULL, (zccmd_t)0, 0, 0}