lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev dev.16 patch 3 - SOURCE_CACHE etc.


From: Klaus Weide
Subject: lynx-dev dev.16 patch 3 - SOURCE_CACHE etc.
Date: Thu, 9 Dec 1999 06:30:17 -0600 (CST)

* Changed lines -> disp_lines, cols -> disp_cols in GridText.c
* Don't reparse with SOURCE_CACHE if screen size changed only
  vertically (disp_lines).  Also don't reparse unnecessarily in
  some cases of LYK_MINIMAL.
* Don't append (HEAD) to title for INFO screen if already present.
* Set newdoc.title to curdoc.title in LYMainLoop.c for SOURCE command.
  Otherwise INFO could show the wrong document's title.
* Made global from_source_cache PRIVATE to mainloop.
* Reset DIRED_MENU item list when lynx.cfg is reloaded.
* New lynx.cfg option AUTO_UNCACHE_DIRLISTS for Dired mode, see lynx.cfg.
* Prevent filedescriptor and inode leak in HTFWriter.c that occurred if
  the same resource is repeatedly downloaded (for 'd' or for passing to
  a viewer).
* Corrected logic for suppressing last HTDisplayPartial call at end of file,
  after discussion with LP.
* Corrected line counting in HTDisplayPartial, taking into account offsets
  used for the various variables being compared.
* Added confirmation prompt for reloading non-safe post_data documents in
  form-based Options Menu change handling.  Before this change, the prompt
  would be issued after returning to mainloop() instead, with different
  behavior if confirmation was denied: The document would be popped instead
  of keeping the current instance.
* Function confirm_post_resub made PUBLIC and moved to HTAlert.c.  New
  function srcmode_for_next_retrieval in LYGetFile.c.  Both used for the
  above and in LYMainLoop.c.
* Fixed behavior for various post_data confirmation prompts in connection
  with SOURCE_CACHE in LYMainLoop.c.  Before this change, the user would
  be prompted to confirm reloading, yet on confirmation reparsing from the
  source cache would be attempted.  So prompts were unnecessary and
  misleading.
* Try to handle some failures of errors in source cache reparsing better.
  Try to make sure that unsafe post_data documents don't get reloaded
  accidentally without confirmation if source cache reparsing fails.
  Treat partial data (i.e. loading from source cache probably 'z'apped by
  user) as successful, as HTLoadDocument does.  (Various error conditions
  are currently only passed on to the caller by HTParseFile, not by
  HTParseMem.  I left this apparent design decision unchanged.)
* Source cache reparsing did not rewrite a previous cache copy when the
  document was reloaded from the net.  This means that e.g. NOCACHE or
  RELOAD would force reloading from the network, but then on the next
  non-forced loading of the document (e.g. by toggling to SOURCE view)
  the old (and possibly stale) copy would again be used.  Now the newer
  copy replaces the old copy if loading is successful (and not interrupted
  or aborted with 'z'). (Note that RELOAD while in source view, at least
  in the normal one without -preparsed or -prettysrc, does not have this
  effect since the document does not get pushed through the cache writer
  at all in that case.)
* If a source cache copy for a document exists, there needs to be a way
  to ensure that reparsing from that copy does not try to rewrite that
  same copy "under our feet" while still reading from it.  Previously
  that was done by just never rewriting an existing source cache.  After
  changing that (see previous item), a different approach is needed to
  prevent such collisions.  This is now solved in two ways: (a) Bse a
  temporary new file or memory chunk for writing, and only commit it to
  the doc's ParentAnchor object (replacing the previous copy) at the
  end of the incoming data stream. This is done in CacheThru_free(), but
  not in CacheThru_abort(), meaning that an interrupted or otherwise aborted
  transmission will not replace an existing cached copy with a truncated
  now version - as long as such interruption gets detected and properly
  indicated, which is not the case for reading from the source cache with
  SOURCE_CACHE:MEMORY in effect, see above.  (b) Change the HTParentAnchor's
  protocol field to indicate a non-HTTP protocol, before starting to load
  from source cache in HTreparse_document().  Normally, as long as
  DEBUG_SOURCE_CACHE is not defined, this prevents the cache writer from
  (re)generating a cache copy.  Mechanism (b) isn't necessary (everything
  still works when DEBUG_SOURCE_CACHE is defined), it just avoids
  unnecessary work.
* Source cache files and chunks were not always being removed when they
  should, probably since change of 1999-06-18.  A large number of cache
  copies could be kept around unnecessarily wasting disk or memory space.
  Now make sure that the source cache copy gets removed when a document
  is removed from the cache of rendered docs.  They would never be reused
  anyway.  New function HTAnchor_clearSourceCache.  Note to other developers:
  HTAnchor_delete() doesn't always remove the HTParentAnchor object, see its
  implementation.
* Detect errors during appending to the cache copy.  Previously, memory
  allocation errors (for SOURCE_CACHE:MEMORY) would cause program exit,
  and file write errors (SOURCE_CACHE:FILE, e.g. if the temp disk space
  was full) would go undetected and leave the cache file corrupt or
  truncated.  Now allow the program to continue normally, just cancel
  the source cache generation for the current document (which may free
  up enough memory or disk space to remedy the immediate problem).  Produce
  an alert message.  In the case of a file error, produce the alert only
  once until a possibly re-reading of lynx.cfg, since Lynx should remain
  otherwise functional in the face of cache file writing errors.
* Extented HTChunk: added a variant for which memory allocation errors
  are not fatal.  Used for changes described in previous item.

Index: 2.31/WWW/Library/Implementation/HTChunk.c
--- 2.31/WWW/Library/Implementation/HTChunk.c Mon, 25 Oct 1999 09:01:18 -0500
+++ 2.31(w)/WWW/Library/Implementation/HTChunk.c Mon, 06 Dec 1999 11:15:15 -0600
@@ -23,6 +23,23 @@
     ch->allocated = 0;
     return ch;
 }
+PUBLIC HTChunk * HTChunkCreateMayFail ARGS2 (int,grow, int,failok)
+{
+    HTChunk * ch = (HTChunk *) calloc(1, sizeof(HTChunk));
+    if (ch == NULL) {
+       if (!failok) {
+           outofmem(__FILE__, "creation of chunk");
+       } else {
+           return ch;
+       }
+    }
+    ch->data = 0;
+    ch->growby = grow;
+    ch->size = 0;
+    ch->allocated = 0;
+    ch->failok = failok;
+    return ch;
+}
 
 /*     Create a chunk with a certain allocation unit and ensured size
 **     --------------
@@ -77,11 +94,18 @@
 PUBLIC void HTChunkPutc ARGS2 (HTChunk *,ch, char,c)
 {
     if (ch->size >= ch->allocated) {
+       char *data;
        ch->allocated = ch->allocated + ch->growby;
-        ch->data = ch->data ? (char *)realloc(ch->data, ch->allocated)
-                           : (char *)calloc(1, ch->allocated);
-      if (!ch->data)
-          outofmem(__FILE__, "HTChunkPutc");
+        data = ch->data ? (char *)realloc(ch->data, ch->allocated)
+                       : (char *)calloc(1, ch->allocated);
+       if (data) {
+           ch->data = data;
+       } else if (ch->failok) {
+          HTChunkClear(ch);    /* allocaction failed, clear all data - kw */
+          return;              /* caller should check ch->allocated - kw */
+       } else {
+          outofmem(__FILE__, "HTChunkPutc");
+       }
     }
     ch->data[ch->size++] = c;
 }
@@ -106,12 +130,19 @@
     int needed = ch->size + l;
     if (l <= 0) return;
     if (needed > ch->allocated) {
+       char *data;
        ch->allocated = needed-1 - ((needed-1) % ch->growby)
            + ch->growby; /* Round up */
-        ch->data = ch->data ? (char *)realloc(ch->data, ch->allocated)
-                           : (char *)calloc(1, ch->allocated);
-       if (ch->data == NULL)
+        data = ch->data ? (char *)realloc(ch->data, ch->allocated)
+                       : (char *)calloc(1, ch->allocated);
+       if (data) {
+           ch->data = data;
+       } else if (ch->failok) {
+          HTChunkClear(ch);    /* allocaction failed, clear all data - kw */
+          return;              /* caller should check ch->allocated - kw */
+       } else {
            outofmem(__FILE__, "HTChunkPutb");
+       }
     }
     memcpy(ch->data + ch->size, b, l);
     ch->size += l;
@@ -142,12 +173,19 @@
        utflen = 0;
 
     if (ch->size + utflen > ch->allocated) {
+       char *data;
        int growby = (ch->growby >= utflen) ? ch->growby : utflen;
        ch->allocated = ch->allocated + growby;
-        ch->data = ch->data ? (char *)realloc(ch->data, ch->allocated)
-                           : (char *)calloc(1, ch->allocated);
-      if (!ch->data)
-          outofmem(__FILE__, "HTChunkPutUtf8Char");
+        data = ch->data ? (char *)realloc(ch->data, ch->allocated)
+                       : (char *)calloc(1, ch->allocated);
+       if (data) {
+           ch->data = data;
+       } else if (ch->failok) {
+           HTChunkClear(ch);   /* allocaction failed, clear all data - kw */
+           return;             /* caller should check ch->allocated - kw */
+       } else {
+           outofmem(__FILE__, "HTChunkPutUtf8Char");
+       }
     }
 
     switch (utflen) {
@@ -200,6 +238,9 @@
 PUBLIC void HTChunkPuts ARGS2 (HTChunk *,ch, CONST char *,s)
 {
     CONST char * p;
-    for (p=s; *p; p++)
+    for (p=s; *p; p++) {
         HTChunkPutc(ch, *p);
+       if (ch->allocated == 0)
+           return;             /* must have been allocation failure - kw */
+    }
 }
Index: 2.31/WWW/Library/Implementation/HTFormat.c
--- 2.31/WWW/Library/Implementation/HTFormat.c Sat, 04 Dec 1999 12:57:50 -0600
+++ 2.31(w)/WWW/Library/Implementation/HTFormat.c Wed, 08 Dec 1999 23:50:03 
-0600
@@ -528,11 +528,11 @@
        **
        **  So repaint the page only when necessary:
        */
-       if (((Newline_partial + display_lines) > NumOfLines_partial)
+       if (((Newline_partial + display_lines) - 1 >= NumOfLines_partial)
                /* current page not complete... */
        && (partial_threshold > 0 ?
-               ((Newline_partial + partial_threshold) < HText_getNumOfLines()) 
:
-               ((Newline_partial + display_lines) < HText_getNumOfLines()))
+               ((Newline_partial + partial_threshold) -1 <= 
HText_getNumOfLines()) :
+               ((Newline_partial + display_lines) - 1 <= 
HText_getNumOfLines()))
                /*
                 * Originally we rendered by increments of 2 lines,
                 * but that got annoying on slow network connections.
@@ -807,8 +807,10 @@
        (*targetClass.put_block)(sink, input_buffer, status);
        bytes += status;
        HTReadProgress(bytes, 0);
-       if (NumOfLines_partial >= 0 && HTMainText && HTMainAnchor &&
-           bytes != HTMainAnchor->content_length) 
+       /*  Suppress last screen update in partial mode - a regular update
+        *  under control of mainloop() should follow anyway. - kw
+        */
+       if (display_partial && bytes != HTMainAnchor->content_length) 
            HTDisplayPartial();
 
        if (HTCheckForInterrupt()) {
@@ -1165,7 +1167,7 @@
 **     -501            Stream stack failed (cannot present or convert).
 **     HT_LOADED       All data sent.
 **
-**  Stat of memory and target stream on return:
+**  State of memory and target stream on return:
 **     always          chunk unchanged; target freed, aborted, or NULL.
 */
 PUBLIC int HTParseMem ARGS5(
Index: 2.31/WWW/Library/Implementation/HTChunk.h
--- 2.31/WWW/Library/Implementation/HTChunk.h Fri, 04 Jun 1999 20:57:16 -0500
+++ 2.31(w)/WWW/Library/Implementation/HTChunk.h Mon, 06 Dec 1999 11:15:16 -0600
@@ -21,6 +21,7 @@
        int     growby;         /* Allocation unit in bytes     */
        int     allocated;      /* Current size of *data        */
        char *  data;           /* Pointer to malloced area or 0 */
+       int     failok;         /* allowed to fail without exiting program? */
 } HTChunk;
 
 
@@ -41,6 +42,15 @@
  */
 
 extern HTChunk * HTChunkCreate PARAMS((int growby));
+
+/*
+ *  Create a chunk for which an allocation error is not a fatal application
+ *  error if failok != 0, but merely resets the chunk.  When using a chunk
+ *  created this way, the caller should always check whether the contents
+ *  are ok each time after data have been appended.
+ *  The create call may also fail and will reurn NULL in that case. - kw
+ */
+extern HTChunk * HTChunkCreateMayFail PARAMS((int growby, int failok));
 
 /*
  *  Like HTChunkCreate but with initial allocation - kw
Index: 2.31/WWW/Library/Implementation/HTAnchor.h
--- 2.31/WWW/Library/Implementation/HTAnchor.h Mon, 25 Oct 1999 09:01:18 -0500
+++ 2.31(w)/WWW/Library/Implementation/HTAnchor.h Mon, 06 Dec 1999 13:23:47 
-0600
@@ -189,6 +189,11 @@
 extern BOOL HTAnchor_delete PARAMS((
        HTParentAnchor *        me));
 
+#ifdef SOURCE_CACHE
+extern void HTAnchor_clearSourceCache PARAMS((
+       HTParentAnchor *        me));
+#endif
+
 /*             Move an anchor to the head of the list of its siblings
 **             ------------------------------------------------------
 **
Index: 2.31/WWW/Library/Implementation/HTAnchor.c
--- 2.31/WWW/Library/Implementation/HTAnchor.c Mon, 25 Oct 1999 09:01:18 -0500
+++ 2.31(w)/WWW/Library/Implementation/HTAnchor.c Mon, 06 Dec 1999 13:25:01 
-0600
@@ -598,6 +598,28 @@
     }
 }
 
+#ifdef SOURCE_CACHE
+PUBLIC void HTAnchor_clearSourceCache ARGS1(
+       HTParentAnchor *,       me)
+{
+    /*
+     * Clean up the source cache, if any.
+     */
+    if (me->source_cache_file) {
+       CTRACE((tfp, "SourceCache: Removing file %s\n",
+              me->source_cache_file));
+       LYRemoveTemp(me->source_cache_file);
+       FREE(me->source_cache_file);
+    }
+    if (me->source_cache_chunk) {
+       CTRACE((tfp, "SourceCache: Removing memory chunk %p\n",
+              (void *)me->source_cache_chunk));
+       HTChunkFree(me->source_cache_chunk);
+       me->source_cache_chunk = NULL;
+    }
+}
+#endif /* SOURCE_CACHE */
+
 PUBLIC BOOL HTAnchor_delete ARGS1(
        HTParentAnchor *,       me)
 {
@@ -722,20 +744,7 @@
     FREE(me->owner);
     FREE(me->RevTitle);
 #ifdef SOURCE_CACHE
-    /*
-     * Clean up the source cache, if any.
-     */
-    if (me->source_cache_file) {
-       CTRACE((tfp, "Removing source cache file %s\n",
-              me->source_cache_file));
-       LYRemoveTemp(me->source_cache_file);
-       FREE(me->source_cache_file);
-    }
-    if (me->source_cache_chunk) {
-       CTRACE((tfp, "Removing memory source cache %p\n",
-              (void *)me->source_cache_chunk));
-       HTChunkFree(me->source_cache_chunk);
-    }
+    HTAnchor_clearSourceCache(me);
 #endif
     if (me->FileCache) {
        FILE *fd;
Index: 2.31/src/HTAlert.c
--- 2.31/src/HTAlert.c Sat, 04 Dec 1999 00:06:06 -0600
+++ 2.31(w)/src/HTAlert.c Tue, 07 Dec 1999 01:44:15 -0600
@@ -22,9 +22,7 @@
 
 #include <LYLeaks.h>
 
-#if defined(WIN_EX) && defined(UNUSED_CODE)
 #include <HTParse.h>
-#endif
 
 /*     Issue a message about a problem.                HTAlert()
 **     --------------------------------
@@ -542,6 +540,88 @@
 PUBLIC BOOL HTConfirm ARGS1(CONST char *, Msg)
 {
     return (BOOL) HTConfirmDefault(Msg, DFT_CONFIRM);
+}
+
+/*
+ *  Ask a post resubmission prompt with some indication of what would
+ *  be resubmitted, useful especially for going backward in history.
+ *  Try to use parts of the address or, if given, the title, depending
+ *  on how much fits on the statusline.
+ *  if_imgmap and if_file indicate how to handle an address that is
+ *  a "LYNXIMGMAP:", or a "file:" URL (presumably the List Page file),
+ *  respectively: 0: auto-deny, 1: auto-confirm, 2: prompt.
+ *  - kw
+ */
+
+PUBLIC BOOL confirm_post_resub ARGS4(
+    CONST char*,       address,
+    CONST char*,       title,
+    int,               if_imgmap,
+    int,               if_file)
+{
+    size_t len1;
+    CONST char *msg = CONFIRM_POST_RESUBMISSION_TO;
+    char buf[240];
+    char *temp = NULL;
+    BOOL res;
+    size_t maxlen = LYcols - 6;
+    if (!address) {
+       return(NO);
+    } else if (!strncmp(address, "LYNXIMGMAP:", 11)) {
+       if (if_imgmap <= 0)
+           return(NO);
+       else if (if_imgmap == 1)
+           return(YES);
+       else
+           msg = CONFIRM_POST_LIST_RELOAD;
+    } else if (!strncmp(address, "file:", 5)) {
+       if (if_file <= 0)
+           return(NO);
+       else if (if_file == 1)
+           return(YES);
+       else
+           msg = CONFIRM_POST_LIST_RELOAD;
+    } else if (dump_output_immediately) {
+       return(NO);
+    }
+    if (maxlen >= sizeof(buf))
+       maxlen = sizeof(buf) - 1;
+    if ((len1 = strlen(msg)) +
+       strlen(address) <= maxlen) {
+       sprintf(buf, msg, address);
+       return HTConfirm(buf);
+    }
+    if (len1 + strlen(temp = HTParse(address, "",
+                                    PARSE_ACCESS+PARSE_HOST+PARSE_PATH
+                                    +PARSE_PUNCTUATION)) <= maxlen) {
+       sprintf(buf, msg, temp);
+       res = HTConfirm(buf);
+       FREE(temp);
+       return(res);
+    }
+    FREE(temp);
+    if (title && (len1 + strlen(title) <= maxlen)) {
+       sprintf(buf, msg, title);
+       return HTConfirm(buf);
+    }
+    if (len1 + strlen(temp = HTParse(address, "",
+                                    PARSE_ACCESS+PARSE_HOST
+                                    +PARSE_PUNCTUATION)) <= maxlen) {
+       sprintf(buf, msg, temp);
+       res = HTConfirm(buf);
+       FREE(temp);
+       return(res);
+    }
+    FREE(temp);
+    if ((temp = HTParse(address, "", PARSE_HOST)) && *temp &&
+       len1 + strlen(temp) <= maxlen) {
+       sprintf(buf, msg, temp);
+       res = HTConfirm(buf);
+       FREE(temp);
+       return(res);
+    }
+    FREE(temp);
+    return HTConfirm(CONFIRM_POST_RESUBMISSION);
 }
 
 /*     Prompt for answer and get text back.            HTPrompt()
Index: 2.31/src/LYGetFile.c
--- 2.31/src/LYGetFile.c Sat, 04 Dec 1999 00:06:06 -0600
+++ 2.31(w)/src/LYGetFile.c Tue, 07 Dec 1999 01:52:26 -0600
@@ -28,6 +28,7 @@
 #endif /* DIRED_SUPPORT */
 #include <LYReadCFG.h>
 #include <LYHistory.h>
+#include <LYPrettySrc.h>
 
 #include <LYexit.h>
 #include <LYLeaks.h>
@@ -1076,6 +1077,42 @@
              CTRACE((tfp,"\n"));
              return(NULLFILE);
          }
+}
+
+/*
+ *  Set source mode for the next retrieval via getfile or HTreparse_document.
+ *  mode == -1: force normal presentation
+ *  mode ==  1: force source presentation
+ *  mode ==  0: reset to normal if it was set to source
+ *  - kw
+ */
+PUBLIC void srcmode_for_next_retrieval ARGS1(
+    int,       mode)
+{
+    if (mode < 0) {
+       HTOutputFormat = WWW_PRESENT;
+#ifdef USE_PSRC
+       psrc_view = FALSE;
+#endif
+
+    } else if (mode == 0) {
+       if (HTOutputFormat == WWW_SOURCE)
+           HTOutputFormat = WWW_PRESENT;
+#ifdef USE_PSRC
+       else if (LYpsrc)
+           psrc_view = FALSE;
+#endif
+
+    } else {
+#ifdef USE_PSRC
+       if (LYpsrc)
+           psrc_view = TRUE;
+       else
+           HTOutputFormat = WWW_SOURCE;
+#else
+       HTOutputFormat = WWW_SOURCE;
+#endif
+    }
 }
 
 /*
Index: 2.31/src/LYLocal.c
--- 2.31/src/LYLocal.c Sat, 04 Dec 1999 00:06:06 -0600
+++ 2.31(w)/src/LYLocal.c Tue, 07 Dec 1999 15:46:28 -0600
@@ -2217,6 +2217,22 @@
        menu_head = new;
 }
 
+PUBLIC void reset_dired_menu NOARGS
+{
+    if (menu_head != defmenu) {
+       struct dired_menu *mp, *mp_next;
+       for (mp = menu_head; mp != NULL; mp = mp_next) {
+            FREE(mp->sfx);
+            FREE(mp->link);
+            FREE(mp->rest);
+            FREE(mp->href);
+           mp_next = mp_next;
+           FREE(mp);
+        }
+       menu_head = NULL;
+    }
+}
+
 /*
  *  Create URL for DIRED HREF value.
  */
Index: 2.31/src/LYMainLoop.c
--- 2.31/src/LYMainLoop.c Sat, 04 Dec 1999 00:06:06 -0600
+++ 2.31(w)/src/LYMainLoop.c Wed, 08 Dec 1999 22:44:44 -0600
@@ -171,11 +171,6 @@
 PRIVATE void status_link PARAMS((char *curlink_name, BOOLEAN show_more, 
BOOLEAN show_indx));
 PRIVATE void show_main_statusline PARAMS((CONST linkstruct curlink, int 
for_what));
 PRIVATE void form_noviceline PARAMS((int));
-PRIVATE BOOL confirm_post_resub PARAMS((
-    CONST char*                address,
-    CONST char*                title,
-    int                        if_imgmap,
-    int                        if_file));
 PRIVATE int are_different PARAMS((document *doc1, document *doc2));
 
 #ifndef DONT_TRACK_INTERNAL_LINKS
@@ -250,6 +245,7 @@
     FREE(ownerS_address);
 #ifdef DIRED_SUPPORT
     clear_tags();
+    reset_dired_menu();
 #endif /* DIRED_SUPPORT */
     FREE(WWW_Download_File);   /* LYGetFile.c/HTFWriter.c */
     FREE(LYRequestReferer);
@@ -431,6 +427,13 @@
     return(0);                 /* indicates OK */
 }
 
+#ifdef DIRED_SUPPORT
+#define DIRED_UNCACHE_1 if (LYAutoUncacheDirLists < 1) /*nothing*/ ;\
+                       else HTuncache_current_document()
+#define DIRED_UNCACHE_2 if (LYAutoUncacheDirLists < 2) /*nothing*/ ;\
+                       else HTuncache_current_document()
+#endif /* DIRED_SUPPORT */
+
 PRIVATE void do_check_goto_URL ARGS3(
     char *,    user_input_buffer,
     char **,   old_user_input,
@@ -576,7 +579,7 @@
                *force_load = TRUE;
 #ifdef DIRED_SUPPORT
                if (lynx_edit_mode)
-                   HTuncache_current_document();
+                   DIRED_UNCACHE_2;
 #endif /* DIRED_SUPPORT */
            }
            LYUserSpecifiedURL = TRUE;
@@ -910,6 +913,16 @@
 }
 #endif
 
+PRIVATE BOOLEAN reparse_document ARGS1(
+    BOOLEAN *, from_source_cache_p)
+{
+    BOOLEAN ok;
+    if ((ok = HTreparse_document())) {
+       *from_source_cache_p = TRUE;  /* flag for mainloop events */
+    }
+    return ok;
+}
+
 PRIVATE int handle_LYK_ACTIVATE ARGS6(
     int *,     c,
     int,       cmd GCC_UNUSED,
@@ -1381,7 +1394,7 @@
 
 #if defined(DIRED_SUPPORT) && !defined(__DJGPP__)
            if (lynx_edit_mode) {
-                 HTuncache_current_document();
+                 DIRED_UNCACHE_2;
                  /*
                   *  Unescaping any slash chars in the URL,
                   *  but avoid double unescaping and too-early
@@ -1755,7 +1768,7 @@
 {
     if (lynx_edit_mode && !no_dired_support) {
        if (local_create(&curdoc)) {
-           HTuncache_current_document();
+           DIRED_UNCACHE_1;
            StrAllocCopy(newdoc.address, curdoc.address);
            FREE(curdoc.address);
            FREE(newdoc.post_data);
@@ -1887,6 +1900,8 @@
             *  change, move, or delete it during the
             *  CSwing session. - FM
             */
+           /* could use DIRED_UNCACHE_1 but it's currently only defined
+              for dired - kw */
            HTuncache_current_document();
            StrAllocCopy(newdoc.address, curdoc.address);
            StrAllocCopy(newdoc.title,
@@ -2391,7 +2406,7 @@
                        HTUnEscapeSome(tp, "/");
                        if (edit_current_file(tp,
                                              curdoc.link, Newline)) {
-                           HTuncache_current_document();
+                           DIRED_UNCACHE_1;
                            StrAllocCopy(newdoc.address,
                                         curdoc.address);
                            FREE(curdoc.address);
@@ -3030,7 +3045,8 @@
     *cshelpfile = NULL;                /* reset pointer - kw */
 }
 
-PRIVATE void handle_LYK_HISTORICAL NOARGS
+PRIVATE void handle_LYK_HISTORICAL ARGS1(
+    BOOLEAN *, from_source_cache_p)
 {
 #ifdef SOURCE_CACHE
     if (!HTcan_reparse_document()) {
@@ -3067,7 +3083,7 @@
                HISTORICAL_ON_VALID_OFF : HISTORICAL_OFF_VALID_ON);
     }
 #ifdef SOURCE_CACHE
-    (void) HTreparse_document();
+    (void) reparse_document(from_source_cache_p);
 #endif
     return;
 }
@@ -3117,8 +3133,9 @@
     return FALSE;
 }
 
-PRIVATE BOOLEAN handle_LYK_IMAGE_TOGGLE ARGS1(
-    int *,     cmd)
+PRIVATE BOOLEAN handle_LYK_IMAGE_TOGGLE ARGS2(
+    int *,     cmd,
+    BOOLEAN *, from_source_cache_p)
 {
     if (clickable_images)
        clickable_images = FALSE;
@@ -3128,7 +3145,8 @@
     HTUserMsg(clickable_images ?
             CLICKABLE_IMAGES_ON : CLICKABLE_IMAGES_OFF);
 #ifdef SOURCE_CACHE
-    if (HTreparse_document()) {
+    if (HTcan_reparse_document()) {
+       reparse_document(from_source_cache_p);
        return FALSE;
     }
 #endif
@@ -3281,8 +3299,9 @@
     return FALSE;
 }
 
-PRIVATE BOOLEAN handle_LYK_INLINE_TOGGLE ARGS1(
-    int *,     cmd)
+PRIVATE BOOLEAN handle_LYK_INLINE_TOGGLE ARGS2(
+    int *,     cmd,
+    BOOLEAN *, from_source_cache_p)
 {
     if (pseudo_inline_alts)
        pseudo_inline_alts = FALSE;
@@ -3292,7 +3311,8 @@
     HTUserMsg(pseudo_inline_alts ?
              PSEUDO_INLINE_ALTS_ON : PSEUDO_INLINE_ALTS_OFF);
 #ifdef SOURCE_CACHE
-    if (HTreparse_document()) {
+    if (HTcan_reparse_document()) {
+       reparse_document(from_source_cache_p);
        return FALSE;
     }
 #endif
@@ -3541,7 +3561,7 @@
            highlight(OFF, curdoc.link, prev_target);
 #ifdef DIRED_SUPPORT
            if (lynx_edit_mode)
-               HTuncache_current_document();
+               DIRED_UNCACHE_2;
 #endif /* DIRED_SUPPORT */
        }
     } else {
@@ -3552,7 +3572,8 @@
     }
 }
 
-PRIVATE void handle_LYK_MINIMAL NOARGS
+PRIVATE void handle_LYK_MINIMAL ARGS1(
+    BOOLEAN *, from_source_cache_p)
 {
     if (!historical_comments) {
 #ifdef SOURCE_CACHE
@@ -3575,10 +3596,10 @@
            newdoc.line = curdoc.line;
            newdoc.link = curdoc.link;
        }
-    }
 #ifdef SOURCE_CACHE
     } /* end if no bypass */
 #endif
+    }
     if (minimal_comments)
        minimal_comments = FALSE;
     else
@@ -3586,13 +3607,13 @@
     if (!historical_comments) {
        HTAlert(minimal_comments ?
                MINIMAL_ON_IN_EFFECT : MINIMAL_OFF_VALID_ON);
+#ifdef SOURCE_CACHE
+       (void)reparse_document(from_source_cache_p);
+#endif
     } else {
        HTAlert(minimal_comments ?
                MINIMAL_ON_BUT_HISTORICAL : MINIMAL_OFF_HISTORICAL_ON);
     }
-#ifdef SOURCE_CACHE
-    (void)HTreparse_document();
-#endif
     return;
 }
 
@@ -3607,7 +3628,7 @@
        if (ret == PERMIT_FORM_RESULT) { /* Permit form thrown up */
            *refresh_screen = TRUE;
        } else if (ret) {
-           HTuncache_current_document();
+           DIRED_UNCACHE_1;
            StrAllocCopy(newdoc.address, curdoc.address);
            FREE(curdoc.address);
            FREE(newdoc.post_data);
@@ -3624,9 +3645,10 @@
 }
 #endif /* DIRED_SUPPORT */
 
-PRIVATE BOOLEAN handle_LYK_OPTIONS ARGS2(
+PRIVATE BOOLEAN handle_LYK_OPTIONS ARGS3(
     int *,     cmd,
-    BOOLEAN *, refresh_screen)
+    BOOLEAN *, refresh_screen,
+    BOOLEAN *, from_source_cache_p)
 {
 #ifndef NO_OPTION_MENU
     if (!LYUseFormsOptions) {
@@ -3672,6 +3694,9 @@
                                          pref_charset : ""))) &&
             (!strncmp(curdoc.address, "http", 4) ||
              !strncmp(curdoc.address, "lynxcgi:", 8)))) {
+
+           BOOLEAN canreparse_post = FALSE;
+
            /*
             *  Check if this is a reply from a POST, and if so,
             *  seek confirmation of reload if the safe element
@@ -3679,6 +3704,9 @@
             */
            if ((curdoc.post_data != NULL &&
                 curdoc.safe != TRUE) &&
+#ifdef SOURCE_CACHE
+               (!(canreparse_post = HTcan_reparse_document())) &&
+#endif
                confirm_post_resub(curdoc.address, curdoc.title,
                                   2, 1) == FALSE) {
                HTInfoMsg(WILL_NOT_RELOAD_DOC);
@@ -3706,19 +3734,12 @@
                    reloading = TRUE;
                }
                if (HTisDocumentSource()) {
-#ifndef USE_PSRC
-                   HTOutputFormat = WWW_SOURCE;
-#else
-                   if (LYpsrc)
-                       psrc_view = TRUE;
-                   else
-                       HTOutputFormat = WWW_SOURCE;
-#endif
+                   srcmode_for_next_retrieval(1);
                }
 #ifdef SOURCE_CACHE
                if (reloading == FALSE) {
                    /* one more attempt to be smart enough: */
-                   if (HTreparse_document()) {
+                   if (reparse_document(from_source_cache_p)) {
                        FREE(CurrentUserAgent);
                        FREE(CurrentNegoLanguage);
                        FREE(CurrentNegoCharset);
@@ -3726,6 +3747,18 @@
                    }
                }
 #endif
+               if (canreparse_post &&
+                   confirm_post_resub(curdoc.address, curdoc.title,
+                                      2, 1) == FALSE) {
+                   if (HTisDocumentSource()) {
+                       srcmode_for_next_retrieval(0);
+                   }
+                   FREE(CurrentUserAgent);
+                   FREE(CurrentNegoLanguage);
+                   FREE(CurrentNegoCharset);
+                   return FALSE;
+               }
+
                HEAD_request = HTLoadedDocumentIsHEAD();
                HTuncache_current_document();
 #ifdef NO_ASSUME_SAME_DOC
@@ -4016,7 +4049,7 @@
        FREE(newdoc.address);
 #ifdef DIRED_SUPPORT
        if (lynx_edit_mode)
-           HTuncache_current_document();
+           DIRED_UNCACHE_2;
 #endif /* DIRED_SUPPORT */
     } else if (child_lynx == TRUE) {
        return(1); /* exit on left arrow in main screen */
@@ -4097,8 +4130,9 @@
     return FALSE;
 }
 
-PRIVATE BOOLEAN handle_LYK_RAW_TOGGLE ARGS1(
-    int *,     cmd)
+PRIVATE BOOLEAN handle_LYK_RAW_TOGGLE ARGS2(
+    int *,     cmd,
+    BOOLEAN *, from_source_cache_p)
 {
     if (HTLoadedDocumentCharset()) {
        HTUserMsg(gettext("charset for this document specified explicitely, 
sorry..."));
@@ -4108,7 +4142,8 @@
        HTUserMsg(LYRawMode ? RAWMODE_OFF : RAWMODE_ON);
        HTMLSetCharacterHandling(current_char_set);
 #ifdef SOURCE_CACHE
-       if (HTreparse_document()) {
+       if (HTcan_reparse_document()) {
+           reparse_document(from_source_cache_p);
            return FALSE;
        }
 #endif
@@ -4138,14 +4173,7 @@
     if (HTisDocumentSource()) {
        if ((forced_UCLYhdnl = HTMainText_Get_UCLYhndl()) >= 0)
            force_old_UCLYhndl_on_reload = TRUE;
-#ifndef USE_PSRC
-       HTOutputFormat = WWW_SOURCE;
-#else
-       if (LYpsrc)
-           psrc_view = TRUE;
-       else
-           HTOutputFormat = WWW_SOURCE;
-#endif
+       srcmode_for_next_retrieval(1);
     }
 
     HEAD_request = HTLoadedDocumentIsHEAD();
@@ -4185,11 +4213,16 @@
 }
 
 #ifdef DIRED_SUPPORT
-PRIVATE void handle_LYK_REMOVE NOARGS
+PRIVATE void handle_LYK_REMOVE ARGS1(
+    BOOLEAN *, refresh_screen)
 {
     if (lynx_edit_mode && nlinks > 0 && !no_dired_support) {
+       int linkno = curdoc.link; /* may be changed in local_remove - kw */
        local_remove(&curdoc);
-       do_cleanup_after_delete();
+       if (LYAutoUncacheDirLists >= 1)
+           do_cleanup_after_delete();
+       else if (curdoc.link != linkno)
+           *refresh_screen = TRUE;
     }
 }
 #endif /* DIRED_SUPPORT */
@@ -4226,7 +4259,8 @@
     }
 }
 
-PRIVATE void handle_LYK_SOFT_DQUOTES NOARGS
+PRIVATE void handle_LYK_SOFT_DQUOTES ARGS1(
+    BOOLEAN *, from_source_cache_p)
 {
 #ifdef SOURCE_CACHE
     if (!HTcan_reparse_document()) {
@@ -4257,7 +4291,7 @@
     HTUserMsg(soft_dquotes ?
              SOFT_DOUBLE_QUOTE_ON : SOFT_DOUBLE_QUOTE_OFF);
 #ifdef SOURCE_CACHE
-    (void)HTreparse_document();
+    (void)reparse_document(from_source_cache_p);
 #endif
     return;
 }
@@ -4266,11 +4300,18 @@
  * Check if this is a reply from a POST, and if so,
  * seek confirmation if the safe element is not set.  - FM
  */
-PRIVATE void handle_LYK_SOURCE ARGS1(
-    char **,   ownerS_address_p)
+PRIVATE void handle_LYK_SOURCE ARGS2(
+    char **,   ownerS_address_p,
+    BOOLEAN *, from_source_cache_p)
 {
+#ifdef SOURCE_CACHE
+    BOOLEAN canreparse_post = FALSE;
+#endif
     if ((curdoc.post_data != NULL &&
         curdoc.safe != TRUE) &&
+#ifdef SOURCE_CACHE
+       (!(canreparse_post = HTcan_reparse_document())) &&
+#endif
        confirm_post_resub(curdoc.address, curdoc.title,
                           1, 1) == FALSE) {
        HTInfoMsg(CANCELLED);
@@ -4278,26 +4319,16 @@
     }
 
     if (HTisDocumentSource()) {
-       HTOutputFormat = WWW_PRESENT;
-#ifdef USE_PSRC
-       psrc_view = FALSE;
-#endif
+       srcmode_for_next_retrieval(-1);
     } else {
        if (HText_getOwner())
            StrAllocCopy(*ownerS_address_p, HText_getOwner());
        LYUCPushAssumed(HTMainAnchor);
-#ifdef USE_PSRC
-       if (LYpsrc)
-           psrc_view = TRUE;
-       else
-           HTOutputFormat = WWW_SOURCE;
-#else
-       HTOutputFormat = WWW_SOURCE;
-#endif
+       srcmode_for_next_retrieval(1);
     }
 
 #ifdef SOURCE_CACHE
-    if (HTreparse_document()) {
+    if (reparse_document(from_source_cache_p)) {
        /*
         * These normally get cleaned up after getfile() returns;
         * since we're not calling getfile(), we have to clean them
@@ -4314,17 +4345,25 @@
        HTMLSetCharacterHandling(current_char_set);  /* restore now */
 
        return;
+    } else if (canreparse_post) {
+       srcmode_for_next_retrieval(0);
+       LYUCPopAssumed();       /* probably a right place here */
+       return;
     }
 #endif
 
+    if (curdoc.title)
+       StrAllocCopy(newdoc.title, curdoc.title);
     FREE(curdoc.address); /* so it doesn't get pushed */
     LYforce_no_cache = TRUE;
 }
 
-PRIVATE void handle_LYK_SWITCH_DTD NOARGS
+PRIVATE void handle_LYK_SWITCH_DTD ARGS1(
+    BOOLEAN *, from_source_cache_p)
 {
 #ifdef SOURCE_CACHE
-    if (!HTcan_reparse_document()) {
+    BOOLEAN canreparse = FALSE;
+    if (!(canreparse = HTcan_reparse_document())) {
 #endif
        /*
         * Check if this is a reply from a POST, and if so,
@@ -4348,12 +4387,7 @@
               AND switch back from the source view to presentation view.-HV
            */
            if (HTisDocumentSource() && LYPreparsedSource) {
-#ifdef USE_PSRC
-               if (LYpsrc)
-                   psrc_view = TRUE;
-               else
-#endif
-                   HTOutputFormat = WWW_SOURCE;
+               srcmode_for_next_retrieval(1);
            }
            HTuncache_current_document();
            StrAllocCopy(newdoc.address, curdoc.address);
@@ -4373,17 +4407,14 @@
     HTSwitchDTD(!Old_DTD);
     HTUserMsg(Old_DTD ? USING_DTD_0 : USING_DTD_1);
 #ifdef SOURCE_CACHE
-    if (HTcan_reparse_document()) {
+    if (canreparse) {
        if (HTisDocumentSource() && LYPreparsedSource) {
-#ifdef USE_PSRC
-           if (LYpsrc)
-               psrc_view = TRUE;
-           else
-#endif
-               HTOutputFormat = WWW_SOURCE;
+           srcmode_for_next_retrieval(1);
        }
-       (void)HTreparse_document();
-    } /* end if no bypass */
+       if (!reparse_document(from_source_cache_p)) {
+           srcmode_for_next_retrieval(0);
+       }
+    }
 #endif
     return;
 }
@@ -4559,7 +4590,7 @@
         *  be updated to included the uploaded file if
         *  placed in the current directory. - FM
         */
-       HTuncache_current_document();
+       DIRED_UNCACHE_1;
      }
 }
 #endif /* DIRED_SUPPORT */
@@ -5047,6 +5078,7 @@
     BOOLEAN emacs_keys_flag = emacs_keys;
     BOOLEAN trace_mode_flag = FALSE;
     BOOLEAN forced_HTML_mode = LYforce_HTML_mode;
+    BOOLEAN from_source_cache = FALSE;
     char cfile[128];
     FILE *cfp;
     char *cp;
@@ -6053,7 +6085,7 @@
        if (HTdocument_settings_changed()) {
           if (HTcan_reparse_document()) {
               HTInfoMsg(gettext("Reparsing document under current 
settings..."));
-              if (HTreparse_document()) {}
+              reparse_document(&from_source_cache); /* @@@ignores status */
           } else {
                /*
                 * Urk.  I have no idea how to recover from a failure here.
@@ -6068,9 +6100,9 @@
        }
 
        /*
-        *  Trying to accomodate HTreparse_document() logic
-        *  with mainloop events.  Working out of force_load cycle
-        *  set all the necessary flags here, from case NORMAL
+        *  Trying to accommodate HTreparse_document() logic
+        *  with mainloop events.  Working outside of the force_load cycle
+        *  we set all the necessary flags here, from case NORMAL
         *  (see also LYK_SOURCE, some stuff implemented directly there).
         */
        if (from_source_cache) {
@@ -6694,7 +6726,7 @@
            break;
 
        case LYK_SOURCE:  /* toggle view source mode */
-           handle_LYK_SOURCE(&ownerS_address);
+           handle_LYK_SOURCE(&ownerS_address, &from_source_cache);
            break;
 
 #ifdef SH_EX           /* 1999/01/01 (Fri) */
@@ -6714,19 +6746,19 @@
            break;
 
        case LYK_HISTORICAL:    /* toggle 'historical' comments parsing */
-           handle_LYK_HISTORICAL();
+           handle_LYK_HISTORICAL(&from_source_cache);
            break;
 
        case LYK_MINIMAL:       /* toggle 'minimal' comments parsing */
-           handle_LYK_MINIMAL();
+           handle_LYK_MINIMAL(&from_source_cache);
            break;
 
        case LYK_SOFT_DQUOTES:
-           handle_LYK_SOFT_DQUOTES();
+           handle_LYK_SOFT_DQUOTES(&from_source_cache);
            break;
 
        case LYK_SWITCH_DTD:
-           handle_LYK_SWITCH_DTD();
+           handle_LYK_SWITCH_DTD(&from_source_cache);
            break;
 
 #ifdef NOT_DONE_YET
@@ -6944,7 +6976,7 @@
            break;
 
        case LYK_OPTIONS:       /* options screen */
-           if (handle_LYK_OPTIONS(&cmd, &refresh_screen))
+           if (handle_LYK_OPTIONS(&cmd, &refresh_screen, &from_source_cache))
                goto new_cmd;
            break;
 
@@ -6994,7 +7026,7 @@
 
 #ifdef DIRED_SUPPORT
        case LYK_REMOVE:        /* remove files and directories */
-           handle_LYK_REMOVE();
+           handle_LYK_REMOVE(&refresh_screen);
            break;
 #endif /* DIRED_SUPPORT */
 
@@ -7094,17 +7126,17 @@
            break;
 
        case LYK_IMAGE_TOGGLE:
-           if (handle_LYK_IMAGE_TOGGLE(&cmd))
+           if (handle_LYK_IMAGE_TOGGLE(&cmd, &from_source_cache))
                goto new_cmd;
            break;
 
        case LYK_INLINE_TOGGLE:
-           if (handle_LYK_INLINE_TOGGLE(&cmd))
+           if (handle_LYK_INLINE_TOGGLE(&cmd, &from_source_cache))
                goto new_cmd;
            break;
 
        case LYK_RAW_TOGGLE:
-           if (handle_LYK_RAW_TOGGLE(&cmd))
+           if (handle_LYK_RAW_TOGGLE(&cmd, &from_source_cache))
                goto new_cmd;
            break;
 
@@ -7140,88 +7172,6 @@
 
        } /* end of BIG switch */
     }
-}
-
-/*
- *  Ask a post resubmission prompt with some indication of what would
- *  be resubmitted, useful especially for going backward in history.
- *  Try to use parts of the address or, if given, the title, depending
- *  on how much fits on the statusline.
- *  if_imgmap and if_file indicate how to handle an address that is
- *  a "LYNXIMGMAP:", or a "file:" URL (presumably the List Page file),
- *  respectively: 0: auto-deny, 1: auto-confirm, 2: prompt.
- *  - kw
- */
-
-PRIVATE BOOL confirm_post_resub ARGS4(
-    CONST char*,       address,
-    CONST char*,       title,
-    int,               if_imgmap,
-    int,               if_file)
-{
-    size_t len1;
-    CONST char *msg = CONFIRM_POST_RESUBMISSION_TO;
-    char buf[240];
-    char *temp = NULL;
-    BOOL res;
-    size_t maxlen = LYcols - 6;
-    if (!address) {
-       return(NO);
-    } else if (!strncmp(address, "LYNXIMGMAP:", 11)) {
-       if (if_imgmap <= 0)
-           return(NO);
-       else if (if_imgmap == 1)
-           return(YES);
-       else
-           msg = CONFIRM_POST_LIST_RELOAD;
-    } else if (!strncmp(address, "file:", 5)) {
-       if (if_file <= 0)
-           return(NO);
-       else if (if_file == 1)
-           return(YES);
-       else
-           msg = CONFIRM_POST_LIST_RELOAD;
-    } else if (dump_output_immediately) {
-       return(NO);
-    }
-    if (maxlen >= sizeof(buf))
-       maxlen = sizeof(buf) - 1;
-    if ((len1 = strlen(msg)) +
-       strlen(address) <= maxlen) {
-       sprintf(buf, msg, address);
-       return HTConfirm(buf);
-    }
-    if (len1 + strlen(temp = HTParse(address, "",
-                                    PARSE_ACCESS+PARSE_HOST+PARSE_PATH
-                                    +PARSE_PUNCTUATION)) <= maxlen) {
-       sprintf(buf, msg, temp);
-       res = HTConfirm(buf);
-       FREE(temp);
-       return(res);
-    }
-    FREE(temp);
-    if (title && (len1 + strlen(title) <= maxlen)) {
-       sprintf(buf, msg, title);
-       return HTConfirm(buf);
-    }
-    if (len1 + strlen(temp = HTParse(address, "",
-                                    PARSE_ACCESS+PARSE_HOST
-                                    +PARSE_PUNCTUATION)) <= maxlen) {
-       sprintf(buf, msg, temp);
-       res = HTConfirm(buf);
-       FREE(temp);
-       return(res);
-    }
-    FREE(temp);
-    if ((temp = HTParse(address, "", PARSE_HOST)) && *temp &&
-       len1 + strlen(temp) <= maxlen) {
-       sprintf(buf, msg, temp);
-       res = HTConfirm(buf);
-       FREE(temp);
-       return(res);
-    }
-    FREE(temp);
-    return HTConfirm(CONFIRM_POST_RESUBMISSION);
 }
 
 PRIVATE int are_different ARGS2(
Index: 2.31/src/LYOptions.c
--- 2.31/src/LYOptions.c Sat, 04 Dec 1999 00:06:06 -0600
+++ 2.31(w)/src/LYOptions.c Tue, 07 Dec 1999 02:04:09 -0600
@@ -4132,24 +4132,28 @@
         *  see LYK_RELOAD & LYK_OPTIONS in mainloop for details...
         */
        if (HTisDocumentSource()) {
-#ifndef USE_PSRC
-           HTOutputFormat = WWW_SOURCE;
-#else
-           if (LYpsrc)
-               psrc_view = TRUE;
-           else
-               HTOutputFormat = WWW_SOURCE;
-#endif
+           srcmode_for_next_retrieval(1);
        }
 #ifdef SOURCE_CACHE
        if (reloading == FALSE) {
            /* one more attempt to be smart enough: */
-           if (HTreparse_document()) {
+           if (HTcan_reparse_document()) {
+               if (!HTreparse_document())
+                   srcmode_for_next_retrieval(0);
                CTRACE((tfp, "LYOptions.c/postoptions(): now really 
exit.\n\n"));
                return(NORMAL);
            }
        }
 #endif
+       if (newdoc->post_data != NULL && !newdoc->safe &&
+           confirm_post_resub(newdoc->address, newdoc->title, 2, 1) == FALSE) {
+           HTInfoMsg(WILL_NOT_RELOAD_DOC);
+           if (HTisDocumentSource()) {
+               srcmode_for_next_retrieval(0);
+           }
+           return(NORMAL);
+       }
+           
        HEAD_request = HTLoadedDocumentIsHEAD();
        /*  uncache and load again */
        HTuncache_current_document();
Index: 2.31/src/HTFWriter.c
--- 2.31/src/HTFWriter.c Mon, 25 Oct 1999 09:01:18 -0500
+++ 2.31(w)/src/HTFWriter.c Tue, 07 Dec 1999 15:16:47 -0600
@@ -564,7 +564,14 @@
     me->sink = sink;
 
     if (LYCachedTemp(fnam, &(anchor->FileCache))) {
-       me->fp = LYNewBinFile (fnam);
+       /*  This used to be LYNewBinFile(fnam); changed to a different call
+        *  so that the open fp gets registered in the list keeping track of
+        *  temp files, equivalent to when LYOpenTemp() gets called below.
+        *  This avoids a file descriptor leak caused by LYCloseTempFP()
+        *  not being able to find the fp.  The ".bin" suffix is expected
+        *  to not be used, it's only for fallback in unusual error cases. - kw
+        */
+       me->fp = LYOpenTempRewrite(fnam, ".bin", "wb");
     } else {
 #if defined(WIN_EX) && !defined(__CYGWIN__)    /* 1998/01/04 (Sun) */
        if (!strncmp(anchor->address,"file://localhost",16)) {
@@ -759,7 +766,14 @@
      * Set up a 'D'ownload.
      */
     if (LYCachedTemp(fnam, &(anchor->FileCache))) {
-       ret_obj->fp = LYNewBinFile (fnam);
+       /*  This used to be LYNewBinFile(fnam); changed to a different call
+        *  so that the open fp gets registered in the list keeping track of
+        *  temp files, equivalent to when LYOpenTemp() gets called below.
+        *  This avoids a file descriptor leak caused by LYCloseTempFP()
+        *  not being able to find the fp.  The ".bin" suffix is expected
+        *  to not be used, it's only for fallback in unusual error cases. - kw
+        */
+       ret_obj->fp = LYOpenTempRewrite(fnam, ".bin", "wb");
     } else {
        /*
         *  Check for a suffix.
Index: 2.31/src/LYGlobalDefs.h
--- 2.31/src/LYGlobalDefs.h Sat, 04 Dec 1999 00:06:06 -0600
+++ 2.31(w)/src/LYGlobalDefs.h Mon, 06 Dec 1999 19:12:42 -0600
@@ -72,6 +72,7 @@
 #ifdef OK_PERMIT
 extern BOOLEAN no_change_exec_perms;
 #endif /* OK_PERMIT */
+extern int LYAutoUncacheDirLists;
 #endif /* DIRED_SUPPORT */
 
 extern int HTCacheSize;  /* the number of documents cached in memory */
@@ -273,8 +274,8 @@
 extern BOOLEAN minimal_comments;
 extern BOOLEAN soft_dquotes;
 #ifdef SOURCE_CACHE
-extern BOOLEAN from_source_cache; /* mutable */
 extern int LYCacheSource;
+extern BOOLEAN source_cache_file_error;
 #define SOURCE_CACHE_NONE      0
 #define SOURCE_CACHE_FILE      1
 #define SOURCE_CACHE_MEMORY    2
Index: 2.31/src/LYGetFile.h
--- 2.31/src/LYGetFile.h Mon, 25 Oct 1999 09:01:18 -0500
+++ 2.31(w)/src/LYGetFile.h Tue, 07 Dec 1999 01:47:31 -0600
@@ -8,6 +8,7 @@
 #define NULLFILE 3
 
 extern int getfile PARAMS((document *doc));
+extern void srcmode_for_next_retrieval PARAMS((int));
 extern int follow_link_number PARAMS((
        int             c,
        int             cur,
Index: 2.31/src/HTAlert.h
--- 2.31/src/HTAlert.h Wed, 06 Oct 1999 14:34:33 -0500
+++ 2.31(w)/src/HTAlert.h Tue, 07 Dec 1999 01:43:32 -0600
@@ -76,6 +76,11 @@
 */
 extern BOOL HTConfirm PARAMS ((CONST char * Msg));
 
+extern BOOL confirm_post_resub PARAMS((
+    CONST char*                address,
+    CONST char*                title,
+    int                        if_imgmap,
+    int                        if_file));
 
 /*      Prompt for password without echoing the reply
 */
Index: 2.31/src/LYLocal.h
--- 2.31/src/LYLocal.h Wed, 06 Oct 1999 13:57:53 -0500
+++ 2.31(w)/src/LYLocal.h Mon, 06 Dec 1999 14:49:55 -0600
@@ -66,6 +66,7 @@
 extern int dired_options PARAMS ((document *doc, char ** newfile));
 
 extern void add_menu_item PARAMS((char *str));
+extern void reset_dired_menu NOPARAMS;
 
 #endif /* DIRED_SUPPORT */
 
Index: 2.31/src/GridText.c
--- 2.31/src/GridText.c Sat, 04 Dec 1999 00:06:06 -0600
+++ 2.31(w)/src/GridText.c Tue, 07 Dec 1999 01:29:36 -0600
@@ -136,7 +136,6 @@
 
 #ifdef SOURCE_CACHE
 PUBLIC int LYCacheSource = SOURCE_CACHE_NONE;
-PUBLIC BOOLEAN from_source_cache = FALSE;  /* mutable */
 #endif
 
 #ifdef USE_SCROLLBAR
@@ -339,7 +338,6 @@
 struct _HText {
        HTParentAnchor *        node_anchor;
 #ifdef SOURCE_CACHE
-#undef lines                   /* FIXME */
        /*
         * Parse settings when this HText was generated.
         */
@@ -352,8 +350,8 @@
        BOOLEAN                 soft_dquotes;
        BOOLEAN                 old_dtd;
        int                     keypad_mode;
-       int                     lines;          /* Screen size */
-       int                     cols;
+       int                     disp_lines;             /* Screen size */
+       int                     disp_cols;
 #endif
        HTLine *                last_line;
        int                     Lines;          /* Number of them */
@@ -785,8 +783,8 @@
     self->soft_dquotes = soft_dquotes;
     self->old_dtd = Old_DTD;
     self->keypad_mode = keypad_mode;
-    self->lines = LYlines;
-    self->cols = LYcols;
+    self->disp_lines = LYlines;
+    self->disp_cols = LYcols;
 #endif
     /*
      *  If we are going to render the List Page, always merge in hidden
@@ -1041,6 +1039,15 @@
                                  UCT_SETBY_NONE);
        HTAnchor_resetUCInfoStage(self->node_anchor, -1, UCT_STAGE_HTEXT,
                                  UCT_SETBY_NONE);
+#ifdef SOURCE_CACHE
+       /* Remove source cache files and chunks always, even if the
+        * HTAnchor_delete call does not actually remove the anchor.
+        * Keeping them would just be a waste of space - they won't
+        * be used any more after the anchor has been disassociated
+        * from a HText structure. - kw
+        */
+       HTAnchor_clearSourceCache(self->node_anchor);
+#endif
        if (HTAnchor_delete(self->node_anchor))
            /*
             *  Make sure HTMainAnchor won't point
@@ -8033,9 +8040,15 @@
 }
 
 #ifdef SOURCE_CACHE
+
+PRIVATE HTProtocol scm = { "source-cache-mem", 0, 0 }; /* dummy - kw */
+
 PUBLIC BOOLEAN HTreparse_document NOARGS
 {
     BOOLEAN ok = FALSE;
+#if 0
+    char *source_url = NULL;   /* unused - see comments below */
+#endif
 
     if (!HTMainAnchor || LYCacheSource == SOURCE_CACHE_NONE ||
        (LYCacheSource == SOURCE_CACHE_FILE &&
@@ -8049,7 +8062,7 @@
        HTFormat format;
        int ret;
 
-       CTRACE((tfp, "Reparsing source cache file %s\n",
+       CTRACE((tfp, "SourceCache: Reparsing file %s\n",
              HTMainAnchor->source_cache_file));
 
        /*
@@ -8079,6 +8092,7 @@
        fp = fopen(HTMainAnchor->source_cache_file, "r");
        if (!fp) {
            CTRACE((tfp, "  Cannot read file %s\n", 
HTMainAnchor->source_cache_file));
+           LYRemoveTemp(HTMainAnchor->source_cache_file);
            FREE(HTMainAnchor->source_cache_file);
            return FALSE;
        }
@@ -8092,9 +8106,24 @@
             */
            HTAlert(RELOADING_FORM);
        }
+       /* Set HTMainAnchor->protocol or HTMainAnchor->physical to convince
+        * the SourceCacheWriter to not regenerate the cache file (which
+        * would be an unnecessary "loop"). - kw
+        */
+#if 0 /* If cache writer looked at physical not protocol, we could use this: */
+       LYLocalFileToURL(&source_url, HTMainAnchor->source_cache_file);
+       HTAnchor_setPhysical(HTMainAnchor, source_url);
+       FREE(source_url);
+#endif /* 0 */
+       HTAnchor_setProtocol(HTMainAnchor, &HTFile);
        ret = HTParseFile(format, HTOutputFormat, HTMainAnchor, fp, NULL);
        fclose(fp);
-       ok = (BOOL) (ret == HT_LOADED);
+       if (ret == HT_PARTIAL_CONTENT) {
+           HTInfoMsg(gettext("Loading incomplete."));
+           CTRACE((tfp, "SourceCache: `%s' has been accessed, partial 
content.\n",
+                   HTLoadedDocumentURL()));
+       }
+       ok = (BOOL) (ret == HT_LOADED || ret == HT_PARTIAL_CONTENT);
     }
 
     if (LYCacheSource == SOURCE_CACHE_MEMORY &&
@@ -8102,7 +8131,7 @@
        HTFormat format = WWW_HTML;
        int ret;
 
-       CTRACE((tfp, "Reparsing from source memory cache %p\n",
+       CTRACE((tfp, "SourceCache: Reparsing from memory chunk %p\n",
                    (void *)HTMainAnchor->source_cache_chunk));
 
        /*
@@ -8135,6 +8164,18 @@
             */
            HTAlert(RELOADING_FORM);
        }
+       /* Set HTMainAnchor->protocol or HTMainAnchor->physical to convince
+        * the SourceCacheWriter to not regenerate the cache chunk (which
+        * would be an unnecessary "loop"). - kw
+        */
+       HTAnchor_setProtocol(HTMainAnchor, &scm); /* cheating -
+                                  anything != &HTTP or &HTTPS would do - kw */
+#if 0 /* If cache writer looked at physical not protocol, we could use this: */
+       HTSprintf0(&source_url, "source-cache-mem:%p",
+                  HTMainAnchor->source_cache_chunk);
+       HTAnchor_setPhysical(HTMainAnchor, source_url);
+       FREE(source_url);
+#endif /* 0 */
        ret = HTParseMem(format, HTOutputFormat, HTMainAnchor,
                        HTMainAnchor->source_cache_chunk, NULL);
        ok = (BOOL) (ret == HT_LOADED);
@@ -8142,10 +8183,6 @@
 
     CTRACE((tfp, "Reparse %s\n", (ok ? "succeeded" : "failed")));
 
-    if (ok)  {
-       from_source_cache = TRUE;  /* flag for mainloop events */
-    }
-
     return ok;
 }
 
@@ -8224,10 +8261,10 @@
        trace_setting_change("OLD_DTD", HTMainText->old_dtd, Old_DTD);
        trace_setting_change("KEYPAD_MODE",
                             HTMainText->keypad_mode, keypad_mode);
-       if (HTMainText->lines != LYlines || HTMainText->cols != LYcols)
+       if (HTMainText->disp_lines != LYlines || HTMainText->disp_cols != 
LYcols)
            CTRACE((tfp,
                   "HTdocument_settings_changed: Screen size has changed (was 
%dx%d, now %dx%d)\n",
-                  HTMainText->cols, HTMainText->lines, LYcols, LYlines));
+                  HTMainText->disp_cols, HTMainText->disp_lines, LYcols, 
LYlines));
     }
 
     return (HTMainText->clickable_images != clickable_images ||
@@ -8235,12 +8272,12 @@
            HTMainText->verbose_img != verbose_img ||
            HTMainText->raw_mode != LYUseDefaultRawMode ||
            HTMainText->historical_comments != historical_comments ||
-           HTMainText->minimal_comments != minimal_comments ||
+           (HTMainText->minimal_comments != minimal_comments &&
+            !historical_comments) ||
            HTMainText->soft_dquotes != soft_dquotes ||
            HTMainText->old_dtd != Old_DTD ||
            HTMainText->keypad_mode != keypad_mode ||
-           HTMainText->lines != LYlines ||
-           HTMainText->cols != LYcols);
+           HTMainText->disp_cols != LYcols);
 }
 #endif
 
Index: 2.31/src/LYShowInfo.c
--- 2.31/src/LYShowInfo.c Sat, 04 Dec 1999 00:06:06 -0600
+++ 2.31(w)/src/LYShowInfo.c Sat, 04 Dec 1999 21:41:03 -0600
@@ -236,7 +236,10 @@
     LYEntify(&Title, TRUE);
     fprintf(fp0, "<dt><em>%s</em> %s%s\n",
                 gettext("Linkname:"),
-                Title, (doc->isHEAD ? " (HEAD)" : ""));
+                Title,
+                ((doc->isHEAD &&
+                  !strstr(Title, " (HEAD)") &&
+                  !strstr(Title, " - HEAD")) ? " (HEAD)" : ""));
 
     StrAllocCopy(Address, doc->address);
     LYEntify(&Address, TRUE);
Index: 2.31/src/LYMain.c
--- 2.31/src/LYMain.c Sat, 04 Dec 1999 01:44:26 -0600
+++ 2.31(w)/src/LYMain.c Mon, 06 Dec 1999 19:01:01 -0600
@@ -102,6 +102,7 @@
 PUBLIC BOOLEAN no_change_exec_perms = FALSE;
 #endif /* NO_CHANGE_EXECUTE_PERMS */
 #endif /* OK_PERMIT */
+PUBLIC int LYAutoUncacheDirLists = 2; /* default dired uncaching behavior */
 #endif /* DIRED_SUPPORT */
 
           /* Number of docs cached in memory */
@@ -2163,7 +2164,12 @@
 #ifdef USE_PSRC
        html_src_on_lynxcfg_reload();
 #endif
-       free_lynx_cfg(); /* free downloaders, printers, environments */
+       /* free downloaders, printers, environments, dired menu */
+       free_lynx_cfg();
+#ifdef SOURCE_CACHE
+       source_cache_file_error = FALSE; /* reset flag */
+#endif
+       
        /*
         *  Process the configuration file.
         */
Index: 2.31/src/LYReadCFG.c
--- 2.31/src/LYReadCFG.c Sat, 04 Dec 1999 00:06:06 -0600
+++ 2.31(w)/src/LYReadCFG.c Mon, 06 Dec 1999 15:00:40 -0600
@@ -1255,6 +1255,9 @@
 #ifdef EXP_CHARSET_CHOICE
      
PARSE_FUN("assumed_doc_charset_choice",CONF_FUN,parse_assumed_doc_charset_choice),
 #endif
+#ifdef DIRED_SUPPORT
+     PARSE_ENV("auto_uncache_dirlists", CONF_INT, &LYAutoUncacheDirLists),
+#endif
      PARSE_SET("block_multi_bookmarks", CONF_BOOL, &LYMBMBlocked),
      PARSE_SET("bold_h1", CONF_BOOL, &bold_H1),
      PARSE_SET("bold_headers", CONF_BOOL, &bold_headers),
@@ -1544,6 +1547,9 @@
     }
     free_item_list();
     free_printer_item_list();
+#ifdef DIRED_SUPPORT
+    reset_dired_menu();                /* frees and resets dired menu items - 
kw */
+#endif
     FREE(lynxcfginfo_url);
 #if defined(HAVE_CONFIG_H) && !defined(NO_CONFIG_INFO)
     FREE(configinfo_url);
Index: 2.31/src/HTML.c
--- 2.31/src/HTML.c Sat, 04 Dec 1999 00:06:06 -0600
+++ 2.31(w)/src/HTML.c Wed, 08 Dec 1999 22:39:20 -0600
@@ -96,10 +96,13 @@
 struct _HTStream {
     CONST HTStreamClass *      isa;
 #ifdef SOURCE_CACHE
+    HTParentAnchor *           anchor;
     FILE *                     fp;
+    char *                     filename;
     HTChunk *                  chunk;
     CONST HTStreamClass *      actions;
     HTStream *                 target;
+    int                                status;
 #else
     /* .... */
 #endif
@@ -8365,6 +8368,16 @@
 }
 
 #ifdef SOURCE_CACHE
+
+/*
+ *  A flag set by a file write error.  Used for only generating an alert
+ *  the first time such an error happens, since Lynx should still be usable
+ *  if the temp space becomes full, and an alert each time a cache file
+ *  cannot be written would be annoying.  Reset when  lynx.cfg is being
+ *  reloaded (user may change SOURCE_CACHE setting). - kw
+ */
+PUBLIC BOOLEAN source_cache_file_error = FALSE;
+
 /*
  * Pass-thru cache HTStream
  */
@@ -8372,8 +8385,51 @@
 PRIVATE void CacheThru_free ARGS1(
        HTStream *,     me)
 {
-    if (me->fp)
+    if (me->anchor->source_cache_file) {
+       CTRACE((tfp, "SourceCacheWriter: Removing previous file %s\n",
+               me->anchor->source_cache_file));
+       LYRemoveTemp(me->anchor->source_cache_file);
+       FREE(me->anchor->source_cache_file);
+    }
+    if (me->anchor->source_cache_chunk) {
+       CTRACE((tfp, "SourceCacheWriter: Removing previous memory chunk %p\n",
+               (void *)me->anchor->source_cache_chunk));
+       HTChunkFree(me->anchor->source_cache_chunk);
+       me->anchor->source_cache_chunk = NULL;
+    }
+    if (me->fp) {
+       fflush(me->fp);
+       if (ferror(me->fp))
+           me->status = HT_ERROR;
        LYCloseTempFP(me->fp);
+       if (me->status == HT_OK) {
+           me->anchor->source_cache_file = me->filename;
+           CTRACE((tfp,
+                   "SourceCacheWriter: Committing file %s for URL %s to 
anchor\n",
+                   me->filename, HTAnchor_address((HTAnchor *)me->anchor)));
+       } else {
+           if (source_cache_file_error == FALSE) {
+               HTAlert(gettext("Source cache error - disk full?"));
+               source_cache_file_error = TRUE;
+           }
+           LYRemoveTemp(me->filename);
+           me->anchor->source_cache_file = NULL;
+       }
+    } else if (me->status != HT_OK) {
+       if (me->chunk) {
+           CTRACE((tfp, "SourceCacheWriter: memory chunk %p had errors.\n",
+                   me->chunk));
+           HTChunkFree(me->chunk);
+           me->chunk = NULL;
+       }
+       HTAlert(gettext("Source cache error - not enough memory!"));
+    }
+    if (me->chunk) {
+       me->anchor->source_cache_chunk = me->chunk;
+       CTRACE((tfp,
+               "SourceCacheWriter: Committing memory chunk %p for URL %s to 
anchor\n",
+               (void *)me->chunk, HTAnchor_address((HTAnchor *)me->anchor)));
+    }
     (*me->actions->_free)(me->target);
     FREE(me);
 }
@@ -8384,6 +8440,17 @@
 {
     if (me->fp)
        LYCloseTempFP(me->fp);
+    if (me->filename) {
+       CTRACE((tfp, "SourceCacheWriter: Removing active file %s\n",
+               me->filename));
+       LYRemoveTemp(me->filename);
+       FREE(me->filename);
+    }
+    if (me->chunk) {
+       CTRACE((tfp, "SourceCacheWriter: Removing active memory chunk %p\n",
+               (void *)me->chunk));
+       HTChunkFree(me->chunk);
+    }
     (*me->actions->_abort)(me->target, e);
     FREE(me);
 }
@@ -8392,10 +8459,15 @@
        HTStream *,     me,
        char,           c_in)
 {
-    if (me->fp)
-       fputc(c_in, me->fp);
-    else
-       HTChunkPutc(me->chunk, c_in);
+    if (me->status == HT_OK) {
+       if (me->fp) {
+           fputc(c_in, me->fp);
+       } else if (me->chunk) {
+           HTChunkPutc(me->chunk, c_in);
+           if (me->chunk->allocated == 0)
+               me->status = HT_ERROR;
+       }
+    }
     (*me->actions->put_character)(me->target, c_in);
 }
 
@@ -8403,10 +8475,15 @@
        HTStream *,     me,
        CONST char *,   str)
 {
-    if (me->fp)
-       fputs(str, me->fp);
-    else
-       HTChunkPuts(me->chunk, str);
+    if (me->status == HT_OK) {
+       if (me->fp) {
+           fputs(str, me->fp);
+       } else if (me->chunk) {
+           HTChunkPuts(me->chunk, str);
+           if (me->chunk->allocated == 0 && *str)
+               me->status = HT_ERROR;
+       }
+    }
     (*me->actions->put_string)(me->target, str);
 }
 
@@ -8415,10 +8492,17 @@
        CONST char *,   str,
        int,            l)
 {
-    if (me->fp)
-       fwrite(str, 1, l, me->fp);
-    else
-       HTChunkPutb(me->chunk, str, l);
+    if (me->status == HT_OK) {
+       if (me->fp) {
+           fwrite(str, 1, l, me->fp);
+           if (ferror(me->fp))
+               me->status = HT_ERROR;
+       } else if (me->chunk) {
+           HTChunkPutb(me->chunk, str, l);
+           if (me->chunk->allocated == 0 && l != 0)
+               me->status = HT_ERROR;
+       }
+    }
     (*me->actions->put_block)(me->target, str, l);
 }
 
@@ -8450,7 +8534,7 @@
     /*  Only remote HTML documents may benefits from HTreparse_document(), */
     /*  oh, assume http protocol:                                          */
     if (strcmp(p->name, "http") != 0) {
-       CTRACE((tfp, "Protocol is \"%s\"; not caching\n", p->name));
+       CTRACE((tfp, "SourceCacheWriter: Protocol is \"%s\"; not caching\n", 
p->name));
        return target;
     }
 #else
@@ -8462,17 +8546,22 @@
        outofmem(__FILE__, "CacheThru_new");
 
     stream->isa = &PassThruCache;
+    stream->anchor = anchor;
     stream->fp = NULL;
+    stream->filename = NULL;
     stream->chunk = NULL;
     stream->target = target;
     stream->actions = target->isa;
+    stream->status = HT_OK;
 
     if (LYCacheSource == SOURCE_CACHE_FILE) {
        if (anchor->source_cache_file) {
-           CTRACE((tfp, "Reusing source cache file %s\n",
-                  anchor->source_cache_file));
+           CTRACE((tfp, "SourceCacheWriter: If successful, will replace source 
cache file %s\n",
+                   anchor->source_cache_file));
+#if 0 /* No, let's NOT do this. - kw 1999-12-05 */
            FREE(stream);
            return target;
+#endif
        }
 
        /*
@@ -8482,29 +8571,38 @@
         * contain exactly what came in from the network.
         */
        if (!(stream->fp = LYOpenTemp(filename, HTML_SUFFIX, "wb"))) {
-           CTRACE((tfp, "Cannot get source cache file for URL %s\n",
+           CTRACE((tfp, "SourceCacheWriter: Cannot open source cache file for 
URL %s\n",
                   HTAnchor_address((HTAnchor *)anchor)));
            FREE(stream);
            return target;
        }
 
-       StrAllocCopy(anchor->source_cache_file, filename);
+       StrAllocCopy(stream->filename, filename);
 
-       CTRACE((tfp, "Caching source for URL %s in file %s\n",
+       CTRACE((tfp, "SourceCacheWriter: Caching source for URL %s in file 
%s\n",
                     HTAnchor_address((HTAnchor *)anchor), filename));
     }
 
     if (LYCacheSource == SOURCE_CACHE_MEMORY) {
        if (anchor->source_cache_chunk) {
-           CTRACE((tfp, "Reusing source memory cache %p\n",
-                  (void *)anchor->source_cache_chunk));
+           CTRACE((tfp,
+                   "SourceCacheWriter: If successful, will replace memory 
chunk %p\n",
+                   (void *)anchor->source_cache_chunk));
+#if 0 /* No, let's NOT do this. - kw 1999-12-05 */
            FREE(stream);
            return target;
+#endif
        }
 
-       /* I think this is right... */
-       anchor->source_cache_chunk = stream->chunk = HTChunkCreate(128);
-       CTRACE((tfp, "Caching source for URL %s in memory cache %p\n",
+#ifdef SAVE_TIME_NOT_SPACE
+       stream->chunk = HTChunkCreateMayFail(4096, 1);
+#else
+       stream->chunk = HTChunkCreateMayFail(128, 1);
+#endif
+       if (!stream->chunk)     /* failed already? pretty bad... - kw */
+           stream->status = HT_ERROR;
+
+       CTRACE((tfp, "SourceCacheWriter: Caching source for URL %s in memory 
chunk %p\n",
               HTAnchor_address((HTAnchor *)anchor), (void *)stream->chunk));
 
     }
Index: 2.31/lynx.cfg
--- 2.31/lynx.cfg Sat, 04 Dec 1999 00:06:06 -0600
+++ 2.31(w)/lynx.cfg Wed, 08 Dec 1999 22:39:23 -0600
@@ -2077,6 +2077,24 @@
 #
 #CSWING_PATH:swing
 
+# AUTO_UNCACHE_DIRLISTS determines when local file directory listings are
+# automatically regenerated (by re-reading the actual directory from disk).
+# Set the value to 0 to avoid automatic regeneration in most cases.  This
+# is useful for browsing large directories that take some time to read and
+# format.  An update can still always be forced with the RELOAD key, and
+# specific DIRED actions may cause a refresh anyway.  Set the value to 1
+# to force regeneration after commands that usually change the directory or
+# some files and would make the displayed info stale, like EDIT and REMOVE.
+# Set it to 2 (the default) or greater to force regeneration even after
+# leaving the displayed directory listing by some action that ususally
+# causes no change, like GOTO or entering a file with the ACTIVATE key.
+# This option is only honored in DIRED mode (i.e. when lynx is compiled
+# with DIRED_SUPPORT and it is not disabled with a -restriction).  Local
+# directories displayed without DIRED normally act as if
+# AUTO_UNCACHE_DIRLISTS:0 was in effect.
+#
+#AUTO_UNCACHE_DIRLISTS:2
+
 # Unix ONLY:
 #===========
 # LIST_FORMAT defines the display for local files when Lynx has been


reply via email to

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