lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev Re: [-dev.12] experimental text entry fields patch (updated)


From: Kim DeVaughn
Subject: lynx-dev Re: [-dev.12] experimental text entry fields patch (updated)
Date: Thu, 7 Jan 1999 09:53:00 -0800

Here's a small patch goes on top of the main, previously posted
"textarea" patch.

It adds another function (EDITTEXTAREA) to the author's CONVERT
and CONVERTEDIT functions, which simply combines the two operations
into a single op, for the sake of convenience.  The two individual
functions are still bindable though, since there may be reasons to
use them seperately (though I haven't found a good reason to do so
as yet).

For my use, I've used the binding:

 KEYMAP:$:EDITTEXTAREA

in my lynx.cfg (in addition to the patch author's suggested bindings
for the other two functions).

BTW, this patch also includes my previously posted "screen refresh"
patch, so it should be -R'd before applying this one.


One thing that I've now (unfortunately) noticed, is that some of the
time, when the edited/converted text is "submitted", some extraneous
bits of text coming from elsewhere on the original page (not out of
a text entry area), are getting appended to the edited text submitted.

Usually this random text appears a couple of lines below the text that
was submitted, and is usually from about 3 to 10 chars in length, or
so.  It does NOT appear in the editor's buffer, on subsequent CONVERT-
EDIT's performed in the same field (ie, it never makes it into the
created temp file).

It seems to be fairly "random" in nature, and when it *does* happen,
it seems to occur with the same text entry field(s), but never (seems
to) happen in other text entry fields.  Similarly, the extraneous text
isn't necessarily the same, from use to use.  Sigh.

Any help in tracking this bug down would be appreciated (if anyone
else is even test-driving this feature).

/kim


Against 2.8.2dev.12, with 0.1.3 textarea patch applied:

diff -uNr lynx-2.8.2-dev.12.orig/src/LYKeymap.c 
lynx-2.8.2-dev.12+kd/src/LYKeymap.c
--- lynx-2.8.2-dev.12.orig/src/LYKeymap.c       Wed Jan  6 15:25:45 1999
+++ lynx-2.8.2-dev.12+kd/src/LYKeymap.c Wed Jan  6 09:12:00 1999
@@ -614,8 +614,9 @@
 { "SWITCH_DTD",                "switch between two ways of parsing HTML" },
 { "ELGOTO",            "edit the current link's URL or ACTION and go to it" },
 { "CHANGE_LINK",       "force reset of the current link on the page" },
-{ "CONVERT",           "Puts a set of textarea fields into a file to edit"},
-{ "CONVERTEDIT",       "Edits file generated by CONVERTion"},
+{ "CONVERT",           "puts a set of textarea fields into a file to edit" },
+{ "CONVERTEDIT",       "edits file generated by CONVERT operation" },
+{ "EDITTEXTAREA",      "performs CONVERT followed by CONVERTEDIT on field" },
 #ifdef USE_EXTERNALS
 { "EXTERN",            "run external program with url" },
 #endif
diff -uNr lynx-2.8.2-dev.12.orig/src/LYKeymap.h 
lynx-2.8.2-dev.12+kd/src/LYKeymap.h
--- lynx-2.8.2-dev.12.orig/src/LYKeymap.h       Wed Jan  6 15:25:45 1999
+++ lynx-2.8.2-dev.12+kd/src/LYKeymap.h Wed Jan  6 09:04:26 1999
@@ -115,15 +115,16 @@
                                    * imagine using a preprocessor in other
                                    * programming languages */
 #define                LYK_EDITCONVERT 76
+#define                LYK_CONVERT_AND_EDIT 77
 
 #ifdef USE_EXTERNALS
-#define       LYK_EXTERN        77
+#define       LYK_EXTERN        78
 #if defined(VMS) || defined(DIRED_SUPPORT)
-#define       LYK_DIRED_MENU    78
+#define       LYK_DIRED_MENU    79
 #endif /* VMS || DIRED_SUPPORT */
 #else  /* USE_EXTERNALS */
 #if defined(VMS) || defined(DIRED_SUPPORT)
-#define       LYK_DIRED_MENU    77
+#define       LYK_DIRED_MENU    78
 #endif /* VMS || DIRED_SUPPORT */
 #endif /* !defined(USE_EXTERNALS) */
 
diff -uNr lynx-2.8.2-dev.12.orig/src/LYMainLoop.c 
lynx-2.8.2-dev.12+kd/src/LYMainLoop.c
--- lynx-2.8.2-dev.12.orig/src/LYMainLoop.c     Wed Jan  6 15:27:49 1999
+++ lynx-2.8.2-dev.12+kd/src/LYMainLoop.c       Wed Jan  6 15:39:02 1999
@@ -4269,6 +4269,7 @@
            break;
 
        case LYK_CONVERT:       /* put textarea text into file */
+       case LYK_CONVERT_AND_EDIT:      /* case that combines both ops */
                /*if curent link is part of a textarea*/
                if (links[curdoc.link].type == WWW_FORM_LINK_TYPE &&
                    links[curdoc.link].form->type == F_TEXTAREA_TYPE)
@@ -4280,11 +4281,21 @@
                                 * the objects I need, is this supposed to be a 
module?
                                 */
                                 HText_FileForm( &links[curdoc.link] );
-                                cmd = LYK_REFRESH;
+                                if (cmd == LYK_CONVERT_AND_EDIT)
+                                   cmd = LYK_EDITCONVERT;
+                                else
+                                   cmd = LYK_REFRESH;
                                 goto new_cmd;
                                }
                        } else {
-                               HTInfoMsg("This textarea is already file");
+                                if (cmd == LYK_CONVERT_AND_EDIT) {
+                                   cmd = LYK_EDITCONVERT;
+                                   goto new_cmd;
+                                }
+                                else
+                                {
+                                   HTInfoMsg("This textarea is already file");
+                                }
                        }
                } else { /* not a textarea */
                        HTInfoMsg("CONVERT: Not in a textarea");
@@ -4304,10 +4315,15 @@
                                stop_curses();
                                /* editor should be lynx.cfg option */
                                /* StrAllocCopy? */
-                               snprintf(com, 200, "%s %s", editor, 
links[curdoc.link].form->filename);
-                               system(com);
+                               snprintf(com, 200, "%s %s",
+                                        editor,
+                                        links[curdoc.link].form->filename);
+
+                               system (com);
+
                                /* start screen */
                                start_curses();
+                               refresh_screen = TRUE;
 
                                stat (links[curdoc.link].form->filename, &B);
                                if (B.st_size > g_maxfile_size) { /* too big */
##--eof--##

reply via email to

[Prev in Thread] Current Thread [Next in Thread]