; Edrx's .emacs ; 2008jan18 ;; (getenv "HOME") ;; default-directory ;; (setenv "HOME" default-directory) ;; (find-sh "grep -n '«.*»' ~/.emacs") ;; «.autoloads» (to "autoloads") ;; «.add-to-alist» (to "add-to-alist") ;; «.auto-mode-alist» (to "auto-mode-alist") ;; «.mode-variables» (to "mode-variables") ;; «.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") ;; «.find-code-c-d» (to "find-code-c-d") ;; «.find-grep-at-dir» (to "find-grep-at-dir") ;; «.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") ;; «.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") ;; «.remote-machines» (to "remote-machines") ;; «.upload-changes» (to "upload-changes") ;; «.upload-this» (to "upload-this") ;; «.code-c-ds» (to "code-c-ds") ;; «.k22» (to "k22") ;; «.find-xxxpage» (to "find-xxxpage") ;; «.eevt_twu» (to "eevt_twu") ;; «.papers» (to "papers") ;; «.iconbook» (to "iconbook") ;; «.tclbook» (to "tclbook") ;; «.find-iconbooktext» (to "find-iconbooktext") ;; «.kd» (to "kd") ;; «.dkey» (to "dkey") ;; «.fooi» (to "fooi") ;; «.fooi-re» (to "fooi-re") ;; «.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") ;; «.favourite-modes» (to "favourite-modes") ;; «.isearch-faces» (to "isearch-faces") ;; «.obsolete» (to "obsolete") ;; «.lua-mode» (to "lua-mode") ;; «.guest_users» (to "guest_users") ;; «.info-path» (to "info-path") ;; «.lilypond» (to "lilypond") ;; «.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") ;; «.modes-safe-local» (to "modes-safe-local") ;; «.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") ;; «.my-modes» (to "my-modes") ;; «.emacs-ascii-screenshots» (to "emacs-ascii-screenshots") ;; «.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") ;; «.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") ;; «.find-source2epage» (to "find-source2epage") ;; «.find-texbookpage-old» (to "find-texbookpage-old") ;; «.find-texbookpage» (to "find-texbookpage") ;; «.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") ;; «.color-theme» (to "color-theme") ;; «.my-make-face» (to "my-make-face") ;; «.myxpm» (to "myxpm") ;; «.find-xpm» (to "find-xpm") ;; «.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") ;; «.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") ;; «.bash» (to "bash") ;; «.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") ;; «.tramp-2.1.9» (to "tramp-2.1.9") ;; «.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") ;; «.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") ;; «.eepitch-moz» (to "eepitch-moz") ;; «.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-rubyforth» (to "eepitch-rubyforth") ;; «.eepitch-sisrotlua» (to "eepitch-sisrotlua") ;; «.eepitch-dednat4» (to "eepitch-dednat4") ;; «.qt» (to "qt") ;; «.maut» (to "maut") ;; «.brecp» (to "brecp") ;; «.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-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") ;; «.ee-replace-regexp» (to "ee-replace-regexp") ;; «.ee-demo-4» (to "ee-demo-4") ;; «.find-lua51ev» (to "find-lua51ev") ;;;;; ;; ;; «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: ;; , ;; , ;; 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")) (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)) ;;;;; ;; ;; «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)) ;; 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") ;; (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) ;;;;; ;; ;; «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") (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) (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") ;; 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-") (lambda () (interactive) (scroll-down 1))) (define-key my-mode-map (kbd "M-C-") (lambda () (interactive) (scroll-up 1))) (define-key my-mode-map "\M-o" 'other-window) ;; (find-sh "locate snarf | grep jpg | grep -v xvpics | sort") ;;;;; ;; ;; «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") ;; 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 'eev-all) ; (find-eev "eev-all.el") (eev-mode 1) ;; ;; End of the eev block. (autoload 'eev-math-glyphs-edrx "eev-math-glyphs" nil t) ;; (eev-math-glyphs-edrx) ;; (find-eev "eev-math-glyphs.el") ;; For the unicode-2 branch (merged with head cvs emacs in 2008feb): ;; (require 'disp-table) ;; (when (fboundp 'make-glyph-code) ;; (defun eev-set-glyph (pos &optional char face) ;; (aset standard-display-table pos ;; (if char (vector (make-glyph-code char face))))) ;; (eev-set-default-glyphs) ;; ) ;; (defalias 'code-c-d 'code-c-d-old) ;; (defalias 'find-code-c-d 'find-code-c-d-old) ;; (defalias 'ee-code-c-d 'ee-code-c-d-old) (defalias 'code-c-d 'code-c-d-new) (defalias 'find-code-c-d 'find-code-c-d-new) ;; (defalias 'ee-code-c-d 'ee-code-c-d-new) ;; (require 'eev-bounded) (put 'ee-charset-indicator 'safe-local-variable 'stringp) ;; obsolete ;; (defalias 'find-dvipage 'eebg-xdvi) ;; (defalias 'find-pspage 'eebg-gv) ;; (autoload 'eev-math-glyphs-edrx "eev-math-glyphs" nil t) ;; (find-eev "eev-math-glyphs.el") ;; (eev-math-glyphs-edrx) ;; (defun code-pdftotext (code pdffile) ;; (ee-eval-read-format ;; "(defun find-%stext (&rest pos-spec-list) (interactive) ;; (apply 'find-pdfpage-pdftotext ;; (ee-expand %S) ;; pos-spec-list))" code pdffile)) ;; «find-code-c-d» (to ".find-code-c-d") ;; (defun ee-code-c-d (&rest rest) ;; (with-temp-buffer ;; (let ((ee-arg 1)) ;; (apply 'code-c-d rest) ;; (buffer-substring (point-min) (point-max))))) ;; (defun find-code-c-d (&rest rest) ;; (find-estring (apply 'ee-code-c-d rest))) ;; «find-grep-at-dir» (to ".find-grep-at-dir") ;; We call this `find-grep-at-dir' because the name `find-grep' is taken. ;; A simple (apply 'ee-goto-position pos-spec-list) after the grep ;; wouldn't work, because grep runs asyncronously, so for the moment ;; we just drop the pos-spec-list. (defun find-grep-at-dir (dir grep-command-args &rest pos-spec-list) "Example: (find-grep-at-dir ee-eetcdir \"grep -niH -e tetris *\") Note: the POS-SPEC-LIST arguments are currently not used." (let ((default-directory (ee-expand (or dir default-directory)))) (grep grep-command-args))) (add-to-alist 'code-c-d-keywords '(:grep (ee-eval-read-format " (defun find-%sgrep (grep-command-args &rest pos-spec-list) (apply 'find-grep-at-dir ee-%sdir grep-command-args pos-spec-list))" c c))) (code-c-d "es" "$ES/" :grep) ;; «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") (code-c-d "woman" (ee-efile "") "woman") ;; 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))) ;; «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-woman (manfile &rest rest) (woman-find-file manfile) (apply 'ee-goto-position rest)) (defun ee-code-c-d-:woman (&rest rest) (cons (format " (defun find-%swoman (manfile &rest pos-spec-list) (apply 'find-woman (ee-%sfile manfile) pos-spec-list)) " c c) (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) (cons (format " (defun find-%sffox (semiurl &rest pos-spec-list) (find-firefox (ee-%surl semiurl))) " c c) (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)) ;; «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)) ;; «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)))) ;; «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) ;;------------------------------------------- ;; «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 " 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") ;; ;;;;; ;; (find-efile "net/browse-url.el") ;; (defun to-browse-url () (interactive) (find-angg ".emacs" "browse-url")) ;; ;; (defun browse-url-eevlynx (url &rest rest) ;; (eev (concat "lynx " url))) ;; ;; (defun browse-url-eevedrxmozilla (url &rest rest) ;; (eev (concat "edrxmozilla " url " &"))) ;; ;; (setq browse-url-browser-function 'browse-url-eevlynx) ;; (setq browse-url-browser-function 'browse-url-eevedrxmozilla) ;; (setq browse-url-browser-function 'find-w3m) ;;;;; ;; ;; «brwl-and-friends» (to ".brwl-and-friends") ;; ;;;;; ;; (defun bru-url-to-local (url) ;; (replace-regexp-in-string "^\\(http\\|ftp\\)://" "$S/\\1/" url)) ;; ;; (defun find-edrxmozilla (url &rest ignore) ;; (interactive (browse-url-interactive-arg "URL: ")) ;; (shell-command-to-string ;; (format ". ~/.zshrc; sudo -u edrx mozilla \"%s\"; echo $?" url))) ;; ;; (defun find-mozilla (url &rest ignore) ;; (interactive (browse-url-interactive-arg "URL: ")) ;; (shell-command-to-string ;; (format ". ~/.zshrc; firefox \"%s\"; echo $?" url))) ;; ;; (defun find-lynx (url &rest ignore) ;; (interactive (browse-url-interactive-arg "URL: ")) ;; (eev (format "lynx \"%s\"" url))) (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))) ;; ;; (defun eemozilla (url &rest ignore) ;; (interactive (browse-url-interactive-arg "URL: ")) ;; (eev (format "firefox \"%s\" &" url))) ;; ;; (defmacro my-def-browse-url-remote (newfun fun) ;; `(defun ,newfun (url &rest ignore) ;; (interactive (browse-url-interactive-arg "URL: ")) ;; (setq browse-url-browser-function ',newfun) ;; (list ',fun url '-> (,fun url)))) ;; ;; (defmacro my-def-browse-url-local (newfun fun) ;; `(defun ,newfun (url &rest ignore) ;; (interactive (browse-url-interactive-arg "URL: ")) ;; (setq browse-url-browser-function ',newfun) ;; (setq url (bru-url-to-local url)) ;; (list ',fun url '-> (,fun url)))) ;; ;; (defmacro my-def-browse-url-local-remote (localfun remotefun fun) ;; `(list (if ',localfun (my-def-browse-url-local ,localfun ,fun)) ;; (if ',remotefun (my-def-browse-url-remote ,remotefun ,fun)))) ;; (my-def-browse-url-local-remote brwl brw find-w3m) ;; ;; (my-def-browse-url-local-remote brml brm find-edrxmozilla) ;; (my-def-browse-url-local-remote brml brm find-mozilla) ;; (my-def-browse-url-local-remote brmbgl brmbg eemozilla) ;; (my-def-browse-url-local-remote nil brp eepsne) ;; (my-def-browse-url-local-remote brfl nil find-fline) ;; (my-def-browse-url-local-remote bril nil find-eimage) ;; (my-def-browse-url-local-remote nil brtmpwget eetmpwget) ;; ;; (my-def-browse-url-local-remote brlynxl brlynx find-lynx) ;; (find-efunctionpp 'brwl) ;; (find-efunctionpp 'brm) ;; (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 "") ;; (defun brmd () (interactive) ;; (if (eq major-mode 'dired-mode) ;; (let* ((fname (file-name-sans-versions (dired-get-filename) t)) ;; (url (concat "file://" fname))) ;; (find-mozilla url) ;; (message (format "%S" `(find-mozilla ,url)))))) ;; ;; (defun brgvd () (interactive) ;; (if (eq major-mode 'dired-mode) ;; (let* ((fname (file-name-sans-versions (dired-get-filename) t))) ;; (find-pspage fname 1) ;; (message (format "%S" `(find-pspage ,fname 1)))))) ;; «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*") ; «tramp» ; (find-es "emacs" "tramp") ; (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/") ;; 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 ) ;;;;; ;; ;; «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"))) ;; 2006nov16 ;; (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 "") ;; «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))) (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)))) ;;;;; ;;;;; «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 "lsrc" "/usr/share/texmf-tetex/source/latex/") (code-c-d "plainsrc" "/usr/share/texmf-tetex/tex/plain/base/") (code-c-d "amslmath" "/usr/share/texmf-tetex/source/latex/amslatex/math/") (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-dvi "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) ; ; 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.1") ;(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 "dpol" "/usr/share/doc/debian-policy/") (code-c-d "maintg" "/usr/share/doc/maint-guide/") (code-c-d "debref" "/usr/share/doc/Debian/reference/") ; ;(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/") (code-c-d "hask98report" "/usr/share/doc/haskell98-report/html/haskell98-report-html/") (code-c-d "hask98tut" "/usr/share/doc/haskell98-tutorial/html/") ; ; 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/") ; ; «Python» ; (find-es "python" "links") (code-c-d "pyapi" "" "python2.4-api") (code-c-d "pydist" "" "python2.4-dist") (code-c-d "pyext" "" "python2.4-ext") (code-c-d "pylib" "/usr/lib/python2.4/" "python2.4-lib") (code-c-d "pyref" "" "python2.4-ref") (code-c-d "pytut" "" "python2.4-tut") (code-c-d "pyex" "/usr/share/doc/python2.1/examples/") (code-c-d "pyexd" "/usr/share/doc/python2.1/examples/Demo/") ;; ;; (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") ; ; 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-old "lua" "~/usrc/lua-5.0.2/" :gdb :grep) (code-c-d-old "lua5" "~/usrc/lua-5.0.2/" :gdb :grep) (code-c-d-old "lua50" "~/usrc/lua-5.0.2/" :gdb :grep) (code-c-d-old "lua511" "~/usrc/lua-5.1.1/" :gdb :grep) (code-c-d-old "lua512" "~/usrc/lua-5.1.2/" :gdb :grep) (code-c-d-old "lua51" "~/usrc/lua-5.1.2/" :gdb :grep) (code-c-d "compat51" "~/usrc/compat-5.1r4/") (code-c-d "lpeg" "~/usrc/lpeg-0.8.1/") ;; (find-lpegfile "") ;; (find-lpegw3m "lpeg.html") (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 "ipl" "/usr/lib/icon-ipl/") (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/") (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") ;; «find-xxxpage» (to ".find-xxxpage") ;; (find-angg ".emacs.papers") ;; (find-es "ps" "gv-starting-page") ;; ;; (defun find-zdvipage (fname n) ;; (let ((command (format "zxdvi %s +%d &" fname n))) ;; (eev command) command)) ;; (defun find-badpdfpage (fname n) ;; (let ((command (format "acroread %s &" fname))) ;; (eev command) command)) ;; ;; (defun find-xpdfpage (fname n) ;; (find-callprocess0 "xpdf" (ee-expand fname) (format "%s" n))) ;; (defun find-xpdfpage (fname &optional n) ;; (start-process ;; "xpdf" "*Messages*" ;; "xpdf" (ee-expand fname) (format "%s" (or n 1)))) ;; ;; (defun code-zdvi (code zdvifile) ;; (ee-eval-read-format ;; "(defun find-%spage (n &rest comments) ;; (interactive (list 1)) ;; (find-zdvipage %S n))" ;; code zdvifile)) ;; (defun code-xpdf (code pdffile) ;; (ee-eval-read-format ;; "(defun find-%spage (n &rest comments) ;; (interactive (list 1)) ;; (find-xpdfpage %S n))" ;; code pdffile)) (defun code-badpdf (code pdffile) (ee-eval-read-format "(defun find-%spage (n &rest comments) (interactive (list 1)) (find-badpdfpage %S n))" code pdffile)) (defun find-xyreferpage (n &rest comments) (find-dvipage "/usr/share/texmf/source/generic/xypic/doc/xyrefer.dvi" n)) (defun find-xyguidepage (n &rest comments) (find-dvipage "/usr/share/texmf/source/generic/xypic/doc/xyguide.dvi" n)) ;; (defun find-amsldocpage (n &rest comments) ;; (find-zdvipage "/usr/share/doc/texmf/latex/amslatex/amsldoc.dvi.gz" n)) (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-dvi "sga1" "~/tmp/sga1-corrected.dvi") ;; «iconbook» (to ".iconbook") ;; http://www.cs.arizona.edu/icon/ ;; http://www.cs.arizona.edu/icon/ftp/doc/lb1up.pdf ;; http://www.cs.arizona.edu/icon/ftp/doc/gb1up.pdf (code-ps "iconbook" "$S/http/www.cs.arizona.edu/icon/ftp/doc/lb1up.pdf") (code-ps "icongrbook" "$S/http/www.cs.arizona.edu/icon/ftp/doc/gb1up.pdf") (code-pdftotext "iconbook" "$S/http/www.cs.arizona.edu/icon/ftp/doc/lb1up.pdf") ;; (find-iconbookpage (+ 22 143) "An Overview of Graphics") ;; (find-iconbookpage (+ 22 273) "Language Reference Manual") ;; (find-icongrbookpage (+ 24 183)) ;; (find-iconbooktext) ;; «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") ;; (find-iconbooktext) ;; (find-iconbooktext "case Event() of") ;; (find-iconbooktext "Event(), 155-156") ;; (find-iconbookpage (+ 22 155)) (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") ;; (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")) ;; «lilypond» (to ".lilypond") ;; (find-fline "/etc/emacs/site-start.d/50lilypond.el") ;; (find-fline "/usr/share/emacs/site-lisp/lilypond-mode.el" "lilypond-indent") ;; The library lilypond-indent.el does not exist, so we fake it. ;; (find-angg "LILYPOND/lilypond-indent.el") ;; (find-es "music" "lilypond-src") (add-to-list 'load-path "~/LILYPOND/") ;; (add-to-list 'Info-additional-directory-list "/usr/share/info/lilypond/") ;; (find-node "(lilypond)Top") ;; (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))))))) ;; «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: ;; 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)) ;; (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" "/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") ;; «lua-mode» (to ".lua-mode") ;; (find-es "lua5" "lua-mode.el") ;; (find-fline "~/elisp/lua-mode.el") (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) ;; (find-fline "$S/http/lua-users.org/files/wiki_insecure/editors/") ' (noerr (load-file "$S/http/lua-users.org/files/wiki_insecure/editors/testing/lua-mode.el")) ' (progn (setq luaerr "3: f...n `process_stuff' at line 185 [file `dednat.lua']") (list (string-match "line \\([0-9]+\\) \\[file `\\(.*\\)'\\]" luaerr) (match-string 2 luaerr) (read (match-string 1 luaerr)))) ' (buffer-substring (ee-search-backward "\n") (ee-search-forward "\n")) (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 ((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 "maroon")))) '(makefile-space-face ((((class color)) (:background "maroon")))) '(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)))) ;; '(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))) ;; (find-efile "mouse.el") ;; (find-evariable 'x-fixed-font-alist "Font menu") ;;------------------------------------------- ;; «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)) ;; «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) ;;;;; ;; ;; «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 " ›«»") (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") (if (fboundp 'menu-bar-mode) (menu-bar-mode 0)) (if (fboundp 'tool-bar-mode) (tool-bar-mode 0)) (if (fboundp 'auto-image-file-mode) (auto-image-file-mode 1)) ;; «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-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)))) ;; «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) ;; (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") ;; ;; 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 7) (format-time-string "%02H:%M")) ((eq arg 8) (format-time-string "%Y-%m-%d")) (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) ;;----------------------------- ;; «eeblogme» (to ".eeblogme") ;; ;; (find-blogmefile "") (code-c-d "blogme" "~/blogme/" :anchor) (code-c-d "blogme3" "~/blogme3/" :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)) ;;------------------------------------------------/ (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-file (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