Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
####### # # E-scripts on lynx. # # Note 1: use the eev command (defined in eev.el) and the # ee alias (in my .zshrc) to execute parts of this file. # Executing this file as a whole makes no sense. # An introduction to eev can be found here: # # (find-eev-quick-intro) # http://angg.twu.net/eev-intros/find-eev-quick-intro.html # # Note 2: be VERY careful and make sure you understand what # you're doing. # # Note 3: If you use a shell other than zsh things like |& # and the for loops may not work. # # Note 4: I always run as root. # # Note 5: some parts are too old and don't work anymore. Some # never worked. # # Note 6: the definitions for the find-xxxfile commands are on my # .emacs. # # Note 7: if you see a strange command check my .zshrc -- it may # be defined there as a function or an alias. # # Note 8: the sections without dates are always older than the # sections with dates. # # This file is at <http://angg.twu.net/e/lynx.e> # or at <http://angg.twu.net/e/lynx.e.html>. # See also <http://angg.twu.net/emacs.html>, # <http://angg.twu.net/.emacs[.html]>, # <http://angg.twu.net/.zshrc[.html]>, # <http://angg.twu.net/escripts.html>, # and <http://angg.twu.net/>. # ####### # «.INCLUDE» (to "INCLUDE") # «.lynx_colors» (to "lynx_colors") # «.lynx_patch_potato» (to "lynx_patch_potato") # «.LYK_DOWN_TWO» (to "LYK_DOWN_TWO") # «.debug_lynx» (to "debug_lynx") # «.user-and-pass» (to "user-and-pass") # «.dump» (to "dump") # «.head» (to "head") #### # # allowing more options in an INCLUDE'd cfg file # 2004apr01 # #### # «INCLUDE» (to ".INCLUDE") # (find-fline "/etc/lynx.cfg" ".h2 INCLUDE") # (find-fline "/etc/lynx.cfg" ".h2 INCLUDE" ".h2") # (find-fline "/etc/lynx.cfg" "# Edrx:") # Add an "# Edrx:" section at the end: # (chowns "/etc/lynx.cfg") # (find-sh0 "sudo chown root:root /etc/lynx.cfg") # (find-sh0 "sudo chown aleph:aleph /etc/lynx.cfg") # (find-fline "/etc/lynx.cfg" "# Edrx:") # Edrx: # (find-es "lynx" "INCLUDE") # (find-angg "lynx.cfg") INCLUDE:~/lynx.cfg:COLOR VIEWER KEYMAP STARTFILE ACCEPT_ALL_COOKIES ###### # # Surgery on lynx.cfg # 99sep07 # ###### # «lynx_colors» (to ".lynx_colors") # On a Slink system the color configuration lies in /etc/lynx.cfg and # can't be moved (at least not easily) to ~/.lynxrc; so we change it # by hand, commenting out the original colors and replacing them by # this. # # (find-fline "/etc/lynx.cfg" "\nCOLOR:") # COLOR:0:lightgray:black COLOR:1:brown:black COLOR:2:yellow:blue COLOR:3:green:black COLOR:4:magenta:black COLOR:5:brown:black COLOR:6:brown:green COLOR:7:magenta:cyan # Also I don't mind cookies. # (find-fline "/etc/lynx.cfg" "ACCEPT_ALL_COOKIES") # ACCEPT_ALL_COOKIES:TRUE ##### # # Patch on lynx 2.8.3 (potato) to remove some "file://localhost"s # 2001jan17 # ##### # «lynx_patch_potato» (to ".lynx_patch_potato") #* pdsc $SDEBIAN/dists/potato/main/source/web/lynx_2.8.3-1.dsc cd /usr/src/lynx-2.8.3/ find * -name '*.[ch]' | sort > .files.ch etags $(<.files.ch) glimpseindex -H . -F < .files.ch #* # (find-es "wget" "wget_patch_potato") # (find-lynxfile "debian/changelog") # diff debian/changelog~ debian/changelog | tee ~/o patch debian/changelog <<'%%%' 0a1,7 > lynx (2.8.3-1edrx) unstable; urgency=low > > * Shortened most displayed URLs beginning with "file://localhost". > See: (find-es "lynx" "lynx_patch_potato") > > -- Eduardo Ochs <edrx@inx.com.br> Thu, 18 Jan 2001 02:17:04 -0200 > %%% # (find-lynxfile "src/LYCharUtils.h") # diff src/LYCharUtils.h~ src/LYCharUtils.h | tee ~/o patch src/LYCharUtils.h <<'%%%' 123a124,127 > > /* Edrx: */ > #define shorten(s) (strncmp((s), "file://localhost", 16) ? (s) : (s)+16) > #define tshorten(s) (strncmp((s), "file://localhost", 16) ? (s) : (s)+15) %%% patch src/LYHistory.c <<'%%%' 547c547 < fprintf(fp0, "<tab to=t%d>%s\n", x, Title); --- > fprintf(fp0, "<tab to=t%d>%s\n", x, shorten(Title)); %%% # (find-lynxfile "src/LYList.c") # (find-lynxfile "src/LYList.c" "gettext(\"this document:\")") # (find-lynxfile "src/LYList.c" "(char *)(Title ? Title : Address),") # (find-lynxfile "src/LYList.c" "<li><a href=\\\"%s\\\">%s</a>\\n\", Address,") # diff src/LYList.c~ src/LYList.c | tee ~/o patch src/LYList.c <<'%%%' 92c92 < ((Address != NULL && *Address != '\0') ? Address : gettext("this document:"))); --- > ((Address != NULL && *Address != '\0') ? shorten(Address) : gettext("this document:"))); 183c183 < (char *)(Title ? Title : Address), --- > shorten(Address) /* (char *)(Title ? Title : Address), */, 209c209 < fprintf(fp0, "<li><a href=\"%s\">%s</a>\n", Address, Address); --- > fprintf(fp0, "<li><a href=\"%s\">%s</a>\n", Address,tshorten(Address)); %%% # I forgot what the first part of this patch is for. # (find-lynxfile "src/LYMainLoop.c") # (find-lynxfile "src/LYMainLoop.c" "cp = links[curdoc.link].lname") # (find-lynxfile "src/LYMainLoop.c" "_user_message(format, curlink_name);") # diff src/LYMainLoop.c~ src/LYMainLoop.c | tee ~/o patch src/LYMainLoop.c <<'%%%' 2405c2405 < cp = links[curdoc.link].lname; --- > cp = shorten(links[curdoc.link].lname); /* Edrx */ 7648c7648 < _user_message(format, curlink_name); --- > _user_message(format, shorten(curlink_name)); %%% # (find-lynxfile "src/LYShowInfo.c") # (find-lynxfile "src/LYShowInfo.c" "<em>URL:</em> %s\\n\", Address);") # (find-lynxfile "src/LYShowInfo.c" "<em>URL:</em> %s\\n\", Title);") # diff src/LYShowInfo.c~ src/LYShowInfo.c | tee ~/o patch src/LYShowInfo.c <<'%%%' 275c275 < "<dt> <em>URL:</em> %s\n", Address); --- > "<dt> <em>URL:</em> %s\n", shorten(Address)); 411c411 < "<dt> <em>URL:</em> %s\n", Title); --- > "<dt> <em>URL:</em> %s\n", shorten(Title)); %%% # (find-packfile "packaging.text.gz" "\n3.2.3. `debian/changelog'") # (find-lynxfile "debian/changelog") #* # «LYK_DOWN_TWO» (to ".LYK_DOWN_TWO") # Another patch: this one is crude and unripe but lets me scroll # (using <ins> and <del>) by one line at each time, instead of always # by 2 lines. As my keyboard repeats very quickly, I find this better # than the default. # (find-lynxfile "src/LYMainLoop.c" "handle_LYK_UP_TWO") # (find-lynxfile "src/LYMainLoop.c" "handle_LYK_DOWN_TWO") patch src/LYMainLoop.c <<'%%%' 2249c2249 < Newline += 2; --- > Newline += 1; /* edrx; was 2 */ 4684c4684 < int scrollamount = (Newline > 2 ? 2 : 1); --- > int scrollamount = (Newline > 2 ? 1 : 1); /* edrx; was 2 2 1 */ %%% #* # Add "-g" and remove "-O2". # Nice for when we are just debugging. # (find-lynxfile "makefile.in") patch makefile.in <<'%%%' 17c17,18 < CFLAGS = @CFLAGS@ --- > ORIGCFLAGS = @CFLAGS@ > CFLAGS = -g -DLINUX -D_GNU_SOURCE %%% #* # Make everything: config files, binaries, debs. # debian/rules CFLAGS="-g -DLINUX -D_GNU_SOURCE" binary |& tee odrb debian/rules binary |& tee odrb # (find-lynxfile "odrb") # (find-lynxfile "") #* # Remake quickly after a little change in the source files. cd /usr/src/lynx-2.8.3/ make CPPFLAGS="-DNSL_FORK" |& tee om # (find-lynxfile "src/LYHistory.c") # (find-lynxtag "showhistory") #* # «debug_lynx» (to ".debug_lynx") # Run lynx on a shell under the control of Expect; M-g will make Emacs # attach a gdb to the lynx process. # (find-es "anatocc" "dlopen") # (find-angg "TCL/attachgdb") # (find-angg "eev-extras.el" "gdbk-mode") # (find-node "(gdb)Invoking GDB") cat > $EEG <<'---' # file /usr/src/lynx-2.8.3/lynx bt # br show_main_statusline # br handle_LYK_NEXT_LINK br showhistory --- expect -c ' spawn /usr/src/lynx-2.8.3/lynx set pid [exp_pid] interact "\033p" {send_user "\n$pid\n"} \ "\033g" { set gdbkstr "/usr/src/lynx-2.8.3/lynx $pid" set lispcode "(gdbk-gdb nil \"$gdbkstr\")" catch {exec gnudoit $lispcode} } ' #* mv -iv /usr/src/lynx_2.8.3-1edrx_i386.deb /usr/src/.debs/ aptu-local-i386 apt-get update apti lynx #* # (find-status "lynx") # (find-vldifile "lynx.list") # (find-fline "/usr/doc/lynx/") # (find-fline "/usr/doc/lynx/changelog.Debian.gz") ###### # # lynx 2.8.1 on slink - patch. # Part 1: patching by hand. # 99sep07 # ###### # I want to get rid of some of the annoying "file://localhost"s. # First I have to find which places to change (or candidates to). # It's safer to strip the "file://localhost"s just before they are # displayed or fed into htmls. # Do a first "make": # apti slang1-dev pdsc /big/slinks2/dists/slink/main/source/web/lynx_2.8.1-3.dsc cd /usr/src/lynx-2.8.1/ (time debian/rules binary) |& tee odrb # (find-lynxfile "odrb") # (find-lynxfile "debian/rules") # Remake (after patching some files by hand). # cd /usr/src/lynx-2.8.1/ (make CPPFLAGS="-DNSL_FORK" |& tee om) \ && /usr/src/lynx-2.8.1/lynx # Now for the patches themselves, together with some of the code that # lead me to the right places. # Add the macro "shorten"; "tshorten" is for tests. # (find-lynxfile "src/LYStrings.h" "#endif /* LYSTRINGS_H */") # (find-lynxfile "src/LYCharUtils.h" "#endif /* LYCHARUTILS_H */") /* Edrx: */ #define shorten(s) (strncmp((s), "file://localhost", 16) ? (s) : (s)+16) #define tshorten(s) (strncmp((s), "file://localhost", 16) ? (s) : (s)+15) # Key: "l" lyglimpse 'List Page' lyglimpse LIST_PAGE_TITLE # (find-lynxfile "src/LYList.c" "LIST_PAGE_TITLE") # (find-lynxfile "src/LYList.c" "<li><a href=") # (find-lynxfile "src/LYList.c" "References in %s") ((Address != NULL && *Address != '\0') ? shorten(Address) : "this document:")); # (find-lynxfile "src/LYList.c" "(char *)(Title ? Title : Address)") shorten(Address) /* (char *)(Title ? Title : Address), */, # ...but I don't know how to reach this one: # (find-lynxfile "src/LYList.c" "<li><a href=\\\"%s\\\">") fprintf(fp0, "<li><a href=\"%s\">%s</a>\n", Address, tshorten(Address)); # Key: "=" lyglimpse 'Information about the current document' lyglimpse SHOWINFO_TITLE # (find-lynxfile "src/LYShowInfo.c" "SHOWINFO_TITLE") # (find-lynxfile "src/LYShowInfo.c" "File that you are currently viewing") # (find-lynxfile "src/LYShowInfo.c" 300) "<dt> <em>URL:</em> %s\n", shorten(Address)); # (find-lynxfile "src/LYShowInfo.c" "Link that you currently have selected") ## (find-lynxfile "src/LYShowInfo.c" 360) # (find-lynxfile "src/LYShowInfo.c" 393) "<dt> <em>URL:</em> %s\n", shorten(Title)); # Bottom line, advanced mode. # (find-lynxfile "src/LYMainLoop.c" "-more-") # (find-lynxfile "src/LYMainLoop.c" 1447) cp = shorten(links[curdoc.link].lname); # Another way to force URLs on the "l" page. # I'll stick to the other one. Ignore this. # (find-lynxfile "src/LYList.c" "if we want titles") # (find-lynxfile "src/LYMainLoop.c" "showlist") ###### # # lynx 2.8.1 on slink - patch. # Part 2: making the diff. # 99sep07 # ###### # Get the diff (as small as possible). # (find-fline "~/.zshrc" "pdsc") rm -Rv /usr/src/o mkdir /usr/src/o cd /usr/src/o && \ dpkg-source -sn -x /big/slinks2/dists/slink/main/source/web/lynx_2.8.1-3.dsc cd /usr/src/lynx-2.8.1/ rm -v $(find * -name '*~') cd /usr/src/ mv o/lynx-2.8.1 lynx-2.8.1.orig rmdir o diff -r lynx-2.8.1.orig lynx-2.8.1 |& tee ~/debian/lynx_2.8.1-3edrx1.diff ###### # # lynx 2.8.1 on slink - patch. # Part 3: turbo remake, using the diff. # I still don't know how to generate a real diff! Aargh! # 99sep07 # ###### # «lynx_patch_turbo» pdsc /big/slinks2/dists/slink/main/source/web/lynx_2.8.1-3.dsc cd /usr/src/lynx-2.8.1/ # (find-lynxfile "src/LYCharUtils.h") patch src/LYCharUtils.h <<'%%%' 105a106,109 > /* Edrx: */ > #define shorten(s) (strncmp((s), "file://localhost", 16) ? (s) : (s)+16) > #define tshorten(s) (strncmp((s), "file://localhost", 16) ? (s) : (s)+15) > %%% patch src/LYList.c <<'%%%' 88c88 < ((Address != NULL && *Address != '\0') ? Address : "this document:")); --- > ((Address != NULL && *Address != '\0') ? shorten(Address) : "this document:")); 169c169 < (char *)(Title ? Title : Address), --- > shorten(Address) /* (char *)(Title ? Title : Address), */, 194c194 < fprintf(fp0, "<li><a href=\"%s\">%s</a>\n", Address, Address); --- > fprintf(fp0, "<li><a href=\"%s\">%s</a>\n", Address, tshorten(Address)); %%% patch src/LYMainLoop.c <<'%%%' 1447c1447 < cp = links[curdoc.link].lname; --- > cp = shorten(links[curdoc.link].lname); %%% patch src/LYShowInfo.c <<'%%%' 300c300 < "<dt> <em>URL:</em> %s\n", Address); --- > "<dt> <em>URL:</em> %s\n", shorten(Address)); 393c393 < "<dt> <em>URL:</em> %s\n", Title); --- > "<dt> <em>URL:</em> %s\n", shorten(Title)); %%% cd /usr/src/lynx-2.8.1/ debian/rules binary |& tee odrb mv -iv /usr/src/lynx*.deb /usr/src/.debs/ apt-update ########## # # lynx 2.8 (old notes) # ########## cd /usr/src/ rm -Rv lynx2-8/ tar -xvzf /snarf/http/www.slcc.edu/lynx/release2-8/lynx2-8.tar.gz cd /usr/src/lynx2-8/ cd /usr/src/lynx2-8.angg/ # (find-node "(fileutils)cp invocation") # (find-node "(fileutils)Backup options") cp --backup --suffix=.orig --parents -v $(find * -type f) /usr/src/lynx2-8/ cd /usr/src/lynx2-8/ ./configure --prefix=/usr |& tee oc # sleep 2 echo -n > .make-start sleep 2 # make |& tee om # find * -name '*.[chS]' -and -anewer .make-start > .files.chS.used find * -name '*.[chS]' -and -not -anewer .make-start > .files.chS.unused etags `cat .files.chS.used` glimpseindex -H . -F < .files.chS.used cd /usr/src/lynx2-8/ make install |& tee omi make install-help |& tee omih # lynx.cfg: # (find-lynxfile "src/HTInit.c") # (find-lynxfile "src/LYReadCFG.c") # (find-lynxfile "src/LYStyle.c") # (find-lynxfile "src/LYrcFile.c") # Comment out the original STARTFILE/HELPFILE lines and insert the block # below. # (find-fline "/usr/lib/lynx.cfg") # (find-fline "~/lynx.cfg") # (find-lynxfile "lynx.cfg") STARTFILE:file://localhost/home/root/ZHTML/index.html HELPFILE:file://localhost/usr/lib/lynx_help/lynx_help_main.html INFOSECS:1 MESSAGESECS:1 ALERTSECS:1 DEFAULT_CACHE_SIZE:25 DEFAULT_VIRTUAL_MEMORY_SIZE:2048000 NO_DOT_FILES:FALSE http_proxy:http://200.240.18.1:8080/ ftp_proxy:http://200.240.18.1:8080/ SUFFIX:.gif:image/gif SUFFIX:.jpg:image/jpeg SUFFIX:.jpeg:image/jpeg SUFFIX:.ps:application/postscript SUFFIX:.eps:application/postscript SUFFIX:.dvi:application/x-DVI VIEWER:image/gif:zgv %s:NON_XWINDOWS VIEWER:image/jpeg:zgv %s:NON_XWINDOWS VIEWER:application/postscript:gv %s&:XWINDOWS VIEWER:application/x-DVI:xdvi %s&:XWINDOWS # # Colors stolen from Debian (?) COLOR:0:lightgray:black COLOR:1:blue:black COLOR:2:yellow:blue COLOR:3:green:black COLOR:4:magenta:black COLOR:5:blue:black COLOR:6:red:black COLOR:7:magenta:cyan # My old colors: # # (find-fline "/snarf/http/sol.slcc.edu/lynx/klaus/texts/attrnotes.txt") # (find-lynxfile "src/LYStyle.c") # # Color names: # # black blue gray brightblue # red magenta brightred brightmagenta # green cyan brightgreen brightcyan # brown lightgray yellow white # COLOR:0:lightgray:black COLOR:1:blue:white COLOR:2:yellow:black COLOR:3:green:black COLOR:4:red:black COLOR:5:brightblue:black COLOR:6:brightred:black COLOR:7:magenta:black # (find-lynxfile "src/LYList.c" "You have reached the List Page") # (find-lynxfile "src/LYShowInfo.c" "You have reached the Information Page") # (find-lynxfile "src/LYShowInfo.c" "File that you are currently viewing") # (find-lynxfile "src/LYShowInfo.c" "Link that you currently have selected") # # Patch: add the def of shorten() to a .h and add some calls to it. # (find-node "(libc)String/Array Comparison") #define shorten(s) (strncmp((s), "file://localhost", 16) ? (s) : (s)+16) # (find-lynxfile "src/LYUtils.h" "#endif /* LYUTILS_H */") # (find-lynxfile "src/LYShowInfo.c" 253) # (find-lynxfile "src/LYShowInfo.c" 346) # (find-lynxfile "src/LYList.c" 126) # (find-lynxfile "src/LYList.c" 207) # (find-lynxfile "src/LYList.c" 232) # (find-lynxfile "src/LYMainLoop.c" 1413) # (find-lynxfile "src/LYMainLoop.c" 1408) # Talvez falte corrigir o LYHistory. ####### # # lynx 2.8 via debian (old) # ####### cd /snarf/ftp/ftp.debian.org/debian/hamm/hamm/source/web/ ln -sf /snarf/http/www.slcc.edu/lynx/release2-8/lynx2-8.tar.gz lynx_2.8.orig.tar.gz rm -R /usr/src/lynx* cd /usr/src/ cp -v /snarf/http/www.slcc.edu/lynx/release2-8/lynx2-8.tar.gz \ lynx_2.8.orig.tar.gz cp -v /snarf/ftp/ftp.debian.org/debian/hamm/hamm/source/web/lynx_2.8-2.{diff.gz,dsc} . # cd /usr/src/ tar -xvzf lynx_2.8.orig.tar.gz mv lynx2-8 lynx-2.8.orig tar -xvzf lynx_2.8.orig.tar.gz mv lynx2-8 lynx-2.8 cd lynx-2.8 gzip -cd ../lynx_2.8-2.diff.gz | patch -p1 |& tee op 3.4 UNPACKING A DEBIAN SOURCE PACKAGE WITHOUT DPKG-SOURCE dpkg-source -x is the recommended way to unpack a Debian source package. However, if it is not available it is possible to unpack a Debian source archive as follows: 1. Untar the tarfile, which will create a .orig directory. 2. Rename the .orig directory to package-version. 3. Create the subdirectory debian at the top of the source tree. 4. Apply the diff using patch -p0. 5. Untar the tarfile again if you want a copy of the original source code alongside the Debianised version. # (w3-open-local "/usr/doc/dpkg/programmer.html/ch-sourcepkg.html#s3.4") # (find-w3elnode "Top") # (find-w3elnode "Information") # (find-fline "/usr/bin/dpkg-source") # (find-fline "/usr/bin/dpkg-source" "'patch'") dpkg-source -x /snarf/ftp/ftp.debian.org/debian/hamm/hamm/source/web/lynx_2.8-2.dsc ftp://ftp.debian.org/debian/hamm/hamm/source/web/lynx_2.8-2.{diff.gz,dsc} ##### # # usernames and passwords # 2009jan01 # ##### # «user-and-pass» (to ".user-and-pass") # (find-status "lynx") # (find-vldifile "lynx.list") # (find-udfile "lynx/") # (find-man "1 lynx") # (find-man "1 lynx" "-useragent=Name") # (find-status "lynx") # (find-vldifile "lynx.list") # (find-udfile "lynx/") # (find-fline "/usr/share/doc/lynx/lynx_help/") # (find-udw3m "lynx/lynx_help/lynx_url_support.html") # (find-udw3m "lynx/lynx_help/Lynx_users_guide.html" "-auth=ID:PW") # (find-udw3m "lynx/lynx_help/Lynx_users_guide.html" "-useragent=STRING") # (find-udw3m "lynx/lynx_help/Lynx_users_guide.html" " -base") ##### # # dump # 2022jul09 # ##### # «dump» (to ".dump") # (find-man "1 lynx" "lynx -dump") # (find-es "maxima" "email-subst-2022jan17") # (find-maximamsg "37419130 202201 17" "Edrx: Part 1: the groups") # (find-sh "lynx -dump https://sourceforge.net/p/maxima/mailman/message/37419130/" 75) ##### # # head # 2022nov20 # ##### # «head» (to ".head") # https://lists.gnu.org/archive/html/emacs-orgmode/2022-10/msg00889.html luwak: https://mail.google.com/mail/u/0/#inbox/FMfcgzGqRGVKsQqLnZRMKXFDMxwtVvKn https://news.ycombinator.com/item?id=30975532 W3M Rocks (w3m.rocks) - w3m and lynx # Local Variables: # coding: utf-8-unix # End: