Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Zsh 4.0.4 and Emacs 21.1 in Windows XP



I don't know if anyone cares, but I just created this patch, which *does* work for me. Nothing else I tried seemed to do it. It adds a new option, emacscygwinhack, which deletes any CR at the end of a line (it works analogously to sunkeyboardhack).

Feel free to come up with a better name for it if you find it at all useful. Andrej: I tried everything I could with CYGWIN, and had no luck at all. Maybe it's just me though.

-- Gary Oberbrunner

--- input.c.~1~    Tue Jan 16 08:44:20 2001
+++ input.c    Fri Nov 23 14:18:57 2001
@@ -294,6 +294,16 @@
        ptr[-1] = '\0';
    }
    }
+    if (*ingetcline && ingetcline[strlen(ingetcline) - 1] == '\n' &&
+    ingetcline[strlen(ingetcline) - 2] == '\r' &&
+    interact && isset(EMACSCYGWINHACK) && isset(SHINSTDIN) &&
+    SHTTY != -1) {
+    /* Junk an unmatched CR at the end of the line. */
+    int ct;
+    char *ptr = &ingetcline[strlen(ingetcline)-2];
+    *ptr++ = '\n';
+    *ptr = '\0';
+    }
    isfirstch = 1;
    /* Put this into the input channel. */
    inputsetline(ingetcline, INP_FREE);
--- options.c.~1~    Mon Jun 25 13:31:20 2001
+++ options.c    Fri Nov 23 14:23:15 2001
@@ -106,6 +106,7 @@
{NULL, "cshjunkiequotes",     OPT_EMULATE|OPT_CSH,     CSHJUNKIEQUOTES},
{NULL, "cshnullcmd",          OPT_EMULATE|OPT_CSH,     CSHNULLCMD},
{NULL, "cshnullglob",          OPT_EMULATE|OPT_CSH,     CSHNULLGLOB},
+{NULL, "emacscygwinhack",     0,             EMACSCYGWINHACK},
{NULL, "equals",          OPT_EMULATE|OPT_ZSH,     EQUALS},
{NULL, "errexit",          OPT_EMULATE,         ERREXIT},
{NULL, "exec",              OPT_ALL,             EXECOPT},
--- zsh.h.~1~    Mon Jun 25 13:31:20 2001
+++ zsh.h    Fri Nov 23 14:22:46 2001
@@ -1441,6 +1441,7 @@
    XTRACE,
    USEZLE,
    DVORAK,
+    EMACSCYGWINHACK,
    OPT_SIZE
};





Messages sorted by: Reverse Date, Date, Thread, Author