Warning: this is an htmlized version!
The original is across this link,
and the conversion rules are here.
; Edrx's .emacs
; 2013feb13
; ^ don't trust the date above

;; (getenv "HOME")
;; default-directory
;; (setenv "HOME" default-directory)

;; (find-sh "grep -n '«.*»' ~/.emacs")

;; «.autoloads»		(to "autoloads")
;; «.add-to-alist»	(to "add-to-alist")
;; «.seen»		(to "seen")
;; «.auto-mode-alist»	(to "auto-mode-alist")
;; «.mode-variables»	(to "mode-variables")
;; «.w3m-el»		(to "w3m-el")
;; «.same-window-buffer-names»	(to "same-window-buffer-names")

;; «.emacs-cvs»		(to "emacs-cvs")
;; «.my-mode»		(to "my-mode")
;; «.eev»		(to "eev")
;; «.eev-block»		(to "eev-block")
;; «.fvwm»		(to "fvwm")
;; «.mplayer-options»	(to "mplayer-options")
;; «.eepitch.el»	(to "eepitch.el")
;; «.favourite-modes»	(to "favourite-modes")
;; «.modes-safe-local»	(to "modes-safe-local")
;; «.square-brackets»	(to "square-brackets")
;; «.woman»		(to "woman")
;; «.find-woman»	(to "find-woman")
;; «.M-e-in-c-mode»	(to "M-e-in-c-mode")
;; «.find-eimage»	(to "find-eimage")
;; «.find-w3m»		(to "find-w3m")
;; «.dired-find-w3m»	(to "dired-find-w3m")
;; «.dired-find-planner»  (to "dired-find-planner")
;; «.ee-isearch»	(to "ee-isearch")
;; «.ee-to-protected»	(to "ee-to-protected")
;; «.to-shadow»		(to "to-shadow")
;; «.find-fline-ov»	(to "find-fline-ov")
;; «.find-dict»		(to "find-dict")
;; «.browse-url»	(to "browse-url")
;; «.brwl-and-friends»	(to "brwl-and-friends")
;; «.find-ie»		(to "find-ie")
;; «.brie»		(to "brie")
;; «.brmd»		(to "brmd")
;; «.brgvd»		(to "brgvd")

;; «.syntax-tables»	(to "syntax-tables")
;; «.noerr»		(to "noerr")
;; «.code-c-d_e»	(to "code-c-d_e")

;; «.tramp»		(to "tramp")
;; «.remote-machines»	(to "remote-machines")
;; «.tramp-twu»		(to "tramp-twu")
;; «.upload-changes»	(to "upload-changes")
;; «.upload-this»	(to "upload-this")

;; «.code-c-ds»		(to "code-c-ds")
;; «.k22»		(to "k22")
;; «.lua50»		(to "lua50")
;; «.eevt_twu»		(to "eevt_twu")
;; «.papers»		(to "papers")
;; «.icon»		(to "icon")
;; «.iconbook»		(to "iconbook")
;; «.icongrbook»	(to "icongrbook")
;; «.tclbook»		(to "tclbook")
;; «.find-iconbooktext»	(to "find-iconbooktext")
;; «.kd»		(to "kd")
;; «.dkey»		(to "dkey")
;; «.fooi»		(to "fooi")
;; «.fooi-re»		(to "fooi-re")
;; «.fooi-t»		(to "fooi-t")
;; «.fooi-a»		(to "fooi-a")

;; «.key_bindings»	(to "key_bindings")
;; «.C-x-spc»		(to "C-x-spc")
;; «.gnuserv»		(to "gnuserv")
;; «.X»			(to "X")
;; «.set-input-mode»	(to "set-input-mode")

;; «.ascstr»		(to "ascstr")
;; «.ee-insert»		(to "ee-insert")
;; «.to-codes»		(to "to-codes")
;; «.to-ranges»		(to "to-ranges")
;; «.emacs-wiki»	(to "emacs-wiki")
;; «.emacs-wiki-edrx»	(to "emacs-wiki-edrx")
;; «.find-planner»	(to "find-planner")
;; «.find-string-ow»	(to "find-string-ow")
;; «.find-progoutput-ow»  (to "find-progoutput-ow")

;; «.isearch-faces»	(to "isearch-faces")

;; «.obsolete»		(to "obsolete")
;; «.php»		(to "php")

;; «.guest_users»	(to "guest_users")
;; «.info-path»		(to "info-path")
;; «.passwds-tcl-get»	(to "passwds-tcl-get")
;; «.eechannel-send-passwd»  (to "eechannel-send-passwd")
;; «.erc»		(to "erc")
;; «.erc-freenode-join»	(to "erc-freenode-join")
;; «.ee-send-to-erc-channel»  (to "ee-send-to-erc-channel")
;; «.find-fsbot-answer»	(to "find-fsbot-answer")

;; «.lforth»		(to "lforth")
;; «.eepdj»		(to "eepdj")
;; «.ee-el»		(to "ee-el")
;; «.dout»		(to "dout")
;; «.load-.emacs-tex»	(to "load-.emacs-tex")

;; «.htmlize»		(to "htmlize")

;; «.fundcomp-menu»	(to "fundcomp-menu")
;; «.menu-bar»		(to "menu-bar")
;; «.tool-bar»		(to "tool-bar")
;; «.show-as-image»	(to "show-as-image")

;; «.ptexts»		(to "ptexts")
;; «.underline-as-green»  (to "underline-as-green")
;; «.lua-manual»	(to "lua-manual")
;; «.r0r2»		(to "r0r2")
;; «.find-ebuffer+»	(to "find-ebuffer+")
;; «.hippie-expand»	(to "hippie-expand")
;; «.dfs»		(to "dfs")
;; «.eesteps»		(to "eesteps")
;; «.my-ins»		(to "my-ins")
;; «.chowns»		(to "chowns")

;; «.find-zsh»			(to "find-zsh")
;; «.upload»			(to "upload")
;; «.eev-current-make-htmls»	(to "eev-current-make-htmls")
;; «.eesteps-insert-longkey»	(to "eesteps-insert-longkey")
;; «.my-screenshot»		(to "my-screenshot")
;; «.emacs-ascii-screenshots»	(to "emacs-ascii-screenshots")
;; «.find-mode-line-links»	(to "find-mode-line-links")
;; «.my-modes»			(to "my-modes")
;; «.my-screenshot»		(to "my-screenshot")
;; «.linuxconfvar»		(to "linuxconfvar")
;; «.code-c-d-linux26»		(to "code-c-d-linux26")
;; «.intermail»			(to "intermail")
;; «.remove-from-keymap»	(to "remove-from-keymap")
;; «.tex-insert-quote»		(to "tex-insert-quote")

;; «.hscroll-keys-mode»	(to "hscroll-keys-mode")
;; «.unquote-printable»	(to "unquote-printable")
;; «.date»		(to "date")
;; «.yank-first-line»	(to "yank-first-line")
;; «.myip»		(to "myip")
;; «.eeblogme»		(to "eeblogme")
;; «.eeblogme-now»	(to "eeblogme-now")
;; «.blogme-mode-syntax-table»	(to "blogme-mode-syntax-table")
;; «.blogme-mode»	(to "blogme-mode")
;; «.blogme4»		(to "blogme4")
;; «.dednat5»		(to "dednat5")

;; «.eevnow»		(to "eevnow")
;; «.dotemacs.private»	(to "dotemacs.private")
;; «.find-w3m-links»	(to "find-w3m-links")
;; «.safe-local-variable»  (to "safe-local-variable")

;; «.source2e»		(to "source2e")
;; «.classes.dtx»	(to "classes.dtx")
;; «.find-source2epage»	(to "find-source2epage")
;; «.find-texbookpage-old»  (to "find-texbookpage-old")
;; «.find-texbookpage»	(to "find-texbookpage")
;; «.wdg»		(to "wdg")
;; «.howm»		(to "howm")
;; «.howm-create-named-file»  (to "howm-create-named-file")
;; «.iheader»		(to "iheader")
;; «.hm»		(to "hm")
;; «.find-edrxhowm»	(to "find-edrxhowm")
;; «.dednat4»		(to "dednat4")
;; «.dednat4-setup»	(to "dednat4-setup")
;; «.eedn4-51»		(to "eedn4-51")
;; «.eedn4a»		(to "eedn4a")
;; «.rcirc»		(to "rcirc")

;; «.find-xkbprint»	(to "find-xkbprint")
;; «.prep-X»		(to "prep-X")
;; «.prep-all»		(to "prep-all")
;; «.prep-X-kbdmap»	(to "prep-X-kbdmap")
;; «.prep-X-kbdrate»	(to "prep-X-kbdrate")
;; «.prep-X-font»	(to "prep-X-font")
;; «.gnus»		(to "gnus")
;; «.gnus-quimby»	(to "gnus-quimby")
;; «.lists.gnu.org»	(to "lists.gnu.org")
;; «.gnu.emacs.bugs»	(to "gnu.emacs.bugs")
;; «.gnu.emacs.devel»	(to "gnu.emacs.devel")
;; «.gnu.emacs.sources»	(to "gnu.emacs.sources")
;; «.gmane.emacs.eev.devel»  (to "gmane.emacs.eev.devel")
;; «.comp.lang.forth»	(to "comp.lang.forth")
;; «.hh»		(to "hh")
;; «.find-eunicode»	(to "find-eunicode")
;; «.find-eunicodeucs»	(to "find-eunicodeucs")
;; «.diagxy»		(to "diagxy")
;; «.libgtk-docs»	(to "libgtk-docs")
;; «.find-firefox-bg»	(to "find-firefox-bg")
;; «.luamanual»		(to "luamanual")
;; «.luamanual-51»	(to "luamanual-51")
;; «.find-luamanual-ff»	(to "find-luamanual-ff")
;; «.smalltalk»		(to "smalltalk")
;; «.visualworks»	(to "visualworks")
;; «.color-theme»	(to "color-theme")
;; «.my-make-face»	(to "my-make-face")
;; «.myxpm»		(to "myxpm")
;; «.find-xpm»		(to "find-xpm")
;; «.terminus»		(to "terminus")
;; «.find-sidebyside»	(to "find-sidebyside")
;; «.eejump-define»	(to "eejump-define")
;; «.eejump-plists»	(to "eejump-plists")
;; «.eejump»		(to "eejump")
;; «.find-tkdiff»	(to "find-tkdiff")
;; «.eekill»		(to "eekill")
;; «.eepitch»		(to "eepitch")
;; «.eepitch-kill»	(to "eepitch-kill")
;; «.reload»		(to "reload")
;; «.ee-comint»		(to "ee-comint")
;; «.ee-telnet»		(to "ee-telnet")
;; «.ruby»		(to "ruby")
;; «.ruby-pragmatic»	(to "ruby-pragmatic")
;; «.titan»		(to "titan")
;; «.titand-docs-text»	(to "titand-docs-text")
;; «.postgres»		(to "postgres")
;; «.find-C-links»	(to "find-C-links")
;; «.find-postgres-links»	(to "find-postgres-links")
;; «.find-grep-links»		(to "find-grep-links")
;; «.swig»			(to "swig")
;; «.eea2ps»			(to "eea2ps")
;; «.eea2ps-meta»		(to "eea2ps-meta")
;; «.eea2pswide»		(to "eea2pswide")
;; «.fill-rcirc-paragraph»	(to "fill-rcirc-paragraph")
;; «.display-time-mode»		(to "display-time-mode")
;; «.eemklinks-yank-w3m-anchor»	(to "eemklinks-yank-w3m-anchor")
;; «.find-C-x»			(to "find-C-x")
;; «.find-ebuffer-links»	(to "find-ebuffer-links")
;; «.freedb-rename»		(to "freedb-rename")
;; «.find-pdfpage-pdftotext»	(to "find-pdfpage-pdftotext")
;; «.find-xxxtkdiff»		(to "find-xxxtkdiff")
;; «.find-cdecl»		(to "find-cdecl")
;; «.eetcc»			(to "eetcc")
;; «.figlet»			(to "figlet")
;; «.eshell»			(to "eshell")
;; «.unaccent»			(to "unaccent")
;; «.flip-psne-ness»		(to "flip-psne-ness")
;; «.find-other-debian-links»	(to "find-other-debian-links")
;; «.find-rcirc-channel-sexps»	(to "find-rcirc-channel-sexps")
;; «.find-ekbmacro-links»	(to "find-ekbmacro-links")
;; «.find-dpkg-build-escript»	(to "find-dpkg-build-escript")
;; «.find-file-links»		(to "find-file-links")
;; «.find-bgprocess»		(to "find-bgprocess")
;; «.defalias-hard-maybe»	(to "defalias-hard-maybe")
;; «.ee-kill-this-buffer»	(to "ee-kill-this-buffer")
;; «.golisp»			(to "golisp")
;; «.sshot»			(to "sshot")
;; «.find-cat-to-lp0-script»	(to "find-cat-to-lp0-script")
;; «.find-bigdvdcopy-script»	(to "find-bigdvdcopy-script")
;; «.cltl»			(to "cltl")
;; «.find-template-untgz»	(to "find-template-untgz")
;; «.bruntgz»			(to "bruntgz")
;; «.find-code-ps-url-links»	(to "find-code-ps-url-links")
;; «.brcps»			(to "brcps")
;; «.find-pspage-links»		(to "find-pspage-links")
;; «.find-jstor-links»		(to "find-jstor-links")
;; «.wikit-edit»		(to "wikit-edit")
;; «.find-eepitch-links»	(to "find-eepitch-links")
;; «.find-eevarticle-links»	(to "find-eevarticle-links")
;; «.find-anggrumidiff-links»	(to "find-anggrumidiff-links")
;; «.ee-shrink-hyperlink-at-eol»  (to "ee-shrink-hyperlink-at-eol")
;; «.find-setq-links»  		(to "find-setq-links")
;; «.ee-choosecolor»		(to "ee-choosecolor")
;; «.find-ecolor-links»		(to "find-ecolor-links")
;; «.find-eface»		(to "find-eface")
;; «.find-eface-links»		(to "find-eface-links")
;; «.digirati»			(to "digirati")
;; «.mysql»			(to "mysql")
;; «.find-anggupload-links»	(to "find-anggupload-links")
;; «.find-unpack-chm-links»	(to "find-unpack-chm-links")
;; «.eepic»			(to "eepic")
;; «.esrpic»			(to "esrpic")
;; «.find-adduser-links»	(to "find-adduser-links")
;; «.find-osmio-template»	(to "find-osmio-template")
;; «.find-template-svnadm»	(to "find-template-svnadm")
;; «.find-copydvdtohd-script»	(to "find-copydvdtohd-script")
;; «.davinci»			(to "davinci")
;; «.eepitch-gdb»		(to "eepitch-gdb")
;; «.eepitch-gdb-lua»		(to "eepitch-gdb-lua")
;; «.eepitch-gdb-scite»		(to "eepitch-gdb-scite")
;; «.tcl-tk»			(to "tcl-tk")
;; «.ee-meta-S»			(to "ee-meta-S")
;; «.org-mode»			(to "org-mode")
;; «.auto-mode-alist-tecmake»	(to "auto-mode-alist-tecmake")
;; «.code-c-d-new»		(to "code-c-d-new")
;; «.ee-sexp-remote»		(to "ee-sexp-remote")
;; «.ee-make-frame»		(to "ee-make-frame")
;; «.ee-sexp-remote-demo»	(to "ee-sexp-remote-demo")
;; «.rename-track»		(to "rename-track")
;; «.firefox»			(to "firefox")
;; «.mozrepl»			(to "mozrepl")
;; «.eepitch-moz»		(to "eepitch-moz")
;; «.espresso-mode»		(to "espresso-mode")
;; «.find-emode-links»		(to "find-emode-links")
;; «.find-sshot-links»		(to "find-sshot-links")
;; «.find-glyphashtml-links»	(to "find-glyphashtml-links")
;; «.find-TH»			(to "find-TH")
;; «.blogme3»			(to "blogme3")
;; «.mksec»			(to "mksec")
;; «.startup-screen»		(to "startup-screen")
;; «..emacs.papers»		(to ".emacs.papers")
;; «..emacs.templates»		(to ".emacs.templates")
;; «.find-urlretrieve»		(to "find-urlretrieve")
;; «.find-wget»			(to "find-wget")
;; «.brwget»			(to "brwget")
;; «.find-epalette»		(to "find-epalette")
;; «.tgt»			(to "tgt")
;; «.column-marker»		(to "column-marker")
;; «.find-psne-links»		(to "find-psne-links")
;; «.brep»			(to "brep")
;; «.ee-cp»			(to "ee-cp")
;; «.find-ecp0»			(to "find-ecp0")
;; «.find-mbox»			(to "find-mbox")
;; «.eshell-url-retrieve»	(to "eshell-url-retrieve")
;; «.ee-wrap»			(to "ee-wrap")
;; «.caramelo»			(to "caramelo")
;; «.zumbi»			(to "zumbi")
;; «.zumbiwikicvs»		(to "zumbiwikicvs")
;; «.dekooning»			(to "dekooning")
;; «.persephone»		(to "persephone")
;; «.sisrot»			(to "sisrot")
;; «.sisrotpdsw»		(to "sisrotpdsw")
;; «.sisrot-pdsw-etc»		(to "sisrot-pdsw-etc")
;; «.sisrot-cameras»		(to "sisrot-cameras")
;; «.noronha»			(to "noronha")
;; «.telemedidastestes»		(to "telemedidastestes")
;; «.find-omnisys-links»	(to "find-omnisys-links")
;; «.telemedidas»		(to "telemedidas")
;; «.find-netbsdman»		(to "find-netbsdman")
;; «.eev-traffic-light-glyphs»	(to "eev-traffic-light-glyphs")
;; «.no-super-key»		(to "no-super-key")
;; «.eepitch-sisrotlua»		(to "eepitch-sisrotlua")
;; «.qt»			(to "qt")
;; «.maut»			(to "maut")
;; «.brecp»			(to "brecp")
;; «.lilypond»			(to "lilypond")
;; «.lilypond-repl»		(to "lilypond-repl")
;; «.metalua»			(to "metalua")
;; «.texinfo»			(to "texinfo")
;; «.ee-unglyph»		(to "ee-unglyph")
;; «.eev-math-glyphs-new»	(to "eev-math-glyphs-new")
;; «.my-faces-sort»		(to "my-faces-sort")
;; «.doc-view-mode»		(to "doc-view-mode")
;; «.sqlite»			(to "sqlite")
;; «.find-pen-links»		(to "find-pen-links")
;; «.find-hde-links»		(to "find-hde-links")
;; «.find-dn4tex-links»		(to "find-dn4tex-links")
;; «.find-euboutput»		(to "find-euboutput")
;; «.find-printindex»		(to "find-printindex")
;; «.find-fontset-links»	(to "find-fontset-links")
;; «.ee-font-unalias»		(to "ee-font-unalias")
;; «.ee-set-frame-font»		(to "ee-set-frame-font")
;; «.:dvi»			(to ":dvi")
;; «.find-LTX»			(to "find-LTX")
;; «.find-testfont»		(to "find-testfont")
;; «.find-dvifonts»		(to "find-dvifonts")
;; «.ee-env-normalize»		(to "ee-env-normalize")
;; «.ee-with-env»		(to "ee-with-env")
;; «.eepitch-makeinfo»		(to "eepitch-makeinfo")
;; «.tmpdn4»			(to "tmpdn4")
;; «.luatex»			(to "luatex")
;; «.luatex-src»		(to "luatex-src")
;; «.luacode»			(to "luacode")
;; «.ee-replace-regexp»		(to "ee-replace-regexp")
;; «.ee-demo-4»			(to "ee-demo-4")
;; «.coq»			(to "coq")
;; «.std-to-dnc»		(to "std-to-dnc")
;; «.dnc-to-std»		(to "dnc-to-std")
;; «.dn4-block»			(to "dn4-block")
;; «.save-this-block-as»	(to "save-this-block-as")
;; «.anchors-in-latin-1»	(to "anchors-in-latin-1")
;; «.hpprint»			(to "hpprint")
;; «.hjbc1»			(to "hjbc1")
;; «.hjbc2»			(to "hjbc2")
;; «.perl»			(to "perl")
;; «.python»			(to "python")
;; «.ipython»			(to "ipython")
;; «.pylab»			(to "pylab")
;; «.sympy»			(to "sympy")
;; «.maxima-cvs»		(to "maxima-cvs")
;; «.maxima-gpdraw»		(to "maxima-gpdraw")
;; «.eepitch-region»		(to "eepitch-region")
;; «.code-filetext»		(to "code-filetext")
;; «.debian-devel-docs»		(to "debian-devel-docs")
;; «.vcaa»			(to "vcaa")
;; «.no-mouse-mode»		(to "no-mouse-mode")
;; «.openoffice»		(to "openoffice")
;; «.mm:ss»			(to "mm:ss")
;; «.find-mplayer»		(to "find-mplayer")
;; «.code-mplayer»		(to "code-mplayer")
;; «.code-Mplayer»		(to "code-Mplayer")
;; «.ict-quimica»		(to "ict-quimica")
;; «.find-minicatsvideo»	(to "find-minicatsvideo")
;; «.find-minicatsframe»	(to "find-minicatsframe")
;; «.lua-5.2»			(to "lua-5.2")
;; «.luajit»			(to "luajit")
;; «.love2d»			(to "love2d")
;; «.caderno»			(to "caderno")
;; «.unilog-2010»		(to "unilog-2010")
;; «.haskell-mode»		(to "haskell-mode")
;; «.gdb»			(to "gdb")
;; «.bash»			(to "bash")
;; «.dash»			(to "dash")
;; «.ksh»			(to "ksh")
;; «.tcsh»			(to "tcsh")
;; «.zsh»			(to "zsh")
;; «.guile»			(to "guile")
;; «.mit-scheme»		(to "mit-scheme")
;; «.scsh»			(to "scsh")
;; «.hugs»			(to "hugs")
;; «.ghc»			(to "ghc")
;; «.haskell»			(to "haskell")
;; «.ocaml»			(to "ocaml")
;; «.plzoo»			(to "plzoo")
;; «.levy»			(to "levy")
;; «.picolisp»			(to "picolisp")
;; «.ee-backup-lua-locals»	(to "ee-backup-lua-locals")
;; «.xmonad»			(to "xmonad")
;; «.unilog-current»		(to "unilog-current")
;; «.idct»			(to "idct")
;; «.minicats»			(to "minicats")
;; «.eblslides»			(to "eblslides")
;; «.eblsheaves»		(to "eblsheaves")
;; «.sheavesforchildren»	(to "sheavesforchildren")
;; «.find-2»			(to "find-2")
;; «.chaui»			(to "chaui")
;; «.metapost»			(to "metapost")
;; «.projeto»			(to "projeto")
;; «.find-luac»			(to "find-luac")
;; «.find-lua51ev»		(to "find-lua51ev")
;; «.gs»			(to "gs")
;; «.gforth»			(to "gforth")
;; «.erlang»			(to "erlang")
;; «.google-dns»		(to "google-dns")
;; «.google»			(to "google")
;; «.fv»			(to "fv")
;; «.scan»			(to "scan")
;; «.rotate»			(to "rotate")
;; «.tex-def-many»		(to "tex-def-many")
;; «.agda»			(to "agda")
;; «.luarocks»			(to "luarocks")
;; «.ltcltk»			(to "ltcltk")
;; «.pulseaudio»		(to "pulseaudio")
;; «.tramp-2.1.9»		(to "tramp-2.1.9")
;; «.varda»			(to "varda")
;; «.find-newhost-links»	(to "find-newhost-links")
;; «.apt-cacher»		(to "apt-cacher")
;; «.blogme4-texi»		(to "blogme4-texi")
;; «.olympus»			(to "olympus")
;; «.quadro»			(to "quadro")

;; «.rubyforth»			(to "rubyforth")
;; «.pythonforth»		(to "pythonforth")
;; «.eepitch-rubyforth»		(to "eepitch-rubyforth")
;; «.eepitch-dednat4»		(to "eepitch-dednat4")
;; «.duoforths»			(to "duoforths")
;; «.rubyforth»			(to "rubyforth")
;; «.dflua»			(to "dflua")
;; «.zbforth»			(to "zbforth")

;; «.scala»			(to "scala")
;; «.clojure»			(to "clojure")
;; «.J»				(to "J")
;; «.maxima»			(to "maxima")
;; «.R»				(to "R")
;; «.joy»			(to "joy")
;; «.octave»			(to "octave")
;; «.cc-mode»			(to "cc-mode")
;; «.eevbuild»			(to "eevbuild")
;; «.eev-puro»			(to "eev-puro")
;; «.eev-puro-deb»		(to "eev-puro-deb")
;; «.LR-and-RE-and-RR»		(to "LR-and-RE-and-RR")
;; «.ee-tramp-proxy»		(to "ee-tramp-proxy")
;; «.ee-splitn»			(to "ee-splitn")
;; «.ee-wrapt»			(to "ee-wrapt")
;; «.ee-wrapc»			(to "ee-wrapc")
;; «.binutils»			(to "binutils")
;; «.wget»			(to "wget")
;; «.ee-popup»			(to "ee-popup")
;; «.fullscreen»		(to "fullscreen")
;; «.find-wset»			(to "find-wset")
;; «.inet-addr»			(to "inet-addr")
;; «.cleanindex»		(to "cleanindex")
;; «.virtualbox»		(to "virtualbox")
;; «.gab»			(to "gab")
;; «.find-rawcat»		(to "find-rawcat")
;; «.estagios»			(to "estagios")
;; «.ict12sep20»		(to "ict12sep20")
;; «.chomsky»			(to "chomsky")
;; «.ee-rmprefix»		(to "ee-rmprefix")
;; «.ee-killurl»		(to "ee-killurl")
;; «.cow-and-mow»		(to "cow-and-mow")
;; «.cuow»			(to "cuow")
;; «.tramp-no-remote-shells»	(to "tramp-no-remote-shells")
;; «.screencasts»		(to "screencasts")
;; «.git»			(to "git")
;; «.git-internals»		(to "git-internals")
;; «.pro-git»			(to "pro-git")
;; «.find-gitdiag»		(to "find-gitdiag")
;; «.OP-1»			(to "OP-1")
;; «.find-eev2-links»		(to "find-eev2-links")
;; «.diags»			(to "diags")
;; «.tags-mode»			(to "tags-mode")
;; «.tags-mode-chars»		(to "tags-mode-chars")
;; «.quadradinho»		(to "quadradinho")
;; «.youtube-dl»		(to "youtube-dl")
;; «.ee-youtubedl-dirs»		(to "ee-youtubedl-dirs")
;; «.find-screenshot-links»	(to "find-screenshot-links")
;; «.idarct»			(to "idarct")
;; «.eww»			(to "eww")
;; «.find-freenode0»		(to "find-freenode0")
;; «.scast»			(to "scast")
;; «.android»			(to "android")
;; «.packages»			(to "packages")
;; «.mplayer»			(to "mplayer")
;; «.mplayer-screenshots»	(to "mplayer-screenshots")
;; «.lua-mode»			(to "lua-mode")
;; «.contact»			(to "contact")
;; «.find-1|3»			(to "find-1|3")
;; «.find-GA-links»		(to "find-GA-links")
;; «.ee-dired-marked»		(to "ee-dired-marked")
;; «.find-cp-to-angg-links»	(to "find-cp-to-angg-links")
;; «.youtube-title»		(to "youtube-title")
;; «.yt»			(to "yt")
;; «.2013-rfm-rcn»		(to "2013-rfm-rcn")
;; «.rst-mode»			(to "rst-mode")
;; «.youtube-db.lua»		(to "youtube-db.lua")
;; «.eecd»			(to "eecd")
;; «.lyrics»			(to "lyrics")
;; «.djview»			(to "djview")
;; «.tikz»			(to "tikz")
;; «.insert-n»			(to "insert-n")
;; «.beamer»			(to "beamer")
;; «.youtube-db»		(to "youtube-db")
;; «.youtube-db-play»		(to "youtube-db-play")





;;;;;
;;
;; «autoloads»  (to ".autoloads")
;;
;;;;;

(autoload 'Info-goto-node "info")
(autoload 'browse-url-interactive-arg "browse-url")
(autoload 'find-function-read "find-func")
(autoload 'icon-mode "icon" nil t)
(autoload 'lua-mode "lua-mode" nil t)
(autoload 'pp-to-string "pp")
(autoload 'emacs-wiki-maybe "emacs-wiki")
(autoload 'htmlize-buffer "htmlize")
(autoload 'erc-select "erc" nil t)
(autoload 'Man-fontify-manpage "man" nil t)

;; (find-eev "Makefile" "htmlize.el")
;; (find-eev "htmlize.el")
(autoload 'htmlize-file "htmlize" nil t)

;; (find-efile "generic-x.el")
(setq generic-use-find-file-hook nil)
(autoload 'fvwm-generic-mode "generic-x" nil t)

;; (find-angg "elisp/tprops.el")
(autoload 'tp-r0-mode "tprops" nil t)
(autoload 'tp-r2-mode "tprops" nil t)

;; (add-to-list 'load-path "~/eev-current") ; do I need these here?
(add-to-list 'load-path "~/elisp/")
;;
;; (find-eev "htmlize-eev.el")
;; (find-eev "htmlize-eev.el" "htmlize-eev-files")
(autoload 'htmlize-eev-files "htmlize-eev" nil t)
(autoload 'htmlize-eev-files-then-quit "htmlize-eev" nil t)




;;;;;
;;
;; «add-to-alist»  (to ".add-to-alist")
;;
;;;;;

;; From:
;; <http://mail.gnu.org/archive/html/bug-gnu-emacs/2001-02/msg00066.html>,
;; <http://lists.gnu.org/archive/html/bug-gnu-emacs/2001-02/msg00066.html>,
;; slightly changed.
;;
;; (setq my-alist '(("1" . "One") ("2" . "Two") ("3". "Three")))
;; (assoc "2" my-alist)
;; my-alist
;; (add-to-alist 'my-alist '("2" . "Dois"))
;; (add-to-alist 'my-alist '("4" . "Quatro"))

;; (find-elnode "Association Lists")
(defun add-to-alist (alist-var elt-cons &optional no-replace)
  "Add to the value of ALIST-VAR an element ELT-CONS if it isn't there yet.
If an element with the same car as the car of ELT-CONS is already present,
replace it with ELT-CONS unless NO-REPLACE is non-nil; if a matching
element is not already present, add ELT-CONS to the front of the alist.
The test for presence of the car of ELT-CONS is done with `equal'."
  (let ((existing-element (assoc (car elt-cons) (symbol-value alist-var))))
    (if existing-element
        (or no-replace
            (rplacd existing-element (cdr elt-cons)))
      (set alist-var (cons elt-cons (symbol-value alist-var)))))
  (symbol-value alist-var))


;; «seen»  (to ".seen")
;; (find-node "(efaq)Debugging a customization file")
;; (find-bgprocess "emacs-default-x --debug-init")
;;
(setq seen)
(defun seen (&optional arg) (interactive)
  (if arg (setq seen (cons arg seen))
    (describe-variable 'seen)))
(defun insert-seen ()
  (interactive)
  (insert (format "(seen %d)\n" (line-number-at-pos))))
(defun saw ()
  (interactive)
  (describe-variable 'seen))

(seen 461)





;;;;;
;;
;; «auto-mode-alist»  (to ".auto-mode-alist")
;;
;;;;;

(add-to-alist 'auto-mode-alist '("\\.icn$" . icon-mode))
(add-to-alist 'auto-mode-alist '("\\.th$" . indented-text-mode))
(add-to-alist 'auto-mode-alist '("\\.st\\'" . smalltalk-mode))
(add-to-alist 'auto-mode-alist '("\\.lua$" . lua-mode))
(add-to-alist 'auto-mode-alist '("\\.fs$" . forth-mode))
(add-to-alist 'auto-mode-alist '("\\.mac$" . maxima-mode))

;; This is for OpenOffice files, but is not working:
;; (add-to-alist 'auto-mode-alist '("\\.sxw$" . archive-mode))




;;;;;
;;
;; «mode-variables»  (to ".mode-variables")
;;
;;;;;

;; (find-elnode "Defining Variables")
;; (find-e20node "Init Examples")

;; For Emacs21 (pre-21.1 at least),
;; where errors on C-x C-e invoke the debugger:
;; (find-efunction 'eval-last-sexp)
;; (find-evariable 'eval-expression-debug-on-error)
(setq eval-expression-debug-on-error nil)

;; And because I don't grok CVS at all:
(setq version-control 'never)

;; Make some things behave as in Emacs20:
;; (find-node "(elisp)The Echo Area" "message-truncate-lines")
;; (find-eevfile "demo/.emacs")
(setq next-line-add-newlines t)
(setq message-truncate-lines t)

;; (find-elnode "Input Modes" "converts characters with the 8th bit")
;; (find-angg ".emacs.local.bsd")
;; (8th-bit-is-meta)
;; (8-bit-clean)
;;
(defun 8th-bit-is-meta () (interactive)
  (set-input-mode (car (current-input-mode)) (nth 1 (current-input-mode)) t))
(defun 8-bit-clean () (interactive)
  (set-input-mode (car (current-input-mode)) (nth 1 (current-input-mode)) 0))

(8-bit-clean)

;; (find-efunction 'mouse-yank-at-click)
(setq mouse-yank-at-point t)

;; (find-elnode "Disabling Commands")
(put 'narrow-to-region 'disabled nil)

;; (find-es "emacs" "C_indentation")
(setq c-indent-level 4
      c-label-offset 2)
;; (find-e20file "progmodes/icon.el")
(setq icon-indent-level 2
      icon-continued-statement-offset 2)
;; (find-e20file "progmodes/tcl-mode.el")
(setq tcl-indent-level 2)
;; (find-e20file "textmodes/tex-mode.el")
(setq tex-open-quote "\""
      tex-close-quote "\""
      tex-default-mode 'latex-mode
      latex-block-names '("align" "align*"))
;; AUCTeX needs separate defs, it seems.
;; (find-es "tex" "auctex")
(setq TeX-open-quote "\""
      TeX-close-quote "\"")
(setq sentence-end-double-space nil)

;; (setq ange-ftp-default-user "edrx")
(setq ange-ftp-default-user "anonymous")
(setq ange-ftp-generate-anonymous-password "edrx@mat.puc-rio.br")

;; «w3m-el»  (to ".w3m-el")
;; (find-es "emacs" "w3")
;; (setq w3-default-homepage (substitute-in-file-name "$HOME/TH/L/index.html"))
;; (setq w3-home-page (substitute-in-file-name "$HOME/TH/L/index.html"))
;; (setq w3-use-terminal-glyphs t)
(setq w3-reuse-buffers 'yes)

;; (find-evardescr 'w3m-key-binding)
(setq w3m-key-binding 'info)
(setq w3m-async-exec nil)

;; «same-window-buffer-names»  (to ".same-window-buffer-names")
;; (find-enode "Force Same Window")
(setq same-window-buffer-names
      (append '("*Help*" "*compilation*" "*Occur*")
	      same-window-buffer-names))

(setq pop-up-windows nil)		; but this disturbs GUD
(setq planner-use-other-window nil)

;; (find-efacedescr 'default)
;; (find-angg ".Xdefaults")
;; (set-face-background face bg)
;; (set-face-foreground face bg)


(seen 667)


;;;;;
;;
;; «emacs-cvs»  (to ".emacs-cvs")
;;
;;;;;

;; See: http://www.emacswiki.org/cgi-bin/wiki/EmacsCvsAndDebian
;; This makes emacs-cvs aware of all the add-on -el packages in my debian box.
;; (find-progoutput "dpkg -l")
;; (find-angg ".zshrc" "emacs-cvs")

;; (find-efile "startup.el")
;; (find-zsh "dmissing debian-startup.el")
;; (find-fline "/usr/share/emacs/site-lisp/debian-startup.el")
;; (find-fline "/etc/emacs22/site-start.d")
;; (find-fline "/etc/emacs21/site-start.d")
;; (find-fline "/etc/emacs/site-start.d/")

(let ((startup-file "/usr/share/emacs/site-lisp/debian-startup.el"))
  (if (and (or (not (fboundp 'debian-startup))
	       (not (boundp  'debian-emacs-flavor)))
	   (file-readable-p startup-file))
      (progn
	(load-file startup-file)
	;; (setq debian-emacs-flavor 'emacs21)
	;; (setq debian-emacs-flavor 'emacs22)
	;; (setq debian-emacs-flavor 'emacs23)
	(setq debian-emacs-flavor
	      (cond ((file-accessible-directory-p
		      "/etc/emacs23/site-start.d/") 'emacs23)
		    ((file-accessible-directory-p
		      "/etc/emacs22/site-start.d/") 'emacs22)))
	(debian-startup debian-emacs-flavor)
	(mapcar '(lambda (f)
		   (and (not (string= (substring f -3) "/.."))
			(file-directory-p f)
			(add-to-list 'load-path f)))
		(directory-files "/usr/share/emacs/site-lisp" t)))))




;; «my-mode»  (to ".my-mode")
;; (find-angg ".emacs.mini" "my-mode")
;; I *think* that minor modes defined later have precedence in the
;; key->action translation; eegud-keys-mode also defines M-s, so let
;; me try to define my-mode before eev-mode and eegud-keys-mode get
;; created...

(setq my-mode-map (make-sparse-keymap))
(define-key my-mode-map "\M-i" 'find-file-this-line)
(define-minor-mode my-mode "Makes the keymap `my-mode-map' active."
  :init-value t :global t)

(define-key my-mode-map (kbd "M-C-<up>")
  (lambda () (interactive) (scroll-down 1)))
(define-key my-mode-map (kbd "M-C-<down>")
  (lambda () (interactive) (scroll-up 1)))

(define-key my-mode-map "\M-o" 'other-window)

;; (find-sh "locate snarf | grep jpg | grep -v xvpics | sort")


(seen 733)




;;;;;
;;
;; «eev»  (to ".eev")
;;
;;;;;

(setq ee-delimiter-hash "\n#*\n")
(setq ee-delimiter-percent "\n%*\n")
(setq ee-anchor-format "«%s»")
(setq eelatex-eevscript "cd $EEVTMPDIR; latex tmp.tex && rexdvi tmp.dvi")

(standard-display-8bit 160 254)

;; (setq debug-on-error t)

;; «eev-block»  (to ".eev-block")
;; (find-eevfile "eev.el" "define-minor-mode eev-mode")
;; (find-eevfile "eev.el" "define-minor-mode eev-mode\n")
(setq eev-mode-lighter nil)

;; Beginning of the eev block:
;; See: (find-eev "eev-rctool" "new_block_emacs")
;;      (find-eev-update-links)
;;
(add-to-list 'load-path "~/eev-current")
(require 'eev2-all)	       ; (find-eev "eev2-all.el")
(eev-mode 1)

(require 'eev-glyphs)          ; (find-eev "eev-glyphs.el")
(require 'eev-compose)         ; (find-eev "eev-compose.el")

;; (find-eev "eev-glyphs.el")
(eev-set-glyph    8 32 'eev-glyph-face-bluebg)
(eev-set-glyph   12 ?L 'eev-glyph-face-yellow-on-red)
(eev-set-glyph   13 ?M 'eev-glyph-face-blue)

;; (find-eev "eev-bounded.el")
;; (find-eev "eev-compose.el")
(define-key eev-mode-map [f3] 'ee-bounded-function)
(define-key eev-mode-map [?\C-,] 'eev-compose-two-keys)     ; X only
(define-key eev-mode-map [?\M-,] 'eev-compose-two-keys)

(defalias      'code-pdftotext      'code-pdf-text)
(defalias 'find-code-pdftotext 'find-code-pdf-text)
(defalias      'code-ps             'code-xpdf)
(defalias 'find-code-ps        'find-code-xpdf)

(require 'eev-channels)        ; (find-eev "eev-channels.el")
(define-key eev-mode-map [f9]   'eechannel-this-line)


;; «fvwm» (to ".fvwm")
;; (find-eev "eev-langs.el" "fvwm")

(defvar ee-file-fvwm "~/.fvwm/ee.fvwm"  "See `eefvwm0'.")

(defun eefvwm (s &optional e) (interactive "r")
  (ee-write-with-nl s e "" "" ee-file-fvwm)
  (format "eefvwm: wrote %s" ee-file-fvwm))
(defun eefvwm0 (s &optional e) (interactive "r")
  (eefvwm s e)
  (find-sh0 "FvwmCommand ee"))

(defun find-fvwm0 (str) (eefvwm str) (find-sh0 "FvwmCommand ee"))







;; (require 'eev-all)      ; (find-eev "eev-all.el")
;; (eev-mode 1)
;;
;; End of the eev block.

'(
;; (find-eev "eev-template.el")
(load "eev-template.el")

;; (find-eevfile "eev2-all.el")
(require 'eev-wrap)	       ; (find-eev "eev-wrap.el")
(require 'eev-blinks)	       ; (find-eev "eev-blinks.el")
(require 'eev-elinks)	       ; (find-eev "eev-elinks.el")
(require 'eev-code)	       ; (find-eev "eev-code.el")
(require 'eev-brxxx)	       ; (find-eev "eev-brxxx.el")
(require 'eev-pdflike)	       ; (find-eev "eev-pdflike.el")
(require 'eev-audiovideo)      ; (find-eev "eev-audiovideo.el")
(require 'eejump)              ; (find-eev "eejump.el")

(require 'eev-eval)            ; (find-eev "eev-eval.el")
(require 'eev-mode)            ; (find-eev "eev-mode.el")

)

;; (eev-mode-map-set)

;; «mplayer-options»  (to ".mplayer-options")
;; (find-eev "eev-audiovideo.el" "find-mplayer")
;; (find-es "fvwm" "fullscreen")
;; (find-es "mplayer" "-zoom")
;; (setq ee-mplayer-options '("-fs"                            "-osdlevel" "2"))
(setq ee-mplayer-options '("-fs" "-title" "mplayer-fullscreen" "-osdlevel" "2"))
(setq ee-mplayer-options '("-fs" "-title" "mplayer-fullscreen" "-osdlevel" "2" "-zoom"))
(setq ee-mplayer-options '("-fs" "-title" "mplayer-fullscreen" "-osdlevel" "2" "-zoom" "-vo" "x11"))
(setq ee-mplayer-options '("-fs" "-title" "mplayer-fullscreen" "-osdlevel" "2" "-zoom" "-vo" "x11" "-sws" "0" "-quiet"))
;; (find-fline "/sda5/videos/")
;; (find-video "/sda5/videos/J_S_Bach_6th_Cello_Suite_transcribed_for_viola_-_Courante-QJjOM7SpbhM.flv")
;; (find-mplayer  "/sda5/videos/Transgender_Love_Story_-_Life_After_Surgery-hRKQJCC_RSM.mp4")
;; (find-mplayer  "/sda5/videos/Transgender_Love_Story_-_Life_After_Surgery-hRKQJCC_RSM.mp4" "1:02")

;; 2013oct03
(setq ee-mplayer-video-options-geometry '("-geometry" "500x400+512+20"))
(setq ee-mplayer-video-options-geometry '("-fs" "-title" "mplayer-fullscreen"))
(setq ee-mplayer-video-options-hardware '("-zoom" "-vo" "x11" "-sws" "0"))
(setq ee-mplayer-video-options-screenshot '("-vf" "screenshot"))
(setq ee-mplayer-video-options-screenshot '())
(setq ee-mplayer-video-options-other    '( "-osdlevel" "2" "-quiet"))
(defun ee-mplayer-video-options ()
  (append
   ee-mplayer-video-options-geometry
   ee-mplayer-video-options-hardware
   ee-mplayer-video-options-screenshot
   ee-mplayer-video-options-other))


(defun find-mplayer0 (&rest rest)
  (let ((ee-mplayer-options
	 '("-fs" "-title" "mplayer-fullscreen" "-osdlevel" "0")))
    (apply 'find-mplayer rest)))


(seen 768)

(autoload 'eev-math-glyphs-edrx "eev-math-glyphs" nil t)
;; (eev-math-glyphs-edrx)
;; (find-eev "eev-math-glyphs.el")

;; «eepitch.el»  (to ".eepitch.el")
;; (load-eepitch)
;; (find-eev "eepitch.el")
;; (defun load-eepitch () (interactive)
;;   (message "%S" (load "~/eev-current/eepitch.el"))
;;   (defun eepitch-shell () (interactive)
;;     (eepitch-de '(shell)))
;;   (defun eepitch-shell2  () (interactive)
;;     (eepitch-de '(shell "*shell 2*"))))

(defun eepitch-shell () (interactive)
  (eepitch-de '(shell)))
(defun eepitch-shell2  () (interactive)
  (eepitch-de '(shell "*shell 2*")))

(code-brurl 'browse-url-firefox
	    :remote 'brm :local 'brml :dired 'brmd)

;; (find-eev "eev-brxxx.el")
(defun find-gimp (fname) (find-bgprocess `("gimp" ,fname)))

(code-brfile 'find-gimp                :local 'brgimpl :dired 'brgimpd)

;; (defun find-chrome (url) (find-bgprocess `("google-chrome" ,url)))
;; (code-brurl  'find-chrome :remote 'brg :local 'brgl    :dired 'brgd)




(seen 798)
;; (load-eepitch)
(seen 800)

(seen 805)


;; (find-efile "mouse.el")
;; (find-evariable 'x-fixed-font-alist "Font menu")



;; «modes-safe-local»  (to ".modes-safe-local")
;; (find-eevfile "htmlize-eev.el" "modes-safe-local")
;; I should use `favourite-modes-allowed', but I'm lazy...
;;
(put 'modes 'safe-local-variable 'listp)

;;-------------------------------------------
;; «favourite-modes»  (to ".favourite-modes")
;; M-m -> `favourite-modes' -> cycle through the list of favourite modes
;;
(defun favourite-modes (arg)
  "Cycle through the list of favourite modes for this buffer."
  (interactive "P")
  (make-local-variable 'favourite-modes)
  (if (not (boundp 'favourite-modes))
      (setq favourite-modes nil))
  (put 'favourite-modes 'permanent-local t)
  (if (and arg (<= arg 0))
      (setq favourite-modes (remove major-mode favourite-modes)))
  (if (null favourite-modes)
      (setq favourite-modes (or modes (list major-mode))))
  (if (and arg (>= arg 1))
      (add-to-list 'favourite-modes major-mode 'append))
  (setq favourite-modes
	(append (cdr favourite-modes) (list (car favourite-modes))))
  (funcall (car favourite-modes))
  (message "favourite-modes = %S" favourite-modes))

(global-set-key "\M-m" 'favourite-modes)

(defun my-normal-mode ()
  "Like `normal-mode', but with a hack to reload the list of favourite modes."
  (interactive)
  ;; (put 'favourite-modes 'permanent-local nil)
  (makunbound 'modes)
  (makunbound 'favourite-modes)
  (normal-mode))

(setq favourite-modes-allowed '(
  fundamental-mode
  emacs-lisp-mode
  lua-mode
  org-mode
  sh-mode
  makefile-mode
  ))

;; Unfinished:
;; (favourite-modes-unkown '(emacs-lisp-mode foo sh-mode))
;; (apply 'or (favourite-modes-unkown '(emacs-lisp-mode foo sh-mode)))
;; (apply 'or '(nil foo nil))
;;
(defun favourite-modes-unkown (ml)
  (let* ((f (lambda (m) (if (member m favourite-modes-allowed) nil m)))
	 (mlu (mapcar f ml)))
    mlu))



(seen 820)


(put 'ee-charset-indicator 'safe-local-variable 'stringp) ;; obsolete

(seen 980)


;; «woman»  (to ".woman")
;; (find-efunction 'woman-dired-find-file)
;; (find-ekeymapdescr dired-mode-map "woman-dired-find-file")
;; (find-efile "woman.el")
(setq woman-use-own-frame nil)
;;
;; (find-womannode "Introduction")
(seen 993)

(code-c-d "woman" (ee-efile "") "woman")

(seen 997)


;; Hey, shouldn't this be an "eval-after-load"?
;; (find-egrep "grep -nH -e woman-dired-find-file $(find * -name '*.el')")
' (add-hook 'dired-mode-hook
	    (lambda ()
	      (define-key dired-mode-map "W" 'woman-dired-find-file)))


(seen 993)


;; «find-woman»  (to ".find-woman")
;; (woman-find-file (ee-fvwmfile "fvwm/fvwm.1"))
;; (find-woman (ee-fvwmfile "fvwm/fvwm.1"))
;; (find-woman (ee-fvwmfile "fvwm/fvwm.1") "ModulePath path")
;; (find-woman (ee-fvwmfile "fvwm/fvwm.1") "FVWM_MODULEDIR")
;; (find-womanfile "")

(defun find-woman0 (manfile &rest rest)
  (woman-find-file manfile)
  (apply 'ee-goto-position rest))

(defun ee-code-c-d-:woman (&rest rest)
 (concat (ee-template0 "
   (defun find-{c}woman (manfile &rest pos-spec-list)
     (apply 'find-woman0 (ee-{c}file manfile) pos-spec-list))
   ") (ee-code-c-d-rest rest)))

;; (find-evariable 'code-c-d-keywords-new)
;; (add-to-alist 'code-c-d-keywords-new '(:woman . ee-code-c-d-:woman))

(defun ee-code-c-d-:ffox (&rest rest)
 (concat (ee-template0 "
   (defun find-{c}ffox (semiurl &rest pos-spec-list)
     (find-firefox (ee-{c}url semiurl)))
   ") (ee-code-c-d-rest rest)))

;; (find-evariable 'code-c-d-keywords-new)
;; (add-to-alist 'code-c-d-keywords-new '(:ffox . ee-code-c-d-:ffox))

(seen 1039)



;; «square-brackets»  (to ".square-brackets")
;; Square brackets (rubikitch)
;; (find-eoutput '(insert 300006 300007))
;; (find-eoutput '(insert 300006 300007) "" '(switch-to-buffer (htmlize-buffer)))
;; (find-eoutput '(insert 332731 332736))
;; (find-eoutput '(insert 332731 332736) "" '(switch-to-buffer (htmlize-buffer)))
;; (find-eleimfile "quail/sgml-input.el")
;; (find-eleimfile "quail/latin-ltx.el")
;; (find-eleimfile "quail/latin-ltx.el" "llbracket")
;; (find-echarsetchars 'mule-unicode-0100-24ff)
;; (find-echarsetchars 'mule-unicode-2500-33ff "276x")
(when (eq window-system 'x)
  (eev-set-glyph ?\^Q 300006 'eev-glyph-face-green)
  (eev-set-glyph ?\^P 300007 'eev-glyph-face-green)
  (when (fboundp 'make-glyph-code)
    (eev-set-glyph ?\^Q 10214 'eev-glyph-face-green)
    (eev-set-glyph ?\^P 10215 'eev-glyph-face-green)))

;; (eev-set-glyph ?\^Q nil)
;; (eev-set-glyph ?\^P nil)
;; (find-es "blogme" "square-brackets")



;; «M-e-in-c-mode»  (to ".M-e-in-c-mode")
;; (find-es "emacs" "c-mode-M-e")

;; `eev-invasive' binds M-e to `ee-eval-sexp-eol' and I want eev's
;; binding to be universal. C-mode will try to set M-e to
;; `c-end-of-statement'; don't let that override my binding.
;;
;;(eval-after-load "cc-mode"
;;  '(define-key c-mode-base-map "\ee" nil))





;; «find-w3m» (to ".find-w3m")
;; (find-eevgrep "grep -nH -e find-w3m *.el")
;; (find-eev "eev.el" "find-w3m")
;; (find-eev "eev-blinks.el" "find-w3m")

;; «dired-find-w3m»  (to ".dired-find-w3m")
;; «dired-find-planner»  (to ".dired-find-planner")

;; Add a binding "w" -> `dired-find-w3m' to dired
(defun dired-find-w3m () (interactive)
  "In dired, visit (with find-w3m) the file named on this line."
  (find-w3m (file-name-sans-versions (dired-get-filename) t)))
(defun dired-find-planner () (interactive)
  "In dired, visit (with find-planner) the file named on this line."
  (find-planner (dired-get-filename 'localp)))
;; (defun dired-find-eimage () (interactive)
;;   "In dired, visit (with find-image) the file named on this line."
;;   (find-eimage (file-name-sans-versions (dired-get-filename) t)))

(eval-after-load "dired"
  '(progn (define-key dired-mode-map "w" 'dired-find-w3m)
	  (define-key dired-mode-map "W" 'woman-dired-find-file)
	  ;; (define-key dired-mode-map "\M-p" 'dired-find-planner)
	  ;; (define-key dired-mode-map "I" 'dired-find-eimage)
	  ))

;; (find-evardescr 'dired-load-hook)
;; (find-efile "wdired.el")
(autoload 'wdired-change-to-wdired-mode "wdired")
(add-hook 'dired-load-hook
          '(lambda ()
             (define-key dired-mode-map "r" 'wdired-change-to-wdired-mode)
             (define-key dired-mode-map
               [menu-bar immediate wdired-change-to-wdired-mode]
               '("Edit File Names" . wdired-change-to-wdired-mode))))


(seen 1109)



;; «ee-isearch»  (to ".ee-isearch")
;; (find-es "emacs" "ee-isearch-regexp")
;; (find-es "emacs" "ee-isearch")
(defun ee-isearch (string &optional isregexp)
  (isearch-update-ring string isregexp)
  (isearch-mode t isregexp nil nil)
  (isearch-repeat-forward))
(defun ee-isearch-regexp (string) (ee-isearch string t))
(defun ee-isearch-re     (string) (ee-isearch string t))

;; «ee-to-protected»  (to ".ee-to-protected")
;; (defun ee-to-protected (anchor &rest rest)
;;   (interactive "sAnchor: ")
;;   (let ((beforejump (point)))
;;     (goto-char (point-min))
;;     (if (search-forward (format ee-anchor-format anchor) nil 'noerror)
;;        (ee-goto-rest rest)
;;         (goto-char beforejump)
;;         (error "Anchor not found"))))

;; (defalias 'to 'ee-to-protected)

;; «to-shadow»  (to ".to-shadow")
(defun to-shadow (&rest rest)
  (interactive "sAnchor: ")
  (apply 'find-anchor ee-shadow-file rest))

;; «find-fline-ov»  (to ".find-fline-ov")
;; Links to text files with ^H-underlining and overstriking
;; (find-efile "man.el" "defun Man-fontify-manpage")
(defun find-fline-ov (fname &rest pos-spec-list)
  (find-file (ee-substitute-in-file-name fname))
  (Man-fontify-manpage)
  (apply 'ee-goto-position pos-spec-list))





;;-------------------------------
;; «find-dict»  (to ".find-dict")
;; Never worked very well.
;; (find-elnode "Syntax Tables")
;; (find-elnode "Motion and Syntax")
;; (find-elnode "Syntax Table Functions")
;; (find-efile "emacs-lisp/lisp-mode.el" "defvar emacs-lisp-mode-syntax-table")
;; (describe-function 'modify-syntax-entry)
;; (find-elnode "Using Interactive")
;; (find-efile "calendar/cal-move.el" "(interactive (list (calendar-read-date")
;; (find-efile "calendar/calendar.el" "(defun calendar-read")
;;   cd /usr/share/emacs/21.2/lisp/
;;   grep '(interactive ' $(find * -name '*.el' | sort) | l -S
;;
(setq ee-dict-syntax-table
  (let ((table (make-syntax-table))
	(i))
    (setq i ?A)
    (while (< i ?Z)
      (modify-syntax-entry i "w   " table)
      (setq i (1+ i)))
    (setq i ?a)
    (while (< i ?z)
      (modify-syntax-entry i "w   " table)
      (setq i (1+ i)))
    (modify-syntax-entry ?- "_   " table)
    table))

(defun ee-dict-word-around-point () (interactive)
  (with-syntax-table ee-dict-syntax-table
    (message
     (let ((p1 (save-excursion (skip-syntax-backward "w_") (point)))
	   (p2 (save-excursion (skip-syntax-forward "w_") (point))))
       (buffer-substring p1 p2)))))

;; (find-man "dict")
;; (find-eev "eev-links.el" "find-progoutput")
;; (find-progoutput "dict -P- stand-up" 0)
;; (find-dict "stand-up")
;;
(defun find-dict (word)
  (interactive (let ((word (ee-dict-word-around-point)))
		 (list (read-string (if (equal word "") "Word: "
				      (format "Word: (default %s) " word))
				    word))))
  (find-progoutput (format "dict -P - %s" word) 0))

;; (global-set-key "\M-D" 'find-dict)




(seen 1204)


;;-------------------------------------------
;; «passwds-tcl-get»  (to ".passwds-tcl-get")
;; (find-anggfile ".passwds.tcl-")
;; (find-anggfile ".passwds.tcl")
;; (passwds-tcl-get "bitlbee")
(defun passwds-tcl-get (str)
  (find-sh0 (format "grep %s ~/.passwds.tcl | awk '{print $3}'" str)))

;; «eechannel-send-passwd»  (to ".eechannel-send-passwd")
(defun eechannel-send-passwd (machine)
  (eechannel-send nil (format "%s\n" (passwds-tcl-get machine))))



;;-------------------
;; «erc»  (to ".erc")
;; (find-es "emacs" "erc")
;; (find-es "emacs" "rcirc")

(defun to-erc () (interactive) (find-es "emacs" "erc"))

;; (find-fline "~/usrc/erc/")
;; (add-to-list 'load-path "~/usrc/erc/")
(add-to-list 'load-path "~/usrc/erc-5.0/")

;; http://www.emacswiki.org/cgi-bin/wiki/ErcCvsFeatures
(setq erc-nick "edrx"
      erc-user-full-name "Eduardo Ochs <http://angg.twu.net/>"
      erc-prompt-for-password nil
      erc-send-whitespace-lines t
      erc-auto-query t
      )

;; (setq erc-autojoin-channels-alist
;;       '(("freenode.net"
;; 	    "#emacs"
;; 	    "#debian-br"
;; 	    )))

(defun erc-freenode ()
  (interactive)
  (erc-select :server "irc.freenode.net" :port 6667))

(defun erc-bitlbee ()
  (interactive)
  (erc-select :server "im.bitlbee.org" :port 6667))

;; Btw, my uin is 250604577,
;; my jabber id is edrx@jabber.org
;; my MSN is eduardoochs@hotmail.com

;; Currently this doesn't work due to an erc bug
(defun erc-freenode2 ()
  (interactive)
  (erc-select :nick '("edrx" "edrx2" "edrx3")
	      :server "irc.freenode.net" :port 6667))

;; «erc-freenode-join»  (to ".erc-freenode-join")
;; (to "rcirc")
;;
' (progn
    (freenode-join "#emacs")
    (freenode-join "#emacs-br")
    (freenode-join "#eev")
    ;; (freenode-join "#fvwm")
    ;; (freenode-join "#lua")
    ;; (freenode-join "#debian")
    (freenode-join "#debian-br")
    (freenode-join "#debian-rj")
    ;; (freenode-join "#debian-br-cdd")
    ;; (freenode-join "#squeak")
    ;; (freenode-join "#gnu-smalltalk")
    ;; (freenode-join "#gimp")
    ;; (freenode-join "#uclibc")	; discussions on busybox
    ;; (freenode-join "#concatenative")	; Forth, etc
    ;; (freenode-join "Txt2tags")
    )
;;
(defun erc-steps ()
  "Load the steps to connect to freenode and bitlbee."
  (interactive)
  (find-efunction 'erc-steps)		; show this function
  (message "%S"
    (eesteps '((erc-freenode)
	       (erc-freenode-join)
	       (eek "M-e")
	       (erc-bitlbee)
	       ;; (eek0 "identify xxx\r")
	       (eek0 (format "identify %s\r" (passwds-tcl-get "bitlbee")))
	       ))))
;;
(defun erc-freenode-join () (interactive)
  (find-angg ".emacs" "erc-freenode-join" "  )"))

(defun freenode-join (channelname)
  (with-current-buffer "irc.freenode.net:6667"
    (insert (concat "/join " channelname))
    (call-interactively (key-binding "\r"))))
;;
(defun freenode-join (channelname)
  (with-current-buffer "irc.freenode.net:6667"
    (erc-cmd-JOIN channelname)))
;;
(defun find-freenode-channel (channel &rest lines)
  (freenode-join channel)
  (if lines (kill-new (mapconcat 'identity lines "\n"))))

;; A test:
;; (find-freenode-channel "#gimp" "/msg Wilber alpha")
;; (find-freenode-channel "#emacs" "/msg fsbot erc?")



;; «ee-send-to-erc-channel»  (to ".ee-send-to-erc-channel")
;; «find-fsbot-answer»  (to ".find-fsbot-answer")
;;
(defun ee-send-to-erc-channel (channel line)
  (if (not (get-buffer channel))
      (error "There's no buffer called \"%s\"" channel))
  (if (not (eq 'erc-mode (with-current-buffer channel major-mode)))
      (error "The buffer \"%s\" is not an ERC buffer"))
  (switch-to-buffer channel)
  (goto-char (point-max))
  (insert line)
  (erc-send-current-line))
;;
(defun find-fsbot-answer (question)
  (interactive "sQuestion: ")
  (ee-send-to-erc-channel "fsbot" question))
;;
(defun find-apt-br-answer (question)
  (interactive "sQuestion: ")
  (ee-send-to-erc-channel "apt-br" question))
;;
(defun find-dpkg-answer (question)
  (interactive "sQuestion: ")
  (ee-send-to-erc-channel "dpkg" question))
;;
(defun find-apt-answer (question)
  (interactive "sQuestion: ")
  (ee-send-to-erc-channel "dpkg" question))
;;
;; Example: (find-fsbot-answer "conkeror?")
;; Example: (find-apt-br-answer "jahnke?")
;; Example: (find-dpkg-answer "udeb")
;; Example: (find-apt-answer "nodm?")
;;   (eev "echo false > /etc/X11/default-display-manager")


;; (find-efunction 'erc-part-from-channel)
;; (defun erc-my-part-from-channel () (interactive)
;;   (erc-part-from-channel "->http://angg.twu.net/"))

(defun switch-to-irc ()
  "Switch to an IRC buffer, or run `erc-select'.
    When called repeatedly, cycle through the buffers."
  (interactive)
  (let ((buffers (and (fboundp 'erc-buffer-list) (erc-buffer-list))))
 (when (eq (current-buffer) (car buffers))
   (bury-buffer)
   (setq buffers (cdr buffers)))
        (if buffers
            (switch-to-buffer (car buffers))
          (erc-select))))

;; (defvar erc-next-modified-buffer-none nil)
;; (defun  erc-next-modified-buffer () (interactive)
;;     (if (not (eq major-mode 'erc-mode))
;;       (setq erc-next-modified-buffer-none (current-buffer)))
;;   (if erc-modified-channels-alist
;;       (switch-to-buffer (car (car erc-modified-channels-alist)))
;;     (switch-to-buffer erc-next-modified-buffer-none)))
;;
;; (global-set-key [f2] 'erc-next-modified-buffer)

;; http://www.emacswiki.org/cgi-bin/wiki?ErcChannelTracking
;;
;; (global-set-key [f2] 'erc-track-switch-buffer)
;; (global-set-key [f14] 'switch-to-irc)




;;;;;
;;
;; «browse-url»  (to ".browse-url")
;;
;;;;;


;;;;;
;;
;; «brwl-and-friends»  (to ".brwl-and-friends")
;;
;;;;;

(defun eepsne (url &rest ignore)
  (interactive (browse-url-interactive-arg "psne "))
  (eev (format "psne '%s'" url)))

(defun eetmpwget (url &rest ignore)
  (interactive (browse-url-interactive-arg "cd /tmp; wget "))
  (eev (concat "cd /tmp\nwget " url)))

;; (brml "http://www.emacswiki.org/cgi-bin/wiki/PlannerModeQuickStart")
;; http://www.emacswiki.org/cgi-bin/wiki/PlannerModeQuickStart

;; «find-ie»  (to ".find-ie")
;; «brie»  (to ".brie")
;; (find-angg ".emacs")
;; (find-angg ".emacs" "brwl-and-friends")

(autoload 'browse-url-default-windows-browser "browse-url")

(defun find-ie (url &rest ignore)
  (interactive (browse-url-interactive-arg "URL: "))
  (browse-url-default-windows-browser url))

(defalias 'brie 'find-ie)

;; For W$:
;; (defalias 'brw  'find-ie)
;; (defalias 'find-w3m 'find-ie)

;; (my-def-browse-url-local-remote briel brie find-ie)

;; 2006jul14
;; «brmd»  (to ".brmd")
;; «brgvd»  (to ".brgvd")
;; find-pspage-gv find-pspage-xdvi
;; (find-rubymanualfile "")

;; «find-firefox-bg»  (to ".find-firefox-bg")
(defun find-firefox-bg (url &optional rest)
  (interactive "sURL: ")
  (start-process "firefox" "*Messages*" "firefox" url)
  url)

(defun find-firefox (url &optional rest)
  (interactive "sURL: ")
  (start-process "firefox" "*Messages*" "firefox" url)
  url)


;; (find-eev "eev-browse-url.el")
;; (require 'eev-browse-url)







;;;;;
;;
;; «syntax-tables»  (to ".syntax-tables")
;;
;;;;;

;; This is because picture-mode-exit in Emacs21 was mutilating files
;; with glyph chars in the ranges 1..7, 11, 14..31, 128..159.

;; (find-es "emacs" "trailing-whitespace-bug")

(defun fix-syntax-table-low (sdescr &optional table) (interactive)
  (mapcar (lambda (i) (modify-syntax-entry i sdescr table))
	  '(1 2 3 4 5 6 7
	    11 12
	    14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31)))

(defun fix-syntax-table-high (sdescr &optional table) (interactive)
  (let ((i 128))
    (while (< i 160)
      (modify-syntax-entry i sdescr table)
      (setq i (1+ i)))))

(defun fix-syntax-table (sdescr &optional table) (interactive)
  (fix-syntax-table-low  sdescr table)
  (fix-syntax-table-high sdescr table))

(fix-syntax-table-low "w" (standard-syntax-table))
(fix-syntax-table-low "w" text-mode-syntax-table)
(fix-syntax-table-low "w" emacs-lisp-mode-syntax-table)

;; (fix-syntax-table "w" (standard-syntax-table))
;; (fix-syntax-table "w" text-mode-syntax-table)
;; (fix-syntax-table "w" emacs-lisp-mode-syntax-table)

;; (with-syntax-table (standard-syntax-table)      (describe-syntax))
;; (with-syntax-table text-mode-syntax-table       (describe-syntax))
;; (with-syntax-table emacs-lisp-mode-syntax-table (describe-syntax))




;; «noerr»  (to ".noerr")
;; (find-es "emacs" "ignoring_errors")
;; (find-efunction 'ignore-errors)
(defmacro noerr     (body) (list 'condition-case nil body '(error nil)))


;;;;;
;;;;; «debugging»
;;;;;

;; SAR: "show and run" - an ugly macro.
;; These two sexps will behave the same,
;;       (+ (* 2 3) (* 4 5))
;;   (SAR + (* 2 3) (* 4 5))
;; except that the second will do a `(message "(+ 6 20)")' before
;; executing `(+ 6 20)'.
;; (find-es "emacs" "SAR")
;;
(defmacro SAR (&rest rest)
  (insert (format "%S\n" rest))
  rest)

(defmacro SHOWCALL (head &rest rest)
  (let ((expandedrest (eval (cons 'list rest))))
    (message "%S" (cons head expandedrest))
    ))

;; (SAR + (+ 1 2) (+ 3 4))
;;     (+ (+ 1 2) (+ 3 4))
;; (SAR describe-function 'next-line)
;;     (describe-function 'next-line)
;; (switch-to-buffer "*Messages*")







;; Basic `code-c-d's
;; «code-c-d_e»  (to ".code-c-d_e")
'(

(setq ee-emacs-lisp-directory
  (or (file-name-directory (locate-library "loadup.el"))
      (format "/usr/share/emacs/%d.%d/lisp/"
	      emacs-major-version emacs-minor-version)))

;; (find-fline ee-emacs-lisp-directory)
(code-c-d "e" ee-emacs-lisp-directory "emacs")
(code-c-d "el" ee-emacs-lisp-directory "elisp")
(code-c-d "eli" ee-emacs-lisp-directory "emacs-lisp-intro")

(setq ee-emacs-leim-directory
      (if (locate-library "leim-list.el")
	  (file-name-directory (locate-library "leim-list.el"))
	(format "/usr/share/emacs/%d.%d/leim/"
		emacs-major-version emacs-minor-version)))

(code-c-d "eleim" ee-emacs-leim-directory)
;; (find-eleimfile "")
;; (find-eleimfile "quail/")

)

(code-c-d "calc" (concat ee-emacs-lisp-directory "calc/") "calc")

;; (code-c-d-anchor "eevold"    "~/eev/")
;; (code-c-d-anchor "eevnew"    "~/eev-current/")
(code-c-d "eev"      "~/eev-current/" :anchor)

;; (code-c-d-old "eevslides" "~/eev-current/slides/" :gv)
(code-c-d "angg"      "~/" :anchor :grep)

(code-c-d "es" "$ES/")
(defun find-es (file &rest rest)
  "A hyperlink function that points to anchor strings in e-script files."
  (apply 'find-anchor (ee-esfile (concat file ".e")) rest))

(code-c-d "dednat4" "~/dednat4/" :anchor)
(code-c-d "dn4"     "~/dednat4/" :anchor)
(code-c-d "dn4ex"   "~/dednat4/examples/" :anchor)
(code-c-d "vtutil4" "~/vtutil4/" :anchor)


(defun find-flua (fname &optional anchor)
  (find-anchor (ee-fluafile fname) anchor))
(defun find-miniforth (fname &optional anchor)
  (find-anchor (ee-miniforthfile fname) anchor))




;; (find-status "eev")
;; (find-vldifile "eev.list")
;; (find-fline "/usr/doc/eev/")
;; (find-fline "/etc/emacs/site-start.d/50eev.el")
;; (find-sitelispfile "eev/")
;; (add-to-list 'load-path "/usr/share/emacs/site-lisp/")
;;
;; (find-eevfile "debian/50eev.el")
;; (find-eevfile "")

;; (if (equal (getenv "TERM") "linux")
;;   (glyphs-set-string disptable-string-latin
;; 		     ?\^O 131 "31" ; small red square (instead of "*")
;; 		     ))



;; (find-node "(elisp)Handling Errors")
;; (condition-case nil <code that may contain errors>)



;; «tramp» (to ".tramp")
;; (find-es "emacs" "tramp")
;; (find-es "emacs" "tramp-from-git")
;; (find-elnode "Library Search")
;;(add-to-list 'load-path "/usr/src/tramp/lisp")
;;(require 'tramp)
;;(add-to-list 'Info-default-directory-list "/usr/src/tramp/texi/")
;; (find-angg ".zshrc" "ASROOT")

(setenv   "ASROOT" "/sudo:root@localhost:")
(code-c-d "asroot" "/sudo:root@localhost:")
;; (find-asrootfile "/var/log/")
;; (find-asrootfile "/var/log/" "auth.log")
;; (find-fline "/sudo::/")



;;;;;
;;
;; «remote-machines»  (to ".remote-machines")
;;
;;;;;

;; eev to some remote machines, using ange-ftp or other tricks:
;; (find-enode "Remote Files")

(defun eevpuc (s &optional e) (interactive "r")
  (eev "Scp $EEVTMPDIR/ee-puc.sh edrx@${SUCURI}:eev-0.94/ee.sh")
  (eev s e "$EEVTMPDIR/ee-puc.sh")
  "Wrote $EEVTMPDIR/ee-puc.sh and $EE; run `ee' to upload")

;; (eeb-define 'eevpuc-bounded 'eevpuc 'ee-delimiter-hash nil t t)

;; Old, probably broken
;; (code-c-d "twur" "/angg.twu.net:/")
;; (code-c-d "twu" "/angg.twu.net:/home2/edrx/")
(code-c-d "twu" "/angg.twu.net:")
(defun eevt (s e) (interactive "r")
  (eev s e (ee-twufile "bin/ee.sh")))

;; «tramp-twu»  (to ".tramp-twu")
;; (find-angg ".zshrc" "TWUS-and-TWUP")
;; (code-c-d "twu"  "/ftp:edrx@angg.twu.net:")
;; (code-c-d "twup" "/ftp:edrx@angg.twu.net:public_html/")
;; (code-c-d "twu"  "/scp:edrx@angg.twu.net:")
;; (code-c-d "twup" "/scp:edrx@angg.twu.net:public_html/")
(code-c-d "twu"  "/scp:edrx@angg.twu.net:/home/edrx/")
(code-c-d "twup" "/scp:edrx@angg.twu.net:/home/edrx/public_html/")
(code-c-d "twus" "/scp:edrx@angg.twu.net:/home/edrx/slow_html/")
;; (find-twufile "")
;; (find-twupfile "")
;; (find-twupfile "tmp/")
;; (find-twusfile "")

;; (getenv "MYPAGEDIR")
;; (getenv "MYPAGEURL")
(setenv "MYPAGEDIR" "/scp:edrx@angg.twu.net:public_html")
(setenv "MYPAGEURL"    "http://angg.twu.net")



;; «upload-changes»  (to ".upload-changes")
(defun upload-changes () (interactive) (find-es "page" "upload-rsync"))

;; (ee-expand "~")
;; (ee-remove-prefix "/home/foo/" "/home/foo/bar")
;;
(defun ee-remove-prefix (prefix str)
  (and (<= (length prefix) (length str))
       (equal prefix (substring str 0 (length prefix)))
       (substring str (length prefix))))

(defun angg-url-of-this-file (&optional arg)
  (interactive "P")
  (let* ((anchor (if arg (eeb-string "«" "»")))
	 (suffix (if anchor (concat "#" anchor) ""))
	 (fname (ee-remove-prefix (ee-expand "~/")
				  (ee-expand (buffer-file-name))))
	 (url (concat "http://angg.twu.net/" fname ".html" suffix)))
    (kill-new url)
    (message url)))

(defun ee-dired-file-name ()
  (if (eq major-mode 'dired-mode)
      (file-name-sans-versions (dired-get-filename) t)))

(defun find-urls-for-this-file (&optional bfname)
  (interactive)
  (setq bfname (or bfname (ee-dired-file-name) buffer-file-name
		   default-directory))
  (let* ((myip (myip-as-string))
	 (stem-home  (ee-remove-prefix "/home/edrx/" bfname))
	 (stem-homeL (ee-remove-prefix "/home/edrx/TH/L/" bfname))
	 (stem-vw    (ee-remove-prefix "/var/www/" bfname)))
    (find-elinks-old
     (list ;; (list '(find-efunction 'find-urls-for-this-file))
           (if stem-home
	       (list (format "http://%s/L/%s"         myip stem-home)
		     (format "http://%s/L/%s.html"    myip stem-home)
		     (format "http://persephone/L/%s"      stem-home)
		     (format "http://persephone/L/%s.html" stem-home)
		     (format "http://angg.twu.net/%s"      stem-home)
		     (format "http://angg.twu.net/%s.html" stem-home)))
	   (if stem-homeL
	       (list (format "http://%s/L/%s"         myip stem-homeL)
		     (format "http://%s/L/%s.html"    myip stem-homeL)
		     (format "http://angg.twu.net/%s"      stem-homeL)
		     (format "http://angg.twu.net/%s.html" stem-homeL)))
	   (if stem-vw
	       (list (format "http://persephone/%s"      stem-vw)
		     (format "http://persephone/%s.html" stem-vw)
		     (format "http://%s/%s"         myip stem-vw)
		     (format "http://%s/%s.html"    myip stem-vw)))
	   bfname
	   ))))

(define-key eev-mode-map "\M-h\M-u" 'find-urls-for-this-file)

;; (defun ee-upload-this-scp-command ())



;; «upload-this»  (to ".upload-this")
;;
(defun ee-strip-prefix-and-suffix (prefix suffix str)
  (let* ((p1 (length prefix))
	 (p2 (- (length str) (length suffix)))
	 (prefix-ok (compare-strings str nil p1 prefix nil nil))
	 (suffix-ok (compare-strings str p2 nil suffix nil nil))
	 (middlestuff (substring str p1 p2)))
    (if (and prefix-ok suffix-ok) middlestuff)))

;; Old, probably broken
(defun upload-this () (interactive)
  (let ((fname-stem (ee-strip-prefix-and-suffix
		     (ee-expand "$HOME/") ""
		     buffer-file-name)))
    (save-buffer)
    (eev (format
	  "cat > ~/eev/ee-rmt.sh <<'---'
cd ~/public_html/; make -f TH/Makefile htmls
---
cd; anonftp angg.twu.net 'put %s public_html/%s' \\
  'put eev/ee-rmt.sh eev/ee.sh' 'quit'"
	  fname-stem fname-stem))
    (message "Do `ee' here and on twu to update http://angg.twu.net/%s.html"
	     fname-stem)))




;;
(defun TODO () (interactive) (find-fline "~/TODO"))
(defun tele () (interactive) (find-fline "~/AGENDA/telefones"))
;; (find-evariable 'completion-ignored-extensions)
;; (find-elnode "File Name Completion")
(defun psne-log () (interactive) (find-fline "~/.psne.log"))
(defun plog-log () (interactive) (find-fline "~/.plog"))



;; Links to sections of huge manpages and info nodes
(defun find-expcommand (str &rest rest)
  (interactive "sExpect command: ")
  (apply 'find-man "1 expect" "\nCOMMANDS"
	 (format "\n       %s" str) rest))

;; (find-es "netbsd" "netbsd-manpages")
;; (find-angg "bin/netbsdman")
;; (find-netbsdman "ktrace")
;; (find-man       "ktrace")
;;
(defun find-netbsdman (&rest rest)
  (let ((manual-program "netbsdman")) (apply 'find-man rest)))


(defun find-zshbuiltin (name &rest rest)
  (interactive "sZsh builtin: ")
  (apply 'find-zshnode "Shell Builtin Commands" (format "\n%s" name) rest))

(defun find-zshcomplex (name &rest rest)
  (interactive "sZsh complex command: ")
  (apply 'find-zshnode "Complex Commands" (format "\n%s" name) rest))

(defun find-tcshbuiltin (str &rest rest)
  (interactive "sTcsh builtin: ")
  (apply 'find-man "1 tcsh" "\n   Builtin commands"
         (format "\n       %s" str) rest))




;; «mkto»  (to ".mkto")
;; (find-es "emacs" "mkto")

;; (defun mkto () (interactive)
;;   (let (beg end) (end-of-line) (setq end (point))
;;        (beginning-of-line) (setq beg (point))
;;        (save-restriction
;;          (narrow-to-region beg end)
;;          (replace-regexp "^\\(.+ \\)«\\([!-~]+\\)»$"
;;                          "# «.\\2»\t(to \"\\2\")\n\\\&  (to \".\\2\")"))
;;        (beginning-of-line)))

(defun ee-replace-line (fun)
  (let* ((line (buffer-substring (ee-bol) (ee-eol)))
	 (new (funcall fun line)))
    (if new (progn (delete-region (ee-bol) (ee-eol))
		   (insert new)))
    (beginning-of-line)
    (forward-line 1)))

(defun ee-replace-line-2 (from-pat to-pat)
  (ee-replace-line
   `(lambda (str) (replace-regexp-in-string
		   ,from-pat ,to-pat
		   str 'fixedcase))))

(defun mkto () (interactive)
  (ee-replace-line-2 "^\\(.+ \\)<\\([!-~]+\\)>$"
		     (concat "\\1«.\\2»\t(to \"\\2\")\n"
			     "\\1«\\2»  (to \".\\2\")")))



(setq mkto-pattern     "^\\(.+ \\)«\\([!-~]+\\)»$")
(setq mkto-pattern     "^\\(.+ \\)<\\([!-~]+\\)>$")
(setq mkto-replacement "\\1«.\\2»\t(to \"\\2\")\n\\&  (to \".\\2\")")
(setq mkto-replacement "\\1«.\\2»\t(to \"\\2\")\n\\1«\\2»  (to \".\\2\")")

;; (find-es "emacs" "emacs-cvs-mkto-bug")
;; (setq mkto-pattern (string-to-multibyte mkto-pattern))

(defun mkto () (interactive)
  (ee-replace-line
   (lambda (str)
     (replace-regexp-in-string
      mkto-pattern mkto-replacement
      str
      'fixedcase))))

;; «mksec»  (to ".mksec")
;; (find-efunction 'mkto)
(defun mksec () (interactive)
  (ee-replace-line
   (lambda (str)
     (replace-regexp-in-string
      "^\\(.*\\)«\\([!-~]+\\)»\\(.*\\)$"
      " # «.\\2»\t(to \"\\2\")\n\\1«\\2»  (to \".\\2\")"
      str 'fixedcase))))



(seen 1943)



;;;;;
;;;;; «code-c-ds»  (to ".code-c-ds")
;;;;; A horde of "code-c-d"s, some new, some old.
;;;;;

; (find-angg "eev.el" "code-c-d-explan1")
; (find-angg "eev.el" "code-c-d-explan2")
;
; TeX:
;(code-c-d "texmfsrcgen" "/usr/share/texmf/source/generic/")
;(code-c-d "texmftexgen" "/usr/share/texmf/tex/generic/")
;(code-c-d "xypic" "/usr/share/texmf/source/generic/xypic/src/")
;(code-c-d "xy36" "/usr/src/xy-3.6/src/")
;(code-c-d "web2c" "/usr/src/teTeX-0.9/texk/web2c/")
(code-c-d "knuth" "$SCTAN/systems/knuth/")
(code-c-d "amslmath" "/usr/share/texmf-tetex/source/latex/amslatex/math/")
(code-c-d "amslmath" "/usr/share/doc/texlive-doc/latex/amsmath/")
;; (code-c-d "plainsrc" "/usr/share/texmf-tetex/tex/plain/base/")
;; (code-c-d "lsrc"     "/usr/share/texmf-tetex/source/latex/")
(code-c-d "lsrc"     "/usr/share/texmf-texlive/tex/latex/")
(code-c-d "plainsrc" "/usr/share/texmf-texlive/tex/plain/base/")
;(code-c-d "mp" "/usr/lib/texmf/texmf/doc/metapost/")
;(code-c-d "pst" "$SCTAN/graphics/pstricks/")
;(code-c-d "pt" "/snarf/ftp/ftp.dcs.qmw.ac.uk/pub/tex/contrib/pt/")
;(code-c-d "amsl" "/usr/lib/texmf/doc/ams/amslatex/")
;(code-c-d "lsh" "/usr/lib/texmf/source/latex/lshort/")
;(code-c-d "lgui" "/usr/lib/texmf/source/latex/guide/")
;(code-c-d "xfig" "/usr/src/redhat/BUILD/xfig.3.1.4/")
;(code-c-d "xdvi" "/usr/src/redhat/BUILD/xdvi-21/")
;(code-c-d "th" "/dl/tex/texhax/")
;(code-c-d "lily" "/usr/src/lilypond-1.0.19.uu3/")
;(code-c-d "l" "~/LATEX/")
;(code-c-d "diagxy" "$usr_src/diagxy/")
(code-c-d  "diagxy" "~/usrc/diagxy/")
(code-xdvi "diagxy" "~/usrc/diaxydoc.dvi")
;
; PostScript:
;(code-c-d "gs5" "/usr/src/gs-5.10/")
;(code-c-d "gs" "/usr/src/gs-6.53/")
;(code-c-d "gv" "/usr/src/gv-3.5.8/")
;(code-c-d "gsshare" "/usr/share/gs/6.53/")
;(code-c-d "psfirstg" "/hda6/snarf/http/www.cs.indiana.edu/docproject/programming/postscript/")
;
; net / browsers:
;(code-c-d "wg" "/usr/src/wget-1.5.3/" "wget")
;(code-c-d "sn" "/dl/www/snarf-1.22/")
;(code-c-d "lynx" "/usr/src/lynx-2.8.3/")
;(code-c-d "grail" "/usr/src/grail-0.3/")
;(code-c-d "tcpd" "/dl/sniffer/tcpdump-3.3.1a2/")
;(code-c-d "A" "/usr/src/redhat/BUILD/WWW/Arena-0.3.24/")
;(code-c-d "sendm" "$RBU/sendmail-8.8.4/")
;(code-c-d "apa" "/usr/src/apache-1.3.0/")
;
; Emacs:
;(code-c-d "eev" "~/eev/")
;(code-c-d "eevnew" "~/eev-new/")
;(code-c-d "e" "/usr/share/emacs/20.5/lisp/" "emacs-e20")
;(code-c-d "e" "/usr/share/emacs/19.34/lisp/" "emacs-19/emacs")
;(code-c-d "el" "/usr/share/emacs/19.34/lisp/" "elisp")
;(code-c-d "eli" "/usr/src/emacs-lisp-intro-1.05/" "emacs-lisp-intro")
(code-c-d "e20" "/usr/share/emacs/20.7/lisp/" "emacs-e20")
(code-c-d "e20src" "/usr/src/emacs20-20.7/" "emacs-e20")
;(code-c-d "efaq" "$S/http/www.lerner.co.il/emacs/" "emacs-faq")
(code-c-d "efaq" "$S/http/www.lerner.co.il/emacs/" "efaq")
;(code-c-d "w3el" "/usr/share/w3-el/" "w3")
;(code-c-d "w3c" "/home/root/AX/w3/")
;(code-c-d "texi" "/usr/src/texinfo-4.0/" "texinfo")
(code-c-d "sitelisp" "/usr/share/emacs/site-lisp/")
(code-c-d "e21src" "/usr/src/emacs21-21.1/")
(code-c-d "e21" "/usr/src/emacs21-21.1/")
(code-c-d "e21l" "/usr/src/emacs21-21.1/lisp/")
(code-c-d "xe" "/usr/lib/xemacs-21.1.10/lisp/" "xemacs-21.1.10/xemacs")
(code-c-d "xel" "/usr/lib/xemacs-21.1.10/lisp/" "xemacs-21.1.10/lispref")
(code-c-d "xei" "/usr/lib/xemacs-21.1.10/lisp/" "xemacs-21.1.10/internals")
(code-c-d "xefaq" "/usr/lib/xemacs-21.1.10/lisp/" "xemacs-21.1.10/xemacs-faq")
(code-c-d "viper" (ee-efile "emulation/") "viper")
(code-c-d "erc" "~/usrc/erc-5.0/")
(code-c-d "rcirc" "~/usrc/rcirc/")
(code-c-d "emacscvs" "~/bigsrc/emacs/")
(code-c-d "ecvs" "~/bigsrc/emacs/")
(code-c-d "ecvssrc" "~/bigsrc/emacs/src/")
(code-c-d "eetc" data-directory)

(seen 2030)

;
; Linux:
; «k22»  (to ".k22")
;(code-c-d "k" "/usr/src/linux-1.2.13/")
;(code-c-d "k2" "/usr/src/linux-2.0/")
;(code-c-d "k22" "/usr/src/linux-2.2/")
;(code-c-d "k24" "/usr/src/linux-2.4/")
(code-c-d "kpatches" "/usr/src/kernel-patches/")
;(code-c-d "k" "/usr/src/linux/")
;(code-c-d "tlk" "/usr/src/tlk/")
;(code-c-d "khg" "/dl/LDP/khg-0.6/")
;(code-c-d "shkpkg" "/usr/share/kernel-package/")
;
; (find-es "hardware" "find-k22configoption")
;(code-c-d-linux "k22" "/hdd7/tmp/kernel-source-2.2.20/")
' (code-c-d-linux "k24"    "~/bigsrc/kernel-source-2.4.26/")
' (code-c-d-linux "k24doc" "~/bigsrc/kernel-source-2.4.26/Documentation/")
;; (code-c-d-linux "k26" "~/bigsrc/kernel-source-2.6.8/")
;; (code-c-d "k26" "~/bigsrc/kernel-source-2.6.8/" :linux :grep)
' (code-c-d-linux "k26doc" "~/bigsrc/kernel-source-2.6.8/Documentation/")

;
; Hurd:
;(code-c-d "hurd" "/usr/src/hurd-20011016/" "hurd")
;(code-c-d "gnumach" "/usr/src/gnumach-20011013/")
;(code-c-d "oskmach" "/usr/src/oskit-mach/")
;(code-c-d "hurddebs" "$SDEBIAN/dists/sid/main/binary-hurd-i386/")
;(code-c-d "dcrossdoc" "/usr/doc/dpkg-cross/")
;(code-c-d "gvldi" "/gnu/var/lib/dpkg/info/")
;(code-c-d "HIG" "/usr/src/hurd-installation-guide/" "hurd-install-guide")
;(defun find-gnustatus (package &rest rest)
;  (apply 'find-Package "/gnu/var/lib/dpkg/status" package rest))
;(defun find-gnuavailable (package &rest rest)
;  (apply 'find-Package "/gnu/var/lib/dpkg/available" package rest))

;; (find-status   "grub")
;; (find-vldifile "grub.list")
;; (find-udfile   "grub/")
;; (find-grubnode "")
(code-c-d "grub" "/usr/share/doc/grub/" "grub")

;
; gcc / low-level things
;(code-c-d "xd" "/usr/src/xduel-2.14/")
;(code-c-d "libc" "/usr/src/redhat/BUILD/libc-5.3.12/")
;(code-c-d "ldso" "/usr/src/redhat/BUILD/ld.so-1.7.14/")
;(code-c-d "svgalib" "/usr/src/svgalib-1.2.13/")
;(code-c-d "gcc" "/usr/src/gcc-2.95.2/" "gcc-3.3")
(code-c-d "gcc" "/usr/lib/gcc/i486-linux-gnu/4.1.2/include/" "gcc-4.4")
;(code-c-d "gdb"   "/usr/src/gdb-4.18.19990928/")
;(code-c-d "gdbts" "/usr/src/gdb-4.18.19990928/gdb/testsuite/")
;(code-c-d "glibc" "/usr/src/glibc-2.1.3/glibc-2.1.3/")
;(code-c-d "binu" "/usr/src/binutils-2.9.1.0.19a/")
;(code-c-d "mk" "/usr/src/make-3.77/")
;(code-c-d "ldso" "/usr/src/ld.so-1.9.11/")
;(code-c-d "libvfw" "/usr/src/libvforkwrap-0.1/")
;
; Debian:
;; (code-c-d "dpkg" "/usr/src/dpkg-1.6.14/")
;(code-c-d "bfsrc" "/usr/src/boot-floppies-2.2.13/")
;(code-c-d "bf" "/usr/src/boot-floppies-2.2.13/")
;(code-c-d "bfdb" "/usr/src/boot-floppies-2.2.13/utilities/dbootstrap/")
;(code-c-d "disksc" "$SLINKB1/dists/slink/main/disks-i386/current/")
;(code-c-d "aptsrc" "/usr/src/apt-0.3.11/")
;(code-c-d "deblists" "$S/http/www.debian.org/Lists-Archives/")
;(code-c-d "deblists" "$S/http/lists.debian.org/")
;
;(code-c-d "dpkg" "/usr/src/dpkg-1.9.16/")
;(code-c-d "apt" "/usr/src/apt-0.5.3/")
;
; RedHat / boot / dos:
;(code-c-d "spec" "/usr/src/redhat/SPECS/")
;(code-c-d "source" "/usr/src/redhat/SOURCES/")
;(code-c-d "B" "/usr/src/redhat/BUILD/")
;(code-c-d "rpm" "/usr/src/redhat/BUILD/rpm-2.3.11/")
;(code-c-d "yard" "/home/root/AX/yard-1.9/")
;(code-c-d "Y" "/home/root/YARD/")
;(code-c-d "yard" "/usr/src/yard-1.13/" "Yard_doc")
;(code-c-d "rhi" "/big/a42/misc/src/install/")
;(code-c-d "demu" "/usr/src/dosemu-0.97.5/" "dosemu")
;(code-c-d "demu" "/usr/src/dosemu-0.66.7/" "dosemu")
;(code-c-d "demu" "/usr/src/dosemu-0.98.8/")
;
; functional languages, automatic reasoning systems, ...
;(code-c-d "ot" "/usr/src/otter-3.0.4/")
;(code-c-d "maple" "/usr/local/maple/")
;(code-c-d "hbc" "/usr/src/hbc/")
;(code-c-d "hugslib" "/usr/share/hugs98/lib/")
;(code-c-d "TH" "/usr/src/TclHaskell/")
;(code-c-d "holdoc" "/usr/src/hol/")
;(code-c-d "gcl" "/usr/src/redhat/BUILD/gcl-2.2/")
;(code-c-d "fp" "/usr/src/fptools/")
;(code-c-d "fudg" "/usr/src/fptools/Fudgets/")
;(code-c-d "smls" "/usr/src/sml-nj-110/")
;(code-c-d "hol" "/usr/src/hol90.10/")
;(code-c-d "tkhol" "/usr/src/TkHol.0.3c/")
;(code-c-d "mosml" "/usr/src/mosml/")
;(code-c-d "hol98" "/usr/src/hol98/")
;
; games:
;(code-c-d "mame" "/usr/src/xmame-0.30.1/")
;(code-c-d "mame356" "/usr/src/xmame-0.35b6.1/")
;(code-c-d "xast" "/usr/src/xaster-1.00/")
;(code-c-d "ste" "/usr/src/stella-0.7/")
;
; Tcl:
;(code-c-d "tcl" "/usr/src/tcl8.3-8.3.1/")
;(code-c-d "tcl7" "/usr/src/tcl7.6-7.6p2/")
;(code-c-d "cgitcl" "/usr/src/cgi.tcl-0.7/")
;(code-c-d "mta" "/usr/src/mktclapp-3.9/")
;(code-c-d "tkex" "/usr/share/doc/tk8.4/examples/")
;(code-c-d "exp" "/usr/src/expect5.31-5.31.2/" "expect")
;(code-c-d "plp" "/usr/src/plplot-4.99j/")
;(code-c-d "tuba" "/usr/src/tuba-2.5.b1/")
;(code-c-d "et" "/usr/src/et-80b2/")
;(code-c-d "sd" "/usr/src/scripdoc/")
;(code-c-d "wiscri" "~/wiki/scripts/")
;(code-c-d "wiscri" "~/WIKIS/tclscripts/")
;(code-c-d "swige" "/usr/doc/swig/examples/")
;(code-c-d "expman" "~/EXPECT/MAN/TXT/")
;(code-c-d "tclers" "/snarf/http/mini.net/cgi-bin/wikit/")
;
; Lua:
(code-c-d "flua" "~/LUA/flua-0.02/")
(code-c-d "miniforth" "~/miniforth/")
;(code-c-d "lua" "/usr/src/lua-4.0/" "~/lua-4.0/doc/lua")
(code-c-d "lua" "/usr/src/lua-4.0/" "lua")
;(code-c-d "lua3.2" "/usr/src/lua3.2-3.2/")
;(code-c-d "luall" "/usr/src/loadlib/")
;(code-c-d "tolua" "/usr/src/tolua/")
;(code-c-d "tklua" "/usr/src/tklua/")
(code-c-d "lua511" "~/usrc/lua-5.1.1/" :grep)
(code-c-d "lua512" "~/usrc/lua-5.1.2/" :grep)
(code-c-d "lua51"  "~/usrc/lua-5.1.2/" :grep)
(code-c-d "lua51"  "~/usrc/lua-5.1.4/" :grep)
(code-c-d "lua51src" "~/usrc/lua-5.1.4/src/" :grep :anchor)
(code-c-d "compat51" "~/usrc/compat-5.1r4/")
;; (find-es "lua5" "lpeg-0.9")
(code-c-d "lpeg" "~/usrc/lpeg-0.9/")
(code-c-d "lpeg" "~/usrc/lpeg-0.10/")
;; (find-lpegfile "")
;; (find-lpegw3m "lpeg.html")
;; (find-lpegw3m "lpeg.html#captures")
;; (find-lpegw3m "lpeg.html#cap-arg")
(code-c-d "luaftp" "$S/http/www.lua.org/ftp/")
(code-c-d "luaman" "/usr/share/doc/lua50-doc/manual/")
(code-c-d "luasocket" "~/usrc/luasocket-2.0.1/" :grep)
(code-c-d "lposix" "~/usrc/posix/" :grep)
;
; etc:
(code-c-d "iconipl" "~/usrc/ipl/" :grep)
;(code-c-d "icon" "/usr/src/icon-9.3.2/")
;(code-c-d "ipl" "/usr/src/icon/ipl/")
;(code-c-d "iproc" "/usr/src/icon/ipl/procs/")
;(code-c-d "bf" "/usr/src/bigforth/")
;(code-c-d "paysan" "/home/root/PAYSAN/")
;(code-c-d "gforth" "/usr/share/gforth/0.5.0/" "gforth")
;(code-c-d "gf"     "/usr/share/gforth/0.5.0/" "gforth")
;(code-c-d "zsh" "/usr/src/zsh-3.1.4/" "zsh")
;(code-c-d "zsh" "/usr/src/zsh-3.1.2/" "zsh")
;(code-c-d "tea" "/dl/teapot-0.9/")
;(code-c-d "txl" "/usr/src/TXL7.4/")
;(code-c-d "gimp" "/usr/src/gimp-1.0.0/")
;(code-c-d "repletc" "~/replace/etc/")
;(code-c-d "p5l" "/usr/lib/perl5/")
(code-c-d "pl5" "/usr/lib/perl5/")
;(code-c-d "pl5pod" "/usr/lib/perl5/5.004/pod/")
;(code-c-d "pl5lin" "/usr/lib/perl5/i386-linux/5.004/")
;(code-c-d "pl5src" "/usr/src/perl-5.004.04/")
;(code-c-d "CPAN" "$SCPAN/")
;(code-c-d "pl55i" "/usr/lib/perl5/5.005/i386-linux/")
;(code-c-d "ptut" "/snarf/http/agora.leeds.ac.uk/Perl/")
;(code-c-d "pg" "/usr/src/postgresql-6.3.2/")
;(code-c-d "g4" "/usr/share/gforth/0.4.0/" "gforth")
;(code-c-d "xf" "/usr/src/xfree86-3.3.2.2/")
;(code-c-d "glib" "/usr/src/glib1.1.12-1.1.12/")
;(code-c-d "gtk+" "/usr/src/gtk+1.1.12-1.1.12/")
(code-c-d "vldi" "/var/lib/dpkg/info/" :grep)
;(code-c-d "latte" "/usr/src/latte-1.1/")
;(code-c-d "php3" "/usr/src/php3-3.0.16/")
;(code-c-d "lsof" "/usr/src/lsof-4.37/")
;(code-c-d "fm" "$S/http/www.freshmeat.net/news/")
;(code-c-d "pf" "/usr/src/pforth-21/")
;(code-c-d "groff" "/usr/src/groff-1.11a/")
;(code-c-d "grof" "/usr/src/groff-1.11a/")
;(code-c-d "mimelite" "/usr/src/MIME-Lite-1.135/")
;(code-c-d "ts2" "/usr/src/ts2/")
;(code-c-d "ssh" "/usr/src/ssh-1.2.26/")
;(code-c-d "cf" "/usr/src/cfengine-1.4.12/" "cfengine")
;(code-c-d "octal" "/usr/src/octal-alpha/")
;(code-c-d "php3h" "/usr/doc/php3-doc/html/")
;(code-c-d "bsd8" "/hdd12/share/doc/en_US.ISO_8859-1/")
;(code-c-d "ldnav" "~/LD/NAVEGACAO/")
;(code-c-d "xc" "/usr/src/xfree86-1-3.3.6/build-tree/xc/")
;(code-c-d "isa" "/usr/src/Isabelle99-1/")
;(code-c-d "isalog" "/usr/src/Isabelle99-1/heaps/smlnj-110_x86-linux/log/")
;(code-c-d "shu" "/usr/src/shellutils-2.0/" "sh-utils")
;(code-c-d "pamh" "/usr/doc/libpam-doc/html/")
;(code-c-d "pams" "/usr/doc/libpam-doc/sgml/")
;(code-c-d "pamt" "/usr/doc/libpam-doc/txt/")
;(code-c-d "THL" "~/TH/L/")
;(code-c-d "ncurs" "/usr/src/ncurses-5.0/")
;(code-c-d "ncursdoc" "/usr/doc/libncurses5-dev/")
;(code-c-d "gst" "~/usrc/smalltalk-1.95.3/" "~/usrc/smalltalk-1.95.3/doc/gst")
;
(code-c-d "gawk" "/usr/share/doc/gawk/" "gawk")

;(code-c-d "planner" "/usr/share/emacs/site-lisp/planner-el/")
;(code-c-d "emacswiki" "/usr/share/emacs/site-lisp/emacs-wiki/")

(code-c-d "htet" "/usr/share/doc/HOWTO/en-txt/")
(code-c-d "rfc" "$S/http/www.ietf.org/rfc/")

;; «lua50»  (to ".lua50")
;; (find-es "lua5" "install-5.0.2")
(code-c-d "lua50"       "~/usrc/lua-5.0.3/")
(code-c-d "lua50manual" (ee-lua50file "doc/manual.html"))
(defun eepitch-lua50 () (interactive) (eepitch-comint "lua50" "lua50"))
;; (find-lua50file "")
;; (find-lua50w3m "doc/manual.html")
;; (find-lua50w3m "doc/manual.html#vararg")
;; (find-lua50manualw3m "")
;; (find-lua50manualw3m "#vararg" "arg={2, 3; n=2}")

(code-c-d "lua40"       "~/usrc/lua-4.0.1/")
(code-c-d "lua40manual" (ee-lua40file "doc/manual.html"))
(defun eepitch-lua40 () (interactive) (eepitch-comint "lua40" "lua40"))

;; (code-ps "lua50" "$S/http/www.lua.org/ftp/refman-5.0.ps.gz")
(defun find-lua50ref (&rest rest) (interactive)
  (apply 'find-anchor "~/LUA/lua50ref.e" rest))
(defun to-luaref (&rest rest) (interactive)
  (apply 'find-lua50ref rest))
;;
;; (find-lua50ref "For Statement")


(seen 2266)

(defun find-texbookpage (n &rest comments)
  (find-dvipage "~/usrc/texbook/texbook.dvi" n))

;; «papers»  (to ".papers")
;; (find-angg ".emacs.papers")

;; (find-es "math" "SGA1" "sga1-corrected")
;; (find-sga1page 10)
(code-xdvi "sga1" "~/tmp/sga1-corrected.dvi")



;; «icon»  (to ".icon")
;; (find-angg "ICON/tron.icn")
;; (find-es "icon" "tron.icn")
(code-c-d "ipl" "/usr/lib/icon-ipl/")

;; «iconbook»  (to ".iconbook")
;; Griswold, Grisworld: "The Icon Programming Language, Third Edition"
;;   http://www.cs.arizona.edu/icon/books.htm
;;   http://www.cs.arizona.edu/icon/lb3.htm
;;   http://www.cs.arizona.edu/icon/ftp/doc/lb1up.pdf
(code-xpdf      "iconbook" "$S/http/www.cs.arizona.edu/icon/ftp/doc/lb1up.pdf")
(code-pdftotext "iconbook" "$S/http/www.cs.arizona.edu/icon/ftp/doc/lb1up.pdf")
;; (find-iconbookpage         5  "Contents")
;; (find-iconbooktext          "\nContents")
;; (find-iconbookpage (+ 22 143) "An Overview of Graphics")
;; (find-iconbooktext     "\n     An Overview of Graphics")
;; (find-iconbookpage (+ 22 273) "Language Reference Manual")
;; (find-iconbooktext          "\nLanguage Reference Manual")
;; (find-iconbookpage (+ 22 373) "Index")
;; (find-iconbooktext "\f         Index")

;; «icongrbook»  (to ".icongrbook")
;; Griswold, Jeffery, Townsend: "Graphics Programming in Icon"
;;   http://www.cs.arizona.edu/icon/books.htm
;;   http://www.cs.arizona.edu/icon/gb/index.htm
;;   http://www.cs.arizona.edu/icon/ftp/doc/gb1up.pdf
(code-xpdf "icongrbook" "$S/http/www.cs.arizona.edu/icon/ftp/doc/gb1up.pdf")
;; (find-icongrbookpage         5  "Contents")
;; (find-icongrbookpage (+ 24 495) "Index")
;; (find-icongrbookpage (+ 24 183) "Events")
;; (find-iconbooktext)

;; Griswold and Griswold: "The Implementation of the Icon Programming Language"
;; http://www.cs.arizona.edu/icon/ftp/doc/ib1up.pdf
(code-xpdf "iconimp" "$S/http/www.cs.arizona.edu/icon/ftp/doc/ib1up.pdf")
;; (find-iconimppage        3  "Contents")
;; (find-iconimppage (+ 6 329) "Index")

;; Alan D. Corré: "Icon Programming for Humanists"
;; http://www2.cs.uidaho.edu/~jeffery/icon/humanists/humanist.pdf
(code-xpdf      "iconhum" "$S/http/www2.cs.uidaho.edu/~jeffery/icon/humanists/humanist.pdf")
(code-pdftotext "iconhum" "$S/http/www2.cs.uidaho.edu/~jeffery/icon/humanists/humanist.pdf")
;; (find-iconhumpage         9  "Contents")
;; (find-iconhumpage (+ 14 123) "Index")
;; (find-iconhumtext "")

;; Thomas W. Christopher: "Icon Programming Language Handbook"
;; http://www.tools-of-computing.com/tc/CS/iconprog.pdf
(code-xpdf      "iconhandbook" "$S/http/www.tools-of-computing.com/tc/CS/iconprog.pdf")
(code-pdftotext "iconhandbook" "$S/http/www.tools-of-computing.com/tc/CS/iconprog.pdf")
;; (find-iconhandbookpage        5  "Contents")
;; (find-iconhandbookpage       11  "List of Figures")
;; (find-iconhandbookpage       13  "List of Tables")
;; (find-iconhandbookpage (+ 0  35) "Generators")
;; (find-iconhandbookpage (+ 0 151) "Windows and Graphics")
;; (find-iconhandbooktext "")




;; «tclbook»  (to ".tclbook")
;; (find-es "tcl" "tclbook")
;;http://web.archive.org/web/*/http://www.cica.indiana.edu/cica/faq/tcl/tcl.html
;; http://wwwcs.upb.de/cs/ag-szwillus/lehre/ws96_97/bss/tcltk.html
;; http://wwwcs.upb.de/cs/ag-szwillus/lehre/ws96_97/bss/book/p1.ps.gz
;; http://wwwcs.upb.de/cs/ag-szwillus/lehre/ws96_97/bss/book/p2.ps.gz
;; http://wwwcs.upb.de/cs/ag-szwillus/lehre/ws96_97/bss/book/p3.ps.gz
;; http://wwwcs.upb.de/cs/ag-szwillus/lehre/ws96_97/bss/book/p4.ps.gz
(code-c-d "tclbook"
	  "$S/http/wwwcs.upb.de/cs/ag-szwillus/lehre/ws96_97/bss/book/")
;; (code-ps  "tclbook1" (ee-tclbookfile "p1.ps.gz"))
;; (code-ps  "tclbook2" (ee-tclbookfile "p2.ps.gz"))
;; (code-ps  "tclbook3" (ee-tclbookfile "p3.ps.gz"))
;; (code-ps  "tclbook4" (ee-tclbookfile "p4.ps.gz"))
;; (find-tclbook1page 1)
;; (find-tclbook2page 1)
;; (find-tclbook3page 1)
;; (find-tclbook4page 1)

(defun find-tclbookfiletext (file &rest rest)
  (apply 'find-sh (format "zcat %s | pstotext" (ee-tclbookfile file)) rest))
(defun find-tclbook1text (&rest rest)
  (interactive) (apply 'find-tclbookfiletext "p1.ps.gz" rest))
(defun find-tclbook2text (&rest rest)
  (interactive) (apply 'find-tclbookfiletext "p2.ps.gz" rest))
(defun find-tclbook3text (&rest rest)
  (interactive) (apply 'find-tclbookfiletext "p3.ps.gz" rest))
(defun find-tclbook4text (&rest rest)
  (interactive) (apply 'find-tclbookfiletext "p4.ps.gz" rest))
;; (find-tclbook1text)
;; (find-tclbook2text)
;; (find-tclbook3text)
;; (find-tclbook4text)

;; http://hegel.ittc.ku.edu/topics/tcltk/book.examples
;; http://wwwcs.upb.de/cs/ag-szwillus/lehre/ws96_97/bss/book/examples.gz


;; «find-iconbooktext»  (to ".find-iconbooktext")
;; http://www.cs.arizona.edu/icon/ftp/doc/lb1up.pdf
;; (find-iconbooktext)
;; (find-iconbooktext "case Event() of")
;; (find-iconbooktext "Event(), 155-156")
;; (find-iconbookpage (+ 22 155))
;; (find-iconbookpage (+ 22 203) "queens")
(defun find-iconbooktext (&rest rest)
  (apply 'find-pdfpage-pdftotext
         (ee-expand "$S/http/www.cs.arizona.edu/icon/ftp/doc/lb1up.pdf")
         rest))



(defun find-hurdPackage (&rest rest)
  (apply 'find-Package "$SSIDMB/Packages" rest))
(defun find-hurdalphaPackage (&rest rest)
  (apply 'find-Package "$SALPHASIDMB/Packages" rest))





;; (find-evardescr 'interpreter-mode-alist)
(setq interpreter-mode-alist
     (append interpreter-mode-alist
	     '(("tclsh8.0" . tcl-mode)
	       ("expectk" . tcl-mode)
	       ("expect" . tcl-mode))))

;; (find-efile "jka-compr.el" "gzip")
;; (find-efile "jka-compr.el" "defun jka-compr-install")
;; (find-efile "jka-compr.el" "defun jka-compr-uninstall")
;; (find-efile "lisp/jka-compr.el")
(load-library "jka-compr")
(if (fboundp 'auto-compression-mode)	; needed on Emacs21
    (auto-compression-mode 1))

;; How do I tell jka-compr that `.dz' files (for dict) are in reality `.gz's?
;; (setq auto-mode-alist (cons '("\\.dz$" nil jka-compr) auto-mode-alist))

;; (find-fline "/usr/share/dictd/jargon.dict.dz")

;; (describe-variable 'auto-mode-alist)
;; (describe-variable 'jka-compr-compression-info-list)
;; (find-efile "jka-compr.el")


;; «gnuserv»  (to ".gnuserv")
;; (find-es "emacs" "gnuserv")
;; (find-efunctiondescr 'server-start)
;; (gnuserv-start)
(if (fboundp 'gnuserv-start)
    (if (equal (getenv "GNUCLIENT") "no") nil
      (gnuserv-start)))


;; «info-path»  (to ".info-path")
;; (describe-variable 'Info-additional-directory-list)
;; (describe-variable 'Info-directory-list)
;; (find-evariable 'Info-additional-directory-list)
;; (find-evariable 'Info-directory-list)
;; (setq Info-additional-directory-list '("~/info"))
;; mkdir ~/info/; cp -v ~/tmp/lua-4.0/doc/lua.info* ~/info/
;; (find-fline "~/info/")
;; (find-node "(lua)Top")
;;
(if (not (boundp 'Info-additional-directory-list))
    (setq Info-additional-directory-list nil))

(add-to-list 'Info-additional-directory-list "~/info")
;; (add-to-list 'Info-additional-directory-list "~/eev-current/doc")
;; (find-node "(eev)Top")

;; (setq Info-additional-directory-list
;;       (append (if (boundp 'Info-additional-directory-list)
;; 		  Info-additional-directory-list)
;; 	      '("~/info")))

;; Info mode doesn't like having in its path dirs that don't exist
(or (file-exists-p "~/info") (make-directory "~/info"))
' (or (file-exists-p  "~/eev-current/doc")
      (make-directory "~/eev-current/doc" "-p"))




;; (find-elnode "Defining Functions" "Function: defalias")
;; (find-efunctiondescr 'defalias)
;; (find-es "emacs" "indented-text-mode")
;; (defalias 'indented-text-mode 'paragraph-indent-text-mode)
;; (find-efaqnode "Turning on syntax highlighting")
(defalias 'indented-text-mode 'text-mode)
(defalias 'flm 'font-lock-mode)
(defalias 'spm 'show-paren-mode)

(add-hook 'awk-mode-hook        'turn-on-font-lock)
(add-hook 'c-mode-hook          'turn-on-font-lock)
(add-hook 'change-log-mode-hook 'turn-on-font-lock)
(add-hook 'dired-mode-hook      'turn-on-font-lock)
(add-hook 'emacs-lisp-mode-hook 'turn-on-font-lock)
(add-hook 'generic-mode         'turn-on-font-lock)
;; (add-hook 'lua-mode          'turn-on-font-lock)   ;; hook doesn't exist?
;; (add-hook 'perl-mode         'turn-on-font-lock)   ;; hook doesn't exist?
(remove-hook 'ruby-mode-hook    'turn-on-font-lock)
(add-hook 'ruby-mode-hook       'turn-on-font-lock 'append)
(add-hook 'sh-mode-hook         'turn-on-font-lock)
(add-hook 'tcl-mode-hook        'turn-on-font-lock)
(add-hook 'texinfo-mode-hook    'turn-on-font-lock)

(add-hook 'makefile-mode-hook   'turn-on-font-lock)



;;;;;
;;
;; «key_bindings»  (to ".key_bindings")
;;
;;;;;
;
; (find-enode "Rebinding")
; (find-elnode "Key Binding Commands")
; (find-elnode "Changing Key Bindings")
; (find-elnode "Changing Key Bindings" "Function: define-key")
; (find-elnode "Translating Input")
; (find-elnode "Translating Input" "Variable: function-key-map")
; (find-elnode "Character Type")
; (find-elnode "Terminal-Specific")
; (find-efile "term/")
; (find-efile "term/vt220.el")
; (find-efile "term/internal.el" "function-key-map")
; (describe-variable 'function-key-map)
; (describe-key "\e[")
; (describe-key "\e[7")
; (describe-key "\e[7^")
; (describe-key [C-home])
; (define-key function-key-map "\e[7^" [C-home])
; (define-key function-key-map [C-home] "\e[7^")
; ^ Not working yet.
; 2000oct26: [f6] now toggles picture mode instead of only entering it.
; (find-etag "picture-mode")

;; (require 'picture)
;; (find-efunction 'picture-mode-exit)
;; (find-efunction 'delete-trailing-whitespace)
;;
(defun toggle-picture-mode ()
  (interactive)
  (if (eq major-mode 'picture-mode)
      (picture-mode-exit)
    (picture-mode)))

(put 'eval-expression 'disabled nil)	; Emacs' most useful command (C-x C-e)
(if (locate-library "ibuffer")
    (global-set-key [f1] 'ibuffer)
  (global-set-key   [f1] 'buffer-menu))
(global-set-key [f4] 'redraw-display)
(global-set-key [f5] 'call-last-kbd-macro)
;(global-set-key [f6] 'picture-mode)
(global-set-key [f6] 'toggle-picture-mode)
(global-set-key "\e[1~" 'beginning-of-line)
(global-set-key "\e[4~" 'end-of-line)
(global-set-key "\e[2~" 'overwrite-mode)
(global-set-key "\M-o" 'other-window)
(global-set-key "\M-O" 'other-frame)
(global-set-key "\M-+" 'enlarge-window)
(global-set-key "\M-_" 'shrink-window)
; (find-enode "Non-Window Terminals")
;(defun shrink-window1 () (interactive) (enlarge-window -1))
;	shift	alt	keycode  12 = Meta_underscore
;	shift	alt	keycode  13 = Meta_plus

;(global-set-key "\M->" 'end-of-buffer)
;(global-set-key "\M-<" 'beginning-of-buffer)

; Some gdbk-ish keys that are convenient in source buffers
(global-set-key "\M-B" 'gud-break)
(global-set-key "\M-T" 'gud-tbreak)

; «C-x-spc»  (to ".C-x-spc")
(global-set-key "\C-x " 'set-mark-command) ; for buggy "expect"s or "screen"s

(global-set-key [insertchar] 'overwrite-mode) ; for BSDs
(global-set-key [delete] 'delete-char)	; for X; do I still need this?




;; «kd»  (to ".kd")
(defun kd (key)
  "Prints key and binding in a format suitable for quick refs"
  (interactive "kCommand: ")
  (princ (format "%s\t-- %s\n" (key-description key) (key-binding key))
         (current-buffer)))

;; «dkey»  (to ".dkey")
(defun dkey (key)
  "Execute a key sequence with debugging turned on"
  (interactive "kKey sequence: ")
  (debug)
  (call-interactively (key-binding key)))

;; (define-key global-map "\M-g" 'kd)
;; (define-key global-map "\M-g" 'dkey)



(defun wrap (p) (interactive "P") "Toggle truncate-lines"
  (if p (setq truncate-lines (eq p 0))
    (setq truncate-lines (not truncate-lines))))

;; (setq truncate-partial-width-windows t)
;; (setq truncate-partial-width-windows nil)

;; «fooi»  (to ".fooi")
(defun fooi (&rest rest)
  "Narrow to region then run query-replace on each of the pairs in REST."
  ;; (setq rest (straighten rest))
  (save-excursion
    (save-restriction
      (narrow-to-region (point) (mark))
      (while rest
	(goto-char (point-min))
	(query-replace (car rest) (car (cdr rest)))
;	(query-replace-regexp (regexp-quote (car rest)) (car (cdr rest)))
	(setq rest (cdr (cdr rest)))))))

;; «fooi-re»  (to ".fooi-re")
;; (find-es "emacs" "regexp-syntax")
;;
(defun fooi-re (&rest rest)
  "Narrow to region then run query-replace-regexp on each of the pairs in REST."
  ;; (setq rest (straighten rest))
  (save-excursion
    (save-restriction
      (narrow-to-region (point) (mark))
      (while rest
	(goto-char (point-min))
;	(query-replace (car rest) (car (cdr rest)))
	(query-replace-regexp (car rest) (car (cdr rest)))
	(setq rest (cdr (cdr rest)))))))

;; «fooi-t»  (to ".fooi-t")
;; For templates
;;
(defun fooi-t (&rest pairs) (interactive)
  (apply 'fooi (append pairs '("\\" "\\\\" "\"" "\\\""
			       "\n(" "\n\\(" "\n[" "\n\\["))))

;; «fooi-a» (to ".fooi-a")
;; For audios
;;
(defun fooi-a (&rest pairs) (interactive)
  (apply 'fooi-re (append pairs '("\")" "" "\" \"" " "
				  ";; (find-[-A-Za-z0-9]+ +\"" ""))))




;; «ascstr»  (to ".ascstr")
;;
;; (defun ascstr (i lasti)
;;   (while (<= i lasti)
;;     (princ (format "%c" i) (current-buffer))
;;     (setq i (+ i 1))))
(defun ascstr (i lasti)
  (while (<= i lasti)
    (if (char-valid-p i) (insert i))
    (setq i (+ i 1))))
;;
;; (ascstr 0 255)
;; (ascstr 32 126)
;;
(defun ascstr32 (i lasti)
  (while (<= i lasti)
    (insert (format "%x %d: " i i))
    (let ((j i)
	  (lastj (+ i 32)))
      (while (< j lastj)
	(condition-case nil
	    (insert-char j 1)
	  (error nil))
	(setq j (+ j 1))))
    (setq i (+ i 32))
    (insert "\n")))
;;
;; (ascstr32 0 2047)

;; «ee-insert»  (to ".ee-insert")
;; (find-eoutput '(ee-insert '(0 8000)))
;; (find-eoutput '(ee-insert '(8000 12000)))
;; (find-eevfile "eev.el" "find-einsert")
;; (find-eev "eev.el" "find-einsert")

;; «to-codes»  (to ".to-codes")
;; Braille:
;; <delYsid> t = 2345 o = 135 u = 136 c = 14 h = 125 m = 134 e = 15
;; (find-echarsetchars 'mule-unicode-2500-33ff "282x")
;; (find-eoutput '(insert 300094 300085 300101 300073 300083 32 300077 300081))
;;
;; Classical Greek:
;; (find-echarsetchars 'mule-unicode-0100-24ff "702x")
;;
;; Triangle:
;; (find-eoutput '(insert 342435))
;; (find-echarsetchars 'mule-unicode-0100-24ff "732x")
;;
;; Interrobang:
;; (find-echarsetchars 'mule-unicode-0100-24ff "733x")
;; (find-eoutput '(insert 342461))
;;
;; [[, ]], \big[, \big], <<, >>:
;; (find-eoutput '(insert 300006 300007 300008 300009 300010 300011))
;;
;; http://angg.twu.net/eev-current/eev.el.html#find-echarsetchars
;; http://angg.twu.net/eev-current/eev.el.html#find-eoutput
;;
(defun to-codes (s e)
  "Convert the chars in the region to an equivalent (insert ...) sexp.
Here's an example; the \"insert\" sexp below was generated with `to-codes'.
\(find-echarsetchars 'mule-unicode-2500-33ff \"282x\")
\(find-eoutput '(insert 300094 300085 300101 300073 300083 32 300077 300081))"
  (interactive "r")
  (let ((str (buffer-substring s e)))
    (delete-region s e)
    (save-excursion
      (goto-char s)
      (insert (format "%S" (cons 'insert (mapcar 'identity str)))))))

;; «to-ranges»  (to ".to-ranges")
;; (ranges '(0 1 2 3 4 77 40 41 42))
;;   -> ((0 4) (77 77) (40 42))
;;
(defun ranges (list)
  (let ((rest list) first now last answer)
    (while rest
      (setq first (car rest))
      (setq last (car rest))
      (setq rest (cdr rest))
      (while (and rest (= (car rest) (1+ last)))
	(setq last (1+ last))
	(setq rest (cdr rest)))
      (setq answer `((,first ,last) . ,answer)))
    (nreverse answer)))

(defun to-ranges (s e)
  (interactive "r")
  (let* ((str (buffer-substring s e))
	 ;; (list (mapcar 'identity str))
	 (list (ranges (mapcar 'identity str))))
    (delete-region s e)
    (save-excursion
      (goto-char s)
      (insert (format "%S" list)))))




; (find-elnode "Testing Accessibility" "file-exists-p")
(if (file-exists-p "~/.emacs.local")
    (load-library  "~/.emacs.local"))



;;;;;
;;
;; «obsolete»  (to ".obsolete")
;;
;;;;;

(defun set-window-height (n)
  (enlarge-window (- n (- (window-height) 1))))
;;
(defun set-windows0 (nlines cursorline expr &rest rest)
  (eval expr)
  (if rest (split-window))
  (if rest (if (numberp nlines) (set-window-height nlines)))
  (recenter (or cursorline 0))
  (if rest (other-window 1))
  (if rest (apply 'set-windows0 rest)))
;;
(defun set-windows (&rest rest)
  (delete-other-windows)
  (apply 'set-windows0 rest))



;; «php»  (to ".php")
;; (find-es "php" "php-doc")
;; (find-es "php" "php-raphael-0")
(code-c-d "phpdoc" "/usr/share/doc/php-doc/html/")
(code-c-d "phplang" "/usr/share/doc/php-doc/html/language.")
(code-c-d "phpfunc" "/usr/share/doc/php-doc/html/function.")
;; (find-phpdocfile "")
;; (find-phpdocw3m "index.html")
;; (find-phpdocw3m "langref.html")
;; (find-phplangw3m "types.array.html")
;; (find-phplangw3m "basic-syntax.html")
;; (find-phplangw3m "basic-syntax.comments.html")



;; Obsolete stuff:
' (

;; (find-php3hw3 "language.basic-syntax.html")
;; (find-php3fun "echo")
(defun find-php3fun (funname &rest rest)
  (if (eq ee-arg 3) (find-anchor "~/tmp/ophpfunctions" funname)
    (apply 'find-php3hw3 (format "function.%s.html" funname) rest)))
(defun find-phpdocpage (page &rest rest)
  (interactive (list "index"))
  (eev (format "lynx /usr/share/doc/phpdoc/html/%s.html" page)))
(defun find-phplangpage (page &rest rest)
  (eev (format "lynx /usr/share/doc/phpdoc/html/language.%s.html" page)))
(defun find-phpfuncpage (page &rest rest)
  (eev (format "lynx /usr/share/doc/phpdoc/html/function.%s.html" page)))
;; (find-phpdocpage "index")
;; (find-phplangpage "variables.external")
;; (find-phpfuncpage "import-request-variables")

(defun eep (s e) (interactive "r")
  (write-ee s e "<?\n" "\n?>\n" "/var/www/tmp.php3")
  (write-ee-string "wget -q -O - http://127.0.0.1/tmp.php3$1 $*[2,-1]"))
(defun eep-bounded () (interactive)
  (ee-fstrbounded 'eep-bounded
		  'eep "\n#\n" "\n#\n"))

)




(defun fill-text-field (cols n)
  (let ((fill-column cols))
    (fill-region-as-paragraph
      (search-forward "texto {\n")
      (- (search-forward "}") 1)))
  (if n (if (> n 1) (fill-text-field cols (- n 1)))))

(defun text72 (n) (interactive "P") (fill-text-field 72 n))
(defun textlong (n) (interactive "P") (fill-text-field 5000 n))

;; (find-elnode "Searching and Matching")
;; (find-elnode "Regexp Search" "Function: string-match")
;; (find-elnode "Simple Match Data" "Function: match-string")

(defun lua-goto-error () (interactive)
  (let (str fname linenum)
    (setq str (buffer-substring (ee-search-backward "\n")
				(ee-search-forward "\n")))
    (string-match "line \\([0-9]+\\) \\[file `\\(.*\\)'\\]" str)
    (setq fname (match-string 2 str))
    (setq linenum (read (match-string 1 str)))
    (find-fline fname linenum)))

(defun unquote-printable-1 () (interactive)
  (if (re-search-forward "=\\([0-9A-Fa-f][0-9A-Fa-f]\\)")
      (replace-match
       (format "%c" (read (concat "?\\x" (match-string 1))))
       'fixedcase)))

;; «guest_users»  (to ".guest_users")
;; (find-angg ".zshrc" "inix-lea")
;; (find-efile "enriched.el")
;; (find-eetcfile "enriched.doc")

(when (equal (getenv "GUEST_USER") "lea")
  (if (fboundp 'menu-bar-mode) (menu-bar-mode t))
  (if (fboundp 'tool-bar-mode) (tool-bar-mode t))
  (find-fline "~/LEA/help")
  (find-fline "~/LEA/notas-enriched")
  (find-fline "~/LEA/notas")
  (find-fline "~/LEA/notas2")
  (setq inhibit-startup-message t)
  )

' (defun linetoeshell () (interactive)
    (if (not (eq major-mode 'eshell-mode))
	(progn (beginning-of-line)
	       (setq linetoeshell
		     (buffer-substring (point)
				       (save-excursion (end-of-line) (point))))
	       (next-line 1)
	       (eshell)
	       (insert linetoeshell))
      (if linetoeshell
	  (progn (eshell-send-input)
		 (setq linetoeshell nil))
	(switch-to-buffer nil))))

;; (global-set-key [S-f3] 'linetoeshell)






;; (find-fline "eev-extras.el" "defun cs")
;; (find-angg "eev-extras.el" "glyphs_du_jour")
;; Latinmath:
;(let ((disptables-to-set (list disptable-latinmath)))
;  (setglyphs
;   ?\^O "31"      ?*	; small red square
;   ))
;(if (not window-system) (setq standard-display-table disptable-latinmath))


;; (find-elnode "Change Hooks" "after-change-function")
;; (eev "e20glimpse after-change-function | l -S")




; Try to bypass a xemacs bug:
; (find-angg "eev.el" "to_and_back")
(set-default 'ee-back-list nil)




;; «isearch-faces»  (to ".isearch-faces")
;; (find-es "emacs" "customization-buffers")
;; (find-efunction 'defface)
;; (find-efunction 'custom-declare-face)
;; (customize-group 'isearch-faces)

(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(canlock-password "9ea3d6ab441ededa5760d05aba1cf44d2912255a")
 '(org-enable-table-editor nil)
 '(safe-local-variable-values (quote ((Package . Maxima) (Syntax . Common-Lisp) (Base . 10) (TeX-master . t) (TeX-command-default . "CJKLaTeX") (TeX-master . "lshort2e") (backup-by-copying . t) (sql-product . SQLite) (sql-sqlite-options . "/tmp/music.sqlitedb") (sh-indentation . 2) (folded-file . t) (encoding . raw-text-unix) (modes org-mode emacs-lisp-mode lua-mode) (ee-charset-indicator . "\x08d1")))))
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(comint-highlight-prompt ((t (:foreground "LightSteelBlue"))))
 '(dired-ignored ((t (:inherit shadow :foreground "DarkSalmon"))))
 '(emacs-wiki-link-face ((t (:foreground "lime green" :underline "lime green" :weight bold))))
 '(erc-input-face ((t (:foreground "orange"))))
 '(lazy-highlight ((((type tty pc) (class color)) (:background "yellow" :foreground "black"))))
 '(makefile-shell-face ((t (:foreground "goldenrod"))))
 '(makefile-space ((((class color)) (:background "DeepPink4"))))
 '(makefile-space-face ((((class color)) (:background "DeepPink4"))))
 '(makefile-targets-face ((t (:inherit font-lock-function-name-face))))
 '(outline-1 ((t (:foreground "OrangeRed"))))
 '(outline-2 ((t (:foreground "Goldenrod2"))))
 '(outline-3 ((t (:foreground "LimeGreen"))))
 '(outline-4 ((t (:foreground "Dodger Blue"))))
 '(sh-heredoc ((t (:foreground "gold1" :weight bold)))))

;; '(comint-highlight-prompt ((((min-colors 88) (background dark)) (:foreground "LightSteelBlue"))))
;; '(makefile-shell-face ((((class color) (min-colors 88) (background dark)) (:foreground "goldenrod"))))
;; '(sh-heredoc ((((min-colors 88) (class color) (background dark)) (:foreground "gold1" :weight bold))))


(seen 3004)


;; '(font-lock-constant-face ((((class color) (min-colors 88) (background dark)) (:foreground "OrangeRed2"))))

;; (find-elnode "Disabling Commands")
(put 'downcase-region 'disabled nil)

;; (custom-set-faces
;;   ;; custom-set-faces was added by Custom -- don't edit or cut/paste it!
;;   ;; Your init file should contain only one such instance.
;;   '(default ((t (:background "black" :foreground "#99aaff"))))




;; «lforth»  (to ".lforth")
;; (find-eev "eev-misc.el" "shortcut-find-xxxs")
(code-c-d "lforth" "~/LFORTH/")
(defun find-lforth (file &rest rest)
  "A hyperlink function to anchors in files in ~/LFORTH/."
  (apply 'find-anchor (concat "~/LFORTH/" file) rest))

;; «eepdj»  (to ".eepdj")
;; (find-angg "LATEX/Makefile" ".pdj")
(defun eepdj (s &optional e) (interactive "r")
  (ee-write s e "" "" "~/o")
  (eev "cd
a2ps -=p2isol o
regv o.ps
make -f ~/LATEX/Makefile /tmp/o.pdj
laf ~/o ~/o.ps /tmp/o.pdj"))






(defun find-ewikipage (&optional pagename)
  (let* ((path (if pagename (concat "cgi-bin/wiki\\?" pagename) ""))
	(base "http://www.emacswiki.org/")
	(command (concat "lynx " base path)))
    (eev command)
    command))

;; (find-ewikipage "CategoryEshell")
;; (find-ewikipage nil)


(make-variable-buffer-local 'ee-imenu-index-alist)

(defun ee-imenu-create-index ()
  (goto-char (point-min))
  (let ((search-re (or ee-imenu-re
		       (format ee-anchor-format "\\(.+\\)")))
        a p alist)
    (while (re-search-forward search-re nil t)
      (setq a (match-string 1)
            p (match-beginning 0))
      (unless (string= a "%s")
        (push (cons a p) alist)))
    (setq ee-imenu-index-alist (nreverse alist))))

(defun ee-imenu ()
  (interactive)
  (let ((imenu-create-index-function 'ee-imenu-create-index)
        (imenu-index-alist ee-imenu-index-alist))
    (call-interactively 'imenu)))

(define-key ctl-x-map "E" 'ee-imenu)

;; (find-efunction 'imenu)





;; «load-.emacs-tex»  (to ".load-.emacs-tex")
;; (find-angg ".emacs-tex.el")
(load-library "~/.emacs-tex.el")



;; (find-elnode "Process Information")
;;
(defun find-eprocesses (&rest rest)
  (interactive)
  (list-processes)
  (apply 'ee-goto-position rest))


;; (find-dmissing "wiki")

(defun ee-read-stuff-around-point (prompt chars)
  (read-string prompt (ee-stuff-around-point chars)))

(defun find-dmissing (str &rest rest)
  (interactive (list (ee-read-stuff-around-point "dmissing " "-+0-9A-Za-z_./")))
  (apply 'find-zsh (format "dmissing %s" str) rest))

;; (defun find-w (str &rest rest)
;;   (interactive (list (ee-read-stuff-around-point "w " "-+0-9A-Za-z_")))
;;   (apply 'find-zsh (format "w %s" str) rest))

(defun find-locate (str &rest rest)
  (interactive "slocate ")
  (apply 'find-sh (format "locate %s" str) rest))




;;;;;
;;
;; «emacs-wiki»  (to ".emacs-wiki")
;;
;;;;;

(add-to-list 'load-path "~/usrc/sacha-dev/emacs-wiki/")
(add-to-list 'load-path "~/usrc/sacha-dev/planner/")
(add-to-list 'load-path "~/usrc/sacha-dev/remember/")

(code-c-d "emacswiki" "~/usrc/sacha-dev/emacs-wiki/" "emacs-wiki")
(code-c-d "planner"   "~/usrc/sacha-dev/planner/"    "planner-el")
(code-c-d "remember"  "~/usrc/sacha-dev/remember/"   "remember-el")


;; (find-emacswikifile "")
;; (find-emacswikinode "Top")
;; (find-plannerfile "")
;; (find-plannernode "Top")
;; (find-rememberfile "")
;; (find-remembernode "Top")

;; (code-c-d "muse" "~/usrc/sachac/muse/")
;; (find-musefile "")

;; (defun find-planner (pagename &rest rest)
;;   (planner-goto pagename)
;;   (apply 'ee-goto-position rest))

;; (defun planner-main () (interactive) (find-planner "MainTasksPage"))
;; (defun planner-main () (interactive) (find-planner "MainPage"))

;; (defun to-muse () (interactive) (find-fline "~/eev-0.94/Notes/Muse"))

;; «emacs-wiki-edrx»  (to ".emacs-wiki-edrx")
;; (find-es "ewiki" "emacs-wiki-edrx")
;; (find-angg "elisp/emacs-wiki-edrx.el")

;; (add-to-list 'load-path "~/elisp/")

;; (eval-after-load "emacs-wiki"
;;   '(load-library "emacs-wiki-edrx"))

;; (code-c-d "eevnotes" "~/eev-0.94/Notes/")
;;
;; (defun find-eevnotes (pagename &rest rest)
;;   (find-fline (ee-eevnotesfile pagename))
;;   ;; (emacs-wiki-maybe)
;;   ;; (muse-mode-maybe)
;;   (apply 'ee-goto-position rest))

;; (find-eevnotes "MainPage")




;;;;;
;;
;; find-stringbuffer, find-evalread, and another find-etpat
;; 2004apr02
;;
;;;;;

;; (find-elnode "Temporary Displays")
;; (find-elnode "Temporary Displays" "cial Form: with-output-to-temp-buffer")

(defun find-stringbuffer-new (buffername string &rest rest)
  (ee-same-window buffername
		  (with-output-to-temp-buffer buffername
		    (princ string)))
  (apply 'ee-goto-position rest))

(defun find-eevalread (sexpstr &rest rest)
  (interactive "sEval: ")
  (apply 'find-stringbuffer-new
	 (format "*%s*" sexpstr)
	 (format "%s\n   ==>\n\%s\n"
		 sexpstr (pp-to-string (eval (read sexpstr))))
	 rest))

;; (defun find-efunctionpp (symbol &rest rest)
;;   (interactive (find-function-read))
;;   (apply 'find-eevalread (format "(symbol-function '%S)" symbol) rest))

;; (defun find-etpat (&rest rest) (interactive)
;;   (apply 'find-eevalread "(text-properties-at (point))" rest))



;; «find-string-ow»  (to ".find-string-ow")
;; «find-progoutput-ow»  (to ".find-progoutput-ow")
;; 2004aug04
;;
(defun find-string-ow (string buffername &rest pos-spec-list)
  (if (null buffername) (error))
  (save-selected-window
    (let ((pop-up-windows t))
      (pop-to-buffer buffername)
      (if buffer-file-name
	  (error "Buffer %s is not a scratch buffer" buffer-file-name))
      (delete-region (point-min) (point-max))
      (insert string)
      (goto-char (point-min))
      (apply 'ee-goto-position pos-spec-list))))

(defun find-progoutput-ow (command &optional title &rest pos-spec-list)
  (apply 'find-string-ow
	 (shell-command-to-string command)
	 (or title (format "*%s*" command))
	 pos-spec-list))


;; (find-elnode "Output Variables")
;; (ee-pp-to-string-compact '(a [foo] "\n\r"))
;; (ee-pp-to-string-compact '(a [foo] "\n\r") 'tick)
;; (ee-pp-to-string-compact '(defun f (x) `(1 2 ,x 'a)) 'tick)

;; (defalias 'ee-pp1 'pp-to-string)

;; (defalias 'ee-format-%S 'ee-pp0)
;; (defalias 'ee-pp-to-string-compact 'ee-pp0)

;; (defun find-ekeypp (key &rest rest)
;;   (interactive "kDescribe key: ")
;;   (let* ((codestr (format "(symbol-function (key-binding %s))"
;;                           (ee-pp-to-string-compact key 'tick))))
;;     (apply 'find-eevalread codestr rest)))






;;;;;
;;
;; «htmlize»  (to ".htmlize")
;; 2004jul17
;;
;;;;;

;; Moved to: (find-eev "htmlize-eev.el")

;; See also:
;; http://rtfm.etla.org/emacs/htmlfontify/src/htmlfontify.el.html

;; http://fly.srk.fer.hr/~hniksic/emacs/htmlize.el
;; cp -iv $S/http/fly.srk.fer.hr/~hniksic/emacs/htmlize.el ~/elisp/

;; (find-efile "fast-lock.el")
;; (find-efile "font-lock.el")
;; (find-efile "jit-lock.el")
;; (find-efile "lazy-lock.el")
;; (customize-option 'font-lont-support-mode)

;; (find-eev "META" "htmlize")
;; (load-library "~/elisp/htmlize.el")
;; (find-fline "~/elisp/htmlize.el")
;; (find-elnode "Changing Properties")
;; (find-elnode "Narrowing" "save-restriction")

;; (glyphs-faceglyph-to-facechar (aref "*" 0))
;; (glyphs-replace-by-facechars (- (point) 30) (point) "*«»")
;; (eev "rm -v /tmp/stuff.*; cp -v ~/.emacs /tmp/stuff.el")
;; (glyphs-htmlize-file "/tmp/stuff.el")

;; (find-fline "~/elisp/htmlize.el" "defun htmlize-make-hyperlinks")

(defvar glyphs-to-replace-by-facechars "\r*«»")

(defun glyphs-faceglyph-to-facechar (pos)
  (let* ((n (aref (aref standard-display-table pos) 0))
	 (faceid (ash n -19))
	 (face (ee-faceid-to-face faceid (face-list)))
	 (char (logand n 524287))
	 (charstr (format "%c" char)))
    (add-text-properties 0 1 (list 'face face) charstr)
    charstr))

(defun glyphs-replace-by-facechars (start end glyphsstr)
  (save-restriction
    (narrow-to-region start end)
    (let ((i 0) char code replacement)
      (while (< i (length glyphsstr))
	(setq char (substring glyphsstr i (1+ i)))
	(setq code (aref glyphsstr i))
	(setq replacement (glyphs-faceglyph-to-facechar code))
	(save-excursion
	  (goto-char (point-min))
	  (while (search-forward char nil t)
	    (replace-match replacement nil t)))
	(setq i (1+ i))))))

(defun glyphs-htmlize-this-buffer-1 (name-orig)
  (let* ((contents (buffer-substring (point-min) (point-max)))
	 (name-htmlized (concat name-orig " (htmlized)"))
	 (name-html (concat name-orig ".html")))
    (pop-to-buffer name-htmlized)
    (delete-region (point-min) (point-max))
    (insert contents)
    (glyphs-replace-by-facechars (point-min) (point-max)
				 glyphs-to-replace-by-facechars)
    (switch-to-buffer (htmlize-buffer))
    (rename-buffer name-html)))

(defun glyphs-htmlize-file (fname)
  (find-file fname)
  (font-lock-mode 1)
  (jit-lock-fontify-now (point-min) (point-max))
  (glyphs-htmlize-this-buffer-1 (file-name-nondirectory fname))
  (write-file (concat fname ".html")))



;; «fundcomp-menu»  (to ".fundcomp-menu")
'
(easy-menu-define
 fundcomp-menu global-map
 "FundComp menu."
 '("FundComp"
   ["c:/FundComp/lab/"              (find-fline "$LAB/") t]
   "--"
   ["scheme.txt"                    (find-fline "$LAB/scheme.txt") t]
   ["leitao.txt"                    (find-fline "$LAB/leitao.txt") t]
   ["eng-por.dict"                  (find-fline "$LAB/eng-por.dict") t]
   ["keys.e"                        (find-eevfile "keys.e") t]
   "--"
   ["(info \"(emacs)Top\")"         (info "(emacs)Top") t]
   ["(info \"(elisp)Top\")"         (info "(elisp)Top") t]
   ["(info \"(eintr)Top\")"         (info "(eintr)Top") t]
   ))

;; «menu-bar»  (to ".menu-bar")
;; «tool-bar»  (to ".tool-bar")
;; (find-enode "Menu Bars")
;; (find-enode "Tool Bars")
;; (find-enode "Scroll Bars")
(if (fboundp 'menu-bar-mode)   (menu-bar-mode 0))
(if (fboundp 'tool-bar-mode)   (tool-bar-mode 0))
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))

;; 2011nov28: Commented out:
;;   (if (fboundp 'auto-image-file-mode) (auto-image-file-mode 1))
;; On recent Emacsen auto-image-file-mode is on by default, but
;; running (auto-image-file-mode 1) explicitly is bad, as it triggers
;; a bug - on big images <left> and <right> will scroll horizontally
;; too much. Curiously, this doesn't happen for images in zip files or
;; tarballs.



;; «show-as-image»  (to ".show-as-image")
;; (find-es "emacs" "keymap-property")
;; (find-es "emacs" "display-property")
;; (find-node "(elisp)Image Descriptors")
;; (show-as-png "~/IMAGES/kaoya.png")
;;
(setq show-as-image-keymap
      '(keymap (?q . show-as-image-unshow))) ; `q' makes the image text again

(defun show-as-image-unshow (&optional s e)
  (interactive)
  (setq s (or s (previous-single-property-change (1+ (point)) 'display)
	      (point-min)))
  (setq e (or e (next-single-property-change (point) 'display) (point-max)))
  (remove-text-properties s e '(display keymap)))

(defun show-as-image (type fname &optional s e)
  (if (not s) (save-excursion
		(setq s (eek-backward-sexp))
		(setq e (eek-forward-sexp))))
  (let* ((image-data (with-temp-buffer
		       (set-buffer-multibyte nil)
		       (insert-file-contents-literally fname)
		       (buffer-string))))
    (add-text-properties s e
      `(display (image :type ,type :data ,image-data)
	keymap ,show-as-image-keymap))))

(defun show-as-png (fname &optional s e)
  (show-as-image 'png fname s e))



;; «ptexts»  (to ".ptexts")
;; (find-elnode "Output Variables" "print-escape-newlines")
;; (find-elnode "Formatting Strings" "with quoting")

(defun ptexts-build-alist (f pos posmax)
  (let ((nextpos (next-property-change pos)))
    (if nextpos
        (cons (funcall f pos nextpos)
	      (ptexts-build-alist f nextpos posmax))
      (funcall f pos posmax))))

(defun ptexts (&optional pos posmax)
  (ptexts-build-alist
   (lambda (start end)
     (cons (buffer-substring-no-properties start end)
	   (text-properties-at start)))
   (or pos (point-min))
   (or posmax (point-max))))

(defun ptexts-as-string (&optional pos posmax)
  (mapconcat (lambda (ptext) (format "%S\n" ptext))
	     (ptexts pos posmax)
	     ""))

;; (setq ptexts (ptexts (point) (mark)))
;; (find-evardescr 'ptexts)





(setq outline-minor-mode-prefix "\C-c")
;; (find-eevfile "eev-dev.el")


;; «underline-as-green»  (to ".underline-as-green")
;; (find-angg ".zshrc" "underline_as_green")
;; (find-man "4 console_codes" "Set color n as the underline color")
;; (set-face-foreground 'underline "green")
;; (set-face-foreground 'underline nil)
;; (find-efacedescr 'underline)
;;
(if (equal (getenv "TERM") "linux")
    (set-face-foreground 'underline "green"))

(defun eeapti (packages)
  (interactive (list (ee-debpkgname-ask)))
  (eev (format "apti %s" packages)))


;; For the lua manual
;; «lua-manual»  (to ".lua-manual")
;;
(defun foo-lua-section () (interactive)
  (beginning-of-line)
  (assert (looking-at "\\([0-9.]+\\) - \\(.+\\)"))
  (insert (format "*%s*\n*%s*\n" (match-string 1) (match-string 2)))
  (next-line))

(defun foo-lua-region (s e) (interactive "r")
  (let ((str (buffer-substring s e)))
    (beginning-of-line)
    (insert (format "*%s*\n" str))
    (forward-line 1)))

(defun tp-make-w3m-faces () (interactive)
  (make-face           'w3m-anchor-face)
  (set-face-foreground 'w3m-anchor-face "cyan")
  (make-face           'w3m-bold-face)
  (set-face-bold-p     'w3m-bold-face t)
  (make-face           'w3m-header-line-location-content-face)
  (set-face-foreground 'w3m-header-line-location-content-face "LightGoldenrod")
  (set-face-background 'w3m-header-line-location-content-face "Gray20")
  (make-face           'w3m-header-line-location-title-face)
  (set-face-foreground 'w3m-header-line-location-title-face "cyan")
  (set-face-background 'w3m-header-line-location-title-face "Gray20")
  (make-face           'w3m-anchor-face)
  (set-face-foreground 'w3m-anchor-face "cyan"))

;; «r0r2»  (to ".r0r2")
;; (defun tp-find-file-r2-then-r0 (r2-fname r0-fname)
;;   (find-fline r2-fname)

(setq lua50ref-r0-file "~/LUA/lua50ref.r0")
(setq lua50ref-r2-file "~/LUA/lua50ref.r2")

;; Obsolete:
' (defun find-lua50ref (&rest rest)
    (interactive)
    (if (not (file-exists-p lua50ref-r0-file))
	(progn (find-fline lua50ref-r2-file)
	       (tp-r2-write-r0-file)))
    (apply 'find-anchor lua50ref-r0-file rest))

;; «find-ebuffer+»  (to ".find-ebuffer+")

(defun read-file-as-sexp (fname)
  (with-temp-buffer
    (insert-file-contents fname)
    (read (buffer-substring (point-min) (point-max)))))

(defun my-insert-str-props (str-props)
  (if (cdr str-props) (insert (apply 'propertize str-props))
    (insert (car str-props))))

(defun find-ebuffer+ (bufname &rest pos-spec-list)
  "Like `find-ebuffer', but for buffers that are constructed in special ways.
See `find-ebuffer+-alist'."
  (if (get-buffer bufname)
      (apply 'find-ebuffer bufname pos-spec-list)
    (find-ebuffer bufname)
    (let ((a (assoc bufname find-ebuffer+-alist)))
      (if (not a) (error "Not in `find-ebuffer+-alist': %S" bufname))
      (let ((buffer-undo-list t))
	(eval (cons 'progn (cdr a))))
      (set-buffer-modified-p nil)
      (apply 'ee-goto-position pos-spec-list))))

(defvar find-ebuffer+-alist nil)

(setq find-ebuffer+-alist
      '(("Lua50ref"
	 (mapc 'my-insert-str-props
	       (let ((coding-system-for-read 'utf-8-unix))
		 (read-file-as-sexp "~/LUA/lua50ref.r2")))
	 (normal-mode))
	("UserModeLinux-HOWTO"
	 (insert-file-contents
	  (ee-udfile "user-mode-linux-doc/html/UserModeLinux-HOWTO.txt.gz"))
	 (Man-fontify-manpage))
	("MuttManual"
	 (insert-file-contents
	  (ee-udfile "mutt/manual.txt.gz"))
	 (Man-fontify-manpage))
	))

(defun find-Lua50ref (&rest pos-spec-list)
  (interactive)
  (apply 'find-ebuffer+ "Lua50ref" pos-spec-list))

;; (find-epp (assoc "Lua50ref" find-ebuffer+-alist))
;; (find-Lua50ref)
;; (find-ebuffer+ "UserModeLinux-HOWTO")




;; (pc-selection-mode)

;; «hippie-expand»  (to ".hippie-expand")
;; (find-node "(autotype)Hippie Expand")
;; (find-efile "hippie-exp.el")
;;
(global-set-key [f11] 'hippie-expand)
(setq hippie-expand-try-functions-list
  '(try-complete-file-name-partially
    try-complete-file-name
    try-complete-lisp-symbol-partially
    try-complete-lisp-symbol
    try-expand-all-abbrevs
    try-expand-list
    try-expand-line
    try-expand-dabbrev
    try-expand-dabbrev-all-buffers
    try-expand-dabbrev-from-kill
    ))



;; (find-sh0 "echo foo >&2 > /dev/null")


;; Obsolete thanks to tramp and $ASROOT
' (defun sudoemacs (fname)
    (interactive (list (read-file-name "sudo emacs ")))
    (eev (format "sudo emacs %s &" fname)))

' (defun sudoemacs-nw (fname)
    (interactive (list (read-file-name "sudo emacs -nw ")))
    (eev (format "sudo emacs -nw %s" fname)))

' (defun whoami ()
    (interactive)
    (message (shell-command-to-string
              "echo \"$(whoami) (HOME=$HOME)\"")))




;; «dfs»  (to ".dfs")
;; (find-sh "cd /var/lib/dpkg/info/; 'ls' -X | awk -F . '{print $NF}' | uniq")
;; (ee-dfss "#" "less")
;;
;; (setq ee-dfs-extensions
;;       (mapcar 'symbol-name
;; 	      '(preinst postinst prerm postrm
;; 		conffiles config templates
;; 		md5sums shlibs)))
;;
;; (defun ee-dfs (N)
;;   (interactive "p")
;;   (dotimes (i N)
;;     (let* ((bol (save-excursion (beginning-of-line) (point)))
;; 	   (eol (save-excursion (end-of-line) (point)))
;; 	   (pkgname (buffer-substring bol eol))
;; 	   (prefix (ee-comment-prefix))
;; 	   (links (ee-dfss prefix pkgname ee-dfs-extensions)))
;;       (if (not links)
;; 	  (error "Not an installed package: %s" pkgname))
;;       (delete-and-extract-region bol (1+ eol))
;;       (insert links))))
;;
;; (defalias 'dfs 'ee-dfs)



;; «eesteps»  (to ".eesteps")
;;
;; (defun eesteps-set (list)
;;   (setq eesteps-pos 0)
;;   (setq eesteps-list list))
;;
;; (defun eesteps-do-step ()
;;   (interactive)
;;   (if (>= eesteps-pos (length eesteps-list))
;;       (error "No more steps"))
;;   (eval (nth eesteps-pos eesteps-list))
;;   (setq eesteps-pos (1+ eesteps-pos)))
;;
;; (global-set-key [f12] 'eesteps-do-step)

;; A test:
;; (eesteps-set '((insert "foobar") (backward-char 3) (insert "!")))

;; «my-ins»  (to ".my-ins")
;; (find-elnode "Markers")
;; (find-elnode "Marker Insertion Types")
;;

(defun ins-here ()
  (setq ins-marker (make-marker))
  (set-marker-insertion-type ins-marker t)
  (set-marker ins-marker (point)))

(defun ins (&rest stuff)
  (with-current-buffer
      (or (marker-buffer ins-marker)
	  (error "ins-marker points nowhere"))
    (save-excursion
      (goto-char ins-marker)
      (apply 'insert stuff))))

(defun ins-expr (expr) (ins (format "%S\n" expr)) expr)


(defun my-set-marker ()
  (setq my-marker (make-marker))
  (set-marker-insertion-type my-marker t)
  (set-marker my-marker (point)))

(defun my-ins (&rest stuff)
  (save-excursion
    (set-buffer (or (marker-buffer my-marker)
		    (error "my-marker points nowhere")))
    (goto-char my-marker)
    (apply 'insert stuff)))

;; a demo:
' (eesteps-set '(
    (next-line 2) (ins-here) (next-line 2)
    (ins "a") (ins "b") (ins "c")
    ))


;; «chowns»  (to ".chowns")
;; A test: (eesteps-set '((find-fline "/etc/fstab") (chowns)))

(defun chowns-string (fname)
  (shell-command-to-string (concat "FNAME=" fname "
function sudolink () { echo \"# (find-sh0 \\\"sudo chown $1 $2\\\")\"; }
sudolink $(stat -c %U:%G $FNAME) $FNAME
sudolink $(id -gn):$(id -un)     $FNAME")))

(defun chowns (&optional fname) (interactive)
  "Insert in the kill ring two hyperlinks to toggle the ownership of this file"
  (let ((result (chowns-string (or fname (buffer-file-name))))
	(message-truncate-lines nil))
    (kill-new result)
    (message "%s" (substring result 0 -1))))

;; (find-find-links-links "{k}" "chown" "fname")
;; (find-chown-links "/etc/hosts")
;;
(defun find-chown-links (&optional fname &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for foo."
  (interactive (list (or (buffer-file-name) default-directory)))
  (setq fname (or fname "{fname}"))
  (apply 'find-elinks
   `((find-chown-links ,fname ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-chown-links)
     ""
     (find-fline ,(file-name-directory fname)
		 ,(format " %s" (file-name-nondirectory fname)))
     (find-sh0 ,(format "sudo chown -v edrx. %s" fname))
     (find-sh0 ,(format "sudo chmod 666      %s" fname))
     (find-sh0 ,(format "sudo chmod 777      %s" fname))
     )
   pos-spec-list))


(code-brfile 'find-chown-links  :dired 'chown)




;; «find-eimage»  (to ".find-eimage")
;; obsolete: see (find-efunction 'auto-image-file-mode)
' (defun find-eimage (fname)
    (let ((buffername (format "*image %s*" fname))
          (substitutedfname (ee-expand fname)))
      (switch-to-buffer buffername)
      (delete-region (point-min) (point-max))
      (cd (file-name-directory substitutedfname))
      (insert-image (create-image substitutedfname))))




;; «to-netbotanic-test»  (find-angg ".zshrc" "to-netbotanic-test")
(defun to-netbotanic-test () (interactive)
  (find-angg ".zshrc" "to-netbotanic-test"))

;; «to-install-beth»  (find-eev "examples/eev-tests.e" "to-install-beth")
(defun to-install-beth () (interactive)
  (find-eev "examples/eev-tests.e" "to-install-beth"))

;; «to-eev-current»  (find-angg ".zshrc" "to-eev-current")
(defun to-eev-current () (interactive)
  (find-angg ".zshrc" "to-eev-current"))

;; (find-dpkg-l)
(defun find-dpkg-l (&rest rest)
  (interactive)
  (apply 'find-sh "dpkg -l" rest))

;; «find-zsh»  (to ".find-zsh")
;; (find-zsh "alias")
;; (find-zsh "set")

(defun find-zsh00 (command)
  (find-callprocess00
   `("zsh" "-c" ,(format "export TERM=emacs\n. ~/.zshrc\n%s" command))))

;; 2007dec13: bad news: the clean solution above does not work for
;; aliases, I need some hack... like the two below.
;; (find-zsh "installeddebs")

(defun find-zsh00 (command)
  (eev command nil "$EEVTMPDIR/ee.zsh")
  (find-callprocess00
   `("zsh" "-c" ,(format "export TERM=emacs\n. ~/.zshrc\n%s"
			 ". $EEVTMPDIR/ee.zsh"))))

(defun find-zsh00 (command)
  (eev command nil "$EEVTMPDIR/ee.zsh")
  (find-callprocess00
   `("zsh" "-c" ,(format "export TERM=emacs\n. ~/.zshrc\n%s"
			 "eval \"$(cat $EEVTMPDIR/ee.zsh)\""))))

(defun find-zsh0 (command)
  (ee-no-trailing-nl (find-zsh00 command)))

(defun find-zsh (command &rest rest)
  (apply 'find-eoutput-reuse
         (or ee-buffer-name (format "zsh: %s" command))
         `(insert (find-zsh00 ,command))
         rest))

;; (defun find-zsh (command &rest rest)
;;   (interactive "MCommand: ")
;;   (ee-write command nil ". ~/.zshrc\n" "" "$EEVTMPDIR/ee.zsh")
;;   (apply 'find-sh "TERM=emacs zsh $EEVTMPDIR/ee.zsh" rest))
;;
;; (defun find-zsh0 (command)
;;   (interactive "MCommand: ")
;;   (ee-write command nil ". ~/.zshrc\n" "" "$EEVTMPDIR/ee.zsh")
;;   (find-sh0 "TERM=emacs zsh $EEVTMPDIR/ee.zsh"))

;; «upload»  (to ".upload")
;; (find-angg ".zshrc" "upload")
(defun upload (fname)
  (interactive "fFile name: ")
  (setq fname (ee-expand (or fname (buffer-file-name))))
  (eev (format "upload %s" fname)))




;; «eev-current-make-htmls»  (to ".eev-current-make-htmls")
;; (find-angg ".zshrc" "eev-current")
;; (eev "eev-current-upload")
;; (eev-current-make-htmls)
;;
;; (find-eevexfile "eev-make.e" "make-htmls")
;; (find-eevexfile "tools.el")


(defun ee-info-page-url (book+ node)
  (let ((book- (file-name-nondirectory book+)))
    (cond ((equal book- "emacs")
	   (format "http://www.fsf.org/software/emacs/manual/html_node/%s.html"
		   (replace-regexp-in-string "[ /]" "-" node)))
	  ((or (equal book- "emacs-lisp-intro")
	       (equal book- "elintro")
	   (format "http://www.fsf.org/software/emacs/emacs-lisp-intro/html_node/%s.html"
		   (replace-regexp-in-string "[ /]" "-" node))))
	  )))

(defun ee-sexp-to-url (sexp)
  (let ((first (car sexp))
	(second (cadr sexp)))
    (cond ((member first '(info find-node))
	   (if (string-match "^(\\([^()]*\\))\\(.*\\)" second)
	       (ee-info-page-url (match-string 1 second)
				 (match-string 2 second))))
	  ((eq first 'find-enode)   (ee-info-page-url "emacs" second))
	  ((eq first 'find-elnode)  (ee-info-page-url "elisp" second))
	  ((eq first 'find-elinode) (ee-info-page-url "elintro" second))
	  )))

;; (ee-info-page-url "emacs" "Calendar/Diary")
;; (ee-sexp-to-url '(find-enode "Calendar/Diary"))

;;---------------------------------------------------------
;; «eesteps-insert-longkey»  (to ".eesteps-insert-longkey")
;; (find-estring "" "" '(eesteps-insert-longkey+ (kbd "M-h M-k")))
;;
(defun eesteps-insert-longkey (key)
  (interactive "kInsert longkey: ")
  (insert (ee-pp0 (format-kbd-macro key))))

(defun eesteps-insert-longkey+ (key)
  (interactive "kInsert longkey with comment: ")
  (insert (ee-pp0 (replace-regexp-in-string
		   "[ \t][ \t]+" "  "
		   (format-kbd-macro key t)))))

' (define-key eev-mode-map [f7] 'eesteps-insert-longkey)
' (define-key eev-mode-map [f8] 'eesteps-insert-longkey+)



;;---------------------------------------
;; «my-screenshot»  (to ".my-screenshot")
;; «emacs-ascii-screenshots»  (to ".emacs-ascii-screenshots")
;; (find-node "(elisp)Emulating Mode Line")
;; TODO: change the prefix "my-" (to "shot-", maybe?)
;;       use (format-mode-line nil nil t)
;; (my-2uple-to-string  '("foo" "/") 7)
;; (my-2uples-to-rect   '(("foo" "/") ("b" ".")) 5)
;; (my-max-width-2uples '(("foo" "/") ("b" ".")))
;; (my-max-width        '("foo" "b"))

(defun my-untabify-string (string)
  (with-temp-buffer
    (insert string)
    (untabify 0 (point-max))
    (buffer-substring 0 (point-max))))

(defun my-max-width (strings)
  (apply 'max 0 (mapcar 'length strings)))

(defun my-max-width-2uples (2uples)
  (my-max-width (mapcar 'first 2uples)))

(defun my-2uple-to-string (2uple targetwidth)
  (let* ((s    (nth 0 2uple))
	 (fill (nth 1 2uple))
	 (code (aref fill 0))		; ascii code of the first char of fill
	 (slen (length s)))
    (concat s (make-string (- targetwidth slen) code))))

(defun my-2uples-to-rect (2uples width)
  (mapcar (lambda (2uple) (my-2uple-to-string 2uple width)) 2uples))

(defun my-2uples-to-rect+ (2uples extra)
  (let ((width (+ (my-max-width-2uples 2uples) extra)))
    (my-2uples-to-rect 2uples width)))

(defun my-add-walls-to-rect (rect pre post &optional pre0 post0)
  (if pre0 (cons (concat pre0 (car rect) post0)
		 (my-add-walls-to-rect (cdr rect) pre post))
    (mapcar (lambda (str) (concat pre str post)) rect)))

(defun my-window-to-2uples (top strs modeline minibuffer)
  (let ((2uples (append (mapcar (lambda (str) (list str " ")) strs)
			`((,modeline "-")))))
    (if top (setq 2uples (append '(("" "_")) 2uples)))
    (if minibuffer (setq 2uples (append 2uples `((,minibuffer "_")))))
    2uples))

(defun my-window-to-shot-rect (prepre strs modeline minibuffer extra fixed)
  (let* ((pre0 (concat prepre " ")) (post0 " ")
	 (pre  (concat prepre "|")) (post  "|")
	 (2uples (my-window-to-2uples t strs modeline minibuffer))
	 (rect (if extra (my-2uples-to-rect+ 2uples extra)
		 (my-2uples-to-rect 2uples fixed))))
    (my-add-walls-to-rect rect pre post pre0 post0)))

(defun my-concat-lines (rect)
  (apply 'concat (mapcar (lambda (s) (concat s "\n")) rect)))

;; A demo:
' (find-estring
   (my-concat-lines
    (my-window-to-shot-rect
     ";; "
     (split-string "foo\nbar\n" "\n")
     "-:**-F1  TODO  (Emacs-Lisp)--L706--79%--"
     "M-x foo"
     2
     nil)))

(defvar my-screenshot-prefix "  ")

;; «my-screenshot»  (to ".my-screenshot")
(defun my-screenshot (extra)
  (interactive "P")
  (find-estring
   (my-concat-lines
    (my-window-to-shot-rect
     my-screenshot-prefix
     (split-string (buffer-substring (point) (mark)) "\n")
     (format-mode-line mode-line-format 0)
     ""
     (or extra 6)
     nil))))


;; «find-mode-line-links» (to ".find-mode-line-links")
(defun find-mode-line-links (&rest pos-spec-list)
"Visit a temporary buffer containing an skeleton for an ascii screenshot."
  (interactive)
  (apply 'find-elinks
   `((find-mode-line-links  ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-mode-line-links)
     (define-key eev-mode-map "\M-U" 'eewrap-screenshot)
     (setq ee-screenshot-width ,ee-screenshot-width) ; current value
     ""
     (find-elnode "Emulating Mode Line")
     (find-epp (format-mode-line mode-line-format))
     (find-epp (format-mode-line mode-line-format 'header-line))
     (ee-no-properties (format-mode-line mode-line-format))
     ""
     "   ________________________________________________________"
     "  |                                                        |"
     "  |                                                        |"
     "  |                                                        |"
     ;; "  |"
     ;; "  |"
     ,(format "  |%s|" (ee-no-properties (format-mode-line mode-line-format)))
     "  |________________________________________________________|"
     )
   pos-spec-list))

;; (key "\M-U")

;; Test: (find-mode-line-links)

(defvar ee-screenshot-width 70)
(defun  ee-screenshot-width () (interactive)
  (find-elinks
   `((ee-screenshot-width)
     ;; Convention: the first sexp always regenerates the buffer.
     (setq ee-screenshot-width ,ee-screenshot-width) ; current value
     ""
     (setq ee-screenshot-width 70)
     )))

(defun ee-to-screenshot-line (&optional str width)
  (setq width (or width ee-screenshot-width))
  (setq str (replace-regexp-in-string "^ *|\\(.*?\\) *| *$" "\\1" str))
  (let* ((len   (length str))
	 (needs (- width (length str)))
	 (spaces (make-string (max 0 needs) 32)))
    (format "  |%s%s|" str spaces)))

(defun eewrap-screenshot () (interactive)
  (ee-this-line-wrapn 1 'ee-to-screenshot-line))

;; (ee-to-screenshot-line " abcd ")
;; (ee-to-screenshot-line " abcd " 4)
;; (ee-to-screenshot-line " | abcd | " 4)
;; (find-elnode "Creating Strings" "Function: make-string")







;; «my-modes»  (to ".my-modes")
;; (find-fvwmhelp "")
(defun fvwm-sloppy-focus   () (interactive) (find-fvwm0 "Style * SloppyFocus"))
(defun fvwm-click-to-focus () (interactive) (find-fvwm0 "Style * ClickToFocus"))

(setq my-modes-table
      '((:no-scroll-bar (scroll-bar-mode -1))
	(:scroll-bar    (scroll-bar-mode 1))
	(:no-blink      (blink-cursor-mode 0))
	(:blink         (blink-cursor-mode 1))
	(:no-erc-track  (erc-track-disable))
        (:erc-track     (erc-track-enable))
        (:no-pager      (find-fvwm0 "KillModule FvwmPager"))
	(:pager         (find-fvwm0 "Module FvwmPager"))
	(:no-fringe     (fringe-mode '(0)))
	(:fringe        (fringe-mode '(nil)))
	(:width80       (set-frame-width nil 80))
	(:long-flash    (setq ee-highlight-spec  '(highlight 7)
			      eeb-highlight-spec '(highlight 7)
			      eek-highlight-spec '(region    7)))
	(:normal-flash  (setq ee-highlight-spec  '(highlight 0.75)
			      eeb-highlight-spec '(highlight 0.5)
			      eek-highlight-spec '(region    0.75)))
	))

(defun my-modes (&rest args)
  (while args
    (let* ((keyword (car args))
	   (assoc (assoc keyword my-modes-table)))
      (setq args (cdr args))
      (if assoc (eval (cons 'progn (cdr assoc)))
	(error "Keyword %S not in my-modes-table" keyword)))))

;; (require 'erc)
;; (my-modes :scroll-bar    :pager    :erc-track    :fringe    :width80)
;; (my-modes :no-scroll-bar :no-pager :no-erc-track :no-fringe :width80)
;; (my-modes :long-flash   :no-blink)
;; (my-modes :normal-flash :blink)


;; «linuxconfvar»  (to ".linuxconfvar")
;; «code-c-d-linux26»  (to ".code-c-d-linux26")

(defun ee-linuxconfvarname-around-point (&optional show-it)
  (interactive "p")
  (ee-stuff-around-point "A-Z0-9_" show-it))

(defun ee-linuxconfvarname-ask (&optional prompt show-it)
  (interactive (list nil t))
  (ee-maybe-showing-it
   (read-string (or prompt "Linux confvar (usually CONFIG_xxx): ")
		(ee-linuxconfvarname-around-point))))

'(
(defun code-c-d-linux26 (c d)
  (code-c-d c d)
  (ee-eval-read-format "
    (defun find-%sconfvar (var &rest rest)
      (interactive (list (ee-linuxconfvarname-ask)))
      (apply 'find-%sfile \".Configure.help\"
	     (concat \"\\n\" var \"\\n\") rest))" c c))

(code-c-d-linux26 "k26" "~/bigsrc/kernel-source-2.6.8/")
(code-c-d-linux26 "linux26" "~/bigsrc/kernel-source-2.6.8/")
)

;; (find-es "kernel" "k26.Configure.help")
;; (find-k26confvar "CONFIG_BLK_DEV_LOOP")
;; (find-fline "~/LINUX/2.6.28-persephone1.conf")



(setq ee-file-html (ee-expand "$EEVTMPDIR/ee.html"))
(setq ee-file-html "/tmp/ee.html")

;; (eeurl "http://www.cs.utah.edu/dept/old/texinfo/emacs18/emacs_21.html")

(setq large-file-warning-threshold 15000000)


;; «intermail»  (to ".intermail")
;; (find-angg ".zshrc" "intermail")
;; (find-angg "bin/intermail")
;; (find-fline "~/INTERMAIL/")
;;
;; (setq sendmail-program "~/bin/intermail")
;; (setq sendmail-program "/usr/lib/sendmail")
;; (setq sendmail-program "/usr/sbin/sendmail")
;; (makunbound 'sendmail-program)
;;
;; (setq sendmail-program "~/bin/intermail")

(defun eebgPUC ()
  (interactive)
  (eebg-channel-xterm "PUC" "Sucuri")
  (eechannel "PUC"))

(defun eebgTWU ()
  (interactive)
  (eebg-channel-xterm "TWU" "Twu")
  (eechannel "TWU"))

(defun eechannel-PUC () (interactive) (eechannel-xterm "PUC" "Sucuri"))
(defun eechannel-TWU () (interactive) (eechannel-xterm "TWU" "Twu"))
(defalias 'eebgPUC 'eechannel-PUC)
(defalias 'eebgTWU 'eechannel-TWU)

(defun eebgLua () (interactive) (eechannel-xterm "Lua" "lua50"))


;;-------------------------------------------------
;; «remove-from-keymap»  (to ".remove-from-keymap")
;;
(defun remove-from-keymap (keymap key-to-remove)
  (unless (eq (car keymap) 'keymap) (error "Not a sparse keymap"))
  (setcdr keymap (remq (assoc key-to-remove keymap)
		       (cdr keymap))))

;; «tex-insert-quote»  (to ".tex-insert-quote")
;; (find-evariable 'tex-mode-map "tex-insert-quote")
;; (find-evardescr 'tex-mode-map)
;;
(eval-after-load "tex-mode"
  '(remove-from-keymap tex-mode-map ?\"))




;; (find-eetcfile "NEWS" "undo-outer-limit")
;; (setq undo-outer-limit-function 'undo-outer-limit-truncate)
;; Always accept truncation of undo data, never ask:
;;
(defun undo-outer-limit-my-truncate (&rest rest) t)
(setq undo-outer-limit-function 'undo-outer-limit-my-truncate)

(setq ee-hyperlink-prefix "# ")
(setq add-log-full-name "Eduardo Ochs")
(setq add-log-mailing-address "eduardoochs@gmail.com")
;; (setq add-log-mailing-address "edrx@mat.puc-rio.br")

;; (find-efile "")
;; (find-efile "progmodes/tcl.el")
;;
(setq tcl-proc-list
  '("proc" "method" "itcl_class" "body" "configbody" "class"
    "pseudoproc"))
;; (tcl-set-proc-regexp)
;; (tcl-set-font-lock-keywords)



;; For zsh:
;;   (setq-default comint-process-echoes t)
;; The default is:
;;   (setq-default comint-process-echoes nil)
;; 2011nov03: I discovered that
;;   (setq-default comint-process-echoes t)
;; was the cause of a long-standing bug...
;;   (find-es "emacs" "comint-gets-stuck")
;;   (find-es "emacs" "comint-process-echoes")




;; (find-sitelispfile "debian-el/deb-view.el")
(autoload 'deb-find            "deb-view" "Debian Archive File Finder" t)
(autoload 'deb-view-mode       "deb-view" "Debian Archive File Mode" t)
(autoload 'deb-view            "deb-view" "Debian Archive File Viewer" t)
(autoload 'deb-view-dired-view "deb-view" "Debian Archive File Viewer" t)
(setq auto-mode-alist (append '(("\\.deb$" . deb-view-mode)) auto-mode-alist))
;; (define-key dired-mode-map     "\C-d"     'deb-view-dired-view)


(add-hook 'dired-load-hook
          '(lambda ()
	     (define-key dired-mode-map     "\C-d"     'deb-view-dired-view)))



;;-----------------------------------------------
;; «hscroll-keys-mode»  (to ".hscroll-keys-mode")
;; (find-eevnewfile "eev-dev.el" "define-minor-mode eegud-keys-mode")
;; (hscroll-keys-mode)
;;
(define-minor-mode hscroll-keys-mode
  "Use M-> and M-< for horizontal scrolling."
  nil
  " hscr-k"
  '(("\M->" . (lambda (arg) (interactive "p") (scroll-left (or arg 1))))
    ("\M-<" . (lambda (arg) (interactive "p") (scroll-right (or arg 1))))))

;; Or:
' (global-set-key (kbd "s-.")
    (lambda (arg) (interactive "p") (scroll-left (or arg 1))))
' (global-set-key (kbd "s-,")
    (lambda (arg) (interactive "p") (scroll-right (or arg 1))))



;;-----------------------------------------------
;; «unquote-printable»  (to ".unquote-printable")
(defun unquote-printable () (interactive)
  (while (and (re-search-forward "=\\([0-9A-Fa-f][0-9A-Fa-f]\\|\n\\)"
				 (mark) t)
	      (y-or-n-p "Unquote this? ")
	      (let ((q (match-string 1)))
		(if (equal q "\n")
		    (replace-match "")
		  (replace-match
		   (format "%c" (read (concat "?\\x" q)))
		   'fixedcase))
		t))))



;;---------------------
;; «date»  (to ".date")
;; (find-enode "Single Shell")
;; (describe-function 'shell-command-on-region)
;; (date)
;; (date+time)
;; (format-time-string "%Y%b%d")
;; (find-elnode "Time Parsing")
;; (find-sh "date")
;; (find-sh "date --help")
;; (find-sh "date +%d/%b/%Y | tr A-Z a-z")
;;
;; This version runs both on *nix and on M$. 2005nov16
(defun date-as-string (&optional arg) (interactive "P")
  "Return the current date as a string; ARG determines the format."
  (cond ((eq arg 1) (downcase (format-time-string "%Y%b%d %k:%M")))
	((eq arg 2) (format-time-string "%Y%b%d %k:%M"))
	((eq arg 3) (format-time-string "%Y%m%d55555")) ; for makecdrdaotoc
	((eq arg 4) (format-time-string "%k:%M:%S "))
	((eq arg 5) (format-time-string "%Y%m%d"))      ; for eev.deb
	((eq arg 7) (format-time-string "%02H:%M"))
	((eq arg 8) (format-time-string "%Y-%m-%d"))
	((eq arg 9) (downcase (format-time-string "%d/%b/%Y %k:%M")))
	(t          (downcase (format-time-string "%Y%b%d")))))

(defun date (&optional arg) (interactive "P")
  "Insert the current date."
  (insert (date-as-string arg)))

;; (eev "dpkg-reconfigure locales")
;; (find-node "(gawk)String Functions")
;; (find-node "(coreutils)Padding and other flags")
;; (find-node "(coreutils)Relative items in date strings")
;; (find-node "(libc)Locale Categories")
;;
(defun Data (&optional yesterday)
  (interactive "P")
  (insert (shell-command-to-string
           (format "LC_ALL=pt_BR \\
                    date -d '%d days' '+%%A, %%-e de %%B, %%Y' \\
                      | awk '{print toupper(substr($0,1,1)) substr($0,2)}'"
		   (if yesterday -1 0)))))

(define-key eev-mode-map "\M-d"  'date)
;; (global-set-key "\M-d" 'date)




;;-------------------------------------------
;; «yank-first-line»  (to ".yank-first-line")
;;
(defun yank-first-line () (interactive)
  "Yanks the first line of the killed text and does a RET.
Insert the first line from the latest kill-ring entry and run the
action associated to the RET key.  The kill-ring entry is then altered
so that subsequent calls of yank-first-line will return successive
lines."
  (let ((bigstr (car kill-ring)))
    (cond ((string-match "^\\([^\n]*\\)\n" bigstr)
	   (let ((firstline (match-string 1 bigstr))
		 (rest (substring bigstr (match-end 0))))
	     (insert firstline)
	     (call-interactively (key-binding "\r"))
	     (setcar kill-ring rest)))
	  ((equal bigstr ""))
	  (t (insert bigstr)
	     (call-interactively (key-binding "\r"))
	     (setcar kill-ring "")))))

(global-set-key "\M-P" 'yank-first-line)



;;---------------------
;; «myip»  (to ".myip")
;; (find-angg ".zshrc" "myip-ppp0")
;; (find-sh  "sudo ifconfig")
;; (find-sh "/sbin/ifconfig")
;; (defun myip () (interactive) (insert (find-zsh0 "myip-ppp0")))
;; (defun myip-as-string ()
;;   (find-sh0 "ifconfig ppp0 | awk 'NR==2' | tr : ' ' | awk '{print $3}'"))
(defun myip-ppp0-as-string ()
  (find-sh0 "ifconfig ppp0 | awk 'NR==2' | tr : ' ' | awk '{print $3}'"))
(defun myip-ppp1-as-string ()
  (find-sh0 "ifconfig ppp1 | awk 'NR==2' | tr : ' ' | awk '{print $3}'"))
(defun myip-eth0-as-string ()
  (find-sh0 "ifconfig eth0 | awk 'NR==2' | tr : ' ' | awk '{print $3}'"))
(defun myip-ppp0 () (interactive) (insert (myip-ppp0-as-string)))
(defun myip-eth0 () (interactive) (insert (myip-eth0-as-string)))

;; (find-efunction 'network-interface-info)
;; (network-interface-info "eth0")
;; (network-interface-info "lo")
;; (network-interface-info "ppp0")
;; (network-interface-info "ppp1")
;; (interface-ip "ppp0")
;; (interface-ip "ppp1")
;;
(defun interface-ip (ifname)
  (let* ((ifinfo (network-interface-info ifname)))
    (if (and ifinfo (car ifinfo))
	(let* ((addr (car ifinfo))
	       (a0 (aref addr 0))
	       (a1 (aref addr 1))
	       (a2 (aref addr 2))
	       (a3 (aref addr 3)))
	  (format "%d.%d.%d.%d" a0 a1 a2 a3)))))

(defun myip-ppp0-or-ppp1-as-string ()
  (or (interface-ip "ppp0") (interface-ip "ppp1")))

(defun myip-as-string () (myip-ppp0-as-string))
(defun myip-as-string () (myip-ppp1-as-string))
(defun myip-as-string () (myip-ppp0-or-ppp1-as-string))
(defun myip () (interactive) (insert (myip-as-string)))

(defun myip-persephone-as-sexp ()
  `(progn (kill-new ,(format "%s persephone" (myip-as-string)))
	  (find-fline "$ASROOT/etc/hosts")))

(defun myip-persephone ()
  (interactive)
  (insert (format "%S" (myip-persephone-as-sexp))))

;; (myip-persephone-as-sexp)
;; (myip-persephone)


(seen 4179)


;;-----------------------------
;; «eeblogme»  (to ".eeblogme")
;;
;; (find-blogmefile "")
(code-c-d "blogme"  "~/blogme/"  :anchor)
(code-c-d "blogme3" "~/blogme3/" :anchor :grep)
(code-c-d "blogme4" "~/blogme4/" "blogme4" :anchor :grep)
(setq ee-file-html   "/tmp/ee.html")

(setq ee-file-blogme "/tmp/ee.blogme")
(setq ee-blogme-prog  "~/blogme/blogme2.lua")
(setq ee-blogme-command
      (format "%s -o %s -i %s" ee-blogme-prog ee-file-html ee-file-blogme))
(setq ee-blogme3-prog "lua51 ~/blogme3/blogme3.lua")
(setq ee-blogme-command
      (format "%s -o %s -i %s" ee-blogme3-prog ee-file-html ee-file-blogme))
(setq ee-blogme-header (format "[htmlize %s\n" ee-file-blogme))
(setq ee-blogme-footer "\n]\n\n[#
 # Local Variables:
 # coding: raw-text-unix
 # modes: (fundamental-mode blogme-mode)
 # End:
 #
 #]
")

;; Check the footer: (eeblogme-now "[ERR]")

;; «eeblogme-now»  (to ".eeblogme-now")
;;
(defun eeblogme (s &optional e)
  (interactive "r")
  (ee-write s e ee-blogme-header ee-blogme-footer ee-file-blogme))

(defun eeblogme-now (s &optional e)
  (interactive "r")
  (eeblogme s e)
  (let ((output (find-sh0 ee-blogme-command)))
    (eev (format "firefox %s" ee-file-html))
    (if (string= output "") (message "ok") (find-estring output))))

;; (eeb-define 'eeblogme-bounded     'eeblogme     'ee-delimiter-hash nil t t)
;; (eeb-define 'eeblogme-now-bounded 'eeblogme-now 'ee-delimiter-hash nil t t)



;;-------------------------------------------------------------
;; «blogme-mode-syntax-table»  (to ".blogme-mode-syntax-table")
;; «blogme-mode»  (to ".blogme-mode")
;; (find-elnode "Syntax Table Functions")
;; (find-eapropos "syntax-table")
;; (with-syntax-table blogme-mode-syntax-table (describe-syntax))
;;
(setq blogme-mode-syntax-table
	(copy-syntax-table text-mode-syntax-table))
(modify-syntax-entry ?\( "." blogme-mode-syntax-table)
(modify-syntax-entry ?\) "." blogme-mode-syntax-table)
(modify-syntax-entry ?{  "." blogme-mode-syntax-table)
(modify-syntax-entry ?}  "." blogme-mode-syntax-table)

;; (find-angg "elisp/hisex.el")
(autoload 'hisex-mode "hisex")
(defface hisex-face '((t :background "red4"))
  "The face used to highlight sexps.")

(defun hisex-mode-off () (interactive) (hisex-mode 0))

;; (find-node "(elisp)Major Mode Basics")
;; (find-efunction 'generic-mode-internal)
(defun blogme-mode ()
  (interactive)
  (kill-all-local-variables)
  (setq major-mode 'blogme-mode)
  (setq mode-name "Blogme")
  (setq font-lock-defaults '())
  (set-syntax-table blogme-mode-syntax-table)
  (add-hook 'change-major-mode-hook 'hisex-mode-off nil 'local)
  (hisex-mode 1))

;;------------------------------------------------/

;; «blogme4»  (to ".blogme4")

;; eepitch-comint-at is defined at:
;; (find-eev "eepitch.el")
;; (find-eev "eepitch.el" "eepitch-comint-at")
;; (find-eev "eepitch.el" nil "eepitch-comint-at")

;; (code-c-d "blogme4" "~/blogme4/" "blogme4" :anchor :grep)
(code-c-d "blogme4" "~/blogme4/" "blogme4" :anchor)
(defun eepitch-blogme4 () (interactive)
  (eepitch-comint-at "~/blogme4/" "blogme4" "lua5.1 -l blogme4 -i"))

;; «dednat5»  (to ".dednat5")
;; (find-dn5 "")
;; (find-dn5 "build.lua")
;; (find-dn5 "options.lua")
;; (find-dn5 "repl.lua")
;; (find-angg "bin/dednat5")
(code-c-d "dn5" "~/dednat5/" :anchor)
;; (defun eepitch-dednat5 () (interactive)
;;   '(eepitch-comint-at "~/dednat5/" "dednat5" "lua5.1 -l dednat5 -i"))
(defun eepitch-dednat5 () (interactive)
  (eepitch-comint "dednat5" "dednat5 -e repl()"))
(defun eepitch-dn5 () (interactive)
  (eepitch-comint "dednat5" "dednat5 -e repl()"))


;;------------------------------------------------/


(defun u8-to-l1 (s e)
  (interactive "r")
  (shell-command-on-region s e "recode u8..l1" nil t))

(defun find-file-this-line () (interactive)
  (find-fline (ee-url-to-fname (buffer-substring (ee-bol) (ee-eol)))))

;; «eevnow»  (to ".eevnow")
;; (find-fline "~/EXPECT/eevsh")
;; (find-eevnewfile "eevsh") <-- not yet
;;
;; (defun eevnow (s e suffix)
;;   (interactive "rsSuffix: ")
;;   (eev s e)
;;   (ee-write "ee\r" nil "" "" "~/eev-0.94/ee.eeg.onsigdo")
;;   (shell-command-to-string
;;    (format "kill -USR1 $(cat ~/eev-0.94/ee.eeg.pid.%s); echo -n $?"
;;            suffix)))

;; (defun eevnow (s &optional e)
;;   (interactive "r")
;;   (eev s e)
;;   (eech "ee\n"))
;;
;; (defmacro ee-at (anchor &rest body)
;;   `(save-excursion
;;      (ee-goto-position (format ee-anchor-format ,anchor))
;;      . ,body))
;;
;; (defmacro ee-at-file (fname anchor &rest body)
;;   (with-current-buffer (find-file-noselect fname)
;;     (apply 'ee-goto-position (format ee-anchor-format ,anchor))
;;     . ,body))



(defmacro if-xemacs    (&rest body) `(when   (featurep 'xemacs) . ,body))
(defmacro if-gnu-emacs (&rest body) `(unless (featurep 'xemacs) . ,body))

(code-c-d "xe"    "/usr/share/xemacs-21.4.15/lisp/" "xemacs21/xemacs")
(code-c-d "xel"   "/usr/share/xemacs-21.4.15/lisp/" "xemacs21/lispref")
(code-c-d "xefaq" "/usr/share/xemacs-21.4.15/lisp/" "xemacs21/xemacs-faq")

;; (find-xenode "")
;; (find-xelnode "")
;; (find-xefaqnode "")



;;---------------------------------------------
;; «dotemacs.private»  (to ".dotemacs.private")
(setq ee-passwords ())
(setq ee-passwords (ee-aset ee-passwords "beth"     "beth"))
(defun eesendpassword (account)
  (interactive "sPassword for: ")
  (eech (concat (ee-aref ee-passwords account) "\n")))

; (find-elnode "Testing Accessibility" "file-readable--p")
; (find-fline "~/.emacs.private")
(if (file-readable-p "~/.emacs.private")
    (load-library    "~/.emacs.private"))




;;-----------------------------------------
;; «find-w3m-links»  (to ".find-w3m-links")
(defun ee-links-for-findxxxw3m-1 (c d path)
  (list (intern (format "find-%sw3m" c))
	(ee-remove-prefix d path)))

(defun ee-links-for-findxxxw3m (path)
  (mapcar (lambda (c-d) (ee-pph (ee-links-for-findxxxw3m-1
				 (car c-d) (nth 1 c-d) path)))
	  (code-c-d-prefixes path)))

(defun find-w3m-links-old (fname &rest rest)
  (interactive (list (or w3m-current-url (buffer-file-name) default-directory)))
  (if (ee-prefixp "file://" fname)
      (setq fname (ee-remove-prefix "file://" fname)))
  (apply 'find-elinks-old
	 (list (ee-links-for-findxxxw3m (ee-expand fname)))
	 rest))

(defun ee-find-xxxw3m-sexps (fname)
  (ee-code-c-d-pairs-eval
   fname
   '(list (ee-intern "find-%sw3m" c) fname-)))

(defun find-w3m-links (fname &rest rest)
  (interactive (list (or w3m-current-url (buffer-file-name) default-directory)))
  (if (ee-prefixp "file://" fname)
      (setq fname (ee-remove-prefix "file://" fname)))
  (apply 'find-elinks
	 `((find-w3m-links ,fname ,@rest)
	   ,(concat "file://" fname)
	   ,fname
	   ,@(ee-find-xxxw3m-sexps (ee-expand fname)))
	 rest))

(define-key eev-mode-map "\M-hw"    'find-w3m-links)
(define-key eev-mode-map "\M-h\M-w" 'find-w3m-links)

(defun find-w3m-anchors (&rest rest)
  (interactive)
  (apply 'find-epp
	 (with-current-buffer "*w3m*"
	   (get-char-property (point) 'w3m-name-anchor2))
	 rest))

(define-key eev-mode-map "\M-h3"    'find-w3m-anchors)
(define-key eev-mode-map "\M-h\M-3" 'find-w3m-anchors)




;;--------[ etc ]--------

;; (find-es "busybox" "busybox-1.2.0")
(code-c-d "busybox" "~/usrc/busybox-1.2.0/")
;; (code-c-d "uclibc" "~/bigsrc/uclibc/uclibc-0.9.26-cvs20040816/")
;; (find-es "anatocc" "uclibc-upstream")
(code-c-d "uclibc" "~/bigsrc/uClibc-0.9.29/" :grep)


;; «safe-local-variable»  (to ".safe-local-variable")
;; (find-elnode "File Local Variables" "safe-local-variable")
;; (find-elnode "Property Lists")
;; (find-elnode "Symbol Plists")
;; (find-egrep "grep -nH -e safe-local *.el")
;; (find-eevgrep "grep -nH -e comment-prefix *.el")
;;
;; (find-efunction 'risky-local-variable-p)
;; (find-es "emacs" "safe-local-variable")
;; (find-elnode "File Local Variables" "`-function'")
;; `ee-temp-bounded-function' isn't used anymore, and the warning is
;; annoying.
;;
(put 'ee-temp-bounded-function 'safe-local-variable t)
(put 'ee-comment-prefix        'safe-local-variable 'stringp)
;; (symbol-plist 'ee-comment-prefix)

;; (code-c-d-anchor "eeva" "$EEVDIR/article/")
;; (code-c-d-old    "eeva" "$EEVDIR/article/" :anchor :xdvi)
;; (find-eevafile "")



;;-----------------------------
;; «source2e»   (to ".source2e")
;; «classes.dtx»  (to ".classes.dtx")
;; (find-es "tex" "source2e.dvi")
;; (find-es "tex" "classes.dtx-dvi")

;; New (2013jan20):
;; (find-fline "/usr/share/doc/texlive-latex-base-doc/latex/base/")
(code-xpdf     "source2e" "/usr/share/doc/texlive-latex-base-doc/latex/base/source2e.pdf" 0)
(code-pdf-text "source2e" "/usr/share/doc/texlive-latex-base-doc/latex/base/source2e.pdf")
(code-xpdf     "classes"  "/usr/share/doc/texlive-latex-base-doc/latex/base/classes.pdf" 0)
(code-pdf-text "classes"  "/usr/share/doc/texlive-latex-base-doc/latex/base/classes.pdf")
;; (find-source2epage)
;; (find-source2etext)
;; (find-classespage)
;; (find-classestext)

;; (find-classespage 36 "the figure environment")
;; (find-classestext 36 "the figure environment")
;; (find-classespage 37 "\\abovecaptionskip")
;; (find-classestext 37 "\\abovecaptionskip")

;; (find-source2epage 'ltoutput)
;; (find-texbookpage 'appendixI)
;; http://lists.gnu.org/archive/html/eev/2005-06/msg00000.html

;; (find-es "tex" "source2e.dvi")
;; (find-source2exdvi "source2e.dvi")
;; (find-source2efile "ltlists.dtx")
;; (find-source2efile "")
;; (find-source2efile "source2e.ind")
;; (find-source2efile "source2e.toc")
;; (find-source2esh "grep dtx source2e.toc")
;; (find-source2epage)
;; (find-source2epage 'ltdefns 2)
;; (find-source2epage 'lttab)

;; (find-eevex "")
;; (find-eevex "tex.e" "find-source2epage")

'(
;; Old:
(code-c-d-old "source2e" "~/usrc/latex/base/" :xdvi)

(defvar ee-source2e-plist
  '(ltdirchk   1 ltplain   13 ltvers    24 ltdefns   26 ltalloc   40
    ltcntrl   42 lterror   46 ltpar     55 ltspace   57 ltlogos   69
    ltfiles   70 ltoutenc  80 ltcounts 112 ltlength 116 ltfssbas 117
    ltfsstrc 137 ltfsscmp 160 ltfssdcl 165 ltfssini 186 fontdef  192
    preload  209 ltfntcmd 213 ltpageno 221 ltxref   222 ltmiscen 226
    ltmath   235 ltlists  245 ltboxes  260 lttab    271 ltpictur 293
    ltthm    315 ltsect   319 ltfloat  329 ltidxglo 345 ltbibl   347
    ltpage   350 ltoutput 353 ltclass  408 lthyphen 426 ltfinal  428
    index    487)
"A plist that says at which page of source2e.dvi each .dtx file begins.
The plist is hand-built from (find-source2esh \"grep dtx source2e.toc\")
and is used by `find-source2epage'.")

;; «find-source2epage»  (to ".find-source2epage")
(defun find-source2epage (&optional pagespec add &rest rest)
  (interactive)
  (let* ((n (plist-get ee-source2e-plist pagespec))
	 (page (if n (+ 9 n (if (numberp add) add 0)) pagespec)))
    (find-source2exdvi "source2e.dvi" page)))

;; (find-eevex "tex.e" "find-texbookpage")

(code-c-d-old "texbook" "~/usrc/texbook/" :xdvi)

(defvar ee-texbook-plist
  '(chapter1    1 chapter2    3 chapter3    7 chapter4   13 chapter5   19
    chapter6   23 chapter7   37 chapter8   43 chapter9   51 chapter10  57
    chapter11  63 chapter12  69 chapter13  85 chapter14  91 chapter15 109
    chapter16 127 chapter17 139 chapter18 161 chapter19 185 chapter20 199
    chapter21 221 chapter22 231 chapter23 251 chapter24 267 chapter25 285
    chapter26 289 chapter27 295
    appendixA 305 appendixB 339 appendixC 367 appendixD 373 appendixE 403
    appendixF 427 appendixG 441 appendixH 449 appendixI 457 appendixJ 483)
"A plist that says at which page of texbook.dvi each chapter begins.
The plist is hand-built from:
  (find-texbookfile \"texbook.tex\" \"1. The Name of the Game. 1.\")
and is used by `find-texbookpage'.")

;; «find-texbookpage-old»  (to ".find-texbookpage-old")
(defun find-texbookpage (&optional pagespec add &rest rest)
  (interactive)
  (let* ((n (plist-get ee-texbook-plist pagespec))
	 (page (if n (+ 11 n (if (numberp add) add 0)) pagespec)))
    (find-texbookxdvi "texbook.dvi" page)))

)

;; «find-texbookpage»  (to ".find-texbookpage")
;; (find-angg ".emacs.papers" "texbook")
;; (find-es "tex" "texbook")
;; (find-texbookfile "")
;; (find-eevex "tex.e" "find-texbookpage")
(code-c-d       "texbook" "~/usrc/texbook/")
(code-dvi       "texbook" (ee-texbookfile "texbook.dvi"))
(code-pdftotext "texbook" (ee-texbookfile "texbook.pdf"))
;; (find-texbookfile "texbook.tex")
;; (find-texbookpage 1)
;; (find-texbooktext)

;; (find-es "tex" "mfbook")
;; (find-mfbookfile "")
(code-c-d       "mfbook" "~/usrc/mfbook/")
(code-dvi       "mfbook" (ee-mfbookfile "mfbook.dvi"))
(code-pdftotext "mfbook" (ee-mfbookfile "mfbook.pdf"))
;; (find-mfbookfile "mfbook.tex")
;; (find-mfbookpage 1)
;; (find-mfbooktext)

;; (find-fline         (ee-amslmathfile ""))
;; (find-pspage        (ee-amslmathfile "amsldoc.pdf"))
;; (find-pspage-links '(ee-amslmathfile "amsldoc.pdf"))
(code-xpdf      "amsldoc" (ee-amslmathfile "amsldoc.pdf"))
(code-pdftotext "amsldoc" (ee-amslmathfile "amsldoc.pdf"))
;; (find-amsldocpage 1)
;; (find-amsldoctext)



;; «wdg»  (to ".wdg")
;; (find-es "html" "wdg-upstream")
;; (find-es "html" "wdg")
;;
;; (code-c-d "wdgref" "/usr/share/doc/wdg-html-reference/reference/")
;; (code-c-d "wdg40"  "/usr/share/doc/wdg-html-reference/reference/html40/")
;; (code-c-d "wdgcss" "/usr/share/doc/wdg-html-reference/reference/css/")
(code-c-d "wdgref" "~/usrc/wdg/")
(code-c-d "wdg40"  "~/usrc/wdg/html40/")
(code-c-d "wdgcss" "~/usrc/wdg/css/")
;;
;; (find-wdgreffile "")
;; (find-wdg40w3m "index.html")
;; (find-wdg40w3m "alist.html")
;; (find-wdgrefw3m "css/index.html")
;; (find-wdgrefw3m "css/structure.html")
;; (find-wdgcssw3m "font/index.html")
;; (find-wdgcssw3m "font/index.html" "backup")
;; (find-wdgcssgrep "grep -niH -e font *")

;; http://www.mozilla.org/docs/dom/domref.pdf
(code-xpdf      "domref" "$S/http/www.mozilla.org/docs/dom/domref.pdf")
(code-pdftotext "domref" "$S/http/www.mozilla.org/docs/dom/domref.pdf")
;; (find-domrefpage         1  "Contents")
;; (find-domrefpage        12  "Testing the DOM API")
;; (find-domrefpage (+ 16  73) "DOM window Reference")
;; (find-domrefpage (+ 26 307) "DOM HTML Elements Reference")
;; (find-domreftext "")



;;---------[ tese de doutorado + etc ]------------
(code-c-d "dout" "/oldfs/7/pandahome/edrx/LATEX/dout/" :anchor)
(code-dvi "dout" "/oldfs/7/pandahome/edrx/LATEX/dout/chapters.dvi")
;; (find-doutfile "")
;; (find-doutpage 1)
(code-c-d "doutslides" "/oldfs/7/pandahome/edrx/LATEX/" :anchor)
(code-dvi "doutslides" "/oldfs/7/pandahome/edrx/LATEX/2003a-slides.dvi")
;; (find-doutslidesfile "")
;; (find-doutslidesfile "2003a-slides.tex")
;; (find-doutslidespage 1)




;;--------[ howm ]--------
;; «howm»  (to ".howm")
;; I am not using Howm anymore - I'm using Org instead.
;; (find-es "howm")
;; (find-fline "~/DTO/.emacs.howm")
;;
;; (code-c-d "howm"        "~/usrc/howm-1.3.2/")
;; (add-to-list 'load-path "~/usrc/howm-1.3.2/")
(code-c-d "howm"        "~/usrc/howm-test/")
(add-to-list 'load-path "~/usrc/howm-test/")
(autoload 'howm-mode "howm" nil t)

;;;_  , howm-view-*
(setq howm-view-summary-persistent nil)
(setq howm-view-contents-persistent nil)
(setq howm-view-keep-one-window t)  ; when you press '1' it sticks
(setq howm-view-summary-name "*howm S:%s*")
(setq howm-view-contents-name "*howm C:%s*")

(require 'howm nil t)
(setq howm-directory "~/HOWM/")
;; (setq howm-file-name-format "%Y-%m-%d.howm")
(setq howm-file-name-format "%Y-%m-%d")
(setq howm-menu-file ".howm")
;; (howm-menu)

;; «howm-create-named-file»  (to ".howm-create-named-file")
;; http://lists.sourceforge.jp/mailman/archives/howm-eng/2005/000010.html
;; (find-howm "")
(defun howm-create-named-file (fname)
  (interactive (list (read-file-name "New howm file: " howm-directory)))
  (cond ((find-buffer-visiting fname) (error "File being visited"))
	((file-exists-p fname)        (error "File already exists"))
	(t (write-region (format "  -*- coding: raw-text -*-\n= %s\n"
				 (file-name-nondirectory fname)) nil
				 fname))))

;; The default binding for (kbd "C-c , a") is howm-list-all - replace
;; it with something that makes it easy to use several directories.
;;
;; (find-ekeymapdescr global-map "C-c , a")
;; (global-set-key (kbd "C-c , a") 'howm-list-all-with-edrx-arg)
;; (global-set-key (kbd "C-c , a") 'howm-list-all)
;; (eek "M-h M-k C-c , a")
;; (find-fline "~/HOMW/")
;; (find-fline "~/HOMW4/")

(defun howm-list-all-with-edrx-arg (arg)
  "Like `howm-list-all', but when invoked with an argument set `howm-directory'.
When ARG is nil use \"~/HOMW/\", when ARG is a number, for
example, 32, use \"~/HOMW32/\"."
  (interactive "P")
  (if arg (setq howm-directory
		(format "~/HOWM%s/" (if (eq arg 0) "" arg))))
  (howm-list-all))

(global-set-key (kbd "C-c , a") 'howm-list-all-with-edrx-arg)

;; (find-howmfile "howm.el" "(require 'riffle)")
;; (find-howmfile "riffle.el" "[backspace] 'scroll-other-window-down")
;; (find-howmfile "riffle.el" "\"\\C-h\" 'scroll-other-window-down")
;; (find-ekeymapdescr riffle-summary-mode-map)

(when (boundp 'riffle-summary-mode-map)
  (remove-from-keymap riffle-summary-mode-map 'backspace)
  (remove-from-keymap riffle-summary-mode-map ?\C-h))

;; (find-howmfile "")
;; (find-howmfile "doc/")
;; (find-howmfile "doc/README.rd")
;; (progn (find-howmfile "doc/README.rd") (howm-mode))
;; (find-howmfile "howm.el")
;; (find-howmfile "howm-mode.el")

;; (find-efunction 'howm-menu)
;; (require 'howm)

;; «hm»  (to ".hm")
;; (defun hm (&optional arg)
;; "Like howm-mode, but shorter, smarter, and more adequate (2005jul29)"
;;   (interactive)
;;   (if (null arg)
;;       (if howm-mode (normal-mode) (howm-mode 1))
;;     (if (> arg 0) (howm-mode 1) (normal-mode))))

;; «find-edrxhowm»  (to ".find-edrxhowm")
;; (code-c-d "edrx" "~/HOWM/")
;; (defun find-edrxhowm (file &rest pos-spec-list)
;;   (interactive (list ""))
;;   (setq howm-directory "~/HOWM/")
;;   (find-edrxfile file)
;;   (unless (string= file "") (hm 1))
;;   (apply 'ee-goto-position pos-spec-list))
;;
;; (defun find-edrxhowm+ (file &rest pos-spec-list)
;;   (interactive
;;    (let ((stuff (ee-no-properties (ee-stuff-around-point "A-Za-z0-9-+_:."))))
;;      ;; (list (read-file-name "Howm page: " "~/HOWM/" "" nil stuff))
;;      (list (read-string "Howm page: " stuff))
;;      ;; (list stuff)
;;      ))
;;   (apply 'find-edrxhowm file pos-spec-list)
;;   (if (= (point-min) (point-max))
;;       (let ((m (buffer-modified-p (current-buffer))))
;;         (insert "= " file "\n")
;;         (set-buffer-modified-p m)))
;;   (hm 1))
;;
;; (define-key eev-mode-map "\M-\r" 'find-edrxhowm+)
;;
;; test on this word: Heroes

;; http://lists.sourceforge.jp/mailman/archives/howm-eng/2005/000004.html
;;
' (defun find-filehowm (file &optional title)
    (find-file (expand-file-name file howm-directory))
    (howm-mode 1)
    (when title
      (goto-char (point-min))
      (re-search-forward (concat "^= +" (regexp-quote title) "$"))))





;; «iheader»  (to ".iheader")
;; See: (find-node "(emacs)File Variables")
;;      (find-node "(emacs)Initial Options" "`--unibyte'")
(defun iheader ()
  (interactive)
  (setq buffer-file-coding-system 'raw-text-unix)
  (insert " -*- encoding: raw-text-unix -*-\n"))

;; «reload»  (to ".reload")
(defun reload ()
  "Reload the current file. Like `normal-mode', but stronger."
  (interactive)
  (let ((bfn (buffer-file-name))
        (lin (line-number-at-pos)))
    (save-buffer)
    (kill-buffer nil)
    (find-fline bfn lin)))




;;---------------------------------
;; «dednat4»  (to ".dednat4")
;; (find-dn4ex "dednat4.el")
;; (find-node "(web2c)tex invocation")
;; (find-node "(kpathsea)Path sources")
;; (find-es "tex" "TEXINPUTS")
;;
;; (find-dednat4 "examples/edrxmain.tex")
;; (find-dn4 "README" "eedn4-lisp")
;; (find-dn4file "")
;; (find-fline "~/LATEX/
;;
;; «dednat4-setup»  (to ".dednat4-setup")
;; (find-dn4ex "")
;; (find-dn4 "dednat4.el")
;; (find-dn4 "downloads/")
;; (find-dn4 "Makefile")
;; (eev "cd ~/dednat4/; make downloads")
;; (find-sh "cd ~/dednat4/; cp -v proof.sty diagxy.tex ~/LATEX/")

(defun eedn4 (s e)
"Write the region between S and E to ~/LATEX/ee.tex and write an
e-script to $EE; then running `ee' in a shell will run
dednat4.lua and after that latex on ~/LATEX/tmp.tex (tmp.tex is a
wrapper around ee.tex) and display the resulting DVI file.
See: (find-efunction 'eedn4)
     (find-fline \"~/LATEX/tmp.tex\")
     (find-fline \"~/LATEX/ee.tex\")"
  (interactive "r")
  (ee-write s e "" "" "~/LATEX/ee.tex")
  (eev "cd ~/LATEX/ &&
        cp -v edrxmain41.tex tmp.tex &&
        ~/dednat4/dednat4.lua tmp.tex &&
        latex tmp.tex &&
        rexdvi tmp.dvi"))

;; (eeb-define 'eedn4-bounded     'eedn4  'ee-delimiter-percent nil t t)
;; (eeb-define 'eedn4-%%-bounded  'eedn4  "\n%%*\n" nil t t)

(defun eedn4-script (&optional dir tmptex prog)
  (ee-template
   `(("~/LATEX/"       ,(or dir    "~/LATEX/"))
     ("edrxmain41.tex" ,(or tmptex "edrxmain41.tex"))
     ("dednat4"        ,(or prog   "~/dednat4/dednat41"))
     ("rexdvi"         ,(or rexdvi "rexdvi")))
   "cd {~/LATEX/} &&
    cp -v {edrxmain41.tex} tmp.tex &&
    {dednat4} tmp.tex &&
    latex tmp.tex &&
    rexdvi tmp.dvi"))

;; (eedn4-script)


;; «eedn4-51»  (to ".eedn4-51")
;; (find-dn4ex "edrxmain41.tex")
;;
(defun eedn4-51 (s &optional e)
  "Same as eedn4, but using lua51"
  (interactive "r")
  (ee-write s e "" "" "~/LATEX/ee.tex")
  (eev "cd ~/LATEX/ &&
    cp -v edrxmain41.tex tmp.tex &&
    ~/dednat4/dednat4 tmp.tex &&
    latex tmp.tex &&
    rexdvi tmp.dvi"))

(defun eedn4-51 (s &optional e)
  "Same as eedn4, but using dednat4, which uses lua51.
See: (eedn4-script \"~/LATEX/\" \"edrxmain41.tex\" \"~/dednat4/dednat41\")"
  (interactive "r")
  (ee-write s e "" "" "~/LATEX/ee.tex")
  (eev (eedn4-script "~/LATEX/" "edrxmain41.tex" "~/dednat4/dednat41")))


;; (eeb-define 'eedn4-51-bounded  'eedn4-51  'ee-delimiter-percent nil t t)

;; «eedn4a»  (to ".eedn4a")
;; (to "dn4-block")
;; (find-dn4ex "edrxmain41a.tex")
;; (find-dn4 "Makefile" "dednat41")
;;
(defun eedn4a (s &optional e)
  "Same as eedn4-51, but using \\documentclass[article]."
  (interactive "r")
  (ee-write s e "" "" "~/LATEX/ee.tex")
  (eev "cd ~/LATEX/ &&
        cp -v edrxmain41a.tex tmp.tex &&
        ~/dednat4/dednat41 tmp.tex &&
        latex tmp.tex &&
        rexdvi tmp.dvi"))

;; (eeb-define 'eedn4a-bounded  'eedn4a  'ee-delimiter-percent nil t t)



(seen 4904)



;;-----------------------
;; «rcirc»  (to ".rcirc")
;; (find-angg ".emacs.mini" "rcirc")
;; (to "erc-freenode-join")
;; (find-es "emacs" "rcirc")
;;
(code-c-d "rcirc" "~/usrc/rcirc/" "rcirc")
;; (add-to-list 'load-path "~/usrc/rcirc/")
;; (add-to-list 'load-path "~/usrc/rcirc/" 'append)
;; (find-rcircnode "")
;; (find-rcircnode "Configuration" "`chanserv'")

;; (require 'rcirc nil 'no-error)

;; (find-rcircnode "Configuration" "\n`rcirc-default-user-name'")
;; (find-rcircnode "Configuration" "\n`rcirc-default-full-name'")
;; (find-rcircnode "Configuration" "`rcirc-authinfo'")
;; (find-evariable 'rcirc-scroll-show-maximum-output)
(setq rcirc-default-user-name      "Eduardo Ochs <http://angg.twu.net/>")
(setq rcirc-default-user-full-name "Eduardo Ochs <http://angg.twu.net/>")
(setq rcirc-authinfo '(("freenode" nickserv "edrx" "Snobol4")
		       ("rizon"    nickserv "edrx" "Snobol4")
		       ))

(defun rcirc-defs () (interactive)
  (require 'rcirc)
  (rcirc-track-minor-mode 1)
  (setq rcirc-read-only-flag nil)
  (setq rcirc-time-format "")
  (setq                      rcirc-prompt "(%n) ")
  (set-face-foreground      'rcirc-prompt "sienna")
  (make-face                'rcirc-mode-line-nick)
  (set-face-bold-p          'rcirc-mode-line-nick nil)
  (set-face-foreground      'rcirc-mode-line-nick "sienna")
  (make-face                'rcirc-track-nick)
  (set-face-inverse-video-p 'rcirc-track-nick nil)
  (set-face-foreground      'rcirc-track-nick "sienna")
  (make-face                'rcirc-nick-in-message-full-line)
  (set-face-bold-p          'rcirc-nick-in-message-full-line nil)
  (setq                      rcirc-scroll-show-maximum-output nil)
  (global-set-key      [f2] 'rcirc-next-active-buffer)
  (define-key rcirc-mode-map (kbd "C-x C-s") 'save-buffer-keep-buffer-name)
  )

(rcirc-defs)

;; (find-rcircfile "")
;; (find-rcircfile "rcirc.el")
;; (find-efunction 'save-buffer)
;; (find-eCfunction 'rename-buffer)
;; (find-elnode "Buffer File Name")
;; (find-elnode "Buffer File Name" "Command: set-visited-file-name")

;; Hackish, mainly for rcirc
;;
(defun save-buffer-keep-buffer-name (&rest args)
  "Like save-buffer, but doesn't changes the buffer name or the major mode."
  (interactive "p")
  (let ((bname (buffer-name))
	(change-major-mode-with-file-name nil))
    (save-excursion (apply 'save-buffer args))
    (rename-buffer bname)))

;; (find-ecolors)
;; (find-efaces "rcirc-special-modeline-face")
;; (find-efunction 'set-face-attribute)
;; (set-face-attribute  'rcirc-special-modeline-face nil :inherit 'mode-line)
;; (set-face-attribute  'rcirc-special-modeline-face nil :inherit nil)

;; Fossils - for old rcircs only
'(

(make-face           'rcirc-special-modeline-face)
(set-face-foreground 'rcirc-special-modeline-face "sienna")

(defun rcirc-activity-string-for-buffer (b)
  "Return how the name of a buffer B looks in the mode-line string."
  (let ((s (rcirc-short-buffer-name b)))
    (with-current-buffer b
      (if (not (eq rcirc-activity-type 'nick))
	  s
	(rcirc-facify s 'rcirc-special-modeline-face)))))

;; (find-rcircfile "rcirc.el" "defun rcirc-update-activity-string")

(defun rcirc-update-activity-string ()
  "Update mode-line string."
  (setq rcirc-activity-string
	(if (not rcirc-activity)
	    ""
	  (concat " [" (mapconcat 'rcirc-activity-string-for-buffer
				  rcirc-activity ",") "]"))))

)

;; Abbreviations for channel names
;; From ayrnieu - 2005aug05
;; http://paste.lisp.org/display/10527

'(
;;; added to rcirc.el
(defvar rcirc-abbreviated-channels nil
  "Alist of channels to specially abbreviate in the modeline.
Each element looks like (CHANNEL . ABBREVIATION).
E.g., ((\"#vectorprogramming\" . \"#vp\")).")

;;; modified in rcirc.el
(defun rcirc-short-buffer-name (buffer)
  "Return a short name for BUFFER to use in the modeline indicator."
  (with-current-buffer buffer
    (let ((bn (or rcirc-target (process-name rcirc-process))))
      (or (cdr (assoc bn rcirc-abbreviated-channels)) bn))))

;;; added to ~/.emacs
(add-to-list 'rcirc-abbreviated-channels '("#emacs-br" . "#eb"))
(add-to-list 'rcirc-abbreviated-channels '("#opensolaris" . "#os"))

)

(defun rcirc-steps ()
  (interactive)
  (rcirc-defs)
  (find-angg ".emacs" "rcirc")
  (message "%S"
   (eesteps '(
     (rcirc-freenode)
     (rcirc-bitlbee)
     (switch-to-buffer "&bitlbee@im.bitlbee.org")
     ;; (eek0 "identify xxx\r")
     (eek0 (format "identify %s\r" (passwds-tcl-get "bitlbee")))
     ))))

(defun rcirc-freenode-old () (interactive)
  (rcirc "irc.freenode.net" 6667 "edrx"
	 '("#debian-rj" "#eev" "#emacs" "#rcirc")))

;; (find-node "(rcirc)Configuration")
;; (rcirc-freenode)
;; (find-efunction 'rcirc)
;; (find-efunction 'rcirc-connect)
;; (rcirc-connect server port nick user-name full-name startup-channels)
;; http://freenode.net/irc_servers.shtml
;; (find-rcircnode "Configuration")
;;
(defun rcirc-freenode () (interactive)
  (rcirc-connect "irc.freenode.net" "6667" "edrx"
		 "Eduardo Ochs <http://angg.twu.net/>"
		 "Eduardo Ochs <http://angg.twu.net/>"
		 '("#eev"
		   ;; "#emacs"
		   ;; "#lua"     ;; "#forth"
		   ;; "#agda" "#clojure" "#retro"
		   ;; "##forth" "#coq" "#maxima" ;; "#forthcafe" "#tcl"
                   ;; "#truta.org" "#omnisys"
		   ;; "#rcirc"
		   ;; "#fvwm"
		   ;; "#ruby-lang"
		   ;; "#debian-rj"
		   ;; "#concatenative" "#debian-br" "#fvwm" "#gimp"
		   ;; "#gnu-smalltalk" "#squeak" "#uclibc" "Txt2tags"
		   )))

(defun rcirc-oftc () (interactive)
  (rcirc-connect "irc.oftc.net" "6667" "edrx"
		 "Eduardo Ochs <http://angg.twu.net/>"
		 "Eduardo Ochs <http://angg.twu.net/>"
		 '("#swig" "#debian-eeepc")))

(defun rcirc-bitlbee () (interactive)
  (rcirc-connect "im.bitlbee.org" "6667" "edrx"))

;; (defun rcirc-defs () (interactive)
;;   (require 'rcirc)
;;   (global-set-key [f2] 'rcirc-next-active-buffer)
;;   ;; (define-key rcirc-mode-map (kbd "C-c C-s") 'rcirc-save-buffer)
;;   (define-key rcirc-mode-map (kbd "C-x C-s") 'save-buffer-keep-buffer-name)
;;   (setq rcirc-time-format "")
;;   (setq rcirc-read-only-flag nil)
;;   (setq rcirc-user-full-name "Eduardo Ochs <http://angg.twu.net/>")
;;   ;; (find-efunction 'rcirc)
;;   ;; (find-efile "net/rcirc.el")
;;   (setq rcirc-prompt "(%n) ")
;;   ;; (find-ecolors)
;;   ;; (set-face-background 'rcirc-prompt-face bg)
;;   (rcirc-track-minor-mode 1)                           ;; new rcirc
;;   (make-face 'rcirc-mode-line-nick)
;;   (set-face-foreground 'rcirc-prompt         "sienna") ;; new rcirc
;;   (set-face-foreground 'rcirc-mode-line-nick "sienna") ;; new rcirc
;;   (set-face-bold-p     'rcirc-mode-line-nick nil)      ;; new rcirc
;;   (setq rcirc-show-maximum-output nil)
;;   (make-face 'rcirc-track-nick)
;;   (set-face-foreground      'rcirc-track-nick "sienna")
;;   (set-face-inverse-video-p 'rcirc-track-nick nil)
;;   (make-face       'rcirc-nick-in-message-full-line)
;;   (set-face-bold-p 'rcirc-nick-in-message-full-line nil)
;;   ;; (progn (setq rcirc-prompt "<%n> ") (rcirc-set-prompt))
;;   )



;;---------------------------------------------------------------
;; a control panel for X (currently only for repeat speed and keymap)

;; «find-xkbprint»  (to ".find-xkbprint")
;; (eev "xkbprint $DISPLAY /tmp/o.ps; gv --orientation=seascape /tmp/o.ps &")
(defun find-xkbprint (&optional server psfile)
  "Display X's current keymap using xkbprint and gv (in background)."
  (if (not server) (setq server (ee-expand "$DISPLAY")))
  (if (not psfile) (setq psfile (ee-expand "~/o.ps")))
  (prog1 (find-sh0 (format "xkbprint %s %s" server psfile))
    (start-process "gv" "*Messages*"
		   "gv" "--orientation=seascape" psfile)))

;; «prep-X»  (to ".prep-X")
;; «prep-all»  (to ".prep-all")
(defun prep-X () (interactive) (find-angg ".emacs" "prep-X"))
(defun prep-all () (interactive) (find-angg ".emacs" "prep-all"))


;; «prep-X-kbdmap»  (to ".prep-X-kbdmap")
;; (find-man "setxkbmap")
;; My default:   (find-sh0 "setxkbmap -model pc104 -layout us")
;; US w/d.k.s:   (find-sh0 "setxkbmap -model pc104 -layout us_intl")
;; ABNT w/d.k.s: (find-sh0 "setxkbmap -model abnt2 -layout br -variant abnt2")
;; (find-xkbprint)
;;
;; Keymap captions:
;; My default:   "Group 1   Layout: pc/pc(pc104)+pc/us        Generic 104"
;; US w/d.k.s:   "Group 1   Layout: pc/pc(pc104)+pc/us_intl   Generic 104"
;; ABNT w/d.k.s: "Group 1   Layout: us(pc101)+br              Generic 101"

;; «prep-X-kbdrate»  (to ".prep-X-kbdrate")
;; (find-es "x" "X-kbdrate")
;; (find-man "1 xset" "repeat rate")
;; Default rate:         (find-sh0 "xset r rate")
;; My preferred setting: (find-sh0 "xset r rate 250 30")
;; Very fast:            (find-sh0 "xset r rate 250 75")

;; (find-angg ".Xdefaults")
;; (find-sh  "cd ~/eev-current/; ./eev-rctool prepare")
;; (find-sh0 "mkdir -p ~/tmp ~/usrc")

;; (find-angg ".Xdefaults")

;; «prep-X-font»  (to ".prep-X-font")
;; (find-sh "xlsfonts")
;; (find-sh "xlsfonts | grep -v ^-")
;; (find-sh "xlsfonts | grep ^terminus")
;; (find-sh "xlsfonts | grep ^terminus | grep bold")
;; (find-sh "xlsfonts | grep ^terminus | grep bold | grep 20\\$")
;; (set-frame-font "fixed")
;; (set-frame-font "terminus-iso8859-1-20")
;; (eev "ae -fn terminus-bold-20")
;; (find-sh0 "xfd -fn ")
;; (find-sh0 "xfd -fn terminus-bold-20")
;; (find-sh0 "xfd -fn terminus-iso8859-1-bold-20")




;;-------------
;; «gnus»  (to ".gnus")
;; (find-es "mail" "dovecot")
;; (find-gnusnode "Index")
;; (find-gnusnode "Index" "nnimap-authinfo-file")
;; (find-fline "~/.authinfo")
;; machine localhost login edrx password xxxx port imap

;; (find-fline "~/DTO/")
;; (find-fline "~/DTO/.gnus")

(code-c-d "gnus" (ee-efile "gnus/") "gnus")

;; (find-node "(gnus)Smileys")
(setq gnus-treat-display-smileys nil)

;; (setq user-mail-address "eduardoochs\100fastmail.fm")
;; (setq user-mail-address "edrx\100mat.puc-rio.br")
(setq user-mail-address "eduardoochs\100gmail.com")
(setq user-full-name "Eduardo Ochs")
(setq gnus-select-method '(nntp "news.gmane.org"))
(setq gnus-secondary-select-methods
      '((nnimap "localhost"
		(nnimap-authenticator login)
		(nnimap-authinfo-file "~/.authinfo")
		(nnimap-stream ssl))))

;; «gnus-quimby»  (to ".gnus-quimby")
;; (find-node "(gnus)Top")
;; (find-node "(gnus)Starting Up")
;; (find-node "(gnus)The First Time")
;; (find-node "(gnus)Startup Files")
;; (find-node "(gnus)Fetching a Group")
(setq gnus-select-method '(nntp "quimby.gnus.org"))
;; Already set:
;; user-full-name
;; user-mail-address

;; «lists.gnu.org»  (to ".lists.gnu.org")
;; http://lists.gnu.org/archive/html/index.html
;; (find-sh "cat  $S/http/lists.gnu.org/archive/html/index.html | grep listName")
;; (find-sh "sort $S/http/lists.gnu.org/archive/html/index.html | grep listName")

;; (find-es "gnus" "browse-foreign-server")
;; (gnus-group-browse-foreign-server '(nntp "quimby.gnus.org"))

;; «gnu.emacs.bugs»  (to ".gnu.emacs.bugs")
;; This group is at quimby and at gmane:
;; (setq gnus-select-method '(nntp "quimby.gnus.org"))
;;      (gnus-fetch-group   "gnu.emacs.bug")
;; http://lists.gnu.org/archive/html/bug-gnu-emacs/
;; (setq gnus-select-method '(nntp "news.gmane.org"))
;;      (gnus-fetch-group   "gmane.emacs.bugs")
;;     http://news.gmane.org/gmane.emacs.bugs
;; http://www.gnu.org/software/emacs/#HelpMailing

;; «gnu.emacs.sources»  (to ".gnu.emacs.sources")
;; This group is at quimby and at gmane:
;; (setq gnus-select-method '(nntp "quimby.gnus.org"))
;;      (gnus-fetch-group           "gnu.emacs.sources")
;; http://lists.gnu.org/archive/html/gnu-emacs-sources/
;; (setq gnus-select-method '(nntp "news.gmane.org"))
;;      (gnus-fetch-group   "gmane.emacs.sources")
;;     http://news.gmane.org/gmane.emacs.sources

;; (gnus-fetch-group   "gnu.emacs.sources")
;; (gnus-fetch-group "gmane.emacs.bugs")

;; «gnu.emacs.devel»  (to ".gnu.emacs.devel")
;; This group is not at quimby (afaik).
;; http://lists.gnu.org/archive/html/emacs-devel/
;; (setq gnus-select-method '(nntp "news.gmane.org"))
;;      (gnus-fetch-group   "gmane.emacs.devel")
;;     http://news.gmane.org/gmane.emacs.devel

;; (setq gnus-select-method '(nntp "quimby.gnus.org"))

;; «gmane.emacs.eev.devel»  (to ".gmane.emacs.eev.devel")
;; http://lists.gnu.org/archive/html/eev/
;; (setq gnus-select-method '(nntp "news.gmane.org"))
;;      (gnus-fetch-group   "gmane.emacs.eev.devel")
;;     http://news.gmane.org/gmane.emacs.eev.devel

;; «comp.lang.forth»  (to ".comp.lang.forth")
;; http://en.wikipedia.org/wiki/Nntp
;; http://www.dmoz.org/Computers/Usenet/Public_News_Servers/
;; http://www.freeusenetnews.com/newssrch.html?group=comp.lang.forth&active=1
;; (setq gnus-select-method '(nntp "dscnews2.dcccd.edu"))
;; (setq gnus-select-method '(nntp "news.cnusenet.org"))
;; (setq gnus-select-method '(nntp "web.aioe.org"))
;;      (gnus-fetch-group   "comp.lang.forth")



;; http://users.pepperfish.org/vivek/unihacks.el
;; http://www.kollektiv-hamburg.de/~forcer/unicode-helper.el
;; http://www.emacswiki.org/cgi-bin/wiki/UnicodeHelperMode



;; s-0 -> C-x 0 -> delete-window
;; s-1 -> C-x 1 -> delete-other-windows
;; s-2 -> C-x 2 -> split-window-vertically
;;
(global-set-key (kbd "s-0") 'delete-window)           ; (eek "M-h M-k C-x 0")
(global-set-key (kbd "s-1") 'delete-other-windows)    ; (eek "M-h M-k C-x 1")
(global-set-key (kbd "s-2") 'split-window-vertically) ; (eek "M-h M-k C-x 2")
(global-set-key (kbd "s-3") 'split-window-horizontally) ; (eek "M-h M-k C-x 3")
(global-set-key (kbd "s-o") 'other-window)            ; (eek "M-h M-k C-x o")
(global-set-key (kbd "s-,") 'prev-buffer)         ; (eek "M-h M-k C-x <left>")
(global-set-key (kbd "s-.") 'next-buffer)         ; (eek "M-h M-k C-x <right>")

(global-set-key "\M-s" 'search-forward)


(setq ibuffer-default-sorting-mode 'major-mode)


;; (defun ei ()
;;   (interactive)
;;   (find-eevfile "doc/eev.texi")
;;   (find-estring
;;    (format "%s\n%S"
;;            (find-sh0 "cd ~/eev-current/doc/; makeinfo eev")
;;            ' (find-node "(eev)Top")
;;            )))


;; «hh»  (to ".hh")
;; (find-angg ".zshrc" "hh")
;; http://article.gmane.org/gmane.emacs.eev.devel/22
;; http://lists.gnu.org/archive/html/eev/2005-07/msg00019.html
(defun hh ()
  (interactive)
  (find-fline "$EEVTMPDIR/hh"))



;; Experimental - an alternative to `to'.
;; 2005aug08. Try these:
;; (index "foo")
;; (index "foo")
;; (index "foo")
' (defun index (str)
    (let ((bigstr (format "(index %S)" str)))
      (or (search-forward bigstr nil 'no-error)
	  (ee-goto-position bigstr))))


(defun unfill-paragraph (&optional arg)
  (interactive "P")
  (let ((fill-column (or arg 99999))) (fill-paragraph nil)))
;;
(global-set-key (kbd "M-Q") 'unfill-paragraph)

;; Recommended by dto:
' (add-hook 'find-file-hook 'auto-insert)

(defun downcase-to-eol ()
  (interactive)
  (downcase-region (point) (point-at-eol)))




;;;;;;
;;
;; find-eregion, find-eunicodeucs
;; 2005aug16
;;
;;;;;;

;; (find-fline "$VWT/o.el")

(defun find-eregion (s e &rest rest)
  (interactive "r")
  (apply 'find-estring (buffer-substring s e) rest))

(defun find-ebuffer-or-output (ee-buffer-name code &rest rest)
  (if (get-buffer ee-buffer-name)
      (apply 'find-ebuffer ee-buffer-name rest)
    (apply 'find-eoutput code rest)))

(defun ee-find-cd-sh (dir command &rest pos-spec-list)
  (find-ebuffer-or-output
   (format "cd %s; %s" dir command)
   `(progn (cd (ee-expand ,dir))
	   (insert (shell-command-to-string ,command))
	   (goto-char (point-min)))
   pos-spec-list))

;; «find-eunicode»  (to ".find-eunicode")
;; «find-eunicodeucs»  (to ".find-eunicodeucs")
;; Inspired by:
;; http://www.kollektiv-hamburg.de/~forcer/unicode-helper.el
;; Try it on this: (find-echarsetchars 'mule-unicode-0100-24ff "733x")
;; Try also this:  (eesteps '((find-eoutput '(ucs-insert "203D")) "M-h M-n"))
;;
;; (find-efunction 'ucs-insert)
;; (find-efile "international/ucs-tables.el")
;;
;; (find-debpkg-links "unicode-data")
(setq ee-unicode-data-file "/usr/share/unicode/UnicodeData.txt") ; <- for etch

(defvar ee-unicode-data-file "/usr/share/unidata/UnicodeData-4.0.1d1b.txt")

(defun find-eunicode (&rest pos-spec-list)
  (apply 'find-fline ee-unicode-data-file pos-spec-list))

(defun find-eunicodeucs (c &rest pos-spec-list)
  (interactive (list (char-after (point))))
  (apply 'find-eunicode (format "\n%04X" (encode-char c 'ucs)) pos-spec-list))

(define-key eev-mode-map "\M-h\M-n" 'find-eunicodeucs)

;; (find-echarsetchars 'mule-unicode-0100-24ff "272x")
;;
(defun ee-to-ucs-link (c)
  (if (>= c 256)
      (format ";; %04X (find-eunicodeucs ?%c)\n"
	      (encode-char c 'ucs) c)
    ""))
(defun eeucs (s e)
  (interactive "r")
  (find-estring (mapconcat 'ee-to-ucs-link (ee-se-to-string s e) "")))


;; (find-elnode "Syntax Tables")
;; (find-esyntaxtable blogme-mode-syntax-table)
;; (find-esyntaxtable text-mode-syntax-table)
;; (find-eapropos "syntax-table")
(defun find-esyntaxtable (syntax-table &rest ignore)
  (with-syntax-table syntax-table (describe-syntax)))


;; (global-set-key (kbd "s-s") 'scroll-bar-mode)
(global-set-key (kbd "s-s") 'toggle-scroll-bar)
(global-set-key (kbd "s-t") 'tool-bar-mode)
(global-set-key (kbd "s-m") 'menu-bar-mode)
(global-set-key (kbd "s-d") 'display-time-mode)

(defalias 'sbm 'scroll-bar-mode)




;; (find-enode "Expanding Abbrevs" "`C-x a e'")
;; (find-enode "Defining Abbrevs" "M-x define-global-abbrev")
(define-global-abbrev "tabular" "\\begin{tabular}{ll}\n\\end{tabular}\n")
(define-global-abbrev "array" "\\begin{array}{ll}\n\\end{array}\n")
;;
' (eesteps '((find-estring "tabular")
	     (eek "C-e")
             (eek "C-x a e")))


;; (defun code-ps (code psfile)
;;   (ee-eval-read-format
;;    "(defun find-%spage (&optional n &rest comments) (interactive)
;;        (find-pspage %S n))"
;;    code psfile))

;; (defun code-dvi (code dvifile)
;;   (ee-eval-read-format
;;    "(defun find-%spage (&optional n &rest comments) (interactive)
;;        (find-dvipage %S n))"
;;    code dvifile))

;; «diagxy»  (to ".diagxy")
;; (find-angg ".emacs.papers" "diagxy")
;; (find-es "xypic" "diagxy")
(code-c-d       "diagxy" "~/usrc/diagxy/")
(code-dvi       "diagxy" "~/usrc/diagxy/diaxydoc.dvi")
(code-pdftotext "diagxy" "~/usrc/diagxy/diaxydoc.pdf")
;; (find-efunction 'find-dvipage)
;; (find-efunction 'find-dvipagenow)
;; (find-diagxypage)
;; (find-diagxyfile "")
;; (find-diagxypage 25)
;; (find-diagxyfile "diaxydoc.tex" "\\two/<-`->/<100>")


;; «libgtk-docs»  (to ".libgtk-docs")
;; (find-angg ".eev/HELP-gtk")
;; (find-status   "libgtk2.0-doc")
;; (find-vldifile "libgtk2.0-doc.list")
;; (find-udfile   "libgtk2.0-doc/")
;; (find-libgtkdocfile "")
(code-c-d "libgtkdoc" "/usr/share/doc/libgtk2.0-doc/")
(code-c-d "gdkdoc"    "/usr/share/doc/libgtk2.0-doc/gdk/")
(code-c-d "gtkdoc"    "/usr/share/doc/libgtk2.0-doc/gtk/")
(code-c-d "gtkfaqdoc" "/usr/share/doc/libgtk2.0-doc/gtk-faq/")
(code-c-d "gtktutdoc" "/usr/share/doc/libgtk2.0-doc/gtk-tutorial/")
;; (find-gdkdocfile "")
;; (find-gtkdocfile "")
;; (find-gtkfaqdocfile "")
;; (find-gtktutdocfile "")
;; (find-gdkdocw3m "index.html")
;; (find-gdkdocw3m "ix01.html")
;; (find-gtkdocw3m "index.html")
;; (find-gtkdocw3m "ix01.html")
;; (find-gtkfaqdocw3m "book1.html")
;; (find-gtktutdocw3m "book1.html")



;; (find-es "lua5" "pil")
;; (find-pilw3m "index.html")
;; (find-pilw3m "4.3.5.html" "Generic for")
(code-c-d "pil" "$S/http/www.lua.org/pil/")


(seen 5352)

;; «luamanual»  (to ".luamanual")
(code-c-d "luamanual" "/usr/share/doc/lua50-doc/manual/manual.html")
(if (file-exists-p (ee-luafile "doc/manual2.html"))
    (code-c-d "luamanual" (ee-luafile "doc/manual2.html"))
  )
;; (find-luamanualw3m "")
;; (find-luamanualw3m "#pm")
;; (find-luamanualw3m "#pdf-string.len")

(seen 5500)


;; «luamanual-51»  (to ".luamanual-51")
;; (find-lua51file "doc/")
(code-c-d "luamanual" (ee-lua51file "doc/manual.html"))

;; (defun find-luamanualw3m+ (&optional tag &rest rest)
;;   (interactive (list (read-string "Section (anchor) of the Lua manual: "
;;                                   (ee-stuff-around-point "0-9A-Za-z_.:"))))
;;   (apply 'find-luamanualw3m
;;          (if (equal tag "") "" (concat "#" tag))
;;          rest))

(seen 5511)


;; (ee-luamanual-url)
;; (ee-luamanual-url "")
;; (ee-luamanual-url "3.14")
(defun ee-luamanual-url (&optional tag)
  (if (equal tag "") (setq tag nil))
  (format "file://%s%s" ee-luamanualdir (if tag (concat "#" tag) "")))

(defun find-luamanualw3m+ (&optional tag &rest rest)
  (interactive (list (read-string "Section (anchor) of the Lua manual: "
				  (ee-stuff-around-point "0-9A-Za-z_.:"))))
  (apply 'find-w3m (ee-luamanual-url tag) rest))

;; «find-luamanual-ff»  (to ".find-luamanual-ff")
;; (find-luamanual-ff "3.14")
(defun find-luamanual-ff (&optional tag)
  (interactive (list (read-string "Section (anchor) of the Lua manual: "
				  (ee-stuff-around-point "0-9A-Za-z_.:"))))
  (find-firefox-bg (ee-luamanual-url tag)))

(define-key eev-mode-map "\M-h\M-l" 'find-luamanualw3m+)
(define-key eev-mode-map "\M-h\M-L" 'find-luamanual-ff)

(code-c-d "luagtk" "~/usrc/lua-gtk2-0.3/")
;; (find-luagtkfile "")
;; (find-es "lua5" "luagtk")
;; (find-es "lua5" "luagtk_pixmaps")


(defun re (&rest rest) (interactive)
  (apply 'find-sh "wget -q -O - http://angg.twu.net/re" rest))

;; (find-eevfile "eev-langs.el" "ee-gdb-start")
;; (find-eevfile "eev.el" "setq code-c-d-keywords")

;; (defun ee-gdb-start (dir &optional fname)
;;   (if (= emacs-major-version 21)
;;       (gdb (format "gdb %s%s" dir (or fname "")))
;;     (gdb (format "gdb --annotate=3 %s%s" dir (or fname ""))))
;;   (eegud-keys-mode))

;; (defun eeb-gdb-start (dir &optional fname)
;;   (eegdb-bounded)
;;   (ee-gdb-start dir fname))

;; (add-to-alist 'code-c-d-keywords
;;   '(:gdb
;;     (ee-eval-read-format "
;;        (defun eeb-%sgdb-start (&optional fname)
;;          (ee-use-%s-tags)
;;          (eeb-gdb-start ee-%sdir fname))" c c c)
;;     (code-c-d-rest (cdr rest))))

;; (find-rcircfile "rcirc.el" "defface rcirc-prompt-face")

(code-dvi "uff" "~/LATEX/2005oct20-seminar.dvi")
;; (code-c-d "uff" "~/LATEX/")
(defun find-uff (&rest rest) (interactive)
  (apply 'find-anchor "~/LATEX/2005oct20-seminar.tex" rest))

;; (find-uffpage 1)
;; (find-uff)

(code-dvi "2002cms"  "$S/http/angg.twu.net/math/2002cms.dvi.gz")
(code-dvi "2002fmcs" "$S/http/angg.twu.net/math/2002fmcs.dvi.gz")
;; (find-2002cmspage)
;; (find-2002fmcspage)



;; «color-theme»  (to ".color-theme")
;; (find-fline "~/elisp/color-theme.el")
;; (find-fline "~/DTO/color-theme-stanley-mk91.el")
;;
;; (require 'color-theme)
;; (load "~/DTO/color-theme-stanley-mk91.el")
;; (color-theme-stanley-mk91)

(defun color-theme-snap (name)
  "Write this color theme to a snapshot file."
  (interactive "MName of color-theme: ")
  (let* ((theme  (concat "color-theme-" name))
	 (file (concat dto/eefolder "/" theme ".el")))
    (progn (color-theme-print)
	   (replace-string "my-color-theme" theme)
	   (write-file file nil)
	   (eval-buffer))))


(seen 5599)

;; «my-make-face»  (to ".my-make-face")
;; (find-efaces)
;; (find-efacedescr 'variable-pitch)
;; (find-node "(elisp)Face Attributes")
;;
(defun my-make-face (face frame &rest args)
  (make-face face)
  (face-spec-reset-face face frame)
  (apply 'set-face-attribute face frame args)
  face)

;; (my-make-face 'my-face nil :foreground "#ffbc03" :inherit 'variable-pitch)
;; (put-text-property (point) (ee-search-forward "\n;;-\n") 'face 'my-face)
;; Blah Blah Blah
;;-

;; «myxpm»     (to ".myxpm")
;; «find-xpm»  (to ".find-xpm")
;; (find-angg "elisp/myxpm.el")
(autoload 'find-myxpm        "myxpm" nil t)
(autoload 'find-myxpmscaled  "myxpm" nil t)
(autoload 'find-myxpmscaled+ "myxpm" nil t)





;; (find-sh0 "convert ~/.eev/ee.xpm /var/www/favicon.ico")
;; (find-sh0 "convert ~/.eev/ee.xpm ~/favicon.ico")
;; (find-sh0 "convert ~/.eev/ee.xpm ~/eev-current/favicon.png")
;; (find-sh0 "display /var/www/favicon.ico")




;;;;;;
;;
;; Links for a symbol
;;
;;;;;;

;; (find-elnode "Symbol Components" "The four functions")
;; Links for a symbol: the four cells of the symbol, apropos, its
;; entry in the elisp manual, maybe its entries at the emacs manual
;; too... are there any alists or stuff the define where they have
;; been defined?




;;;;;;
;;
;; Links to all the active keymaps (minor modes, major, etc)
;; 2005nov11
;;
;;;;;;

;; (find-elnode "Minor Modes")
;; (find-elnode "Keymaps and Minor Modes")
;; (find-elnode "Active Keymaps")
;; (ee-active-minor-modes-having-keymaps)
;; (ee-minor-mode-keymap 'eev-mode)
;; (find-eminormodekeymapdescr 'eev-mode)
;; (find-ekeymapdescr (ee-minor-mode-keymap 'eev-mode))

;; Moved to eev.el
;; (defun ee-minor-mode-keymap (mode-symbol)
;;   (cdr (assq mode-symbol minor-mode-map-alist)))

;; (find-eev "eev-blinks.el" "find-eminorkeymapdescr")

' (defun find-eminormodekeymapdescr (mode-symbol &rest rest)
    (apply 'find-ekeymapdescr (ee-minor-mode-keymap mode-symbol) rest))

(defun ee-active-minor-modes-having-keymaps ()
  (delq nil (mapcar (lambda (m) (if (symbol-value m) m))
		    (mapcar 'car minor-mode-map-alist))))

;; (find-efunctionpp 'howm-view-summary-mode)
;; (find-howmfile "howm-view.el" " howm-view-summary-mode")
;; (find-efunctiond 'fundamental-mode)
;; (find-efunctiond 'emacs-lisp-mode)

;; Missing: a find-xxx-links function that creates links to the major
;; mode (symbol, pp, d, etc), to its keymap, and to all the keymaps of
;; active minor modes

;; Idea: I can use local variables at the *elisp hyperlinks* buffer to
;; store variables from the buffer where we came from... I need a
;; prefix for those vars.

(seen 5688)



;;;;;;
;;
;; ee-other-buffer
;; 2005nov12
;;
;;;;;;

;; (with-current-buffer nil default-directory)
;; (with-current-buffer "tmp" default-directory)
;; (setq ee-other-buffer "...")
;; (find-xxx (ee-other-buffer ...))

(defvar ee-other-buffer nil)
(make-variable-buffer-local 'ee-other-buffer)

(defmacro ee-other-buffer (&rest sexps)
  `(with-current-buffer ee-other-buffer . ,sexps))



;; (find-angg ".emacs.local.w32")
(when (eq window-system 'w32)
  (load-library  "~/.emacs.local.w32"))


;; «smalltalk»  (to ".smalltalk")
;; (find-es "smalltalk" "gnu-smalltalk")
;; (find-es "squeak")
(code-c-d "gst"     "/usr/share/gnu-smalltalk/" "gst")
(code-c-d "gstbase" "/usr/share/gnu-smalltalk/" "gst-base")
(code-c-d "gstlibs" "/usr/share/gnu-smalltalk/" "gst-libs")
;; (find-gstfile "")
;; (find-gstfile "examples/")
;; (find-gstfile "examples/README")
;; (find-gstnode "")
;; (find-gstnode "Invocation")
;; (find-gstnode "Syntax")
;; (find-gstnode "Namespaces")
;; (find-gstnode "Disk file-IO")
;; (find-gstnode "Blox")
;; (find-gstnode "Seaside")
;; (find-gstnode "SUnit")
;; (find-gstnode "Editing")
;; (find-gstnode "Interactor")
;; (find-gstnode "Tutorial")
;; (find-gstnode "Files")
;; (find-gstnode "Arrays")
;; (find-gstnode "Dictionaries")
;; (find-gstlibsnode "BLOX package")
;; (find-gstbasenode "Array")

;; (code-c-d "gst" "~/usrc/smalltalk-2.1.9/" "~/usrc/smalltalk-2.1.9/doc/gst")
;; (code-c-d "gstlibs" "" "~/usrc/smalltalk-2.1.9/doc/gst-libs")
;; (code-c-d "gstbase" "" "~/usrc/smalltalk-2.1.9/doc/gst-base")
;; (find-gstnode "")
;; (find-gstlibsnode "")
;; (find-gstbasenode "")
;; (find-gstbasenode "Base classes")
;; (find-gstnode "Arrays")
;; (find-gstnode "Math in Smalltalk")

;; For gst and smalltalk-mode:
;; (find-gstfile "")
;; (find-gstfile "smalltalk-mode.el")
;; (find-gstfile "gst-mode.el")
;; (add-to-list 'load-path "~/usrc/smalltalk-2.1.9/")
;; (autoload 'smalltalk-mode "smalltalk-mode" nil t) ; GNU SmallTalk
;; (autoload 'gst            "gst-mode" nil t)       ; GNU SmallTalk

;; «visualworks»  (to ".visualworks")
;; (find-es "smalltalk" "visualworks")
(code-c-d "visualworksdoc" "~/vw7.8nc/doc/")
;; (find-visualworksdocfile "")
(code-xpdf      "vwwalkthrough" (ee-visualworksdocfile "WalkThrough.pdf"))
(code-pdftotext "vwwalkthrough" (ee-visualworksdocfile "WalkThrough.pdf"))
;; (find-vwwalkthroughpage      3  "Contents")
;; (find-vwwalkthroughpage (+ 1 1) "Index")
;; (find-vwwalkthroughtext "")

(code-xpdf      "vwinstall" "~/vw7.8nc/Install.pdf")
(code-pdftotext "vwinstall" "~/vw7.8nc/Install.pdf")
;; (find-vwinstallpage      3  "Contents")
;; (find-vwinstallpage      9  "Running the VisualWorks Installer")
;; (find-vwinstallpage     13  "Launching from the Command Line")
;; (find-vwinstallpage (+ 1 1) "Index")
;; (find-vwinstalltext "")



;; (car grep-history)
;; (find-grep ee-preemgstondir "grep -niH -e bprra *")
;; (find-code-c-d "preemgston" "~/src/mvgest/preemgston/" :grep)



;; For some reason in W$ f10 is bound to something else.
;;
(global-set-key (kbd "<f10>") 'tmm-menubar)



;; (find-angg ".emacs" "date")
(defun org-today-file-name (&optional date)
  (format "~/ORG/%s.org" (downcase (format-time-string "%Y-%m-%d"))))

(defun coding-footer () (interactive)
  (insert (format (concat
   "\n"
   "%sLocal Variables:\n"
   "%scoding: %S\n"
   "%sEnd:\n")
   ee-hyperlink-prefix ee-hyperlink-prefix buffer-file-coding-system
   ee-hyperlink-prefix)))

(defun org-footer () (interactive)
  (insert
   "\n"
   "* Local variables:\n"
   "\f\n"
   "#  Local Variables:\n"
   "#  coding: raw-text-unix\n"
   "#  modes: (my-org-mode emacs-lisp-mode)\n"
   "#  End:\n"))

(defun c-footer () (interactive)
  (insert
   "\n\f\n"
   "/*\n"
   " * Local variables:\n"
   " * coding: raw-text-unix\n"
   " * c-file-style: \"ellemtel\"\n"
   " * End:\n"
   " */\n"
   ))


;; «terminus» (to ".terminus")
;; Tests:
;; (set-frame-font "5x7" t)
;; (set-frame-font "6x13" t)
;; (ee-set-font-terminus 320)
;; (ee-set-font-terminus 200)
;; (ee-set-font-terminus 160)
;;
(defun ee-set-font-terminus (height)
  (set-frame-font "6x13" t)   ; to override the last ee-set-frame-font
  (set-face-attribute 'default nil :height height)
  (set-face-attribute 'default nil :family "Terminus"))




;; «find-sidebyside»  (to ".find-sidebyside")
(defun find-sidebyside (sexp1 sexp2)
  (eek "C-x 1")       (eval sexp1)
  (eek "C-x 3 C-x o") (eval sexp2))

' (find-sidebyside
   ' (find-rfcfile "rfc3550.txt")
   ' (find-rfcfile "rfc3551.txt")
     )

;; «eejump-define»  (to ".eejump-define")
;; «eejump-plists»  (to ".eejump-plists")
;; «eejump»  (to ".eejump")
;; (define-key eev-mode-map "\M-j" 'eejump)
;; (find-eev "eejump.el" "eejump-*")
(require 'eejump)

;; (defun eejump-* () (find-efunction 'eejump-*))
(defun eejump-1*  () (find-efunction 'eejump-1*))
(defun eejump-10  () (ee-set-frame-font "5x7"   t))
(defun eejump-11  () (ee-set-frame-font "fixed" t))
(defun eejump-11  () (ee-set-frame-font "6x13" t))
(defun eejump-110 ()    (set-frame-font "6x13" t))
(defun eejump-15  () (ee-set-font-terminus 180))
(defun eejump-16  () (ee-set-font-terminus 200))
(defun eejump-17  () (ee-set-font-terminus 320))
(defun eejump-111 () (find-wset "12_o_" '(eejump-1) '(eejump-0)))

(defun eejump-2* () (find-efunction 'eejump-2*))

(defun eejump-24  () (find-blogme4 ""))
(defun eejump-24* () (find-efunction 'eejump-24*))
(defun eejump-240 () (find-blogme4 "README"))
(defun eejump-241 () (find-blogme4 "blogme4.lua"))
(defun eejump-242 () (find-blogme4 "Makefile"))
(defun eejump-244 () (find-blogme4 "anggdefs.lua"))
(defun eejump-245 () (find-blogme4    "elisp.lua"))
(defun eejump-246 () (find-blogme4 "angglisp.lua"))
(defun eejump-248 () (find-blogme4 "doc/blogme4.b4texi"))
(defun eejump-249 () (find-blogme4 "doc/eev.b4texi"))

(defun eejump-23  () (find-blogme3 ""))
(defun eejump-24  () (find-blogme3 "anggdefs.lua"))
(defun eejump-25  () (find-blogme3 "youtube.lua"))
(defun eejump-255 () (find-TH "videos-locais"))
(defun eejump-26  () (find-blogme3 "anggmake.lua"))
(defun eejump-200 () (find-angg "TH/blogme3.blogme"))

;; (defun eejump-235 () (find-blogme3    "elisp.lua"))
;; (defun eejump-236 () (find-blogme3 "angglisp.lua"))

(defun eejump-20  () (find-booksfile ""))
(defun eejump-201 () (find-booksfile "__alg/__alg.el"))
(defun eejump-202 () (find-booksfile "__analysis/__analysis.el"))
(defun eejump-203 () (find-booksfile "__cats/__cats.el"))
(defun eejump-204 () (find-booksfile "__comp/__comp.el"))
(defun eejump-205 () (find-booksfile "__etc/__etc.el"))
(defun eejump-206 () (find-booksfile "__frege/__frege.el"))
(defun eejump-207 () (find-booksfile "__habermas/__habermas.el"))
(defun eejump-208 () (find-booksfile "__logic/__logic.el"))
(defun eejump-209 () (find-booksfile "__modal/__modal.el"))
(defun eejump-210 () (find-booksfile "__phil/__phil.el"))
(defun eejump-211 () (find-booksfile "__piaget/__piaget.el"))
(defun eejump-212 () (find-booksfile "__politics/__politics.el"))
;; (defun eejump-204 () (find-angg "TH/blogme3-angg.blogme"))
  ;;
  ;; (find-blogme3 "lstoindexhtml.lua")
  ;; (find-blogme3 "notes.e.lua")
  ;; (find-blogme3 ".files.sh")
  ;; (find-blogme3 "Makefile")
  ;;
  ;; 24 (find-TH "emacs"  "a-2D-map-of-eev")
  ;; 241 (find-angg "DAVINCI/intro.lua")
  ;; 242 (find-angg "TH/davinci.blogme")
  ;; 25  (find-es   "iup")

(defun eejump-3* () (find-efunction 'eejump-3*))
(defun eejump-30 () (find-es "lua5"))
(defun eejump-300 () (find-angg "LUA/lua50init.lua"))
(defun eejump-301 () (find-angg "eev-puro/mini-lua-intro.e"))
(defun eejump-302 () (find-dn5 "eoo.lua"))
(defun eejump-3000 () (find-es "lua-intro"))
(defun eejump-3001 () (find-es "lua-intro"))
(defun eejump-302 () (find-es "lua-intro" "bytecode:captures"))

  ;; 32  (find-angg "LUA/canvas2.lua")
  ;; 33  (find-angg "LUA/canvas3.lua")
(defun eejump-31 () (find-es "lua5" "lpeg-quickref"))
(defun eejump-32 () (find-angg "eev-puro/"))
  ;; 32 (find-angg "LUA/middle-c.lua")
  ;; 33 (find-angg "peek/ctypes.lua")
(defun eejump-33 () (find-angg "peek/ctypes2.lua"))
(defun eejump-34 () (find-LATEX "2011ebl-abs.tex"))
(defun eejump-35 () (find-LATEX "2011ebl-slides.tex"))
(defun eejump-36 () (find-fline "~/tmp/abstract_EBL_2011_ochs.tex"))
  ;; 32 (find-angg "CV/cv-edrx-2008-pt.tex")
  ;; 33 (find-miniforth "miniforth5.lua")
  ;; 34  (find-angg "TH/miniforth-article.blogme")
  ;; 333 (find-miniforth "miniforth6.lua")
  ;; 33  (find-es "lua5" "xpcall")
  ;; 333 (find-fline "~/ORG/Categories.org")
  ;; 34  (find-es "kepler")
  ;; 34 (find-fline "$S/http/primero.ricilake.net/lua/ldb.lua")
  ;; 37  (find-angg "LUA/luatclbridge.c")
(defun eejump-37 () (find-angg "CV/cv-edrx-2010-pt.tex"))
(defun eejump-377 () (find-angg "LUA/interactive.lua"))
(defun eejump-38 () (find-angg "TH/luainteractive.blogme"))
(defun eejump-384 () (find-angg "LATEX/chaui-hch.tex"))
(defun eejump-39 () (find-angg "elisp/cheap-face.el"))

(defun eejump-4* () (find-efunction 'eejump-4*))
(defun eejump-4  () (find-angg ".zshrc"))
(defun eejump-44 () (find-angg "quadradinho/"))
(defun eejump-444 () (find-angg "quadradinho/quadradinho-texto.tex"))
(defun eejump-4444 () (find-xpdfpage "~/quadradinho/quadradinho-a5.pdf"))
(defun eejump-445 () (find-angg "quadradinho/quadradinho-a5.tex"))
(defun eejump-446 () (find-angg "quadradinho/quadradinho-print.tex"))
(defun eejump-466 () (find-fline "~/AGENDA/telefones"))
(defun eejump-42 () (find-angg "LATEX/2009dnc-in-coq.tex"))
(defun eejump-43 () (find-TH "math-b"))
(defun eejump-433 () (find-xpdfpage "~/PURO/diarios_de_classe/dclas_2009-10-C2.pdf"))
  ;44  (find-es "netbsd" "cvs-emacs-at-caramelo")
  ;44  (find-dn4 "dednat4.el")
  ;; (defun eejump-444 () (find-dn4 "dednat4.lua"))
  ;(defun eejump-44 () (find-dn4 "experimental.lua"))
(defun eejump-443 () (find-dn4 "Makefile" "dednat4" "make cleanscripts"))
(defun eejump-4433 () (find-sh  "cd ~/dednat4/; make cleanscripts; make S=$S scripts"))
 ;; (defun eejump-445 () (find-dn4 "examples/"))
(defun eejump-45 () (find-dn5 ""))
(defun eejump-46 () (find-gab "gab.lua"))
(defun eejump-47 () (find-gab "gab-tests.lua"))
  ;; 46   (find-dn5 "gab.lua")
  ;; 47   (find-dn5 "gab-tests.lua")
  ;; 46   (find-dn5 "gabriela.lua")
  ;; 47   (find-dn5 "gabriela-app.lua")
(defun eejump-49 () (find-3 '(find-gab "gab.lua") '(find-gab "gabriela-tests.lua")))
(defun eejump-452 () (find-3 '(find-blogme4 "build.lua") '(find-dn5 "build.lua")))
(defun eejump-455 () (find-dn5 "dednat5.lua"))
(defun eejump-456 () (find-dn5 "tests/"))
(defun eejump-453 () (find-dn5 "tests/test3.tex"))
(defun eejump-46 () (find-dn4 "newtrees.lua"))
  ;; 46   (find-dn4 "Makefile")
(defun eejump-48 () (find-dn4ex "edrx08.sty"))

(defun eejump-5*  () (find-efunction 'eejump-5*))
(defun eejump-5   () (find-eev-intro))
(defun eejump-50  () (find-eev "eev-readme.el"))
(defun eejump-500 () (find-eevfile "eejump.el" "eejump-*"))
;;
(defun eejump-51  () (find-eev "eev-intro.el"))
(defun eejump-511 () (find-eev "eev-code.el"))
;; (defun eejump-51 () (find-angg "TEXINFO/eev.texi.lua"))
;; (defun eejump-511 () (find-TH   "2011-maio"))
(defun eejump-512 () (find-TH   "2011-cuv-quorum"))
	;; 511 (find-node "(eev)introduction")
(defun eejump-508 () (find-dn4ex "edrx08.sty"))
(defun eejump-52  () (find-angg ".emacs.papers"))
(defun eejump-53  () (find-angg ".emacs.templates"))
(defun eejump-54  () (find-angg ".emacs.audios"))
(defun eejump-535 () (find-eev "eev-mini-steps.el"))
(defun eejump-545 () (find-eev "eepitch.readme"))
(defun eejump-55  () (find-angg ".emacs"))
(defun eejump-550 () (find-angg ".emacs.mini"))
(defun eejump-56 () (find-eev "eev-links.el"))
;; (defun eejump-57 () (find-eev "eev-template.el"))
(defun eejump-57 () (find-angg "eev-videos/1.sh"))
;; (defun eejump-58 () (find-eev  "eev-readme.el"))
;; (defun eejump-59 () (find-angg "eev-intros/README"))
	;58 (find-eev "eev-pdfpages.el")
	;56 (find-eev "eev-sshot.el")
(defun eejump-56 () (find-es  "eev"))
(defun eejump-58 () (find-eejumps))
(defun eejump-590 () (find-eev "eev-code-old.el"))
(defun eejump-551 () (find-eev2-links))
(defun eejump-552 () (find-eev "eev2-all.el"))
(defun eejump-554 () (find-es "eev" "dh-make-2"))
(defun eejump-555 () (find-eev ""))
(defun eejump-5554 () (find-eev "debian/"))

(defun eejump-7* () (find-efunction 'eejump-7*))
;; (defun eejump-70 () (find-fline "~/ORG/Lyrics.org"))
(defun eejump-70 () (find-TH "javascript"))
(defun eejump-70 () (find-fline "~/ORG/lyrics.org"))
(defun eejump-71  () (find-LATEX ""))
(defun eejump-711 () (find-LATEX "2013-montreal.tex"))
(defun eejump-72 () (find-fline "~/tmp/"))
(defun eejump-73 () (find-fline "~/e/"))
(defun eejump-75 () (find-fline "/sda5/videos/"))

(defun eejump-1 () (find-fline (or (getenv "TODOFILE") "~/TODO")))
(defun eejump-12 () (find-blogme4 "doc/eev.b4texi"))
(defun eejump-13 () (find-TH "eev-article"))
        ;;
(defun eejump-120 () (find-ebuffer "*irc.freenode.net*"))
(defun eejump-12 () (find-ebuffer "cfa@irc.freenode.net"))
(defun eejump-121 () (eepitch '(find-ebuffer "cfa@irc.freenode.net")))
(defun eejump-122 () (find-es "clojure"))

(defun eejump-19 () (psne-log))
(defun eejump-6* () (find-efunction 'eejump-6*))
(defun eejump-65 () (find-TH "2012-greve-fontes-primarias"))

(defun eejump-6 () (find-freenode "#eev"))
(defun eejump-66 () (find-freenode-3a "#eev"))
(defun eejump-67 () (find-freenode "#labmacambira"))

;; (defun eejump-6  () (find-ebuffer "#eev@irc.freenode.net"))
;; (defun eejump-67 () (find-ebuffer "#rcirc@irc.freenode.net"))
;; (defun eejump-67 () (find-ebuffer "#node.js@irc.freenode.net"))
;; (defun eejump-67 () (find-ebuffer "#metareciclagem@irc.freenode.net"))
;; (defun eejump-67 () (find-ebuffer "#labmacambira@irc.freenode.net"))
;; (defun eejump-67 () (find-freenode "#labmacambira"))
(defun eejump-677 () (find-es "javascript"))
;; (defun eejump-66 () (progn (rcirc-defs) (find-freenode)))
;; (defun eejump-66 () (progn (rcirc-defs) (find-2a nil '(find-freenode))))
(defun eejump-68 () (progn (find-es "gnome" "gwm-keys") (eek "M-0 C-l")))
(defun eejump-69 () (find-2a nil '(find-ebuffer eepitch-buffer-name)))

;; (find-eev "eev-rcirc.el")
(setq ee-freenode-channels '("#eev" "#yfl" "#metareciclagem"))
(setq ee-freenode-channels
      '("#eev" "#metareciclagem" "#labmacambira"
	;; "#youtube-dl"
	"#org-mode"
	"#git" "#emacs"
	"#matehackers"
	))
;; (rcirc-defs)
;; (find-freenode)

(defun eejump-8* () (find-efunction 'eejump-8*))
(defun eejump-8 () (find-es "page" "upload-edrx.tgz-with-rsync"))
(defun eejump-80   () (find-TH "2014.1"))
(defun eejump-800  () (find-TH "2013.2"))
(defun eejump-8000 () (find-es "puro"))
(defun eejump-81   () (find-TH "2014.1-GA"))
(defun eejump-811  () (find-TH "2013.2-GA"))
(defun eejump-8111 () (find-TH "2013.1-GA"))
(defun eejump-810  ()
  (find-3a
    ' (find-fline "/tmp/pen/DCIM/Camera/")
    ' (find-fline    "2013.1-GA/")
    ' (find-twusfile "2013.1-GA/")
    ;;(find-TH       "2013.1-GA")
    ))
(defun eejump-830  ()
  (find-3a
    ' (find-fline "/tmp/pen/DCIM/Camera/")
    ' (find-twusfile "2013.1-ES/")
    ' (find-TH       "2013.1-ES")
    ))
(defun eejump-83   () (find-TH "2014.1-FM"))
(defun eejump-833  () (find-TH "2013.2-ES"))
(defun eejump-8333 () (find-TH "2013.1-ES"))
;; (defun eejump-811 () (find-TH "2011.2-GA"))
;; (defun eejump-8111 () (find-TH "2011.1-GA"))
;; (defun eejump-822 () (find-TH "2011.2-MD"))
;; (defun eejump-8222 () (find-TH "2011.1-MD"))
(defun eejump-821 () (find-LATEX "2010-1-C2-prova-1.tex"))
(defun eejump-881 () (find-TH "2009.2-MD"))
(defun eejump-882 () (find-TH "2009.2-C2"))
(defun eejump-884 () (find-TH "2009.2-C4"))
;; (defun eejump-83 () (find-LATEX "2009-micropol.tex"))
;; (defun eejump-811 () (find-LATEX "2009-2-MD-prova-1.tex"))
(defun eejump-812 () (find-LATEX "2009-2-MD-prova-1-notas.tex"))
(defun eejump-813 () (find-LATEX "2009-2-MD-comparacao.tex"))
(defun eejump-814 () (find-LATEX "2009-2-MD-prova-2.tex"))
(defun eejump-821 () (find-LATEX "2009-2-C2-prova-1.tex"))
(defun eejump-822 () (find-LATEX "2009-2-C2-prova-1-notas.tex"))
(defun eejump-823 () (find-LATEX "2009-2-C2-lista-1.tex"))
(defun eejump-824 () (find-LATEX "2009-2-C2-prova-2.tex"))
(defun eejump-841 () (find-LATEX "2009-2-C4-prova-1.tex"))
(defun eejump-842 () (find-LATEX "2009-2-C4-prova-1-notas.tex"))
(defun eejump-843 () (find-LATEX "2009-2-C4-prova-2.tex"))
(defun eejump-85 () (find-LATEX "2009unilog-dnc.tex"))
;; (defun eejump-854 () (find-LATEX "2010unilog-current.tex"))
(defun eejump-854 () (find-angg ".emacs" "unilog-current"))
(defun eejump-855 () (find-LATEX "2010diags.tex"))
(defun eejump-86 () (find-LATEX "2010diags.tex"))
(defun eejump-850 () (find-LATEX "2010-1-MD-plano-de-aulas.tex"))
(defun eejump-851 () (find-TH    "2009-cola"))
(defun eejump-852 () (find-LATEX "forest.tex"))
(defun eejump-853 () (find-LATEX "2008graphs.tex"))
(defun eejump-857 () (find-LATEX "2009-nd-in-hyps.tex"))
(defun eejump-858 () (find-LATEX "2009dnc-monads.tex"))
(defun eejump-87 () (find-LATEX "2009-defesa.tex"))
(defun eejump-88 () (find-pen-links))
(defun eejump-888 () (find-es "lenny" "syncing-the-edrx.tgzs"))
(defun eejump-8888 () (find-es "eev" "dh-make-2"))
(defun eejump-889 () (find-es "rcirc" "eepitch-full"))
(defun eejump-899 () (find-es "rcirc" "eepitch-full"))
(defun eejump-89 () (find-ebuffer "#eev@irc.freenode.net"))
(defun eejump-9 () (find-LATEX "2009-planodetrabalho.tex"))
(defun eejump-91 () (find-TH "2009.1-C1"))
(defun eejump-911 () (find-LATEX "2009-1-C1-prova-2.tex"))
(defun eejump-92 () (find-TH "2009.1-C2"))
(defun eejump-93 () (find-LATEX "catsem.bib"))
(defun eejump-94 () (find-LATEX "filters.bib"))
(defun eejump-95 () (find-TH "psi-cor"))
(defun eejump-96 () (find-TH "2011-eleicoes"))
(defun eejump-99 () (find-orgfiles))
(defun eejump-0 () (find-fline "~/ORG/index.org"))
	;;
	;; ((eq arg 13) (find-ebuffer "*Messages*"))
	;;
	;; (find-sh "xlsfonts | grep terminus | grep -v ^- | sort")
	;; (find-sh "xlsfonts | grep -v ^- | sort")
(defun eejump-100 () (set-frame-font "nil2"))
	;; (find-fline "/usr/share/fonts/X11/misc/fonts.alias")
(defun eejump-10 () (ee-set-frame-font "5x7"   t))
(defun eejump-11 () (ee-set-frame-font "fixed" t))
(defun eejump-13 () (ee-set-frame-font "9x15"  t))
(defun eejump-14 () (ee-set-frame-font "10x20" t))
(defun eejump-22 () (set-frame-font "terminus-16"))
	;; ((eq arg 33) (set-frame-font "terminus-bold-16"))




;; Beginning of the el4r block:
;; RCtool generated this block automatically. DO NOT MODIFY this block!
(add-to-list 'load-path "/usr/share/emacs/site-lisp")
;; (require 'el4r)
;; (el4r-boot)
;; End of the el4r block.
;; User-setting area is below this line.

;; «find-tkdiff»  (to ".find-tkdiff")

(defun find-tkdiff (f1 f2 &optional suffix)
  (cond (suffix (find-tkdiff (concat f1 suffix) (concat f2 suffix)))
	(ee-arg (find-fline-side-by-side f1 f2))
	(t (start-process "tkdiff" "*Messages*"
			  "tkdiff" (ee-expand f1) (ee-expand f2)))))

(defun find-tkdiff> (f1 f2 &optional suffix)
  "Takes the same arguments as find-tkdiff, but copies F1->F2"
  (if suffix
      (find-tkdiff> (concat f1 suffix) (concat f2 suffix))
    (find-sh0 (format "cp -av %s %s" f1 f2))))

(defun find-tkdiff< (f1 f2 &optional suffix)
  "Takes the same arguments as find-tkdiff, but copies F1<-F2"
  (if suffix
      (find-tkdiff> (concat f1 suffix) (concat f2 suffix))
    (find-sh0 (format "cp -av %s %s" f2 f1))))

(defun find-tkdiff1 (prefix1 prefix2 suffix &rest rest)
  (apply 'find-fline (concat prefix1 suffix) rest))

(defun find-tkdiff2 (prefix1 prefix2 suffix &rest rest)
  (apply 'find-fline (concat prefix2 suffix) rest))

(defun find-fline-side-by-side (f1 f2)
  (eek "C-x 1") (find-fline f1)
  (eek "C-x 3 C-x o") (find-fline f2))

;; Uh-oh, isearch-lazy-highlight-face -> lazy-highlight in CVS Emacs,
;; and somehow lazy-highlight stopped getting attributes.
;; (find-efile "isearch.el" "isearch-lazy-highlight-face")
(make-face           'lazy-highlight)
(set-face-background 'lazy-highlight "paleturquoise4")



;; «eekill»  (to ".eekill")
;; (find-es "x" "xclip")
;; (find-enode "Enabling Multibyte")
;; (find-enode "Enabling Multibyte" "nothing precedes the colon")
;; (find-enode "Mode Line" "When multibyte characters")
;;
(defun eekill (s &optional e)
  (interactive "r")
  (let ((str (ee-se-to-string s e)))
    (kill-new
     (with-temp-buffer			; because W32 dislikes unibyte data
       (insert str)
       (buffer-substring (point-min) (point-max))))
    str))

;; 2008may28
;; (find-elnode "Synchronous Processes" "Function: call-process-region")
;;
(defun eekill (s &optional e)
  (interactive "r")
  (let ((origb (current-buffer)))
    (with-temp-buffer
      (let ((tmpb (current-buffer)))
	(with-current-buffer origb
	  (call-process-region (point) (mark) "cat" nil tmpb)))
      (let ((str (buffer-substring (point-min) (point-max))))
	(kill-new str)
	str))))




(code-c-d "wb" "$S/http/dto.freeshell.org/e/")
(code-c-d "dtoe" "$S/http/dto.freeshell.org/e/")
;; (find-wbfile "")
;; (find-dtoefile "")

(defun find-whiteboardlinks (&rest rest)
  (interactive)
  (apply 'find-elinks
	 `((eek "C-x 1 C-x b *wb-console* RET C-x 4 b whiteboard RET C-x o")
	   (load (ee-expand "$S/http/dto.freeshell.org/e/whiteboard.el"))
           (setq wb-directory "~/whiteboard")
	   (setq wb-base-port 10191)
	   (setq wb-local-ip ,(myip-as-string))
	   (wb-make-client "edrx" "66.189.73.146")
	   ""
	   (wb-make-server "edrx")
	   (wb-terminate)
	   ""
	   "* (eepitch '(shell))"
	   "psne http://dto.freeshell.org/e/whiteboard.el"
	   "mv whiteboard.el.1 whiteboard.el")
	 rest))

;; (define-key eev-mode-map "\M-h\M-w" 'find-whiteboardlinks)
;; (eek "M-h M-w")






;;;                  _ _       _
;;;   ___  ___ _ __ (_) |_ ___| |__
;;;  / _ \/ _ \ '_ \| | __/ __| '_ \
;;; |  __/  __/ |_) | | || (__| | | |
;;;  \___|\___| .__/|_|\__\___|_| |_|
;;;           |_|

;; «eepitch»  (to ".eepitch")
;; «eepitch-kill»  (to ".eepitch-kill")
;; Code moved to  eev-mini-steps.el.
;; (find-eevfile "eev-mini-steps.el" "defvar eepitch-code")
;; (find-eevfile "eev-steps.el" "defun eepitch-prepare")

;;; --------------------------
;; (find-eevfile "eev-mini-steps.el" "defvar eepitch-code")

;; obsolete!
(defun eepitch-this-buffer ()
  "Set eepitch to copy lines to this buffer."
  (interactive)
  (setq eepitch-file-name (buffer-file-name))
  (eepitch (find-fline eepitch-file-name)))



;; some extra tools and things based on eepitch

(defun ee-to-char (charorstring)
  (if (stringp charorstring)
      (string-to-char charorstring)
    charorstring))

(defun find-eregister (register-char &rest rest)
  (jump-to-register (ee-to-char register-char))
  (ee-goto-rest rest))

(defun eepitch-register (register-char)
  (point-to-register (ee-to-char register-char))
  (eepitch `(find-eregister ,register-char -1)))

(defun ee-add-slash (dir)
  (if (string-match "/$" dir)
      dir
    (concat dir "/")))

(defmacro ee-at-dir (dir &rest body)
  `(let ((default-directory (ee-add-slash (ee-expand ,dir))))
	 . ,body))

;; (find-eev "eev-mini-steps.el")




;; «ee-comint»  (to ".ee-comint")
;; «ee-telnet»  (to ".ee-telnet")
;; (find-angg ".emacs.local.tijuca" "ee-comint")
;; 2005dez22
;;
(defun ee-comint (name program &rest switches)
  (apply 'make-comint name program nil switches)
  (switch-to-buffer (format "*%s*" name)))

;; (defun ee-telnet (name host &rest switches)
;;   (apply 'ee-comint name
;;          "C:/Arquivos de programas/PuTTY/plink.exe" "-telnet"
;;          host switches))

(seen 6268)


'(

(defun ee-telnet (name &optional host &rest switches)
  (apply 'ee-comint name "telnet" (or host name) switches))

(defun ee-telnet-mangaratiba () (interactive) (ee-telnet "mangaratiba"))
(defun ee-telnet-parati      () (interactive) (ee-telnet "parati"))
(defun ee-telnet-trindade    () (interactive) (ee-telnet "trindade"))
(defun eepitch-mangaratiba   () (interactive) (eepitch (ee-telnet-mangaratiba)))
(defun eepitch-parati        () (interactive) (eepitch (ee-telnet-parati)))
(defun eepitch-trindade      () (interactive) (eepitch (ee-telnet-trindade)))

)

(seen 6285)

(defun eepitch-Twu     () (interactive) (eepitch-comint "Twu" "Twu"))
(defun eepitch-Twu     () (interactive) (eepitch-comint "Twu" "autopasswd ssh -C edrx@angg.twu.net"))


;; (defun eepitch-hallowlua   () (interactive)
;;   (eepitch (let ((default-directory (ee-expand "~/HALLOWEEN/")))
;; 	        (find-comintprocess "halloween: lua" "lua50"))))

(defun eepitch-hallowlua   () (interactive)
  (eepitch-at-dir-comint
   "~/HALLOWEEN/"
   "halloween: lua"
   "lua50"))

(defun eepitch-hallowplot   () (interactive)
  (eepitch-at-dir-comint
   "~/HALLOWEEN/"
   "hallowplot"
   "eegchannel hallowplot gnuplot"))

;; (find-miniforthfile "miniforth3.lua")
;; (eepitch-miniforth)
;; (eepitch-kill)
(defun eepitch-miniforth   () (interactive)
  (ee-eepitch-comint
   "~/miniforth/"
   "miniforth5.lua"
   "lua51 -e dofile[[miniforth5.lua]] -i"))



;; (find-eevfile "eev.el" "defun ee-goto-position")
;; (find-efunction 'ee-goto-position)
;; (find-efile "reveal.el")

(autoload 'reveal-post-command "reveal")

(defun ee-goto-position-orig (&optional pos-spec &rest rest)
  (when pos-spec
    (cond ((numberp pos-spec)
	   (goto-char (point-min))
	   (forward-line (1- pos-spec)))
	  ((stringp pos-spec)
	   (goto-char (save-excursion	          ; This used to be just:
			(goto-char (point-min))	  ; (goto-char (point-min))
			(search-forward pos-spec) ; (search-forward pos-spec)
			(point))))		  ;
	  (t (error "This is not a valid pos-spec: %S" pos-spec)))
    (if rest (ee-goto-rest rest))))

(defun ee-goto-position-reveal (&optional pos-spec &rest rest)
  (let ((search-invisible t))
    (apply 'ee-goto-position-orig pos-spec rest)
    (reveal-post-command)))

' (defun ee-goto-position (&optional pos-spec &rest rest)
    (apply 'ee-goto-position-reveal pos-spec rest))


(seen 6000)

;; (find-trampfile "")
;; (find-trampfile "om")
;; (find-trampfile "lisp/")
;; (find-file "/sudo:root@localhost:/etc/hosts")
;; (find-file "/ftp:guest@127.0.0.1:")
;; (find-file "/ftp:root@127.0.0.1:/")
;; (find-file "/ftp:edrx@parati:")
;; (find-node "(tramp)Top")
;; http://lists.gnu.org/archive/html/tramp-devel/
;; (eekill "make-auto-save-file-name")
;; (find-trampgrep "grep -nH -e make-auto-save-file-name lisp/*.el")
;; (find-efile "files.el")
;; (find-eetcfile "NEWS")
;; (find-eetcfile "NEWS" "`make-auto-save-file-name' is now handled")

(code-c-d "tramp" "~/usrc/tramp/" :grep)

(seen 6375)


(if (= emacs-major-version 22)
  (add-to-list 'load-path "~/usrc/tramp/lisp/"))



;; «ruby»  (to ".ruby")
;; (find-es "ruby" "rubyri")
;;
(code-c-d "rubybook"   "/usr/share/doc/rubybook/html/")
(code-c-d "rubymanual" "/usr/share/doc/ruby-manual/html/")
(code-c-d "rubyfaq"    "/usr/share/doc/ruby-manual/faq/")
(code-c-d "rubyex"     "/usr/share/doc/ruby1.8-examples/examples/")
(code-c-d "rubylib"    "/usr/lib/ruby/1.8/")

;; (find-rubyri "Test::Unit")
(defun find-rubyri (name &rest rest)
  (apply 'find-sh (format "PAGER=cat ri1.8 '%s'" name) rest))

;; (find-rubybookfile "")
;; (find-rubymanualfile "")
;; (find-rubyfaqfile "")
;; (find-rubyexfile "")
;; (find-rubyexfile "webrick/hello.rb")
;; (find-rubyexfile "webrick/hello.cgi")
;; (find-rubylibfile "")
;; (find-rubylibfile "webrick/")
;; (find-rubymanualw3m "syntax.html" "class Foo < Super")

(code-c-d "ruby" "~/usrc/ruby/ruby1.8-1.8.2/")
;; (code-c-d-old "rubysrc" "~/usrc/ruby/ruby1.8-1.8.2/build-tree/ruby-1.8.2/" :gdb)
;; (find-rubyfile "")
;; (find-rubysrcfile "")

;; (find-es "ruby" "postgres-pr")
(code-c-d "postgrespr" "~/usrc/postgres-pr-0.4.0/d/")

;; «ruby-pragmatic»  (to ".ruby-pragmatic")
;; (find-angg ".emacs.papers" "ruby")
;; (find-es "ruby" "pragmatic")
;;
;;(code-xpdf "pragmaticruby" "~/tmp/ruby-pragmatic-2nd-ed.pdf")
;;(code-c-d  "pragmaticruby" "~/tmp/ruby-pragmatic-2nd-ed.txt")
;;(defun find-pragmaticrubytext (&rest rest) (interactive)
;;  (apply 'find-pragmaticrubyfile "" rest))

(code-c-d "e" ee-emacs-lisp-directory "emacs" :grep)
(code-c-d "es" "$ES/" :grep)

(code-c-d "org" "~/ORG/" :anchor :grep)

;; This should be moved to .emacs.local.sj (sweetjane)
(code-c-d "mediador"       "/ftp:edrx@parati:/app/mediador/")
(code-c-d "mediadorparati" "/ftp:mediador@parati:/app/mediador/")
(code-c-d "parati"   "/ftp:edrx@parati:")
(code-c-d "trindade" "/ftp:edrx@trindade:")

(code-c-d "paratireadline" "/ftp:edrx@parati:usrc/readline-5.1/")
(code-c-d "paratilua50"    "/ftp:edrx@parati:usrc/lua-5.0.2/")

(code-c-d "paratioraclehome" "/ftp:edrx@parati:/opt/oracle/product/9.2.0/")


;; «titan»  (to ".titan")
;;
;; (find-titanfile "")
;; (find-titansmsfile "")
;; (find-titansmsfile "titanfilter.h")
(code-c-d "titan"    "~/TITAN/" :anchor)
(code-c-d "titansms" "~/TITAN/" :anchor)
(code-c-d "titansmsdocs" "~/usrc/titan-sms-docs/")
;; (find-titansmsdocsfile "")
;;
(code-xpdf "titandic"
  "~/usrc/titan-sms-docs/Docionario de dados V1.1.pdf")
(code-xpdf "titanspec"
  "~/usrc/titan-sms-docs/Especificacao GTW Interceptador SMS - V1.0.pdf")
(code-xpdf "titanprojfis"
  "~/usrc/titan-sms-docs/TITAN_SMS_PROJ_FISICO.pdf")
(code-xpdf "titanprojlog"
  "~/usrc/titan-sms-docs/TITAN_SMS_PROJ_LOGICO.pdf")
(code-xpdf "titansmsminuta"
  "~/usrc/titan-sms-docs/20060607-VIVBRSIP02-Minuta-SMS-V1.5.pdf")
;;
;; (find-titandicpage 1)
;; (find-titanspecpage 1)
;; (find-titanprojfispage 1)
;; (find-titanprojlogpage 1)
;; (find-titansmsminutapage 1)

;; «titand-docs-text»  (to ".titand-docs-text")
;; (find-titan "titan.e" "docsprincipais.txt")
;;
(defun find-titanspectext (&rest rest)
  (apply 'find-titansmsdocsfile "titanspec.txt" rest))
(defun find-titandictext (&rest rest)
  (apply 'find-titansmsdocsfile "dicdados.txt" rest))
(defun find-titanprojfistext (&rest rest)
  (apply 'find-titansmsdocsfile "projfis.txt" rest))
(defun find-titanprojlogtext (&rest rest)
  (apply 'find-titansmsdocsfile "projlog.txt" rest))

;; (find-titanspectext)
;; (find-titandictext)
;; (find-titanprojfistext)
;; (find-titanprojlogtext)




;; (ee-add-file-name-maybe "/foo/bar/plic" "/tmp/ploc")
;; (ee-add-file-name-maybe "/foo/bar/"     "/tmp/ploc")
;;
(defun ee-add-file-name-maybe (fname-or-dir fname)
  (if (equal (file-name-directory fname-or-dir) fname-or-dir)
      (concat fname-or-dir (file-name-nondirectory fname))
    fname-or-dir))

(defun ee-copy-file- (fname1 fname2)
  (let ((coding-system-for-read  'raw-text-unix)
        (coding-system-for-write 'raw-text-unix))
    (with-temp-buffer
      (insert-file-contents-literally fname1)
      (write-region (point-min) (point-max) fname2))))

(defun ee-copy-file (fname1 fname2)
  (setq fname1 (ee-expand fname1))
  (setq fname2 (ee-expand fname2))
  (setq fname2 (ee-add-file-name-maybe fname2 fname1))
  (ee-copy-file- fname1 fname2))


;; (find-efunction 'org-goto)

(defun my-org-mode ()
  "Like `org-mode', but doesn't change point"
  (interactive)
  (save-excursion (org-mode))
  (reveal-post-command))

;; (find-elnode "Index" "* directory-files:")
;; (find-elnode "Contents of Directories")
;; (find-efunction 'find-frame-font-links)
;; (find-orgfiles)
;;
(defun find-orgfiles (&rest rest)
  (let* ((f (lambda (fname) `(find-orgfile ,fname)))
	 (fnames (directory-files  ee-orgdir nil "^[^#~]+.org$"))
	 (links (mapcar f (reverse fnames))))
    (apply 'find-elinks
	   `((find-orgfiles ,@rest)
	     (find-orggrep "grep -nH -e _ *.org")
	     (find-esgrep "grep -nH -e _ *.e")
	     ,@links)
	   rest)))

(code-c-d "mediadorsj" "~/usrc/mediador/" :grep)
;; (find-mediadorsjfile "")


;; http://article.gmane.org/gmane.emacs.eev.devel/42
;; http://www.emacswiki.org/cgi-bin/wiki/IndirectBuffers

(defvar indirect-mode-name nil
  "Mode to set for indirect buffers.")
(make-variable-buffer-local 'indirect-mode-name)

(defun indirect-region (start end)
  "Edit the current region in another buffer.
    If the buffer-local variable `indirect-mode-name' is not set, prompt
    for mode name to choose for the indirect buffer interactively.
    Otherwise, use the value of said variable as argument to a funcall."
  (interactive "r")
  (let ((buffer-name (generate-new-buffer-name "*indirect*"))
        (mode
         (if (not indirect-mode-name)
             (setq indirect-mode-name
                   (intern
                    (completing-read
                     "Mode: "
                     (mapcar (lambda (e)
                               (list (symbol-name e)))
                             (apropos-internal "-mode$" 'commandp))
                     nil t)))
           indirect-mode-name)))
    (switch-to-buffer (make-indirect-buffer (current-buffer) buffer-name))
    (narrow-to-region start end)
    (funcall mode)
    (goto-char (point-min))
    ))

(defun eeindirect ()
  "Edit the eev bounded region in another buffer."
  (interactive)
  (let ((eebound-re "^[-;%#]+*\n")      ; bounded region delimiter regexp
        s e)
    (save-excursion
      (when (re-search-backward eebound-re nil t)
        (forward-line -1)
        (setq s (point))))
    (save-excursion
      (when (and s (re-search-forward eebound-re nil t))
        (beginning-of-line)
        (setq e (point))
        (indirect-region s e)))))


;; (global-set-key (kbd "s-s") 'toggle-scroll-bar)
;; (global-set-key (kbd "s-w") 'wrap)

(defun upload-changes-sweetjane ()
  (interactive)
  (find-es "page" "compare-tp-and-home"))

' (defalias 'upload-changes 'upload-changes-sweetjane)


;; «postgres»  (to ".postgres")
;; (find-esfile "postgres.e")
;; Older (debian-ish, non-upstream-ish):
;; (code-c-d "pgdoc"  "/usr/share/doc/postgresql-doc/")
;; (code-c-d "pghtml" "/usr/share/doc/postgresql-doc/html/")
;; (code-c-d "pgtut"  "/usr/share/doc/postgresql-doc/tutorial/")

(code-c-d "pg"     "~/usrc/postgresql-7.4.13/" :grep)
(code-c-d "pgex"   "~/usrc/postgresql-7.4.13/src/test/examples/")
(code-c-d "pgdoc"  "~/usrc/postgresql-7.4.13/doc/html/" :grep)
(code-c-d "pghtml" "~/usrc/postgresql-7.4.13/doc/html/" :grep)
(code-c-d "psql"   "~/usrc/postgresql-7.4.13/src/bin/psql/" :grep)
(setq ee-pgextagsfile  ee-pgtagsfile)
(setq ee-pgdoctagsfile ee-pgtagsfile)
(setq ee-psqltagsfile  ee-pgtagsfile)
;; (find-psqlfile "")
;; (find-pgdocfile "")



;; «find-C-links»  (to ".find-C-links")
;; Test with M-h c on this: printf
;;
' (define-key eev-mode-map "\M-hc" 'find-C-links)

(defun find-C-links (fstr &rest rest)
  (interactive (list (read-string "C function name: "
				  (ee-stuff-around-point "a-zA-Z0-9_"))))
  (apply 'find-elinks
	 `((find-C-links ,fstr ,@rest)
	   (find-node "(libc)Function Index" ,(concat "* " fstr ":"))
	   (find-man ,(concat "3 " fstr))
	   (find-man ,(concat "2 " fstr))
	   (find-uclibctag ,fstr))
	 rest))



;; «find-postgres-links»  (to ".find-postgres-links")
(defun find-postgres-links (symbolstr &rest rest)
  (interactive (list (read-string "Postgres function name: "
				  (ee-stuff-around-point "a-zA-Z0-9_"))))
  (apply 'find-elinks
	 `((find-postgres-links ,symbolstr ,@rest)
	   (find-pgdocfile "")
	   (find-pgtag ,symbolstr))
	 rest))

(define-key eev-mode-map "\M-hp" 'find-postgres-links)


;; «find-grep-links»  (to ".find-grep-links")
'(

(defun ee-findxxxgreps (dir)
"Return the list of `find-xxxgrep' symbols where XXX is associated to DIR"
  ;; Inspired by: (find-efunction 'code-c-d-prefixes)
  (let* ((expdir (ee-expand dir))
	 (c-d-s (ee-filter (lambda (c-d) (equal (nth 1 c-d) expdir))
			   code-c-d-list))
	 (cs (mapcar 'car c-d-s)))
    (mapcar (lambda (c) (intern (format "find-%sgrep" c))) cs)))

;; (ee-trimafter 8 '(a b c d e f))
;; (ee-trimafter 4 '(a b c d e f))
;; (ee-trimafter 0 '(a b c d e f))

(defun ee-trimafter (n list)
"Return a list that has only the first N elements of LIST.
If LIST has N elements or less return it unchanged."
  ;; Inspired by: (find-efunction 'butlast)
  (cond ((<= (length list) n) list)
	((<= n 0) nil)
	(t (let ((newlist (copy-sequence list)))
	      (setcdr (nthcdr (- n 1) newlist) nil)
	      newlist))))

;; (ee-findxxxgrep-links '(f g h) '("a" "b" "c") "foo" "bar")
;;
(defun ee-findxxxgrep-links (find-xxxgreps grep-commands &rest rest)
  "FIND-XXXGREPS is a list of symbols, GREP-COMMANDS a list of strings."
  (let (result)
    (dolist (head find-xxxgreps)
      (dolist (command grep-commands)
	(setq result (cons `(,head ,command ,@rest) result))))
    (nreverse result)))

(defun find-grep-links (&rest rest)
  (interactive)
  (let ((findxxxgreps (ee-findxxxgreps default-directory))
	(grep-commands (ee-trimafter 4 (cons "grep -nH -e _ *" grep-history))))
    (apply 'find-elinks
	   `((find-grep-links ,@rest)
	     ,@(ee-findxxxgrep-links findxxxgreps grep-commands)
	     )
	   nil)))

(define-key eev-mode-map "\M-h\M-g" 'find-grep-links)

)


;; «swig»  (to ".swig")
;; Test with M-h M-p on this: PQexec
(code-c-d "swig"       "~/usrc/swig-1.3.29/")
(code-c-d "swigmanual" "~/usrc/swig-1.3.29/Doc/Manual/")



;; «eea2ps»  (to ".eea2ps")
;; (find-angg ".a2ps/a2psrc")

(defun find-a2ps (fname)
  (interactive "f")
  (list (find-sh0 (format "a2ps -=p2isol '%s' -o ~/o.ps" (ee-expand fname)))
	(find-pspage "~/o.ps")))

(defun eea2ps (s &optional e) (interactive "r")
  (let ((coding-system-for-write 'latin-1-unix))
    (ee-write s e "" "" "~/o"))
  (find-sh0 "cd; a2ps -=p2isol o")
  (find-pspage "~/o.ps"))

(defun eea2ps1 (s &optional e) (interactive "r")
  (let ((coding-system-for-write 'latin-1-unix))
    (ee-write s e "" "" "~/o"))
  (find-sh0 "cd; a2ps -=p1iso o")
  (find-pspage "~/o.ps"))

(defun eea2ps3 (s &optional e) (interactive "r")
  (let ((coding-system-for-write 'latin-1-unix))
    (ee-write s e "" "" "~/o"))
  (find-sh0 "cd; a2ps -=p3isol o")
  (find-pspage "~/o.ps"))

;; «eea2ps-meta»  (to ".eea2ps-meta")
;; (setq eea2ps-meta "cd; a2ps -=p1iso -l 100 o")
;; (find-eea2ps-links)
(setq  eea2ps-meta "cd; a2ps -=p1iso o")
(defun eea2ps-meta (s &optional e) (interactive "r")
  (let ((coding-system-for-write 'latin-1-unix))
    (ee-write s e "" "" "~/o"))
  (find-sh0 eea2ps-meta)
  (find-pspage "~/o.ps"))

(defun find-eea2ps-links (&rest rest)
  (interactive)
  (find-elinks
   `((find-eea2ps-links ,@rest)
     (find-angg ".a2ps/a2psrc")
     (find-angg ".emacs" "eea2ps-meta")
     (setq eea2ps-meta ,eea2ps-meta)
     (setq eea2ps-meta "cd; a2ps -=p1isol o")
     (setq eea2ps-meta "cd; a2ps -=p1iso o")
     (setq eea2ps-meta "cd; a2ps -=p2iso o")
     "%*"
     "% (eea2ps-meta-bounded)"
     "%*"
     )))

;; (eeb-define 'eea2ps-meta-bounded  'eea2ps-meta  'ee-delimiter-percent nil t t)

;; «eea2pswide»  (to ".eea2pswide")
;; (find-angg ".a2ps/a2psrc" "p1isolwide")
;;
(defun eea2pswide (s &optional e) (interactive "r")
  (let ((coding-system-for-write 'latin-1-unix))
    (ee-write s e "" "" "~/o"))
  (find-sh0 "cd; a2ps -=p1isolwide o")
  (find-pspage "~/o.ps"))

;; (eeb-define 'eea2ps-bounded  'eea2ps  'ee-delimiter-percent nil t t)
;; (eeb-define 'eea2ps3-bounded 'eea2ps3 'ee-delimiter-percent nil t t)

(defun find-a2ps-file (fname)
  (interactive "f")
  (list (find-callprocess0
	 `("a2ps" "-=p2isol" ,(ee-expand fname)
	          "-o"       ,(ee-expand "~/o.ps")))
	(find-pspage "~/o.ps")))

(defun find-a3ps-file (fname)
  (interactive "f")
  (list (find-callprocess0
	 `("a2ps" "-=p3isol" ,(ee-expand fname)
	          "-o"       ,(ee-expand "~/o.ps")))
	(find-pspage "~/o.ps")))


(code-brfile 'find-a2ps-file :local 'bra2psl :dired 'bra2psd)
(code-brfile 'find-a3ps-file :local 'bra3psl :dired 'bra3psd)




;; «fill-rcirc-paragraph»  (to ".fill-rcirc-paragraph")
;; Note: I haven't coded an "unfill-rcirc-paragraph" yet.

(defun fill-rcirc-paragraph ()
"Fill the current line as if it were a long line in an rcirc log.
If it starts with \"<nick>\" then use blanks to the width of
\"<nick>\" (plus one) as the fill-prefix for the other lines of
the paragraph. Lines that are not of that form are not changed.
This function advances point to the beginning of the next line.
Note that I don't use timestamps in my rcirc logs."
  (interactive)
  (save-restriction
    (narrow-to-region (point-at-bol) (1+ (point-at-eol)))
    (goto-char (point-min))
    (if (looking-at "<[-_A-Za-z0-9`]+>")
	(let* ((head (match-string 0))
	       (fill-prefix (make-string (1+ (length head)) 32)))
	  (fill-region-as-paragraph (point-min) (point-max))))
    (goto-char (point-max))))
;;
(global-set-key (kbd "M-R") 'fill-rcirc-paragraph)

;; http://homepage1.nifty.com/bmonkey/emacs/elisp/screen-lines.el
;; See also: http://www.emacswiki.org/cgi-bin/wiki/VisibleLines
'(
(autoload 'screen-lines-mode
  (ee-expand "$S/http/homepage1.nifty.com/bmonkey/emacs/elisp/screen-lines.el")
  "Toggle Screen Lines minor mode for the current buffer." t)

(defalias 'slm 'screen-lines-mode)
)

;; «display-time-mode»  (to ".display-time-mode")
;; (find-enode "Optional Mode Line")
;; With thanks to Marc Simpson.
(setq display-time-mail-file 'none)
(setq display-time-default-load-average nil)
(setq display-time-24hr-format t)
(setq display-time-format " %H:%M ")
(defalias 'dtm 'display-time-mode)
;; (dtm)

;; (find-evardescr 'mode-line-format)
;; (find-evardescr 'mode-line-format "global-mode-string")

(defalias 'mkdir 'make-directory)

;; http://www.emacswiki.org/cgi-bin/emacs/eimp.el
;; http://www.emacswiki.org/cgi-bin/emacs/download/eimp.el
;;
'(autoload 'eimp-mode
  (ee-expand "$S/http/www.emacswiki.org/cgi-bin/emacs/download/eimp.el")
  "Emacs Image Manipulation Package." t)


;; «eemklinks-yank-w3m-anchor»  (to ".eemklinks-yank-w3m-anchor")
;; (find-efunction 'eemklinks-yank-pos-spec)
;; (find-efunction 'eemklinks-yank-w3m-anchor)
;;
(defun eemklinks-yank-w3m-anchor () (interactive)
  (save-excursion
    (end-of-line)
    (skip-chars-backward ")")
    (skip-chars-backward "\"")
    (insert "#" (with-current-buffer "*w3m*"
		  (car (get-char-property (point) 'w3m-name-anchor2))))))

;; (find-eevfile "eev.el" "'eemklinks-yank-pos-spec")
;;
(define-key eev-mode-map "\M-h\M-Y" 'eemklinks-yank-w3m-anchor)


;; «find-C-x»  (to ".find-C-x")
;; (find-es "emacs" "window-configurations")
;;
(defun find-C-x (C-x &rest C-x-s)
  (cond ((stringp C-x) (eek (concat "C-x " C-x)))
	((listp C-x)   (eval C-x))
	(t (error "Not a C-x-step: %S" C-x)))
  (if C-x-s (apply 'find-C-x C-x-s)))

' (find-C-x "1" '(find-angg ".emacs" "find-C-x")
	    "3" "o" '(find-node "(emacs)RegConfig" "`C-x r w R'")
	    "o" "r w 1")




;; «find-ebuffer-links»  (to ".find-ebuffer-links")
;; (find-efunction 'find-ekey-links)
;; (find-efunctiondescr 'switch-to-buffer)
;; (find-efunction      'switch-to-buffer)
;; (find-efunctiondescr 'kill-buffer)
;; (find-efunction      'kill-buffer)

(define-key eev-mode-map "\M-h\M-b" 'find-ebuffer-links)

(defun find-ebuffer-links (buffer &rest rest)
  (interactive "bHyperlinks for buffer: ")
  (apply 'find-elinks
	 `((find-ebuffer-links ,buffer ,@rest)
	   (find-ebuffer ,buffer)
	   (eepitch-to-buffer ,buffer)
	   )	 
	 rest))


;; «freedb-rename»  (to ".freedb-rename")
;; (find-angg ".zshrc" "cddb2rentracks")
;;
(defun freedb-rename (N &optional ext)
  (interactive "p")
  (dotimes (i N)
    (let* ((line (ee-delete-and-extract-line))
	   (sline (replace-regexp-in-string "^http://" "$S/http/" line)))
      (insert (format "# %s
# (find-zsh \"cddb2rentracks < %s\")
function rentrack () { mv -iv track$1.cdda.wav $1._$2.wav }
function rentrack () { mv -iv track$1.cdda.ogg $1._$2.ogg }
cd ~/NICOTINE/\n" line sline)))
    (forward-char 1)))



;; «find-pdfpage-pdftotext»  (to ".find-pdfpage-pdftotext")
;; Search for "Kock.zip" at gmail.
;; (find-fline "/tmp/Kock.zip")
;; (find-man "1 unzip" "overwrite existing files")
;; (find-es "ps" "xpdftools")
;; (find-sh "cd /tmp/; unzip -o ~/tmp/Kock.zip")
;; (find-pspage "/tmp/Kock3.pdf" 14)
;; (find-pspage "/tmp/Kock4.pdf" 3)
;; (find-pspage "/tmp/kock1.pdf")
;; (find-pspage "/tmp/kock2.pdf")
;; (find-pdftotext "/tmp/Kock3.pdf" "A simple axiomatics for differentiation")
;; (find-pdftotext "/tmp/Kock4.pdf" "factorization")
;; (find-pdftotext "/tmp/kock1.pdf")
;; (find-pdftotext "/tmp/kock2.pdf")
;;
'(
(defun find-pdftotext (fname &rest rest)
  (apply 'find-sh (format "pdftotext -layout %s -" fname) rest))

(defun find-pdfpage-pdftotext (fname &rest rest)
  (apply 'find-sh (format "pdftotext -layout %s -" fname) rest))

(defun find-pstotext (fname &rest rest)
  (apply 'find-sh (format "cat %s | pstotext" fname) rest))
(defun find-zpstotext (fname &rest rest)
  (apply 'find-sh (format "zcat %s | pstotext" fname) rest))

(code-brfile 'find-pdftotext
             :local 'brpdftxtl :dired 'brpdftxtd)
(code-brfile 'find-a2ps-file
             :local 'bra2psl :dired 'bra2psd)
(code-brfile 'find-a3ps-file
             :local 'bra3psl :dired 'bra3psd)

(code-brurl 'find-dpkg-build-escript
            :remote 'brdsc :local 'brdscl :dired 'brdscd)
(code-brurl 'find-template-untgz
            :remote 'bruntgz :local 'bruntgzl :dired 'bruntgzd)
(code-brurl 'find-template-untbz2
            :remote 'bruntbz2 :local 'bruntbz2l :dired 'bruntbz2d)

)


;; «find-xxxtkdiff»  (to ".find-xxxtkdiff")
;; 2006jul31; not working yet
'
(add-to-alist 'code-c-d-keywords
 '(:tkdiff
   (ee-eval-read-format "
    (defun find-%stkdiff (prefix f1 f2)
      (find-tkdiff (ee-%sfile prefix) f1 f2))" c c)))


;; AAAARGH, code-c-d doesn't complain when it gets bad tags
;; (code-c-d "mediadorsj" "~/usrc/mediador/" :grep :tkdiff :foo)
(code-c-d "dialogex" "/usr/share/doc/dialog/examples/" :grep)

;; (find-mediadorsjfile "")
;; (find-mediadorsjtkdiff "admin/ivr/" "volta_ivr.2006aug01.sh" "volta_ivr.2006jul26.sh")
;; "volta_ivr.2006mar28.sh"


;; «find-cdecl»  (to ".find-cdecl")
;; (find-es "anatocc" "cdecl")
;; (find-node "(cutils)cdecl/cundecl examples")
;; (find-cdecl "explain void (*commands[128])(void)")
;; (find-cdecl "declare commands as array 128 of pointer to function (void) returning void")
;; (find-cdecl "declare cmds as array 128 of ptr to function (void) ret void")
(defun find-cdecl (str) (find-sh0 (format "echo '%s' | cdecl" str)))


;; «eetcc»  (to ".eetcc")
;; (find-es "anatocc" "tcc")
;; (find-eev "eev-langs.el" "eelua0")
;; (find-eev "eev.el")
;; (find-eevexfile "c.e")
;; (find-eevfile "eev-rctool")
;; (find-eevfile "eev-rctool" "EETMPC:=")
;; (find-fline "$EEC")
;; (find-fline "$EETMPC")

(defun eetcc (s &optional e)
  (interactive "r")
  (ee-write-with-nl s e "#include <tcclib.h>\n" "" (ee-expand "$EEC")))

(defun eetccnow  (s &optional e)
  (interactive "r")
  (eetcc s e)
  (find-sh  "tcc -run $EEC"))

(defun eetccnow0 (s &optional e)
  (interactive "r")
  (eetcc s e)
  (find-sh0 "tcc -run $EEC"))

(defun find-tcc (progcode &rest rest)
  (eetcc progcode)
  (apply 'find-sh "tcc -run $EEC" rest))

(defun find-tcc0 (progcode &rest rest)
  (eetcc progcode)
  (apply 'find-sh0 "tcc -run $EEC" rest))

;; (eeb-define 'eeb-tcc  'eetccnow  "\n//*\n" nil t t)
;;(eeb-define 'eeb-tcc0 'eetccnow0 "\n//*\n" nil t t)


;; «figlet»  (to ".figlet")
;; (find-es "figlet")
;; Other nice fonts: ogre, big
(defun figlet-region (s e)
  (interactive "r")
  (shell-command-on-region s e "figlet -f standard | gsub.lua '' '*;; %1'" nil t))

(defun figlet-region (s e)
  (interactive "r")
  (shell-command-on-region s e "figlet -f standard | gsub.lua '' '%% %1'" nil t))

(defun figlet-region (s e)
  (interactive "r")
  (shell-command-on-region s e "figlet -f standard | gsub.lua '' ' # %1'" nil t))

(defun figlet-region (s e)
  (interactive "r")
  (shell-command-on-region s e "figlet -f standard | gsub.lua '' '-- %1'" nil t))

(defun figlet-region (s e)
  (interactive "r")
  (shell-command-on-region s e "figlet -f standard | gsub.lua '' '// %1'" nil t))

(defun figlet-region (s e)
  (interactive "r")
  (shell-command-on-region s e "figlet -f standard | gsub.lua '' ' ! %1'" nil t))

(defun figlet-region (s e)
  (interactive "r")
  (shell-command-on-region s e "figlet -f standard | gsub.lua '' ';;; %1'" nil t))

(defun figlet ()
  "Run `figlet-region' on the current line."
  (interactive)
  (figlet-region (ee-bol) (1+ (ee-eol))))



;; «eshell»  (to ".eshell")
;; kensanata
(add-hook 'eshell-mode-hook
  (lambda ()
    (local-set-key (kbd "C-z") 'bury-buffer)
    (local-set-key (kbd "C-a") 'eshell-bol)
    (local-set-key (kbd "<up>") 'previous-line)
    (local-set-key (kbd "<down>") 'next-line)))

;; (find-efile "eshell/em-hist.el" "defun eshell-save-some-history")
;; (find-efile "eshell/em-hist.el" "defcustom eshell-save-history-on-exit")
;; (setq eshell-save-history-on-exit nil)
;; (find-efile "eshell/em-rebind.el")



;; «unaccent»  (to ".unaccent")
;; (find-blogmefile "blogme2-outer.lua" "unaccent_from, unaccent_to =")
;; (find-efunction 'translate-region)
;; (find-node "(recode)Concept Index")
(defun unaccent (s e)
  (interactive "r")
  (let ((coding-system-for-read 'latin-1-unix)
        (coding-system-for-write 'latin-1-unix))
    (shell-command-on-region
     s e
     (concat "tr 'ÀÁÂÃÄÅÇÈÉÊËÍÏÑÒÓÔÕÖÙÚÛÜàáâãäåçèéêëìíîïñòóôõöùúûü'"
	     "   'AAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuy'")
     nil t)))

;; «flip-psne-ness»  (to ".flip-psne-ness")
(defun flip-psne-ness ()
  (interactive)
  (if (search-forward-regexp "\\$S/\\(https?\\|ftp\\)/\\|\\(https?\\|ftp\\)://")
      (cond ((match-string 1) (replace-match "\\1://"))
            ((match-string 2) (replace-match "$S/\\2/")))))

(define-key my-mode-map "\M-s" 'flip-psne-ness)


(code-c-d "debfaq" "/usr/share/doc/debian/FAQ/")
;; (find-debfaqfile "debian-faq.en.txt.gz")

;; «find-other-debian-links»  (to ".find-other-debian-links")
;; Add: stuff for unpacking and building from source.
(defun find-other-debian-links (&optional str)
  (interactive (list (ee-no-properties (ee-debpkgname-around-point))))
  (if (or (null str) (equal str ""))
      (setq str "_"))
  (find-elinks `((find-other-debian-links ,str)
		 (find-zsh ,(format "dmissing %s" str))
		 (find-zsh "installeddebs | sort")
		 (find-zsh "installeddebs | sort" ,str)
		 (find-zsh ,(format "installeddebs | sort | grep %s" str))
		 (find-zsh "availabledebs | sort")
		 (find-zsh "availabledebs | sort" ,str)
		 (find-zsh ,(format "availabledebs | sort | grep %s" str))
		 (find-zsh ,(format "acse %s | sort" str))
		 (find-zsh ,(format "acse -i %s | sort" str))
		 (find-zsh ,(format "grep-available %s" str))
		 (find-zsh ,(format "grep-status %s" str)))))

(define-key eev-mode-map "\M-hd" 'find-other-debian-links)



;; «find-rcirc-channel-sexps»  (to ".find-rcirc-channel-sexps")
;; 2006sep02
(defun ee-sexp-value (sexp)
  "Example: (ee-sexp-value '(+ 1 2))"
  (list (ee-pp0 sexp) (format "  -> %s" (ee-pp0 (eval sexp)))))

(defun ee-rcirc-channel-sexp (sexp)
  "Internal use. Uses the value and the name of the variable `c'."
  (ee-sexp-value `(with-current-buffer c ,sexp)))

(defun ee-rcirc-server-sexp (sexp)
  "Internal use. Uses the value and the name of the variable `s'."
  (ee-sexp-value `(with-current-buffer s ,sexp)))

(defun ee-rcirc-channel-sexps (c)
  "Example: (find-elinks (ee-rcirc-channel-sexps \"#rcirc@irc.freenode.net\"))"
  `(,@(ee-rcirc-channel-sexp 'rcirc-target)
    ,@(ee-rcirc-channel-sexp '(rcirc-buffer-process))
    ,@(ee-rcirc-channel-sexp 'rcirc-server-buffer)
    ,@(ee-rcirc-channel-sexp 'rcirc-short-buffer-name)
    ,@(ee-rcirc-channel-sexp 'rcirc-topic)
    ,@(ee-rcirc-channel-sexp '(rcirc-nick (rcirc-buffer-process)))
    ,@(ee-rcirc-channel-sexp
       '(rcirc-channel-nicks (rcirc-buffer-process) rcirc-target))
    ))

(defun ee-rcirc-server-sexps (s)
  "Example: (find-elinks (ee-rcirc-server-sexps \"*irc.freenode.net*\"))"
  `(,@(ee-rcirc-server-sexp 'rcirc-server)
    ,@(ee-rcirc-server-sexp 'rcirc-buffer-alist)
    ))

;; (find-elinks (ee-rcirc-channel-sexps "#rcirc@irc.freenode.net"))
;; (find-elinks (ee-rcirc-server-sexps "*irc.freenode.net*"))
;; (find-rcirc-channel-sexps "#rcirc@irc.freenode.net")

(defun find-rcirc-channel-sexps (&optional buffer)
  "Visit a temporary buffer showing data associated to an rcirc channel buffer.
How to use: if you run\n
  (define-key eev-mode-map \"\M-hr\" 'find-rcirc-channel-sexps)\n
and then type `M-h r' when you're inside an rcirc channel buffer -
for example, when you're at the buffer for the channel #rcirc at
irc.freenode.node - then you will get a buffer with several
interesting sexps and their values.\n
This function is mostly a proof of concept at the moment.
We should write something like this to inspect buttons, customize
buffers, and dired buffers."
  (interactive (list (buffer-name (current-buffer))))
  (if (bufferp buffer) (setq buffer (buffer-name buffer)))
  (let ((server-buffer (buffer-name
			(with-current-buffer buffer
			  rcirc-server-buffer))))
    (find-elinks
     `((find-rcirc-channel-sexps ,buffer)
       (progn (make-local-variable 'c) (setq c ,buffer))
       (progn (make-local-variable 's) (setq s ,server-buffer))
       ""
       ,@(ee-rcirc-channel-sexps buffer)
       ""
       ,@(ee-rcirc-server-sexps server-buffer)
       ))))

(define-key eev-mode-map "\M-hr" 'find-rcirc-channel-sexps)


;; «find-ekbmacro-links»  (to ".find-ekbmacro-links")
(define-key eev-mode-map "\M-hM" 'find-ekbmacro-links)

(defun find-ekbmacro-links () (interactive)
  (find-elinks `(
    (find-ekbmacro-links)
    ""
    (format-kbd-macro last-kbd-macro)
    (setq last-kbd-macro (kbd ,(format-kbd-macro last-kbd-macro)))
    ""
    (find-enode "Keyboard Macros")
    (find-enode "Edit Keyboard Macro")
    (eek "M-h M-k C-x C-k C-e  ;; kmacro-edit-macro-repeat")
    (eek "        C-x C-k C-e  ;; kmacro-edit-macro-repeat")
    (eek "M-h M-k C-x C-k l    ;; kmacro-edit-lossage")
    (eek "        C-x C-k l    ;; kmacro-edit-lossage")
    )))



;; «find-dpkg-build-escript»  (to ".find-dpkg-build-escript")
;; anyone here remembers the precise rules for splitting the names of
;; "dsc" files (a debian source package thing) into parts? I need a
;; regexp for splitting, for example,
;; "http://ftp.debian.org/debian/pool/main/i/imagemagick/imagemagick_6.2.4.5.dfsg1-0.9.dsc"
;; into ("http" "ftp.debian.org/debian/pool/main/i/imagemagick/"
;; "imagemagick" "6.2.4.5.dfsg1" "-0.9")

(defun ee-dsc-url-split (dsc-url)
  "Example:
  (ee-dsc-url-split
   \"http://ftp.debian.org/debian/pool/main/i/imagemagick/imagemagick_6.2.4.5.dfsg1-0.9.dsc\")
  -> (\"http\" \"ftp.debian.org/debian/pool/main/i/imagemagick/\"
      \"imagemagick\" \"6.2.4.5.dfsg1\" \"-0.9\")"
  (let ((prot://dir/ (file-name-directory dsc-url))
	(fname-dsc (file-name-nondirectory dsc-url))
	prot dir/ xxx vvv -sv)
    (if (string-match "^\\([a-z]+\\)://\\(.*\\)" prot://dir/)
	(setq prot (match-string 1 prot://dir/)
	      dir/ (match-string 2 prot://dir/)))
    (if (string-match "^\\([^_]+\\)_\\([^-]+\\)\\(-.*\\)?\\.dsc$" fname-dsc)
	(setq xxx (match-string 1 fname-dsc)
	      vvv (match-string 2 fname-dsc)
	      -sv (or (match-string 3 fname-dsc) "")))
    (list prot dir/ xxx vvv -sv)))

(defun ee-escript-header (title)
  "Example: (find-elinks (ee-escript-header \"Blah blah blah\"))"
  `("#####"
    "#"
    ,(format "# %s" title)
    ,(format "# %s" (date-as-string))
    "#"
    "#####"
    ))

(defun ee-find-dpkg-build-escript (prot dir/ xxx vvv -sv)
  "Example:
  (find-elinks
   (ee-find-dpkg-build-escript
    \"http\" \"ftp.debian.org/debian/pool/main/i/imagemagick/\"
    \"imagemagick\" \"6.2.4.5.dfsg1\" \"-0.9\"))"
  (let ((urld/      (concat prot "://" dir/))
	(localurld/ (concat "$S/" prot "/" dir/)))
    `(,(format "# %s" urld/)
      ,(format "# %s%s_%s%s.dsc"           urld/ xxx vvv -sv)
      ,(format "# %s%s_%s%s.diff.gz"       urld/ xxx vvv -sv)
      ,(format "# %s%s_%s%s.debian.tar.gz" urld/ xxx vvv -sv)
      ,(format "# %s%s_%s.orig.tar.gz"     urld/ xxx vvv)
      "#*"
      ,(format "rm -Rv ~/usrc/%s/"       xxx)
      ,(format "mkdir  ~/usrc/%s/"       xxx)
      ,(format "cd %s"                   localurld/)
      ,(format "cp -v %s_%s* ~/usrc/%s/" xxx vvv xxx)
      ,(format "cd     ~/usrc/%s/"       xxx)
      ,(format "dpkg-source -sn -x %s_%s%s.dsc" xxx vvv -sv)
      ,(format "cd     ~/usrc/%s/%s-%s/"        xxx xxx vvv)
      ,(format "dpkg-buildpackage -us -uc -b -rfakeroot     |& tee odb")
      ""
      "#*"
      ,(format "# (find-fline \"~/usrc/%s/\")" xxx)
      ,(format "* (eepitch-shell)")
      ,(format "cd ~/usrc/%s/"                 xxx)
      ,(format "sudo dpkg -i *.deb")
      ""
      "#*"
      ,(format "# (code-c-d \"%s\" \"~/usrc/%s/%s-%s/\")" xxx xxx xxx vvv)
      ,(format "# (find-%sfile \"\")"                     xxx)
      )))

(defun find-dpkg-build-escript (dsc-url)
"Example: (find-dpkg-build-escript
          \"http://ftp.debian.org/debian/pool/main/g/gv/gv_3.6.2-4.dsc\")"
  (let* ((url-parts (ee-dsc-url-split dsc-url))
	 (xxx (nth 2 url-parts)))
    (find-elinks
     `((find-dpkg-build-escript ,dsc-url)
       ""
       ,@(ee-escript-header (format "%s (from the debian sources)" xxx))
       ""
       ,(format "# <%s-deb-src>" xxx)
       ,@(apply 'ee-find-dpkg-build-escript url-parts)
       ))))

;; (find-efunctiondescr 'find-dpkg-build-escript)
;; (find-efunctiondescr 'ee-find-dpkg-build-escript)
;; (find-efunctiondescr 'ee-escript-header)

;; (find-dpkg-build-escript "http://ftp.debian.org/debian/pool/main/g/gv/gv_3.6.2-4.dsc")
;; (brdsc  "http://ftp.debian.org/debian/pool/main/g/gv/gv_3.6.2-4.dsc")

(code-brurl 'find-dpkg-build-escript
	    :remote 'brdsc :dired 'brdscd)



;; 2006sep09 - overrides the default
;; «find-file-links»  (to ".find-file-links")
;; (find-efunction 'find-file-links)

(defun ee-find-file-extra-links (fname)
  (list
   ""
   (ee-replace-prefix "~/"      "http://angg.twu.net/" fname)
   (ee-replace-prefix "~/TH/L/" "http://angg.twu.net/" fname)
   ))

;; (find-eevfile "eev-insert.el")
;; (find-eevfile "eev-insert.el" "defun find-file-links")

;; '
;; (defun find-file-links (fname &rest rest)
;;   "Visit a temporary buffer containing hyperlinks related a file."
;;   (interactive (list (or (buffer-file-name) default-directory)))
;;   (apply 'find-elinks
;;          `((find-file-links ,fname)
;;            ""
;;            (find-fline ,fname)
;;            ,@(let ((home (ee-expand "$HOME/")))
;;                (if (ee-prefixp home fname)
;;                    (let ((homeless-fname (ee-remove-prefix home fname)))
;;                      `((find-fline ,(concat "~/" homeless-fname))
;;                        ""
;;                        ,(format "http://angg.twu.net/%s" homeless-fname)
;;                        ,(format "http://angg.twu.net/%s.html" homeless-fname)))))
;;            ,@(let ((vwt (ee-expand "$VWT/")))
;;                (if (ee-prefixp vwt fname)
;;                    (let ((vwtless-fname (ee-remove-prefix vwt fname))
;;                          (vwt-dir-url (format "http://%s/tmp/" (myip-as-string))))
;;                      `((find-fline ,(format "$VWT/%s" vwtless-fname))
;;                        ,(format "%s%s" vwt-dir-url vwtless-fname)))))
;;            ""
;;            ,@(ee-links-for-findxxxfile (ee-expand fname)))
;;          rest))

;; (progn (find-file-links (ee-expand "$VWT/1.txt")))


;; «find-bgprocess»  (to ".find-bgprocess")
;; (ee-unsplit (ee-split "aa   bb cc"))
;; (find-bgprocess `("xzgv" ,(ee-expand "$S/http/www.domai.com/-today/")))
;; (find-bgprocess                 "xzgv $S/http/www.domai.com/-today/" t)
;; (find-efunction 'find-callprocess0)

'(

(defun ee-split (str)
  "Return a list of the \"words\" at STR by splitting it at whitespace.
If STR is already a list return it unchanged."
  (if (stringp str)
      (split-string str "[ \t]+")
    str))

(defun ee-unsplit (list)
  "Concatenate the \"words\" in LIST into a big string, using spaces.
If LIST is already a string return it unchanged."
  (if (listp list)
      (mapconcat 'identity list " ")
    list))

'
(defun find-bgprocess (program-and-args &optional expand)
  "Start the background process PROGRAM-AND-ARGS.
PROGRAM-AND-ARGS can be either a string or a list of strings; see
`ee-split'. If EXPAND is non-nil then run `ee-expand' on each
component of PROGRAM-AND-ARGS. The process runs in background and
its output (including error messages) goes to the buffer
\"*Messages*\". "
  (let ((list (ee-split program-and-args)))
    (if expand (setq list (mapcar 'ee-expand list)))
    (apply 'start-process (car list) "*Messages*" list)))

;;-------
;; (find-eev "eev-mini.el")

)

;;

(defun find-xzgv (dir)
  (find-bgprocess `("xzgv" ,dir)))
(defun find-xzgvf (dir)
  (find-bgprocess `("xzgv" "-f" ,dir)))
(defun find-gqview (dir)
  (find-bgprocess `("gqview" ,dir)))



;; «sshot»  (to ".sshot")
;; (find-angg "elisp/sshot.el")
;; (find-fline "~/flipbooks/" "eesteps")
;; (find-sshot "~/flipbooks/eesteps" 1)

;; 2007nov27: commenting this out - use eev-sshot instead.
'(

;; (find-anggfile "bin/sshot-uniq.lua")
;; (find-efunction 'eeurl-dired-file-name-at-point)
;;
(defun sshot-uniq (stem)
  (interactive
   (list
    (read-string "Screenshot stem: "
		 (file-name-sans-versions (dired-get-filename) t))))
  (find-sh (format "sshot-uniq.lua %s" stem)))

;; A "template" for screenshot-taking:
;;   (set-frame-size (selected-frame) 80 25)
;;   (recenter 12)
;;   (sshot-init "/tmp/sshot/eesteps")
;;   (find-efunctiondescr 'eesteps)
;;   (sshot-blink)
;;   (sshot-write-html)
;;   (find-fline (sshot-dir))
;;   (find-fline "/tmp/sshot/" "eesteps")
;;   (find-sshot "/tmp/sshot/eesteps" 1)
;;   (sshot-uniq "/tmp/sshot/eesteps")
;;   (find-sh  "cd /tmp/sshot/ && tar -cvzf eesteps.tgz eesteps{.html,_*.png}")
;;   (find-sh0 "cp -v /tmp/sshot/eesteps.tgz ~/flipbooks/")
;;   (find-fline  "~/flipbooks/")
;;   (find-sh  "cd ~/flipbooks/ && tar -xvzf eesteps.tgz")

(autoload 'sshot-init "sshot")
(autoload 'find-sshot "sshot")
(autoload 'sshot-write-html "sshot")

)



;; «defalias-hard-maybe»  (to ".defalias-hard-maybe")
;;
(defun defalias-hard (new-symbol old-symbol)
  (fset new-symbol (symbol-function old-symbol))
  new-symbol)

(defun defalias-hard-maybe (new-symbol old-symbol)
  (unless (fboundp new-symbol) (defalias-hard new-symbol old-symbol)))

;; (find-elnode "Function Cells")
;; (require 'rcirc)
;; (fmakunbound         'rcirc-print-orig)
;; (defalias-hard-maybe 'rcirc-print-orig 'rcirc-print)
;; (find-efunctiond     'rcirc-print-orig)

;; How do I make defalias-hard and defalias-hard-maybe fontify as
;; defalias?
;; (find-efunction 'emacs-lisp-mode)
;; (find-ecvsfile "lisp/")
;; (find-elgrep "grep -nH -e font-lock-function-name-face $(find * -name '*.el')")

;; (code-c-d "el"  ee-emacs-lisp-directory "elisp" :grep)




;; «ee-kill-this-buffer»  (to ".ee-kill-this-buffer")
;; (find-enode "Command Index" "* delete-other-windows:")
;; (find-efunction 'kill-buffer-and-window)
;; (find-efunction 'delete-window)

(defvar ee-kill-buffer-kills-window nil)
(make-variable-buffer-local 'ee-kill-buffer-kills-window)

;; Argument: permament

(defun ee-kbkw ()
  "Set `ee-kill-buffer-kills-window' to t in this buffer."
  (interactive)
  (put 'ee-kill-buffer-kills-window 'permanent-local t)
  (setq ee-kill-buffer-kills-window t))

(defun ee-delete-window (&optional window)
  "Like `delete-window', but do not raise an error on failure."
  (interactive)
  (condition-case nil
      (delete-window window)
    (error nil)))

(defun ee-kill-this-buffer-and-window ()
  "Run `kill-this-buffer', then `ee-delete-window'."
  (interactive)
  (kill-this-buffer)
  (ee-delete-window))

;; (defun ee-kill-this-buffer ()
;;   "Like `kill-this-buffer', but might delete the current window too."
;;   (interactive)
;;   (if ee-kill-buffer-kills-window
;;       (ee-kill-this-buffer-and-window)
;;     (kill-this-buffer)))

;; (define-key eev-mode-map "\M-k" 'ee-kill-this-buffer)
;; (define-key eev-mode-map "\M-k" 'kill-this-buffer)

;; Run this at fid-gdb
;; (put 'ee-kill-buffer-kills-window 'permanent-local t)
;; (setq ee-kill-buffer-kills-window t)

;; what about M-K?
;; (find-efunction 'kill-this-buffer)



;; (find-teseleapage 20)
;; (find-teseleatext)
;;
(code-xpdf "teselea" "~/LEA/teselea2006.pdf")
(defun find-teseleatext (&rest rest)
  (interactive)
  (apply 'find-pdfpage-pdftotext "~/LEA/teselea2006.pdf" rest))


;; (find-es "icon" "icon-sarge-source")
;; (find-iconfile "")
(code-c-d "icon" "~/usrc/icon/icon-9.4.2/" :grep)



;; «golisp»  (to ".golisp")
;; http://dto.freeshell.org/notebook/GoLisp.html
;; http://dto.freeshell.org/e/golisp.el
;; (eev "psne http://dto.freeshell.org/e/golisp.el; mv -v golisp.el.1 golisp.el")
;; (find-sh0 "cp -v $S/http/dto.freeshell.org/e/golisp.el ~/elisp/")
;; (find-fline "~/elisp/golisp.el")
;;
;; (code-c-d "golisp" "~/elisp/")
;; (find-golispfile "golisp.el" "defface golisp-xref-face")
;; (find-golispfile "golisp.el" "{{fontlocking}}")
;;
(defface golisp-xref-face '((t (:weight normal :bold nil :foreground "gold")))
  "Face for golisp links.")
;;
(setq golisp-xref-bullet 342435)
(setq golisp-anchor-bullet 343416)
(autoload 'golisp-mode "golisp" nil t)





(defun ee-find-dvdcopy-script (name)
  (format "\
* (eechannel-xterm \"A\")
cd
umount       /tmp/dvd/
mkdir        /oldfs/dvds/%s/
mount        /tmp/dvd/
cd           /tmp/dvd/
du -c
cp -diPpvR * /oldfs/dvds/%s/
cd           /oldfs/dvds/%s/
find
du -c\n
# (find-man \"growisofs\" \"To master and burn an ISO9660\")
# (find-sh \"dvd+rw-mediainfo /dev/hdc\")
cd /oldfs/dvds/%s/
du -c
growisofs -dvd-compat -Z /dev/hdc -R -J -v .
" name name name name))

(defun find-dvdcopy-script (name &rest rest)
  (apply 'find-estring (ee-find-dvdcopy-script name) rest))

;; (find-dvdcopy-script "padrone")
;; (find-dvdcopy-script "sheltering")
;; (find-dvdcopy-script "nossamusica")


(defun ee-find-bigdvdcopy-script (isoimagefilename nfiles1)
  (format "\
* (eechannel-xterm \"A\")
* (eepitch-shell)
mkdir /tmp/dvd/

# Check the size
sudo umount /tmp/dvd/
mount  /tmp/dvd/
du -c  /tmp/dvd/
find   /tmp/dvd/

# Check for partitions with free space
df

# Copy the DVD image as an .iso
# (find-fline \"%s\")
# (find-sh0 \"ls -l %s\")
cat /dev/hdc > %s

# Play
vlc dvd://%s

# Mount the the .iso image or the real DVD
sudo umount /tmp/dvd/
mount | grep dvd
mount /tmp/dvd/
sudo mount -o loop,ro -t iso9660 %s /tmp/dvd/
sudo mount -o loop,ro -t udf     %s /tmp/dvd/

# Write the .iso into a single DVD-R
# (find-sh \"dvd+rw-mediainfo /dev/hdc\")
growisofs -dvd-compat -Z /dev/hdc=%s

# Check for how to split
# (find-zsh \"laf /tmp/dvd/*/*\")
du -c $(find /tmp/dvd/ -type f | sort | awk 'NR <= %d')
du -c $(find /tmp/dvd/ -type f | sort | awk 'NR  > %d')

# (find-man \"growisofs\" \"To master and burn an ISO9660\")
# (find-angg \".zshrc\" \"asgraftpoints\")
# (find-sh \"dvd+rw-mediainfo /dev/hdc\")
cd /tmp/dvd/
du -c
growisofs -dvd-compat -Z /dev/hdc -R -J -v \\
  $(find * -type f | sort | awk 'NR <= %d' | asgraftpoints)
growisofs -dvd-compat -Z /dev/hdc -R -J -v \\
  $(find * -type f | sort | awk 'NR  > %d' | asgraftpoints)
" (file-name-directory isoimagefilename)
  isoimagefilename isoimagefilename isoimagefilename isoimagefilename
  isoimagefilename isoimagefilename
  nfiles1 nfiles1 nfiles1 nfiles1))

;; «find-bigdvdcopy-script»  (to ".find-bigdvdcopy-script")
;;
(defun find-bigdvdcopy-script (isoimagefilename nfiles1 &rest rest)
  (apply 'find-estring
	 (ee-find-bigdvdcopy-script isoimagefilename nfiles1) rest))

(defun find-bigdvdcopy-script (isoimagefilename nfiles1 &rest rest)
  (apply 'find-elinks
	 `((find-bigdvdcopy-script ,isoimagefilename ,nfiles1 . ,rest)
	   ""
	   ,(ee-find-bigdvdcopy-script isoimagefilename nfiles1))
	 rest))

;; (find-bigdvdcopy-script "/oldfs/dvds/pantano.iso" 10)
;; (find-bigdvdcopy-script "/oldfs/dvds/castelo.iso" 15)
;; (find-bigdvdcopy-script "/oldfs/dvds/senhordasarmas.iso" 9)
;; (find-bigdvdcopy-script "/oldfs/dvds/noitescomsol.iso" 10)

;; (find-bigdvdcopy-script "/oldfs/dvds/cache.iso" 30)
;; (find-bigdvdcopy-script "/oldfs/dvds/solaris1.iso" 10)
;; (find-bigdvdcopy-script "/oldfs/dvds/solarisdossier.iso" 10)
;; (find-bigdvdcopy-script "/oldfs/dvds/sacrificio.iso" 10)

;; (find-bigdvdcopy-script "/oldfs/dvds/ozu.iso" 99)
;; (find-bigdvdcopy-script "/oldfs/dvds/medea.iso" 99)

;; (find-bigdvdcopy-script "/oldfs/dvds/muppetshow1.iso" 10)
;; (find-bigdvdcopy-script "/oldfs/dvds/muppetshow2.iso" 10)
;; (find-bigdvdcopy-script "/oldfs/dvds/meaningoflife.iso" 10)
;; (find-bigdvdcopy-script "/oldfs/dvds/thunderbirds6.iso" 10)
;; (find-bigdvdcopy-script "/oldfs/dvds/thunderbirdsarego.iso" 53)
;; (find-bigdvdcopy-script "/oldfs/dvds/felakuti.iso" 13)
;; (find-bigdvdcopy-script "/oldfs/dvds/florespartidas.iso" 53)
;; (find-bigdvdcopy-script "/oldfs/dvds/lavoura.iso" 9)
;; (find-bigdvdcopy-script "/oldfs/dvds/lavoura2.iso" 9)
;; (find-bigdvdcopy-script "/oldfs/dvds/ran.iso" 10)
;; (find-sh0 "sudo umount /tmp/dvd/; rmdir /tmp/dvd/; rm /tmp/dvd")
;; (find-sh0 "ln -s /oldfs/dvds/ran /tmp/dvd")
;; (find-fline "/tmp/dvd/")
;; (find-bigdvdcopy-script "/oldfs/dvds/tagliaferro.iso" 13)
;; (find-bigdvdcopy-script "/oldfs/dvds/noivasiria.iso" 10)
;; (find-bigdvdcopy-script "/oldfs/dvds/capote.iso" 13)
;; (find-bigdvdcopy-script "/oldfs/dvds/brancaleone.iso" 13)
;; (find-bigdvdcopy-script "/oldfs/dvds/ultimotango.iso" 99)
;; ^libdvdread: Error cracking CSS key for /VIDEO_TS/VTS_01_0.VOB (0x000006b5)
;; (find-bigdvdcopy-script "/oldfs/dvds/ytumamatambien.iso" 99)
;; (find-bigdvdcopy-script "/oldfs/dvds/querelle.iso" 99)
;; (find-bigdvdcopy-script "/oldfs/dvds/fightclub.iso" 99)


;; http://www.tac.mta.ca/tac/volumes/17/1/17-01.dvi
;; http://www.tac.mta.ca/tac/volumes/18/2/18-02.dvi
(code-dvi "ragsgames" "$S/http/www.tac.mta.ca/tac/volumes/18/2/18-02.dvi")
(code-dvi "barrchu2006" "$S/http/www.tac.mta.ca/tac/volumes/17/1/17-01.dvi")
;; (find-barrchu2006page 1)
;; (find-ragsgamespage 1)



;; (find-halloweenfile "")
;; (find-halloweengrep "grep -nH -e '^[A-Za-z]' 2.lua")
(code-c-d "halloween" "~/HALLOWEEN/" :anchor :grep)

(defun fs (&rest rest) (interactive)
  (apply 'find-sh "egrep 'function|return' ~/HALLOWEEN/2.lua" rest))


;; «find-cat-to-lp0-script»  (to ".find-cat-to-lp0-script")
;; (find-angg ".zshrc" "MAKEDEV_create")
;; (find-angg ".zshrc" "gsdj")
;; (find-angg "bin/lpdj-tmp")
;; (find-anggfile "bin/" "lpr -> lpdj-tmp")
;; (find-fline "/dev/" "lp0")
;; (find-fline "/dev/usb/" "lp0")
;;
(defun find-cat-to-lp0-script ()
  (interactive)
  (find-estring (format "\
gnudoit \"(find-cat-to-lp0-script)\"\n
* (eepitch-shell)
R
  MAKEDEV_create /tmp/lp0 c 6 0 edrx:edrx 0666
# MAKEDEV_create /tmp/lp0 c 180 0 edrx:edrx 0666
exit
cd /tmp/
laf
%s
rm -v /tmp/lp0
" (find-sh00 "cd /tmp
      for i in o.p[0-9][0-9][0-9]; do
        echo \"cat $i > /tmp/lp0\"
      done"))))



;; «cltl»  (to ".cltl")
;; (find-es "lisp" "common-lisp-the-language")
(code-c-d "cltl" "~/usrc/cltl_src/")
(code-dvi "cltl"    (ee-cltlfile "clm.dvi"))
(code-dvi "cltldvi" (ee-cltlfile "clm.dvi"))
;; (code-ps  "cltlps"  (ee-cltlfile "clm.ps"))
;; (find-cltlfile "")
;; (find-cltlpage 2)
;; (find-cltlpage (+ 24 80))
;; (find-cltlpage (+ 24 81))
;; (find-cltlpage (+ 24 84))
;; (find-cltlpage (+ 24 86))
;; (find-cltlpage (+ 24 90))

;; (find-sh "pstotext ~/usrc/cltl_src/clm.ps")



;; «slime»  (to ".slime")
;; (find-es "lisp" "slime")
;;
;; 2007mar17:
;; <lisppaste> edrx pasted "problem with M-x slime" at
;;             http://paste.lisp.org/display/38274
;;
'(
(add-to-list 'load-path "~/usrc/slime-2.0/")
(setq inferior-lisp-program "/usr/bin/sbcl")
(autoload 'slime "slime" nil t)
(eval-after-load "slime" '(slime-setup :autodoc t))
)


;; «find-template-untgz»  (to ".find-template-untgz")
;; «bruntgz»              (to ".bruntgz")
;; (bruntgz "http://common-lisp.net/project/slime/slime-2.0.tgz")

(defun ee-first-directory (fname)
  (replace-regexp-in-string "^\\([^/]*\\)\\(/[^/]*\\)*" "\\1" fname))

(defun ee-tar-tzf-first-line (fname)
  (find-sh0 (format "tar -tzf %s 2>&1 | head -n 1" fname)))

(defun ee-tar-tzf-first-directory (fname)
  (ee-first-directory (ee-tar-tzf-first-line fname)))

(defun ee-template-untgz (url &optional c)
  (let* (;; (shortlurl (eeurl-u-to-f url))
	 (shortlurl (ee-url-to-fname url))
	 (lurl (ee-expand shortlurl))
	 (shortd (ee-tar-tzf-first-directory lurl))
	 (d (format "~/usrc/%s" shortd))
	 (date (downcase (format-time-string "%Y%b%d"))))
    `(,(format "#####")
      ,(format "#")
      ,(format "# %s" shortd)
      ,(format "# %s" date)
      ,(format "#")
      ,(format "#####")
      ,(format "")
      ,(format "# %s" url)
      ,(format "#*")
      ,(format "rm -Rv ~/usrc/%s/" shortd)
      ,(format "tar -C ~/usrc/ -xvzf \\")
      ,(format "  %s" shortlurl)
      ,(format "cd     ~/usrc/%s/" shortd)
      ,(format "")
      ,(format "#*")
      ,(format "# (code-c-d %S \"~/usrc/%s/\")" c shortd)
      ,(format "# (find-%sfile \"\")" c)
      )))

(defun find-template-untgz (url &optional c &rest rest)
  (apply 'find-elinks `
   ((find-template-untgz ,url ,c)
    ""
    ,@(ee-template-untgz url c))
   rest))

(code-brurl 'find-template-untgz :remote 'bruntgz)




(defun ee-tar-tjf-first-line (fname)
  (find-sh0 (format "tar -tjf %s | head -n 1" fname)))

(defun ee-tar-tjf-first-directory (fname)
  (ee-first-directory (ee-tar-tjf-first-line fname)))

(defun ee-template-untbz2 (url &optional c)
  (let* (;; (shortlurl (eeurl-u-to-f url))
	 (shortlurl (ee-url-to-fname url))
	 (lurl (ee-expand shortlurl))
	 (shortd (ee-tar-tjf-first-directory lurl))
	 (d (format "~/usrc/%s" shortd))
	 (date (downcase (format-time-string "%Y%b%d"))))
    `(,(format "#####")
      ,(format "#")
      ,(format "# %s" shortd)
      ,(format "# %s" date)
      ,(format "#")
      ,(format "#####")
      ,(format "")
      ,(format "# %s" url)
      ,(format "#*")
      ,(format "rm -Rv ~/usrc/%s/" shortd)
      ,(format "tar -C ~/usrc/ -xvjf \\")
      ,(format "  %s" shortlurl)
      ,(format "cd     ~/usrc/%s/" shortd)
      ,(format "")
      ,(format "#*")
      ,(format "# (code-c-d %S \"~/usrc/%s/\")" c shortd)
      ,(format "# (find-%sfile \"\")" c)
      )))

(defun find-template-untbz2 (url &optional c &rest rest)
  (apply 'find-elinks `
   ((find-template-untbz2 ,url ,c)
    ""
    ,@(ee-template-untbz2 url c))
   rest))

(code-brurl 'find-template-untbz2 :remote 'bruntbz2)


;; «find-code-ps-url-links»  (to ".find-code-ps-url-links")
;; «brcps»  (to ".brcps")

;; (find-code-ps-url-links "http://foo/bar.pdf" "foobar")
;; "dvipdf -" doesn't work:
;; (find-man "dvipdf")
;; (find-sh "cd /tmp/ && cat ~/LATEX/tmp.dvi && dvipdf - foo.pdf")

(defun find-code-ps-url-links (url &optional code &rest rest)
  "Example: (find-code-ps-url-links \"http://foo/bar.pdf\" \"foobar\")"
  (setq code (or code "_"))
  (let* ((ee-hyperlink-prefix ";; ")
	 (localurl (eeurl-u-to-f url))
	 (localdir (file-name-directory localurl))
	 (fname    (file-name-nondirectory localurl))
	 )
    (find-elinks
     `((find-code-ps-url-links ,url ,code ,@rest)
       ""
       ,(format ";; %s" url)
       ,(format ";; (find-sh \"cd %s && zcat %s | ps2pdf - %s.pdf\")" localdir fname fname)
       ,(format "(code-ps        %S %S)" code localurl)
       ,(format "(code-pdftotext %S %S)" code localurl)
       ,(format ";; (find-%spage 1)" code)
       ,(format ";; (find-%stext)"   code)
       ) rest)))

(defun find-code-xpdf-url-links (url &optional code &rest rest)
  "Example: (find-code-xpdf-url-links \"http://foo/bar.pdf\" \"foobar\")"
  (setq code (or code "_"))
  (let ((ee-hyperlink-prefix ";; ")
	(localurl (eeurl-u-to-f url)))
    (find-elinks
     `((find-code-xpdf-url-links ,url ,code ,@rest)
       ""
       ,(format ";; %s" url)
       ,(format "(code-xpdf      %S %S)" code localurl)
       ,(format "(code-pdftotext %S %S)" code localurl)
       ,(format ";; (find-%spage 1)" code)
       ,(format ";; (find-%stext)"   code)
       ) rest)))

(code-brurl 'find-code-ps-url-links
            :remote 'brcps :local 'brcpsl :dired 'brcpsd)
(code-brurl 'find-code-xpdf-url-links
            :remote 'brcxpdf :local 'brcxpdfl :dired 'brcxpdfd)




;; «find-pspage-links»  (to ".find-pspage-links")
;; (find-amslmathfile "")
;; (find-fline         (ee-amslmathfile ""))
;; (find-pspage        (ee-amslmathfile "amsldoc.pdf"))
;; (find-pspage-links '(ee-amslmathfile "amsldoc.pdf") "amsldoc")
;;
(defun find-pspage-links (sexp &optional code &rest rest)
  "Example: see (find-efunction 'find-pspage-links)"
  (setq code (or code "_"))
  (find-elinks
   `((find-pspage-links ',sexp ,code ,@rest)
     ""
     ,(format "(find-pspage        %S)" sexp)
     ,(format "(find-pspage-links '%S)" sexp)
     ,(format "(code-ps        %S %S)" code sexp)
     ,(format "(code-pdftotext %S %S)" code sexp)
     ,(format "(find-%spage 1)" code)
     ,(format "(find-%stext)"   code)
     ) rest))


;; «find-jstor-links»  (to ".find-jstor-links")
;; (define-key eev-mode-map "\M-h\M-j" 'find-jstor-links)
;; (find-efunction 'ee-template)

(defun find-jstor-links (&optional numeric code &rest rest)
  (interactive)
  (setq numeric (or numeric "{2222222}"))
  (setq code (or code "_"))
  (apply 'find-elinks `(
    (find-jstor-links ,numeric ,code ,@rest)
    ,(ee-template `(("2222222" ,numeric) ("code" ,code)) "
;; Author: \"Title\"
;; http://www.jstor.org/stable/info/{2222222}
;; http://www.jstor.org/stable/pdfplus/{2222222}.pdf
;; (find-sh0 \"mv -iv /tmp/{2222222}.pdf $S/http/www.jstor.org/stable/pdfplus/\")
\(code-xpdf      \"{code}\" \"$S/http/www.jstor.org/stable/pdfplus/{2222222}.pdf\")
\(code-pdftotext \"{code}\" \"$S/http/www.jstor.org/stable/pdfplus/{2222222}.pdf\")
;; (find-{code}page 1)
;; (find-{code}text)")
    ) rest))

(defun find-arxiv-links (&optional url v code &rest rest)
  (interactive)
  (setq url (or url "http://arxiv.org/abs/0807.1704"))
  (setq v (or v "v1"))
  (setq code (or code "_"))
  (apply 'find-elinks `(
    (find-arxiv-links ,url ,v ,code ,@rest)
    (find-efunction 'find-arxiv-links)
    ,(ee-template
      `(("code" ,code)
	("v1" ,v)
        ("http://arxiv.org/abs/12.34" ,url)
        ("$S/http/arxiv.org/abs/12.34" ,(eeurl-u-to-f url))
        ("$S/http/arxiv.org/abs/" ,(file-name-directory (eeurl-u-to-f url)))
        ("12.34" ,(file-name-nondirectory url))
	) "
;; Author: \"Title\"
;; {http://arxiv.org/abs/12.34}
;; {http://arxiv.org/abs/12.34}v1.dvi
;; {http://arxiv.org/abs/12.34}v1.pdf
;; (find-fline \"{$S/http/arxiv.org/abs/}\" \"{12.34}\")
;; (find-sh0 \"mv -iv /tmp/{12.34}* {$S/http/arxiv.org/abs/}\")
\(code-dvi       \"{code}\" \"{$S/http/arxiv.org/abs/12.34}{v1}.dvi\")
\(code-xpdf      \"{code}\" \"{$S/http/arxiv.org/abs/12.34}{v1}.pdf\")
\(code-pdftotext \"{code}\" \"{$S/http/arxiv.org/abs/12.34}{v1}.pdf\")
;; (find-{code}page 1)
;; (find-{code}text)")
    ) rest))

;; (find-arxiv-links)

(code-brurl 'find-arxiv-links :remote 'brarxiv)






;; http://www.hermetic.com/crowley/aba/
;; (code-c-d "mitap" "$S/http/www.hermetic.com/crowley/aba/" :grep)
;; (find-mitapfile "")
;; (find-mitapw3m "index.html")
;; (find-mitapw3m "chap14.html" "Many ends, many means")



(seen 7953)





;; «wikit-edit»  (to ".wikit-edit")
;; (find-es "tcl" "httpwiki")
(defun wikit-edit (interactive) (find-es "tcl" "httpwiki"))



;; «find-eepitch-links»  (to ".find-eepitch-links")
;; (defun find-eepitch-links (&rest rest)
;;   (interactive)
;;   (apply 'find-elinks
;;          `((find-eepitch-links ,@rest)
;;            "* (eepitch-shell)"
;;            "* (eepitch-lua51)"
;;            "* (eepitch-kill)"
;;            ""
;;            (find-angg ".emacs" "find-eepitch-links")
;;            (find-angg ".emacs" "eepitch-kill")
;;            (find-efunction 'eepitch)
;;            (find-eevfile "eev-steps.el")
;;            (find-eevfile "eev-mini-steps.el"))
;;          rest))
;;
;; (define-key eev-mode-map "\M-h\M-p" 'find-eepitch-links)



;; «find-eevarticle-links»  (to ".find-eevarticle-links")
(defun find-eevarticle-links (&rest rest)
  (interactive (list ""))
  (let* ((anchororempty (if (equal (car rest) "") ""  (car rest)))
	 (anchorornil   (if (equal (car rest) "") nil (car rest)))
	 (htmlanchororempty (if anchorornil (concat "#" anchorornil) ""))
	 (htmlanchorornil   (if anchorornil (concat "#" anchorornil) nil))
	 )
    (apply 'find-elinks
	   `((find-eevarticle-links ,@rest)
	     (find-angg "TH/eev-article.blogme")
	     (find-angg ".emacs" "find-eevarticle-links")
	     )
	   rest)))

(define-key eev-mode-map "\M-h\M-a" 'find-eevarticle-links)


;; «find-anggrumidiff-links»  (to ".find-anggrumidiff-links")

(defun filename-at-eol ()
  (let ((line (buffer-substring (ee-bol) (ee-eol))))
    (string-match "\\([^ \t]*\\)$" line)
    (ee-no-properties (match-string 1 line))))

(defun find-anggrumidiff-links (fname &rest rest)
  (interactive (list (filename-at-eol)))
  (let ((anggfname (concat "/tmp/page/angg/" fname))
	(rumifname (concat "/tmp/page/rumi/" fname))
	(homefname (concat              "~/" fname))
	)
    (apply 'find-elinks
	   `((find-anggrumidiff-links ,fname)
	     (find-anggfile "LUA/quickdiff.lua")
	     ""
	     (find-tkdiff ,anggfname ,rumifname)
	     (find-fline ,anggfname)
	     (find-fline ,rumifname)
	     (find-fline ,homefname)
	     (find-sidebyside '(find-fline ,anggfname) '(find-fline ,homefname))
	     (find-sh0 ,(format "cp -v %s %s" anggfname rumifname))
	     (find-sh0 ,(format "cp -v %s %s" rumifname anggfname))
	     (find-sh0 ,(format "cp -v %s %s" anggfname homefname))
	     (find-sh0 ,(format "cp -v %s %s" rumifname homefname)))
	   rest)))

(define-key eev-mode-map "\M-ha" 'find-anggrumidiff-links)


;; This is missing from eev.el, why?
' (defmacro eeb-once (&rest body) `(let (eeb-defaults) . ,body))
' (defmacro ee-once  (&rest body) `(let (eeb-defaults) . ,body))


;; «ee-shrink-hyperlink-at-eol»  (to ".ee-shrink-hyperlink-at-eol")
;; (find-eev "eev-edit.el" "ee-shrink-hyperlink-at-eol")



;; 2007apr19
;; (find-angg ".emacs" "eechannel-send-passwd")
;; (find-elnode "Reading a Password")
;; (find-efunction 'ee-hyperlink-prefix)
;; (find-efunction 'eechannel-send)
;; (find-eevfile "eev-steps.el" "defun eechannel-send")
;; (find-eevgrep "grep -nH -e concat *.el")
;; (find-eevgrep "grep -nH -e '\"eev\"' *.el")

;; (code-c-d "eev" "$EEVDIR/" :anchor :grep)
'
(defun eechannel-send (channel &rest strings)
  (if (not channel) (setq channel eechannel-default))
  (ee-write (ee-concat strings) nil "" "" (eechannel-strfile channel))
  (find-sh0 (format "kill -USR1 $(cat %s)" (eechannel-pidfile channel))))

;; «find-setq-links»	(to ".find-setq-links")
;; # (find-setq-links 'k8-password-edrx)
;; # (find-setq-links 'k8-password-root)
;; * (eechannel-xterm "A")
;; ssh edrx@mta13.prv.k8.com.br
;; * (eechannel-send nil k8-password-edrx "\n")
;; su
;; * (eechannel-send nil k8-password-root "\n")
;;
(defun find-setq-links (var &rest rest)
  (interactive)
  (if (not (boundp var)) (set var nil))
  (find-elinks
   `((find-setq-links ',var ,@rest)
     (setq ,var ,(symbol-value var))
     (setq ,var (read-passwd ,(format "%s: " var)))
     )))



;; (code-c-d "rumi" "~/" :anchor)




;; «ee-choosecolor»  (to ".ee-choosecolor")
;; (find-es "tcl" "tk_chooseColor")
;; (find-estring (ee-choosecolor))
;; (find-eev "eev-langs.el" "ee-choosecolor")

;; «find-ecolor-links»  (to ".find-ecolor-links")
;; (find-efunction 'list-colors-display)
;; (find-efunction 'list-colors-print)
;; (find-efunction 'list-colors-print "#%02x%02x%02x")
;; (find-ecolor-links)
;; (find-ecolor-links "sienna")
;; (find-eev "eev-insert.el" "find-ecolor-links")

;; «find-eface»  (to ".find-eface")
;; (find-eev "eev-blinks.el" "find-wottb")
;; (find-efunction 'find-face-definition)
;; (find-efunction 'find-definition-noselect)
;; (find-egrep "grep -nH -e find-face-definition C*")
;;
(defun find-eface (face &rest pos-spec-list)
  "Hyperlink to the result of running `find-face-definition' on FACE.
The `find-face-definition' function of Emacs can be used as a hyperlink
- it finds the Elisp source code of SYMBOL -, but it doesn't
support a POS-SPEC-LIST like this function does."
  (interactive (find-function-read 'defface))
  (apply 'find-ebufferandpos (find-definition-noselect face 'defface)
	 pos-spec-list))

;; «find-eface-links»  (to ".find-eface-links")
;; (find-eface-links 'makefile-space)
;; (find-eapropos "foreground")
;; (find-eface-links 'region)
;;
'
(defun find-eface-links (face-symbol &rest rest)
  ;; (interactive (list (read-face-name "Links for face:")))
  (interactive (list (face-at-point)))
  (apply 'find-elinks `(
    (find-eface-links ',face-symbol ,@rest)
    ""
    (find-efacedescr ',face-symbol)
    (find-eface ',face-symbol)
    (customize-face ',face-symbol)
    (set-face-foreground ',face-symbol ,(face-foreground face-symbol))
    (set-face-background ',face-symbol ,(face-background face-symbol))
    (face-id ',face-symbol)
    (find-epp (mapcar (lambda (face) (cons (face-id face) face)) (face-list)))
    (find-ecolors)
    (find-efaces)
    ) rest))

;; (find-eevfile "eev.el" "\\M-h\\M-s")
(define-key eev-mode-map "\M-h\M-s" 'find-eface-links)



;; «digirati»  (to ".digirati")
;; (find-rumi "RUMI/baktodo.e" "download-from-svn")
;; (find-baksrvfile "")
(code-c-d "baksrv" "~/svn/adm/todo/bak/srv/" :grep)
;;
;; (find-rumi "RUMI/ruby.e")
;; (find-rumi "RUMI/ruby.e" "rubyway")
;; (find-rubywayfile "")
;; (find-rubywayw3m "toc.html")
(code-c-d "rubyway" "~/usrc/rubyway/0768667208/")
;;
;; (find-es "ruby" "ruby-from-debian-sources-etch")
(code-c-d "rubysrc" "~/usrc/ruby1.8/ruby1.8-1.8.5/" :grep)
(code-c-d "rubysrc" "~/usrc/ruby1.8/ruby1.8-1.8.5/build-tree/ruby-1.8.5/" :grep)

(defun eepitch-osmio () (interactive)
  (eepitch '(find-comintprocess "osmio" "ssh edrx@osmio.prv.k8.com.br")))

(defun eepitch-svl2 () (interactive)
  (eepitch '(find-comintprocess "svl2" "ssh teste@10.7.5.243")))

;; * (eepitch-svl2)
;; * (ansi-color-for-comint-mode-on)

;; (find-es "cvs" "svnbook")
(code-xpdf      "svnbook" "$S/http/svnbook.red-bean.com/en/1.2/svn-book.pdf")
(code-pdftotext "svnbook" "$S/http/svnbook.red-bean.com/en/1.2/svn-book.pdf")
;; (find-svnbookpage 4)
;; (find-svnbookpage (+ 17 44))
;; (find-svnbooktext "Chapter 4. Branching and Merging")

;; A new edition (non-free, on a private machine) of the "pragmatic
;; programmers" etc etc book...
;; http://andre.prv.digirati.com.br/programming_ruby_2nd.pdf
;; (find-es "ruby" "pragmatic")
(code-xpdf      "progruby2" "$S/http/andre.prv.digirati.com.br/programming_ruby_2nd.pdf")
(code-pdftotext "progruby2" "$S/http/andre.prv.digirati.com.br/programming_ruby_2nd.pdf")
;;
;; (find-progruby2page (+ 28 313) "Names")
;; (find-progruby2page (+ 28 343))
;; (find-progruby2page (+ 28 363) "(diagram)")
;; (find-progruby2text)
;; (find-progruby2text "export RI=\"--format ansi --width 70\"")
;; (find-progruby2page (+ 28 330) "Method Definition")
;; (find-progruby2page (+ 28 333) "Invoking a Method")

;; (find-es "ruby" "ruby-in-a-nutshell")
(code-xpdf      "rubynutshell" "~/books/ruby-in-a-nutshell.pdf")
(code-pdftotext "rubynutshell" "~/books/ruby-in-a-nutshell.pdf")
;; (find-rubynutshellpage 45)
;; (find-rubynutshelltext "Among the methods of the modules")

(code-xpdf "railssolutions"
  "~/tmp/FriendsofED.Rails.Solutions.Ruby.on.Rails.Made.Easy.Jan.2007.pdf")
;; (find-railssolutionspage 6)

(code-xpdf      "rubyforrails" "~/tmp/ruby_for_rails.pdf")
(code-pdftotext "rubyforrails" "~/tmp/ruby_for_rails.pdf")
;; (find-rubyforrailspage 1)
;; (find-rubyforrailspage (+ 35 1))
;; (find-rubyforrailspage (+ 35 25) "irb -rrbconfig")
;; (find-rubyforrailstext)
;; (find-rubyforrailstext "irb -rrbconfig")

;; (find-rubyismsfile "")
;; (find-rubyismsw3m "toc.html")
(code-c-d "rubyisms" "~/usrc/rubyisms/0321474074/")

;; «mysql»  (to ".mysql")
;; (find-es "mysql" "mysql-ref")
(code-c-d "mysqlref" "~/usrc/refman-5.0-en.html-chapter/")
;;
;; (find-mysqlrefw3m "index.html")
;; (find-mysqlrefw3m "tutorial.html")
;;
;; (find-es "mysql" "mysql-help")
;; (find-mysqldo "help")
;; (find-mysqldo "help show")
;; (find-mysqldo "help contents")
(defun find-mysqldo (str &rest rest)
  (apply 'find-sh (format "echo '%s' | mysql -u root" str) rest))
(defun find-mysqlvdo (str &rest rest)
  (apply 'find-sh (format "echo '%s' | mysql -u root -t -vvv" str) rest))

(defun eepitch-mysql () (interactive)
  (eepitch '(let ((process-environment (cons "PAGER=cat" process-environment)))
	      (find-comintprocess "mysql" "mysql -u root"))))

;; «find-anggupload-links»  (to ".find-anggupload-links")
;; (find-anggupload-links "~/e/sqlite.e")
;;
(defun ee-expand-remove-prefix (prefix fname)
  (ee-remove-prefix (ee-expand prefix) (ee-expand fname)))
;;
(define-key eev-mode-map "\M-h\M-u" 'find-anggupload-links)
(defun find-anggupload-links (fname &rest rest)
  (interactive (list (buffer-file-name)))
  (let ((fnamestem (ee-expand-remove-prefix "~/" fname)))
    (find-elinks
     `((find-anggupload-links ,fname ,@rest)
       (find-angg ,fnamestem)
       ,(format "# http://angg.twu.net/%s"      fnamestem)
       ,(format "# http://angg.twu.net/%s.html" fnamestem)
       ""
       "* (eepitch-eshell)"
       ,(format "cp -v ~/%s /scp:edrx@angg.twu.net:public_html/%s"
		fnamestem fnamestem)
       ""
       "* (eechannel-xterm \"TWU\" '(\"ssh\" \"edrx@angg.twu.net\"))"
       "cd ~/public_html/ && make -f TH/Makefile page |& tee ~/om"
       "cd ~/public_html/ && make -f TH/Makefile page edrx.tgz |& tee ~/om"
       ""
       (find-es "page" "upload-rsync")
       (find-angg ".zshrc" "makepagefromtar")
       (find-angg ".zshrc" "makepage")
       (find-fline "/scp:edrx@angg.twu.net:om")
       (find-fline "/scp:edrx@angg.twu.net:public_html/")
       ))))

;; «find-unpack-chm-links»  (to ".find-unpack-chm-links")
;; (find-zsh "dmissing extract_chmLib")
;; (eev "apti libchm-bin")
(defun find-unpack-chm-links (chm &optional destdir code &rest rest)
  (interactive "f")
  (if (not destdir) (setq destdir "~/usrc/tmpchm/"))
  (if (not code)    (setq code    "tmpchm"))
  (find-elinks
   `((find-unpack-chm-links ,chm ,destdir ,code ,@rest)
     (find-efunction 'find-unpack-chm-links)
     ,@(ee-escript-header code)
     ""
     "#*"
     ,(format "rm -Rv %s" destdir)
     ,(format "mkdir  %s" destdir)
     ,(format "cd     %s" destdir)
     ,(format "extract_chmLib \\")
     ,(format "  %s \\" chm)
     ,(format "  %s" destdir)
     ""
     "#*"
     ,(format "# (code-c-d %S %S)" code destdir)
     ,(format "# (find-%sfile \"\")" code)
     ,(format "# (find-%sw3m \"toc.html\")" code)
     )))

(code-brfile 'find-unpack-chm-links :local 'brunchml :dired 'brunchmd)



(seen 8000)

;;;                  _
;;;   ___  ___ _ __ (_) ___
;;;  / _ \/ _ \ '_ \| |/ __|
;;; |  __/  __/ |_) | | (__
;;;  \___|\___| .__/|_|\___|
;;;           |_|
;;
;; «eepic»  (to ".eepic")
;; (find-eev "eev-mini-steps.el")
;; (find-eev "eev-mini-steps.el" "eechannel-assert")
;; (load "eev-mini-steps")

(defun eepic-gv-assert ()
  (eechannel-assert "eepicgv" `("gv" "-watch" "$EEVTMPDIR/ee.pic.ps")))

(defun eepic-now (s &optional e)
  (interactive "r")
  (ee-write s e ".PS\n" "\n.PE\n" (ee-expand "$EEVTMPDIR/ee.pic"))
  (let ((output (find-sh0 "groff -p $EEVTMPDIR/ee.pic > $EEVTMPDIR/ee.pic.ps")))
    (unless (equal output "")
      (find-estring output)))
  (eepic-gv-assert))

;; (eepic-now "box; box wid 1 ht 1; box same; box")
;; (eepic-now "box; box wid 1 ht 2; box same; box")
;;
;; (find-fline  "$EEVTMPDIR/" "ee.pic")
;; (find-pspage "$EEVTMPDIR/ee.pic.ps")

;; «esrpic»  (to ".esrpic")
;; (find-es "pic" "pic-manual")
;; (find-es "pic" "gpic")
;; (find-angg "PIC/1.pic")
;;
(defun find-esrpicorigtext (&rest rest)
  (apply 'find-sh "zcat /usr/share/doc/groff-base/pic.txt.gz | col -b" rest))
;; (code-ps      "esrpic" "/usr/share/doc/groff-base/pic.ps.gz")
;;
;; (find-sh0 "cd /usr/share/doc/groff-base/ && zcat pic.ps.gz | ps2pdf - ~/tmp/esrpic.pdf")
(code-xpdf      "esrpic" "~/tmp/esrpic.pdf")
(code-pdftotext "esrpic" "~/tmp/esrpic.pdf")
;;
;; (find-esrpicpage      1  "Contents")
;; (find-esrpictext "")
;;
;; (find-esrpicpage 12   "9. Naming Objects")
;; (find-esrpictext      "9. Naming Objects")
;; (find-esrpicorigtext "9.  Naming Objects")



;; (find-eevarticlesection "shorter-hyperlinks")
(defun find-eevarticlesection (&rest rest)
  (interactive)
  (apply 'find-angg "TH/eev-article.blogme" rest))


(code-c-d "keplersrc" "~/usrc/kepler-1.1/")
(code-c-d "kepler"    "~/usrc/kepler/")



;; «find-adduser-links»  (to ".find-adduser-links")
;; (find-adduser-links)
;; (find-adduser-links "aleph" "aleph")
(defun find-adduser-links (&optional username password)
  (interactive)
  (setq username (or username "foo"))
  (setq password (or password "1234"))
  (setq homedir (format "/home/%s/" username))
  (find-elinks `(
    (find-adduser-links ,username ,password)
    ""
    "* (eexterm \"A\")"
    ,(format "sudo rm -Rfv /home/%s/" username)
    ,(format "sudo deluser %s" username)
    ,(format "sudo adduser %s" username)
    ,(format "%s" password)
    ,(format "%s" password)
    ,(format "(fullname)")
    ,(format "(roomnumber)")
    ,(format "(workphone)")
    ,(format "(homephone)")
    ,(format "(other)")
    ,(format "y")
    ""
    (find-fline ,homedir)
    ,(format "cd %s" homedir)
    ,(format "su - %s" username)
    ,(format "%s" password)
    ,(format "exit")
    ,(format "exit")
    ""
    ""
    ""
    "*;; \"su -\" with an authorization to open X windows"
    "* (eexterm \"A\")"
    ,(format "xhost +")
    ,(format "cd  ~%s/" username)
    ,(format "su - %s"  username)
    ,(format "aleph")
    ,(format "export DISPLAY=%s" (getenv "DISPLAY"))
    ,(format "exit")
    ,(format "exit")
    )))

;; «find-osmio-template»  (to ".find-osmio-template")
(defun find-osmio-template ()
  (interactive)
  (find-elinks '(
    (find-osmio-template)
    (find-efunction 'find-osmio-template)
    ""
    "* (eepitch-osmio)"
    "su -"
    "head -n 1"
    ""
    (find-setq-links 'k8-password-edrx)
    (find-setq-links 'k8-password-root)
    ""
    "* (eechannel-xterm \"osmio\" '(\"ssh\" \"osmio.prv.k8.com.br\"))"
    "* (eechannel-send nil k8-password-edrx \"\\n\")"
    "su"
    "* (eechannel-send nil k8-password-root \"\\n\")"
    "head -n 1"
    ""
    (find-fline "/ssh:osmio.prv.k8.com.br:")
    (find-fline "/su:osmio.prv.k8.com.br:")
    )))


;; «find-template-svnadm»  (to ".find-template-svnadm")
;; (find-template-svnadm "todo/bak/srv/")
;;
(defun find-template-svnadm (stem)
  (interactive (list "todo/bak/srv/"))
  (find-elinks `(
    (find-template-svnadm ,stem)
    ""
    ,(format "# http://svn.prv.digirati.com.br/repos/adm/trunk/%s" stem)
    (svn-status ,(format "~/svn/adm/%s" stem))
    ""
    ,(format "* (eepitch-shell)")
    ,(format "cd ~/svn/adm/")
    ,(format "svn checkout --username edrx.dig \\")
    ,(format "   http://svn.prv.digirati.com.br/repos/adm/trunk/%s" stem)
    )))

;; «find-copydvdtohd-script»  (to ".find-copydvdtohd-script")
(defun find-copydvdtohd-script (dir &rest rest)
  (interactive (list "/hda6/movie/"))
  (let ((ee-buffer-name (or ee-buffer-name "*copydvdtohd*"))
	(dirvideots (concat dir "video_ts/")))
    (apply 'find-elinks `(
      (find-copydvdtohd-script ,dir ,@rest)
      (find-fline ,dir)
      (find-fline ,dirvideots)
      (eev ,(format "cd %s" dir))
      (eev ,(format "cd %s" dirvideots))
      ""
      ,(format "* (eechannel-xterm \"A\")")
      ,(format "* (eepitch-shell)")
      ,(format "mkdir /tmp/dvd/")
      ""
      ,(format "sudo umount /tmp/dvd/")
      ,(format "mount  /tmp/dvd/")
      ,(format "du -c  /tmp/dvd/")
      ,(format "find   /tmp/dvd/")
      ,(format "mkdir                    %s"  dir)
      ,(format "(cd /tmp/dvd; cp -av *   %s)" dir)
      ,(format "sudo chown -Rv edrx:edrx %s"  dir)
      ,(format "chmod -v 777             %s*" dir)
      ,(format "umount /tmp/dvd/")
      ) rest)))

;; (find-copydvdtohd-script "/hda6/sacrificio/")
;; (find-copydvdtohd-script "/hda6/manufacturingconsent/")
;; (find-copydvdtohd-script "/hda6/thecorporation/")
;; (find-copydvdtohd-script "/hda6/felakuti/")
;; (find-copydvdtohd-script "/hda6/bomdia/")
;; ^ cp: reading `video_ts/vts_01_5.vob': Input/output error
;; (find-copydvdtohd-script "/hda6/ogostodacereja/")
;; (find-copydvdtohd-script "/hda6/capote/")
;; (find-copydvdtohd-script "/hda6/capitaesdeabril/")


;; Just because these make some scripts clearer
;;
(defun ee-with-newline (str)
  (if (string-match "[^\n]\\'" str) (concat str "\n") str))
(defun eexterm-password (str)
  (eechannel-send nil (ee-with-newline str)))


;; This will force me to clean up some stuff in eev-mini-steps.el
;; (find-eev "eev-mini-steps.el")
;; (load "eev-mini-steps")



;; (find-fline "~/LATEX/2005oct20-seminar.tex")
(code-c-d "2005oct20seminar" "~/LATEX/2005oct20-seminar.tex" :anchor)
(code-dvi "2005oct20seminar" "~/LATEX/2005oct20-seminar.dvi")
;; (find-2005oct20seminarfile "")
;; (find-2005oct20seminar "")
;; (find-2005oct20seminar "" "original-motivation-2")
;; (find-2005oct20seminarpage 1)
;; (find-2005oct20seminarpage 31)

(seen 8500)





(code-c-d "THL" "~/TH/L/" :grep)


;; «davinci»  (to ".davinci")
;; (find-THLw3m "e/davinci.e.html")
;; (find-es "davinci")
;; (find-es "lua5" "ldb-from-tgz")
(code-c-d "ldb" "~/usrc/ldb/" :grep)

(code-c-d "luawiki" "$S/http/lua-users.org/wiki/")
;; (find-luawikiw3m "UsingLuaWithScite.html")
;; To do: the htmlizer for luawikiw3m links should remove the ".html"

(code-c-d "scite"    "~/usrc/scite/scite-1.71/" :grep)
(code-c-d "scitedoc" "~/usrc/scite/scite-1.71/scite/doc/" :grep)
(code-c-d "scite174" "~/usrc/scite174/" :grep)



;; «eepitch-gdb»  (to ".eepitch-gdb")
;; http://article.gmane.org/gmane.emacs.eev.devel/47
;; http://lists.gnu.org/archive/html/eev/2007-07/msg00000.html
;; (find-efunction 'eegud-keys-mode)
;; * (eepitch-gdb-kill "*gud-lua*")
;; * (eepitch-gdb "*gud-lua*" "gdb --annotate=3 ~/usrc/lua-5.1.2/src/lua")
;; br main
;; run

;; (define-key eegud-keys-mode-map "\M-k" 'eegud-kill-this-buffer)
;;
;; (defun eegud-kill-this-buffer ()
;;   (interactive)
;;   (delete-other-windows)
;;   (kill-this-buffer))
;;
;; (defvar ee-gdb-escript-window nil
;;   "An internal variable used to simplify the code of `eepitch-gdb'.
;; The \"e-script window\" is the upper-left quadrant of the frame.")
;;
;; (defvar ee-gdb-gdb-window nil
;;   "An internal variable used to simplify the code of `eepitch-gdb'.
;; The \"gdb window\" is the lower-left quadrant of the frame.")
;;
;; (defvar ee-gdb-source-window nil
;;   "An internal variable used to simplify the code of `eepitch-gdb'.
;; The \"source window\" is the right half of the frame.")
;;
;; (defun eepitch-gdb-window-setup ()
;;   (interactive)
;;   (delete-other-windows)
;;   (split-window-horizontally)  ; left|right
;;   (split-window-vertically)    ; split the left side into upper/lower
;;   (setq ee-gdb-escript-window (selected-window)) ; upper left
;;   (setq ee-gdb-gdb-window     (next-window))	 ; lower left
;;   (setq ee-gdb-source-window  (next-window (next-window)))) ; right
;;
;; ;; 2008jul05
;; (defun eepitch-gdb (buffer-name gdb-prog-and-args)
;;   (eepitch-gdb-window-setup)
;;   (with-selected-window ee-gdb-gdb-window
;;     (if (get-buffer buffer-name)
;; 	(find-ebuffer buffer-name)
;;       (gdb gdb-prog-and-args)
;;       (eegud-keys-mode 1)))
;;   (setq eepitch-code `(find-ebuffer ,buffer-name)))
;;
;; (defun eepitch-gdb-old (buffer-name gdb-prog-and-args)
;;   ;; (eek "s-1 s-3 s-2 s-o")
;;   (delete-other-windows)
;;   (split-window-horizontally)
;;   (split-window-vertically)
;;   (other-window 1)
;;   (if (get-buffer buffer-name)
;;       (find-ebuffer buffer-name)
;;     (gdb gdb-prog-and-args)
;;     (eegud-keys-mode 1))
;;   ;; (eek "s-o s-o")
;;   (other-window 2)
;;   (setq eepitch-code `(find-ebuffer ,buffer-name)))
;;
;; (defun eepitch-gdb-kill (buffer-name)
;;   (if (get-buffer buffer-name) (kill-buffer buffer-name))
;;   (delete-other-windows))

;; «eepitch-gdb-lua»  (to ".eepitch-gdb-lua")
;; (find-es "lua5" "lua-innards-gdb")
;; 2013, low-tech:
(defun eepitch-gdb-lua ()
  (eepitch-comint "*gdb lua_O0*" "gdb -q ~/usrc/lua-5.1.4/src/lua_O0"))

;; Old:
;; (find-es "lua5" "lua-api-from-gdb")
;; (find-es "lua5" "compile-5.1.2-lua_O0")
;; (find-es "lua5" "compile-5.1.4-lua_O0")
;; (find-angg ".lua51/PP.gdb")
;; (find-angg ".lua51/PP.c")
'(

(defun eepitch-gdb-lua ()
  (eepitch-gdb "*gud-lua_O0*"
	       "gdb --annotate=3 --quiet ~/usrc/lua-5.1.2/src/lua_O0"))
(defun eepitch-gdb-lua ()
  (eepitch-gdb "*gud-lua_O0*"
	       "gdb --annotate=3 --quiet ~/usrc/lua-5.1.4/src/lua_O0"))
(defun eepitch-gdb-lua ()
  (eepitch-gdb "*gud-lua_O0*"
	       "gdb -i=mi --quiet ~/usrc/lua-5.1.4/src/lua_O0"))
(defun eepitch-gdb-lua-kill ()
  (eepitch-gdb-kill "*gud-lua_O0*"))

)



;; * (eepitch-gdb-kill "*gud-lua*")
;; * (eepitch-gdb "*gud-lua*" "gdb --annotate=3 ~/usrc/lua-5.1.2/src/lua")
;; * (eepitch-gdb-lua-kill)
;; * (eepitch-gdb-lua)

;; «eepitch-gdb-scite»  (to ".eepitch-gdb-scite")
;; (find-es "davinci" "scite-in-gdb")
(defun eepitch-gdb-scite ()
  (eepitch-gdb "*gud-SciTE*" "gdb --annotate=3 ~/usrc/scite174/scite/bin/SciTE"))
(defun eepitch-gdb-scite-kill ()
  (eepitch-gdb-kill "*gud-SciTE*"))

(defun eepitch-gdb-bait ()
  (eepitch-gdb "*gud-bait*" "gdb --annotate=3 ~/usrc/bait/bait"))
(defun eepitch-gdb-bait-kill ()
  (eepitch-gdb-kill "*gud-bait*"))

;; (find-es "davinci")
;; http://www.tecgraf.puc-rio.br/tecmake/
(code-c-d "iup" "~/usrc/iup/" :grep)
(code-c-d "iupbinaries" "~/usrc/iupbinaries/")
(code-c-d "tecmake"    "~/usrc/tecmake/" :grep)
(code-c-d "tecmakedoc" "$S/http/www.tecgraf.puc-rio.br/tecmake/" :grep)

(code-c-d "cd" "~/usrc/cd/" :grep)
(code-c-d "im" "~/usrc/im/" :grep)

;; (find-es "anatocc" "K-and-R")
(code-c-d "kandr" "~/usrc/the-c-programming-language/")


;; «tcl-tk»  (to ".tcl-tk")
;; (find-angg ".zshrc" "tcl-tk")
;; (find-tcl84file "")
;; (find-tk84file "")
(code-c-d "tcl84" "~/usrc/tcl8.4/tcl8.4-8.4.12/" :grep)
(code-c-d "tk84"  "~/usrc/tk8.4/tk8.4-8.4.12/" :grep)
(defun eepitch-gdb-wish ()
  (eepitch-gdb "*gud-wish*" "gdb --annotate=3 ~/usrc/tk8.4/tk8.4-8.4.12/unix/wish"))
(defun eepitch-gdb-wish-kill ()
  (eepitch-gdb-kill "*gud-wish*"))
(defun eepitch-gdb-tclsh ()
  (eepitch-gdb "*gud-tclsh*" "gdb --annotate=3 ~/usrc/tcl8.4/tcl8.4-8.4.12/unix/tclsh"))
(defun eepitch-gdb-tclsh-kill ()
  (eepitch-gdb-kill "*gud-tclsh*"))


;; «ee-meta-S»  (to ".ee-meta-S")
;; (find-efunction 'ee-delete-and-extract-line)
;;
;; (defun ee-meta-S () (interactive)
;;   (insert (ee-pph `(find-sh ,(ee-no-properties (ee-delete-and-extract-line)))))
;;   (next-line 1))
;; (define-key eev-mode-map "\M-S" 'ee-meta-S)


;; (find-efacedescr 'w3m-anchor)
;; (find-efacedescr 'org-link)
(make-face 'w3m-anchor)
(set-face-foreground 'w3m-anchor "SteelBlue1")
;; (set-face-foreground 'org-link "SteelBlue1")
;; (find-ecolors)
;; (find-efaces)
;; (find-efaces "w3m-anchor")

;; (find-es "emacs" "w3m-upstream")
(add-to-list 'load-path "~/usrc/emacs-w3m/")

;; «org-mode»  (to ".org-mode")
;; (find-es "org" "git")
;; Tell org-mode to not create and use a display-table.
;; (find-evardescr 'org-display-table)
;; (find-evardescr 'org-ellipsis)
;; (find-egrep "grep -nH -e buffer-display-table $(find * -name '*.el')")
;; (find-efile "textmodes/org.el" "buffer-display-table")
;; (find-efile "textmodes/org.el" "setq buffer-display-table")
;; (find-efile "textmodes/org.el" "defcustom org-ellipsis")
;; (setq org-ellipsis 'org-ellipsis)

;; (find-es "org" "TODO-and-DONE")
(setq org-log-done nil)

;; (code-c-d "org" (ee-efile "org/") "org")
;; (find-orgfile "")
;; (find-orgnode "")
(code-c-d "orgsrc"   "~/usrc/org-mode/")
(code-c-d "orgbabel" "~/usrc/org-mode/contrib/babel/")
(setq org-ellipsis nil)

(make-face 'org-link)
(set-face-foreground 'org-link "CornflowerBlue")
(make-face 'org-level-1)
(set-face-foreground 'org-level-1 "CadetBlue")
(set-face-foreground 'org-level-1 "LightSteelBlue")
(set-face-foreground 'org-level-1 "SteelBlue")
;; (find-ecolor-links)
;; (find-ecolors)

;; http://dto.freeshell.org/notebook/OrgTutorial.html
;; (add-to-list 'load-path "PATH_TO_WHERE_YOU_UNPACKED_ORGMODE")
;; (require 'org)
;; (find-fline "~/ORG/index.org" "Org: e-script to install")
;; (find-orgfile "")
(code-c-d "org" "~/usrc/org-4.34/" "org")
(add-to-list 'load-path ee-orgdir)
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-ca" 'org-agenda)
(setq org-log-done t)




;; «auto-mode-alist-tecmake»  (to ".auto-mode-alist-tecmake")
(add-to-alist 'auto-mode-alist '("\\.mak$" . makefile-mode))
(add-to-alist 'auto-mode-alist '("\\.bsh$" . sh-mode))

(seen 8700)


(code-c-d "iup3" "~/usrc/iup3/" :grep)
(code-c-d "gtk20" "~/bigsrc/gtk+2.0/gtk+2.0-2.10.13/" :grep)
(code-c-d "grub2" "~/usrc/grub2/" :grep)

(seen 8729)



;; «code-c-d-new»  (to ".code-c-d-new")
;; (find-eev "eev.el" "code-c-d-new")
;; (find-eev "eev.el" "code-c-d")
;; (find-eev "eev.el" "code-c-d-register")
;; (find-eev "eev-mini.el" "ee-code-c-d")
;; (find-code-c-d-new "CCC" "DDD/" :info "III" :anchor :grep)
;; (find-code-c-d-new "CCC" "DDD/" :info "III" :anchor)
;; (find-code-c-d-new "CCC" "DDD/"       "III" :anchor)
;; (find-code-c-d-new "CCC" "DDD/")
;; (find-code-c-d     "CCC" "DDD/")
;; (code-c-d-new "iup3" "~/usrc/iup3/" :grep :foo)
;; (code-c-d-new "iup3" "~/usrc/iup3/" :grep)
;; (code-c-d     "iup3" "~/usrc/iup3/" :grep)
;; (find-iup3file "")
;; (find-iup3grep "grep -nH -e FUNCPROTO $(find *)")
;; (find-iup3file "src/gtk/iupgtk_drv.h")
;; (:gdb . ee-code-c-d-:gdb)         ; rusty
;; :linux, :xdvi and :gv shouldn't be standard...
;; (:linux  . ee-code-c-d-:linux)
;; (:xdvi   . ee-code-c-d-:xdvi)
;; (:gv     . ee-code-c-d-:gv)



;; (defun ee-find-node (dir manual section &rest rest)
;;   (setq dir (if dir (ee-expand dir) ""))
;;   (apply 'find-node (format "(%s%s)%s" dir manual section) rest)


;; «ee-sexp-remote»  (to ".ee-sexp-remote")
;;
(setq ee-sexp-beg nil)
(setq ee-sexp-end nil)
(setq ee-sexp-buffer nil)

(defun ee-sexp-read ()
  (interactive)
  (eek-forward-sexp)
  (setq ee-sexp-end (point))
  (save-excursion
    (eek-backward-sexp)
    (setq ee-sexp-beg (point)))
  (read (buffer-substring ee-sexp-beg ee-sexp-end)))

(defun ee-sexp-next ()
  (interactive)
  (eek-forward-sexp)
  (eek-backward-sexp))

(defun ee-sexp-remote-read-next ()
  (with-selected-window
      (get-buffer-window ee-sexp-buffer t)
    (prog1 (ee-sexp-read)
      (ee-sexp-next))))

(defun ee-sexp-stop ()
  (with-selected-window
      (get-buffer-window ee-sexp-buffer t)
    (goto-char ee-sexp-beg)
    (error "End of steps")))

(define-key my-mode-map (kbd "<f7>")
  (lambda (arg) (interactive "P")
    (if (eq arg 0)
	(setq ee-sexp-buffer (buffer-name))
      (eesteps-perform (ee-sexp-remote-read-next)))))

;; (eev-demos 4)

;; (frame-height)
;; (frame-width)
;; (set-frame-size (selected-frame) 167 59)
;; (set-frame-size (selected-frame) 80 59)
;; (find-elnode "Position Parameters")
;; (find-elnode "Size Parameters")
;; (find-eapropos "frame")
;; (find-angg ".fvwm/keys.fvwm" "4-v,h,b")
;; (find-es "fvwm" "no-borders")
;; (modify-frame-parameters (selected-frame) '((vertical-scroll-bars . nil)))

;; «ee-make-frame»  (to ".ee-make-frame")
(defun ee-make-frame (x y width height &rest rest)
  (select-frame
   (make-frame `((user-position . t) (left . ,x) (top . ,y)
		 (user-size . t) (width . ,width) (height . ,height)
		 (vertical-scroll-bars . nil) ,@rest))))

(defun ee-sexp-setup (&optional x y width height &rest rest)
  (delete-other-windows)
  (delete-other-frames)
  ;; (find-angg ".fvwm/keys.fvwm" "4-v,h,b" "Key v")
  (find-fvwm0 "Current Maximize 0, 100")
  (sleep-for 0.2)
  (ee-make-frame (or x 516) (or y 0)  (or width 80) (or height 20))
  (sleep-for 0.2)
  ;; (find-angg ".fvwm/keys.fvwm" "4-f,g"   "Key f")
  (find-fvwm0 "Current WindowStyle NoTitle, !Borders")
  (sleep-for 0.2)
  (setq ee-sexp-buffer (buffer-name)))

;; «ee-sexp-remote-demo»  (to ".ee-sexp-remote-demo")
'( (progn
     (find-fvwm0 "Current Maximize 0, 100")
     (sleep-for 0.2)
     (delete-other-frames)
     (ee-make-frame 500 0  80 20)
     (ee-bare-frame)
     (setq ee-sexp-buffer (buffer-name))
     (eek "M-O")
     (find-ebuffer "o")
     )

   "<down>" "foobar" "3*<left>"
   (ee-sexp-stop) nil

)

'( (progn
     (ee-sexp-setup)
     (eek "M-O")
     (find-ebuffer "o")
     )

   "<down>" "foobar" "3*<left>"
   (ee-sexp-stop) nil

)


;; Ex: (find-emount-links)
;; (find-sh "dmesg")
;; (find-sh "dmesg | grep ^hd")
;; Persephone, 2007oct08:
;; hdc: TSSTcorpCD/DVDW SH-W162D, ATAPI CD/DVD-ROM drive
;; hdc: ATAPI 48X DVD-ROM DVD-R CD-R/RW drive, 2048kB Cache, UDMA(33)
;; hdd: HL-DT-ST GCE-8526B, ATAPI CD/DVD-ROM drive
;; hdd: ATAPI 52X CD-ROM CD-R/RW drive, 2048kB Cache, UDMA(33)
;;
(defun find-emount-links (&optional dir &rest rest)
  (interactive)
  (find-elinks
    `((find-emount-links ,@rest)
      (find-efunction 'find-emount-links)
      ""
      "* (eepitch-shell)"
      "mkdir /tmp/dvd/"
      "sudo mount -o ro /dev/hdc /tmp/dvd/"
      (find-fline "/tmp/dvd/")
      "sudo umount /tmp/dvd/"
      ""
      "mkdir /tmp/cdrom/"
      "sudo mount -o ro /dev/hdd /tmp/cdrom/"
      (find-fline "/tmp/cdrom/")
      "sudo umount /tmp/cdrom/"
      ""
      (find-sh "dmesg")
      "mkdir /tmp/pen/"
      "sudo mount -o ro /dev/sda1 /tmp/pen/"
      "sudo mount -o ro /dev/sdb1 /tmp/pen/"
      "sudo umount /tmp/pen/"
      (find-fline "/tmp/pen/")
      )))


;; «rename-track»  (to ".rename-track")
;; (find-emode-links 'wdired-mode)
;; (find-efunction-links 'wdired-change-to-wdired-mode)
;; (find-ekeymapdescr wdired-mode-map)

(defun rename-track-string (str)
  (if (string-match "^\\([0-9]+\\)[-_ .]*\\(.*\\)" str)
      (let* ((n (match-string 1 str))
	     (name (match-string 2 str))
	     (newname (replace-regexp-in-string "[ ']" "_" (downcase name))))
	(format "%02d._%s" (string-to-number n) newname))))

(rename-track-string "1 - Foo bar")

(defun rename-track-after-point ()
  (interactive)
  (save-excursion
    (insert
     (rename-track-string
      (delete-and-extract-region (point) (ee-eol)))))
  (next-line 1))

(eval-after-load "wdired"
  '(define-key wdired-mode-map "\M-t" 'rename-track-after-point))

(seen 8900)


;; "1.   Foo bar" -> "01._foo_bar.wav"
;;
(defun rename-wav-tracks (&optional arg)
  (interactive "p")
  (dotimes (i (or arg 1))
    (eek "M-f <right> M-\\ C-e M-\\ .wav C-a <<rename-track-after-point>>")))




;; «firefox»  (to ".firefox")
;; (find-es "javascript")
;; (find-fline "~/.mozilla/")
;; (find-fline "~/.mozilla/firefox/")
;; (find-sh "cd ~/.mozilla/firefox/ && ls -l")
;; (find-sh "cd ~/.mozilla/firefox/ && rm -v default")
;; (find-sh "cd ~/.mozilla/firefox/ && ln -s s59t32wg.default default")
;; (find-fline "~/.mozilla/firefox/default/")
(code-c-d "dotfirefox" "~/.mozilla/firefox/default/")
(code-c-d "firefoxext" "~/.mozilla/firefox/default/extensions/")
;; (find-dotfirefoxfile "")
;; (find-firefoxextfile "")

;; «mozrepl»  (to ".mozrepl")
;; (find-es "javascript" "mozrepl")
;; (find-es "javascript" "mozrepl-2011")
' (code-c-d "mozrepl"        (ee-firefoxextfile "mozrepl@hyperstruct.net/"))
' (code-c-d "mozreplcontent" (ee-mozreplfile "chrome/content/"))
;; (find-mozreplfile "")
;; (find-mozreplcontentfile "")

(defun eepitch-mozrepl () (interactive)
  (eepitch-comint "mozrepl" "telnet localhost 4242"))

;; http://dev.hyperstruct.net/mozlab
;; http://dev.hyperstruct.net/movie/mozrepl.html
;; http://dev.hyperstruct.net/movie/mozrepl.swf
;; http://dev.hyperstruct.net/mozlab/wiki/MozRepl
;; http://dev.hyperstruct.net/mozlab/wiki/MozRepl/Tutorial
;; http://dev.hyperstruct.net/mozlab/wiki/MozRepl/Emacs
;; http://hyperstruct.net/projects/mozrepl
;; http://hyperstruct.net/projects/mozrepl/emacs-integration
;; http://wiki.github.com/bard/mozrepl/custom-commands

(seen 8940)

;; (find-fline "~/.mozilla/firefox/")
;; (find-fline "~/.mozilla/firefox/")
;; (find-mozreplfile "chrome/content/")
;; (find-mozlabfile "")
;; (find-mozlabfile "components/MozRepl.js")
;; (find-mozlabfile "defaults/preferences/mozlab.js")
;; (find-mozlabfile "chrome/mozlab.jar")
;; (find-mozlabfile "chrome/mozlab.jar" "moz.el")
;; -> (find-anggfile "elisp/moz.el")
;; (find-anggfile "elisp/moz.el")
;; (find-anggfile "elisp/moz.el" "(\"localhost\" . 4242)")
;; (find-mozlabfile "chrome/mozlab.jar" "javascript.el")
;; -> (find-anggfile "elisp/javascript.el")

;; «eepitch-moz»  (to ".eepitch-moz")
;; (find-es "javascript" "mozrepl")
;; (find-mozreplfile "chrome/content/")
;; (find-mozreplfile "chrome/content/moz.el" "defalias 'run-mozilla")
;; (find-mozreplfile "chrome/content/moz.el" "defun inferior-moz-switch-to-mozilla")
(defun eepitch-moz ()
  (interactive)
  (require 'moz)
  (eepitch '(run-mozilla nil)))

;; «espresso-mode»  (to ".espresso-mode")
;; (find-mozreplfile "")
;; (find-mozreplfile "chrome/content/")
;; (add-to-list 'auto-mode-alist '("\\.js\\'" . espresso-mode))
;; (autoload 'espresso-mode "espresso" nil t)

;; (find-dotfirefoxfile "")
;; (find-dotfirefoxfile "downloads.rdf")
;; (find-dotfirefoxfile "prefs.js" "default.print_edge_top")

(code-c-d "itsalltext" (ee-dotfirefoxfile "extensions/itsalltext@docwhat.gerf.org/"))
;; https://addons.mozilla.org/en-US/firefox/addon/4125
;; (find-itsalltextfile "")

(code-c-d "tabsopenrelative" (ee-dotfirefoxfile "extensions/tabsopenrelative@jomel.me.uk/"))
;; https://addons.mozilla.org/en-US/firefox/addon/1956
;; (find-tabsopenrelativefile "")

(code-c-d "conkeror"   (ee-dotfirefoxfile "extensions/{a79fe89b-6662-4ff4-8e88-09950ad4dfde}/"))
;; (find-conkerorfile "")
;; http://dev.technomancy.us/conkeror/
;; http://mozdev.org/pipermail/conkeror/
;; http://conkeror.mozdev.org/installation.html
;; (find-conkerorfile "chrome/conkeror.jar")


(seen 9000)


;; «find-emode-links»  (to ".find-emode-links")
;; (find-emode-links 'org-mode)
;;
(defun find-emode-links (symbol &rest rest)
  (interactive (find-function-read))
  (apply 'find-elinks `(
    (find-emode-links ',symbol ,@rest)
    ""
    (find-efunctiondescr ',symbol)
    (find-efunction ',symbol)
    (find-efunctiond ',symbol)
    (find-efunctionpp ',symbol)
    ""
    (find-efunction 'ee-minor-mode-keymap)
    (find-evardescr 'minor-mode-map-alist)
    (mapcar 'car minor-mode-map-alist)
    (find-elinks ,'(mapcar (lambda (xx) `(find-emode-links ,(car xx))) minor-mode-map-alist))
    (find-emode-links ',major-mode)
    ""
    (find-eapropos "^org-.*mode$")
    (find-eapropos "^org-.*map$")
    (find-elinks ,'(mapcar (lambda (x) `(find-emode-links ',x)) (apropos-internal "^org-.*mode$")))
    (find-elinks ,'(mapcar (lambda (x) `(find-ekeymapdescr ,x)) (apropos-internal "^org-.*map$")))
    ) rest))

;; (find-eevfile "eev.el" "\\M-h\\M-s")
(define-key eev-mode-map "\M-h\C-m" 'find-emode-links)



;; «find-sshot-links»  (to ".find-sshot-links")
;; (find-sshot-links "/tmp/sshot/test")
;;
(define-key eev-mode-map "\M-h\C-s" 'find-sshot-links)
(defun find-sshot-links (&optional fnamestem &rest rest)
  (interactive)
  (if (not fnamestem) (setq fnamestem "/tmp/sshot/test"))
  (apply 'find-elinks
    `((find-sshot-links ,fnamestem ,@rest)
       (find-eevfile "eev-sshot.el")
       ""
       ,(ee-addhp "Use the geometry of the Emacs window:")
       (sshot-save-geom-fvwm)
       ""
       ,(ee-addhp "Manual setting:")
       (sshot-save-geom-tcl)
       (find-fline "/tmp/sshot.geom")
       (sshot-force-geom ,(find-sh0 "cat /tmp/sshot.geom"))
       ""
       (global-set-key (kbd "<print>") 'sshot-take+)
       (eefvwm0 "Key Print A N   Exec gnudoit '(sshot-take+)'")
       (eefvwm0 "Key Print A N   -")
       (sshot-blink)
       (sshot-init ,fnamestem)
       (sshot-write-html)
       (find-sshot ,fnamestem 1)
       ""
       (find-fline ,(file-name-directory fnamestem))
       ,(ee-addhp (format "file://%s.html" fnamestem))
       ,(ee-addhp "To do: code for packing and uploading")
       ) rest))



;; «find-glyphashtml-links»  (to ".find-glyphashtml-links")
;; (find-blogme3file "anggdefs.lua" "eev_math_glyphs_edrx =")
;; (find-eevfile "eev-compose.el")
;; (find-eevfile "eev-glyphs.el")
;; (find-eevfile "eev-math-glyphs.el")
;; (find-efunction 'ee-glyph)
;; (eev-math-glyphs-reset)
;; (eev-math-glyphs-edrx)
;; (find-elnode "Creating Strings")
;; (find-glyphashtml-links "ox")

(defun ee-glyph-bign (char) (aref (aref standard-display-table char) 0))
(defun ee-glyph-char (bign) (logand (- (ash 1 19) 1) bign))
(defun ee-glyph-face-id (bign) (ash bign -19))

;; (define-key eev-mode-map "\M-hg" 'find-glyphashtml-links)
(defun find-glyphashtml-links (composepair &rest rest)
  (interactive (list "<<"))
  (let* ((lowchar (cadr (member composepair eev-composes-all)))
	 (bigchar (ee-glyph-char (ee-glyph-bign lowchar))))
    (apply 'find-elinks
     `((find-glyphashtml-links ,composepair ,@rest)
       (find-eevfile "eev-math-glyphs.el")
       ""
       (cadr (member ,composepair eev-composes-all))
       (ee-glyph-char (ee-glyph-bign ,lowchar))
       (find-eoutput '(insert ,bigchar))
       (find-eleimfile "quail/latin-ltx.el" (string ,bigchar))
       (find-eleimfile "quail/sgml-input.el" (string ,bigchar))
       (require 'htmlize)
       (htmlize-protect-string (string ,bigchar))
       ) rest)))



;; (find-eface-links 'subscript)
;; (find-eface-links 'superscript)
;; (find-efile "textmodes/tex-mode.el" "defun tex-font-lock-suscript")
;; (find-efile "textmodes/tex-mode.el" "defcustom tex-font-script-display")
;;
(setq tex-fontify-script nil)



;; «find-TH»  (to ".find-TH")
;; (find-code-c-d-new "TH" "~/TH/" :anchor :grep)
;; (find-TH "davinci" "long-way")
;;
(code-c-d  "TH" "~/TH/" :anchor :grep)
(defun find-TH (str &rest pos-spec-list)
  (apply 'find-anchor (ee-THfile (concat str ".blogme")) pos-spec-list))


(seen 9106)


(defun find-sh0-if (okmsg command)
   (let ((output (find-sh0 command)))
     (if (equal output okmsg) (message "ok") (find-estring output))))



;; «blogme3»  (to ".blogme3")

(defun find-blogme3-sh0-if (stem)
  (find-sh0-if "" (ee-find-blogme3-sh0-if stem)))

;; Example: (ee-find-blogme3-sh0-if "math-b")
(defun ee-find-blogme3-sh0-if (stem)
  (format "\
    cd ~/TH/L/
    cp ~/TH/%s.blogme ~/TH/L/TH/%s.blogme
    lua51 ~/blogme3/blogme3.lua -o %s.html -i TH/%s.blogme"
    stem stem stem stem))

(defun blogme3-lisp-as-string (stem)
  (format "[#
\(defun c () (interactive) (find-blogme3-sh0-if \"%s\"))
;;    http://angg.twu.net/%s.html
;; file:///home/edrx/TH/L/%s.html
#]
" stem stem stem))

(defun blogme3-tt-as-string ()
  (format "[lua:
  -- (eev-math-glyphs-edrx)
  eev_math_glyphs_edrx()
]\n
\[WITHINDEX
\[#
 #]
\[RULE ----------------------------------------]\n
\[tsec <_>
\[++N]. _
=========
]\n
]
"))

;; (find-estring (blogme3-footer-as-string "xxx"))
(defun blogme3-footer-as-string (&optional stem)
  (format
"[INCLUDE TH/speedbar.blogme]
\[SETFAVICON dednat4/dednat4-icon.png]
\[SETFAVICON IMAGES/forthsun.png]
\[lua: LR = R ]
\[htmlize [J (Title)]\n
]
\[#
 # Local Variables:
 # coding: raw-text-unix
 # modes: (fundamental-mode blogme-mode)
 # End:
#]"))

(defun blogme3-bounded-as-string ()
 "\n#*
\[# (eeblogme-now-bounded)
 # file:///tmp/ee.html
 #]
#*
")

(defun blogme3-stem ()
  (replace-regexp-in-string "\\.blogme" "" (buffer-name)))

(defun blogme3-footer ()
  (interactive)
  (insert (blogme3-footer-as-string (blogme3-stem))))

(defun blogme3-lisp ()
  (interactive)
  (insert (blogme3-lisp-as-string (blogme3-stem))))

(defun blogme3-tt ()
  (interactive)
  (insert (blogme3-tt-as-string)))

(defun blogme3-bounded ()
  (interactive)
  (insert (blogme3-bounded-as-string)))


;; «startup-screen»  (to ".startup-screen")
;; (find-eapropos "inhibit-startup-screen")
;; (find-efile "startup.el")
;; (find-efile "startup.el" "defcustom fancy-splash-image")
;; (find-efile "startup.el" "defun fancy-splash-head")
;; (find-evardescr 'inhibit-startup-screen)
(setq inhibit-startup-screen t)


(seen 8900)

;; «.emacs.papers»  (to "..emacs.papers")
;; (find-eev "eev-pdflike.el")
;; (find-angg ".emacs.papers")

;; (find-eev "eev-pdfpages.el")
;; (find-eev "eev-pdflike.el")
;; (find-eevgrep "grep -nH -e code-pdftotext *.el")

(defalias 'code-pdftotext 'code-pdf-text)

'
(defun code-badpdf (code pdffile)
  (ee-eval-read-format
   "(defun find-%spage (n &rest comments)
  (interactive (list 1))
  (find-badpdfpage %S n))"
   code pdffile))

(defalias 'code-pstotext 'code-pdftotext)
(defalias 'code-djvutotext 'code-djvu-text)
(defalias 'code-badpdf     'code-xpdf)

(load "~/.emacs.papers")    ; (find-angg ".emacs.papers")



(seen 8915)

(load "~/.emacs.audios")    ; (find-angg ".emacs.audios")

(seen 8920)

;; «.emacs.templates»  (to "..emacs.templates")
;; (find-angg ".emacs.templates")
(load "~/.emacs.templates")



;; «find-urlretrieve»  (to ".find-urlretrieve")
;; (find-efunction 'url-retrieve-synchronously)
;; http://lists.gnu.org/archive/html/bug-gnu-emacs/2007-11/msg00065.html
;; http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg00648.html
;; http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg00922.html
;; http://thread.gmane.org/gmane.emacs.bugs/16951
;; http://article.gmane.org/gmane.emacs.bugs/16951
;; http://article.gmane.org/gmane.emacs.devel/82931
;; http://article.gmane.org/gmane.emacs.devel/83205
;; (find-urlretrieve000 "http://127.0.0.1/")
;; (find-urlretrieve000 "http://127.0.0.1/404")
;; (find-urlretrieve00  "http://127.0.0.1/")
;; (find-urlretrieve00  "http://127.0.0.1/404")
;;
(defun ee-url-retrieve-body ()
  (goto-char (point-min))
  (when (looking-at "HTTP/1.1 200 OK")
    (ee-goto-position "\n\n")
    (buffer-substring (point) (point-max))))

(defun find-urlretrieve000 (url)
  (find-ebuffer (url-retrieve-synchronously (ee-expand url)))
  (ee-url-retrieve-body))

(defun find-urlretrieve00 (url)
  (let* ((buffer (url-retrieve-synchronously (ee-expand url)))
	 (body (with-current-buffer buffer (ee-url-retrieve-body))))
    (if body
	(prog1 body (kill-buffer buffer))
      (switch-to-buffer buffer)
      (error "find-urlretrieve00: not OK!"))))

(defun find-urlretrieve (url &rest rest)
  **NOT-YET**)


;; This block is several hours older than the one below -
;; ignore this one.
;; (find-efunction 'find-callprocess0-ne)
;; (setq myurl "http://angg.twu.net/eev-current/eev-math-glyphs.el")
;; (find-eoutput '(insert (find-wget00u myurl)))
(defun ee-with-raw-text-unix (code)
  (let ((coding-system-for-read 'raw-text-unix)
	(coding-system-for-write 'raw-text-unix))
    (eval code)))
' (defun find-wget00 (url) (find-callprocess00 `("wget" "-q" "-O" "-" ,url)))
' (defun find-wget00u (url) (ee-with-raw-text-unix `(find-wget00 ,url)))

;; «find-wget»  (to ".find-wget")
;; «brwget»  (to ".brwget")
;; (find-urlretrieve000 "http://127.0.0.1/")
;; (find-urlretrieve000 "http://127.0.0.1/404")
;; (find-wget "http://127.0.0.1/")
;; (find-wget "http://127.0.0.1/404")
;; (find-urlretrieve000 "http://angg.twu.net/eev-current/eev-math-glyphs.el")
;; (find-wget "http://angg.twu.net/eev-current/eev-math-glyphs.el")
;; (find-wget "http://angg.twu.net/404")
;;
(defun find-wget00 (url)
  (find-callprocess00 `("wget" "-q" "-O" "-" ,url)))

(defun find-wget (url &rest rest)
  (setq url (ee-expand url))
  (apply 'find-eoutput-reuse (format "*wget: %s*" url)
	 `(insert (find-wget00 ,url))
	 rest))

(code-brurl 'find-wget :remote 'brwget)



;; «find-epalette»  (to ".find-epalette")
;; (find-es "emacs" "palette")
;; (find-epalette my-palette)

;; Screenshot: (find-anggfile "IMAGES/palette.png")
;; Entry in my Emacs page: (find-TH "emacs" "palette")

(defun find-epalette (&optional colorstr &rest rest)
  ;; (interactive (list my-palette))
  (interactive)
  (if (not colorstr) (setq colorstr my-palette))
  (apply
   'find-eoutput-reuse
   "*palette*"
   '(progn (insert colorstr)
	   (goto-char (point-min))
	   (while (re-search-forward "#?[A-Za-z0-9]+" nil 'no-error)
	     (set-text-properties
	      (match-beginning 0) (match-end 0)
	      `(face (foreground-color . ,(match-string 0))))))
   rest))

(setq my-palette "
LightSeaGreen MediumAquamarine aquamarine DarkSeaGreen MediumSeaGreen
SeaGreen DarkOliveGreen OliveDrab MediumSpringGreen
LightGreen PaleGreen SpringGreen green GreenYellow YellowGreen
LimeGreen DarkKhaki khaki LightGoldenrod PaleGoldenrod yellow gold
goldenrod RosyBrown tan HotPink PaleVioletRed MediumVioletRed
VioletRed DeepPink magenta1 magenta magenta2 magenta3

SandyBrown DarkSalmon
LightSalmon LightSalmon1 LightSalmon2 LightSalmon3
orange1 orange orange2 orange3 tan1 tan2 tan3 peru
DarkOrange1 DarkOrange DarkOrange2 DarkOrange3
chocolate1 chocolate2 chocolate3 chocolate
sienna1 sienna2 sienna3
salmon salmon1 salmon2 salmon3
coral coral1 coral2 coral3
tomato tomato1 tomato2 tomato3 LightCoral
IndianRed1 IndianRed2 IndianRed3 IndianRed
OrangeRed1 OrangeRed OrangeRed2 OrangeRed3
firebrick1 firebrick2 firebrick3 firebrick
brown1 brown2 brown3
red red1 red2 red3

snow1 snow2 snow3 snow4
seashell1 seashell2 seashell3
AntiqueWhite1 AntiqueWhite2 AntiqueWhite3
LightGoldenrodYellow LightYellow beige
bisque1 bisque2 bisque3
PeachPuff1 PeachPuff2 PeachPuff3
NavajoWhite1 NavajoWhite2 NavajoWhite3
burlywood burlywood1 burlywood2 burlywood3
wheat wheat1 wheat2 wheat3
LemonChiffon1 LemonChiffon2 LemonChiffon3
cornsilk1 cornsilk2 cornsilk3
ivory1 ivory2 ivory3
honeydew1 honeydew2 honeydew3
azure1 azure2 azure3
LavenderBlush1 LavenderBlush2 LavenderBlush3
MistyRose1 MistyRose2 MistyRose3
thistle thistle1 thistle2 thistle3
RosyBrown1 RosyBrown2 RosyBrown3
pink LightPink
plum1 plum2 plum3 plum
orchid1 orchid2 orchid orchid3 violet
MediumOrchid1 MediumOrchid2 MediumOrchid MediumOrchid3
DarkOrchid1 DarkOrchid2 DarkOrchid3 DarkOrchid
purple1 purple2 purple purple3 BlueViolet DarkViolet
MediumPurple1 MediumPurple2 MediumPurple MediumPurple3
MediumSlateBlue LightSlateBlue CornflowerBlue
SlateBlue1 SlateBlue2 SlateBlue3
RoyalBlue1 RoyalBlue2 RoyalBlue3
DodgerBlue DodgerBlue1 DodgerBlue2 DodgerBlue3
DeepSkyBlue DeepSkyBlue1 DeepSkyBlue2 DeepSkyBlue3
SteelBlue1 SteelBlue2 SteelBlue3
SkyBlue SkyBlue1 SkyBlue2 SkyBlue3
LightSkyBlue LightSkyBlue1 LightSkyBlue2 LightSkyBlue3
SlateGray1 SlateGray2 SlateGray3
LightSteelBlue1 LightSteelBlue2 LightSteelBlue LightSteelBlue3
LightBlue1 LightBlue2 LightBlue LightBlue3
LightCyan1 LightCyan2 LightCyan3
PaleTurquoise1 PaleTurquoise2 PaleTurquoise3
PowderBlue PaleTurquoise LightCyan
CadetBlue1 CadetBlue2 CadetBlue3
DarkSlateGray1 DarkSlateGray2 DarkSlateGray3
turquoise1 turquoise2 turquoise3
cyan1 cyan2 cyan3
")


(seen 9082)

;; «tgt»  (to ".tgt")
;; (find-blogme3 "anggdefs.lua" "-tgt")
;; (tgt00 '(find-blogme3 "elisp.lua" "TGT"))
;; (tgt0  '(find-blogme3 "elisp.lua" "TGT"))
;; (tgt   '(find-blogme3 "elisp.lua" "TGT"))

(defun tgt00 (sexp)
  (if (not (stringp sexp)) (setq sexp (format "%S" sexp)))
  (find-callprocess00 `("lua51" "~/blogme3/blogme3.lua" "-tgt" ,sexp)))

(defun tgt0 (sexp) (ee-no-trailing-nl (tgt00 sexp)))

(defun tgt (sexp)
  (interactive (list (ee-last-sexp)))
  (if (stringp sexp) (setq sexp (read sexp)))
  (let* ((ee-buffer-name (or ee-buffer-name "*tgt*")))
    (find-estring (tgt00 sexp))))

(defun tgt (sexp)
  (interactive (list (ee-last-sexp)))
  (if (stringp sexp) (setq sexp (read sexp)))
  (let* ((ee-buffer-name (or ee-buffer-name "*tgt*"))
	 (target (tgt0 sexp))
	 (localtarget (replace-regexp-in-string
		       "^http://angg.twu.net/"
		       "file:///home/edrx/TH/L/"
		       target)))
    (find-elinks `(
      (tgt ',sexp)
      ,sexp
      ""
      ,target
      ,localtarget
      ""
      (find-blogme3 "angglisp.lua")
      ))))

(define-key eev-mode-map "\M-hb" 'tgt)

;; «find-ecp0»  (to ".find-ecp0")
;; (find-es "emacs" "letf")
;; (find-eapropos "tramp")
;; (find-efunction 'tramp-message)
;; (find-efunction 'tramp-error-with-buffer)
;; (find-evardescr 'tramp-verbose)
;; (find-es "emacs" "letf")

;; dired-copy-file is here: (find-efile "dired-aux.el")
;; it has an autoload, but running it straight away without a
;; (require 'dired) doesn't work...

(defun find-ecp0 (from to &optional ok-flag)
  (require 'dired)
  (let ((tramp-verbose 0))
    (dired-copy-file from to ok-flag)))

(seen 9126)


;; «caramelo»  (to ".caramelo")
;; «zumbi»  (to ".zumbi")
;; (find-fline "/etc/hosts")
;; (find-zumbifile "")
;; (find-zumbipagefile "")
;; (find-zumbihomefile "")
;; (find-caramelofile "")
;; (find-tanenbaumfile "")
;; (find-node "(tramp)Inline methods" "`host#42'")
;; (code-c-d "zumbi"  "/scp:edrx@zumbi#222:/home/edrx/")
;; (find-fline "~/.ssh/")
;; (find-fline "~/.ssh/config" "port 222")
(code-c-d "zumbi"     "/scp:edrx@_zumbi:/home/edrx/")
(code-c-d "zumbipage" "/scp:edrx@_zumbi:/home/edrx/public_html/")
(code-c-d "zumbihome" "/scp:edrx@_zumbi:/home/")
(code-c-d "caramelo"  "/scp:edrx@caramelo:/home/edrx/")
(code-c-d "tanenbaum" "/scp:edrx@tanenbaum:/home/")

(code-c-d "zumbipage" "/scp:edrx@_zumbi:/home/edrx/public_html/"
                                     :wget "http://zumbi/~edrx/" :ffox)
(code-c-d "zumbiwiki" "/scp:edrx@_zumbi:/omnisys/www/www/wiki/"
                                     :wget "http://zumbi/wiki/"  :ffox)

;; (find-zumbipagefile "")
;; (find-zumbipageffox "")
;; (find-zumbiwikifile "")
;; (find-zumbiwikiffox "")

;; «zumbiwikicvs»  (to ".zumbiwikicvs")
;; (find-es "omnisys" "zumbi-wiki-cvs")
(code-c-d "zumbiwikicvs" "~/usrc/zumbi-wiki/www/wiki/"
                            :wget "http://zumbi/wiki/"  :ffox)
;; (find-zumbiwikicvsfile "")

;; «dekooning»  (to ".dekooning")
;; Tramp doesn't like my zsh prompt, but edrsh uses /bin/sh...
;; (find-dekooningfile "")
;; (find-es "ssh" "ssh-copy-id")
(code-c-d "dekooning" "/scp:edrsh@dekooning:/home/edrx/")
(defun eepitch-dekooning () (interactive)
  (eepitch '(find-comintprocess "dekooning" "ssh edrx@dekooning")))
(defun eexterm-dekooning ()
  (eexterm "dekooning" "ssh edrx@dekooning"))

;; «persephone»  (to ".persephone")
;; (find-persephonefile "")
(code-c-d "persephone" "/scp:edrx@persephone:/home/edrx/")
(defun eepitch-persephone () (interactive)
  (eepitch '(find-comintprocess "persephone" "ssh edrx@persephone")))
(defun eexterm-persephone ()
  (eexterm "persephone" "ssh edrx@persephone"))




(defun eepitch-zumbi () (interactive)
  (eepitch '(find-comintprocess "zumbi" "ssh -p 222 edrx@zumbi")))

(defun eepitch-caramelo () (interactive)
  (eepitch '(find-comintprocess "caramelo" "ssh edrx@caramelo")))

(defun eepitch-tanenbaum () (interactive)
  (eepitch '(find-comintprocess "ssh tanenbaum" "ssh edrx@tanenbaum")))

(defun eepitch-gomanetstevens () (interactive)
  (eepitch '(find-comintprocess "gomanetstevens" "ssh -p 2222 edrx@tanenbaum")))

(defun eepitch-gomanetfreire () (interactive)
  (eepitch '(find-comintprocess "gomanetfreire"
				"ssh -p 2222 edrx@tanenbaum -t ssh freire")))

;; «sisrot»  (to ".sisrot")
;; (find-zumbihomefile "andre/public_html/projects/cla-sisrot/tmp/")
;; (find-fline "~/tmp/")
;; (find-noronhafile "Sisrot/PD/" "39.11.0080_352_rev00.doc")
(code-xpdf      "sisrotpdp" "~/tmp/PD_Sisrot_CLA_2006dec14.pdf")
(code-pdftotext "sisrotpdp" "~/tmp/PD_Sisrot_CLA_2006dec14.pdf")
;; (find-sisrotpdppage 1)
;; (find-sisrotpdppage 25)
;; (find-sisrotpdppage 126)
;; (find-sisrotpdptext)
;; (find-sisrotpdppage 23  "6.3" "Sinais TU / TD IRIG B")
;; (find-sisrotpdppage 109 "8.6.1.5" "Recepção do sinal de IRIG-B")
;;
;; (find-sisrotpdppage  28 "8.1.3" "telemetria laser")
;; (find-sisrotpdppage  73 "8.4"   "mecanica do pedestal")
;; (find-sisrotpdppage 124 "8.7.1" "manche de comando manual")
;; (find-sisrotpdppage 126 "8.7.2" "Tela de interface" "monitoração")
;; (find-sisrotpdppage 127 "8.7.2" "Tela de interface" "operação")
;;
;; (find-fline "~/tmp/CLA-sisrot_cronograma_expandido.txt")
;; (find-sh "cd /tmp/; a2ps -l 160 -=p1isol ~/tmp/CLA-sisrot_cronograma_expandido.txt")
;; (find-pspage "/tmp/o.ps")
;; (find-sh0 "cd /tmp/; ps2pdf o.ps")
;; (find-pspage "/tmp/o.pdf")
;; (find-sh0 "cp -v /tmp/o.pdf /var/www/tmp/screenies/")
;;
;; Versão obsoleta (2005):
;; (code-ps "sisrotpdp0" "~/tmp/PD_Sisrot_CLA_rev00.pdf")
;; (find-sisrotpdp0page 1)

;; «sisrotpdsw»  (to ".sisrotpdsw")
;; (find-noronhafile "QUALIDADE/1-S G Q/Templates(modelos)/ENGENHARIA/")
;; (find-noronhafile "QUALIDADE/1-S G Q/Templates(modelos)/ENGENHARIA/" "90.01.0054_031_rev02.doc")
;; (find-lnoronhafile "QUALIDADE/1-S G Q/Templates(modelos)/ENGENHARIA/" "90.01.0054_031_rev02.doc")
;; (find-lnoronhafile "QUALIDADE/1-S G Q/Templates(modelos)/ENGENHARIA/")
;; (find-pspage (ee-lnoronhafile "QUALIDADE/1-S G Q/Templates(modelos)/ENGENHARIA/90.01.0054_031_rev02.pdf"))
;; http://zumbi/~silas/_/tmp/90.01.0054_031_rev02.pdf
(code-xpdf      "pdswmodel" "$S/http/zumbi/~silas/_/tmp/90.01.0054_031_rev02.pdf")
(code-pdftotext "pdswmodel" "$S/http/zumbi/~silas/_/tmp/90.01.0054_031_rev02.pdf")
;; (find-pdswmodelpage 1)
;; (find-pdswmodeltext)

;; «sisrot-pdsw-etc»  (to ".sisrot-pdsw-etc")
;; http://www.pragmaticsoftware.com/Templates.asp
;; http://zumbi/~andre/_/resources/project/ProjectMgtGuidelines.pdf
;; http://zumbi/~andre/_/resources/project/SDP_Template.pdf
;; http://zumbi/~andre/_/resources/project/ArchitectureOverview.pdf
(code-xpdf      "pdsw_AO"  "$S/http/zumbi/~andre/_/resources/project/ArchitectureOverview.pdf")
(code-pdftotext "pdsw_AO"  "$S/http/zumbi/~andre/_/resources/project/ArchitectureOverview.pdf")
(code-xpdf      "pdsw_PMG" "$S/http/zumbi/~andre/_/resources/project/ProjectMgtGuidelines.pdf")
(code-pdftotext "pdsw_PMG" "$S/http/zumbi/~andre/_/resources/project/ProjectMgtGuidelines.pdf")
(code-xpdf      "pdsw_ST"  "$S/http/zumbi/~andre/_/resources/project/SDP_Template.pdf")
(code-pdftotext "pdsw_ST"  "$S/http/zumbi/~andre/_/resources/project/SDP_Template.pdf")
;; (find-pdsw_AOpage 1)
;; (find-pdsw_AOtext)
;; (find-pdsw_PMGpage 1)
;; (find-pdsw_PMGtext)
;; (find-pdsw_STpage 1)
;; (find-pdsw_STtext)

;; «sisrot-cameras»  (to ".sisrot-cameras")
;; (find-noronhafile "Sisrot/Sensores/Cedip infrared systems/")
;; (find-noronhafile "Sisrot/Sensores/Cedip infrared systems/DOC/")

;; «noronha»  (to ".noronha")
;; (find-fline "/scp:edrx@caramelo:/etc/fstab")
;; (find-fline "/scp:edrx@caramelo:/etc/fstab" "/mnt/omnisys.files")
(code-c-d  "noronha" "/scp:edrx@caramelo:/mnt/omnisys.files/")
(code-c-d "lnoronha" "$S/http/noronha/")
(code-c-d "lnoronhatpt"
  (ee-lnoronhafile "Telemedidas Redundante/PD/01 Sistema/Procedimentos de testes sistema/"))
;; (find-noronhafile "")
;; (find-lnoronhafile "")
;; (find-lnoronhatptfile "")
;; (find-noronhafile "QUALIDADE/1-S G Q/Procedimentos/")
;; (find-noronhafile "QUALIDADE/1-S G Q/Processos/")
;; (find-noronhafile "QUALIDADE/1-S G Q/Processos/" "01.30.0200_500_rev02.doc")
;; (find-lnoronhafile "QUALIDADE/1-S G Q/Processos/" "01.30.0200_500_rev02.doc")
;; (find-lnoronhafile "QUALIDADE/1-S G Q/Processos/" "01.30.0200_500_rev02.pdf")
;; (find-pspage (ee-lnoronhafile "QUALIDADE/1-S G Q/Processos/01.30.0200_500_rev02.pdf"))

;; «telemedidastestes»  (to ".telemedidastestes")
;; (find-pspage (ee-lnoronhatptfile "95.24.0014_doc456_rev00.pdf"))
(code-xpdf      "telemedidastestes" (ee-lnoronhatptfile "95.24.0014_doc456_rev00.pdf"))
(code-pdftotext "telemedidastestes" (ee-lnoronhatptfile "95.24.0014_doc456_rev00.pdf"))
;; (find-telemedidastestespage 1)
;; (find-telemedidastestespage 29)
;; (find-telemedidastestestext)

;; Make rcirc connect to freenode through a local machine that
;; connects to freenode via an ssh tunnel - override `rcirc-freenode'
;;
(setq omnisys-machines
      '(;; "persephone"
	"caramelo"
	))

(if (member system-name
	    '(;; "persephone"
	      "caramelo"
	      ))
    (defun rcirc-freenode () (interactive)
      (rcirc-connect "tanenbaum"
		     "6666" ; "6667"
		     "edrx"
		     "Eduardo Ochs <http://angg.twu.net/>"
		     "Eduardo Ochs <http://angg.twu.net/>"
		     '("#eev" "#emacs"
		       ;; "#lua" "#forth"
		       ;; "#tcl"
		       ;; "#truta.org" "#omnisys"
		       )))
  )

;; Make the emacs window that I run on caramelo visually distinct
;; M-44 M-j ->
;;   (find-es "netbsd" "cvs-emacs-at-caramelo")
;; (find-eface-links 'mode-line)
;; (find-ecolor-links "grey75")
;; (find-ecolor-links "#ccddbb")
;; (find-ecolor-links "khaki")
;; (find-epalette my-palette "YellowGreen")
;; (find-epalette my-palette "burlywood")
;; (find-epalette "red orange yellow green blue #7000C0 violet")
;; (find-ecolors)
;; (set-face-background 'mode-line "grey75")
;; (set-face-background 'mode-line "#ccddbb")
;; (set-face-background 'mode-line "khaki")
;; (set-face-background 'mode-line "burlywood")
;; (set-face-background 'mode-line "tan")
;;
(if (equal system-name "caramelo")
    (set-face-background 'mode-line "burlywood")
  )
(if (equal system-name "dekooning")
    (set-face-background 'mode-line "tan")
  )


;; «find-omnisys-links»  (to ".find-omnisys-links")
;; (find-omnisys-links)
;;
(defun find-omnisys-links (&rest rest)
  (interactive)
  (apply 'find-elinks `(
    (find-omnisys-links ,@rest)
    (find-efunction 'find-omnisys-links)
    nil
    (find-rcirc-channel-sexps "*tanenbaum*")
    (find-ebuffer "#omnisys@tanenbaum")
    (find-es "netbsd" ".xterms-at-caramelo")
    (find-es "netbsd" "cvs-emacs-at-caramelo")
    (find-es "omnisys")
    (find-es "sisrot")
    (find-angg ".emacs" "sisrot")
    nil
    (find-es "omnisys" "zumbi-wiki-w2html")
    (find-zumbipagefile "")
    ,(ee-addhp "http://zumbi/wiki/")
    ,(ee-addhp "http://zumbi/wiki/project.omnisys-zumbi.Blogme3")
    ,(ee-addhp "http://zumbi/~edrx/")
    ,(ee-addhp "http://zumbi/~edrx/sisrot/")
    ,(ee-addhp "http://zumbi/devel/")
    ,(ee-addhp "http://zumbi/cgi-bin/cvsweb.cgi/cla-telemedidas/")
    ,(ee-addhp "http://zumbi/~andre/projects/omnisys-zumbi/standards/public-filetree.txt")
    ,(ee-addhp "http://meskita/")
    nil
    (find-es "sisrot" "pdsw-upload")
    nil
    (find-zsh "TERM=vt100 muttfetchmail")
    (find-sh0 "cp -v ~/.mutt/inbox /tmp/testmbox")
    (find-fline "/tmp/testmbox")
    (find-mbox "/tmp/testmbox")
    (find-mbox "/tmp/testmbox" "" '(eek "C-u /w /t-2"))
    nil
    ,(ee-addhp "Fetch and auth with 'G', exit with 'x':")
    (find-bgprocess "xterm -e mutt")
    (ee-addhp "http://192.168.51.5/consulta_ramais.asp")
    nil
    (find-zumbipagefile "tmp/")
    (find-zumbipagefile "tmp/TODO")
    (find-es "blogme" "a2html-at-zumbi")
    nil
    (ee-cp (ee-zumbipagefile "tmp/TODO") "~/OMNISYS/")
    (eekill "TODO and index.org")
    (eekill "~/TODO")
    (eekill "~/ORG/index.org")
    (eekill "~/.psne.log")
    ""
    (find-zsh "TERM=vt100 muttfetchmail")
    "* (eepitch-shell)"
    "* (eepitch-kill)"
    "* (eepitch-shell)"
    ""
    "/var/qmail/bin/qmail-inject -feduardo.ochs\100omnisys.com.br <<'%%%'"
    "From: \"Eduardo Nahum Ochs\" <eduardo.ochs\100omnisys.com.br>"
    "To: \"Andre Luiz de Oliveira\" <andre.luiz\100omnisys.com.br>"
    "Subject:"
    "Cc: \"Eduardo Nahum Ochs\" <eduardo.ochs\100omnisys.com.br>, \"Silas Silva\" <silas.silva\100omnisys.com.br>"
    ""
    "%%%"
    ) rest))

;; (find-omnisys-links)
;; (eejump 14)


;; «telemedidas»  (to ".telemedidas")
;; (find-es "omnisys" "telemedidas")
(code-c-d    "telemedidas" "~/usrc/telemedidas/")
(code-c-d "clatelemedidas" "~/usrc/telemedidas/cla-telemedidas/")
(code-c-d        "ihmtelm" "~/usrc/telemedidas/cla-telemedidas/ihmtelm/")
;; (find-telemedidasfile "")
;; (find-clatelemedidasfile "")
;; (find-ihmtelmfile "")
;; (find-ihmtelmfile "tests/")



;; «column-marker»  (to ".column-marker")
;; http://www.emacswiki.org/cgi-bin/wiki/download/column-marker.el
;; http://www.emacswiki.org/cgi-bin/wiki/RulerMode
;; http://www.emacswiki.org/cgi-bin/wiki/PopupRuler



;; «find-mbox»  (to ".find-mbox")
;; (find-es "gnus" "find-mbox")
;; (find-es "gnus" "limiting")
;; (find-sh0 "cp -v ~/.mutt/inbox /tmp/testmbox")
;; (find-mbox "/tmp/testmbox")
;; (find-mbox "/tmp/testmbox" "" '(eek "C-u /w/t-3"))
;;
(defun find-mbox (fname &rest pos-spec-list)
  (setq fname (ee-expand fname))
  (gnus-fetch-group
   (format "nndoc+%s:%s" fname (file-name-nondirectory fname)))
  (apply 'ee-goto-position pos-spec-list))




(seen 9500)


;; «eshell-url-retrieve»  (to ".eshell-url-retrieve")
;; (find-efile "eshell/")
;; (find-egrep "grep -nH -e cp eshell/*.el")
;; (find-egrep "grep -nH -e eshell-eval-using-options eshell/*.el")
;; (find-efile "eshell/em-unix.el" "defun eshell/cp")
;; (find-efile "eshell/esh-opt.el" "defmacro eshell-eval-using-options")
;; (find-eapropos "eshell-")
;;
(defun eshell/taturana (&rest args)
  "A skeleton for implementing an url-retrieve/wget-like command in eshell."
  (eshell-eval-using-options
   "taturana" args
   '((?v "verbose" nil verbose
	 "explain what is being done")
     (nil "help" nil nil "show this usage screen")
     :preserve-args
     :external "wget"
     :show-usage
     :usage "URL")
   (eshell-printn (format "Taturana: args = %S" args))))

;; A test:
'
(find-estring "
* (eepitch-eshell)
* (eepitch-kill)
* (eepitch-eshell)
taturana
taturana foo
taturana foo bar
")


;; «find-netbsdman»  (to ".find-netbsdman")
;; (find-angg ".emacs" "find-fline-ov")
;;
(defun find-netbsdman (manpage &rest rest)
  (let ((buffername (format "*netbsdman: %s*" manpage))
	(command (format "ssh edrx@caramelo \"sh -c 'PAGER=cat man %s'\"" manpage)))
    (apply 'find-eoutput-reuse
	   buffername
	   `(progn (insert (find-sh0 ,command))
		   (Man-fontify-manpage))
	   rest)))

;; (find-netbsdman "man")
;; (find-netbsdman "1 make")
;; (find-netbsdman "1 make" "Print debugging")



;; 2007dec27: new function, still dirty...
;; (find-edrx-update-links)
;; Based on:         (find-eev-update-links)
;;   (find-efunction 'find-eev-update-links)
(defun find-edrx-update-links (&rest rest)
  (interactive)
  (apply 'find-elinks `(
    (find-edrx-update-links ,@rest)
    (find-efunction 'find-edrx-update-links)
    ""
    ,(format "* (eepitch-shell)")
    ,(format "cd")
    ,(format "mv -v edrx.tgz edrx-old.tgz")
    ,(format "wget http://angg.twu.net/edrx.tgz")
    ,(format "tar -xvzf edrx.tgz")
    ""
    (find-es "emacs" "emacs-from-cvs")
    (find-es "lua5" "install-5.1.2")
    (find-es "lua5" "install-5.1.2" "mkdir")
    (find-es "lua5" "install-5.1.2" "cp -iv lua  ~/bin/lua51")
    (find-es "lua5" "lpeg-0.7")
    ) rest))



;; (setq password-cache-expiry nil)

(code-c-d "ezilh"
 "/scp:ezil@shells.sf.net:/home/users/e/ez/ezil/htdocs/"
                    :wget "http://ezil.sourceforge.net/" :ffox)
(code-c-d "ezilfr"
 "/scp:ezil@shells.sf.net:/home/users/e/ez/ezil/htdocs/forth/rubyforth/"
                    :wget "http://ezil.sourceforge.net/forth/rubyforth/" :ffox)
(code-c-d "twup"
 "/scp:edrx@angg.twu.net:/home/edrx/public_html/"
                               :wget "http://angg.twu.net/" :ffox)

;; (find-twupfile "tmp/o")
;; (find-twupwget "tmp/o")
;; (find-ezilhfile "")
;; (find-ezilhwget "")
;; (find-ezilfrfile "")
;; (find-ezilfrwget "")

;; (find-ezilhwget "")
;; (find-ezilffox  "")
;; (find-firefox (ee-ezilhurl ""))

;; «eev-traffic-light-glyphs»  (to ".eev-traffic-light-glyphs")
;; (find-es "blogme" "traffic-lights-glyphs")
;; (find-blogme3 "anggdefs.lua" "TRAFFIC")
;;
(defun eev-traffic-light-glyphs ()
  (interactive)
  (eev-math-glyphs-edrx)
  (add-to-alist 'eev-math-glyphs-name-to-char '("^a" . ?a))
  (add-to-alist 'eev-math-glyphs-name-to-char '("^b" . ?b))
  (add-to-alist 'eev-math-glyphs-name-to-char '("^c" . ?c))
  (eev-glyphs-set-face 'eev-glyph-face-cfont-a "firebrick1"      "firebrick")
  (eev-glyphs-set-face 'eev-glyph-face-cfont-b "orange1"         "orange4")
  (eev-glyphs-set-face 'eev-glyph-face-cfont-c "darkolivegreen1" "darkolivegreen4")
  (eev-math-glyphs-set 'eev-glyph-face-cfont-a "^a" "^a" "")
  (eev-math-glyphs-set 'eev-glyph-face-cfont-b "^b" "^b" "")
  (eev-math-glyphs-set 'eev-glyph-face-cfont-c "^c" "^c" ""))


(message "line 9606")

;; «no-super-key»  (to ".no-super-key")
;; (find-angg ".fvwm/.fvwm2rc" "no-super-key")
;; For freire, a netbsd machine with an old IBM keyboard
(defun no-super-key ()
  (find-fvwm0 "
    Key F5 A M WindowStyle NoTitle, !Borders # no borders
    Key F6 A M WindowStyle Title, Borders    # borders
    Key F7 A M Maximize   0 100  # maximize vertically (toggle)
    Key F8 A M Maximize 100 100  # maximize both ways (toggle)
  ")
  (global-set-key (kbd "C-M-s") 'toggle-scroll-bar)
  (global-set-key (kbd "C-M-d") 'display-time-mode)
  (find-sh0 "~/bin/mysetxkb us"))

;; This is for freire too...
;; (find-fline "/usr/pkg/info/")
(add-to-list 'Info-additional-directory-list "/usr/pkg/info/")
;; (find-sh "locate wget.info")
;; (find-node "(/usr/pkg/info/wget)")
;; (find-node "(wget)")
;; (find-node "(wget)Sample Wgetrc" "http_proxy =")




;; «eepitch-sisrotlua»  (to ".eepitch-sisrotlua")
;; (find-angg "sisrot/")
(defun eepitch-sisrotlua (&optional rubyforthargs)
  (ee-eepitch-comint "~/sisrot/" "sisrotlua" "lua51"))


;; «brecp»  (to ".brecp")

(defun find-cpsne-links (url &rest rest)
  (let* ((localurl (replace-regexp-in-string
		    "^\\(https?\\|ftp\\)://" "$S/\\1/" url))
	 (caramurl (replace-regexp-in-string
		    "^\\(https?\\|ftp\\)://" "snarf/\\1/" url))
	 (localdir (file-name-directory localurl)))
  (find-elinks `(
    (find-cpsne-links ,url ,@rest)
    ,(ee-addhp url)
    nil
    "* (eepitch-caramelo)"
    "* (eepitch-kill)"
    "* (eepitch-caramelo)"
    "S=$HOME/snarf"
    ,(format "mkdir -p %s" localdir)
    ,(format "cd       %s" localdir)
    ,(format "wget --user=guest --password=guest \\")
    ,(format "          %s" url)
    ""
    "* (eepitch-eshell)"
    "* (eepitch-kill)"
    "* (eepitch-eshell)"
    ,(format "mkdir -p %s" localdir)
    ,(format "cd       %s" localdir)
    ,(format "cp -v (ee-caramelofile %S) ." caramurl)
    ,(format "echo    '%s' >> ~/.psne.log" url)
    ""
    ,(ee-addhp url)
    ))))

(code-brurl 'find-cpsne-links :remote 'brecp)



;; «qt»  (to ".qt")
;; (find-es "qt")
;; (find-es "qt" "qtprogramming")
;; (find-angg ".emacs.templates")
;; (find-angg ".emacs.templates" "find-qtdemo-links")
(code-c-d "qt4doc" "/usr/share/qt4/doc/html/")
(code-c-d "qtprogramming" "/tmp/qtprogramming/0131872494/")
;; (find-qt4docfile "")
;; (find-qt4docw3m "index.html")
;; (find-qt4docw3m "classes.html")
;; (find-qtprogrammingfile "")
;; (find-qtprogrammingw3m "toc.html")


(code-c-d "progfiles"   "c:/Arquivos de programs/")
(code-c-d "progfilesff" "c:/Arquivos de programs/Mozilla Firefox/")
(defun find-windowsfirefox (url)
  (interactive (browse-url-interactive-arg "URL: "))
  (find-bgprocess (list (ee-progfilesfffile "firefox.exe") url)))

;; (find-windowsfirefox "http://angg.twu.net/")
;; (find-eevfile "eev-browse-url.el" "'browse-url-firefox")
' (code-brurl 'find-windowsfirefox
              :remote 'brm :local 'brml :dired 'brmd)


(seen 9950)


;; «maut»  (to ".maut")
;; http://www.movimentoautentico.com/
(code-c-d "mautr" "/ftp:soraia@www.movimentoautentico.com:public_html/")
(code-c-d "maut" "$S/http/www.movimentoautentico.com/")
(setenv "MAUT"  (ee-expand "$S/http/www.movimentoautentico.com"))
(setenv "MAUTR" (ee-expand "/ftp:soraia@www.movimentoautentico.com:public_html"))
;; (find-fline "$MAUT/")
;; (find-fline "$MAUTR/")

;; Emacs21:
;; (code-c-d "mautr" "/soraia@www.movimentoautentico.com:public_html/")
;; (code-c-d "maut"  "/soraia@www.movimentoautentico.com:public_html/")
;; (code-c-d "maut" "/ftp:soraia@www.movimentoautentico.com:public_html/")
;; (ee-cp (ee-mautfile "introducao.html") (ee-mautrfile "introducao.html") 'over)
;; (ee-cp (ee-mautfile "menu.html")       (ee-mautrfile "menu.html")       'over)
;; (ee-cp (ee-mautfile "quem.html")       (ee-mautrfile "quem.html")       'over)
;; (ee-cp (ee-mautfile "movaut.html")     (ee-mautrfile "movaut.html")     'over)
;; (find-mautrfile "")
;; (find-mautfile "")
;; (find-mautfile "index.html")
;; (find-mautw3m  "index.html")
;; (find-mautfile  "introducao.html")
;; (find-mautw3m   "introducao.html")
;; (find-mautff    "menu.html")
;; (find-mautfile  "menu.html")
;; (find-mautw3m   "menu.html")
;; (find-mautfile "oficinas.html")
;; (find-mautw3m  "oficinas.html")
;; (find-mautfile "quem.html")
;; (find-mautw3m  "quem.html")
;; (find-mautfile "movaut.html")
;; (find-mautw3m  "movaut.html")
;; http://www.movimentoautentico.com/index.html
;; http://www.movimentoautentico.com/introducao.html
;; http://www.movimentoautentico.com/menu.html
;; http://www.movimentoautentico.com/oficinas.html
;; http://www.movimentoautentico.com/quem.html
;; http://www.movimentoautentico.com/movaut.html
;;
;; http://www.movimentoautentico-orig.com/
;; http://www.movimentoautentico.com/
;; http://www.movimentoautentico.com/movaut.html
;; http://www.movimentoautentico.com/english.html
;; http://www.movimentoautentico.com/english-2009jul07.html



;; «lilypond»  (to ".lilypond")
;; (find-es "lilypond" "lilypond")
(code-c-d "lilypond"  "/usr/share/doc/lilypond/" "lilypond")
(code-c-d "lilylearn" "/usr/share/doc/lilypond/" "lilypond-learning")
(code-c-d "lilyint"   "/usr/share/doc/lilypond/" "lilypond-internals")
(code-c-d "lilyprog"  "/usr/share/doc/lilypond/" "lilypond-program")
(code-c-d "lilysnip"  "/usr/share/doc/lilypond/" "lilypond-snippets")
(code-c-d "lilyglos"  "/usr/share/doc/lilypond/" "music-glossary")
(code-c-d "lilymut" "/usr/share/doc/lilypond/html/input/mutopia/")
;; (find-lilypondnode "")
;; (find-lilypondnode "LilyPond command index")
;; (find-lilypondnode "LilyPond index")
;; (find-lilylearnnode "")
;; (find-lilylearnnode "Tutorial")
;; (find-lilylearnnode "Multiple staves")
;; (find-lilylearnnode "LilyPond index")
;; (find-lilyintnode "")
;; (find-lilyintnode "Indices")
;; (find-lilyprognode "")
;; (find-lilyprognode "LilyPond index")
;; (find-lilysnipnode "")
;; (find-lilyglosnode "")
;; (find-lilymutfile "")
;; (find-lilymutfile "E.Satie/petite-ouverture-a-danser.ly")

;; «lilypond-repl»  (to ".lilypond-repl")
;; (find-angg "LILYPOND/repl.ly")
(defun eepitch-lilyrepl () (interactive)
  (eepitch-comint "Lilypond REPL" "lilypond ~/LILYPOND/repl.ly"))



;; «metalua»  (to ".metalua")
;; (find-es "lua5" "metalua")
;; (find-angg "bin/setenved-metalua")
(code-c-d "metalua"        "~/usrc/metalua/")
(code-c-d "metaluaext"     "~/usrc/metalua/src/lib/extension/")
(code-c-d "metaluasamples" "~/usrc/metalua/src/samples/")
(code-xpdf      "metalua" (ee-metaluafile "doc/manual/metalua-manual.pdf"))
(code-pdftotext "metalua" (ee-metaluafile "doc/manual/metalua-manual.pdf"))
;; (find-metaluafile "")
;; (find-metaluaextfile "")
;; (find-metaluasamplesfile "")
;; (find-metaluapage 1)
;; (find-metaluatext 1)
(defun eepitch-metalua () (interactive)
  (eepitch-comint "metalua" (ee-metaluafile "target/bin/setenved-metalua")))
(defun eepitch-metalua () (interactive)
  (eepitch-comint "metalua" "setenved-metalua"))



;; «texinfo»  (to ".texinfo")
;; (find-es "texinfo" "texinfo-deb-src")
;; (find-es "texinfo" "texinfo-doc-nonfree-deb-src")
(code-c-d "texinfo" "~/usrc/texinfo/texinfo-4.11.dfsg.1/" "texinfo")
(code-c-d "texi" "~/usrc/texinfo-doc-nonfree/texinfo-doc-nonfree-4.11/" "texinfo")
;; (find-texinode "Top")
;; (find-efile "textmodes/texinfo.el")
(setq texinfo-open-quote  "\"")
(setq texinfo-close-quote "\"")


;; «ee-unglyph»  (to ".ee-unglyph")
;; (ee-unglyph-1 15)
;; (find-eevfile "eev-insert.el" "defun ee-template")
;; (find-eevfile "htmlize-eev.el")
;; (find-eevfile "htmlize-eev.el" "glyphs-faceglyph-to-facechar")
;; (find-efunctiondescr 'regexp-quote)
;; (find-elnode "Search and Replace")
;; On recent CVS Emacsen glyphs can be either numbers (bitfields) or
;; conses like this: (code . face). See:
;; http://article.gmane.org/gmane.emacs.bugs/17576
;; http://article.gmane.org/gmane.emacs.bugs/17607
;; (find-efunction 'glyph-char)

(defun ee-unglyph-0 (glyph)
  "Convert GLYPH to a propertized string of length 1.
GLYPH is usually a number whose higher bits encode a face-id.
In recent versions of GNU Emacs (after 2008-02-27) GLYPH can also
be a cons."
  (propertize (string (glyph-char glyph)) 'face (glyph-face glyph)))

(defun ee-unglyph-1 (glyph-code)
  "Convert a vector of glyphs to a propertized string.
The vector of glyphs is read from the position GLYPH-CODE of
`standard-display-table'."
  (let* ((glyphvec (aref standard-display-table glyph-code)))
    (apply 'concat (mapcar 'ee-unglyph-0 glyphvec))))

(defun ee-unglyph-alist (glyphs)
"Return an alist with entries of this form: (glyph-code . propertized-string).
The returned alist is used by `ee-unglyph-replace' to speed
up (and simplify) the replacement process."
  (mapcar (lambda (glyph-code)
	    (cons glyph-code (ee-unglyph-1 glyph-code)))
	  glyphs))

(defun ee-unglyph-replace (&optional glyphs)
  "Replace - from point onwards - all glyphs listed in the string GLYPHS.
Return the number of substitutions made."
  (setq glyphs (or glyphs "\f
*«»"))
  (let ((re    (format "[%s]" glyphs))
	(alist (ee-unglyph-alist glyphs))
	(n     0))
    (while (re-search-forward re nil t)
      (setq n (1+ n))
      (replace-match (cdr (assoc (char-after (match-beginning 0))
				 alist))))
    n))

(defun ee-unglyph-region (beg end &optional glyphs)
  "Replace all glyphs listed in the string GLYPHS, in a region.
Return the number of substitutions made.
This function does not move point."
  (interactive "r")
  (save-excursion
    (save-restriction
      (narrow-to-region beg end)
      (goto-char (point-min))
      (ee-unglyph-replace glyphs))))

;; Tests:
;;      (assoc 15 (ee-unglyph-alist "*
"))
;; (cdr (assoc 15 (ee-unglyph-alist "*
")))
;;
' (find-estring
   "(ee-unglyph-region (point-min) (point-max))\nfoo * «» bar\n\f\n\r\n")


;; (find-efile "doc-view.el" "Welcome to DocView!")
;; (find-evardescr 'auto-mode-alist ". doc-view-mode")
;; (find-efile "files.el" ". doc-view-mode")



;; «eev-math-glyphs-new»  (to ".eev-math-glyphs-new")
;; New code for eev-math-glyphs.el - incomplete
;; (find-eevfile "eev-math-glyphs.el")
;; (find-eevfile "eev-compose.el")
;; (find-elnode "Other Plists")

(when window-system

(require 'eev-math-glyphs)

(setq ee-new-name-to-char-0 '(
    (Theta Pi  Sigma Omega)
    (920   928 931   937)
    (delta epsilon theta lambda nu  pi  rho sigma tau omega)
    (948   949     952   955    957 960 961 963   964 969)
    (top  bot  land lor  supset forall exists _box box  thin:)
    (8868 8869 8743 8744 8835   8704   8707   9633 9744 8758)
    (in   circ cap  cup  infty Int  nabla ge   ^1  sqcap)
    (8712 9675 8745 8746 8747  8711 8734  8805 185 8851)
    (ud&  oplus otimes to   dotli nat  seblock neblock)
    (8523 8853  8855   8594 9480  9838 9623    9629)
    (b  r   s   t)
    (98 114 115 116)
  ))

(setq ee-new-name-to-char (ee-chop3 2 1 ee-new-name-to-char-0))

)

(defun ee-insert-sexp (sexp) (insert (ee-pp0 sexp) "\n"))
(defun find-elist     (list) (find-eoutput `(mapc 'ee-insert-sexp ',list)))
(defun ee-mapcar      (f seq) (mapcar (lambda (args) (apply f args)) seq))
(defun ee-mapc        (f seq) (mapc   (lambda (args) (apply f args)) seq))
(defun ee-insert-name-char (name char) (insert (format "%c %s\n" char name)))

;; (find-elist ee-new-name-to-char-0)
;; (find-elist ee-new-name-to-char)
;; (find-eoutput '(ee-mapc 'ee-insert-name-char ee-new-name-to-char))
;; (find-epp   (ee-chop1 4 (number-sequence 1 10)))
;; (find-elist (ee-chop1 4 (number-sequence 1 10)))

;; (eq 'ee-mapc (intern "ee-mapc"))
;; (eq '\99 (intern "99"))

;; (concat "foo" "bar" "plic" "ploc")
;; (append '(1 2) '(3 4) '(5 6))

;; (find-eevfile "eev-math-glyphs.el")
;;
(defun eev-math-glyph-names (name code &rest rest)
  (add-to-alist 'eev-math-glyphs-name-to-char `(,name . ,code))
  (if rest (apply 'eev-math-glyph-names rest)))




;; «my-faces-sort»  (to ".my-faces-sort")

(defun my-next-single-property-change (pos prop &optional object limit)
  "Like `next-single-property-change', but OBJECT is ignored,
LIMIT is set to (point-max) if nil, and if the property stays
constant until LIMIT then return LIMIT instead of returning nil.
Usage is typically like this:\n
\(let (next)
  (while (setq next (my-next-single-property-change (point) 'face nil limit))
    ...
    (goto-char next)))"
  (let* ((limit (or limit (point-max)))
	 (nextpos (next-single-property-change pos prop nil limit)))
    (cond ((and nextpos (< pos nextpos))
	   nextpos)
	  ((< pos limit)
	   limit))))

(defun my-strings-and-faces (s e)
  "Return a description of the region between S and E as a list
of (face str) pairs. The typical output will be something like:\n
  ((font-lock-doc-face \"foo\")
   (nil \" \")
   ((:foreground \"red\") \"bar\"))"
  (save-excursion
    (let (next pairs (limit (max s e)))
      (goto-char (min s e))
      (while (setq next (my-next-single-property-change (point) 'face nil limit))
	(let ((str  (buffer-substring-no-properties (point) next))
	      (face (get-text-property (point) 'face)))
	  (setq pairs (cons (list face str) pairs))
	  (goto-char next)))
      (nreverse pairs))))

;; Example/test:
' (eesteps '(
    (find-estring "")
    (insert (propertize "foo" 'face 'font-lock-doc-face) " ")
    (insert (propertize "bar" 'face '(:foreground "red")))
    (insert (format "\n%S\n" (my-strings-and-faces (point-min) (point))))
    ;; Result:
    ;; ((font-lock-doc-face "foo") (nil " ") ((:foreground "red") "bar"))
    ))

(defun my-strings-and-faces-face-name (stringandface)
  (let ((face (car stringandface)))
    (if (consp face)
	(format "%S" face)
      (symbol-name face))))

;; (find-node "(cl)Sequence Functions" "delete-duplicates")
(defun my-faces-sort (stringandfacelist)
  (require 'cl)
  (delete-duplicates
   (sort (mapcar 'my-strings-and-faces-face-name stringandfacelist)
	 'string<)
   :test 'equal
   ))

(defun my-simplify-faces (s e)
"Htmlize.el doesn't like faces like (face1 face2) - replace them by their car."
  (let ((start (min s e)) (limit (max s e)) next face (n 0))
    (save-excursion
      (goto-char start)
      (while (setq next (my-next-single-property-change (point) 'face nil limit))
	(setq face (get-text-property (point) 'face))
	(when (and (consp face) (facep (car face)))
	  (put-text-property (point) next 'face (car face))
	  (setq n (1+ n)))
	(goto-char next)))
    n))

(defun copy-this-unibyte-buffer ()
  "Warning: this is confusing - watch the name of the buffer!"
  (interactive)
  (let ((b (buffer-substring (point-min) (point-max)))
	(p (point))
	(ee-buffer-name "*copy*"))
    (find-euboutput '(insert b))
    (goto-char p)))

' (eesteps '(
   (copy-this-unibyte-buffer)
   (find-epp (my-faces-sort (my-strings-and-faces (point-min) (point-max))))
   (kill-this-buffer)
   (message "%d simplifications" (my-simplify-faces (point-min) (point-max)))
   (find-epp (my-faces-sort (my-strings-and-faces (point-min) (point-max))))
   (kill-this-buffer)
   (kill-this-buffer)
   ))

;;                          (my-faces-sort (my-strings-and-faces (point) (mark)))
;; (find-estring (ee-concat (my-faces-sort (my-strings-and-faces (point) (mark))) "\n"))
;; (find-estring (ee-concat (my-faces-sort (my-strings-and-faces (point-min) (point-max))) "\n"))
;; (find-epp (my-faces-sort (my-strings-and-faces (point-min) (point-max))))

;; (find-estring  (my-strings-and-faces (point) (mark))))
;; (find-epp (mapcar 'car myp))
;; (delete-duplicates (sort (mapcar 'symbol-name (mapcar 'car myp)) 'string<))




;; «doc-view-mode»  (to ".doc-view-mode")
;; (find-evardescr 'auto-mode-alist)
;; (find-egrep "grep -nH -e  doc-view-mode $(find * -name '*.el')")
;; (find-efile "files.el" ". doc-view-mode")
;; (find-elnode "Sequence Functions" "Function: copy-sequence")
;; (find-elnode "Association Lists" "Function: rassq-delete-all")
;; (find-elnode "Auto Major Mode" "Variable: auto-mode-alist")
;;
(if (fboundp 'rassq-delete-all)
(setq auto-mode-alist (rassq-delete-all 'doc-view-mode auto-mode-alist))
)


(seen 10050)


;; «sqlite»  (to ".sqlite")
;; (find-es "sqlite")
(code-c-d "sqlitedoc" "/usr/share/doc/sqlite3-doc/")

(code-c-d "pclcvs" "/tmp/foo/" "pcl-cvs")
;; (find-pclcvsnode "")


;; (find-enode "Persistent Mark")
;; (find-egrep "grep -nH -e 'Mark deactivated' *.el")
;; (find-efunction 'set-mark-command)
;; (find-evardescr 'transient-mark-mode)
;; (find-evariable 'transient-mark-mode)
;; (find-efunctiondescr 'transient-mark-mode)
;; (find-efunction 'transient-mark-mode)



;; «find-pen-links»  (to ".find-pen-links")
;; (find-pen-links)
;; (find-es "pendrive")
;; (find-fline "/tmp/pen/")
;; (find-man "mount")
;; (find-man "mount" "Mount options for fat")
;; (find-man "8 mount" "Mount options for fat" "uid=value")
;; (find-sh "dmesg")
;;
(defun find-pen-links (&rest rest)
  "Visit a temporary buffer containing hyperlinks for pen drive operations."
  (interactive)
  (apply 'find-elinks `(
    (find-pen-links ,@rest)
    (find-efunction 'find-pen-links)
    (find-es "pendrive" "repartition-1")
    (find-man "8 mount" "Mount options for fat" "uid=value")
    (find-angg "VIDEOS/Makefile")
    (find-sh "dmesg")
    (find-sh "dmesg | tail")
    (find-sh0 "sudo ls -l /dev/disk/by-id/*usb*")
    "
* (eepitch-shell)
mkdir /tmp/pen/
sudo mount -o ro               /dev/sdb1 /tmp/pen/
sudo mount -o ro               /dev/sdc1 /tmp/pen/
sudo mount -o ro       -t vfat /dev/sdb1 /tmp/pen/
sudo mount             -t vfat /dev/sdb1 /tmp/pen/
sudo mount -o uid=$UID -t vfat /dev/sdb1 /tmp/pen/
sudo mount -o uid=$UID         /dev/sdb1 /tmp/pen/
sudo mount -o uid=$UID         /dev/sdc1 /tmp/pen/
sudo mount -o uid=$UID         /dev/sdb  /tmp/pen/
sudo mount -o uid=$UID         /dev/sdc  /tmp/pen/
# (find-fline \"/tmp/pen/\")
# (find-fline \"/tmp/pen/Music/\")
# (find-fline \"/tmp/pen/DCIM/Camera/\")
# (find-fline \"/tmp/pen/DCIM/100D5100/\")
# (find-fline \"/tmp/pen/VOICE/FOLDER01/\")
sudo umount /tmp/pen
sync

cd /sda6/nikon/caderno/
make -f ~/VIDEOS/Makefile r4_jpgs
# (find-fline \"/sda6/nikon/caderno/\")

\ (find-fline \"/sda6/nikon/aula_1/\")
\ (find-fline \"/sda6/nikon/aula_2/\")
\ (find-fline \"/sda6/nikon/aula_3/\")
\ (find-fline \"/sda6/nikon/aula_4/\")
\ (find-fline \"/sda6/nikon/aula_5/\")
\ (find-fline \"/sda6/nikon/aula_6/\")
\ (find-fline \"/sda6/nikon/aula_7/\")
\ (find-fline \"/sda6/nikon/aula_8/\")
\ (find-fline \"/sda6/nikon/aula_9/\")
\ (find-fline \"/sda6/nikon/aula_10/\")

\(progn
  (kill-new \"/sda6/nikon/\")
  (find-3
    ' (find-fline \"/tmp/pen/DCIM/100D5100/\" 1 '(eek \"M->\"))
    ' (find-fline \"/sda6/nikon/\"            1 '(eek \"M->\"))
  ))"
    ) rest))


;; (find-dvd-links)
(defun find-dvd-links (&rest rest)
  "Visit a temporary buffer containing hyperlinks for dvd operations."
  (interactive)
  (apply 'find-elinks `(
    (find-dvd-links ,@rest)
    (find-efunction 'find-dvd-links)
    (find-man "8 mount" "Mount options for fat" "uid=value")
    (find-sh "dmesg")
    (find-sh "dmesg | tail")
    "
* (eepitch-shell)
mkdir /tmp/dvd/
sudo mount -o ro /dev/sr0 /tmp/dvd/
# (find-fline \"/tmp/dvd/\")
cd
vlc    /tmp/dvd/
cd
sudo umount /tmp/dvd/
eject /dev/sr0
") rest))

;; (find-cdrom-links)
(defun find-cdrom-links (&rest rest)
  "Visit a temporary buffer containing hyperlinks for cdrom operations."
  (interactive)
  (apply 'find-elinks `(
    (find-cdrom-links ,@rest)
    (find-man "8 mount" "Mount options for fat" "uid=value")
    (find-sh "dmesg")
    (find-es "cdrom")
    "
* (eepitch-shell)
mkdir /tmp/cdrom/
sudo mount -o ro       /dev/hdc /tmp/cdrom/
sudo mount             /dev/hdc /tmp/cdrom/
sudo mount -o uid=$UID /dev/hdc /tmp/cdrom/
# (find-fline \"/tmp/cdrom/\")
sudo umount /tmp/cdrom"
    ) rest))


;; «find-hde-links» (to ".find-hde-links")
;; Test: (find-hde-links)
(defun find-hde-links (&optional dir &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for foo."
  (interactive)
  (setq dir (or dir "{dir}"))
  (apply 'find-elinks
   `((find-hde-links ,dir ,@pos-spec-list)
     (find-hde-links "/")
     (find-hde-links "/nikon/")
     ;; Convention: the first sexp always regenerates the buffer.
     ;; (find-efunction 'find-hde-links)
     ""
     ,(ee-template0 "\
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-sh \"dmesg | tail\")
mkdir /tmp/hde1/
mkdir /tmp/hde2/
sudo mount /dev/sdb1  /tmp/hde1/
sudo mount /dev/sdb2  /tmp/hde2/
# (find-fline \"/tmp/hde1/\")
# (find-fline \"/tmp/hde2/\")
# (find-fline \"/tmp/hde2{dir}\")
cd /tmp/hde2{dir}
du -c
cp -auv * {dir}
# (find-fline \"{dir}\")

cd
sudo umount /tmp/hde1/
sudo umount /tmp/hde2/
")
     )
   pos-spec-list))

;; Test: (find-hde-links)




;; «find-dn4tex-links»  (to ".find-dn4tex-links")
;; (find-angg ".emacs.templates" "find-dn4tex-links")


;; «find-euboutput»  (to ".find-euboutput")
;; (find-es "emacs" "display-table-latin-1")
;; (find-enode "Enabling Multibyte" "nothing precedes the colon")
;; (find-enode "Mode Line" "When multibyte" "CS does not appear")
;; (find-enode "Multibyte Conversion" "0200 through 0237")
;; (find-efunction 'find-eoutput)
;; (find-euboutput '(insert "«»"))
;; (find-eeoutput '(ee-set-latin-1) '(insert "«»"))
;; (find-eeoutput '(ee-set-unibyte) '(insert "«»"))
;;
(defun find-eeoutput (precode code &rest pos-spec-list)
  "Like `find-eoutput', but runs PRECODE before CODE."
  (find-escratchbuffer (or ee-buffer-name "*output*"))
  (eval precode)
  (eval code)
  (goto-char (point-min))
  (apply 'ee-goto-position pos-spec-list))

(defun ee-set-unibyte ()
  (interactive)
  (set-buffer-multibyte nil)
  (set-buffer-file-coding-system 'raw-text))

(defun ee-set-latin-1 ()
  (interactive)
  (set-buffer-file-coding-system 'latin-1))

(defun find-euboutput (code &rest pos-spec-list)
  "Like `find-eoutput', but sets the buffer to unibyte."
  (apply 'find-eeoutput (ee-set-unibyte) code pos-spec-list))




(code-c-d "LATEX" "~/LATEX/" :anchor)
;; (find-code-c-d "LATEX" "~/LATEX/" :anchor :xdvi)


(defun eeinsert2 (pre post s e)
  (save-excursion (goto-char (max s e)) (insert post))
  (save-excursion (goto-char (min s e)) (insert pre)))

(defun vf (s e)
  (interactive "r")
  (eeinsert2
   "{\\myttchars\n\\footnotesize\n\\begin{verbatim}\n"
   "\\end{verbatim}\n}\n" s e))



;; Hacky fix, 2008may20:
;; (find-egrep "grep -nH -e crm $(find * -name '*.el')")
(defalias 'crm-select-current-element 'crm--select-current-element)
;; Note that `find-eface-links' calls that function indirectly.
;; (eek "M-h M-k M-h M-s")

;; Fix `tex-verbatim':
;;   (face-attribute 'font-lock-comment-face :family)
;;   (face-attribute 'tex-verbatim           :family)
;;   (find-eface-links    'font-lock-comment-face)
;;   (find-eface-links    'tex-verbatim)
;;   (find-efacedescr     'tex-verbatim)
;; Original: (set-face-foreground 'tex-verbatim nil)
;;           (set-face-attribute  'tex-verbatim nil :family "courier")
;; Changed:  (set-face-foreground 'tex-verbatim "burlywood1")
;;           (set-face-attribute  'tex-verbatim nil :family 'unspecified)
;;
;; Fix `region':
;;   (find-eface-links    'region)
;; Original: (set-face-background 'region "blue3")
;; Changed:  (set-face-background 'region "navyblue")
;;
(set-face-background 'region "navyblue")
(eval-after-load "tex-mode"
  '(progn
     (set-face-foreground 'tex-verbatim "burlywood1")
     (set-face-attribute  'tex-verbatim nil :family 'unspecified)))


;; «find-printindex»  (to ".find-printindex")
;; (find-printindex)
;; (find-angg "LUA/anchors.lua")
(defun find-printindex0 (&optional fname)
  (interactive)
  (find-sh0 (format
	     "lua51 ~/LUA/anchors.lua -i %s"
	     (or fname (buffer-file-name)))))
(defun find-printindex (&optional fname)
  (interactive)
  (find-sh (format
	    "lua51 ~/LUA/anchors.lua -i %s"
	    (or fname (buffer-file-name)))))

;; 2008may25:
;; run-hooks: Symbol's value as variable is void: ispell-local-dictionary-alist
(setq ispell-local-dictionary-alist nil)
;; <f10> e t r
;; (find-egrep "grep -nH -e 'Remove Text Properties' $(find * -name '*.el')")
;; (find-efile "facemenu.el" "Remove Text Properties")
(defalias 'etr 'facemenu-remove-all)
(defalias 'ma 'eev-math-glyphs-edrx)
(defalias 'mar 'eev-math-glyphs-reset)


;; «find-fontset-links»  (to ".find-fontset-links")
;; (find-es "emacs" "find-fontset-links")
;;
(defun find-fontset-links (&rest rest)
  (interactive)
  (apply 'find-es "emacs" "find-fontset-links" rest))


;; «ee-font-unalias»  (to ".ee-font-unalias")
;; (find-es "emacs" "ee-font-unalias")
;; (find-sh0 "xlsfonts -ll -fn 7x13")
;; (find-sh0 "xlsfonts -ll -fn 7x13 | grep ' FONT ' | cut -b29- | tr A-Z a-z")
;; (find-sh "xlsfonts -ll -fn -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-1")
;; (find-sh "xlsfonts -ll -fn foo")
;; (ee-font-unalias-x "foo")
;; (ee-font-unalias-x "7x13")
;; (ee-font-unalias-x (ee-font-unalias-x "7x13"))
;; (ee-font-unalias (ee-font-unalias-x "7x13"))
;; (ee-font-unalias (ee-font-unalias-x "7x13") t)
;;
(defun ee-font-unalias-x (fontname)
  (find-sh0 (format
	     "xlsfonts -ll -fn '%s' | grep ' FONT ' | head -n 1 | cut -b29- | tr A-Z a-z"
	     fontname)))

(defun ee-font-unalias (fontname &optional use-ucs)
  (setq fontname (ee-font-unalias-x fontname))
  (if use-ucs (replace-regexp-in-string
	       "iso8859" "iso10646"
	       fontname)
    fontname))

;; «ee-set-frame-font»  (to ".ee-set-frame-font")
;; (find-es "emacs" "ee-set-frame-font")
(defun ee-set-frame-font (fontname &optional use-ucs)
  "Like `set-frame-font', but uses `ee-font-unalias' to expand FONTNAME."
  (set-frame-font (ee-font-unalias fontname use-ucs)))

;; Tests:
;; (ee-font-unalias "fixed")
;; (ee-font-unalias "fixed" t)
;; (set-frame-font "-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1")
;; (ee-set-frame-font "5x7" t)
;; (ee-set-frame-font "6x10" t)
;; (ee-set-frame-font "6x13" t)
;; (ee-set-frame-font "fixed" t)
;; (ee-set-frame-font "9x15" t)
;; (ee-set-frame-font "10x20" t)
;; (find-eoutput '(ee-insert '(32 126) "\n" '(913 981) "\n" '(8592 9675)))



;; «:dvi»  (to ".:dvi")

;; (find-eevfile "eev.el" "defvar code-c-d-keywords-new")
' (add-to-alist 'code-c-d-keywords-new '(:dvi  . ee-code-c-d-:dvi))
' (defun ee-code-c-d-:dvi (&rest rest)
    (concat (ee-template0 "
   (defun find-{c}dvi (fname &rest rest)
     (apply 'find-dvipage (ee-{c}file fname) rest))
   ") (ee-code-c-d-rest rest)))
' (code-c-d "LATEX" "~/LATEX/" :anchor :dvi)
(code-c-d "LATEX" "~/LATEX/" :anchor)

;; (find-sh "cd ~/LATEX/; ls *.tex")

;; «find-LTX»  (to ".find-LTX")
;; (find-TH "math-b" "seminars-2007")
;; (find-LTX "2007dnc-sets")
;; (find-blogme3 "angglisp.lua" "find-LTX")
(defun find-LTX (stem)
  (if ee-arg
      (find-LATEX (format "%s.tex" stem))
    (find-LATEXdvi (format "%s.dvi" stem))))


;; «find-testfont»  (to ".find-testfont")
;; (find-es "tex" "testfont.tex")
(defun eetestfont0 (s &optional e)
  "Write HEADER+(ee-se-to-string S E)+\"\\bye\" to /tmp/eetestfont.tex."
  (interactive "r")
  (ee-write-with-nl s e "\\let\\noinit!
\\input testfont
\\def\\t#1{\\def\\fontname{#1}\\startfont\\table}
\\def\\T#1{\\def\\fontname{#1}\\startfont\\table\\vfill\\break}
\\def\\newpage{\\vfill\\break}\n"
    "\\bye\n"
    "/tmp/eetestfont.tex"))

(defun find-testfont (texcmds &rest rest)
  "Run `eetestfont0' on TEXCMDS, then run TeX and xdvi on /tmp/eetestfont.*"
  (eetestfont0 texcmds)
  (prog1 (find-sh0 "cd /tmp/ && tex eetestfont.tex")
    (apply 'find-dvipage "/tmp/eetestfont.dvi" rest)))

;; «find-dvifonts»  (to ".find-dvifonts")
;; (find-angg ".zshrc" "dvifonts")
(defun ee-dvifonts-command (fname)
  (format "dvitype -output-level=1 '%s' | grep fntdef | cut -d' ' -f 4-"
	  (ee-expand fname)))
(defun find-dvifonts (fname &rest rest)
  (apply 'find-sh (ee-dvifonts-command fname) rest))
(defun find-dvifonts0 (fname &rest rest)
  (apply 'find-sh (ee-dvifonts-command fname) rest))

;; Tests:
;; (find-testfont "\\T{bbm10}\\T{bbold10}")
;; (find-dvifonts "/tmp/eetestfont.dvi")


;; «ee-env-normalize»  (to ".ee-env-normalize")
;; (string-match "=" "foo=bar")
;; (substring "foo=bar" 0 3)
;; (substring "foo=bar" 4)
;; (ee-env-expand1 "foo=$EE=bar")
;; (ee-env-normalize '("FOO=BAR" ("plic" "ploc") "BLETCH=QUX"))
;; (ee-env-normalize   "FOO=BAR")
;;
(defun ee-env-expand1 (pair)
  (let ((where (string-match "=" pair)))
    (if where
	(let ((var (substring pair 0 where))
	      (exp (substring pair (1+ where))))
	  (format "%s=%s" var (ee-expand exp)))
      pair)))

(defun ee-env-normalize1-ne (pair)
  (if (stringp pair) pair (format "%s=%s" (car pair) (or (cadr pair) ""))))

(defun ee-env-normalize-ne (pairs)
  (if (stringp pairs) (list pairs) (mapcar 'ee-env-normalize1-ne pairs)))

(defun ee-env-normalize (pairs)
  (mapcar 'ee-env-expand1 (ee-env-normalize-ne pairs)))

;; «ee-with-env»  (to ".ee-with-env")
;; (find-efunction 'with-current-buffer)
;; (find-elnode "Expansion")
;;                                             (find-sh0 "echo $FOO")
;; (ee-with-env          "FOO=bar"             (find-sh0 "echo $FOO"))
;; (ee-with-env        '("FOO=bar")            (find-sh0 "echo $FOO"))
;; (ee-with-env        '("FOO=bar" "FOO=plic") (find-sh0 "echo $FOO"))
;; (ee-with-env '("FOO=" "FOO=bar" "FOO=plic") (find-sh0 "echo $FOO"))
;; (ee-with-env '("FOO"  "FOO=bar" "FOO=plic") (find-sh0 "echo $FOO"))
;;
(defmacro ee-with-env (envchanges &rest body)
  `(let ((process-environment
	  (append (ee-env-normalize ,envchanges)
		  process-environment)))
     ,@body))



;; From:
;; http://steve.yegge.googlepages.com/my-dot-emacs-file
(defun swap-windows ()
  "If you have 2 windows, it swaps them."
  (interactive)
  (cond ((not (= (count-windows) 2))
	 (message "You need exactly 2 windows to do this."))
	(t (let* ((w1 (first (window-list)))
		  (w2 (second (window-list)))
		  (b1 (window-buffer w1))
		  (b2 (window-buffer w2))
		  (s1 (window-start w1))
		  (s2 (window-start w2)))
	     (set-window-buffer w1 b2)
	     (set-window-buffer w2 b1)
	     (set-window-start w1 s2)
	     (set-window-start w2 s1)))))


;; «eepitch-makeinfo»  (to ".eepitch-makeinfo")
;; (find-es "texinfo" "texinfo-deb-src")
;; (find-fline "$MAKEINFODIR")
(code-c-d "texinfo" "~/usrc/texinfo/texinfo-4.11.dfsg.1/")
(setenv "MAKEINFODIR" (ee-texinfofile "makeinfo"))

(defun eepitch-gdb-makeinfo ()
  (eepitch-gdb "*gud-makeinfo*" "gdb --annotate=3 $MAKEINFODIR/makeinfo"))
(defun eepitch-gdb-makeinfo-kill ()
  (eepitch-gdb-kill "*gud-makeinfo*"))


;; «tmpdn4»  (to ".tmpdn4")
;; (find-dn4 "Makefile" "tmpdir")
(code-c-d "tmpdn4"  "/tmp/dn4/" :anchor)
(code-c-d "tmpdn4d" "/tmp/dn4/demos/")


;; «luatex»  (to ".luatex")
;; (find-es "luatex" "luatex")
;; http://www.luatex.org/svn/trunk/manual/luatexref-t.pdf
(code-xpdf      "luatexref" "/usr/share/doc/luatex/luatexref-t.pdf")
(code-pdftotext "luatexref" "/usr/share/doc/luatex/luatexref-t.pdf" 4)
;; (find-luatexrefpage        5  "Contents")
;; (find-luatexrefpage       10  "tex.print")
;; (find-luatexrefpage (+ 4  11) "Introduction")
;; (find-luatexrefpage (+ 4  76) "The mplib library")
;; (find-luatexreftext (+ 4  76) "The mplib library")
;; (find-luatexrefpage (+ 4  83) "The node library")
;; (find-luatexrefpage (+ 4 105) "Print functions")
;; (find-luatexrefpage (+ 4 115) "The texio library")
;; (find-luatexreftext "")

;; «luatex-src» (to ".luatex-src")
;; (find-es "luatex" "luatex-upstream")
(code-c-d "luatexsrc"   "~/bigsrc/luatex-beta-0.79.1/")
(code-c-d "luatexsrclt" "~/bigsrc/luatex-beta-0.79.1/source/texk/web2c/luatexdir/tex/")
(code-c-d "luatexweb2c" "~/bigsrc/luatex-beta-0.79.1/build/texk/web2c/")
(setenv "NEWLUATEXDIR" "/home/edrx/bigsrc/luatex-beta-0.79.1/build/texk/web2c")
;; (find-luatexsrcfile "")
;; (find-luatexweb2cfile "")

;; «luacode» (to ".luacode")
;; (find-fline "/usr/share/doc/texlive-luatex/lualatex/luacode/")
(code-xpdf     "luacode" "/usr/share/doc/texlive-luatex/lualatex/luacode/luacode.pdf")
(code-pdf-text "luacode" "/usr/share/doc/texlive-luatex/lualatex/luacode/luacode.pdf")
;; (find-luacodepage)
;; (find-luacodetext)

(defun eepitch-luatex () (interactive)
  (eepitch-comint-at "/tmp/" "luatex" "luatex"))
(defun eepitch-lualatex () (interactive)
  (eepitch-comint-at "/tmp/" "lualatex" "lualatex"))

(defun eeluatex (s &optional e)
  (interactive "r")
  (ee-write s e
	    "\\documentclass{article}\n\\begin{document}\n"
	    "\n\\end{document}" "$EEVTMPDIR/ee.tex")
  (find-sh "cd $EEVTMPDIR/ && lualatex ee.tex"))

(defun eeluatex-view () (find-xpdf-page "$EEVTMPDIR/ee.pdf"))

;; (find-code-bounded 'eeluatex-bounded 'eeluatex 'ee-delimiter-percent)
        (code-bounded 'eeluatex-bounded 'eeluatex 'ee-delimiter-percent)




;; «ee-replace-regexp»  (to ".ee-replace-regexp")
;; (find-efunctiondescr 'replace-regexp "re-search-forward")
;; (find-efunctiondescr 're-search-forward)
;; (find-efunctiondescr 'replace-match)
;; (find-efunction 'query-replace-compile-replacement)
;; (query-replace-compile-replacement "\\1\\,\"foo\"\\2" t)
(defun ee-replace-regexp (from to)
  (if (re-search-forward from nil t)
      (replace-match to 'fixed-case nil)))


(seen 10780)


;; (find-eev "eev-sshot.el")
;; (find-eevfile "eev-sshot.el" "This is how I produced")
;; (ee-demo-eesteps)
;; (find-evariable 'initial-scratch-message)
;; (find-egrep "grep -nH -e initial-scratch-message *.el")
(defun ee-demo-eesteps () (interactive)
  (eesteps
   '((find-efunctiondescr 'eesteps)
     (search-forward ")))")
     (message "Next key:  M-e")
     )))

;; (require 'eev-sshot)
;; (find-zsh0 "rmmkdircd /tmp/sshot/ && tar -xvzf $S/http/angg.twu.net/flipbooks/eesteps.tgz")
;; (find-sshot "/tmp/sshot/eesteps" 1)


;; «ee-demo-4»  (to ".ee-demo-4")
;; (find-eevexfile "demos.e" ";; End of demo 4")
(defun ee-demo-4 () (interactive)
  (eesteps
   '((find-enode "Lisp Eval")
     (search-forward "`defvar'")
     (eekvr "C-SPC C-SPC 8*<left>")
     (eekv "M-w       ;;; kill-ring-save")
     (eekv "M-h M-i   ;;; find-einfo-links")
     (search-forward "find-enode")
     (eekv "M-h M-2   ;;; eemklinks-duplicate-this-line")
     (eekv "M-h M-y   ;;; eemklinks-yank-pos-spec")
     "C-a"
     (eekvr "C-SPC C-SPC <down>")
     (eekv "M-w       ;;; kill-ring-save")
     (eekv "C-x b TEMP")
     (eekv "C-y       ;;; yank")
     (message "Next key:  M-e")
     "M-e"
     (eekv "q         ;;; Info-exit")
     (eekv "C-x k TEMP")
     (eekv "M-K       ;;; bury-buffer")
     )))



;; (define-key eev-mode-map (kbd "M-h M-e")
;;   (lambda () (interactive) (find-efunctiondescr 'eev-mode)))


;; «coq»  (to ".coq")
;; (find-es "coq" "coq-deb-src")
(code-c-d "coq" "~/usrc/coq/coq-8.1.pl3+dfsg/")
(defun eepitch-coqtop () (interactive) (eepitch-comint "coqtop" "coqtop"))

;; http://coq.inria.fr/V8.1/
;; http://coq.inria.fr/V8.1/tutorial.html
(code-c-d "coqv81" "$S/http/coq.inria.fr/V8.1/")

(code-xpdf      "coqref" "/usr/share/doc/coq-doc-pdf/Reference-Manual.pdf")
(code-pdftotext "coqref" "/usr/share/doc/coq-doc-pdf/Reference-Manual.pdf")
;; (find-coqrefpage  13 "Contents")
;; (find-coqrefpage  47 "Record types")
;; (find-coqrefpage 333 "Global Index")
;; (find-coqrefpage 341 "Tactics Index")

(code-c-d "coqref"    "/usr/share/doc/coq-doc-html/refman/")
(code-c-d "coqlibdoc" "/usr/share/doc/coq-libs/html/")
;; (find-coqreffile "")
;; (find-coqrefw3m "command-index.html")
;; (find-coqrefw3m "general-index.html")
;; (find-coqrefw3m "tactic-index.html")
;; (find-coqrefw3m "toc.html")

;; http://cel.archives-ouvertes.fr/docs/00/33/44/28/PDF/coq-hurry.pdf
(code-xpdf      "coqhurry" "$S/http/cel.archives-ouvertes.fr/docs/00/33/44/28/PDF/coq-hurry.pdf")
(code-pdftotext "coqhurry" "$S/http/cel.archives-ouvertes.fr/docs/00/33/44/28/PDF/coq-hurry.pdf")
;; (find-coqhurrypage 1)
;; (find-coqhurrytext)

;; (find-coqrefw3m "Reference-Manual016.html" "The Coq Emacs mode")
;; (find-coqlibdocfile "")

(code-c-d       "coqtut"  "/usr/share/doc/coq-doc-html/Tutorial.v.html")
(code-c-d       "coqtut1" "/usr/share/doc/coq-doc-html/Tutorial.v.html")
(code-c-d       "coqtut2" "/usr/share/doc/coq-doc-html/Tutorial.v.html")
(code-c-d       "coqtut3" "/usr/share/doc/coq-doc-html/Tutorial.v.html")
(code-xpdf      "coqtut"  "/usr/share/doc/coq-doc-pdf/Tutorial.v.pdf")
(code-pdftotext "coqtut"  "/usr/share/doc/coq-doc-pdf/Tutorial.v.pdf")
;; (find-coqtutw3m "")
;; (find-coqtut1w3m "#htoc3")
;; (find-coqtutpage 1)
;; (find-coqtuttext)

(code-c-d       "coqrectut" "/usr/share/doc/coq-doc-html/RecTutorial.v.html")
(code-xpdf      "coqrectut" "/usr/share/doc/coq-doc-pdf/RecTutorial.v.pdf")
(code-pdftotext "coqrectut" "/usr/share/doc/coq-doc-pdf/RecTutorial.v.pdf")
;; (find-coqrectutw3m "")
;; (find-coqrectutw3m "#htoc3")
;; (find-coqrectutpage 1)
;; (find-coqrectuttext)

;; (find-es "coq" "coq-art")
(code-c-d "coqart" "~/usrc/CoqArtExos81/")
;; (find-coqartfile "")
;; (find-coqartw3m "contents.html")




;; Moved to:
;; (find-eev "eev-browse-url.el" "find-psne-links")
;; «find-psne-links»  (to ".find-psne-links")
;; «brep»             (to ".brep")
;;
;; «ee-cp»      (to ".ee-cp")
;; «find-ecp0»  (to ".find-ecp0")
(defalias 'find-ecp0 'ee-cp)


;; 2008aug31
;; http://lists.gnu.org/archive/html/eev/2008-08/msg00001.html


;; 2012jun05
;; Tests:
;; (find-estring (ee-find-psne-links "http://foo/bar"))
;;                  (find-psne-links "http://foo/bar")
;; See: (find-eev "eev-browse-url.el" "conversion-functions")
;;
;; 2012dec25: moved to:
;;   (find-eev "eev-tlinks.el" "find-psne-links")
;;   (find-eevfile "eev-brxxx.el" "brep")
;;                     


;; «std-to-dnc»  (to ".std-to-dnc")
;; «dnc-to-std»  (to ".dnc-to-std")

(defun std-to-dnc ()
  (interactive)
  (fooi ">->" "`->" "|->" "=>" "<-|" "<=" "->" "|->" "<-" "<-|"))

(defun dnc-to-std ()
  (interactive)
  (fooi "`->" ">->" "|->" "->" "<-|" "<-" "=>" "|->" "<=" "<-|"))


;; «dn4-block»  (to ".dn4-block")
;; (to "eedn4a")
(defun dn4-block ()
  (interactive)
  (insert "\n%*
% (eedn4a-bounded)
% (find-sh0 \"cd ~/LATEX/ && dvips  -D 600 -P pk -o tmp.ps tmp.dvi\")
% (find-sh0 \"cd ~/LATEX/ && dvired -D 600 -P pk -o tmp.ps tmp.dvi\")
% (find-pspage \"~/LATEX/tmp.ps\")

%*
"))

(code-xpdf "oficiotcu" "~/tmp/processo/Oficio_TCU.pdf")
;; (find-oficiotcupage 2)


;; «save-this-block-as»  (to ".save-this-block-as")
;; «anchors-in-latin-1»  (to ".anchors-in-latin-1")
;; (find-evariable 'ee-delimiter-semicolon)
;; (find-es "emacs" "anchors-in-latin-1")
;; http://lists.gnu.org/archive/html/bug-gnu-emacs/2008-10/msg00830.html
;; (find-fline "/tmp/1.txt")
;; (find-fline "/tmp/2.txt")
;; (find-fline "/tmp/3.txt")
(setq ee-delimiter-semisnip "\n;;--------snip,snip--------\n")
;; (eeb-define 'eeb-string 'ee-se-to-string ee-delimiter-semisnip nil t t)
(defun save-this-block-as (fname) (eev (ee-once (eeb-string)) nil fname))


;; (find-efunction 'find-callprocess0)
;; (find-efunction 'find-eoutput-reuse)
;; (find-eevgrep "grep -nH -e callprocess *.el")
;; (find-eev "eev-plinks.el" "find-callprocess")
;;
(defun find-unrarl (fname &rest pos-spec-list)
  (apply 'find-callprocess `("unrar" "l" ,fname) pos-spec-list))

(code-brfile 'find-unrarl
             :local 'brunrarll :dired 'brunrarld)

(seen 11000)

;; (find-unrarl "~/books/new/Tractatus.rar")

;; (find-efunction 'ee-delete-and-extract-line)
;; This works on lines in which the first words is the code
;; and the second one is the fname.
(defun wrap-book ()
  (interactive)
  (let* ((pair (ee-split (ee-no-properties (ee-delete-and-extract-line))))
	 (code  (car pair))
	 (fname (cadr pair))
	 (ext (file-name-extension fname))
	 (code-c-d (if (equal ext "djvu")
		       `(code-djvu ,code ,fname)
		     `(code-xpdf ,code ,fname)))
	 (code-ptt `(code-pdftotext ,code ,fname))
	 (find-1 (format "(find-%spage      1  \"Contents\")" code))
	 (find-2 (format "(find-%spage (+ 1 1) \"Index\")" code))
	 (find-t (format "(find-%stext \"\")" code))
	 (str (format "%S\n%S\n;; %s\n;; %s\n;; %s" code-c-d code-ptt find-1 find-2 find-t))
	 )
    (insert str)
    (ee-next-line)))

(define-key eev-mode-map "\M-U" 'wrap-book)

(defun totext ()
  (interactive)
  "A quick hack to add a link to the text version of a wrap-book-ed sexp"
  (end-of-line)
  (let* ((sexp (read (eek-last-sexp)))
	 (cmd (car sexp))
	 (newcmd (cond ((eq cmd 'code-djvu) 'code-djvutotext)
		       ((eq cmd 'code-xpdf) 'code-pdftotext)
		       (t 'error)))
	 (newsexp (cons newcmd (cdr sexp))))
    (insert (format "\n%S\n;; (find-%stext \"\")\n" newsexp (cadr sexp)))))

;; (define-key eev-mode-map "\M-W" 'totext)

(code-c-d "books" "~/books/" :anchor)
;; (find-books "__cats/README.el")

(defvar books-subdir "__logic")

(defun find-mvbooks-links (&optional code fname &rest rest)
  "Visit a temporary buffer containing hyperlinks for moving a downloaded book."
  (interactive)
  (setq code (or code "_"))
  (setq fname (or fname (file-name-nondirectory
			 (eeurl-dired-file-name-at-point))))
  (apply 'find-elinks `(
    ;; Convention: the first sexp always regenerates the buffer.
    (find-mvbooks-links ,code ,fname ,@rest)
    ;; Body:
    ""
    ,(ee-template `(("_" ,code)
                    ("title.pdf" ,fname)
                    ("__logic" ,books-subdir)) "\
# (find-books-links \"{title.pdf}\")
# (setq books-subdir \"{__logic}\")
# (find-fline \"~/books/{__logic}/\")
# (find-sh0 \"mv -iv /tmp/{title.pdf} ~/books/{__logic}/\")

# (find-fline \"~/books/{__logic}/{__logic}.el\")
{_} ~/books/{__logic}/{title.pdf}")
    ) rest))

(defalias 'mvbookd 'find-mvbooks-links)


;; «hjbc1»  (to ".hjbc1")
;; (find-THfile "2009.1-C1.blogme")
;; http://www.professores.uff.br/hjbortol/disciplinas/2008.2/gma00108/
(code-c-d "hjbc1" "$S/http/www.professores.uff.br/hjbortol/disciplinas/2008.2/gma00108/")
;; (find-hjbc1file "")
;; (find-hjbc1file "listas/gma00108-lista-01.pdf")
(code-xpdf "hjbc1lista01" (ee-hjbc1file "listas/gma00108-lista-01.pdf"))
(code-xpdf "hjbc1lista02" (ee-hjbc1file "listas/gma00108-lista-02.pdf"))
(code-xpdf "hjbc1lista03" (ee-hjbc1file "listas/gma00108-lista-03.pdf"))
(code-xpdf "hjbc1lista04" (ee-hjbc1file "listas/gma00108-lista-04.pdf"))
(code-xpdf "hjbc1lista05" (ee-hjbc1file "listas/gma00108-lista-05.pdf"))
(code-xpdf "hjbc1lista06" (ee-hjbc1file "listas/gma00108-lista-06.pdf"))
(code-xpdf "hjbc1lista07" (ee-hjbc1file "listas/gma00108-lista-07.pdf"))
(code-xpdf "hjbc1lista08" (ee-hjbc1file "listas/gma00108-lista-08.pdf"))
(code-xpdf "hjbc1lista09" (ee-hjbc1file "listas/gma00108-lista-09.pdf"))
(code-xpdf "hjbc1lista10" (ee-hjbc1file "listas/gma00108-lista-10.pdf"))
(code-xpdf "hjbc1lista11" (ee-hjbc1file "listas/gma00108-lista-11.pdf"))
(code-xpdf "hjbc1lista12" (ee-hjbc1file "listas/gma00108-lista-12.pdf"))
(code-xpdf "hjbc1lista13" (ee-hjbc1file "listas/gma00108-lista-13.pdf"))
(code-xpdf "hjbc1lista14" (ee-hjbc1file "listas/gma00108-lista-14.pdf"))
(code-xpdf "hjbc1lista15" (ee-hjbc1file "listas/gma00108-lista-15.pdf"))
(code-xpdf "hjbc1lista16" (ee-hjbc1file "listas/gma00108-lista-16.pdf"))
(code-xpdf "hjbc1lista17" (ee-hjbc1file "listas/gma00108-lista-17.pdf"))
(code-xpdf "hjbc1lista18" (ee-hjbc1file "listas/gma00108-lista-18.pdf"))
(code-xpdf "hjbc1lista19" (ee-hjbc1file "listas/gma00108-lista-19.pdf"))
;; (find-hjbc1lista01page 1)
;; (find-hjbc1lista02page 1)
;; (find-hjbc1lista03page 1)
;; (find-hjbc1lista04page 1)
;; (find-hjbc1lista05page 1)
;; (find-hjbc1lista06page 1)
;; (find-hjbc1lista07page 1)
;; (find-hjbc1lista08page 1)
;; (find-hjbc1lista09page 1)
;; (find-hjbc1lista10page 1)
;; (find-hjbc1lista11page 1)
;; (find-hjbc1lista12page 1)
;; (find-hjbc1lista13page 1)
;; (find-hjbc1lista14page 1)
;; (find-hjbc1lista15page 1)
;; (find-hjbc1lista16page 1)
;; (find-hjbc1lista17page 1)
;; (find-hjbc1lista18page 1)
;; (find-hjbc1lista19page 1)


;; «hjbc2»  (to ".hjbc2")
;; (find-THfile "2009.1-C2.blogme")
;; http://www.professores.uff.br/hjbortol/disciplinas/2007.1/gma06074/
;; http://www.professores.uff.br/hjbortol/disciplinas/2007.1/gma06074/listas/
(code-c-d "hjbc2" "$S/http/www.professores.uff.br/hjbortol/disciplinas/2007.1/gma06074/")
;; (find-hjbc2file "")
;; (find-hjbc2w3m "gma06074.cronograma.html")
;; (find-hjbc2w3m "gma06074.listas.html")
;; (find-hjbc2w3m "gma06074.news.html")
;; (find-hjbc2file "listas/")
;; (find-hjbc2file "listas/lista-00-2007-1.pdf")
(code-xpdf "hjbc2lista00" (ee-hjbc2file "listas/lista-00-2007-1.pdf"))
(code-xpdf "hjbc2lista01" (ee-hjbc2file "listas/lista-01-2007-1.pdf"))
(code-xpdf "hjbc2lista02" (ee-hjbc2file "listas/lista-02-2007-1.pdf"))
(code-xpdf "hjbc2lista03" (ee-hjbc2file "listas/lista-03-2007-1.pdf"))
(code-xpdf "hjbc2lista04" (ee-hjbc2file "listas/lista-04-2007-1.pdf"))
(code-xpdf "hjbc2lista05" (ee-hjbc2file "listas/lista-05-2007-1.pdf"))
(code-xpdf "hjbc2lista06" (ee-hjbc2file "listas/lista-06-2007-1.pdf"))
(code-xpdf "hjbc2lista07" (ee-hjbc2file "listas/lista-07-2007-1.pdf"))
(code-xpdf "hjbc2lista08" (ee-hjbc2file "listas/lista-08-2007-1.pdf"))
(code-xpdf "hjbc2lista09" (ee-hjbc2file "listas/lista-09-2007-1.pdf"))
(code-xpdf "hjbc2lista10" (ee-hjbc2file "listas/lista-10-2007-1.pdf"))
(code-xpdf "hjbc2lista11" (ee-hjbc2file "listas/lista-11-2007-1.pdf"))
(code-xpdf "hjbc2lista12" (ee-hjbc2file "listas/lista-12-2007-1.pdf"))
(code-xpdf "hjbc2lista13" (ee-hjbc2file "listas/lista-13-2007-1.pdf"))
(code-xpdf "hjbc2lista14" (ee-hjbc2file "listas/lista-14-2007-1.pdf"))
(code-xpdf "hjbc2lista15" (ee-hjbc2file "listas/lista-15-2007-1.pdf"))
(code-xpdf "hjbc2lista16" (ee-hjbc2file "listas/lista-16-2007-1.pdf"))
(code-xpdf "hjbc2lista17" (ee-hjbc2file "listas/lista-17-2007-1.pdf"))
(code-xpdf "hjbc2lista18" (ee-hjbc2file "listas/lista-18-2007-1.pdf"))
(code-xpdf "hjbc2lista19" (ee-hjbc2file "listas/lista-19-2007-1.pdf"))
;; (find-hjbc2lista01page 1)
;; (find-hjbc2lista02page 1)
;; (find-hjbc2lista03page 1)
;; (find-hjbc2lista04page 1)
;; (find-hjbc2lista05page 1 "integrais impróprias")
;; (find-hjbc2lista06page 1)
;; (find-hjbc2lista07page 1)
;; (find-hjbc2lista08page 1)
;; (find-hjbc2lista09page 1)
;; (find-hjbc2lista10page 1)
;; (find-hjbc2lista11page 1)
;; (find-hjbc2lista12page 1)
;; (find-hjbc2lista13page 1)
;; (find-hjbc2lista14page 1)
;; (find-hjbc2lista15page 1)
;; (find-hjbc2lista16page 1)
;; (find-hjbc2lista17page 1)
;; (find-hjbc2lista18page 1)
;; (find-hjbc2lista19page 1)




;; «hpprint»  (to ".hpprint")
;; (find-angg "bin/hpprint")
;;
(defun find-hpprint (fname &rest rest)
  (apply 'find-sh (format
		   "sudo chown edrx:edrx /dev/usb/lp0; cat %s > /dev/usb/lp0"
		   fname) rest))

(code-brfile 'find-hpprint
	     :local 'brhpprintl :dired 'brhpprintd)



(seen 11190)


;; 2009may22
;; (find-eevfile "eev-math-glyphs.el")
(defun lenny-ma () (interactive)
  "Make the math glyphs use ascii chars. This is a quick hack."
  (mapcar
   (lambda (p) (add-to-alist 'eev-math-glyphs-name-to-char
			     (cons (car p) (string-to-char (cadr p)))))
   (ee-chop3
    2 0
    '("Theta Pi Sigma Omega"
      "H     P  S     W    "
      "delta epsilon theta lambda nu pi rho sigma tau omega"
      "d     e       h     \\     n  p  r   s     t   w    "
      "top bot land lor supset forall exists"
      "T   F   &    v   >      A      E     "
      "box thin: in circ cap cup Int infty"
      "b   :     e  o    ^   v   I   8    "
      "oplus"
      "+    "))
   )
  (ma))


;; (find-fline "~/usrc/emacs-w3m/w3m-session.el" "w3m-session-load-crashed-sessions")
(setq w3m-session-load-crashed-sessions nil)




;; «eepitch-region»  (to ".eepitch-region")
;; (find-elongkey-links "<f8>")
;; (find-efunction 'eepitch-this-line)
;; (find-eevfile "eev.el" "define-key eev-mode-map [f8]")
;; (find-eevfile "eev.el" "define-key eev-mode-map [f8]")
;; (define-key eev-mode-map [f8]   'eepitch-this-line)
;; (define-key eev-mode-map [f8]   'eepitch-this-line-or-region)

(defun eepitch-trim (str)
  (setq str (replace-regexp-in-string "\n+$" "" str))
  (setq str (replace-regexp-in-string "^\n+" "" str))
  str)

(defun eepitch-region (s &optional e)
  (interactive "r")
  (setq deactivate-mark t)
  (let ((str (eepitch-trim (ee-se-to-string s e))))
    (eepitch-prepare-target-buffer)   ; Reconstruct the target buffer,
    (eepitch-display-target-buffer)   ; display it, make sure it's a
    (eepitch-not-this-buffer)	      ; different buffer, and pitch
    (eepitch-line str)))	      ; the trimmed str to the target.

;; (find-elnode "The Mark" "Function: use-region-p")
;; (find-elnode "The Mark" "deactivate-mark")
;; (find-elnode "The Mark" "User Option: mark-even-if-inactive")
;; (defun ee-use-region-p () (use-region-p))
(defun ee-use-region-p () (use-region-p))
;; (read-event "Key: " t)

(defun eepitch-this-line-or-region (s &optional e)
  (interactive "r")
  (if (use-region-p)
      (progn (eepitch-region s e)
	     (setq deactivate-mark t))
    (eepitch-this-line)))

(define-key eev-mode-map [f8]   'eepitch-this-line-or-region)
(define-key eev-mode-map [f8]   'eepitch-this-line)
(define-key eev-mode-map [S-f8] 'eepitch-region)



;; «perl»  (to ".perl")
;; (find-es "perl" "eepitch-perl")
(defun eepitch-perl () (interactive) (eepitch-comint "perl" "perl -d -e 42"))


;; «python»  (to ".python")
;; (find-es "python" "python-on-lenny")
;; (find-es "python" "python-on-squeeze")
(code-c-d "pyapi"  "/nopath"             "python2.5-api")
(code-c-d "pydist" "/nopath"             "python2.5-dist")
(code-c-d "pyext"  "/nopath"             "python2.5-ext")
(code-c-d "pylib"  "/usr/lib/python2.5/" "python2.5-lib")
(code-c-d "pyref"  "/nopath"             "python2.5-ref")
(code-c-d "pytut"  "/nopath"             "python2.5-tut")
(code-c-d "pyex"   "/usr/share/doc/python2.5/examples/")
(code-c-d "pyexd"  "/usr/share/doc/python2.5/examples/Demo/")

(code-c-d "pydocsrc"  "/usr/share/doc/python2.6/html/_sources/")
(code-c-d "pytut"     "/usr/share/doc/python2.6/html/_sources/tutorial/")
(code-c-d "pyhowto"   "/usr/share/doc/python2.6/html/_sources/howto/")
(code-c-d "pydocing"  "/usr/share/doc/python2.6/html/_sources/documenting/")
(code-c-d "pyusing"   "/usr/share/doc/python2.6/html/_sources/using/")
;; (find-pytutfile "")
;; (find-pydocingfile "")
;; (find-pyhowtofile "")
;; (find-pyhowtofile "functional.txt")
;; (find-pyusingfile "")

;; (find-pyapinode "")
;; (find-pydistnode "")
;; (find-pyextnode "")
;; (find-pylibnode "")
;; (find-pyrefnode "")
;; (find-pytutnode "")
;; (find-pytutnode "Python Scopes and Name Spaces")
;; (find-pyrefnode "standard type hierarchy" "`Classes'")

;;
;; (code-c-d "pyref" "" "python-ref")
;; (code-c-d "pylib" "/usr/lib/python1.5/" "python-lib")
;; (code-c-d "pyexd" "/usr/share/doc/python/examples/Demo/" "python-ref")
;; (code-c-d "pyext" "/usr/share/doc/python/examples/Tools/" "python-ref")

;; «ipython» (to ".ipython")
;; «pylab»   (to ".pylab")
;; (find-es "python" "ipython")
(defun eepitch-pylab () (interactive) (eepitch-comint "pylab" "ipython --pylab"))

;; «sympy» (to ".sympy")
;; (find-es "python" "sympy")
;; (find-es "sympy")
;; (find-es "sympy" "sympy-git")
(code-c-d "sympy"   "~/bigsrc/sympy/")
(code-c-d "sympyex" "/usr/share/doc/python-sympy/examples/")
(code-c-d "sympydocsrc" "$S/http/docs.sympy.org/0.7.2/_sources/")
(code-c-d "sympydocsrc" "~/bigsrc/sympy/doc/src/")
(code-c-d "sympytut"    "~/bigsrc/sympy/doc/src/tutorial/")
;; (find-sympyfile "")
;; (find-sympydocsrcfile "")
;; (find-sympydocsrcfile "tutorial/matrices.rst")
;; (find-sympytutfile "matrices.rst")
;;
;; (find-eev "eepitch.el" "eepitch-R")
(defun eepitch-isympy () (interactive) (eepitch-comint "isympy" "isympy"))
(defun eepitch-isympy () (interactive)
  (eepitch '(with-pager-cat (find-comintprocess "isympy" "isympy"))))







;; «maxima-cvs»  (to ".maxima-cvs")
;; (to "maxima")
;; (find-es "maxima")
(code-c-d "maximacvs" "~/usrc/maxima-cvs/"
	  :info "~/usrc/maxima-cvs/usr/share/info/maxima")
(defun eepitch-maximacvs () (interactive)
  (eepitch-comint "maximacvs" "~/usrc/maxima-cvs/usr/bin/maxima"))
;; (find-maximacvsfile "")
;; (find-maximacvsfile "usr/share/info/")
;; (find-maximacvssh "find usr | sort")
;; (find-maximacvsnode "")

;; (find-efunction 'ee-goto-position)
;; (find-elnode "Regexp Search")
;; (find-elnode "Regexp Backslash")
(defun ee-maxima-draw-node-re (word)
  (concat "^ -- [A-Za-z ]+: " word "\\>"))
(defun ee-maxima-draw-node-search (word)
  (if word (re-search-forward (ee-maxima-draw-node-re word))))
(defun find-maximanode-draw (&optional word &rest rest)
  (apply 'find-maximanode "Functions and Variables for draw"
	 "" `(ee-maxima-draw-node-search ,word) rest))

;; (find-maximanode "Functions and Variables for draw")
;; (find-maximanode-draw "title")
;; (find-maximanode-draw nil '(ee-write (point-min) (point-max) "" "" "/tmp/o"))
;; (find-fline "/tmp/o")
;; (find-sh "grep '^ --' /tmp/o")
;; (find-sh "grep '^ --' /tmp/o | awk '{print $4}'")
;; (find-sh "grep '^ --' /tmp/o | awk -F: '{print $2}' | awk '{print $1}'")
;; (find-sh "grep '^ --' /tmp/o | awk -F: '{print $2}' | awk '{print $1}' | sort | uniq")

;; «maxima-gpdraw»  (to ".maxima-gpdraw")
;; (find-es "maxima" "maxima-gpdraw")
;; http://www.telefonica.net/web2/biomates/maxima/gpdraw/index.html
;; http://www.telefonica.net/web2/biomates/maxima/gpdraw/
(code-c-d "maximagpdraw" "$S/http/www.telefonica.net/web2/biomates/maxima/gpdraw/")
;; (find-maximagpdrawfile "")
;; (find-maximagpdraww3m "index.html")
;; (find-maximagpdraww3m "implic/index.html")


(seen 11350)



;; «code-filetext»  (to ".code-filetext")
;; (find-eev "eev.el" "code-xpdf")
;;
(defun ee-code-filetext (code fname)
  (format "
    (defun find-%stext (&rest rest) (interactive)
      (apply 'find-fline %S rest))
  " code fname))
(defun code-filetext (c f) (eval (ee-read (ee-code-filetext c f))))
(defun find-code-filetext (c f) (find-estring-elisp (ee-code-filetext c f)))

;; «debian-devel-docs»  (to ".debian-devel-docs")
;; (find-es "debiandev" "debian-devel-docs")
;; http://www.debian.org/doc/packaging-manuals/debian-emacs-policy
(code-filetext "dpol"      "/usr/share/doc/debian-policy/policy.txt.gz")
(code-filetext "debref"    "/usr/share/doc/debian-reference-common/html/debian-reference.en.txt.gz")
(code-filetext "debdevref" "/usr/share/doc/developers-reference/developers-reference.txt.gz")
(code-filetext "docbase"   "/usr/share/doc/doc-base/doc-base.txt.gz")
(code-filetext "maintg"    "/usr/share/doc/maint-guide/maint-guide.en.txt.gz")
(code-filetext "debemacspol" "/usr/share/doc/emacsen-common/debian-emacs-policy.gz")
(code-filetext "apthowto"  "/usr/share/doc/Debian/apt-howto/apt-howto.en.txt.gz")
;; (find-dpoltext)
;; (find-debreftext)
;; (find-debdevreftext)
;; (find-docbasetext)
;; (find-maintgtext)
;; (find-debemacspoltext)
;; (find-apthowtotext)

;; (find-man "8 dh_make")
;; (find-man "8 dh_make" "debian-policy")
;; (find-dpolfile "")
;; (find-dpolgrep "zgrep -nH -e ompar *")
;; (find-dpolgrep "zgrep -nH -e ompare-v *")
;; (find-dpolgrep "zgrep -nH -e lexically *")
;; (find-dpolfile "policy.txt.gz" "<upstream_version>")
(code-c-d "dpol"   "/usr/share/doc/debian-policy/")
(code-c-d "maintg" "/usr/share/doc/maint-guide/")
(code-c-d "debref" "/usr/share/doc/Debian/reference/")


(setq debian-changelog-mailing-address "eduardoochs@gmail.com")

;; «vcaa»  (to ".vcaa")
;; (find-node "(coreutils)cp invocation" "`-u'")
(code-c-d "vcaa"  "/var/cache/apt/archives/")
(code-c-d "vcaab" "/var/cache/apt/archives/backup/")
;; (find-vcaafile "")
;; (find-vcaash0 "sudo mkdir backup; sudo chown edrx:edrx backup")
;; (find-vcaash0 "sudo cp -vul *.deb backup/")
;; (find-vcaabfile "")



;; «no-mouse-mode»  (to ".no-mouse-mode")
;; For laptops with touchpads - I keep hitting my thumbs on the
;; touchpad by accident, and this minor mode makes most of these
;; "accidental clicks" harmless.
;;
;; Notes:
;; To identify the event corresponding to mouse clicks:
;;   (defun foo (key) (interactive "k") (setq my-key key))
;; To sort of disable mouse events:
;;   (defun foo () (interactive) (message "Foo!"))
;;   (define-key eev-mode-map [down-mouse-1] 'foo)
;;   (define-key eev-mode-map [mouse-1] 'foo)
;; See:
;;   (find-eevfile "eev.el" "define-minor-mode eev-mode\n")
;;   (find-efile "mouse.el")
;;
;; Use also:
;;   (mouse-wheel-mode 0)
;;
(defun my-mouse-event (str)
  `(lambda () (interactive) (message ,str)))

(setq no-mouse-mode-map (make-sparse-keymap))
(define-key no-mouse-mode-map [down-mouse-1] (my-mouse-event "down-mouse-1"))
(define-key no-mouse-mode-map      [mouse-1] (my-mouse-event      "mouse-1"))
(define-minor-mode no-mouse-mode
  "The no-mouse-mode keymap just binds some mouse events to dummy events."
  :init-value nil :global t :lighter " no-mouse")

;; (no-mouse-mode 1)
;; (no-mouse-mode 0)



;; «openoffice»  (to ".openoffice")
;;
(defun find-oowriter (fname)
  (interactive "fOpen with oowriter: ")
  (find-bgprocess `("oowriter" ,fname)))
(defun find-oocalc (fname)
  (interactive "fOpen with oocalc: ")
  (find-bgprocess `("oocalc" ,fname)))

;; LibreOffice:
(defun find-oowriter (fname)
  (interactive "fOpen with lowriter: ")
  (find-bgprocess `("lowriter" ,fname)))
(defun find-oocalc (fname)
  (interactive "fOpen with localc: ")
  (find-bgprocess `("localc" ,fname)))

(code-brfile 'find-oowriter
             :local 'broowl :dired 'broowd)
(code-brfile 'find-oocalc
             :local 'broocl :dired 'broocd)




;; (find-fline "/sda7/nikon/")

(defun find-avidemux (fname &rest pos-spec-list)
  (apply 'find-bgprocess `("avidemux" ,fname) pos-spec-list))
(defun find-totem (fname &rest pos-spec-list)
  (apply 'find-bgprocess `("totem" ,fname) pos-spec-list))
(defun find-vlc (fname &rest pos-spec-list)
  (apply 'find-bgprocess `("vlc" ,fname) pos-spec-list))

(code-brfile 'find-avidemux
             :local 'bravl :dired 'bravd)
(code-brfile 'find-totem
             :local 'brtoteml :dired 'brtotemd)
(code-brfile 'find-vlc
             :local 'brvlcl :dired 'brvlcd)
(code-brfile 'find-mplayer
             :local 'brmplayerl :dired 'brmplayerd)




;; «mm:ss»  (to ".mm:ss")
;; (find-eev "eev-template.el" "secs-to-mm:ss")
;; Examples:
;; (mm:ss-to-secs "3:20")
;; (mm:ss-to-secs  200)
;; (secs-to-mm:ss "3:20")
;; (secs-to-mm:ss  200)

;; «find-mplayer»  (to ".find-mplayer")
;; (find-eev "eev-template.el" "find-mplayer")
;; (find-angg "VIDEOS/Makefile")
;; (find-es "video" "mplayer")
;; (find-es "math" "catsters")
;; (find-efunction 'find-firefox)
;; (find-efunction 'find-bgprocess)
;; (find-es "dvd" "mplayer-subtitles")
;; (find-man "1 mplayer" "-ss <time>" "Seek to given time position")
;; (find-man "1 mplayer" "onscreen display (OSD)")
;; (find-man "1 mplayer" "keyboard control" "o" "Toggle OSD states:")
;; (find-man "1 mplayer" "keyboard control" "<- and ->" "Seek backward/forward 10 seconds")
;; (find-man "1 mplayer" "keyboard control" "f" "Toggle fullscreen")

;; «code-mplayer»  (to ".code-mplayer")
;; «code-Mplayer»  (to ".code-Mplayer")
;; (find-eev "eev-template.el" "code-mplayer")
;; (find-efunction 'code-xpdf)

;; Renamed and moved to:
;;   (find-eev "eev-audiovideo.el")

;; (defun find-Mplayer (fname &optional pos &rest rest)
;;   (interactive "sFile name: ")
;;   (find-bgprocess
;;    `("xterm" "-geometry" "+200+100" "-e"
;;      "mplayer" ,fname
;;      ,@(if pos `("-ss" ,(secs-to-mm:ss pos)))
;;      )))
;; 
;; (defun ee-code-Mplayer (code fname)
;;   (format "
;;     (defun find-%s (&rest rest) (interactive)
;;       (apply 'find-Mplayer %S rest))
;;   " code fname))
;; (defun code-Mplayer      (c f) (eval (ee-read (ee-code-Mplayer c f))))
;; (defun find-code-Mplayer (c f) (find-estring-elisp (ee-code-Mplayer c f)))


;; «ict-quimica»  (to ".ict-quimica")
;; Moved to: (find-angg ".emacs.audios" "ict-quimica")
;; (find-fline "~/PURO/2011dec13-ict/")


;; «find-minicatsvideo»  (to ".find-minicatsvideo")
(defun find-minicatsvideo (subdir stem &optional pos &rest rest)
  (find-mplayer (format "/sda7/nikon/%s%s.flv" subdir stem) pos))
(defun find-minicatsvideo (subdir stem &optional pos &rest rest)
  (find-mplayer (format "/sda6/nikon/%s%s.avi" subdir stem) pos))


;; Examples:
;; (find-dirfile     "$EEVDIR/eepitch.el")
;; (find-dirfile (ee-eevfile "eepitch.el"))
;;
(defun find-dirfile (fullpath)
  (find-fline (file-name-directory    fullpath)
	      (file-name-nondirectory fullpath)))

;; «find-minicatsframe»  (to ".find-minicatsframe")
;; Examples:
;;               (ee-minicatsvideofile 1 145)
;; (find-dirfile (ee-minicatsvideofile 1 145))
;;               (ee-minicatsframefile 1 145)
;;               (ee-minicatsframefile 1 145 "2:00")
;; (find-dirfile (ee-minicatsframefile 1 145 "2:00"))
;; (find-mplayer (ee-minicatsvideofile 1 144))
;; (find-minicatsvideo 1 145)
;; (find-minicatsvideo 1 145 "2:00")
;; (find-minicatsframe 1 145 "2:00")
;;
(defun ee-minicatsvideofile (aula dscn)
  (format "/sda6/nikon/aula_%d/DSC_%04d.avi" aula dscn))
(defun ee-minicatsframefile (aula dscn &optional pos)
  (format "/sda6/nikon/aula_%d/DSC_%04d_frames/DSC_%04d_%03d.jpg"
	  aula dscn dscn
	  (+ 1 (/ (mm:ss-to-secs (or pos 0)) 20))))

(defun find-minicatsvideofile (aula dscn &optional pos &rest rest)
  (find-dirfile (ee-minicatsvideofile aula dscn)))
(defun find-minicatsframefile (aula dscn &optional pos &rest rest)
  (find-dirfile (ee-minicatsframefile aula dscn pos)))

(defun find-minicatsvideo     (aula dscn &optional pos &rest rest)
  (find-mplayer (ee-minicatsvideofile aula dscn) pos))
(defun find-minicatsframe     (aula dscn &optional pos &rest rest)
  (find-fline   (ee-minicatsframefile aula dscn pos)))


;; (find-minicatsvideofile 1 145 "3:40" "Functions, explicitly")
;; (find-minicatsframefile 1 145 "3:40" "Functions, explicitly")
;; (find-minicatsvideo 1 145 "3:40" "Functions, explicitly")
;; (find-minicatsframe 1 145 "3:40" "Functions, explicitly")
;; (find-minicatsvideo 1 145 "3:40" "Functions are sets")
;; (find-minicatsframe 1 145 "3:40" "Functions are sets")
;; (find-minicatsvideo 1 145 "5:48" "Preamble to Cats")
;; (find-minicatsframe 1 145 "5:48" "Preamble to Cats")





;; (find-fline   "~/CATSTERS/")
;; (find-mplayer "~/CATSTERS/Representables+and+Yoneda+2.mp4")
;; (find-mplayer "~/CATSTERS/Representables+and+Yoneda+2.mp4" "1:10")
;; (find-code-mplayer "catsters-repyoneda4" "~/CATSTERS/Representables+and+Yoneda+2.mp4")
;; (find-es "math" "catsters")

;; (find-angg "bin/gsub.lua")
;; (find-sh "cd ~/CATSTERS/ && ls | gsub.lua '' '(code-mplayer \"catsters-\" \"~/CATSTERS/%1\")'")
;; (find-sh "cat ~/.emacs | gsub.lua '^%(code%-mplayer \"catsters%-([^\"]+)\".*' ';; (find-catsters-%1 nil)'")

(code-mplayer "catsters-2categories1"    "~/CATSTERS/2-categories+1+(Catsters+36).mp4")
(code-mplayer "catsters-2categories2"    "~/CATSTERS/2-categories+2.mp4")
(code-mplayer "catsters-adjs1"           "~/CATSTERS/Adjunctions+1.mp4")
(code-mplayer "catsters-adjs2"           "~/CATSTERS/Adjunctions+2.mp4")
(code-mplayer "catsters-adjs3"           "~/CATSTERS/Adjunctions+3.mp4")
(code-mplayer "catsters-adjs4"           "~/CATSTERS/Adjunctions+4.mp4")
(code-mplayer "catsters-adjs5"           "~/CATSTERS/Adjunctions+5.flv")
(code-mplayer "catsters-adjs6"           "~/CATSTERS/Adjunctions+6.mp4")
(code-mplayer "catsters-adjs7"           "~/CATSTERS/Adjunctions+7.mp4")
(code-mplayer "catsters-adjsfrommorphs1" "~/CATSTERS/Adjunctions+from+morphisms+1.mp4")
(code-mplayer "catsters-adjsfrommorphs2" "~/CATSTERS/Adjunctions+from+morphisms+2.mp4")
(code-mplayer "catsters-adjsfrommorphs3" "~/CATSTERS/Adjunctions+from+morphisms+3.mp4")
(code-mplayer "catsters-adjsfrommorphs4" "~/CATSTERS/Adjunctions+from+morphisms+4.mp4")
(code-mplayer "catsters-adjsfrommorphs5" "~/CATSTERS/Adjunctions+from+morphisms+5.mp4")
(code-mplayer "catsters-coeqs1"          "~/CATSTERS/Coequalisers+1.mp4")
(code-mplayer "catsters-coeqs2"          "~/CATSTERS/Coequalisers+2.mp4")
(code-mplayer "catsters-distrlaws1"      "~/CATSTERS/Distributive+laws+1.mp4")
(code-mplayer "catsters-distrlaws2"      "~/CATSTERS/Distributive+laws+2.mp4")
(code-mplayer "catsters-distrlaws3"      "~/CATSTERS/Distributive+laws+3+and%or+Monads+6+[29].mp4")
(code-mplayer "catsters-distrlaws4"      "~/CATSTERS/Distributive+laws+4+[30].mp4")
(code-mplayer "catsters-doublecats"      "~/CATSTERS/Double+categories.mp4")
(code-mplayer "catsters-eckmannhilton1"  "~/CATSTERS/Eckmann-Hilton+1.mp4")
(code-mplayer "catsters-eckmannhilton2"  "~/CATSTERS/Eckmann-Hilton+2+(beware+typo+at+4:13).mp4")
(code-mplayer "catsters-limsandcolims1"  "~/CATSTERS/General+limits+and+colimits+1.mp4")
(code-mplayer "catsters-limsandcolims2"  "~/CATSTERS/General+limits+and+colimits+2.mp4")
(code-mplayer "catsters-limsandcolims3"  "~/CATSTERS/General+limits+and+colimits+3.mp4")
(code-mplayer "catsters-limsandcolims4"  "~/CATSTERS/General+limits+and+colimits+4.mp4")
(code-mplayer "catsters-limsandcolims5"  "~/CATSTERS/General+limits+and+colimits+5.mp4")
(code-mplayer "catsters-limsandcolims6"  "~/CATSTERS/General+limits+and+colimits+6.mp4")
(code-mplayer "catsters-grobjsandhopf1"  "~/CATSTERS/Group+objects+and+Hopf+algebras+1.mp4")
(code-mplayer "catsters-grobjsandhopf1"  "~/CATSTERS/Group+objects+and+Hopf+algebras+2.mp4")
(code-mplayer "catsters-grobjsandhopf1"  "~/CATSTERS/Group+objects+and+Hopf+algebras+3+(Catsters+37).mp4")
(code-mplayer "catsters-grobjsandhopf1"  "~/CATSTERS/Group+objects+and+Hopf+algebras+4+(Catsters+38).mp4")
(code-mplayer "catsters-grobjsandhopf1"  "~/CATSTERS/Group+objects+and+Hopf+algebras+5.mp4")
(code-mplayer "catsters-grobjsandhopf1"  "~/CATSTERS/Group+objects+and+Hopf+algebras+6.mp4")
(code-mplayer "catsters-howitisdone"     "~/CATSTERS/How+it+is+done.mp4")
(code-mplayer "catsters-kleinbottle"     "~/CATSTERS/Klein+bottle.mp4")
(code-mplayer "catsters-metricspaces1"   "~/CATSTERS/Metric+spaces+and+enriched+categories+1.mp4")
(code-mplayer "catsters-metricspaces2"   "~/CATSTERS/Metric+spaces+and+enriched+categories+2.mp4")
(code-mplayer "catsters-monads1"         "~/CATSTERS/Monads+1.mp4")
(code-mplayer "catsters-monads2"         "~/CATSTERS/Monads+2.mp4")
(code-mplayer "catsters-monads3"         "~/CATSTERS/Monads+3.mp4")
(code-mplayer "catsters-monads3a"        "~/CATSTERS/Monads+3A.mp4")
(code-mplayer "catsters-monads4"         "~/CATSTERS/Monads+4.mp4")
(code-mplayer "catsters-monoidobjs1"     "~/CATSTERS/Monoid+objects+1.mp4")
(code-mplayer "catsters-monoidobjs2"     "~/CATSTERS/Monoid+objects+2.mp4")
(code-mplayer "catsters-multicats1"      "~/CATSTERS/Multicategories+1+(Catsters+33).mp4")
(code-mplayer "catsters-multicats2"      "~/CATSTERS/Multicategories+2+(Catsters+34).mp4")
(code-mplayer "catsters-nts1"            "~/CATSTERS/Natural+transformations+1.mp4")
(code-mplayer "catsters-nts2"            "~/CATSTERS/Natural+transformations+2.mp4")
(code-mplayer "catsters-nts3"            "~/CATSTERS/Natural+transformations+3.mp4")
(code-mplayer "catsters-nts3a"           "~/CATSTERS/Natural+transformations+3A.mp4")
(code-mplayer "catsters-openclosedcob1"  "~/CATSTERS/Open-closed+cobordism+1.mp4")
(code-mplayer "catsters-openclosedcob2"  "~/CATSTERS/Open-closed+cobordisms+2.mp4")
(code-mplayer "catsters-openclosedcob3"  "~/CATSTERS/Open-closed+cobordisms+3.mp4")
(code-mplayer "catsters-outtakes"        "~/CATSTERS/Outtakes+(Catsters+35).mp4")
(code-mplayer "catsters-prodscoprods1"   "~/CATSTERS/Products+and+coproducts+1.mp4")
(code-mplayer "catsters-prodscoprods2"   "~/CATSTERS/Products+and+coproducts+2.mp4")
(code-mplayer "catsters-prodscoprods3"   "~/CATSTERS/Products+and+coproducts+3.mp4")
(code-mplayer "catsters-prodscoprods4"   "~/CATSTERS/Products+and+coproducts+4.mp4")
(code-mplayer "catsters-pbspushouts1"    "~/CATSTERS/Pullbacks+and+pushouts+1.mp4")
(code-mplayer "catsters-pbspushouts2"    "~/CATSTERS/Pullbacks+and+pushouts+2.mp4")
(code-mplayer "catsters-repyoneda1"      "~/CATSTERS/Representables+and+Yoneda+1.mp4")
(code-mplayer "catsters-repyoneda2"      "~/CATSTERS/Representables+and+Yoneda+2.mp4")
(code-mplayer "catsters-repyoneda3"      "~/CATSTERS/Representables+and+Yoneda+3.mp4")
(code-mplayer "catsters-slicecomma1"     "~/CATSTERS/Slice+and+comma+categories+1.mp4")
(code-mplayer "catsters-slicecomma2"     "~/CATSTERS/Slice+and+comma+categories+2.mp4")
(code-mplayer "catsters-spans1"          "~/CATSTERS/Spans+1+[31].mp4")
(code-mplayer "catsters-spans2"          "~/CATSTERS/Spans+2+[32].mp4")
(code-mplayer "catsters-stringdiagrams1" "~/CATSTERS/String+diagrams+1.mp4")
(code-mplayer "catsters-stringdiagrams2" "~/CATSTERS/String+diagrams+2.mp4")
(code-mplayer "catsters-stringdiagrams3" "~/CATSTERS/String+diagrams+3.mp4")
(code-mplayer "catsters-stringdiagrams4" "~/CATSTERS/String+diagrams+4.mp4")
(code-mplayer "catsters-stringdiagrams5" "~/CATSTERS/String+diagrams+5.mp4")
(code-mplayer "catsters-terminits1"      "~/CATSTERS/Terminal+and+initial+objects+1.mp4")
(code-mplayer "catsters-terminits2"      "~/CATSTERS/Terminal+and+initial+objects+2.mp4")
(code-mplayer "catsters-terminits3"      "~/CATSTERS/Terminal+and+initial+objects+3.mp4")


(seen 11630)


;; «lua-5.2»  (to ".lua-5.2")
;; (find-es "lua5" "install-5.2")
(code-c-d "lua52" "~/usrc/lua-5.2.0/")
;; (find-efunction 'eepitch-lua51)
;; (find-angg ".emacs" "luamanual")
(defun eepitch-lua52   () (interactive) (eepitch-comint "lua52"   "lua52"))
(code-c-d "lua51manual" (ee-lua51file "doc/manual.html"))
(code-c-d "lua52manual" (ee-lua52file "doc/manual.html"))
;; (find-lua51manualw3m "")
;; (find-lua52manualw3m "")
;; (find-lua52manualw3m "#pdf-bit")
;; (find-lua52manualw3m "#3.2" "_ENV")
;; (find-lua52w3m "doc/readme.html")

;; «luajit»  (to ".luajit")
;; (find-es "lua5" "luajit")
(code-c-d "luajit" "~/usrc/LuaJIT-2.0.0-beta8/")
(code-c-d "luajit" "~/usrc/LuaJIT-2.0.2/")
(defun eepitch-luajit () (interactive)
  (eepitch-comint "luajit" (ee-luajitfile "src/luajit")))

;; (find-enode "Choosing Modes" "interpreter-mode-alist")
;; (find-evardescr 'interpreter-mode-alist)
;; (find-anggfile "elisp/lua-mode.el")
(add-to-list 'interpreter-mode-alist '("luajit" . lua-mode))

;; «love2d»  (to ".love2d")
;; (find-es "love" "love-vilua")
(defun eepitch-love () (interactive)
  (eepitch-comint "love" "love ~/LOVE2D/vilua2.love"))





;; «caderno»  (to ".caderno")
;; (find-fline "~/SCANS/")
(code-djvu "caderno2" "~/SCANS/caderno2/caderno.djvu")
;; (find-caderno2page 10      "A família {p_U, p_V} viola separatedness")
;; (find-caderno2page 16 "MD" "g(f(4)) -^v^-> g(2*4+3)")
;; (find-caderno2page 21 "C2" "Um modo de estruturar respostas para alguns problemas de Cálculo 2")
;; (find-caderno2page 21 "C2" "boa primitiva")
;; (find-caderno2page 22 "C2" "Exercícios de Integral de Riemann")
;; (find-caderno2page 23 "MD" "Exercícios sobre relações e funções")
;; (find-caderno2page 26 "C2" "reduzir" "(D^2 + \\aa D + \\bb)f = 0" "(D-a)(D-b)f=0")
;; (find-caderno2page 26 "C2" "encontre uma EDO da forma y'''+ay''+by'+cy=0 com sols básicas")
;; (find-caderno2page 27 "C4" "Sejam F, G, H, K os seguintes campos em R^2:")
;; (find-caderno2page 29      "este é o caminho para sermos ouvidos _por outras comissões_")
;; (find-caderno2page 30 "C2" "Gabarito da P2")
;; (find-caderno2page 33 "MD" "Prova de reposição")
;; (find-caderno2page 34 "C2" "Prova de reposição")
;; (find-caderno2page 35 "C4" "2ª Prova de reposição")
;; (find-caderno2page 36 "C4" "2ª Prova de reposição - gabarito")
;; (find-caderno2page 38 "C2" "(VR/VS?)")
;; (find-caderno2page 39 "C4" "VS")
;; (find-caderno2page 40 "C4" "Mini-gabarito da VS")
;; (find-caderno2page 41 "C4" "VS2")
;; (find-caderno2page 42 "C2" "VS")
;; (find-caderno2page 43 "C2" "VS - gabarito")
;; (find-caderno2page 45      "(Yoneda in 6 diagrams)")
;; (find-caderno2page 50      "RRZ's book is centered on presheaves (draft)")
;; (find-caderno2page 51      "RRZ's book is centered on presheaves")
;; (find-caderno2page 52      "O que é preciso para trabalhar em empresas?")
;; (find-caderno2page 53      "Lambek/Scott")
;; (find-caderno2page 55      "Lambek/Scott")
;; (find-caderno2page 56      "pare de fingir que dá pra ver o mundo só do ponto de vista dos winners")
;; (find-caderno2page 57      "\"o método autoritário é melhor\"")
;; (find-caderno2page 58      "A lemma about bifunctors")
;; (find-caderno2page 59      "A lemma about bifunctors")
;; (find-caderno2page 60      "Product categories")
;; (find-caderno2page 61      "A lemma on bifunctors")
;; (find-caderno2page 62      "mapinha do dednat5")
;; (find-caderno2page 63      "The condition on variables (and on terms)")

(code-djvu "caderno1" "~/SCANS/caderno1/caderno1.djvu")
;; (find-caderno1page 1)

(code-djvu "judith" "$S/http/angg.twu.net/MD/judith_p59_a_110.djvu")
;; (find-judithpage (+ -58 59) "2.1. Técnicas de Demonstração")
;; (find-judithpage (+ -58 61)   "Exaustiva")
;; (find-judithpage (+ -58 63)   "Direta")
;; (find-judithpage (+ -58 63)   "Contraposição")
;; (find-judithpage (+ -58 64)   "Absurdo")
;; (find-judithpage (+ -58 65)   "Acidentes Felizes")
;; (find-judithpage (+ -58 66)   "Exercícios")



;; «unilog-2010»  (to ".unilog-2010")
;; http://www.uni-log.org/start3.html
;; http://www.uni-log.org/ss3-CAT.html
;; http://www.uni-log.org/handbook-unilog2010.pdf
(code-xpdf      "uniloghandbook" "$S/http/www.uni-log.org/handbook-unilog2010.pdf")
(code-pdftotext "uniloghandbook" "$S/http/www.uni-log.org/handbook-unilog2010.pdf")
;; (find-uniloghandbookpage        3  "Contents")
;; (find-uniloghandbookpage (+ 4   6) "Yuri Gurevich")
;; (find-uniloghandbookpage (+ 4   7) "Giovanni Sambin")
;; (find-uniloghandbookpage (+ 4   7) "Jonathan Seldin")
;; (find-uniloghandbookpage (+ 4   7) "Amilcar Sernadas")
;; (find-uniloghandbookpage (+ 4  11) "Carlos Caleiro")
;; (find-uniloghandbookpage (+ 4  19) "Categorical Logic")
;; (find-uniloghandbookpage (+ 4  20)   "Maietti")
;; (find-uniloghandbookpage (+ 4  21)   "Dominique Duval")
;; (find-uniloghandbookpage (+ 4  21)   "René Guitart")
;; (find-uniloghandbookpage (+ 4  21)   "Eduardo Ochs")
;; (find-uniloghandbookpage (+ 4  22)   "Valeria de Paiva")
;; (find-uniloghandbookpage (+ 4  22)   "Szczeciniarz")
;; (find-uniloghandbookpage (+ 4  22) "Logic diagrams")
;; (find-uniloghandbookpage (+ 4  28)   "Polynomial Ring Calculus")
;; (find-uniloghandbookpage (+ 4  34) "+ update")
;; (find-uniloghandbookpage (+ 4  39)  "tortoise")
;; (find-uniloghandbookpage (+ 4  55)  "how to combine logics")
;; (find-uniloghandbookpage (+ 4  58)  "tortoise")
;; (find-uniloghandbookpage (+ 4  62)  "godel completeness")
;; (find-uniloghandbookpage (+ 4  66)  "information")
;; (find-uniloghandbookpage (+ 4  69)  "S4")
;; (find-uniloghandbookpage (+ 4  73)  "socrates")
;; (find-uniloghandbookpage (+ 4  79)  "proof events")
;; (find-uniloghandbookpage (+ 4  83)  "Piaget")
;; (find-uniloghandbookpage (+ 4  88) "Tutorials")
;; (find-uniloghandbookpage (+ 4  89)   "Fractals, topology and logic")
;; (find-uniloghandbookpage (+ 4  94)   "Coniglio")
;; (find-uniloghandbookpage (+ 4  95)   "Ideospheres")
;; (find-uniloghandbookpage (+ 4  95)   "Institutions")
;; (find-uniloghandbookpage (+ 4  96)   "Kripke's World")
;; (find-uniloghandbookpage (+ 4  98)   "Plurality")
;; (find-uniloghandbookpage (+ 4  98)   "Natural Deductions")
;; (find-uniloghandbookpage (+ 4 102)   "Joao Marcos")
;; (find-uniloghandbookpage (+ 4 103)   "Truth-values")
;; (find-uniloghandbooktext "" "Luiz Henrique da Cruz Silvestrini")
;; (find-uniloghandbooktext "" "Juan Luis Gastaldi")
;; (find-uniloghandbooktext "" "James Brotherston")
;; (find-uniloghandbooktext "" "Danielle Macbeth")
;; (find-uniloghandbooktext "" "Abelian logic")
;; (find-uniloghandbooktext "" "Arno Bastenhof")
;; (find-uniloghandbooktext "")



;; «haskell-mode»  (to ".haskell-mode")
;; (find-es "haskell" "haskell-mode")
(code-c-d "haskellmode" "~/usrc/haskell-mode-2.8.0/")
;; (find-haskellmodefile "")
;;
(add-to-list 'load-path "~/usrc/haskell-mode-2.8.0/")
(when (file-exists-p "~/usrc/haskell-mode-2.8.0/haskell-site-file.el")
  ;; (find-haskellmodefile "inf-haskell.el" "haskell-program-name")
  ;; (setq haskell-program-name "hugs \"+.\"")
  (setq haskell-program-name "ghci")
  (load "haskell-site-file")
  (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
  (add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)
  )



;; «gdb»  (to ".gdb")
;; (find-es "emacs" "gdb-mi")
;; (find-es "gdb" "gdb-squeeze")
(code-c-d "gdb"    "/usr/share/doc/gdb-doc/html/gdb/"    "gdb")
(code-c-d "gdbint" "/usr/share/doc/gdb-doc/html/gdbint/" "gdbint")
(code-c-d "stabs"  "/usr/share/doc/gdb-doc/html/stabs/"  "stabs")
;; (find-gdbfile "")
;; (find-gdbnode "")
;; (find-gdbintfile "")
;; (find-gdbintnode "")
;; (find-stabsfile "")
;; (find-stabsnode "")



;; «bash»  (to ".bash")
;; (find-es "bash" "bash-debian")
(code-c-d "bash" "/usr/share/doc/bash/examples/" "bashref")
;; (defun eepitch-bash () (interactive) (eepitch-comint "bash" "bash"))
;; (find-bashfile "")
;; (find-bashnode "")

;; «dash»  (to ".dash")
;; (find-es "bash" "dash")
;; (defun eepitch-dash () (interactive) (eepitch-comint "dash" "dash"))

;; «ksh»  (to ".ksh")
;; (find-es "zsh" "ksh")
;; (defun eepitch-ksh () (interactive) (eepitch-comint "ksh" "ksh"))

;; «tcsh»  (to ".tcsh")
;; (find-es "bash" "ksh")
;; (defun eepitch-tcsh () (interactive) (eepitch-comint "tcsh" "tcsh"))

;; «zsh»  (to ".zsh")
;; (find-es "zsh" "zsh-debian")
;; (defun eepitch-zsh () (interactive) (eepitch-comint "zsh" "zsh"))
(code-c-d "zsh" "/usr/share/doc/zsh/examples/" "zsh")
;; (find-zshfile "")
;; (find-zshnode "")




;; «guile»  (to ".guile")
;; (find-es "scheme" "guile-1.8")
;; (defun eepitch-guile () (interactive) (eepitch-comint "guile" "guile"))
(code-c-d "guile"    "/usr/share/guile/1.8/ice-9/" "guile-1.8")
(code-c-d "guiletut" "/usr/share/guile/1.8/ice-9/" "guile-tut-1.8")
;; (find-guilefile "")
;; (find-guilefile "expect.scm")
;; (find-guiletutnode "")
;; (find-guiletutnode "Using Guile to program in Scheme")
;; (find-guilenode "")
;; (find-guilenode "Intro to Using Guile Modules")
;; (find-guilenode "Transforming Scheme name to C name")

;; «mit-scheme»  (to ".mit-scheme")
;; (find-es "scheme" "mit-scheme")
(code-c-d "mitscheme" "/usr/lib/mit-scheme-i386/" "mit-scheme-user")
' (defun eepitch-mitscheme () (interactive)
    (eepitch-comint "mit-scheme" "mit-scheme"))
;; (find-mitschemefile "")
;; (find-mitschemenode "")
;; (find-mitschemenode "Edwin")
;; (find-mitschemenode "Edwin REPL Mode")

;; «scsh»  (to ".scsh")
;; (find-es "scheme" "scsh")
(code-c-d "scshdoc" "/usr/share/doc/scsh-0.6-doc/")
;; (defun eepitch-scsh () (interactive) (eepitch-comint "scsh" "scsh"))
;; (find-scshdocfile "")
;; (find-scshdocfile "cheat.txt.gz")


;; «haskell»  (to ".haskell")
;; (find-es "haskell" "haskell-docs")
;; (find-blogme3 "angglisp.lua" "haskell")
;; (find-es "haskell" "haskell-mode")
(code-c-d "hask98report" "/usr/share/doc/haskell98-report/html/haskell98-report-html/")
(code-c-d "hask98tut"    "/usr/share/doc/haskell98-tutorial/html/")
;; (find-hask98reportfile "")
;; (find-hask98reportw3m  "index.html")
;; (find-hask98reportw3m  "index98.html")
;; (find-hask98tutfile "")
;; (find-hask98tutw3m  "index.html")


;; «hugs»  (to ".hugs")
;; (find-es "haskell" "hugs")
(code-c-d "hugsbase" "/usr/lib/hugs/packages/hugsbase/Hugs/")
(code-c-d "hugsoldlib" "/usr/lib/hugs/oldlib/")
(code-c-d "hugsuserguide" "/usr/share/doc/hugs/users_guide/")
;; (defun eepitch-hugs   () (interactive) (eepitch-comint "hugs" "hugs"))
;; (defun eepitch-hugs98 () (interactive) (eepitch-comint "hugs" "hugs -98"))
;; (find-hugsbasefile "")
;; (find-hugsbasefile "Prelude.hs")
;; (find-hugsoldlibfile "")
;; (find-hugsuserguidefile "")
;; (find-hugsuserguidew3m  "index.html")
;; (find-libhugsfile "")
;; (find-es "haskell" "eepitch-hugs")


;; «ghc»  (to ".ghc")
;; (find-es "haskell" "ghc6")
(code-c-d "ghcdoc"  "/usr/share/doc/ghc6-doc/html/")
(code-c-d "ghcusrh" "/usr/share/doc/ghc6-doc/html/users_guide/")
;; (defun eepitch-ghci () (interactive) (eepitch-comint "ghci" "ghci"))
;; (find-ghcdocfile "")
;; (find-ghcusrhfile "")
;; (find-ghcusrhw3m  "index.html")
;; (find-ghcusrhw3m  "ghci.html")
;; (find-libhugsfile "libraries/Hugs/Prelude.hs")



;; «ocaml»  (to ".ocaml")
;; (find-es "ml" "ocaml-lenny")
;; (find-es "ml" "godi")
(code-xpdf      "ocamlref" "/usr/share/doc/ocaml-doc/ocaml-3.10-refman.pdf")
(code-pdftotext "ocamlref" "/usr/share/doc/ocaml-doc/ocaml-3.10-refman.pdf")
;; (find-ocamlrefpage      1  "Contents")
;; (find-ocamlrefpage (+ 1 1) "Index")
;; (find-ocamlreftext "")
;; (find-fline "/usr/share/doc/ocaml-doc/ocaml-3.10-refman.txt.gz")
(code-c-d "ocaml"    "/usr/share/doc/ocaml-doc/ocaml.html/libref/" "ocaml")
(code-c-d "ocamlref" "/usr/share/doc/ocaml-doc/ocaml.html/libref/" "ocaml")
;; (find-ocamlnode "")
;; (find-ocamlfile "")
;; (defun eepitch-ocaml  () (interactive) (eepitch-comint "ocaml" "ocaml"))
;; (defun eepitch-labltk () (interactive) (eepitch-comint "labltk" "labltk"))

;; (defun eepitch-polyml () (interactive) (eepitch-comint "polyml" "poly"))

(code-c-d "godi"  "~/usrc/godi/")
;; (find-godifile  "")


;; «plzoo»  (to ".plzoo")
;; (find-es "ml" "plzoo")

;; «levy» (to ".levy")
;; (find-es "ml" "levy")
(code-c-d "levy" "~/usrc/levy/")
;; (find-levyfile "")
(defun eepitch-levy () (interactive)
  (eepitch-comint-at "~/usrc/levy/" "levy" "levy.byte"))

;; (find-angg ".emacs.papers" "levy")
;; http://www.cs.bham.ac.uk/~pbl/papers/ctcs02journal.pdf
;; (find-fline "$S/http/www.cs.bham.ac.uk/~pbl/papers/")
(code-xpdf     "cbpvadj" "$S/http/www.cs.bham.ac.uk/~pbl/papers/ctcs02journal.pdf")
(code-pdf-text "cbpvadj" "$S/http/www.cs.bham.ac.uk/~pbl/papers/ctcs02journal.pdf")
;; (find-cbpvadjpage)
;; (find-cbpvadjtext)





;; «picolisp»  (to ".picolisp")
;; (find-es "lisp" "picolisp")
(code-c-d "picolisp" "~/usrc/picoLisp/")
(defun eepitch-picolisp () (interactive)
  (eepitch-comint "picolisp" (ee-picolispfile "bin/picolisp")))
(defun eepitch-picolisp () (interactive)
  (eepitch-comint-at ee-picolispdir "picolisp" "bin/picolisp"))

;; (find-es "lisp" "slime-cvs-run")
;; (find-slimefile "slime.el" "CONTRIBS is a list")
;; (find-slimefile "slime.el")
(code-c-d "slime" "~/usrc/slime/" "slime")

;; (defun eepitch-sbcl  () (interactive) (eepitch-comint "sbcl" "sbcl"))
;; (defun eepitch-gcl   () (interactive) (eepitch-comint "gcl"  "gcl"))

;; (find-es "lisp" "dpans2texi")
;; (find-ansiclnode "")
;; (find-ansiclnode "Index")
(code-c-d "ansicl" "~/usrc/dpans2texi-1.05/" "ansicl")

;; (find-es "lisp" "sbcl")
(code-c-d "sbcl" "/usr/share/sbcl-source/" "sbcl")

;; (find-es "lexyacc")
(code-c-d "bison" "~/BISON/" "bison")


;; «ee-backup-lua-locals»  (to ".ee-backup-lua-locals")
;; (find-efunction 'ee-split)
;; A test:
;; (find-elinks '((bll "foo bar  plic")))

(defun ee-backup-lua-locals (vars)
  (let* ((vars  (ee-split vars))
	 (vars,  (mapconcat 'identity vars ",  "))
	 (vars_, (mapconcat 'identity vars "_, ")))
    (concat "    local " vars_, "_ =\n"
	    "          " vars, "\n"
	    "    " vars, "  =\n"
	    "    " vars_, "_\n")))

(defun bll (vars) (insert "\n" (ee-backup-lua-locals vars)))

(seen 11980)




;; (find-efunction 'find-pdftotext)
;; (find-efunction 'ee-code-pdftotext)
;; (find-efunction 'code-pdftotext)
;; (find-efunction 'find-callprocess0)
;; (find-man "djvutxt")
;; (find-man "djvused")

;; (defun find-djvutotext (fname &rest rest)
;;   (apply 'find-sh (format "djvutxt %s" fname) rest))
;; (defun ee-code-djvutotext (code djvufile)
;;   (format "
;;     (defun find-%stext (&rest rest) (interactive)
;;       (apply 'find-djvutotext %S rest))
;;   " code djvufile))
;; (defun code-djvutotext (c f) (eval (ee-read (ee-code-djvutotext c f))))


;; (find-node "(eev)Top")


;; «xmonad»  (to ".xmonad")
;; (find-es "haskell" "xmonad")
(code-c-d "xmonad" "~/usrc/xmonad-0.9/")

(defun find-eepitch-buffer (cmd &optional body &rest rest)
  (interactive (list "shell"))
  (apply 'find-estring
	 (format "\n* (eepitch-%s)\n* (eepitch-kill)\n* (eepitch-%s)\n%s"
		 cmd cmd (or body ""))
	 rest))
(defun find-eeshell (&optional body &rest rest)
  (apply 'find-eepitch-buffer "shell" body rest))
(defun find-eeshell-here (&optional body &rest rest)
  (apply 'find-eeshell (format "cd %s\n%s" default-directory body) rest))

;; (find-eepitch-buffer "shell" "foo")
;; (find-eeshell "foo")
;; (find-eeshell-here "foo")


(code-c-d       "853" "~/LATEX/2008graphs.tex" :anchor)
(code-dvi       "853" "~/LATEX/2008graphs.dvi")
(code-pdftotext "853" "~/LATEX/2008graphs.pdf")
;; (find-853file  "")
;; (find-853file  "" "LT-modalities")
;; (find-853      "" "LT-modalities")
;; (find-853page  21 "internal-diagram")
;; (find-853text  21 "Lawvere-Tierney Modalities\n")

;; «unilog-current»  (to ".unilog-current")
;; (find-LATEX "2010unilog-current.tex")
;; (find-dvipage  "~/LATEX/2010unilog-current.dvi")
(code-c-d       "854" "~/LATEX/2010unilog-current.tex" :anchor)
(code-dvi       "854" "~/LATEX/2010unilog-current.dvi")
(code-pdftotext "854" "~/LATEX/2010unilog-current.pdf")
(code-c-d       "unilogcurr" "~/LATEX/2010unilog-current.tex" :anchor)
(code-dvi       "unilogcurr" "~/LATEX/2010unilog-current.dvi")
(code-pdftotext "unilogcurr" "~/LATEX/2010unilog-current.pdf")
;; (find-854file  "")
;; (find-854     "" "internal-diagram")
;; (find-854page  9 "internal-diagram")
;; (find-854     "" "phys-notation")
;; (find-854page 11 "phys-notation")
;; (find-854     "" "cheap-and-exp-adjs-2")
;; (find-854page 30 "cheap-and-exp-adjs-2")
;; (find-854     "" "yoneda-lemma")
;; (find-854page 32 "yoneda-lemma")
;; (find-854     "" "CCCs")
;; (find-854page 43 "CCCs")
;; (find-854text)

;; «idarct» (to ".idarct")
;; (find-idarctfile "Makefile")
(code-c-d       "idarct0" "~/LATEX/idarct/")
(code-c-d       "idarct" "~/LATEX/idarct/2010diags-body.tex" :anchor)
(code-dvi       "idarct" "~/LATEX/idarct/idarct-preprint.dvi")
(code-pdftotext "idarct" "~/LATEX/idarct/idarct-preprint.pdf" 0)
(code-dvi       "idarct" "~/LATEX/idarct-preprint.dvi")
(code-pdftotext "idarct" "~/LATEX/idarct-preprint.pdf" 0)
;; (find-idarct0file "")
;; (find-idarct0file "Makefile")
;; (find-idarct     "")
;; (find-idarctpage 24 "17. Cartesian Closed Categories")
;; (find-idarcttext 24 "17. Cartesian Closed Categories")

;; (find-idarct "2010diags-body.tex" "build-scripts")



;; «idct» (to ".idct")
;; (find-LATEX "2010diags.tex")
;; http://angg.twu.net/math-b.html#internal-diags-in-ct
;; http://angg.twu.net/LATEX/2010diags.pdf
(code-c-d       "idct" "~/LATEX/2010diags.tex" :anchor)
(code-xpdf      "idct" "~/LATEX/2010diags.pdf")
(code-dvi       "idct" "~/LATEX/2010diags.dvi")
(code-pdftotext "idct" "~/LATEX/2010diags.pdf")
;; (find-idct     "" "olts")
;; (find-idctpage 25 "17. Objects of Line Type")
;; (find-idcttext)

;; «minicats»  (to ".minicats")
;; (find-angg "LATEX/2012minicats.tex")
(code-c-d       "minicats" "~/LATEX/2012minicats.tex" :anchor)
(code-dvi       "minicats" "~/LATEX/2012minicats.dvi")
(code-pdftotext "minicats" "~/LATEX/2012minicats.pdf")
;; (find-minicatspage 2  "Program (1)")
;; (find-minicats     "" "lambda-intro")
;; (find-minicatspage 25 "17. Objects of Line Type")
;; (find-minicatstext)

;; «eblslides»  (to ".eblslides")
;; (find-angg "LATEX/2011ebl-slides.tex")
(code-c-d       "eblslides" "~/LATEX/2011ebl-slides.tex" :anchor)
(code-dvi       "eblslides" "~/LATEX/2011ebl-slides.dvi")
(code-pdftotext "eblslides" "~/LATEX/2011ebl-slides.pdf")
;; (find-eblslides     "" "fav-top-space")
;; (find-eblslidespage  7 "Essential arrows")
;; (find-eblslidespage 10 "Our favorite topological space: V")
;; (find-eblslides     "" "evil-presheaf")
;; (find-eblslidespage 13 "The evil presheaf")
;; (find-eblslidestext)

;; «eblsheaves»  (to ".eblsheaves")
;; (find-angg "LATEX/2011ebl-abs.tex")
(code-c-d       "eblsheaves" "~/LATEX/2011ebl-abs.tex" :anchor)
(code-dvi       "eblsheaves" "~/LATEX/2011ebl-abs.dvi")
(code-pdftotext "eblsheaves" "~/LATEX/2011ebl-abs.pdf")
;; (find-eblsheaves     "")
;; (find-eblsheavespage  5 "Priming")
;; (find-eblsheavespage  9 "int-and-coint")
;; (find-eblsheavespage 13 "thinness")
;; (find-eblsheavespage 17 "Heyting Algebras")
;; (find-eblsheavestext)

;; (code-c-d       "34" "~/LATEX/2011ebl-abs.tex" :anchor)
;; (code-dvi       "34" "~/LATEX/2011ebl-abs.dvi")
;; (code-pdftotext "34" "~/LATEX/2011ebl-abs.pdf")
;; (find-34     "" "thinness")
;; (find-34page 13 "thinness")

;; «sheavesforchildren» (to ".sheavesforchildren")
;; (find-angg "sheavesforchildren/")
;; (find-TH "sheavesforchildren")
(defun eejump-56 () (find-TH "sheavesforchildren"))
(code-c-d "sfc" "~/sheavesforchildren/")
;; (find-sfcfile "")

(defun eejump-57 () (find-LATEX "2014-resposta.tex"))





;; «find-2»  (to ".find-2")
;; Rewritten: (find-eev "eev-multiwindow.el" "find-2a")

;; (defun find-2 (sexp1 sexp2)
;;   (eek "C-x 1")
;;   (eval sexp1) (eek "C-x 2  M-o")
;;   (eval sexp2))
;; 
;; (defun find-22o (sexp1 sexp2 sexp3)
;;   (eek "C-x 1")
;;   (eval sexp1) (eek "C-x 2  M-o")
;;   (eval sexp2) (eek "C-x 2  M-o  C-x +")
;;   (eval sexp3) (eek "C-x o"))
;; 
;; (defun find-3 (sexp1 sexp2)
;;   (eek "C-x 1")
;;   (eval sexp1) (eek "C-x 3  M-o")
;;   (eval sexp2))
;; 
;; (defun find-3o2 (sexp1 sexp2 sexp3)
;;   (eek "C-x 1")
;;   (eval sexp1) (eek "C-x 3  M-o")
;;   (eval sexp2) (eek "C-x 2  M-o")
;;   (eval sexp3))
;; 
;; (defun find-3o2o2 (sexp1 sexp2 sexp3 sexp4)
;;   (eek "C-x 1")
;;   (eval sexp1) (eek "C-x 3  M-o")
;;   (eval sexp2) (eek "C-x 2  M-o")
;;   (eval sexp3) (eek "C-x 2  M-o")
;;   (eval sexp4) (eek "C-x +")
;;   (eek "M-0 C-l  M-o")
;;   (eek "M-0 C-l  M-o")
;;   (eek "M-0 C-l  M-o")
;;   (eek "M-0 C-l  M-o"))
;; 
;; ' (find-3o2o2
;;    '(find-TH "2010.2-MD" "resumos-das-aulas")
;;    '(find-es "puro" "ementa-e-programa-MD")
;;    '(find-TH "2010.2-MD" "diario-de-classe")
;;    '(find-TH "2010.2-MD" "plano-de-aulas")
;;    )



;; «chaui»  (to ".chaui")
;; (find-fline "~/SCANS/univ_form_cid/chaui.txt")
;; Marilena Chaui: "As Humanidades contra o Humanismo", e:
;; Eduardo Rinesi: "Universidade Reflexiva e Cidadania Crítica"
(code-djvu "hch" "~/SCANS/univ_form_cid/hch_e_rinesi.djvu")
;; M-vrr M-vzw F11
;; (find-hchpage (+ -14 15) "Chaui")
;; (find-hchpage (+ -76 87) "Rinesi")
;; (find-hchpage (+ -77 89) "a universidade" "pensa por nosso intermédio")
;; (find-hchpage (+ -78 92) "a universidade replica")
;; (find-hchpage (+ -80 95) "os indivíduos tendem a se voltar para o espaço da sua privacidade")
;; (find-hchpage (+ -80 95) "a própria noção que as universidade têm de sua tarefa e de sua função")

;; (find-LATEX "chaui-hch.tex")

(defun find-inks (fname)
  (find-bgprocess `("inkscape" ,fname)))
(defun find-inkv (fname)
  (find-bgprocess `("inkview" ,fname)))
(defun find-nautilus (fname)
  (find-bgprocess `("nautilus" ,fname)))

(code-brfile 'find-inks
             :local 'brinksl :dired 'brinksd)
(code-brfile 'find-inkv
             :local 'brinkvl :dired 'brinkvd)
(code-brfile 'find-nautilus
             :local 'brnaul :dired 'brnaud)


;; (defun ee-wrap-zsh (&optional n)
;;   (interactive "p")
;;   (ee-delete-extract-wrap (lambda (str) `((find-zsh ,str))) n))

;; (define-key eev-mode-map "\M-Z" 'ee-wrap-zsh)


;; «metapost»  (to ".metapost")
;; (find-angg ".emacs.papers" "metapost")
;; (find-es "tex" "metapost")
;; (find-metapostfile "")
;; (find-metapostfile "base/")
;; (find-metapostdocfile "")
;; (find-metapostdocfile "base/")
;; (find-metapostdocfile "base/source-manual/")
;; (find-metapostdocfile "base/source-tutorial/")
(code-c-d "metapost"    "/usr/share/texmf-texlive/metapost/")
(code-c-d "metapostdoc" "/usr/share/doc/texlive-metapost-doc/metapost/")
(code-c-d "featpostdoc" "/usr/share/doc/texlive-metapost-doc/metapost/featpost/")
(defun eepitch-mpost () (interactive) (ee-eepitch-comint "/tmp/" "mpost" "mpost"))
(defun eepitch-mf    () (interactive) (ee-eepitch-comint "/tmp/" "mf"    "mf"))
;; (find-efile "progmodes/meta-mode.el")

;; (find-angg ".emacs" "dn4-block")
(defun mp-block ()
  (interactive)
  (insert "
* (eepitch-mpost)
* (eepitch-kill)
* (eepitch-mpost)
null
outputtemplate:=\"/tmp/mp-%3c.mps\"; prologues:=3;
beginfig(1);
endfig;
% (find-pspage \"/tmp/mp-001.mps\")
"))



;; «projeto»  (to ".projeto")
(code-c-d "projeto"  "/scp:projeto@projeto.twu.net:/home/projeto/")
(code-c-d "projetop" "/scp:projeto@projeto.twu.net:/home/projeto/public_html/")
;; (find-projetofile "")
;; (find-projetopfile "")
;; (find-projetopfile "index.html")
;; http://projeto.twu.net/


;; «find-luac»  (to ".find-luac")
;; (find-es "lua5" "vmmerge5.lua")
;; (find-luac                "a.b.c.d.__mt = mt")
;; (find-luac   "setmetatable(a.b.c.d,       mt)")
;; (find-luac              "p(a.b.c.d.__mt)")
;; (find-luac "p(getmetatable(a.b.c.d))")
(defun find-luac0 (luacode)
  (ee-write-string luacode (ee-expand "$EEVTMPDIR/ee.luac"))
  (find-callprocess0 "luac51 -p -l $EEVTMPDIR/ee.luac"))
(defun find-luac (luacode &rest rest)
  (apply 'find-eoutput-reuse
	 (format "*luac: %s*" luacode)
	 `(insert ,(find-luac0 luacode))
	 rest))


;; «find-lua51ev»  (to ".find-lua51ev")
;; Tests: (find-lua51ev "print 'foo'")
;;        (find-lua51c  "print 'foo'")
;; See: (find-lua51w3m "doc/luac.html")
;;      (find-sh "luac51 -p -l - <<'%%%'\nprint 'foo'\n%%%")
;;      (find-es "lua-intro" "bytecode:captures")
(defun find-lua51ev (code &rest rest)
  (apply 'find-estring (find-callprocess0 `("lua51" "-e" ,code)) rest))
(defun find-lua51c (code &rest rest)
  (apply 'find-sh (concat "luac51 -p -l - <<'%%%'\n" code "\n%%%") rest))




;; «gs»  (to ".gs")
;; (find-es "ps" "eepitch-gs")
;; (find-es "ps" "ps-intro")
(defun eepitch-gs () (interactive) (eepitch-comint "gs" "gs -r45"))
(defun eepitch-gs () (interactive) (eepitch-comint "gs" "gs -r48"))
(defun eepitch-gs () (interactive) (eepitch-comint "gs" "gs -r60"))
(code-c-d "gslib" "/usr/share/ghostscript/8.62/lib/")
;; (find-gslibfile "")
;; (find-gslibfile "gs_cmdl.ps" "command line")
;; (find-gslibfile "acctest.ps")
;; (find-gslibfile "gs_init.ps")
;; (find-gslibfile "gs_init.ps" "/=== ")
;; (find-gslibfile "gs_init.ps" "/pstack")
;; (find-gslibfile "gs_init.ps" "/prompt")
;; (find-gslibfile "gs_init.ps" "countexecstack")
;; (find-gslibfile "gs_init.ps" "Operand stack:")
;; (find-gslibfile "opdfread.ps")
;; (find-gslibfile "ppath.ps" "print the current path")
;; (find-gslibfile "showchar.ps")
;; (find-gslibfile "wrfont.ps" "unless you have loaded unprot.ps first")
;; (find-gslibfile "unprot.ps")
;; (find-gslibfile "type1enc.ps")
;; (find-gslibfile "type1ops.ps")
;; (find-gslibfile "gs_init.ps" "prints dictionaries")
;; (find-gslibfile "uninfo.ps" "printing")

;; «gforth»  (to ".gforth")
;; (find-es "gforth" "gforth-basics")
(defun eepitch-gforth  () (interactive) (eepitch '(run-forth "gforth")))
(defun eepitch-gforth  () (interactive) (eepitch-comint "gforth" "gforth"))
(code-c-d "gforth" "/usr/share/gforth/0.7.0/" "gforth")
;; (find-gforthfile "")
;; (find-gforthnode "")

;; «erlang»  (to ".erlang")
;; (find-es "erlang")
;; (find-eev "eepitch.el" "eepitch-erl")
;; (defun eepitch-erl () (interactive) (eepitch-comint "erl" "erl"))


;; «google-dns»  (to ".google-dns")
;; (eesteps '("C-n M-e" "C-n M-e" "C-n M-e" "C-n M-e" "C-n # C-a C-n C-y"))
;; (find-sh0 "cat /etc/resolv.conf")
;; (find-sh0 "sudo chmod 666 /etc/resolv.conf")
;; (kill-new "nameserver 8.8.8.8\n")
;; (find-fline "/etc/resolv.conf")
;;
(defun google-dns () (interactive)
  (find-angg ".emacs" "google-dns"))



;; «google»  (to ".google")
;;; Old version:
;;; (find-efunctiondescr 'url-hexify-string)
;;; (find-efunction      'url-hexify-string)
;;
;; (defun google-maps-url (query)
;;   (concat "http://maps.google.com/maps?f=q&q="
;;            (url-hexify-string query)
;;           ))
;; (defun gmap (query &rest rest)
;;   (brm (google-maps-url query)))
;;
;; (find-blogme3 "anggdefs.lua" "cgiquote")
;; (find-google-links "Eduardo Ochs")

(defun ee-wrap-google-maps- (li)
  (format "http://maps.google.com/maps?f=q&q=%s,+London"
	  (replace-regexp-in-string " " "+" li)))
(defun ee-wrap-google-maps () (interactive)
  (ee-wrapc '(li) '(insert (ee-wrap-google-maps- li))))

(defun find-google-links (&optional str &rest rest)
  "Visit a temporary buffer containing hyperlinks for google."
  (interactive)
  (setq str (or str "{str}"))
  (let ((qstr (replace-regexp-in-string " " "+" str)))
    (apply 'find-elinks `(
      ;; Convention: the first sexp always regenerates the buffer.
      (find-google-links ,str ,@rest)
      ;; Body:
      ""
      ,(ee-template0 "\
http://www.google.com/search?q={qstr}
http://www.google.com.br/search?tbm=isch&q={qstr}
http://www.google.com.br/search?tbm=isch&hl=en&safe=off&q={qstr}
http://maps.google.com/maps?f=q&q={qstr}")
    ) rest)))






(code-c-d "initd" "/etc/init.d/")
;; (find-initdfile "")


;; (find-es "ubuntu" "thttpd")

(defun monep () (interactive) (find-TH "monep"))

;; «fv»  (to ".fv")
;; (find-angg ".fvwm/.fvwm2rc")
;; (find-es "fvwm")
(defun fv () (interactive) (find-angg ".emacs" "fv"))


;; «scan»  (to ".scan")
;; (find-es "scan" "xsane-needs-root")
;; (find-fline "/tmp/dejours/")
(defun edrx ()
  (interactive)
  ;; (find-sh0 "sudo chown edrx:edrx /tmp/dejours/")
  ;; (find-sh0 "sudo chown edrx:edrx /tmp/dejours/*")
  ;; (find-sh0 "sudo chmod 666       /tmp/dejours/*")
  (find-sh0 "sudo chown edrx:edrx .")
  (find-sh0 "sudo chown edrx:edrx *")
  (find-sh0 "sudo chmod 666       *")
  (revert-buffer)
  )
(defun xz (fname)
  (interactive (list (ee-dired-to-fname)))
  (find-bgprocess `("xzgv" "--geometry" "1012x572+0+0" ,fname)))

;; «rotate» (to ".rotate")
;; (find-eev "eev-brxxx.el")
(defun rot90 (fname)
  (interactive (list (ee-dired-to-fname)))
  (find-callprocess `("convert" ,fname "-rotate" "90" ,fname)))
(defun rot180 (fname)
  (interactive (list (ee-dired-to-fname)))
  (find-callprocess `("convert" ,fname "-rotate" "180" ,fname)))
(defun rot270 (fname)
  (interactive (list (ee-dired-to-fname)))
  (find-callprocess `("convert" ,fname "-rotate" "270" ,fname)))

;; (find-es "imagemagick" "exif-orientation")
(defun rot-ao (fname)
  (interactive (list (ee-dired-to-fname)))
  (find-callprocess `("convert" ,fname "-auto-orient" ,fname)))
(defun rot0 (fname)
  (interactive (list (ee-dired-to-fname)))
  (find-callprocess `("convert" ,fname "-rotate" "0" "-auto-orient" ,fname)))
(defun rot180 (fname)
  (interactive (list (ee-dired-to-fname)))
  (find-callprocess `("convert" ,fname "-rotate" "180" "-auto-orient" ,fname)))
(defun rotleft (fname)
  (interactive (list (ee-dired-to-fname)))
  (find-callprocess `("convert" ,fname "-rotate" "270" "-auto-orient" ,fname)))
(defun rotright (fname)
  (interactive (list (ee-dired-to-fname)))
  (find-callprocess `("convert" ,fname "-rotate" "90" "-auto-orient" ,fname)))

;; (xz "/tmp/dejours/0030.jpeg")
;; (rot180 "/tmp/dejours/0030.jpeg")
;; (find-fline "~/SCANS/dejours/")
;; (find-fline "~/SCANS/moyses2/")

(code-c-d "tclmagick" "~/usrc/TclMagick/")
;; (find-es "tcl" "tclmagick")
;; (find-es "imagemagick")


;; «tex-def-many»  (to ".tex-def-many")
;; (find-es "tex" "more-than-9-args")
;; (find-angg "LUA/defwithmanyargs.lua" "run")
;; (find-angg "LUA/defwithmanyargs.lua" "test-run")
;; Tests: (find-tex-def-many "nam" 19)
;;        (find-tex-def-many "nam" 20 "% bbooddyy\n")
;;
(defun tex-def-many (name n &optional body)
  (find-callprocess00-ne
    (list (ee-expand "~/LUA/defwithmanyargs.lua")
          "--longdef" name (format "%s" n) (or body "% body\n"))))
(defun find-tex-def-many (name n &optional body)
  (find-estring (tex-def-many name n body)))



;; «agda»  (to ".agda")
;; (find-es "agda")
;; (find-angg ".emacs.papers" "agda")
(code-c-d "agdastdlib" "/usr/lib/agda-stdlib")
;; (find-agdastdlibfile "")


;; «luarocks»  (to ".luarocks")
;; (find-es "lua5" "luarocks")
;; (find-angg "LUA/lua50init.lua" "userocks")
(code-c-d "luarockssrc"   "~/usrc/luarocks-2.0.4/")
(code-c-d "luarocks"      "~/usrc/luarocks/")
(code-c-d "luarocksrocks" "~/usrc/luarocks/lib/luarocks/rocks/")
(code-c-d "luarocks51"    "~/usrc/luarocks/share/lua/5.1/luarocks/")
;; (find-luarockssh "find * | sort")
;; (find-luarocksfile "")
;; (find-luarocksfile "etc/luarocks/config.lua")

;; «ltcltk»  (to ".ltcltk")
;; (find-es "lua5" "ltcltk")
;; (find-luarocks-links "ltcltk")
;; (find-luarocks-links "ltcltk" "0.9-2" "")
(code-c-d "ltcltk" "~/usrc/ltcltk-0.9-2/")
;; (find-ltcltkfile "")

;; (find-lposixfile "")
(code-c-d "lposix" "~/usrc/posix/")
;; (find-luarocksfile "lib/luarocks/rocks/lposix/20031107-1/lposix-20031107-1.rockspec")

;; (find-luarocks-links "alien" "0.5.0-1")
;; (find-luarocks-links "copas" "1.1.6-1")
;; (find-luarocks-links "coxpcall" "1.13.0-1")
;; (find-luarocks-links "lpeg" "0.10-1")
;; (find-luarocks-links "lposix" "" "20031107-1")
;; (find-luarocks-links "ltcltk" "0.9-1")
;; (find-luarocks-links "luafilesystem" "1.5.0-1")
;; (find-luarocks-links "luagl" "1.01-1")
;; (find-luarocks-links "luasocket" "2.0.2-3")
;; (find-luarocks-links "xavante" "2.2.1-1")








;; http://www.uff.br/eleicoesreitoria2006/normas/rgce.pdf
(code-xpdf      "rgce" "$S/http/www.uff.br/eleicoesreitoria2006/normas/rgce.pdf")
(code-pdftotext "rgce" "$S/http/www.uff.br/eleicoesreitoria2006/normas/rgce.pdf")
;; (find-rgcepage 1 "Contents")
;; (find-rgcetext "")

(code-djvu "quotsandcovers" "~/tmp/quotient_topologies_and_covers.djvu")
;; (find-quotsandcoverspage      1  "Contents")



;; «rubyforth»  (to ".rubyforth")
;; (find-es "rubyforth" "rubyforth")
(code-c-d "rubyforth" "~/usrc/rubyforth/" :anchor)
(defun eepitch-rubyforth () (interactive)
  (ee-eepitch-comint (ee-rubyforthfile "") "rubyforth" "./rubyforth"))

;; (defun eepitch-rubyforth (&optional rubyforthargs)
;;   (interactive)
;;   (ee-eepitch-comint (ee-rubyforthfile "")
;;                      (format   "rubyforth%s" (or rubyforthargs ""))
;;                      (format "./rubyforth%s" (or rubyforthargs ""))))
;;
;; «pythonforth»  (to ".pythonforth")
;; (defun eepitch-pythonforth (&optional pythonforthargs)
;;   (interactive)
;;   (ee-eepitch-comint (ee-pythonforthfile "")
;;                      (format   "pythonforth%s" (or pythonforthargs ""))
;;                      (format "./pythonforth%s" (or pythonforthargs ""))))


;; «eepitch-rubyforth»  (to ".eepitch-rubyforth")
;; (find-es "fortho")
;; (find-es "fortho" "rubyforth-demos")
;; (find-es "fortho" "rubyforth")
;; (find-es "fortho" "rubyforth-angg")
;; (code-c-d "rubyforth" "/tmp/rubyforth/rubyforth-0.18/" :angg)
;; (find-rubyforthfile "")
;;   (ee-rubyforthfile "")
;; (code-c-d "rubyforth" "~/usrc/rubyforth-0.23/" :anchor)



;; «eepitch-dednat4»  (to ".eepitch-dednat4")
;; (find-angg "LUA/lua50init.lua" "load_dednat4")
;; (find-es "xypic" "eepitch-dednat4")
;; (find-es "dednat" "eepitch-dednat4")
;; (eepitch-kill)
;; (eepitch-dednat4)
(defun eepitch-dednat4 () (interactive)
  (eepitch-comint "dednat4" "lua51 -e load_dednat4() -i"))


;; «duoforths»  (to ".duoforths")
(code-c-d "duoforths" "~/duoforths/" :anchor)
;; (find-duoforthsfile "")

;; «rubyforth»  (to ".rubyforth")
;; (find-es "rubyforth" "rubyforth")

;; «dflua»  (to ".dflua")
;; (find-es "rubyforth" "dflua")
(code-c-d "dflua" "~/usrc/df-lua-0.0.3/")
(defun eepitch-dflua () (interactive)
  (ee-eepitch-comint ee-dfluadir "dflua" "lua51 forth.lua"))
;; (find-dfluafile "")
;; (find-es "rubyforth" "dflua")

;; «zbforth»  (to ".zbforth")
;; (find-es "rubyforth" "zbforth")
(code-c-d "zbforth" "~/usrc/zbforth-0.0.1d/")
(defun eepitch-zbforth () (interactive)
  (ee-eepitch-comint ee-zbforthdir "zbforth" "zbforth"))



;; «pulseaudio»  (to ".pulseaudio")
;; (find-es "alsa" "pulseaudio")
;; (find-es "sound" "pulseaudio")
(defun eepitch-pacmd () (interactive) (eepitch-comint "pacmd" "pacmd"))
(defun find-pacmd0 (cmd)
  (apply 'find-sh0 (format "echo '%s' | pacmd" cmd) rest))
(defun find-pacmd (cmd &rest rest)
  (apply 'find-sh (format "echo '%s' | pacmd" cmd) rest))
;;
;; (find-pacmd "help")
;; (find-pacmd "play-file /usr/share/sounds/question.wav 0")





(defun eepitch-turquia () (interactive)
  (eepitch '(find-comintprocess "ssh turquia" "ssh llarc@turquia")))
(defun eepitch-brasil () (interactive)
  (eepitch '(find-comintprocess "ssh brasil"  "ssh llarc@brasil")))
(defun eepitch-jamaica () (interactive)
  (eepitch '(find-comintprocess "ssh jamaica" "ssh llarc@jamaica")))
(defun eepitch-canada () (interactive)
  (eepitch '(find-comintprocess "ssh canada"  "ssh llarc@canada")))
(defun eepitch-gana () (interactive)
  (eepitch '(find-comintprocess "ssh gana"    "ssh llarc@gana")))
(defun eepitch-papua () (interactive)
  (eepitch '(find-comintprocess "ssh papua"   "ssh llarc@papua")))

(code-c-d "turquia" "/scp:llarc@turquia:")
(code-c-d "brasil"  "/scp:llarc@brasil:")
(code-c-d "jamaica" "/scp:llarc@jamaica:")
(code-c-d "canada"  "/scp:llarc@canada:")
(code-c-d "gana"    "/scp:llarc@gana:")
;; (find-ganafile "")
(code-c-d "papua"   "/scp:llarc@papua:")

(defun eepitch-persephone () (interactive)
  (eepitch '(find-comintprocess "ssh persephone" "ssh edrx@persephone")))
(defun eepitch-horses () (interactive)
  (eepitch '(find-comintprocess "ssh horses" "ssh edrx@horses")))
(defun eepitch-gwen () (interactive)
  (eepitch '(find-comintprocess "ssh gwen" "ssh edrx@gwen")))
(defun eepitch-gwenv () (interactive)
  (eepitch '(find-comintprocess "ssh gwen" "ssh valeria@gwen")))
(defun eepitch-reef () (interactive)
  (eepitch-de '(find-comintprocess "ssh reef" "ssh edrx@reef")))

(code-c-d "persephone" "/scp:edrx@persephone:")
(code-c-d "horses" "/scp:edrx@horses:")
(code-c-d "gwen"  "/scp:edrx@gwen:")
(code-c-d "gwenv" "/scp:valeria@gwen:")
(code-c-d "reef" "/scp:edrx@reef:")


;; (find-persephonefile "")
;; (find-horsesfile "")
;; (find-gwenfile "")
;; (find-reeffile "")


;; «tramp-2.1.9»  (to ".tramp-2.1.9")
;; (find-es "emacs" "tramp-2.1.9")
;; (find-fline "~/usrc/tramp-2.1.9/lisp/")
;; (find-fline "~/usrc/tramp-2.1.9/info/")
;; (find-trampnode "Password caching")
;; (find-trampnode "Password caching" "`password.el'")
;; (find-node "(tramp)Password handling")
;; (find-trampfile "contrib/")
;; (find-trampfile "contrib/password.el")
;; (find-trampnode "Multi-hops")
;; (find-trampnode "Multi-hops" "\\\\`root\\\\'")
;; (find-evardescr 'tramp-default-proxies-alist)
;;
(code-c-d "tramp" "~/usrc/tramp-2.1.9/" "tramp")
(code-c-d "tramp" "~/usrc/tramp-2.1.9/" "~/usrc/tramp-2.1.9/info/tramp")
(require 'info)
;; (add-to-list         'Info-directory-list "~/usrc/tramp-2.1.9/info/")
;; (add-to-list 'Info-default-directory-list "~/usrc/tramp-2.1.9/info/")
(add-to-list 'load-path           "~/usrc/tramp-2.1.9/lisp/")
(add-to-list 'load-path           "~/usrc/tramp-2.1.9/contrib/")
;;
(setq tramp-default-proxies-alist nil)
(add-to-list 'tramp-default-proxies-alist '("\\.k8\\.com\\.br\\'" "\\`root\\'" "/ssh:%h:"))
(setq password-cache-expiry nil)
;;
;; (require 'tramp)
;; tramp-version
;; ^ should be 2.1.9
;; (find-efile "net/trampver.el" "defconst tramp-version")
;; ^ in cvs-emacs tramp is 2.0.55.



;; «varda»  (to ".varda")
(defun eepitch-varda () (interactive)
  (eepitch '(find-comintprocess "varda" "ssh edrx@varda")))
(defun eepitch-vardav () (interactive)
  (eepitch '(find-comintprocess "varda" "ssh valeria@varda")))
(code-c-d "varda"  "/scp:edrx@varda:/")
(code-c-d "varda"  "/ssh:edrx@varda:/")
(code-c-d "vardar" "/ssh:root@varda:/")
(code-c-d "vardav" "/scp:valeria@varda:")
;;
;; (find-vardafile "")
;; (find-vardarfile "")
;; (setenv "VA" "/ssh:edrx@varda:")
;; (setenv "VR" "/ssh:root@varda:")
;; (find-fline "$VR/")
;;
;; (find-es "emacs" "multi-hop")
;;(setq         tramp-default-proxies-alist nil)
;;(add-to-list 'tramp-default-proxies-alist '("varda\\'" "\\`root\\'" "/ssh:%h:"))
;;(add-to-list 'tramp-default-proxies-alist '("lugao\\'" "\\`root\\'" "/ssh:%h:"))
;; (find-angg ".emacs.templates" "find-newhost-links")

;; «find-newhost-links»  (to ".find-newhost-links")
;; (find-fline "/etc/hosts")
;; (find-newhost-links "gwen"  "192.168.1.101" "GW")
;; (find-newhost-links "varda" "192.168.1.100" "VA")
;; (find-newhost-links "flaviobia" "192.168.0.198")
;; (find-newhost-links "flaviobia" "192.168.1.126")

;; «apt-cacher»  (to ".apt-cacher")
;; (find-es "debrepository" "apt-cacher")
;; (to "LR-and-RE-and-RR")
(code-c-d "aptcacher" "/var/cache/apt-cacher/")
;; (find-aptcacherfile "")
;; (find-aptcacherfile "packages/")
;; (find-aptcachersh "find * | sort")
;; (find-aptcachersh "du -c")
;; (find-fline "/var/log/apt-cacher/")
;; (find-sh "ps ax")
;; (find-sh "ps ax | grep cache")
;; (find-sh "sudo /etc/init.d/apt-cacher restart")




(code-c-d "RETRO" "~/RETRO/" :anchor)


;; This is useful for some situations in which tramp has bugs
;; (find-node "(emacs)Backup")
(defun bup () (interactive)
  (make-local-variable 'backup-inhibited)
  (setq backup-inhibited (not backup-inhibited))
  (message "backup-inhibited is now %S" backup-inhibited))







;; «blogme4-texi»  (to ".blogme4-texi")
;; (find-blogme4 "doc/blogme4.b4texi")
;; (find-efunction 'ee-gformat)

(defun ee-delete-and-extract-line-body ()
  (ee-no-trailing-nl
   (ee-no-properties
    (ee-delete-and-extract-line 1))))

(defun ee-gformat00 (pat fmt)
  `(lambda (str) (replace-regexp-in-string ,pat ,fmt str 'fixedcase)))

(defun ee-gformat1 (fmt)
  (ee-gformat00 "\\`[ \t]*\\([^ \t]+\\)[ \t]+\\(.*\\)\\'" fmt))

(defun ee-wrap-line (fun)
  (insert (funcall fun (ee-delete-and-extract-line-body)))
  (next-line 1))

(defun nd () (interactive)
  (ee-wrap-line (ee-gformat1
" # «.\\1»	(to \"\\1\")
\[ANODE «\\1»  (to \".\\1\")
  (find-blogme4node \"\\2\")
  [J \\2]
\[LE'
]
]\n
")))


;; (find-blogme4 "doc/blogme4.b4texi")
;; (find-find-links-links "b4texi" "dir stem")
;; (find-b4texi-links)
;; (find-b4texi-links "blogme4/doc/" "eev")

(defun find-b4texi-links (&optional dir stem &rest rest)
  "Visit a temporary buffer containing hyperlinks for b4texi."
  (interactive)
  (setq dir (or dir "{dir/}"))
  (setq stem (or stem "{stem}"))
  (apply 'find-elinks `(
    ;; Convention: the first sexp always regenerates the buffer.
    (find-b4texi-links ,dir ,stem ,@rest)
    (find-angg ,(format "%s%s.b4texi" dir stem))
    ;; Body:
    ""
    ,(ee-template `(dir stem ("foo" ,"AAA")) "\
\[#
\(defun c () (interactive)
  (find-sh \"cd ~/{dir} &&
            blogme4.lua -o {stem}.texi -i {stem}.b4texi &&
            makeinfo {stem}.texi\"))
\(defun i () (interactive) (find-node \"({stem})Top\"))
\(defun ii () (interactive) (find-angg \"{dir}{stem}.b4texi\"))
;;
;; (find-sh0 \"cd ~/info/ && rm -v {stem}.info\")
;; (find-sh0 \"cd ~/info/ && ln -s ../{dir}{stem}.info .\")
;; (find-angg \"info/\")
;; (find-node \"({stem})Top\")
;;
;; (find-blogme4 \"texinfo.lua\")
;; (find-angg \".emacs\" \"nd\")
#]
\[# Nodes:
#]


\[TOP {stem} [J The {stem} manual]
  body
\]
\[lua:
  tt.srclink_fmt  = '(find-angg \"{dir}{stem}.b4texi\" \"%s\")'
  tt.infolink_fmt = '(find-node \"({stem})%s\")'
\]

\[lua: blogme_output = tt:full_texi() ]
\[#
 # Local Variables:
 # coding: raw-text-unix
 # modes: (fundamental-mode blogme-mode)
 # End:
#]
")
    ) rest))

;; (find-b4texi-links "blogme4/doc/" "eev")
;; (find-angg "blogme4/doc/eev.b4texi")



(code-c-d "apachedoc" "/usr/share/doc/apache2-doc/manual/en/")
;; (find-apachedocfile "")
;; (find-apachedocfile "mod/")
;; (find-apachedocw3m "mod/mod_rewrite.html")

;; «quadro»  (to ".quadro")
;; «olympus»  (to ".olympus")
;; (find-books "__comp/__comp.el" "gersting")
(code-c-d "olymp" "/tmp/pen/DCIM/100OLYMP/")
(code-c-d "QUADRO" "~/FOTOS/QUADRO/")
(defun find-QUADRO (fname &rest rest) (xz (ee-QUADROfile fname)))
;; (find-QUADROfile "")
;; (find-QUADRO "")
;; (find-QUADRO "2011-09-29-MD-1.jpg")
;; (find-QUADRO "2011-09-29-MD-2.jpg")
;; (find-QUADRO "2011-09-29-MD-3.jpg")
;; (find-QUADRO "2011-09-30-GA-1.jpg")
;; (find-QUADRO "2011-09-30-GA-2.jpg")
;; (find-QUADRO "2011-10-05-MD-1.jpg")
;; (find-QUADRO "2011-10-05-MD-2.jpg")
;; (find-QUADRO "2011-10-05-MD-3.jpg")
;; (find-QUADRO "2011-10-06-MD-1.jpg")
;; (find-QUADRO "2011-10-06-MD-2.jpg")
;; (find-QUADRO "2011-10-06-MD-3.jpg")
;; (find-QUADRO "2011-10-06-MD-4.jpg")
;;
;; (find-QUADRO "2011-10-13-MD-1.jpg")
;; (find-QUADRO "2011-10-13-MD-2.jpg")
;; (find-QUADRO "2011-10-13-MD-3.jpg")
;; (find-QUADRO "2011-10-13-MD-4.jpg")
;; (find-QUADRO "bel-subconjunto.jpg")
;; (find-QUADRO "bel-tabela-pertinencia.jpg" "tabela" "diagrama de arvore")
;; (find-olympfile "")
;; (find-pen-links)
;; (find-sh "dmesg | grep sd")
;; (find-sh "sudo mount -o uid=$UID /dev/sdb1 /tmp/pen/")
;; (find-sh0 "sudo umount /tmp/pen")
' (find-3 ' (find-olympfile "")
	  ' (find-QUADROfile "")
            )
;; (find-QUADROfile "" "2011-10-06-MD-1")


;; «scala»  (to ".scala")
;; (find-es "scala")
(defun eepitch-scala () (interactive)
  (eepitch-de '(find-comintprocess "scala" "scala")))

;; «clojure»  (to ".clojure")
;; (find-es "clojure")
(defun eepitch-clojure () (interactive)
  (eepitch '(find-comintprocess "clojure" "clojure -r")))

;; «J»  (to ".J")
;; (find-es "apl" "J")
;; (find-es "apl" "J-primer")
;; (find-es "apl" "learning-J")
(code-c-d "J"         "~/usrc/j/j701/")
(defun eepitch-J () (interactive)
  (eepitch-comint-de "J" (ee-Jfile "bin/jconsole")))

;; (code-c-d "Jlearning" "~/usrc/j/j701/addons/docs/help/learning/")
(code-c-d "Jdocs"     "~/usrc/j/j701/addons/docs/")
(code-c-d "Jhelp"     "~/usrc/j/j701/addons/docs/help/")
(code-c-d "Jprimer"   "~/usrc/j/j701/addons/docs/help/primer/")
(code-c-d "learningJ" "~/usrc/j/j701/addons/docs/help/learning/")
(code-c-d "Jsrc"      "~/usrc/jgplsrc/")

;; (find-Jfile "")
;; (find-Jdocsfile "")
;; (find-Jhelpfile "")
;; (find-Jprimerfile "")
;; (find-Jsrcfile "")
;; (find-Jlearningfile "")
;; (find-Jlearningw3m "contents.htm")
;; (find-Jhelpfile "")
;; (find-Jhelpw3m "dictionary/contents.htm")
;; (find-Jhelpw3m "jforc/contents.htm")
;; (find-Jhelpw3m "phrases/contents.htm")
;; (find-Jhelpw3m "user/boxdraw.htm")
;; (find-Jhelpw3m "user/contents.htm")
;; (find-Jhelpw3m "user/emacs.htm")


;; «octave»  (to ".octave")
;; (find-es "octave")
(code-c-d "octave"    "/usr/share/octave/3.2.4/m/" "octave")
(code-c-d "octavefaq" "/usr/share/octave/3.2.4/m/" "Octave-FAQ")
(defun eepitch-octave () (interactive) (eepitch-comint "octave" "octave"))
;; (find-octavefile "")
;; (find-octavenode "")
;; (find-octavenode "Matrix Manipulation")
;; (find-octavefaqnode "")

;; «maxima»  (to ".maxima")
;; (to "maxima-cvs")
;; (find-es "maxima")
(code-c-d "maxima"    "/usr/share/maxima/5.21.1/src/" "maxima")
(code-c-d "xmaxima"   "/usr/share/maxima/5.21.1/src/" "xmaxima")
(code-c-d "maximasrc" "/usr/share/maxima/5.21.1/src/")
(code-c-d "maximael"  "/usr/share/emacs/site-lisp/maxima/")
(defun eepitch-maxima () (interactive) (eepitch-comint "maxima" "maxima"))
;; (find-maximafile "")
;; (find-maximasrcfile "")
;; (find-maximaelfile "")
;; (find-maximanode "")
;; (find-maximanode "Introduction to Maxima")
;; (find-maximagrep "grep -nH -e integrate *.lisp")
;; (find-maximagrep "grep -niH -e prompt *.lisp")
;; (find-maximanode "Introduction to draw")
;; (find-xmaximanode "")

;; «R»  (to ".R")
;; (find-es "r" "pager")
;; (find-es "r" "R-sample")
(defun eepitch-R () (interactive)
  (eepitch `(let ((process-environment `("PAGER=cat" . ,process-environment)))
	      (find-comintprocess "R" "R"))))

;; «joy»  (to ".joy")
;; (find-es "joy" "joy")
;; (find-joyfile "")
(code-c-d "joy" "~/usrc/joy/")
(defun eepitch-joy () (interactive)
  (eepitch-comint-at ee-joydir "joy" "joy"))




;; «cc-mode»  (to ".cc-mode")
;; (find-es "emacs" "C-mode")
(code-c-d "ccmode" (ee-efile "progmodes/") "ccmode")
(setq-default c-electric-flag nil)




;; «eevbuild»  (to ".eevbuild")
;; (find-es "eev" "dh-make-2")
;; (find-dhmake-links "eev" "eevbuild" "20110612")
;; (find-dhmake-links "eev" "eevbuild" "20120404")
(code-c-d "eevbuild"   "~/usrc/eev/eev-0.1.20110612/")
(code-c-d "eevbuildd"  "~/usrc/eev/eev-0.1.20110612/debian/")
(code-c-d "eevbuilddd" "~/usrc/eev/eev-0.1.20110612/debian/eev/")
(code-c-d "eevbuildu"  "~/usrc/eev/eev-unpacked/")
;; (find-eevbuildfile   "")
;; (find-eevbuilddfile  "")
;; (find-eevbuildddfile "")
;; (find-eevbuildufile  "")
;; (find-eevbuildddsh "find * | sort")
;; (find-eevbuildush  "find * | sort")
;; (find-status   "eev")
;; (find-vldifile "eev.list")
;; (find-udfile   "eev/")
;; (find-fline "/etc/emacs/site-start.d/90eev.el")

;; «eev-puro»  (to ".eev-puro")
;; (find-angg ".emacs.templates" "find-dhmake-links")
;; (find-dhmake-links "eev-puro" "eevpuro" "20111114")
;; (find-dhmake-links "eev-puro" "eevpuro" "20111204")
;; (find-dhmake-links "eev-puro" "eevpuro" "20111230")
;; (find-eepitch-buffer "shell" "ssh -X valeria@gwen emacs")

;; «eev-puro-deb»  (to ".eev-puro-deb")
;; (find-angg "eev-puro/do-build.sh")
;; (find-sh "~/eev-puro/do-build.sh")
;; (find-angg "eev-puro/do-install.sh")
;; (find-sh "~/eev-puro/do-install.sh")
;; (find-eepitch-buffer "eshell" "cp -v ~/usrc/eev-puro/eev*.deb $RE/tmp/")
;; (find-eepitch-buffer "RE" "sudo dpkg -i /tmp/eev*.deb")
;; (find-eepitch-buffer "shell" "ssh -X valeria@gwen emacs")
;; (find-anggfile "eev-puro/.emacs")
;; (find-fline "$RE/usr/share/eev-puro/.emacs")
;;
;; (find-status   "eev-puro")
;; (find-vldifile "eev-puro.list")
;; (find-udfile   "eev-puro/")
;; (find-angg "eev-puro/")
;; (find-angg "eev-puro/debian/")
;; (find-angg "eev-puro/debian/rules")
;;
;; (find-dhmake-links "eev-puro" "eevpuro" "20111204")
;; (find-dhmake-links "eev-puro" "eevpuro" "20111114")
' (ee-cp     "~/usrc/eev-puro/eev-puro_0.1.20111114_all.deb"
	 (ee-twusfile "debian/eev-puro_0.1.20111114_all.deb")
	 'over)
;; (find-angg "eev-puro/")
;; (find-angg "eev-puro/.emacs")
;; (find-fline "/usr/share/eev-puro/")
;; (find-fline "/usr/share/eev-puro/mini-lua-intro.e")
(code-c-d "eevpuro"    "~/usrc/eev-puro/eev-puro-0.1.20111114/")
(code-c-d "eevpurod"   "~/usrc/eev-puro/eev-puro-0.1.20111114/debian/")
(code-c-d "eevpurodd"  "~/usrc/eev-puro/eev-puro-0.1.20111114/debian/eev-puro/")
(code-c-d "eevpurounp" "~/usrc/eev-puro/eev-puro-unpacked/")
;; (find-eevpurofile    "")
;; (find-eevpurodfile   "")
;; (find-eevpuroddfile  "")
;; (find-eevpurounpfile "")
;; (find-eevpurodsh   "find * | sort")
;; (find-eevpuroddsh  "find * | sort")
;; (find-eevpurounpsh "find * | sort")
;; (find-status   "eev-puro")
;; (find-vldifile "eev-puro.list")
;; (find-udfile   "eev-puro/")


;; «LR-and-RE-and-RR»  (to ".LR-and-RE-and-RR")
;; (to "apt-cacher")
;; (find-es "emacs" "multi-hop")
;; (find-es "kernel" "lugao")
;; (find-es "debrepository" "apt-cacher")
;; LR: localhost as root
;; RE: remote as edrx
;; RR: remote as root

;; (find-fline "/etc/hosts")
(setenv "LR" "/sudo::")
(setenv "RE"  "/ssh:edrx@lugao:")
(setenv "RR" "/sudo:root@lugao:")
(code-c-d "LR" (ee-expand "$LR/"))
(code-c-d "RE" (ee-expand "$RE/"))
(code-c-d "RR" (ee-expand "$RR/"))
(defun eepitch-RE () (interactive) (eepitch-comint "lugao" "ssh edrx@lugao"))
(defun eepitch-RR () (interactive) (eepitch-comint "lugao/R" "ssh edrx@lugao"))

;; (find-LRfile "etc/")
;; (find-REfile "etc/")
;; (find-RRfile "etc/")
;; (find-lugaorfile "")
(defun eepitch-lugao () (interactive) (eepitch-comint "lugao" "ssh edrx@lugao"))

;; «ee-tramp-proxy»  (to ".ee-tramp-proxy")
(defun ee-tramp-proxy (host proxy)
  (setq         tramp-default-proxies-alist nil)
  (add-to-list 'tramp-default-proxies-alist
	       `(,(format "\\`%s\\'" host) "\\`root\\'" ,proxy))
  tramp-default-proxies-alist)

;; (describe-variable 'tramp-default-proxies-alist)
(defun find-RR3 (fname &rest rest)
  (find-3 `(find-fline ,(format "/%s" fname) . ,rest)
	  `(find-RRfile ,fname)))

(defun eepitch-comint-de-at (dir name program-and-args)
  (ee-at0 dir `(eepitch-comint-de ,name ,program-and-args)))

(defun eepitch-gdb-lua () (interactive)
  (eepitch-comint-de "gdb lua" `("gdb" ,(ee-lua51file "bin/lua"))))

;; (find-efunction 'find-dn4tex-links)
;; (find-dn4tex-links)
(defun wrobak (n code)
  "With the rest of this buffer as a new kill, execute CODE"
  (next-line n)
  (eek "C-a C-SPC M-> C-x C-x M-w")
  (eval code))


(seen 13050)


;; «ee-splitn»  (to ".ee-splitn")
;; «ee-wrapt»  (to ".ee-wrapt")
;; «ee-wrapc»  (to ".ee-wrapc")

;; (describe-function 'ee-splitn)
;; (describe-function 'ee-zip)
;; (describe-function 'ee-wrapt)
;; (describe-function 'ee-wrapc)
;; (find-efunction 'ee-wrap-file)
;; (find-efunction 'ee-pph)
;; (find-efunction 'ee-pp0)
;; (find-efunction 'find-elinks)
;;
;; (find-efunction 'ee-pp0)
;; (find-efunction 'ee-pph)
;; (find-efunction 'find-elinks)

;; (find-eev "eev-insert.el" "ee-wrap-file")
;; (find-eev "eev-insert.el" "ee-delete-extract-wrap")
;; (find-eev "eev-insert.el" "ee-delete-and-extract-line")
;; (find-eev "eev-insert.el" "ee-links-to-string")

;; mkto needs to be rewritten.
;; find-elinks needs to be rewritten.
;; ee-zipp is a wild hack, incomplete.
;; intention: uppercase -> quoted in patterns
(defun ee-zipp (list1 list2)
"Example: (ee-zipp '(\"a\" \"b\") '(\"aa\" \"bb\"))
            --> ((a aa) (b bb) (c cc))?"
  (if list1
      `((,(car list1)          ,(car list2))
	(,(upcase (car list1)) ,(car list2))
	. ,(ee-zip (cdr list1) (cdr list2)))))



(code-c-d "libc" "/usr/share/doc/glibc-doc-reference/html/" "libc")
;; (find-libcfile "")
;; (find-libcnode "")





;; «binutils»  (to ".binutils")
;; (find-es "anatocc" "binutils")
(code-c-d "binutils" "/usr/lib/ldscripts/" "binutils")
;; (find-binutilsfile "")
;; (find-binutilsnode "")

;; «wget»  (to ".wget")
;; (find-es "wget")
(code-c-d "wget" "$S/" "wget")
;; (find-wgetnode "")




;; «ee-popup»  (to ".ee-popup")
;; (find-es "fvwm" "style:bare")
;; (find-es "x" "xpad" "ffee99")
;; (find-es "console" "terminfo")
;; (find-man "5 terminfo" "cursor_invisible")
;; (find-man "1 infocmp")
;; (find-sh "infocmp xterm" "civis=")
;;
(defun ee-popup-prepare (delay str)
  (ee-write-string str "/tmp/msg")
  (ee-write-string
   (format "#!/bin/sh
       cat /tmp/msg
       echo -n '\e[?25l'
       sleep %f" delay)
   "/tmp/msg.sh" "755"))

(defun ee-popup-run (args)
  (find-sh0 (format "xterm -class Bare %s -e /tmp/msg.sh" args)))

(defun ee-popup-size (str)
  (let ((width (apply 'max (mapcar 'length (split-string str "\n"))))
	(height (+ 1 (length (replace-regexp-in-string "[^\n]+" "" str)))))
    (format "%dx%d" width height)))

(defun ee-popup-args (where str)
  (format "-bg '#ffee99' -fg black -geometry %s%s"
	  (ee-popup-size str) where))

(defun ee-popup0 (delay where str)
  (ee-popup-prepare (or delay 1) str)
  (ee-popup-run (ee-popup-args where str)))

;; (ee-popup0 2 "+0+0" "foo\nbar plic")
;; (ee-popup0 1 "+100+30" "foo\nbar plic")


;; «fullscreen»  (to ".fullscreen")
;; (find-es "x" "wmctrl")
(defun fullscreen (&optional arg)
  (interactive "P")
  (setq arg (or arg 1))
  (if (> arg 0)
      (find-sh0 "wmctrl -r :ACTIVE: -b add,fullscreen")
    (find-sh0 "wmctrl -r :ACTIVE: -b remove,fullscreen")))


;; «find-wset»  (to ".find-wset")
;; (find-eev "eev-multiwindow.el" "find-wset")

;; Test:
' (find-wset "1_3o_2o_o"
    ' (find-fline "~/TODO")
    ' (find-ebuffer "*shell*")
    ' (find-ebuffer "*shell 2*")
    )



;; «inet-addr»  (to ".inet-addr")
;; (find-angg "bin/etc.lua" "inet_addr")
;; (inet-addr)
(defun inet-addr (&optional interface)
  (find-sh0 (format "/sbin/ifconfig %s | etc.lua inet_addr"
                    (or interface "wlan0"))))


;; «cleanindex»  (to ".cleanindex")
;; (find-angg "bin/etc.lua" "cleanindex")
(defun cleanindex (start end) 
  (interactive "r")
  (shell-command-on-region
   start end
   (format "etc.lua cleanindex %s %s" ee-page-stem ee-page-offset)
   nil 'replace))




;; «virtualbox»  (to ".virtualbox")
;; (find-es "qemu" "virtualbox")
(code-xpdf      "virtualboxmanual" "/usr/share/doc/virtualbox/UserManual.pdf")
(code-pdftotext "virtualboxmanual" "/usr/share/doc/virtualbox/UserManual.pdf" 0)
;; (find-virtualboxmanualpage 1 "Contents")
;; (find-virtualboxmanualpage 2 "Index")
;; (find-virtualboxmanualtext "")




;; «gab»  (to ".gab")
;; (find-angg "gab/")
;; (find-angg "eev-puro/.emacs")
;; (find-fline "/usr/share/eev-puro/gab.lua")
;; (find-fline "/usr/share/eev-puro/gab-tests.lua")
;; (find-dn5 "gab.lua")
;; (find-dn5 "gab-tests.lua")
;;
(defun eepitch-gab () (interactive)
  (eepitch-comint-at "~/dednat5/" "gab.lua" "lua5.1 -l gab"))
(defun eepitch-gab () (interactive)
  (eepitch-comint-at "~/gab/" "gab.lua" "lua5.1 -l gab"))

(code-c-d "gab" "~/gab/" :anchor)
;; (find-gab "")



;; «find-rawcat»  (to ".find-rawcat")
;; (find-efunction 'find-eoutput-reuse)
;; (find-rawcat "~/eev-puro/mini-lua-intro.e")
;; (find-rawcat "~/eev-puro/mini-lua-intro.e" "intro:PP")
;;
(defun find-rawcat (fname &optional tag &rest rest)
  (apply
   'find-eoutput-reuse
   (format "*cat %s*" fname)
   `(progn 
      (set-buffer-file-coding-system 'raw-text-unix 'force)
      (set-buffer-multibyte nil)
      (insert (ee-read-file ,fname)))
   (if (stringp tag) (ee-format-as-anchor tag))
   rest))


(defun raw-text-unix0 () (interactive)
  (set-buffer-file-coding-system 'raw-text-unix 'force)
  (set-buffer-multibyte nil))

(defun raw-text-unix (&optional arg) (interactive "P")
  (set-buffer-file-coding-system 'raw-text-unix 'force)
  (set-buffer-multibyte nil)
  (insert (format "
%sLocal Variables:
%scoding: raw-text-unix
%sEnd:
" ee-hyperlink-prefix ee-hyperlink-prefix ee-hyperlink-prefix)))






;; (find-efunction 'ee-wrap-code-c-d)
(defun ee-wrap-mkdir ()
  (interactive)
  (ee-wrapt "d" "\
rm -Rv {d}
mkdir  {d}
cd     {d}"))


;; (find-status   "coreutils")
;; (find-vldifile "coreutils.list")
;; (find-udfile   "coreutils/")
(code-c-d "coreutils" "/usr/share/doc/coreutils/" "coreutils")
;; (find-coreutilsfile "")
;; (find-coreutilsnode "")

(defun card () (interactive) (find-angg ".asoundrc"))


;; «estagios»  (to ".estagios")
(code-c-d "purouff-tk-"
	  "/ftp:purouff@estagios.purouff.tk:/public_html/")
(code-c-d "estagios-purouff-tk-"
	  "/ftp:purouff@estagios.purouff.tk:/public_html/estagios/")
(setenv   "ESTAGIOS"
	  "/ftp:purouff@estagios.purouff.tk:/public_html/estagios/")
(defun eepitch-ftpestagios ()
  (interactive) (eepitch-comint "ftp estagios" "pftp estagios.purouff.tk"))
;; (find-purouff-tk-file          "")
;; (find-estagios-purouff-tk-file "")
;; (find-puroufftkfile "")
;; (find-puroufftkfile "estagios/")






(defun ee-evincepage (fname &optional page)
  `("evince"
    ,@(if page (list (format "--page-label=%d" page)))
    ,fname))

(defun find-evincepage  (fname &optional page &rest rest)
  (find-bgprocess (ee-evincepage fname page)))


;; «chomsky» (to ".chomsky")
;; (find-fline "/sda5/torrents/Consenso_fabricado/")
;; (find-fline "/sda5/videos/" "Consenso_Fabricado_-_Chomsky_e_a_M_dia_TVE_VHS-1IFKcdwCpwM.mp4")
;; (find-fline "/sda5/videos/Consenso_Fabricado_-_Chomsky_e_a_M_dia_TVE_VHS-1IFKcdwCpwM.mp4")

(code-video "chomskyleg" "/sda5/DVDs/chomsky-leg/chomsky-leg.avi")
(code-video "consenso" "/sda5/torrents/Consenso_fabricado/Consenso Fabricado - Chomsky e a Midia (TVE, VHS).avi")
(code-video "cf"       "/sda5/torrents/Consenso_fabricado/Consenso Fabricado - Chomsky e a Midia (TVE, VHS).avi")
(code-video "cf"       "/sda5/videos/Consenso_Fabricado_-_Chomsky_e_a_M_dia_TVE_VHS-1IFKcdwCpwM.mp4")
;; (find-chomskyleg)
;; (find-consenso)
;; (find-consenso "12:53" "Foucault")

;; (eev-avadj-mode 1)
;; (find-consenso t)
;; (find-cf t)
;; 12:53 foucault
;; 2:00:00

;; (find-anggfile "manufacturing.srt" "but, at the core, sort of similar values")
(defun find-mcsrt (&rest pos) (apply 'find-fline "~/manufacturing.srt" pos))
;; (find-mcsrt "but, at the core, sort of similar values")
;; (find-es "chomsky")




;; «ee-rmprefix» (to ".ee-rmprefix")
;; «ee-killurl» (to ".ee-killurl")
(defun ee-rmprefix (prefix fname &optional newprefix)
  (setq prefix (ee-expand prefix))
  (setq fname  (ee-expand fname))
  (if (ee-prefixp prefix fname)
      (concat (or newprefix "")
	      (ee-remove-prefix prefix fname))))

(defun ee-fname-to-url0 (fname)
  (or (ee-rmprefix  "$S/http/" fname "http://")
      (ee-rmprefix "$S/http/s" fname "https://")
      (ee-rmprefix   "~/TH/L/" fname "http://angg.twu.net/")
      (ee-rmprefix   "~/TH/R/" fname "http://angg.twu.net/")
      (ee-rmprefix        "~/" fname "http://angg.twu.net/")
      (ee-rmprefix  ee-twusdir fname "http://angg.twu.net/")
      (ee-rmprefix  ee-twupdir fname "http://angg.twu.net/")
      ))

(defun ee-fname-here ()
  (or (and (eq major-mode 'dired-mode) (ee-dired-to-fname))
      buffer-file-name
      default-directory))

(defun kill-and-message (string)
  (if (not (stringp string))
      (error "Not a string: %S" string))
  (kill-new string)
  (message "Killing: %S" string))

(defun kill-pwd () (interactive)
  (kill-and-message default-directory))
(defalias 'kd 'kill-pwd)

(defun kill-url (fname)
  (interactive (list (ee-fname-here)))
  (kill-and-message (ee-fname-to-url0 fname)))




(defun ee-suffixp (suffix str)
  "Return t if STR ends with PREFIX."
  (let ((len (length suffix)))
    (and (<= len (length str))
	 (equal suffix (substring str (- len) (length str))))))

(defun ee-remove-suffix (suffix str)
  "Example: (ee-remove-prefix \"EF\" \"abcdef\") --> \"abcd\""
  (substring str 0 (- (length suffix))))

(defun ee-rmsuffix (suffix str)
  (and str
       (ee-suffixp suffix str)
       (ee-remove-suffix suffix str)))

(defun ee-rmprefixsuffix (prefix suffix fname)
  (let* ((fname-  (and fname  (ee-rmprefix prefix fname)))
	 (fname-- (and fname- (ee-rmsuffix suffix fname-))))
    fname--))

' (

;; (find-angg ".emacs.templates" "find-angg-upload-links")
;; (find-angg ".emacs.templates" "find-escript-upload-links")

(defun ee-fname-to-astem (fname)
  (ee-rmprefixsuffix "~/" "" fname))
(defun ee-fname-to-bstem (fname)
  (ee-rmprefixsuffix "~/TH/" ".blogme" fname))
(defun ee-fname-to-estem (fname)
  (ee-rmprefixsuffix "~/TH/" ".blogme" fname))

)



(defun kill-but-last-word () (interactive)
  (insert (car (nreverse (ee-split (ee-this-line-extract))))))



;; «cow-and-mow» (to ".cow-and-mow")
;;
(defun copy-line-to-other-window () (interactive)
  (let ((line-move-visual nil))
    (eek "C-a C-SPC <down> M-w M-o C-a C-y <<recenter>> M-- M-1 M-o")))

(defun move-line-to-other-window () (interactive)
  (let ((line-move-visual nil))
    (eek "C-a C-SPC <down> C-w M-o C-a C-y <<recenter>> M-- M-1 M-o")))

(defalias 'cow 'copy-line-to-other-window)
(defalias 'mow 'move-line-to-other-window)

;; «cuow» (to ".cuow")
(defun cuow () (interactive)
  "Copy URL to other (i.e., next) window"
  (let* ((fname (ee-dired-to-fname))
	 (url (ee-rmprefix "~/" fname "http://angg.twu.net/")))
    (eek "M-o C-a")
    (insert (format "  %s\n" url))
    (eek "M-- M-o <down>")
    ))






;; (find-angg ".zshrc" "makeL")
;;
(defun ee-in-eepitch-target (code)
  (eepitch-prepare)
  (save-selected-window
    (select-window (eepitch-target-window))
    (eval code)))

(defun makeR1C (relfname) 
  (eepitch-shell)
  (ee-in-eepitch-target '(eek "M->"))
  (eev (format "makeR1C %s" relfname))
  (eepitch-line "ee"))

;; (makeR1C "tmp.html")

(defun eepitch-shell12 () (interactive)
  (find-wset "_13o_2o_o"
    ' (progn (eepitch-shell)
	     (eepitch-kill)
	     (eepitch-shell2)
	     (eepitch-kill)
	     (eepitch-shell)
	     (eepitch-shell2)
	     )
    ' (find-ebuffer "*shell*")
    ' (find-ebuffer "*shell 2*")
    )
  )


(defun show-trailing-whitespace () (interactive)
  (setq show-trailing-whitespace (not show-trailing-whitespace))
  (message "%S" `(setq show-trailing-whitespace ,show-trailing-whitespace)))



;; «tramp-no-remote-shells» (to ".tramp-no-remote-shells")
;; From: https://gist.github.com/4002203
;;       https://gist.github.com/legumbre
;;
'
(defadvice shell (around prevent-remote-shells-from-tramp compile activate)
  (let ((default-directory (if (file-remote-p default-directory)
                               "~/" default-directory)))
    ad-do-it))



;; «screencasts» (to ".screencasts")
;; (find-es "emacs" "adjust-geometry")
;; (find-es "emacs" "frame-geometry")
;; (find-es "fvwm" "resize")
;; x--: (find-sh0 "FvwmCommand 'Current Resize w-1c keep'")
;; x++: (find-sh0 "FvwmCommand 'Current Resize w+1c keep'")
;; y--: (find-sh0 "FvwmCommand 'Current Resize keep w-1c'")
;; y++: (find-sh0 "FvwmCommand 'Current Resize keep w+1c'")
;;      (find-sh0 "FvwmCommand 'Current Resize keep w+1c'")
;;      (find-sh0 "FvwmCommand 'Current Resize  80c 37c'")
;;      (find-sh0 "FvwmCommand 'Current Resize 167c 46c'")
;;      (find-sh0 "FvwmCommand 'Current Resize 123c 38c'")
;; (frame-parameter (selected-frame) 'width)
;; (frame-parameter (selected-frame) 'height)

(defun frame-width-height ()
  (format "%dc %dc"
	  (frame-parameter (selected-frame) 'width)
	  (frame-parameter (selected-frame) 'height)))
(defun frame-width-height-set (str)
  (find-sh0 (format "FvwmCommand 'Current Resize %s'" str)))
(defun frame-width--  () (frame-width-height-set "w-1c keep"))
(defun frame-width++  () (frame-width-height-set "w+1c keep"))
(defun frame-height-- () (frame-width-height-set "keep w-1c"))
(defun frame-height++ () (frame-width-height-set "keep w+1c"))
(defun framegeom (&optional h v)
  (interactive "P")
  (cond ((and (numberp h) (numberp v))
	 (frame-width-height-set (format "%dc %dc" h v)))
	((eq h 'big)   (framegeom 167 46))
        ((eq h 'v)     (framegeom  80 46))
        ((eq h 'small) (framegeom  80 37))
	((eq h 1)      (framegeom 'v))
	((eq h nil)    (framegeom 'small))
	(t (error))))

;; (frame-width--)
;; (frame-width++)
;; (frame-height--)
;; (frame-height++)
;; (frame-width-height)
;; (frame-width-height-set " 80c 37c")
;; (frame-width-height-set "167c 46c")

(defun ee-aligned (pow2 n) (= 0 (logand n (- pow2 1))))
(defun ee-align   (pow2 n)
  "Increase N until it becomes a multiple of POW2."
  (while (not (ee-aligned pow2 n)) (setq n (1+ n)))
  n)

(defun ee-scast-geometry0 (h v)
  "Warning: this assumes `-style bare -fn 6x13'!"
  (format "%dx%d+0+0" (+ 18 (* 6 h)) (* 13 v)))

(defun ee-scast-geometry (ah av)
  (ee-scast-geometry0
   (ee-align ah (frame-parameter (selected-frame) 'width))
   (ee-align av (frame-parameter (selected-frame) 'height))))

(setq ee-scast-cmdline
 "avconv -loglevel quiet -r 5 -s $GEOMETRY -f x11grab -i $DISPLAY /tmp/out.mp4")

(defun ee-scast-start () (interactive)
  (find-sh0 "rm -f /tmp/out.mp4")
  (setenv "GEOMETRY" (ee-scast-geometry 2 2))
  (find-bgprocess ee-scast-cmdline))

(defun ee-scast-stop  () (interactive)
  (find-sh0 "killall avconv"))

;; (setenv "GEOMETRY" (ee-scast-geometry 1 1))
;; (ee-scast-start)
;; (ee-scast-stop)
;; (find-fline "/tmp/" "out.mp4")
;; (find-video "/tmp/out.mp4")

' (defalias 'r 'ee-scast-start)
' (defalias 's 'ee-scast-stop)



;; «git» (to ".git")
;; (find-es "git" "git-doc")
(code-c-d "gitdoc" "/usr/share/doc/git-doc/")

;; «git-internals» (to ".git-internals")
;; (find-books "__comp/__comp.el" "git")
(code-xpdf      "gitinternals" "~/books/__comp/chacon__git_internals.pdf")
(code-pdftotext "gitinternals" "~/books/__comp/chacon__git_internals.pdf" 0)
;; (find-gitinternalspage  41 "The Treeish")
;; (find-gitinternalstext  41 "The Treeish")

;; «pro-git» (to ".pro-git")
;; (find-fline "$S/https/github.s3.amazonaws.com/media/")
(code-xpdf     "progit" "$S/https/github.s3.amazonaws.com/media/progit.en.pdf")
(code-pdf-text "progit" "$S/https/github.s3.amazonaws.com/media/progit.en.pdf" 7)
;; (find-progitpage)
;; (find-progittext)
;; (find-progitpage (+ 7 43) "Git Branching")
;; (find-progittext (+ 7 43) "Git Branching")
;; (find-progitpage (+ 7 48) "3.2 Basic Branching and Merging")
;; (find-progittext (+ 7 48) "3.2 Basic Branching and Merging")
;; (find-progitpage (+ 7 63) "3.6 Rebasing")
;; (find-progittext (+ 7 63) "3.6 Rebasing")



;; (find-es "git" "git-deb-src")
(code-c-d "gitsrc" "~/usrc/git/git-1.7.10.4/")

;; (find-es "git" "emacs-from-git")
(code-c-d "gitemacs" "~/bigsrc/git/emacs/")

;; (find-es "git" "magit")
(code-video "meetmagit" "/sda5/videos/meet_magit_504x380.flv")
(code-c-d "magit" "/usr/share/emacs/site-lisp/" "magit")
(code-c-d "magit" "~/.emacs.d/elpa/magit-20130921.1716/" "magit")
;; (find-meetmagit)
;; (find-meetmagit  "7:02" "Other branches")
;; (find-meetmagit  "8:13" "SHA")
;; (find-meetmagit "10:20" "tree")
;; (find-magitfile "")
;; (find-magitfile "magit.el")
;; (find-magitnode "Top")

;; (find-efunction 'ee-at0)
(defun find-gitk (path) (ee-at0 path '(find-bgprocess "gitk --all")))
(defun find-gitk (path) (ee-at0 path '(find-bgprocess "gitk --all --date-order")))
;; (find-gitk "~/eev-current/")
;; (find-gitk "/tmp/")

;; «find-gitdiag» (to ".find-gitdiag")
;; (find-angg "e/git.e" "git-animations")
;; (find-angg "bin/git-defs")
;;
(defun find-gitdiag0 (title dir cmd)
  (let ((fullcmd (format "cd %s && git-defs '%s'" dir cmd)))
  (find-eoutput-rerun title '(insert (find-sh0 fullcmd)))))

(defun find-gitdiag (dir)
  (find-gitdiag0 "*diagram*" dir "Diagram"))
(defun find-gitddiag (dir)
  (find-gitdiag0 "*dump/diagram*" dir "Dump; echo; Diagram"))

(defun ee-buffer-contents (b)
  (if (not (get-buffer b)) ""
    (with-current-buffer b (buffer-substring (point-min) (point-max)))))

(defun find-gitoldddiag ()
  (find-ebuffer "*old dump/diagram*")
  (erase-buffer)
  (insert (ee-buffer-contents "*dump/diagram*")))

(defun find-gitddiag-4a (dir)
  (find-wset "13o_2o_3o_o"
	     '(find-ebuffer "*shell*")
	     '(find-gitoldddiag)
	     `(find-gitddiag ,dir)))
    
;; (find-gitdiag0 "*tree*" ee-eevdir "Diagram")
;; (find-gitdiag0 "*tree*" ee-eevdir "pwd; Diagram")
;; (find-gitdiag0 "*dump/tree*" "/tmp/git/here/" "Dump; echo; Diagram")






;; «OP-1» (to ".OP-1")
;; (find-es "hardware" "OP-1")
;; (find-es "op-1")
(code-djvu      "op1manual" "~/tmp/OP-1_Manual_1.2_(EN).djvu")
(code-pdf-text  "op1manual" "~/tmp/OP-1_Manual_1.2_(EN).pdf")
(code-djvu-text "op1manual" "~/tmp/OP-1_Manual_1.2_(EN).djvu" 0)
(code-c-d       "op1manual" "~/tmp/OP-1_Manual_1.2_(EN).text")
;; (find-op1manualpage 3 "TOC")
;; (find-op1manualtext 3 "TOC")
;; (find-op1manualtext)
;; (find-op1manualfile "")




;; (find-eewrap-links "L" "latex" "word")
;; (find-efunction 'find-eewrap-links)

;; M-L: latex
(define-key eev-mode-map "\M-L" 'eewrap-latex)

(defun  eewrap-latex () (interactive)
  (ee-this-line-wrapn 1 'ee-wrap-latex))
(defun ee-wrap-latex (word)
  "An internal function used by `eewrap-latex'."
  (ee-template0 "\
\\begin{<}{word}{>}
\\end{<}{word}{>}
"))



;; «find-eev2-links» (to ".find-eev2-links")
;; (find-find-links-links "<none>" "eev2" "")
(defun find-eev2-links (&optional  &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for foo."
  (interactive)
  (apply 'find-elinks
   `((find-eev2-links  ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-eev2-links)
     (find-angg ".zshrc" "eev2-files")
     (find-angg ".zshrc" "eev2-files" "eev2-test ()")
     (find-angg "eev-intros/README")
     "# http://angg.twu.net/eev-intros/"
     ""
     "* (eepitch-shell)"
     "* (eepitch-kill)"
     "* (eepitch-shell)"
     ;; "eev2-build-tgz"
     ;; "eev2-test-unpack"
     ;; ""
     "eev2-build-tgz"
     "eev2-test"
     "eev2-upload"
     "
# (find-gitk ee-eevdir)
cd ~/eev-current/
git commit -a -m \"***\"
# (find-eevsh0 \"PAGER=cat git log -1 --pretty=tformat:%s\")
git commit -a --amend -m \"***\"
# (find-gitk ee-eevdir)
# (find-eevsh0 \"gitk &\")
git push

# edrx Fa
"
     )
   pos-spec-list))


;; (find-eev-video-record-links "")
;; (find-eevvideos "")
(code-c-d "eevvideos" "~/eev-videos/" :anchor)
;; (find-eevvideos "4-bare.el")

;; (find-es "imagemagick" "exif")
(defun find-exif (fname &rest pos-spec-list)
  (apply 'find-callprocess `("exif" ,fname) pos-spec-list))

(code-brfile 'find-exif :local 'brexifl :dired 'brexifd)


;; «diags» (to ".diags")
(code-c-d "diags" "~/diags/")
;; (find-diagsfile "")
;; (find-idct "")
;; (find-LATEX "2010diags.tex")
;; (find-dn5file "")



;; «tags-mode» (to ".tags-mode")
;; (find-eminorkeymapdescr 'tags-mode)
;; (find-eevfile "eev-math-glyphs.el" "eev-glyphs-set-face")
;; (find-es "emacs" "faces")
;; (find-epalette)
;; (find-ecolors)
;; (find-angg ".emacs" "my-mode")

(defun tags-set-face (face fg bg)
  (make-face face)
  (set-face-foreground face fg)
  (set-face-background face bg))

(defun tag-get-point-at (code) (save-excursion (eval code) (point)))
(defun tag-s () (tag-get-point-at '(eek "C-a")))
(defun tag-e () (tag-get-point-at '(eek "C-e <right>")))
(defun tag-e () (tag-get-point-at '(eek "C-e")))
(defun tag-this-line (arg face)
  (if arg (remove-text-properties (tag-s) (tag-e) '(face nil))
    (set-text-properties          (tag-s) (tag-e) `(face ,face)))
  (eek "<down>"))

(setq tags-mode-map (make-sparse-keymap))
(define-minor-mode tags-mode
  "Makes the keymap `tags-mode-map' active.
See: (find-eminorkeymapdescr 'tags-mode)"
  :init-value nil :global nil :lighter " tags")

(defun tag-define-0  (key symbol fg bg)
  `(progn
     (defun ,symbol (arg) (interactive "P") (tag-this-line arg ',symbol))
     (tags-set-face ',symbol ,fg ,bg)
     (define-key tags-mode-map ,key ',symbol)))

(defun tag-define    (key symbol fg bg)
  (eval (tag-define-0 key symbol fg bg)))

(tag-define "\M-a" 'tag-art      "bisque" "snow4")
(tag-define "\M-a" 'tag-aumento  "bisque" "gray28")
(tag-define "\M-g" 'tag-gender   "bisque" "magenta3")
(tag-define "\M-i" 'tag-indios   "bisque" "green4")
(tag-define "\M-m" 'tag-music    "bisque" "blue4")
(tag-define "\M-n" 'tag-news     "bisque" "firebrick")
(tag-define "\M-p" 'tag-politics "bisque" "sienna4")
(tag-define "\M-t" 'tag-turkey   "bisque" "DarkOrange3")
(tag-define "\M-z" 'tag-unknown  "yellow" "red")
(tag-define "\M-z" 'tag-unknown  "red"    "yellow")
;; (set-face-bold     'tag-unknown t)

;; (tags-set-face 'tag-gender   "bisque" "magenta3")
;; (tags-set-face 'tag-music    "bisque" "blue4")
;; (tags-set-face 'tag-news     "bisque" "firebrick")
;; (tags-set-face 'tag-politics "bisque" "sienna4")
;; 
;; (defun tag-gender   (arg) (interactive "P") (tag-this-line arg 'tag-gender))
;; (defun tag-music    (arg) (interactive "P") (tag-this-line arg 'tag-music))
;; (defun tag-news     (arg) (interactive "P") (tag-this-line arg 'tag-news))
;; (defun tag-politics (arg) (interactive "P") (tag-this-line arg 'tag-politics))
;; 
;; (define-key tags-mode-map "\M-g" 'tag-gender)
;; (define-key tags-mode-map "\M-m" 'tag-music)
;; (define-key tags-mode-map "\M-n" 'tag-news)
;; (define-key tags-mode-map "\M-p" 'tag-politics)

;; «tags-mode-chars» (to ".tags-mode-chars")
;;
(defun tags-insert-at-bol (text)
  (save-excursion
    (let* ((b (ee-bol))
	   (c (buffer-substring b (1+ b))))
      (goto-char (1+ b))
      (insert-and-inherit (concat text c))
      (delete-region b (1+ b)))))

(defun tags-c-at-bol ()
  (save-excursion
    (save-match-data
      (goto-char (ee-bol))
      (if (looking-at "\\[\\(.\\)\\]")
	  (ee-no-properties (match-string 1))))))

(defun tags-line-face ()
  (get-char-property (ee-bol) 'face))







(code-brurl 'find-googlechrome
            :remote 'brg :local 'brgl :dired 'brgd)
(code-brurl 'find-w3m
	    :remote 'brw :local 'brwl :dired 'brwd)

(code-brfile 'find-fline       :local 'brfl)



;; (find-eevfile "eev-brxxx.el" "brg")
;; (find-es "chrome" "chromium-vs-chrome")
(defun find-chromiumbrowser (url) (find-bgprocess `("chromium-browser" ,url)))
(code-brurl 'find-chromiumbrowser
            :remote 'brc :local 'brcl :dired 'brcd)

;; «eww» (to ".eww")
;; (find-es "emacs" "eww")
;; (find-efunction 'find-w3m)
;; (find-eevfile "eev-brxxx.el" "brwl")
;; (find-THLfile "")
;; (find-eww "~/TH/L/index.html")

(defun find-eww (url &rest rest)
  (eww (replace-regexp-in-string "^/" "file:///" (ee-expand url))))

(code-brurl 'find-eww :remote 'breww :local 'brewwl :dired 'brewwd)
(code-brurl 'find-eww :remote 'brew  :local 'brewl  :dired 'brewd)




;; «quadradinho» (to ".quadradinho")
(code-c-d "quadr" "~/quadradinho/" :anchor)
;; (find-quadrfile "")
;; (find-quadr "quadradinho-texto.tex")

;; (find-eevfile "eev-blinks.el")




;; (find-eev "eev-multiwindow.el")
(defun find-3L (sexp1 sexp2) (find-wset "13_o_o" sexp1 sexp2))
(defun find-3R (sexp1 sexp2) (find-wset "13_o_"  sexp1 sexp2))

(defalias 'nik 'find-pen-links)
(defalias 'find-dvipage 'find-xdvipage)

(seen 13560)

;; (find-fline "/etc/hosts" "Mel")
;; (find-newhost-links "mel" "192.168.0.130")
(defun eepitch-mel () (interactive)
  (eepitch '(find-comintprocess "ssh mel" "ssh edrx@mel")))


;; (find-eev "eev-browse-url.el" "ee-cp")
(defun ee-cp (from to &optional ok-flag)
  (require 'dired)
  (let ((tramp-verbose 0))
    (dired-copy-file (ee-expand from) (ee-expand to) ok-flag)))


;; «youtube-dl» (to ".youtube-dl")
;; (find-es "youtube" "youtube-dl-git")
;;
(code-c-d "youtubedl"   "~/usrc/youtube-dl/")
(code-c-d "youtubedly"  "~/usrc/youtube-dl/youtube_dl/")
(code-c-d "youtubedlye" "~/usrc/youtube-dl/youtube_dl/extractor/")
;; (find-youtubedlfile "")
;; (find-youtubedlyfile "")
;; (find-youtubedlyefile "")
;; (find-youtubedlyefile "youtube.py" "upload_date")


;; «ee-youtubedl-dirs» (to ".ee-youtubedl-dirs")
;; (find-eev "eev-tlinks.el" "find-youtubedl-links")
;;
(setq ee-youtubedl-dir  "/sda5/videos/")
(setq ee-youtubedl-dir2 "/sda5/videos/bd/")
(setq ee-youtubedl-dir3 "~/tmp/pn/")
(setq ee-youtubedl-dir3 "/sda5/videos/manifs/")
(setq ee-youtubedl-dir4 "/tmp/")
;;
;; Defaults:
;; (find-eevfile "eev-tlinks.el" "defvar ee-youtubedl-dir")
;; (setq ee-youtubedl-dir     "~/videos/")
;; (setq ee-youtubedl-dir2    "~/videos/tech/")
;; (setq ee-youtubedl-dir3    "/tmp/videos/")
;; (setq ee-youtubedl-dir4    "/tmp/")
;; (setq ee-youtubedl-command "youtube-dl -t")
;;
;; http://www.youtube.com/watch?v=zqZNZHUr6B0




;; «find-screenshot-links» (to ".find-screenshot-links")
;; (find-find-links-links "{k}" "screenshot" "nn")
;; A test: (find-screenshot-links "00")
(defun find-screenshot-links (&optional nn &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for foo."
  (interactive)
  (setq nn (or nn "{nn}"))
  (apply 'find-elinks
   `((find-screenshot-links ,nn ,@pos-spec-list)
     (find-screenshot-links "00")
     (find-screenshot-links "01")
     (find-fline "/tmp/screenshots/")
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-screenshot-links)
     ""
     ,(ee-template0 "\
  (find-2a
   ' (find-fline \"/tmp/screenshots/\")
   ' (find-twupfile \"tmp/\")
   )

# (find-fline \"/tmp/screenshots/\")
# (find-fline \"/tmp/screenshots/ss{nn}.png\")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
Scp-np -v /tmp/screenshots/ss{nn}.png $TWUP/tmp/
# http://angg.twu.net/tmp/ss{nn}.png
")
     )
   pos-spec-list))



;; «find-freenode0» (to ".find-freenode0")
;; (find-eevfile "eev-rcirc.el")

(setq ee-freenode-ichannels "#eev #rcirc #transmission #org-mode")
(setq ee-freenode-achannels "#eev #rcirc #transmission #org-mode")


;; «scast» (to ".scast")
;; (find-angg "bin/scast")
;; (defun scast () (interactive) (find-angg "bin/scast"))
(defun scast (&optional cmd)
  (interactive "P")
  (if cmd (find-sh0 (format "~/bin/scast '%s'" cmd))
    (find-angg "bin/scast")))


;; «android» (to ".android")
;; (find-es "android" "android-41-manuals")
(code-xpdf     "android41" "~/tmp/nexus_7_guidebook.pdf")
(code-pdf-text "android41" "~/tmp/nexus_7_guidebook.pdf" 0)
;; (find-android41page)
;; (find-android41text)
;; (find-android41page 83 "Factory data reset")
;; (find-android41text 83 "Factory data reset")






;;;                      
;;;  _ __   _____      __
;;; | '_ \ / _ \ \ /\ / /
;;; | | | |  __/\ V  V / 
;;; |_| |_|\___| \_/\_/  
;;;                      

;; (find-eevfile "eev-wrap.el" "eewrap-two-eepitches")

'(

;; (find-eewrap-links "#" "two-eepitches" "b c")
;; M-#: two-eepitches
(define-key eev-mode-map "\M-#" 'eewrap-two-eepitches)

(defun  eewrap-two-eepitches () (interactive)
  (ee-this-line-wrapn 2 'ee-wrap-two-eepitches))
(defun ee-wrap-two-eepitches (b c)
  "An internal function used by `eewrap-two-eepitches'."
  (ee-template0 "\
* (find-3EE '(eepitch-{b}) '(eepitch-{c}))
* (find-3ee '(eepitch-{b}) '(eepitch-{c}))
* (eepitch-{b})
* (eepitch-{c})
"))

)



;; (find-videos-intro)
;; (find-eev-video-links "eepitchvideo" "video4-eepitch" "Lj_zKC5BR64")
;; (find-eev-video-links "eevvideo"     "video2"         "doeyn5MOaB8")
;; (find-eev-video-links "eevvideopt"   "video2pt"       "yztYD9Y7Iz4")
(code-video "eepitchvideo" "$S/http/angg.twu.net/eev-videos/video4-eepitch.mp4")
(code-video "eevvideo"     "$S/http/angg.twu.net/eev-videos/video2.mp4")
(code-video "eevvideopt"   "$S/http/angg.twu.net/eev-videos/video2pt.mp4")

;; (find-eevvideopt "7:43" "Como ativar o modo eev")
;; http://www.youtube.com/watch?v=yztYD9Y7Iz4&t=7m43s

(defun machine-gun () (interactive)
  (find-video "/sda5/videos/Portishead_Machine_Gun.avi" "0:02"))





;;;                   _                         
;;;  _ __   __ _  ___| | ____ _  __ _  ___  ___ 
;;; | '_ \ / _` |/ __| |/ / _` |/ _` |/ _ \/ __|
;;; | |_) | (_| | (__|   < (_| | (_| |  __/\__ \
;;; | .__/ \__,_|\___|_|\_\__,_|\__, |\___||___/
;;; |_|                         |___/           
;;
;; «packages» (to ".packages")
;; (find-es "emacs" "packages")

'(

(require 'package)
(add-to-list 'package-archives 
    '("marmalade" .
      "http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives
  '("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
(package-refresh-contents)

;; (find-epackages)
;; (find-epackages 0 "magit")
;; (find-epackages 0 "htmlfontify")
;; (find-epackage 'htmlfontify)
;; (find-es "emacs" "htmlfontify")

)




;;;  _                         _ _       _        
;;; | |__   ___ _ __ ___      | (_)_ __ | | _____ 
;;; | '_ \ / _ \ '__/ _ \_____| | | '_ \| |/ / __|
;;; | | | |  __/ | |  __/_____| | | | | |   <\__ \
;;; |_| |_|\___|_|  \___|     |_|_|_| |_|_|\_\___/
;;;                                               

;; (find-eev "eev-elinks.el")
;; (find-eev "eev-elinks.el" "defun find-etp")
;; (find-eev "eev-elinks.el" "find-here-links")

;; (find-efunction 'find-grep-links)
;; (find-efunction 'find-einfo-links)
;; (find-efunction 'find-file-links)
;; (find-find-links-links "\\M-h" "here" "")
;; (find-efunction 'find-ecolors)



;; (find-blogme3 "blogme3.el")
(load "~/blogme3/blogme3.el")
;; (find-intro-links "{stem}")


(defun mo0 () (interactive) (find-LATEXfile "2013-montreal.tex"))
(defun mo  () (interactive) (find-LATEXfile "2013-montreal.txt"))
(defun sa  () (interactive) (find-angg "MONTREAL/sexophobic_as_answer"))
;; (defun lr  () (interactive) (find-es "blogme" "linkdasruas"))
(defun lv  () (interactive) (find-es "localvideos"))


;; «mplayer» (to ".mplayer")
;; (find-es "mplayer" "mplayer-from-git")
(code-c-d "mplayer" "~/bigsrc/mplayer/")

;; «mplayer-screenshots» (to ".mplayer-screenshots")
;; (find-es "mplayer" "screenshots")
;; For Manufacturing Consent
;;
(setq ee-mplayer-secreenshot-n 1)

(setq ee-mplayer-secreenshot-format "~/CHOMSKY/shot%04d.jpg")

(defun ee-mplayer-secreenshot-fname (&optional n)
  (format ee-mplayer-secreenshot-format
	  (or n ee-mplayer-secreenshot-n)))

(defun find-mplayer-screenshot (&optional n)
  (find-fline (ee-mplayer-secreenshot-fname n)))

(defun find-mplayer-screenshot+ (&optional delta)
  (setq ee-mplayer-secreenshot-n (+ ee-mplayer-secreenshot-n (or delta 1)))
  (find-2a nil '(find-mplayer-screenshot)))

(setq mss-mode-map (make-sparse-keymap))

(define-minor-mode mss-mode "Makes the keymap `mss-mode-map' active."
  :init-value nil :global nil :lighter " mss")

(define-key mss-mode-map (kbd "M-<up>")
  (lambda () (interactive) (find-mplayer-screenshot+ -1)))

(define-key mss-mode-map (kbd "M-<down>")
  (lambda () (interactive) (find-mplayer-screenshot+ 1)))




;; «lua-mode»  (to ".lua-mode")
;; (find-es "lua5" "lua-mode.el")
;; (find-fline "~/elisp/lua-mode.el")
;; http://stackoverflow.com/questions/4643206/how-to-configure-indentation-in-emacs-lua-mode
(setq lua-indent-level 2)
(setq lua-electric-flag nil)

;; (find-fline "~/elisp/lua-mode.el" "\"else\" \"else\" lua-indent-line 0")
;; (find-fline "~/elisp/lua-mode.el" "defun lua-indent-line")
;; (find-evariable 'lua-mode-abbrev-table)
;; (find-evardescr 'lua-mode-abbrev-table)
;; (find-elnode "Abbrev Tables")
(defun lua-abbrev-mode-off () (abbrev-mode 0))
(add-hook 'lua-mode-hook 'lua-abbrev-mode-off)

;; (find-efile "files.el" "Save abbrevs in %s?")
;; (find-efile "files.el" "and save-abbrevs abbrevs-changed")
(setq save-abbrevs nil)

;; (load "~/elisp/lua-mode.el")
(load "~/elisp/lua-mode.elc")





;; High-level
;;
(defvar ee-efnet-server "irc.efnet.net")
(defvar ee-efnet-ichannels "#thepiratebay.org")
(defvar ee-efnet-achannels "#thepiratebay.org")

(defun find-efnet (&optional channel &rest pos-spec-list)
  (apply 'find-rcirc-buffer
	  ee-efnet-server
	  ee-efnet-ichannels 
	  ee-efnet-achannels channel pos-spec-list))

(defun find-efnet-3a (channel)
  (find-3a nil '(find-efnet) '(find-efnet channel)))

(defun ee-find-efnet-links (&optional channel)
  (setq channel (or channel (replace-regexp-in-string
			     "^\\(.*\\).irc\\.efnet\\.net" "\\1"
			     (buffer-name))))
  `((setq ee-efnet-ichannels ,ee-efnet-ichannels)
    (setq ee-efnet-achannels ,ee-efnet-achannels)
    ""
    (find-efnet ,channel)
    (find-efnet-3a ,channel)
    (defun eejump-9 () (find-efnet ,channel))
    (defun eejump-99 () (find-efnet-3a ,channel))
    ))

(defun find-efnet-links (&optional channel &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for foo."
  (interactive (list (ee-irc-channel-around-point)))
  (setq channel (or channel "{channel}"))
  (apply 'find-elinks
   `((find-efnet-links ,channel)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-efnet-links)
     ""
     ,@(ee-find-efnet-links channel)
     )
   pos-spec-list))

;; Tests: (find-efnet-links)
;;        (find-efnet-links "#eev")


;; «contact» (to ".contact")
;; (find-angg "contact.txt")
(defun contact () (interactive) (find-sh "cat ~/contact.txt"))

(defun nm () (interactive) (find-es "networkmanager"))



;; «find-1|3» (to ".find-1|3")
;; From: http://lists.gnu.org/archive/html/eev/2013-11/msg00010.html
;;
(defun ee-set-window-height (ht)
  (window-resize nil (- ht (window-total-height))))
;;
(defun find-1|3a (a b c d) (find-wset "13_o22+_o_o_o"   a b c d))
(defun find-1|3b (a b c d) (find-wset "13_o22+_o_o_oo"  a b c d))
(defun find-1|3c (a b c d) (find-wset "13_o22+_o_o_ooo" a b c d))
(defun find-1|3d (a b c d) (find-wset "13_o22+_o_o_"    a b c d))




;; «find-GA-links» (to ".find-GA-links")
(defun find-GA-links (&rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for foo."
  (interactive)
  (let* ((files (dired-get-marked-files t))
	 (fmt "    http://angg.twu.net/2013.2-GA/%s\n")
	 (urls (mapconcat (lambda (fname) (format fmt fname)) files ""))
	 (scps (ee-unsplit files)))
    (apply 'find-elinks
     `((find-GA-links)
       (find-efunction 'find-GA-links)
       ""
       ,(ee-template0 "\
{urls}

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd ~/2013.2-GA/
Scp -v {scps} \\
  edrx@angg.twu.net:/home/edrx/slow_html/2013.2-GA/
")
       )
     pos-spec-list)))

(defun eejump-9 () (find-2a '(find-fline "~/2013.2-GA/")
			    '(find-twusfile "2013.2-GA/")))


;; «ee-dired-marked» (to ".ee-dired-marked")
;;
(defun ee-dired-marked-format-concat (fmt sep)
  (mapconcat (lambda (fname) (format fmt fname))
	     (dired-get-marked-files t)
	     sep))

(defun ee-dired-relative-dir (&optional dir)
  (setq dir (or dir default-directory))
  (save-match-data
    (or (ee-rmprefix "~/TH/L/" dir "")
	(ee-rmprefix "~/TH/R/" dir "")
	(ee-rmprefix      "~/" dir ""))))

(defun ee-dired-angg-dir (&optional dir)
  (concat "http://angg.twu.net/" (ee-dired-relative-dir dir)))

(defun ee-dired-angg-urls ()
  (ee-dired-marked-format-concat
   (format "%s%%s\n" (ee-dired-angg-dir))
   ""))

(defun ee-dired-angg-scp-dir (&optional dir)
  (concat "edrx@angg.twu.net:/home/edrx/slow_html/"
	  (ee-dired-relative-dir dir)))

;; «find-cp-to-angg-links» (to ".find-cp-to-angg-links")
;; (find-find-links-links "{k}" "cp-to-angg" "")
;;
(defun find-cp-to-angg-links (&rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for foo."
  (interactive)
  (apply 'find-elinks
   `((find-cp-to-angg-links  ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-cp-to-angg-links)
     ""
     ,(ee-template0 "\
cd ~/{(ee-dired-relative-dir default-directory)}
Scp -v {(save-match-data (ee-unsplit (dired-get-marked-files t)))} \\
  {(save-match-data (ee-dired-angg-scp-dir))}

{(save-match-data (ee-dired-angg-urls))}
")
     )
   pos-spec-list))

;; Test: (find-wset "13o_2o_" '(find-angg "2013-rfm-rcn/") '(find-cp-to-angg-links))

;; (find-twusfile "2013-rfm-rcn/")


;; «youtube-title» (to ".youtube-title")
;; (find-es "youtube" "youtube-title")
;; «yt» (to ".yt")

(defun ee-url-at-point ()
  ;; (thing-at-point 'url 'no-properties)
  (ee-no-properties (thing-at-point 'url)))

(defun yt (&optional url)
  (interactive)
  (setq url (or url (ee-url-at-point)))
  (let ((title (find-sh0 (format "youtube-dl -e '%s' | recode h..l1" url))))
    (eek "C-e SPC")
    (insert title)))


;; «2013-rfm-rcn» (to ".2013-rfm-rcn")
;; (find-TH "2013-rfm-rcn")
;; (defun eejump-21 () (find-anggfile "2013-rfm-rcn/"))
;; (defun eejump-22 () (find-twusfile "2013-rfm-rcn/"))
;; (defun eejump-23 () (find-TH       "2013-rfm-rcn"))


;; «rst-mode» (to ".rst-mode")
;; (find-es "rst" "emacs")

;; (find-efaces "rst-level-1-face")
;; (find-eface-links 'rst-level-1-face)
;; (find-eface-links 'rst-level-2-face)
;; (find-eface-links 'rst-level-3-face)
;; (find-eface-links 'rst-level-4-face)
;; (find-eface-links 'rst-level-5-face)
;; (find-eface-links 'rst-level-6-face)
;;
;; Orig:
'
(progn
  (set-face-background 'rst-level-1-face "grey85")
  (set-face-background 'rst-level-2-face "grey78")
  (set-face-background 'rst-level-3-face "grey71")
  (set-face-background 'rst-level-4-face "grey64")
  (set-face-background 'rst-level-5-face "grey57")
  (set-face-background 'rst-level-6-face "grey50")
  )

;; My:
'
(progn
  (set-face-background 'rst-level-1-face "grey55")
  (set-face-background 'rst-level-2-face "grey48")
  (set-face-background 'rst-level-3-face "grey41")
  (set-face-background 'rst-level-4-face "grey34")
  (set-face-background 'rst-level-5-face "grey27")
  (set-face-background 'rst-level-6-face "grey20")
  )


;; «youtube-db.lua» (to ".youtube-db.lua")
;; (find-angg     "LUA/youtube-db.lua")
;; (find-anggfile "LUA/youtube-db.lua" "-sort_td")
(defun yd () (interactive) (find-angg "LUA/youtube-db.lua"))
(defun lr () (interactive) (find-angg "linkdasruas.txt"))

(defun std (s e) (interactive "r")
  (shell-command-on-region s e "~/LUA/youtube-db.lua -sort_td" nil t))


;; «eecd» (to ".eecd")
;; (find-eevfile "eev-prepared.el" "defun eecd")
;;
(defun ee-shell-quote (str)
  (save-match-data
    (replace-regexp-in-string "\\([ '\"]\\)" "\\\\\\1" str)))

(defun eecd ()
  (interactive)
  (eev (format "cd %s" (ee-shell-quote default-directory))))

;; «lyrics» (to ".lyrics")
;; (find-es "mp3" "id3v2")
(defun ee-set-lyrics (&optional fname lyrics tmpfile)
  (setq fname   (or fname (ee-dired-file-name)))
  (setq lyrics  (or lyrics (ee-last-kill)))
  (setq tmpfile (or tmpfile "/tmp/o"))
  `("id3v2" "--USLT" ,lyrics ,fname))

(defun ee-get-lyrics (&optional fname)
  (setq fname (or fname (ee-dired-file-name)))
  `("id3v2" "-l" ,fname))

(defun set-lyrics (&optional fname lyrics tmpfile)
  (interactive)
  (find-callprocess0 (ee-set-lyrics fname lyrics tmpfile))
  (find-callprocess  (ee-get-lyrics fname)))

(defun find-id3v2-lyrics (&optional fname)
  (interactive)
  (find-callprocess (ee-get-lyrics fname)))



;; Emergency, 2014jan26
;; (find-efunction 'eepitch)
;; (find-efunction 'eepitch-window-show)
;; (find-eevfile "eepitch.el" "defun eepitch-window-show")
;;
(defun eepitch-window-show ()
  "Emergency"
  (find-2a nil '(find-ebuffer eepitch-buffer-name)))


;; (find-efunction 'electric-indent-mode)
(electric-indent-mode 0)


;; «djview» (to ".djview")
;; (find-es "scan" "djview")
;; (find-efunction 'find-djvu-page)
;; (find-efunction 'ee-find-djvu-page)
;; (find-efunctionpp 'ee-find-djvu-page)
;; (find-books "__comp/__comp.el" "bentley")


(code-c-d "bowie" "/sda4/torrents4/A David Bowie Vinyl Rip Collection - 1969-1989/")
(defun bowie () (interactive) (find-bowiefile ""))
;; (find-bowiefile "")

(defun saa () (interactive) (find-fline "~/MONTREAL/sexophobic_as_answer"))
(defun resp () (interactive)  (find-LATEXfile "2014-resposta.tex"))
(defun fe () (interactive)  (find-TH "ferramentas-para-ativistas"))



;; «tikz» (to ".tikz")
;; (find-angg ".emacs.papers" "tikz")
;;
(defun tikz () (interactive)
  (insert "
#*
# (defun c  () (interactive) (eev-bounded) (find-zsh0 \"ee\"))
# (defun cc () (interactive) (eev-bounded) (find-zsh  \"ee\"))
# (defun d  () (interactive) (find-xpdfpage \"/tmp/tikz/test1.pdf\"))
# (find-angg \".emacs.papers\" \"tikz\")

mkdir /tmp/tikz/
cd    /tmp/tikz/
cat > test1.tex <<'%%%'
\\documentclass{book}
\\usepackage{tikz}
\\usepackage{luacode}
\\begin{document}
\\tikzset{axis/.style=very thick}
\\tikzset{tick/.style=thick}
\\tikzset{grid/.style=gray,very thin}
%
\\begin{tikzpicture}[scale=0.5]
  \\clip (-2-0.4, -3-0.4) rectangle (4+0.4, 5+0.4);
  \\draw[step=1cm,grid] (-2,-3) grid (4,5);
  \\draw[axis] (-10,0) -- (10,0);
  \\draw[axis] (0,-10) -- (0,10);
  \\foreach \\x in {-10,...,10} \\draw[tick] (\\x,-0.2) -- (\\x,0.2);
  \\foreach \\y in {-10,...,10} \\draw[tick] (-0.2,\\y) -- (0.2,\\y);
  %
\\end{tikzpicture}
\\end{document}
%%%
lualatex test1.tex
#*
"))



;; «insert-n» (to ".insert-n")
(setq insert-n 0)
(defun insert-n (n) (interactive "P")
  (if n (setq insert-n n))
  (eek "C-a")
  (insert (format "%3d " insert-n))
  (eek "C-a <down>")
  (setq insert-n (1+ insert-n)))
(define-key my-mode-map "\M-n" 'insert-n)



;; «beamer» (to ".beamer")
;; (find-es "beamer" "userguide")
;; (find-sh0 "zcat /usr/share/doc/latex-beamer/beameruserguide.pdf.gz > /tmp/beameruserguide.pdf")
(code-xpdf     "beamerug" "/tmp/beameruserguide.pdf")
(code-pdf-text "beamerug" "/tmp/beameruserguide.pdf")
;; (find-beamerugpage)
;; (find-beamerugtext)
;; (find-beamerugtext 33)
;; (find-beamerugpage 146)
;; (find-beamerugtext 146)
(code-c-d "BEAMER" "~/BEAMER/" :anchor)
;; (find-BEAMERfile "")
;; (find-BEAMERfile "sfc.tex")
;; (defun sfc () (interactive) (find-BEAMERfile "sfc.tex"))
(defun sfc () (interactive) (find-LATEX "2014sfc-slides.tex"))
(defun sfcc () (interactive) (find-TH "sheavesforchildren"))
(defun sfccc () (interactive) (find-2a '(sfc) '(sfcc)))

;; (find-fline "$S/http/angg.twu.net/MINICATS/")
(code-xpdf "sfch" "$S/http/angg.twu.net/MINICATS/sheaves_for_children__1_to_7.pdf")
(code-djvu "sfch" "$S/http/angg.twu.net/MINICATS/sheaves_for_children__1_to_7.djvu")
;; (find-sfchpage)



;; «youtube-db» (to ".youtube-db")
(code-c-d "ydb" "~/youtube-db/" :anchor)
;; (find-ydbfile "")
;;
(defun ys () (interactive) (find-ydb "scripts.lua"))
(defun yo () (interactive) (find-ydb "toolbox.lua"))
(defun yd () (interactive) (find-ydb "db.lua"))
(defun yy () (interactive) (find-ydb "youtube-db"))
(defun yg () (interactive)
  (find-estring "\
# (find-eev2-links)\n
# (find-gitk ee-ydbdir)
# (find-ydbsh0 \"PAGER=cat git log -1 --pretty=tformat:%s\")
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd ~/youtube-db/
git commit -a -m \"***\"
git commit -a --amend -m \"***\"
"))


;; «youtube-db-play» (to ".youtube-db-play")
;;
(defun youtube-db-url-to-fname0 (li)
  (find-callprocess0 `("~/youtube-db/youtube-db" "-local" ,li)))

(defun youtube-db-url-to-fname (li)
  (let ((fname (youtube-db-url-to-fname0 li)))
    (if (not (equal fname "")) fname)))

(defun youtube-db-play (&optional li)
  (interactive)
  (setq li (or li (buffer-substring (ee-bol) (ee-eol))))
  (let ((fname (youtube-db-url-to-fname li)))
    (if fname (find-video fname)
      (message "Not found %S" (ee-no-properties li)))))

(defun eejump-9 () (youtube-db-play))

;; (youtube-db-url-to-fname " http://www.youtube.com/watch?v=Ikd0ZYQoDko ")
;; (youtube-db-url-to-fname "http://www.youtube.com/watch?v=Ikd0ZYQoDko")
;; (youtube-db-url-to-fname "http://www.youtube.com/watch?v=Ikd0ZYQoD")
;; (find-angg "linkdasruas2.txt")




;; (find-es "scan" "djview-default-page")
(defun dr () (interactive) (find-fline "~/.config/DjVuLibre/DjView.conf" "recentFiles="))
(defun pn () (interactive) (find-anggfile "ORG/index.org" "pn/"))
(defun xs () (interactive) (find-TH "2014-xs"))



(defun tmp () (interactive)
  (kill-new "~/tmp/")
  (find-2a '(find-fline "/tmp/") '(find-fline "~/tmp/")))


;; (defun eejump-9  () (find-sh "grep '^\\[[ec][ej]\\]' ~/TODO"))
(defun eejump-99 () (find-sh "grep '^\\[[ec][ej]\\]' ~/TODO | cut -b 6- | sort | uniq"))




;;;   __ _        _   _     _
;;;  / _(_)_  __ | |_| |__ (_)___
;;; | |_| \ \/ / | __| '_ \| / __|
;;; |  _| |>  <  | |_| | | | \__ \
;;; |_| |_/_/\_\  \__|_| |_|_|___/
;;;
;; (require 'eev-steps)

;; On sweetjane:
;; (defun myip-as-string () (myip-eth0-as-string))

;; (find-eapropos "iconify")
;; (find-eapropos "suspend")
;; (find-elongkey-links "C-x C-z  ;; suspend-frame")

(when (eq window-system 'x)
  (global-set-key "\C-z" nil)
  (global-set-key "\C-x\C-z" nil)
  )

;; ispell-local-dictionary-alist
;; (find-efile "")
;; (find-egrep "grep -nH -e ispell-local-dictionary-alist *.el")

;; ee-comment-prefix:    ";;"

;; http://lists.gnu.org/archive/html/bug-gnu-emacs/2009-11/msg00363.html
;; http://web.psung.name/emacs/2007/emacs-slides-2.pdf
;; http://web.psung.name/emacs/2007/emacs-slides-3.pdf

;; )
;; !!!!





;;
;; Local Variables:
;; coding:               raw-text-unix
;; ee-delimiter-hash:    "\n#*\n"
;; ee-delimiter-percent: "\n%*\n"
;; ee-anchor-format:     "«%s»"
;; End: