lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev lynx2.8.2dev.19 patch #6 (em dash = --)


From: Leonid Pauzner
Subject: Re: lynx-dev lynx2.8.2dev.19 patch #6 (em dash = --)
Date: Mon, 15 Mar 1999 02:19:58 +0300 (MSK)

Few obvious changes:


* — (&#x2014) now display as "--" (popular requests) - LP
*   now display as two   (popular requests),
  previous definition of HT_EM_SPACE now renamed to HT_EN_SPACE. - LP
* block 'd'ownloading of submit button in forms-based 'O'ptions menu - LP
* minore tweaks in postoptions(), new flag added - LP



diff -u old/def7_uni.tbl ./def7_uni.tbl
--- old/def7_uni.tbl    Thu Mar  4 02:39:46 1999
+++ ./def7_uni.tbl      Mon Mar 15 01:10:40 1999
@@ -1290,7 +1290,8 @@
 U+200e:(->)
 U+200f:(<-)
 U+200a:
-0x2d   U+2010  U+2013-U+2015   # hyphen-like
+0x2d   U+2010  U+2013 U+2015   # hyphen-like
+U+2014:--
 U+2016:||
 U+2017:=2
 0x60   U+2018          # left single quotation mark  <`>


diff -u old/lymainlo.c ./lymainlo.c
--- old/lymainlo.c      Thu Mar  4 02:39:46 1999
+++ ./lymainlo.c        Thu Mar 11 20:14:22 1999
@@ -5218,6 +5218,14 @@
                            }
                            break;
                        }
+                       if (!strncmp(links[curdoc.link].form->submit_action,
+                                "LYNXOPTIONS:", 12)) {
+                           if (old_c != real_c) {
+                               old_c = real_c;
+                               HTUserMsg(NO_DOWNLOAD_SPECIAL);
+                           }
+                           break;
+                       }
                        HTOutputFormat = HTAtom_for("www/download");
                        LYforce_no_cache = TRUE;
                        cmd = LYK_ACTIVATE;
diff -u old/lyoption.c ./lyoption.c
--- old/lyoption.c      Mon Jan 18 04:29:20 1999
+++ ./lyoption.c        Fri Mar 12 02:45:44 1999
@@ -3495,14 +3495,6 @@
  * post_data here, but bring along everything just in case.  It's only a
  * pointer.  MRC
  *
- * By changing the certain options value (like preferred language or
- * fake browser name) we need to inform the remote server and reload
- * (uncache on a proxy) the document which was active just before
- * the Options menu was invoked.  Another values (like display_char_set
- * or assume_char_set) used by lynx initial rendering stages
- * and can only be changed after reloading :-(
- * So we introduce boolean flag 'need_reload' (currently dummy).
- *
  * Options are processed in order according to gen_options(), we should not
  * depend on it and add boolean flags where the order is essential (save,
  * character sets...)
@@ -3511,7 +3503,27 @@
  * conditions.  We *should* duplicate the same conditions here in postoptions()
  * to prevent user with a limited access from editing HTML options code
  * manually (e.g., doing 'e'dit in 'o'ptions) and submit it to access the
- * restricted items. Prevent spoofing attempts from index overrun. - LP
+ * restricted items.  Prevent spoofing attempts from index overrun. - LP
+ *
+ * Exit status: NULLFILE
+ *
+ * Not implemented [in mainloop(), getfile()]:
+ * (whether we really need to reload the document
+ * which was current before the Options menu)
+ *
+ *   NULLFILE  (error)
+ *
+ *   OPT_OK    (no reload) nothing changed or no visual effect supposed:
+ *             e-mail, bookmarks, etc.
+ *
+ *   OPT_RELOAD  (reload locally) to see the effect of certain changes:
+ *             display_char_set, assume_charset, etc.
+ *             (use 'need_reload' flag where necessary).
+ *
+ *   OPT_END_RELOAD  (reload from remote server and uncache on a proxy)
+ *             few options changes should be transferred to remote server:
+ *             preferred language, fake browser name, etc.
+ *             (use 'need_end_reload' flag).
  */

 PUBLIC int postoptions ARGS1(
@@ -3525,6 +3537,7 @@
     BOOLEAN raw_mode_old = LYRawMode;
     BOOLEAN assume_char_set_changed = FALSE;
     BOOLEAN need_reload = FALSE;
+    BOOLEAN need_end_reload = FALSE;
 #if defined(USE_SLANG) || defined(COLOR_CURSES)
     int CurrentShowColor = LYShowColor;
 #endif
@@ -3653,8 +3666,10 @@
        /* HTML error tolerance: SELECT */
        if (!strcmp(data[i].tag, DTD_recovery_string)
         && GetOptValues(DTD_type_values, data[i].value, &code)) {
-           Old_DTD = code;
-           HTSwitchDTD(!Old_DTD);
+           if (Old_DTD != code) {
+               Old_DTD = code;
+               HTSwitchDTD(!Old_DTD);
+           }
        }

        /* Select Popups: ON/OFF */
@@ -3799,28 +3814,37 @@

        /* Preferred Document Character Set: INPUT */
        if (!strcmp(data[i].tag, preferred_doc_char_string)) {
-           FREE(pref_charset);
-           StrAllocCopy(pref_charset, data[i].value);
+           if (!strcmp(pref_charset, data[i].value)) {
+               FREE(pref_charset);
+               StrAllocCopy(pref_charset, data[i].value);
+               need_end_reload = TRUE;
+           }
        }

        /* Preferred Document Language: INPUT */
        if (!strcmp(data[i].tag, preferred_doc_lang_string)) {
-           FREE(language);
-           StrAllocCopy(language, data[i].value);
+           if (!strcmp(language, data[i].value)) {
+               FREE(language);
+               StrAllocCopy(language, data[i].value);
+               need_end_reload = TRUE;
+           }
        }

        /* User Agent: INPUT */
        if (!strcmp(data[i].tag, user_agent_string) && (!no_useragent)) {
-           FREE(LYUserAgent);
-           /* ignore Copyright warning ? */
-           StrAllocCopy(LYUserAgent,
-               *(data[i].value)
-               ? data[i].value
-               : LYUserAgentDefault);
-           if (LYUserAgent && *LYUserAgent &&
-               !strstr(LYUserAgent, "Lynx") &&
-               !strstr(LYUserAgent, "lynx")) {
-               HTAlert(UA_COPYRIGHT_WARNING);
+           if (!strcmp(LYUserAgent, data[i].value)) {
+               need_end_reload = TRUE;
+               FREE(LYUserAgent);
+               /* ignore Copyright warning ? */
+               StrAllocCopy(LYUserAgent,
+                  *(data[i].value)
+                  ? data[i].value
+                  : LYUserAgentDefault);
+               if (LYUserAgent && *LYUserAgent &&
+                  !strstr(LYUserAgent, "Lynx") &&
+                  !strstr(LYUserAgent, "lynx")) {
+                       HTAlert(UA_COPYRIGHT_WARNING);
+               }
            }
        }
     } /* end of loop */
@@ -3872,9 +3896,21 @@
     }
     LYpop(newdoc);  /* return to previous doc, not to options menu! */

+    /*
+     *  Exit status: what to do with previous document
+     */
+#ifdef NOT_IMPLEMENTED
+    if (need_end_reload == TRUE)  {
+       /* force end-to-end reload from remote server */
+       return(OPT_END_RELOAD);
+    }
     if (need_reload == TRUE)  {
-       /* FIXME: currently dummy */
+       /* force reload locally: HTuncache_current_document() */
+       return(OPT_RELOAD);
     }
+    return(OPT_OK);      /* no reload */
+#endif /* NOT_IMPLEMENTED */
+
     return(NULLFILE);
 }



diff -u old/gridtext.c ./gridtext.c
--- old/gridtext.c      Thu Mar  4 02:39:46 1999
+++ ./gridtext.c        Mon Mar 15 01:46:28 1999
@@ -2343,8 +2343,8 @@
        case HT_NON_BREAK_SPACE:
                special = "HT_NON_BREAK_SPACE";
                break;
-       case HT_EM_SPACE:
-               special = "HT_EM_SPACE";
+       case HT_EN_SPACE:
+               special = "HT_EN_SPACE";
                break;
        case LY_UNDERLINE_START_CHAR:
                special = "LY_UNDERLINE_START_CHAR";
@@ -2620,7 +2620,7 @@
                    !isspace((unsigned char)line->data[i]) &&
                    (unsigned char)line->data[i] != '-' &&
                    (unsigned char)line->data[i] != HT_NON_BREAK_SPACE &&
-                   (unsigned char)line->data[i] != HT_EM_SPACE) {
+                   (unsigned char)line->data[i] != HT_EN_SPACE) {
                    break;
                }
            }
@@ -2660,9 +2660,9 @@
     }

     /*
-     *  Convert EM_SPACE to a space here so that it doesn't get collapsed.
+     *  Convert EN_SPACE to a space here so that it doesn't get collapsed.
      */
-    if (ch == HT_EM_SPACE)
+    if (ch == HT_EN_SPACE)
        ch = ' ';

     /*
@@ -3120,7 +3120,7 @@
            if (!IsSpecialAttrChar(last->data[j]) &&
                !isspace((unsigned char)last->data[j]) &&
                last->data[j] != HT_NON_BREAK_SPACE &&
-               last->data[j] != HT_EM_SPACE)
+               last->data[j] != HT_EN_SPACE)
                break;
            i--;
            j++;
@@ -3177,7 +3177,7 @@
                if (!IsSpecialAttrChar(prev->data[j]) &&
                    !isspace((unsigned char)prev->data[j]) &&
                    prev->data[j] != HT_NON_BREAK_SPACE &&
-                   prev->data[j] != HT_EM_SPACE)
+                   prev->data[j] != HT_EN_SPACE)
                    break;
                i--;
                j++;
@@ -6289,7 +6289,7 @@
                 ((unsigned char)(line->data[i] & 0xc0) == 0xc0)) &&
                !isspace((unsigned char)line->data[i]) &&
                (unsigned char)line->data[i] != HT_NON_BREAK_SPACE &&
-               (unsigned char)line->data[i] != HT_EM_SPACE) {
+               (unsigned char)line->data[i] != HT_EN_SPACE) {
                true_size++;
            }
        }
@@ -6943,7 +6943,7 @@
            cp++;
        for (i = 0, j = 0; cp[i]; i++) {
            if (cp[i] == HT_NON_BREAK_SPACE ||
-               cp[i] == HT_EM_SPACE) {
+               cp[i] == HT_EN_SPACE) {
                cp[j++] = ' ';
            } else if (cp[i] != LY_SOFT_HYPHEN &&
                       !IsSpecialAttrChar((unsigned char)cp[i])) {
@@ -7821,7 +7821,7 @@
                     p && *p && !(field_has_8bit && field_has_special);
                     p++)
                    if ((*p == HT_NON_BREAK_SPACE) ||
-                       (*p == HT_EM_SPACE) ||
+                       (*p == HT_EN_SPACE) ||
                        (*p == LY_SOFT_HYPHEN)) {
                        field_has_special = YES;
                    } else if ((*p & 0x80) != 0) {
@@ -7831,7 +7831,7 @@
                     p && *p && !(name_has_8bit && name_has_special);
                     p++)
                    if ((*p == HT_NON_BREAK_SPACE) ||
-                       (*p == HT_EM_SPACE) ||
+                       (*p == HT_EN_SPACE) ||
                        (*p == LY_SOFT_HYPHEN)) {
                        name_has_special = YES;
                    } else if ((*p & 0x80) != 0) {
@@ -8057,7 +8057,7 @@
                         p && *p && !(field_has_8bit && field_has_special);
                         p++) {
                        if ((*p == HT_NON_BREAK_SPACE) ||
-                           (*p == HT_EM_SPACE) ||
+                           (*p == HT_EN_SPACE) ||
                            (*p == LY_SOFT_HYPHEN)) {
                            field_has_special = YES;
                        } else if ((*p & 0x80) != 0) {
@@ -8147,7 +8147,7 @@
                         p && *p && !(name_has_8bit && name_has_special);
                         p++) {
                        if ((*p == HT_NON_BREAK_SPACE) ||
-                           (*p == HT_EM_SPACE) ||
+                           (*p == HT_EN_SPACE) ||
                            (*p == LY_SOFT_HYPHEN)) {
                            name_has_special = YES;
                        } else if ((*p & 0x80) != 0) {
diff -u old/gridtext.h ./gridtext.h
--- old/gridtext.h      Thu Mar  4 02:39:46 1999
+++ ./gridtext.h        Mon Mar 15 01:46:56 1999
@@ -13,9 +13,9 @@
 #ifndef HT_NON_BREAK_SPACE
 #define HT_NON_BREAK_SPACE     ((char)1)       /* remember it */
 #endif /* !HT_NON_BREAK_SPACE */
-#ifndef HT_EM_SPACE
-#define HT_EM_SPACE            ((char)2)       /* remember it */
-#endif /* !HT_EM_SPACE */
+#ifndef HT_EN_SPACE
+#define HT_EN_SPACE            ((char)2)       /* remember it */
+#endif /* !HT_EN_SPACE */
 #define LY_UNDERLINE_START_CHAR        '\003'
 #define LY_UNDERLINE_END_CHAR  '\004'
 #define LY_BOLD_START_CHAR     '\005'
diff -u old/htfont.h ./htfont.h
--- old/htfont.h        Wed Sep 17 18:00:16 1997
+++ ./htfont.h  Mon Mar 15 01:47:26 1999
@@ -11,9 +11,9 @@
 #ifndef HT_NON_BREAK_SPACE
 #define HT_NON_BREAK_SPACE ((char)1)   /* For now */
 #endif /* !HT_NON_BREAK_SPACE */
-#ifndef HT_EM_SPACE
-#define HT_EM_SPACE ((char)2)          /* For now */
-#endif /* !HT_EM_SPACE */
+#ifndef HT_EN_SPACE
+#define HT_EN_SPACE ((char)2)          /* For now */
+#endif /* !HT_EN_SPACE */


 #define HT_FONT                0
diff -u old/htmldtd.h ./htmldtd.h
--- old/htmldtd.h       Wed Dec 16 13:56:42 1998
+++ ./htmldtd.h Mon Mar 15 01:47:42 1999
@@ -20,9 +20,9 @@
 #ifndef HT_NON_BREAK_SPACE
 #define HT_NON_BREAK_SPACE     ((char)1)       /* For now */
 #endif /* !HT_NON_BREAK_SPACE */
-#ifndef HT_EM_SPACE
-#define HT_EM_SPACE            ((char)2)       /* For now */
-#endif /* !HT_EM_SPACE */
+#ifndef HT_EN_SPACE
+#define HT_EN_SPACE            ((char)2)       /* For now */
+#endif /* !HT_EN_SPACE */
 #ifndef LY_SOFT_HYPHEN
 #define LY_SOFT_HYPHEN         ((char)7)
 #endif /* !LY_SOFT_HYPHEN */
diff -u old/htmlgen.c ./htmlgen.c
--- old/htmlgen.c       Sat Dec 12 20:10:36 1998
+++ ./htmlgen.c Mon Mar 15 01:49:26 1999
@@ -121,7 +121,7 @@
        char,                   c)
 {
     if (me->escape_specials && (unsigned char)c < 32) {
-       if (c == HT_NON_BREAK_SPACE || c == HT_EM_SPACE ||
+       if (c == HT_NON_BREAK_SPACE || c == HT_EN_SPACE ||
            c == LY_SOFT_HYPHEN) { /* recursion... */
            HTMLGen_put_character(me, '&');
            HTMLGen_put_character(me, '#');
@@ -131,11 +131,11 @@
                HTMLGen_put_character(me, 'A');
                HTMLGen_put_character(me, '0');
                break;
-           case HT_EM_SPACE: /* &#x2003; */
+           case HT_EN_SPACE: /* &#x2002; */
                HTMLGen_put_character(me, '2');
                HTMLGen_put_character(me, '0');
                HTMLGen_put_character(me, '0');
-               HTMLGen_put_character(me, '3');
+               HTMLGen_put_character(me, '2');
                break;
            case LY_SOFT_HYPHEN: /* &#xAD; */
                HTMLGen_put_character(me, 'A');
diff -u old/lycharut.c ./lycharut.c
--- old/lycharut.c      Mon Feb  8 02:33:00 1999
+++ ./lycharut.c        Mon Mar 15 01:57:08 1999
@@ -140,7 +140,7 @@

 /*
 **  This function trims characters <= that of a space (32),
-**  including HT_NON_BREAK_SPACE (1) and HT_EM_SPACE (2),
+**  including HT_NON_BREAK_SPACE (1) and HT_EN_SPACE (2),
 **  but not ESC, from the heads of strings. - FM
 */
 PUBLIC void LYTrimHead ARGS1(
@@ -163,7 +163,7 @@

 /*
 **  This function trims characters <= that of a space (32),
-**  including HT_NON_BREAK_SPACE (1), HT_EM_SPACE (2), and
+**  including HT_NON_BREAK_SPACE (1), HT_EN_SPACE (2), and
 **  ESC from the tails of strings. - FM
 */
 PUBLIC void LYTrimTail ARGS1(
@@ -1204,7 +1204,7 @@
            if (plain_space || hidden) {
                HTChunkPutc(s, ' ');
            } else {
-               HTChunkPutc(s, HT_EM_SPACE);
+               HTChunkPutc(s, HT_EN_SPACE);
            }
            if (me->T.decode_utf8 && *utf_buf) {
                utf_buf[0] == '\0';
@@ -1849,7 +1849,7 @@
            if (Back) {
                int rev_c;
                if ((*p) == HT_NON_BREAK_SPACE ||
-                   (*p) == HT_EM_SPACE) {
+                   (*p) == HT_EN_SPACE) {
                    if (plain_space) {
                        code = *p = ' ';
                        state = S_got_outchar;
@@ -2254,7 +2254,7 @@
                        code = ' ';
                        state = S_got_outchar;
                    } else {
-                       code = HT_EM_SPACE;
+                       code = HT_EN_SPACE;
                        state = S_got_outchar;
                    }
                    break;
Only in .: old
diff -u old/sgml.c ./sgml.c
--- old/sgml.c  Tue Mar  9 00:44:28 1999
+++ ./sgml.c    Mon Mar 15 01:56:30 1999
@@ -342,27 +342,26 @@
        **  Use Lynx special character for shy.
        */
        PUTC(LY_SOFT_HYPHEN);
-    } else if (code == 8194 || code == 8195 || code == 8201) {
+    } else if (code == 8194 || code == 8201) {
        /*
-       **  Use Lynx special character for ensp, emsp or thinsp.
+       **  Use Lynx special character for ensp or thinsp.
        **
        **  Originally, Lynx use space '32' as word delimiter and omits this
        **  space at end of line if word is wrapped to the next line.  There
        **  are several other spaces in the Unicode repertoire and we should
        **  teach Lynx to understand them, not only as regular characters but
        **  in the context of line wrapping.  Unfortunately, if we use
-       **  HT_EM_SPACE we override the chartrans tables for those spaces
-       **  (e.g., emsp= double space) with a single '32' for all (but do line
-       **  wrapping more fancy).  So we probably need HT_EN_SPACE etc...
+       **  HT_EN_SPACE we override the chartrans tables for those spaces
+       **  with a single '32' for all (but do line wrapping more fancy).
+       **  Assume emsp as two ensp (below).
        */
-       PUTC(HT_EM_SPACE);
-#ifdef NOTUSED_FOTEMODS
-    } else if (code == 8211 || code == 8212) {
+       PUTC(HT_EN_SPACE);
+    } else if (code == 8195) {
        /*
-       **  Use ASCII hyphen for ndash/endash or mdash/emdash.
+       **  Use Lynx special character for emsp.
        */
-       PUTC('-');
-#endif
+       PUTC(HT_EN_SPACE);
+       PUTC(HT_EN_SPACE);
     } else {
        /*
        **  Return NO if nothing done.



reply via email to

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