zsh-workers
 help / color / mirror / code / Atom feed
From: Clint Adams <clint@zsh.org>
To: Peter Stephenson <p.w.stephenson@ntlworld.com>
Cc: Zsh hackers list <zsh-workers@sunsite.dk>
Subject: Re: PATCH: zcurses stuff
Date: Tue, 23 Oct 2007 17:12:47 -0400	[thread overview]
Message-ID: <20071023211247.GA9492@scowler.net> (raw)
In-Reply-To: <9462.1193172355@pws-pc.ntlworld.com>

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}


  reply	other threads:[~2007-10-23 21:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-23 20:45 Peter Stephenson
2007-10-23 21:12 ` Clint Adams [this message]
2007-10-24  8:45   ` Peter Stephenson
2007-10-24  0:52 ` Bart Schaefer
2007-10-24  1:06   ` Matthew Wozniski
2007-10-24  5:18     ` Bart Schaefer

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=20071023211247.GA9492@scowler.net \
    --to=clint@zsh.org \
    --cc=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@sunsite.dk \
    /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.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).