lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev [dev16] patch for an A-page (was: Re: L-page: set/clear)


From: Kim DeVaughn
Subject: lynx-dev [dev16] patch for an A-page (was: Re: L-page: set/clear)
Date: Wed, 10 Feb 1999 19:58:38 -0800

On Tue, Feb 09, 1999, Philip Webb (address@hidden) said:
|
| you are both onto something, but KD is the proven programmer (smile).
| it should be set up as an alternative in  lynx.cfg , not another keystroke.
| i'll put it in my todo list of little C exercises,
| but KD could do it in  10 min , tops ... (grin).

Ten minutes ... no way ...!

More like an hour or so, to track down all the grep'd references, and
do a little bit of documenting.

I needed a break from the TEXTAREA stuff, and character set problems
though, so ...


On Wed, Feb 10, 1999, David Combs (address@hidden) said:
|
| Anyway, once the urls have been changed to "next",
| no way to tell one manual from another!  In fact,
| you might think, from a QUICK glance at the above
| L-page (had you visited ALL the separate manuals,
| ALL presumably also named "next"), that there was only
| ONE file to download.
|
| There's no way out -- having a way to see all the URLs
| is still essential.

Try the attached patch.

It creates a new command called ADDRLIST, which behaves exactly the
same as LIST, but which *should* always show only the URL's.

Rather than make it a config option (which would have taken me quite
a bit longer to do), I've bound it to the "A" key (that's a capital
"A").  Why not "L" you ask?  Because of the "vi keys" option, whereby
"l" is used for cursor movement, and "L" stays reserved for L(ist).

Anyway ... I dunno if folks will want this to become a part of the
distribution or not, but in any case, you may wish to apply it to
your own copy.

/kim


Against 2.8.2dev.16:

diff -uNr lynx-2.8.2-dev.16+kd.orig/LYMessages_en.h 
lynx-2.8.2-dev.16+kd/LYMessages_en.h
--- lynx-2.8.2-dev.16+kd.orig/LYMessages_en.h   Mon Feb  8 02:32:59 1999
+++ lynx-2.8.2-dev.16+kd/LYMessages_en.h        Wed Feb 10 12:45:20 1999
@@ -776,6 +776,7 @@
 #define DOWNLOAD_OPTIONS_TITLE gettext("Download Options")
 #define HISTORY_PAGE_TITLE     gettext("History Page")
 #define LIST_PAGE_TITLE                gettext("List Page")
+#define ADDRLIST_PAGE_TITLE    gettext("Address List Page")
 #define LYNXCFG_TITLE          gettext("Lynx.cfg Information")
 #define OPTIONS_TITLE          gettext("Options Menu")
 #define PERMIT_OPTIONS_TITLE   gettext("File Permission Options")
diff -uNr lynx-2.8.2-dev.16+kd.orig/lynx_help/Lynx_users_guide.html 
lynx-2.8.2-dev.16+kd/lynx_help/Lynx_users_guide.html
--- lynx-2.8.2-dev.16+kd.orig/lynx_help/Lynx_users_guide.html   Mon Jan 18 
04:29:20 1999
+++ lynx-2.8.2-dev.16+kd/lynx_help/Lynx_users_guide.html        Wed Feb 10 
14:45:54 1999
@@ -286,9 +286,9 @@
 that list.  The MAIN_MENU keystroke command, normally mapped to '<em>m</em>'
 and '<em>M</em>', will take you back to the starting document unless you
 specified the <em>-homepage=URL</em> option at the command line.  Also, the
-LIST keystroke command, normally mapped to '<em>l</em>' and <em>L</em>',
-will create a compact list of all the links in the current document, and
-they can be selected via that list.
+LIST and ADDRLIST keystroke commands, normally mapped to '<em>l</em>' and
+<em>A</em>' respectively, will create a compact lists of all the links in
+the current document, and they can be selected via those lists.
 
 <p>The '<em>i</em>' key presents an index of documents.  The default index
 is usually a document pointing to servers around the world, but the index
diff -uNr lynx-2.8.2-dev.16+kd.orig/lynx_help/keystrokes/follow_help.html 
lynx-2.8.2-dev.16+kd/lynx_help/keystrokes/follow_help.html
--- lynx-2.8.2-dev.16+kd.orig/lynx_help/keystrokes/follow_help.html     Mon Jul 
 7 02:16:13 1997
+++ lynx-2.8.2-dev.16+kd/lynx_help/keystrokes/follow_help.html  Wed Feb 10 
14:55:42 1999
@@ -108,9 +108,9 @@
 
 <p>If a document includes
 <em>hidden links</em>, they will be reported, with appropriate labeling,
-in the menu created for the LIST ('<em>l</em>') command,
-unless <em>-hiddenlinks=ignore</em> is used.  They can then be
-ACTIVATE-ed via that menu.  Also, if a link was hidden due to an ALT
+in the menus created for the LIST ('<em>l</em>') or ADDRLIST ('<em>A</em>')
+commands, unless <em>-hiddenlinks=ignore</em> is used.  They can then be
+ACTIVATE-ed via those menus.  Also, if a link was hidden due to an ALT
 attribute in an IMG element, it will be converted to a <em>visible link</em>
 whenever the IMAGE_TOGGLE ('<em>*</em>') command is used to create links
 for SRC attritute values of IMG elements, because this indicates that the
@@ -124,8 +124,9 @@
 Lynx respects this attribute as well, and neither displays the HIDDEN field,
 nor assigns it a number for the F_LINK_NUM ('<em>0</em>') command and
 <em>Links and form fields are numbered</em> keypad mode handling, nor
-includes an entry for it in the menu created for the LIST ('<em>l</em>')
-command.  However, the HIDDEN name/value pairs are included in any displays
+includes an entry for it in the menus created for the LIST ('<em>l</em>')
+or ADDRLIST ('<em>A</em>')
+commands.  However, the HIDDEN name/value pairs are included in any displays
 of submitted form content in the <em>Information about the current
 document</em> that is invoked by the INFO ('<em>=</em>') command.
 </BODY>
diff -uNr lynx-2.8.2-dev.16+kd.orig/src/LYHistory.c 
lynx-2.8.2-dev.16+kd/src/LYHistory.c
--- lynx-2.8.2-dev.16+kd.orig/src/LYHistory.c   Thu Dec 24 03:27:23 1998
+++ lynx-2.8.2-dev.16+kd/src/LYHistory.c        Wed Feb 10 13:39:42 1999
@@ -76,6 +76,7 @@
 #endif /* DIRED_SUPPORT */
        !strcmp((doc->title ? doc->title : ""), CURRENT_KEYMAP_TITLE) ||
        !strcmp((doc->title ? doc->title : ""), LIST_PAGE_TITLE) ||
+       !strcmp((doc->title ? doc->title : ""), ADDRLIST_PAGE_TITLE) ||
        !strcmp((doc->title ? doc->title : ""), SHOWINFO_TITLE) ||
        !strcmp((doc->title ? doc->title : ""), COOKIE_JAR_TITLE) ||
        !strcmp((doc->title ? doc->title : ""), VISITED_LINKS_TITLE) ||
diff -uNr lynx-2.8.2-dev.16+kd.orig/src/LYKeymap.c 
lynx-2.8.2-dev.16+kd/src/LYKeymap.c
--- lynx-2.8.2-dev.16+kd.orig/src/LYKeymap.c    Wed Feb 10 15:18:53 1999
+++ lynx-2.8.2-dev.16+kd/src/LYKeymap.c Wed Feb 10 15:13:15 1999
@@ -99,7 +99,7 @@
 LYK_UP_LINK,         LYK_INFO,     LYK_DOWN_LINK,   LYK_HELP,
 /* < */              /* = */         /* > */        /* ? */
 
-LYK_RAW_TOGGLE,  LYK_ADD_BOOKMARK, LYK_PREV_PAGE,   LYK_COMMENT,
+LYK_RAW_TOGGLE,      LYK_ADDRLIST, LYK_PREV_PAGE,   LYK_COMMENT,
 /* @ */              /* A */         /* B */        /* C */
 
 LYK_DOWNLOAD,        LYK_ELGOTO,
@@ -608,6 +608,7 @@
 { "ELGOTO",            "edit the current link's URL or ACTION and go to it" },
 { "CHANGE_LINK",       "force reset of the current link on the page" },
 { "EDITTEXTAREA",      "use an external editor to edit a form's textarea" },
+{ "ADDRLIST",          "like LIST command, but always shows the links URL's" },
 #ifdef USE_EXTERNALS
 { "EXTERN",            "run external program with url" },
 #endif
diff -uNr lynx-2.8.2-dev.16+kd.orig/src/LYKeymap.h 
lynx-2.8.2-dev.16+kd/src/LYKeymap.h
--- lynx-2.8.2-dev.16+kd.orig/src/LYKeymap.h    Wed Feb 10 15:18:53 1999
+++ lynx-2.8.2-dev.16+kd/src/LYKeymap.h Wed Feb 10 15:16:21 1999
@@ -106,15 +106,16 @@
 #define       LYK_ELGOTO        73
 #define       LYK_CHANGE_LINK   74
 #define              LYK_EDIT_TEXTAREA 75
+#define       LYK_ADDRLIST      76
 
 #ifdef USE_EXTERNALS
-#define       LYK_EXTERN        76
+#define       LYK_EXTERN        77
 #if defined(VMS) || defined(DIRED_SUPPORT)
-#define       LYK_DIRED_MENU    77
+#define       LYK_DIRED_MENU    78
 #endif /* VMS || DIRED_SUPPORT */
 #else  /* USE_EXTERNALS */
 #if defined(VMS) || defined(DIRED_SUPPORT)
-#define       LYK_DIRED_MENU    76
+#define       LYK_DIRED_MENU    77
 #endif /* VMS || DIRED_SUPPORT */
 #endif /* !defined(USE_EXTERNALS) */
 
diff -uNr lynx-2.8.2-dev.16+kd.orig/src/LYList.c 
lynx-2.8.2-dev.16+kd/src/LYList.c
--- lynx-2.8.2-dev.16+kd.orig/src/LYList.c      Wed Jan 13 03:37:34 1999
+++ lynx-2.8.2-dev.16+kd/src/LYList.c   Wed Feb 10 13:36:01 1999
@@ -81,7 +81,10 @@
     LYforce_HTML_mode = TRUE;  /* force this file to be HTML */
     LYforce_no_cache = TRUE;   /* force this file to be new */
 
-    BeginInternalPage(fp0, LIST_PAGE_TITLE, LIST_PAGE_HELP);
+    if (titles == TRUE)
+       BeginInternalPage(fp0, LIST_PAGE_TITLE, LIST_PAGE_HELP);
+    else
+       BeginInternalPage(fp0, ADDRLIST_PAGE_TITLE, LIST_PAGE_HELP);
 
     StrAllocCopy(Address, HTLoadedDocumentURL());
     LYEntify(&Address, FALSE);
diff -uNr lynx-2.8.2-dev.16+kd.orig/src/LYMainLoop.c 
lynx-2.8.2-dev.16+kd/src/LYMainLoop.c
--- lynx-2.8.2-dev.16+kd.orig/src/LYMainLoop.c  Mon Feb  8 02:32:59 1999
+++ lynx-2.8.2-dev.16+kd/src/LYMainLoop.c       Wed Feb 10 15:03:39 1999
@@ -1785,8 +1785,10 @@
                if (links[lindx].type == WWW_INTERN_LINK_TYPE) {
                    LYinternal_flag = TRUE;
                    newdoc.internal_link = TRUE;
-                   if (0==strcmp((curdoc.title ? curdoc.title : ""),
-                                     LIST_PAGE_TITLE) &&
+                   if ((0==strcmp((curdoc.title ? curdoc.title : ""),
+                                     LIST_PAGE_TITLE) ||
+                       0==strcmp((curdoc.title ? curdoc.title : ""),
+                                     ADDRLIST_PAGE_TITLE)) &&
                        0==strcmp(HTLoadedDocumentURL(), LYlist_temp_url())) {
                        if (!curdoc.post_data ||
                            /*
@@ -2984,9 +2986,11 @@
                         *  for an internal link within the document the
                         *  List Page is about. - kw
                         */
-                       if (0==strcmp(curdoc.address, LYlist_temp_url()) &&
-                           0==strcmp((curdoc.title ? curdoc.title : ""),
-                                     LIST_PAGE_TITLE)) {
+                       if ( 0==strcmp(curdoc.address, LYlist_temp_url()) &&
+                           (0==strcmp((curdoc.title ? curdoc.title : ""),
+                                     LIST_PAGE_TITLE) ||
+                            0==strcmp((curdoc.title ? curdoc.title : ""),
+                                     ADDRLIST_PAGE_TITLE))) {
                            if (!curdoc.post_data ||
                                /*
                                 *  Normal case - List Page is not associated
@@ -4445,6 +4449,39 @@
            }
            break;
 
+       case LYK_ADDRLIST:   /* always list URL's (only) */
+           /*
+            *  Don't do if already viewing list addresses page.
+            */
+           if (!strcmp((curdoc.title ? curdoc.title : ""),
+                       ADDRLIST_PAGE_TITLE)) {
+               /*
+                *  Already viewing list page, so get out.
+                */
+               cmd = LYK_PREV_DOC;
+               goto new_cmd;
+           }
+
+           /*
+            *  Print address list page to file.
+            */
+           if (showlist(&newdoc, FALSE) < 0)
+               break;
+           StrAllocCopy(newdoc.title, ADDRLIST_PAGE_TITLE);
+           /*
+            *  showlist will set newdoc's other fields.  It may leave
+            *  post_data intact so the list can be used to follow
+            *  internal links in the current document even if it is
+            *  a POST response. - kw
+            */
+
+           refresh_screen = TRUE;  /* redisplay */
+           if (LYValidate || check_realm) {
+               LYPermitURL = TRUE;
+               StrAllocCopy(lynxlistfile, newdoc.address);
+           }
+           break;
+
        case LYK_VLINKS:  /* list links visited during the current session */
            if (!strcmp((curdoc.title ? curdoc.title : ""),
                        VISITED_LINKS_TITLE)) {
@@ -4695,6 +4732,8 @@
                        curdoc.bookmark == NULL &&
                        strcmp((curdoc.title ? curdoc.title : ""),
                               LIST_PAGE_TITLE) &&
+                       strcmp((curdoc.title ? curdoc.title : ""),
+                              ADDRLIST_PAGE_TITLE) &&
                        strcmp((curdoc.title ? curdoc.title : ""),
                               VISITED_LINKS_TITLE)) {
                        /*
diff -uNr lynx-2.8.2-dev.16+kd.orig/src/LYUtils.c 
lynx-2.8.2-dev.16+kd/src/LYUtils.c
--- lynx-2.8.2-dev.16+kd.orig/src/LYUtils.c     Mon Feb  8 02:32:59 1999
+++ lynx-2.8.2-dev.16+kd/src/LYUtils.c  Wed Feb 10 13:44:45 1999
@@ -6076,7 +6076,8 @@
 {
     fprintf(fp0, "<html>\n<head>\n");
     LYAddMETAcharsetToFD(fp0, -1);
-    if (!strcmp(Title, LIST_PAGE_TITLE)) {
+    if (!strcmp(Title, LIST_PAGE_TITLE)      ||
+       !strcmp(Title, ADDRLIST_PAGE_TITLE)) {
        if (strchr(HTLoadedDocumentURL(), '"') == NULL) {
            char *Address = NULL;
            /*
##--eof--##

reply via email to

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