lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev (patch) dev.23: -prettysrc fix etc.


From: Leonid Pauzner
Subject: lynx-dev (patch) dev.23: -prettysrc fix etc.
Date: Mon, 26 Apr 1999 22:42:23 +0400 (MSD)

23-Apr-99 23:31 I wrote:
>> 1999-04-23 (2.8.2dev.23)
>> * fix for -prettysrc:  when pressing '\' on non-local files, the prettysrc 
>> view
>>   is shown, but there is no way out of this mode -VH
>> * fixes for related bugs tweaked by going to an internal page while viewing
>>   source, and a few blurbs in the documentation -DSB

> Seems both different patches for -prettysrc mode were implemented.

This patch will undo some redundant dev23 changes, in particular the absence of
first PSRC_TEST responsible for a wrong line breaking in -prettysrc mode
(try "lynx . -prettysrc" and press "\" to see wrapping in dev23-24).
Also fix Visited Links for internal pages (my fault).

For HTreparse_document() mode people are welcome to add flags into mainloop
when necessary, after the string "from_source_cache".
Not in HTreparse_document() function itself.



diff -u old/gridtext.c ./gridtext.c
--- old/gridtext.c      Fri Apr 23 19:59:34 1999
+++ ./gridtext.c        Fri Apr 23 23:37:06 1999
@@ -562,7 +562,7 @@
     self->LastChar = '\0';
     self->IgnoreExcess = FALSE;

-#ifndef USE_PSRC
+#ifndef PSRC_TEST
     if (HTOutputFormat == WWW_SOURCE)
        self->source = YES;
     else
@@ -6231,10 +6231,6 @@
        if (!ok) {
            FREE(source_cache_filename);
        }
-#ifdef USE_PSRC
-       else if (LYpsrc && psrc_view)
-           HTMainText->source = TRUE;
-#endif
     }

     if (LYCacheSource == SOURCE_CACHE_MEMORY &&
@@ -6271,10 +6267,6 @@
            HTChunkFree(source_cache_chunk);
            source_cache_chunk = NULL;
        }
-#ifdef USE_PSRC
-       else if (LYpsrc && psrc_view)
-           HTMainText->source = TRUE;
-#endif
     }

     /*
@@ -6284,13 +6276,8 @@

     CTRACE(tfp, "Reparse %s\n", (ok ? "succeeded" : "failed"));

-    if (ok)  {/* fix few flags: */
+    if (ok)  {
        from_source_cache = TRUE;  /* flag for mainloop events */
-#ifdef USE_PSRC
-       if (LYpsrc && psrc_view)
-           HTMainText->source = TRUE;
-#endif
-       more = HText_canScrollDown();  /* the length may be changed */
     }

     return ok;
diff -u old/htfile.c ./htfile.c
--- old/htfile.c        Fri Apr 23 20:00:34 1999
+++ ./htfile.c  Fri Apr 23 20:44:42 1999
@@ -521,7 +521,6 @@
 }
 #endif /* LY_FIND_LEAKS */

-extern void HTDisplayPartial NOARGS;

 /*     Make the cache file name for a W3 document.
 **     -------------------------------------------
diff -u old/lyhistor.c ./lyhistor.c
--- old/lyhistor.c      Fri Apr 23 19:59:42 1999
+++ ./lyhistor.c        Fri Apr 23 22:48:24 1999
@@ -68,7 +68,10 @@
      * or list files. - FM
      */
     if (doc->post_data || doc->isHEAD || doc->bookmark ||
-       (!strncmp(doc->address, "file://localhost/", 17) && (
+        (/* special url or a temp file */
+         (!strncmp(doc->address, "LYNX", 4) ||
+          !strncmp(doc->address, "file://localhost/", 17))
+         && (
        !strcmp((doc->title ? doc->title : ""), HISTORY_PAGE_TITLE) ||
        !strcmp((doc->title ? doc->title : ""), PRINT_OPTIONS_TITLE) ||
        !strcmp((doc->title ? doc->title : ""), DOWNLOAD_OPTIONS_TITLE) ||
diff -u old/lymainlo.c ./lymainlo.c
--- old/lymainlo.c      Fri Apr 23 19:59:48 1999
+++ ./lymainlo.c        Mon Apr 26 22:24:02 1999
@@ -744,15 +744,15 @@
                           if (dump_output_immediately) {
                               fprintf(stderr,
  gettext("\nlynx: Start file could not be found or is not text/html or 
text/plain\n"));
-                              fprintf(stderr,gettext("      Exiting...\n"));
+                              fprintf(stderr, gettext("      Exiting...\n"));
                           } else
 #endif /* UNIX */
                           {
                               SetOutputMode( O_TEXT );

                               printf(
- "\nlynx: Start file could not be found or is not text/html or text/plain\n");
-                              printf("      Exiting...\n");
+ gettext("\nlynx: Start file could not be found or is not text/html or 
text/plain\n"));
+                              printf(gettext("      Exiting...\n"));

                               SetOutputMode( O_BINARY );
                           }
@@ -1218,42 +1218,41 @@
        /*
         * If the parse settings have changed since this HText was
         * generated, we need to reparse and redraw it.  -dsb
+        *
+        * Should be configured to avoid shock for experienced lynx users.
+        * Currently enabled for cached sources only.
         */
        if (HTdocument_settings_changed()) {
-           HTUserMsg(gettext("Reparsing document under current settings..."));
-           if (HTreparse_document()) {}
-           else {
+           if (HTcan_reparse_document()) {
+               HTUserMsg(gettext("Reparsing document under current 
settings..."));
+               if (HTreparse_document()) {}
+           } else {
                /*
                 * Urk.  I have no idea how to recover from a failure here.
                 * At a guess, I'll try reloading.  -dsb
                 */
+                       /*  currently disabled ***
+               HTUserMsg(gettext("Reparsing document under current 
settings..."));
                cmd = LYK_RELOAD;
                goto new_cmd;
+                        */
            }
        }

        /*
         *  Trying to accomodate HTreparse_document() logic
-        *  with mainloop events. Set all the necessaty flags here...
+        *  with mainloop events.  Working out of force_load cycle
+        *  set all the necessary flags here, from case NORMAL
+        *  (see also LYK_SOURCE, some staff implemented directly there).
         */
        if (from_source_cache) {
-               from_source_cache = FALSE; /* reset */
+               from_source_cache = FALSE; /* done */

                    /*
                     *  Make sure curdoc.line will not be equal
                     *  to Newline, so we get a redraw.
                     */
                    curdoc.line = -1;
-
-           /*
-            * This information can get clobbered if we go to an internal
-            * page while viewing source.  Normally it would be recreated
-            * by reloading the file; we have to do it ourselves.  -dsb
-            */
-           if (curdoc.link < 0 && nlinks > 0)
-               curdoc.link = 0;
-
-               refresh_screen = TRUE; /* ? */
        }
 #endif

@@ -1262,6 +1261,7 @@
         *  If the curdoc.line is different than Newline then there must
         *  have been a change since last update.  Run HText_pageDisplay()
         *  create a fresh screen of text out.
+        *  All display_partial calls ends here for final redraw.
         */
        if (curdoc.line != Newline) {

@@ -1344,16 +1344,6 @@
             */
            more = HText_canScrollDown();

-#ifdef SOURCE_CACHE
-           /*
-            * This information can get clobbered if we go to an internal
-            * page while viewing source, or if the page length changes
-            * between reparses.  Normally it would be recreated by
-            * reloading the file; we have to do it ourselves.  -dsb
-            */
-           if (curdoc.link < 0 && nlinks > 0)
-               curdoc.link = 0;
-#endif
            if (user_mode == NOVICE_MODE)
                noviceline(more);  /* print help message */
            refresh_screen = FALSE;




reply via email to

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