v08i099: xmail, Patch2, Part04/05
Michael Wagnitz
michael at parns.nsc.com
Tue Aug 28 17:50:12 AEST 1990
Submitted-by: michael at parns.nsc.com (Michael Wagnitz)
Posting-number: Volume 8, Issue 99
Archive-name: xmail/patch2.04
#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of archive 4 (of 5)."
# Contents: Patch.02d
# Wrapped by michael at harley on Mon Aug 27 12:47:27 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Patch.02d' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'Patch.02d'\"
else
echo shar: Extracting \"'Patch.02d'\" \(52848 characters\)
sed "s/^X//" >'Patch.02d' <<'END_OF_FILE'
X! markIndex(" ");
X }
X }
X break;
X--- 246,252 ----
X sprintf(tmp, "%d", msgnum);
X XtFree(msg);
X msg = QueryMail(tmp);
X! markIndex("> ");
X }
X }
X break;
X***************
X*** 256,268 ****
X markIndex("D");
X num = msgnum;
X msgnum = index_handler(++msgnum, 0); /* next msg */
X! if (msgnum != num) markIndex(" ");
X }
X if (*Command == 'u') {
X c = QueryMail("=");
X sscanf(c, "%d", &msgnum);
X XtFree(c);
X! iw = WidgetOf(WidgetOf(toplevel, "topBox"),"indexWindow");
X if (TextGetLastPos(iw) < (XtTextPosition) 4) {
X c = QueryMail("h");
X writeText(iw, c, FALSE);
X--- 269,282 ----
X markIndex("D");
X num = msgnum;
X msgnum = index_handler(++msgnum, 0); /* next msg */
X! if (msgnum != num)
X! markIndex("> ");
X }
X if (*Command == 'u') {
X c = QueryMail("=");
X sscanf(c, "%d", &msgnum);
X XtFree(c);
X! iw = WidgetOf(WidgetOf(toplevel, "topBox"), "indexWindow");
X if (TextGetLastPos(iw) < (XtTextPosition) 4) {
X c = QueryMail("h");
X writeText(iw, c, FALSE);
X***************
X*** 269,275 ****
X XtFree(c);
X }
X msgnum = index_handler(msgnum, 1);
X! markIndex(" ");
X }
X c = QueryMail("file"); /* resets current msg to 1 */
X (void) UpdateTitleBar(c);
X--- 283,289 ----
X XtFree(c);
X }
X msgnum = index_handler(msgnum, 1);
X! markIndex("> ");
X }
X c = QueryMail("file"); /* resets current msg to 1 */
X (void) UpdateTitleBar(c);
X***************
X*** 281,295 ****
X /*
X ** In response to a request to view new mail, first reset the mailbox flag.
X ** If mail came back with an error, complain to the user. Otherwise, clear
X! ** the Newmail command button highlighting, and (if it exists) destroy the
X! ** current folder popup list. Then display any new mail text.
X */
X case C_NEWMAIL:
X button = WidgetOf(WidgetOf(WidgetOf(toplevel, "topBox"),
X "commandPanel"), "Folder");
X UnsetNewmail(button, NULL, NULL);
X- if (popup = WidgetOf(button, "popupList"))
X- XtDestroyWidget(popup);
X if (O_BELL == match(output_pattern, msg)) {
X if (strncmp(msg, "No mail for ", 12) == 0) {
X Bell("No mail in system mailbox\n");
X--- 295,306 ----
X /*
X ** In response to a request to view new mail, first reset the mailbox flag.
X ** If mail came back with an error, complain to the user. Otherwise, clear
X! ** the Newmail command button highlighting. Then display any new mail text.
X */
X case C_NEWMAIL:
X button = WidgetOf(WidgetOf(WidgetOf(toplevel, "topBox"),
X "commandPanel"), "Folder");
X UnsetNewmail(button, NULL, NULL);
X if (O_BELL == match(output_pattern, msg)) {
X if (strncmp(msg, "No mail for ", 12) == 0) {
X Bell("No mail in system mailbox\n");
X***************
X*** 316,322 ****
X sprintf(tmp, "%d", msgnum);
X XtFree(msg);
X msg = QueryMail(tmp);
X! markIndex(" "); /* 'cause we just read it */
X }
X }
X }
X--- 327,333 ----
X sprintf(tmp, "%d", msgnum);
X XtFree(msg);
X msg = QueryMail(tmp);
X! markIndex("> "); /* 'cause we just read it */
X }
X }
X }
X***************
X*** 419,424 ****
X--- 430,446 ----
X if (strcmp(&output[j], MailPrompt) == 0) {
X output[j] = '\0'; /* Drop prompt from end of text */
X break; /* and return from read routine */
X+ }
X+
X+ if (!strcmp(Command,"Start")) { /* see if somehow missed the prompt */
X+ j = strlen(output) - 3; /* no accidents allowed here either */
X+ if (j < 0) j = 0; /* no string references before zero */
X+ if (strcmp(&output[j], "\n& ") == 0) { /* if default mail prompt */
X+ output[++j] = '\0'; /* drop prompt from end of string */
X+ XtFree(MailPrompt); /* intended prompt is now bogus */
X+ MailPrompt = XtNewString("& "); /* reset the mail prompt */
X+ break; /* and return from read routine */
X+ }
X }
X
X if (O_BELL == match(output_pattern,output) && !strcmp(Command,"Start"))
X*** ../v1.1/utils.c Mon Jun 4 09:48:42 1990
X--- utils.c Mon Aug 27 11:09:22 1990
X***************
X*** 32,38 ****
X * EVENT SHALL NATIONAL SEMICONDUCTOR CORPORATION BE LIABLE FOR ANY SPECIAL,
X * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
X * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
X! * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
X * PERFORMANCE OF THIS SOFTWARE.
X *
X * The following software modules were created and are Copyrighted by National
X--- 32,38 ----
X * EVENT SHALL NATIONAL SEMICONDUCTOR CORPORATION BE LIABLE FOR ANY SPECIAL,
X * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
X * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
X! * OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
X * PERFORMANCE OF THIS SOFTWARE.
X *
X * The following software modules were created and are Copyrighted by National
X***************
X*** 72,95 ****
X char *s;
X {
X XtTextBlock textblock;
X! XtTextPosition pos;
X Widget w = WidgetOf(WidgetOf(toplevel, "topBox"), "indexWindow");
X
X
X! pos = XtTextGetInsertionPoint(w) + 1;
X
X! XtTextSetInsertionPoint(w, pos);
X
X textblock.firstPos = 0;
X! textblock.length = 1;
X textblock.ptr = s;
X textblock.format = FMT8BIT;
X
X! XtTextReplace(w, pos, pos + 1, &textblock);
X
X XtTextSetInsertionPoint(w, pos);
X-
X- SetSelect(w, NULL, NULL, NULL);
X } /* markIndex */
X
X
X--- 72,110 ----
X char *s;
X {
X XtTextBlock textblock;
X! XtTextPosition pos, old;
X Widget w = WidgetOf(WidgetOf(toplevel, "topBox"), "indexWindow");
X+ char *p;
X+ int size = strlen(s);
X
X
X! pos = XtTextGetInsertionPoint(w);
X
X! if (*s == '>') /* first, remove any existing pointer */
X! if (p = index(IndexBuf, '>')) {
X! old = p - IndexBuf;
X! XtTextSetInsertionPoint(w, old);
X! textblock.firstPos = 0;
X! textblock.length = 1;
X! textblock.ptr = " ";
X! textblock.format = FMT8BIT;
X! XtTextReplace(w, old, old + 1, &textblock);
X! }
X
X+ for (p = IndexBuf + pos; p > IndexBuf && *(p - 1) != '\n'; p--);
X+
X+ pos = (p - IndexBuf);
X+
X+ XtTextSetInsertionPoint(w, (*s == '>') ? pos : ++pos);
X+
X textblock.firstPos = 0;
X! textblock.length = size;
X textblock.ptr = s;
X textblock.format = FMT8BIT;
X
X! XtTextReplace(w, pos, pos + size, &textblock);
X
X XtTextSetInsertionPoint(w, pos);
X } /* markIndex */
X
X
X***************
X*** 186,192 ****
X String msg;
X {
X Arg args[1];
X! char *p, *index();
X char buf[BUFSIZ];
X int worthy = 0; /* only msgs with ending newline are */
X
X--- 201,207 ----
X String msg;
X {
X Arg args[1];
X! char *p;
X char buf[BUFSIZ];
X int worthy = 0; /* only msgs with ending newline are */
X
X*** ../v1.1/windows.c Mon Jun 4 09:48:44 1990
X--- windows.c Mon Aug 27 11:09:22 1990
X***************
X*** 32,38 ****
X * EVENT SHALL NATIONAL SEMICONDUCTOR CORPORATION BE LIABLE FOR ANY SPECIAL,
X * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
X * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
X! * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
X * PERFORMANCE OF THIS SOFTWARE.
X *
X * The following software modules were created and are Copyrighted by National
X--- 32,38 ----
X * EVENT SHALL NATIONAL SEMICONDUCTOR CORPORATION BE LIABLE FOR ANY SPECIAL,
X * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
X * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
X! * OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
X * PERFORMANCE OF THIS SOFTWARE.
X *
X * The following software modules were created and are Copyrighted by National
X***************
X*** 50,56 ****
X
X
X #include "global.h"
X! #include "Mailwatch.h"
X #include "patchlevel.h"
X #include "icon.mail"
X #include "national.bm"
X--- 50,56 ----
X
X
X #include "global.h"
X! #include "MailwatchP.h"
X #include "patchlevel.h"
X #include "icon.mail"
X #include "national.bm"
X***************
X*** 164,170 ****
X XtSetArg(args[3], XtNtranslations, XtParseTranslationTable(b_Trans));
X for (indx = 0; list[indx] != NULL; indx++) {
X strcpy(tag, list[indx]->label); /* set window name by label */
X! if ((c = (char *)index(tag, ' '))) *c = '\0'; /* first word only */
X sprintf(trans, "%-*.*s", j, j, list[indx]->label);
X if (Labels[indx]) /* add accel. note if needed */
X strcat(trans, Labels[indx]);
X--- 164,170 ----
X XtSetArg(args[3], XtNtranslations, XtParseTranslationTable(b_Trans));
X for (indx = 0; list[indx] != NULL; indx++) {
X strcpy(tag, list[indx]->label); /* set window name by label */
X! if ((c = index(tag, ' '))) *c = '\0'; /* first word only */
X sprintf(trans, "%-*.*s", j, j, list[indx]->label);
X if (Labels[indx]) /* add accel. note if needed */
X strcat(trans, Labels[indx]);
X***************
X*** 284,292 ****
X b1.label = "Newmail"; b1.func = (XtCallbackProc) DoIt; b1.data = "file %";
X #ifdef SUNOS_4
X b2.label = "inc (no commit)"; b2.func = (XtCallbackProc) DoIt; b2.data = "inc";
X! list[0] = &b1; list[1] = &b2; list[2] = NULL;
X #else
X! list[0] = &b1; list[1] = NULL;
X #endif
X AddButton(parent, "Newmail", "DoCmd", "file %", list, NewMail_Help_Text);
X
X--- 284,294 ----
X b1.label = "Newmail"; b1.func = (XtCallbackProc) DoIt; b1.data = "file %";
X #ifdef SUNOS_4
X b2.label = "inc (no commit)"; b2.func = (XtCallbackProc) DoIt; b2.data = "inc";
X! b3.label = "Drop Folders"; b3.func = (XtCallbackProc) DropIt; b3.data = "drop";
X! list[0] = &b1; list[1] = &b2; list[2] = &b3; list[3] = NULL;
X #else
X! b2.label = "Drop Folders"; b2.func = (XtCallbackProc) DropIt; b2.data = "drop";
X! list[0] = &b1; list[1] = &b2; list[2] = NULL;
X #endif
X AddButton(parent, "Newmail", "DoCmd", "file %", list, NewMail_Help_Text);
X
X***************
X*** 388,395 ****
X <Key>BackSpace: DeleteChar()\n\
X <Key>Linefeed: DoNothing()\n\
X <Key>Return: DoNothing()\n\
X! <Key>: CheckInsert() insert-char()";
X
X XtSetArg(args[0], XtNwidth, XMail.fileBoxWidth);
X XtSetArg(args[1], XtNfont, TextFontStr);
X XtSetArg(args[2], XtNborderWidth, 0);
X--- 390,400 ----
X <Key>BackSpace: DeleteChar()\n\
X <Key>Linefeed: DoNothing()\n\
X <Key>Return: DoNothing()\n\
X! <Key>: CheckInsert() insert-char()\n\
X! <Btn1Down>: select-start()\n\
X! <Btn2Down>: CheckInsert() insert-selection(PRIMARY, CUT_BUFFER0)";
X
X+
X XtSetArg(args[0], XtNwidth, XMail.fileBoxWidth);
X XtSetArg(args[1], XtNfont, TextFontStr);
X XtSetArg(args[2], XtNborderWidth, 0);
X***************
X*** 449,454 ****
X--- 454,461 ----
X Arg args[6];
X Widget w;
X
X+ static String Trans = "#override\n\
X+ :<Key>Linefeed: MenuPopdown(help)";
X
X XtSetArg(args[0], XtNborderWidth, 3);
X w = XtCreatePopupShell("help", overrideShellWidgetClass, parent, args, 1);
X***************
X*** 458,464 ****
X XtSetArg(args[2], XtNfont, HelpFontStr);
X XtSetArg(args[3], XtNeditType, (XtArgVal) XttextRead);
X XtSetArg(args[4], XtNtextOptions, wordBreakey>L: redraw-display() \n\
dan
----------------------------------------------------
O'Reilly && Associates argv at sun.com / argv at ora.com
Opinions expressed reflect those of the author only.
More information about the Comp.sources.x
mailing list