Warning: this is an htmlized version!
The original is here, and
the conversion rules are here.
#######
#
# E-scripts on e-scripts.
#
# 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/escripts.e>
#           or at <http://angg.twu.net/e/escripts.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/>.
#
#######





# For instructions on how to install a copy of my home stuff in your
# machine, follow this link:
# (to "edrxpage")



# «.the_eev_dir»	(to "the_eev_dir")
# «.eev.tar.gz»		(to "eev.tar.gz")
# «.emacs-tutor.th»	(to "emacs-tutor.th")
# «.eev-quick-inst»	(to "eev-quick-inst")
# «.eev-tutorial»	(to "eev-tutorial")
# «.debugging_gawk0»	(to "debugging_gawk0")
# «.makepackage_twu»	(to "makepackage_twu")
# «.makepagedeb_angg»	(to "makepagedeb_angg")
# «.makepagedeb»	(to "makepagedeb")
# «.escripts_to_html_perl»	(to "escripts_to_html_perl")
# «.eheaders»		(to "eheaders")
# «.adjusting_eheaders»	(to "adjusting_eheaders")
# «.adding_coding:»	(to "adding_coding:")
# «.eev_may2000»	(to "eev_may2000")
# «.copy_of_edrxs_page»	(to "copy_of_edrxs_page")
# «.copy_of_edrxs_home»	(to "copy_of_edrxs_home")
# «.copy_of_edrxs_home_LR»	(to "copy_of_edrxs_home_LR")
# «.edrxpage»		(to "edrxpage")
# «.edrxpage_log»	(to "edrxpage_log")
# «.edrxpage_logtrick»	(to "edrxpage_logtrick")
# «.edrxpage_htmls»	(to "edrxpage_htmls")
# «.edrxpage_emacsX»	(to "edrxpage_emacsX")
# «.edrxpage_emacs»	(to "edrxpage_emacs")
# «.edrxpage_makedeb»	(to "edrxpage_makedeb")
# «.edrxpage-test»	(to "edrxpage-test")




#####
#
# ~/eev/
# 2001sep06
#
#####

# «the_eev_dir»  (to ".the_eev_dir")
# (find-es "emacs" "zcatinfo")
# (find-fline "/tmp/elisp.info")
# (find-fline "/usr/doc/emacsen-common/debian-emacs-policy.gz")
# (find-elnode "Autoload" ";;;###autoload")
# (find-eevfile "eev-all.el")
# (find-eevfile "")

#*
cd ~/eev/
make tgz
rm -Rv /usr/src/eev/
mkdir  /usr/src/eev/
cd     /usr/src/eev/
tar -xvzf ~/eev/eev-0.91.tar.gz
make

#*
# (find-efunction 'generate-file-autoloads)
# (generate-file-autoloads "/usr/src/eev/eev-links.el")
# (find-shttpfile "debian-br.sourceforge.net/docs/sgml/apt-howto-pt/apt-howto-pt.txt")






#####
#
# eev.tar.gz
# 2001jul15
#
#####

# «eev.tar.gz»  (to ".eev.tar.gz")
# (code-c-d "eev" "~/eev-0.90/")
# (find-eevfile "")
# (find-eevfile "Makefile")
# (find-eevfile ".files")
# (find-eevfile "demo/")
# (find-eevfile "demo/.profile")

#*
cd ~/eev-0.90/
cp -v ~/eev-all.el  .
cp -v ~/EXPECT/eeg  .
cp -v ~/EXPECT/eeg3 .
cp -v ~/glyphs.el   .
cp -v ~/eegdb.el    eev-gud.el

rm -Rv    /usr/src/eev-0.90/
mkdir  -p /usr/src/eev-0.90/{demo,texts}/
cd ~/eev-0.90/
cp -iPv $(<.files) /usr/src/eev-0.90/
cd        /usr/src/eev-0.90/

# make xemacs-demo
# make EMACS="xemacs21 -debug-init" demo
make

#*
# Test if the instructions in the README are right
# (find-eevfile "README")
cd /tmp/
wget http://angg.twu.net/tmp/eev-0.90.tar.gz
mv -v eev-0.90.tar.gz.1 eev-0.90.tar.gz

rm -R /usr/src/eev-0.90/
cd /usr/src/
tar -xvzf /tmp/eev-0.90.tar.gz
cd /usr/src/eev-0.90/
read
make demo

#*
# Make a .tar.gz in /tmp:
rm -Rv /tmp/eev-0.90/
mkdir  /tmp/eev-0.90/
cd ~/eev-0.90/
cp -iPv $(<.files) /tmp/eev-0.90/
cd /tmp/
tar -cvzf eev-0.90.tar.gz eev-0.90/
laf /tmp/eev-0.90.tar.gz

#*
# Upload it:
cd /tmp/
anonftp ftp://angg.twu.net/home2/edrx/slow_html/tmp/ 'put eev-0.90.tar.gz' quit
#
# (find-fline "/tmp/eev-0.90.tar.gz")
# (eevt "minimakepage; cd; laf {slow,public}_html/tmp/eev*" nil)

#*




#####
#
# eev.tar.gz - tests to see if the package is really portable
# 2001jul15
#
#####

# «eev.tar.gz»  (to ".eev.tar.gz")
#*
# Testing on RedHat:
# (find-es "redhat" "chroot_to_redhat")

rm -Rv /redhat/usr/src/eev*
cd     /redhat/usr/src/
tar -xvzf /tmp/eev-0.90.tar.gz

cat > $EEG <<'---'
cd /usr/src/eev-0.90/
ls -lAF ..
make demo-emacs0
exit
---

# (find-angg ".zshrc" "chroot-redhat-zsh")
eeg3 -c 'set metaL_re [meta_re j]' \
  sh -c '
    unset $(env | sed "s/=.*\$//" | egrep -v "^(PWD|TERM|_)\$")
    export HOME=/
    exec /usr/sbin/chroot /redhat /bin/sh
  '

#*
# Test with other emacsen

rm -R /usr/src/eev-0.90/
mkdir /usr/src/eev-0.90/
cd ~/eev-0.90/
cp -iPv $(<.files) /usr/src/eev-0.90/
cd /usr/src/eev-0.90/
EMACS=/usr/src/emacs-21.0.103/src/emacs \
  make demo-dlopen

# EMACS=xemacs21 \
#   make demo-emacs0

# emacs19: demo-emacs0 works, demo-dlopen doesn't
# xemacs21: problems with man.el

# (find-eevfile "demo/emacs0.eeg3")

#*




#####
#
# Adapting emacs-tutor.th for inclusion in eev.tar.gz
#
#####

# «emacs-tutor.th»  (to ".emacs-tutor.th")
# (find-fline "~/TH/")
# (find-fline "~/TH/emacs-tutor.th")
# (find-eevfile "demo/keys.e")

# (find-elnode "Syntax of Regexps")

# (fooi-re "\\[ENODE \\{\\([ -Za-z]+\\)\\}" ":\\1:\\2:")
# (fooi-re "\\[ENODE \\{\\([ -Za-z]+\\)\\} \\([ -Za-z]+\\)\\]" "\\2 (find-enode \"\\1\")")
# (fooi-re "\\[ELNODE \\{\\([ -Za-z]+\\)\\} \\([ -Za-z]+\\)\\]" "\\2 (find-elnode \"\\1\")")
# (fooi-re "\\[ELINODE \\{\\([ -Za-z]+\\)\\} \\([ -Za-z]+\\)\\]" "\\2 (find-elinode \"\\1\")")






#####
#
# eev.el: quick installation
# 2000jun29
#
#####

# «eev-quick-inst»  (to ".eev-quick-inst")
# This is a quick and rather dirty way of installing eev.el.
# (find-angg "eev.el" "eev-howto")
# If you don't have wget you may use the lines with "lynx". 

# The main thing
cd ~
wget          http://angg.twu.net/a/eev.el
#lynx -source http://angg.twu.net/a/eev.el > eev.el

# Eeg and the temporary scripts will be placed in ~/bin/ by
# default, so we need to make sure that ~/bin/ exists...
mkdir ~/bin/

# The eeg script is used for the "generic interface".
# (find-fline "~/bin/eeg")
cd ~/bin/
wget          http://angg.twu.net/a/EXPECT/eeg
#lynx -source http://angg.twu.net/a/EXPECT/eeg > eeg
chmod 755 eeg

# Support for gdb.
# Beware: if you already have a ~/.gdbinit this will overwrite it!
cd ~
wget          http://angg.twu.net/a/.gdbinit
#lynx -source http://angg.twu.net/a/.gdbinit > .gdbinit

# These lines will add all configuration changes you need, but in a
# messy way: no comments, and no checking for duplicates (duplicates
# are harmless, though) and no setting of $EE (=~/bin/ee.sh) and $EEG
# (=~/bin/ee.generic). $EE and $EEG are not needed but are very
# convenient, esp. when you want to check what's been written in the
# temporary script files.
#
cd ~
echo '(load-library "~/eev.el")'	>> .emacs
echo "alias ee='. ~/bin/ee.sh'"		>> .bashrc
echo "alias ee='. ~/bin/ee.sh'"		>> .zshrc
echo "alias ee 'source ~/bin/ee.sh'"	>> .cshrc

# Set the `ee' alias in the current shell so that you won't have to
# restart it to have ee working. The first line is for bash and zshrc;
# the second should work with tcsh, but I haven't tested it much. The
# shells may complain about the line that is not in their syntax;
# ignore the error.
#
alias ee='. ~/bin/ee.sh'
alias ee 'source ~/bin/ee.sh'

# More .emacs customizations. Note that these will reprogram the keys
# F3, M-k and M-e.
#
cat >> ~/.emacs <<'---'
;
; eev stuff
; Set some keys
; (find-angg "eev.el" "keys")
; (find-angg "eev.el" "bounded")
(global-set-key [f3] 'ee-default-strbounded)
(global-set-key "\M-k" 'kill-buffer)
(global-set-key "\M-e" 'end-of-line-then-eval-last-sexp)
;
; Override eelatex with a simpler definition
; that should work at any system.
; (find-angg "eev.el" "eelatex")
(defun eelatex (s e) (interactive "r")
  (write-ee s e "\\documentclass{book}\n\\begin{document}\n\n"
		"\n\n\\end{document}\n"
		"~/tmp/ee.tex")
  (eev "latex ~/tmp/ee.tex" nil))
---
mkdir ~/tmp/

# Now enter Emacs, or run this with C-x C-e in your
# current Emacs session:
# (load-library "~/eev.el")

# That's it.
# (find-es "escripts" "eev-tutorial")

# TO DO: set $EE and $EEG; check if ~/bin/ is in the path (to make
# calling eeg easier); explain F3, M-k, and M-e; comment on the fact
# the some Emacs modes override these key binding with local ones




#####
#
# Topics for a hands-on eev tutorial
# 2000jun29
#
#####

# «eev-tutorial»  (to ".eev-tutorial")
# Until you have some experience it's better to have a browser
# pointing to the html version of this page so that you can follow all
# the hyperlinks. The html version is at:
#   <http://angg.twu.net/a/e/escripts.e#eev-tutorial>

# (find-angg "eev.el" "eev-howto")
#
# Installation notes:
# (find-es "escripts" "eev-quick-inst")

# eev: mark this block, run M-x eev, go to a shell that has the "ee"
# alias, type ee.
echo hello
cd /tmp/
ls

# eev-bounded: place the cursor somewhere between the "#*"s and press
# F3. Then go to a shell and run ee.
#*
tac <<'---'
hello
  bye
---

#*

# The eeg script: press F3 between the "#*"s, go to a shell, run ee;
# then you can send the lines in ee.generic to bc using M-l.
# Bc will interpret M-l and M-r specially, but will treat all the
# other keys in the normal way (it will run interactively!)
#*
cat > ~/bin/ee.generic <<'---'
1 + 2
l(3)/l(2)
#
# log_2 8:
l(8)/l(2)
#
# 1000^(log_2 3):
e(l(1000)*1.585)
e(l(1000)*(l(3)/l(2)))
quit
---
~/bin/eeg bc -l
#*

# If that didn't work then ~/bin/eeg may not have been able to call
# Expect. Check the path. There's an eev block and a hyperlink
# below, ready to be used...

which expect
expect -c 'puts hello'
# (find-fline "~/bin/eeg")

# You can follow hyperlinks like the one in the "find-fline" line
# above in Emacs by placing the cursor after the ")" or at the
# beginning of the following line and typing "C-x C-e". Alternatively,
# if you have followed the dirty installation method you may have a
# single key that works as "C-x C-e": "M-e".

M-k

"M-e" is also able to
# send arguments to the hyperlink functions: try the hyperlink below
# with 



# Things to explain: M-e, M-k, eeg, hyperlinks that search for
# strings, eeman, info path, eelatex-bounded, F3, code-c-d, icode-c-d,
# eecd, w3, dff, inn, eegdb, calling gdb via Lisp, ...





######
#
# a first e-script demo: debugging gawk (+ explanations)
# 00jan23
#
######

# «debugging_gawk0»  (to ".debugging_gawk0")

  Hi Georg,

  I have a project that I think you'll find worth a look, as the
  author of "Brave GNU world" or as a GNU user: it lets users embed
  chunks of code and hyperlinks in plain text files (if they use
  Emacs!), in such a way that one can, for example, write notes about
  how to unpack gawk, recompile it with debug information, start gdb
  on it, place a breakpoint at a certain place, and make it run until
  the breakpoint is reached, all that with comments interspersed that
  are in fact hyperlinks to the places where you got the information
  that led you up to that point... and instead of writing these notes
  in an artificial "press this, do that" style you just record what
  you sent to the shell and to gdb and to "replay" what you recorded
  you just have to mark blocks in Emacs and issue some simple
  commands... in this specific example, many comments in the chunk
  below are to be executed with C-x C-e (eval-last-sexp in Emacs) and
  other parts with M-x eev or M-x eegdb-bounded; eev, eegdb-bounded
  and code-c-d are defined in my package, eev.el, and find-gawkfile,
  find-gawknode and find-gawktag become defined when one runs the
  code-c-d line.

# «debugging_gawk»
# (code-c-d "gawk" "/usr/src/gawk-3.0.3/" "gawk")

rm -Rv /usr/src/gawk-3.0.3/
cd /usr/src/
dpkg-source -sn -x \
  /big/slinks2/dists/slink/main/source/interpreters/gawk_3.0.3-1.dsc
cd /usr/src/gawk-3.0.3/
debian/rules binary	|& tee odrb
etags *.[chy]

# (find-gawkfile "odrb" "strip")
# (find-gawkfile "debian/rules" "strip")
# In the top gawk dir there's a non-stripped binary; we use it.

# (find-gawknode "Numeric Functions")
# (find-gawkfile "awktab.c" "\"cos\"")
# (find-gawktag "do_cos")

cat > /tmp/awkprog <<'---'
BEGIN { print cos(0); }
---

#*
br do_cos
set args -f /tmp/awkprog
run
p *tree
#*
p *(tree->sub.nodep.l.lptr)
#*
p *(tree->sub.nodep.l.ll)
#*

# (gdb "gdb /usr/src/gawk-3.0.3/gawk")
# (find-gawktag "lnode")


# (find-angg "eev.el" "eev")
# (find-angg "eev.el" "code-c-d")
# (find-angg "eev.el" "code-c-d-explan1")
# (find-angg "eev.el" "code-c-d-explan2")
# (find-angg "eev.el" "gdb")
# (find-angg "eev.el" "bounded")





#####
#
# Making a .deb of my home stuff
# 2000nov17
#
#####

# «makepackage_twu»  (to ".makepackage_twu")
# (find-es "debiandev" "yada")
# (find-angg "~/bin/edrxpage")
anonftp angg.twu.net 'lcd /usr/bin' 'cd ~/bin' 'put yada' 'chmod 755 yada' \
  'quit'

#*
# «makepagedeb_angg»  (to ".makepagedeb_angg")
# The first test for "makepackage" (on angg.popolvuh):

makeLedrxtgz
rm -R /tmp/edrxdeb
mkdir /tmp/edrxdeb
cd    /tmp/edrxdeb
cp -v ~root/bin/edrxpage .
cp -v ~root/TH/L/a/s/edrx.tgz .
chmod 755 edrxpage
./edrxpage make_package

#*
# Uploading it to twu ('cause yada there is broken until exec perms are back)
# (find-angg "bin/edrxpage" "package")
cd /tmp/edrxdeb/
PACKAGEVERSION=$(date +%y%m%d)
PACKAGEFILE=edrxpage_$PACKAGEVERSION-1_all.deb
laf $PACKAGEFILE
echo $PACKAGEFILE
echo -n "set -v
  cd ~/slow_html/tmp/
  rm -v edrxpage_latest.deb
  ln -s  $PACKAGEFILE edrxpage_latest.deb
  rm -v  ~/public_html/tmp/edrxpage*.deb
  cp -lv $PACKAGEFILE ~/public_html/tmp/
  ln -s  $PACKAGEFILE ~/public_html/tmp/edrxpage_latest.deb
  laf ~/public_html/tmp/
  laf -L ~/public_html/tmp/
  set +v" > ee.sh
cat ee.sh
#*
anonftp angg.twu.net \
  'put ee.sh ~/bin/ee.sh' \ 
  'cd ~/slow_html/tmp/' 'mdel edrxpage *' "put $PACKAGEFILE" 'dir' 'quit'

#*
# Then, on twu:
cat $EE
ee

#*
# «makepagedeb»  (to ".makepagedeb")
# «makepage_deb»
# The version that used to work on twu:
# (find-angg ".zshrc" "makepagedeb")
# I tested it using eevt.
# All user exec permissions are temporarily disabled on twu, so
# this is not working now.

rm -R ~/tmp/edrxdeb
mkdir ~/tmp/edrxdeb
cd    ~/tmp/edrxdeb
# cp -v ~/bin/edrxpage .
cp -v ~/public_html/a/bin/edrxpage .
cp -v ~/public_html/a/s/edrx.tgz .
chmod 755 edrxpage
./edrxpage make_package && \
( rm -v ~/slow_html/tmp/edrxpage*.deb
  rm -v ~/public_html/tmp/edrxpage*.deb
  cp -lv edrxpage*.deb ~/slow_html/tmp/
  cp -lv edrxpage*.deb ~/public_html/tmp/
  laf ~/public_html/tmp/
  # rm -Rv ~/tmp/edrxdeb/
)

#*




######
#
# locating escript headers in emacs (old)
#
######

; (fundamental-mode)
; (emacs-lisp-mode)
; (find-elnode "Top")
; (find-elnode "Searching and Matching")
; (find-elnode "Syntax of Regexps")

; (find-enode "Top")
; (find-enode "Top" "Regexp Search")

; (find-enode "Command Index" "isearch-forward-regexp")
; (find-etag "isearch-forward-regexp")

(setq eregexp (let ((li1 "####*")
		    (li2 "#")
		    (li3 "# \\(.*\\)")
		    (li4 "#")
		    (li5 "####*"))
		(format "\n\n%s\n%s\n%s\n%s\n%s\n\n" li1 li2 li3 li4 li5)))
(let ((regexp-search-ring (list eregexp)))
  (isearch-forward-regexp))

; Uso: C-M-s 

tclsh <<'---'
set re "\n\n####*\n#\n# \\(.*\\)\n#\n####*\n\n"
set re "\n\n####*\n#\n# (.*)\n#\n####*\n\n"
set s "a\n\n#####\n#\n# foo\n#\n######\n\nb"
set fid [open "~/ZHTML/escripts/icon.e"]
set s [read $fid]
puts [regexp $re $s]
puts [regexp $re foo]
---




######
#
# Converting escripts to html (perl version; old)
#
######

# «escripts_to_html_perl»  (to ".escripts_to_html_perl")

# (find-pl5file "HTML/")
# (find-pl5file "HTML/Entities.pm")
# (find-fline "~/bin/e2html")

cat $ES/escripts.e \
  | 850toiso -s \
  | perl -e 'use HTML::Entities;
	     print "<head></head><body><pre>";
	     while ($_ = <>) {
	       if (m/^((#+ |;+ |\\ |\\; )\0253(.*)\0273\n$/) {
		 print "<a name=\"$3\">", encode_entities($1), "</a>\n"; 
	       } else {
		 print encode_entities($_);
	       }
	     }
	     print "</pre></body>\n";' \
  > /tmp/o.html

pdsc /debian/dists/slink/main/source/text/tcs_1-4.dsc


 $a = "V&aring;re norske tegn b&oslash;r &#230res";
 decode_entities($a);
 encode_entities($a, "\200-\377");




#####
#
# Checking if all headers are OK
# 99sep??
#
#####

# (find-enode "Fill Commands")
# (find-enode "Fill Commands" "adaptive-fill-mode")
# (find-enode "Text Mode" "indented-text-mode")

set escripts {anggsmil.e bis.e cartas.e crim.e debian.e debian0.e
  debiandev.e dos.e emacs.e escripts.e ethernet.e fl.e forth.e games.e
  general.e gimp.e greenmatrix.e hardware.e html.e icon.e icq.e k22.e
  kernel.e mail.e maple.e mini.e music.e net.e netscape.e nonfree.e
  page.e perl.e perl1.e ppp.e print.e psx.e raven10.e raven10b.e
  redhat.e rest.e scheme.e secret.e slink.e sql.e tcl.e tese.e tex.e
  todo.e transp.e vivamusica.e yard.e zsh.e}

proc getheaderlines {fname} {
  set lines [split [exec cat /home/root/ZHTML/escripts/$fname] "\n"]
  puts "$fname [llength $lines]"
  set headerlines {}
  foreach line $lines {
    lappend headerlines $line
    if {$line==""} {break}
  }
  return $headerlines
}
proc writefile {fname str} {
  set channel [open $fname w]; puts -nonewline $channel $str; close $channel
}
foreach fname $escripts {
  writefile /tmp/$fname [join [getheaderlines $fname] "\n"]
}


eet
cd /tmp; for i in *.e; do echo "\n\n$i kernel.e"; diff $i kernel.e; done

rm /tmp/*.e





######
#
# Checking the headers with an expect script
# 99oct14
#
######

# «eheaders»  (to ".eheaders")
# (find-fline "~/EXPECT/eheaders")

cd $ES
eheaders *.e





######
#
# Adjusting the headers
# 99nov03
#
######

# «adjusting_eheaders»  (to ".adjusting_eheaders")
# (find-fline "~/EXPECT/eheaders")

expect -c '
  proc readfile {fname} {
    set channel [open $fname r]; set bigstr [read $channel]; close $channel
    return $bigstr
  }
  set s [readfile $env(ES)/emacs.e]
  set v "#\n"
  set nv "#\[^\n\]+\n"
  set com "#\[^\n\]*\n"
  set bigre "^$nv${v}(($nv)+)${v}(($com)+)(.*)\$"
  if {[regexp $bigre $s -> descr {} hrest {} rest]} {
    puts "<<$descr>>\n<<$hrest>>\n<<$rest>>"
  }
'


# «fix-eheaders»
# (find-fline "~/TCL/fix-eheaders")

rm -Rv /tmp/e
mkdir /tmp/e
cd $ES
~/TCL/fix-eheaders *.e

# eheaders /tmp/e/*.e

cp -v /tmp/e/*.e $ES/

# (find-fline "~/TCL/fix-eheaders" "splite")
# (find-fline "~/TCL/fix-eheaders" "Bad efile")




#####
#
# Adding a "coding:" declaration
# 2000oct22
#
#####

# «adding_coding:»  (to ".adding_coding:")
# (find-es "emacs" "coding:")
# (find-es "perl" "reading_a_file_at_once")

#*
cd $ES
cp zsh.e /tmp/
cd /tmp/
cat zsh.e \
  | perl -e 'undef $/; $_ = <>;
      s/(\n#  Local Variables:\n)((#  [^\n]+\n)+)$/\1#  coding:               \"no-conversion\"\n\2/ && print'

#*
rm -Rv /tmp/e/
mkdir /tmp/e/
cd $ES
for i in *.e; do cat $i \
  | perl -e 'undef $/; $_ = <>;
      s/(\n#  Local Variables:\n)((#  [^\n]+\n)+)$/\1#  coding:               \"no-conversion\"\n\2/ && print' \
  > /tmp/e/$i
  touch -r $i /tmp/e/$i
done
cd /tmp/e/

#*

# Oops, the quotes in "no-conversion" were wrong. Fixing...
rm -Rv /tmp/e/
mkdir /tmp/e/
cd $ES
for i in *.e; do cat $i \
  | sed -e 's/^\(#  coding:.*\)"\(no-conversion\)"/\1\2/' \
  > /tmp/e/$i
  touch -r $i /tmp/e/$i
done
cd /tmp/e/

#*
cd /tmp/e
laf -S
#*
cd /tmp/e
for i in *.e; do diff $i $ES/$i; done |& l -S
#*
cd /tmp/e
cp -av *.e $ES/
#*




#####
#
# corrections in eev.el
# 2000may04
#
#####

# «eev_may2000»  (to ".eev_may2000")

To make the installation easier: use a variable instead of $EE in
eev.el, add another for the generic interface, document it and give
examples of how to override.

# (find-elnode "Top")
# (find-elnode "Defining Variables" "defvar SYMBOL")
# (find-fline "~/eev.el" "where EE is usually")

# (find-angg "eev.el" "variables")

;;;; (describe-variable 'standard-display-table)
;;;; (describe-variable 'buffer-display-table)

;; (find-elnode "Defining Variables" "Special Form: defvar")
;; (find-elinode "defun")

;; (describe-function 'defvar)
;; (describe-function 'defun)
;; (find-elnode "Documentation Basics")
;; (find-elnode "Documentation Tips")
;; (find-e20file "")


use another variable for the "generic" interface. Tell the user that
he/she is encouraged to create other variables and change the ee-defs
if e wants to

write an e-script that downloads eev.el (with either wget or lynx),
then edits the user's .emacs, makes a ~/bin directory to avoid
changing variables, and edits .zshrc to place the alias files.






#####
#
# Installing a copy my page, way 1: only the page
# 2000oct15
#
#####

# «copy_of_edrxs_page»  (to ".copy_of_edrxs_page")
# UPDATE!!! If you use Debian then there is a much easier way:
# (to "edrxpage")

# (to "copy_of_edrxs_home")
# (to "copy_of_edrxs_home_LR")
# This is a first serious attempt to allow a weak form of "tourism"
# with the material on my home directory. See the link below...
# (find-shttpw3 "angg.twu.net/tourism.html")

# Note: actually I started working on this because of a more
# real-worldish project:
# (find-es "xxx-server" "first_doc")

# It should be very easy to change the paths if you need to.

# First step: download http://angg.twu.net/a/s/edrx.tgz to, say, ~/tmp/:

mkdir ~/tmp/
cd    ~/tmp/
wget http://angg.twu.net/a/s/edrx.tgz

# Technical detail: If wget is in no-clobber mode and you already have
# a file named edrx.tgz in the current directory then the new one will
# become "edrx.tgz.1"; the following mv will fix this.

#mv edrx.tgz.1 edrx.tgz

# Here's a way to download the file with lynx, if you don't have wget:
#lynx -source http://angg.twu.net/a/s/edrx.tgz edrx.tgz

# Here's what I do in my home machine to test that without having to
# download anything:
#makeL; make -f a/s/Makefile a/s/edrx.tgz; cp -v a/s/edrx.tgz ~/tmp/

# Now we unpack the tgz in ~/tmp/edrx/:
#
rm -Rv ~/tmp/edrx/
mkdir  ~/tmp/edrx/
cd     ~/tmp/edrx/
tar -xvzf ~/tmp/edrx.tgz

# And now we make all the automatically-generated stuff...
#
#cd    ~/tmp/edrx/
make -f a/s/Makefile

# Note: in BSD systems (FreeBSD, at least) we need to force the use
# of GNU make and to specify a version of tclsh; so the above "make"
# must be replaced by (I think):
#gmake -f a/s/Makefile TCLSH=tclsh8.2 

# That's it! Now this should work, for example:
#
#cd    ~/tmp/edrx/
lynx index.html

# And this is a way to remake the .tgz... but it will make more sense
# after you read the "advanced usage" block below.

#cd    ~/tmp/edrx/
make -f a/s/Makefile a/s/edrx.tgz




#####
#
# Installing a copy of my page, way 2: public_html and home
# 2000nov15
#
#####

# «copy_of_edrxs_home»  (to ".copy_of_edrxs_home")
# (to "copy_of_edrxs_page")
# (to "copy_of_edrxs_home_LR")
# Installation of my page and my home directory -
# First way, for when you're not in my home machine and you don't want
# to convert any links to the local form (the conversions are like
# http://xxx/yy -> $S/http/xxx/yy).

mkdir ~/tmp/
cd    ~/tmp/
wget http://angg.twu.net/a/s/edrx.tgz
#mv edrx.tgz.1 edrx.tgz

# Or, for tests:
#makeL; make -f a/s/Makefile a/s/edrx.tgz; cp -v a/s/edrx.tgz ~/tmp/

# Unpack the tgz in /tmp/edrxhome/public_html/:

rm -Rv   /tmp/edrxhome/public_html/
mkdir -p /tmp/edrxhome/public_html/
cd       /tmp/edrxhome/public_html/

tar -xvzf ~/tmp/edrx.tgz
# These two "make"s (for the htmls and the home) can come in any order.
make -f a/s/Makefile
make -f a/s/Makefile DEST=.. homedir




#####
#
# Installing a copy of my page, way 3: TH/R, TH/L and home
# 2000nov15
#
#####

# «copy_of_edrxs_home_LR»  (to ".copy_of_edrxs_home_LR")
# (to "copy_of_edrxs_page")
# (to "copy_of_edrxs_home")
# Installation of my page and my home directory -
# Second way, for when you/I want both a local version (with
# conversions) and a remote version (without) for the page, plus a
# home directory:

mkdir ~/tmp/
cd    ~/tmp/
wget http://angg.twu.net/a/s/edrx.tgz
#mv edrx.tgz.1 edrx.tgz

# Or, for tests:
#makeL; make -f a/s/Makefile a/s/edrx.tgz; cp -v a/s/edrx.tgz ~/tmp/

# Unpack the tgz in /tmp/edrxhome/public_html/:

rm -Rv   /tmp/edrxhome/TH/R/
mkdir -p /tmp/edrxhome/TH/R/
cd       /tmp/edrxhome/TH/R/

tar -xvzf ~/tmp/edrx.tgz
make -f a/s/Makefile DEST=../.. homedir
make -f a/s/Makefile

# Oops! The way of doing that with a single script is incomplete...
# but what I do in practice is to log in using the new directory and
# zsh (and thus my .zshrc) and then run the "makeL" and "makeR"
# aliases. Then the local and remote versions of the page will be
# available as:

lynx /tmp/edrxhome/TH/L/index.html
lynx /tmp/edrxhome/TH/R/index.html

# (find-angg ".zshrc" "makeL")
# (find-fline "~/TH/Makefile")




#####
#
# Installing a copy of my page, way 4: installing edrxpage on a Debian box
# 2001jan05
#
#####

# «edrxpage»  (to ".edrxpage")
# way 1: (to "copy_of_edrxs_page")
# way 2: (to "copy_of_edrxs_home")
# way 3: (to "copy_of_edrxs_home_LR")
# This way ("4") is more powerful than the three other ways described
# above. The instructions may seem longer, but they will take you much
# farther.

# (to "edrxpage-test")

# First part, the easy way: installing edrxpage_(date)-1.deb without
# building it.
# Edrxpage_(date)-1.deb requires emacs, zsh and expect, and runs much
# better on a GNU Emacs than on XEmacsen; we first ask apt to install
# all its dependencies, so that we can install the package itself with
# dpkg later without messing anything.
#
apt-get install  emacs20 zsh expect5.31
#apt-get install  emacs20 zsh expect5.24

# Download the package. The URL below is a symlink that (huh!) points
# to latest version, that has an uglier name.
#
wget http://angg.twu.net/tmp/edrxpage_latest.deb

# For the partly paranoid, the two commands below will show that the
# package doesn't contain anything harmful; people that are more than
# partly paranoid will want to check each control file more carefully...
#
ar p edrxpage_latest.deb control.tar.gz | tar -tvzf -
ar p edrxpage_latest.deb    data.tar.gz | tar -tvzf -

# Install it.
dpkg -i edrxpage_latest.deb



# Second part: use the scripts from the package to install a copy of
# my home directory, and, inside it, the local and remote versions of
# my page.
# Note: if you are not generally root and want to install the stuff on
# "/home/edrx/" then remember that "mkdir /home/edrx" will require
# special permissions and that you may need to chown or chmod that
# directory later if some normal user is to use it.
#
#mkdir /tmp/edrxhome
#cd    /tmp/edrxhome
mkdir /home/edrx
cd    /home/edrx
#
# The "THR" target opens the contents of /var/lib/edrx/edrx.tgz in
# ./TH/R/ (where it becomes the skeleton for the remote version of
# the page) and then calls the page's makefile to reinstall the
# stuff in the home dir configuration in "." (i.e., in
# /tmp/edrxhome).
#
edrxpage THR
#
# «edrxpage_log»  (to ".edrxpage_log")
# The "log_zsh" target invokes a zsh for the current user, but using
# the current dir as home; it will put you in an environment that
# should be exactly like the one I use.
# (find-angg "bin/edrxpage" "log_help")
#
#cd /tmp/edrxhome
cd /home/edrx
edrxpage log_zsh



# «edrxpage_htmls»  (to ".edrxpage_htmls")
# The following commands should be issued inside the zsh running on
# /home/edrx; makeR and makeL are shell aliased that will update the
# local and remote version of my page in TH/R and TH/L from the home
# stuff. They will have a lot of work to do, as none of the htmls has
# been generated up to this point.
# If you want to inspect make[LR]'s ugly code: (find-angg ".zshrc" "makeL")
#
makeR
makeL
lynx ~/TH/L/
lynx ~/TH/R/
#
# To make the manpage and info page hyperlinks work you'll have to
# install apache with cgi support, plus info2www and man2html; lynx
# /home/edrx/TH/L/ will use the "local version" of the page, that use
# local CGIs. The main link with installation instructions is the one
# below; it isn't very detailed at this moment, sorry.
# (find-es "apache" "apache_basic_inst")

# «edrxpage_emacs»  (to ".edrxpage_emacs")
# I set DISPLAY to :0.0 to make it easy to start X programs from a
# text console; if you want emacs to run on the text console you're in
# (without popping up a window in X) then you have to run it with the
# "-nw" option:
#
emacs -nw $ES/emacs.e

# «edrxpage_emacsX»  (to ".edrxpage_emacsX")
# Installing the console fonts I use is difficult (it involves
# installing mktclapp, that hasn't been accepted into Debian yet)
# but Emacs will work ok in X, even with some colored chars:
#
emacs $ES/emacs.e




# Note: if you are running as root or as an user with enough X
# permissions then the "xset_MATH" shell alias will add ~/MTA/ to X's
# font path, so that you can run the Emacs commands xmath or xmathx2
# and see what my font looks like. It is not very convenient, though
# -- entering the strange chars is still a bit of a pain. I still use
# console mode 99% of the time, and I use a program based on mktclapp
# to change the console font and the keymap; instructions on how to
# install all that stuff will have to wait.
#
# (find-angg ".zshrc" "X")
# (find-angg ".zshrc" "console")
# (find-angg ".xinitrc" "xauth")
# (find-es "mktclapp")
# (find-fline "~/MTA/vtutil")
#
xset_MATH
emacs $ES/emacs.e



# «edrxpage_logtrick»  (to ".edrxpage_logtrick")
# Here's a dirty (and entirely optional) trick to let you log as root
# straight into /home/edrx, using the "edrxroot" login name and with
# no password; the username and userid will still be root's. If you
# care about invasions and security you shouldn't do this, of course.
#
# (find-angg "bin/edrxpage" "passwd_help")
# (find-fline "/etc/passwd")
#
echo 'edrxroot::0:0:root:/home/edrx:/usr/bin/zsh' >> /etc/passwd
#
# If you want to create a standard "edrx" user then adduser can take
# care of all the ugly details.



# «edrxpage_makedeb»  (to ".edrxpage_makedeb")
# The "hard" alternative to the first part of the installation: we use
# the fact that the "edrxpage" script is able to download the stuff it
# needs and build the .deb from the .tgz using yada. I stopped using
# this, though, because people weren't very interested in it and yada
# sometimes behave weirdly on woody.
#
apt-get install task-debian-devel yada

#rm -Rv /tmp/edrxdeb
mkdir /tmp/edrxdeb
cd    /tmp/edrxdeb
wget http://angg.twu.net/a/bin/edrxpage
chmod 755 edrxpage
# (find-angg "bin/edrxpage" "package")
./edrxpage download_tgz make_package
#
# The following two "ar" lines will list the contents of the package
# and maybe convince you that it is harmless.
#
ar p edrxpage*.deb control.tar.gz | tar -tvzf -
ar p edrxpage*.deb    data.tar.gz | tar -tvzf -

# Now install the deb. This is the only thing that must be done as
# root.
#
#dpkg -i edrxpage*.deb
sudo dpkg -i edrxpage*.deb 






# «edrxpage-test»  (to ".edrxpage-test")
# You do not need to understand this, it is just something that I use
# -- or used to use -- to test the installation instructions above in:
# (to "edrxpage")
#*
makeLedrxtgz
rm -R /tmp/edrxdeb
rm -R /tmp/edrxhome
mkdir /tmp/edrxhome
#aptrm edrxpage
  # For the xset/Emacs test:
  su -s /usr/X11R6/bin/xauth beth nmerge /tmp/0.0
  cp -av ~beth/.Xauthority /tmp/edrxhome/; laf /tmp/edrxhome/.Xauthority

cat > $EEG <<'---'
mkdir  /tmp/edrxdeb
cd     /tmp/edrxdeb
#wget http://angg.twu.net/a/bin/edrxpage
cp -v ~root/bin/edrxpage .
cp -v ~root/TH/L/a/s/edrx.tgz .
chmod 755 edrxpage

./edrxpage download_tgz make_package
ar p edrxpage*.deb control.tar.gz | tar -tvzf -
ar p edrxpage*.deb    data.tar.gz | tar -tvzf -
sudo dpkg -i edrxpage*.deb 

mkdir /tmp/edrxhome
cd    /tmp/edrxhome
# (find-angg "bin/edrxpage" "package")
edrxpage THR
edrxpage log_zsh
#makeR
makeL
lynx ~/TH/L/
#lynx ~/TH/R/
xset_MATH
emacs $ES/emacs.e

exit 0
---
eeg su - beth
# done.

#*






#####
#
# Removing the strange characters
# 2000aug29
#
#####

# (find-node "(sed)Concept Index")
# Just substituting "*" for "\xxx" (say) doesn't seem to work.
# What's the trick?
# (find-fline "~/TH/Makefile")

#*
cd $ES
cat escripts.e \
  | sed -e 's/*/-/' -e 's/«/<</' -e 's/»/>>/' \
  |& l
#*
cd $ES
cat escripts.e \
  | sed 's/*/-/; s/«/<</; s/»/>>/' \
  |& l
#*




#####
#
# Making links to all docstrings in eev.el
# 2000aug27
#
#####

#*
cat ~/eev.el \
  | perl -nle '
      m/^\(defun (\S+)/  && print "# (describe-function \047$1)";
      m/^\(defvar (\S+)/ && print "# (describe-variable \047$1)";
    ' \
  | tee ~/o
#*




#####
#
# something about converting from 850math to iso
# 2001jan??
#
#####

#*
makeLedrxtgz
rm -R /tmp/edrxdeb
mkdir /tmp/edrxdeb
cd    /tmp/edrxdeb
cp -v ~root/bin/edrxpage .
cp -v ~root/TH/L/a/s/edrx.tgz .
chmod 755 edrxpage
./edrxpage make_package

#*
makeLedrxtgz
#*
rm -Rv /tmp/850/
mkdir  /tmp/850/
cd     /tmp/850/
tar -xvzf ~/TH/L/a/s/edrx.tgz
rm -v $(find * | egrep '(png|gz)$')
for i in $(find * -type f); do
  (850toiso < $i > x) >>& otcs; mv -v x $i
done
sort otcs | uniq | tee otcs2
make -f a/s/Makefile
for i in $(find * | grep 'html$'); do
  cmp -s $i ~/TH/R/$i || (echo $i; diff $i ~/TH/R/$i)
done
#*




#####
#
# Putting shells in verbose mode
# 2001oct30
#
#####

#*
alias ee2='set -v;. /tmp/ee.sh;set +v'
cat > /tmp/ee.sh <<'---'
echo hello
echo bye
---
ee2

cat > $EEG <<'---'
alias ee2 'set verbose;source /tmp/ee.sh;unset verbose'
ee2
exit
---
eeg tcsh

cat > $EEG <<'---'
alias ee2='set -v;. /tmp/ee.sh;set +v'
ee2
exit
---
eeg bash

#*





#  Local Variables:
#  coding:               utf-8-unix
#  End: