Warning: this is a htmlized version!
The original is across this link.
#######
#
# 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.
#
# 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/a/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/a/.emacs[.html]>,
#                 <http://angg.twu.net/a/.zshrc[.html]>,
#                 <http://angg.twu.net/escripts.html>,
#             and <http://angg.twu.net/>.
#
#######



######
#
# Surgery on lynx.cfg
# 99sep07
#
######

#  «cfg_surgery»

# 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






######
#
# 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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<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/

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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em>URL:</em> %s\n", Address);
---
> 	    "<dt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em>URL:</em> %s\n", shorten(Address));
393c393
< 	       "<dt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em>URL:</em> %s\n", Title);
---
> 	       "<dt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<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





#####
#
# From here on everything is old or very old
#
#####

# This was a nice trick to generate e-script links automatically.
# I kept it just because it is pretty.

cd /usr/src/lynx-2.8.1/
find * -type f > .files
find * -type f -and -name '*.[ch]' | sort > .files.ch
etags $(<.files.ch)
glimpseindex -H . -F < .files.ch
alias lyglimpse='cd /usr/src/lynx-2.8.1/; glimpse -y -H .'
lyglimpse -n localhost \
  | perl -nle '
	m/^([^ ]*): ([^ ]*):/ &&
	  print "# (find-lynxfile \"$1\" $2)"' \
  | tee ~/o

# (find-fline "~/o")
# It is full of lines like {# (find-lynxfile "src/HTML.c" 794)}, see?






##########
#
# 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 changes (old)
#
######

rm -Rv /usr/src/lynx2-8.angg
mkdir  /usr/src/lynx2-8.angg

A=( src/LYUtils.h src/LYShowInfo.c src/LYList.c	src/LYMainLoop.c )
cd     /usr/src/lynx2-8
cp -pPv $A /usr/src/lynx2-8.angg/


cd     /usr/src/lynx2-8.angg
A=($(find * -type f))

cd     /usr/src/lynx2-8
for i in $A; do
  [ -f $i.orig ] || mv -v $i $i.orig
  cp -v /usr/src/lynx2-8.angg/$i $i
done


  



# Recompile and reinstall
#
cd /usr/src/lynx2-8/
make |& tee om
make install |& tee omi
rm /usr/lib/lynx.cfg
cp -s ~/lynx.cfg /usr/lib/

cp -v ~/lynx.cfg /usr/lib/



ftp://ftp.debian.org/debian/hamm/hamm/source/web/lynx_2.8-2.{diff.gz,dsc}





#######
#
# 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-w3node "Top")
# (find-w3node "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}