├── snippets ├── js2-mode │ └── .yas-parents ├── c++-mode │ ├── .yas-parents │ ├── ns │ ├── beginend │ ├── template │ ├── using │ ├── print │ ├── btest.req2 │ ├── catch │ ├── errprint │ ├── stdprint │ ├── btest.ceq │ ├── btest.clt │ ├── btest.cne │ ├── try │ ├── btest.req │ ├── btest.rlt │ ├── btest.rne │ ├── btest.test-case1 │ ├── prcopy │ ├── btest.test-case2 │ ├── btest.include │ ├── btest.test-suite1 │ ├── class │ └── btest.test-suite2 ├── c-mode │ ├── .yas-parents │ ├── fopen │ └── printf ├── cc-mode │ ├── .yas-parents │ ├── ret │ ├── inc │ ├── inc.1 │ ├── else │ ├── if │ ├── union │ ├── struct │ ├── while │ ├── do │ ├── case │ ├── for │ ├── ifelse │ ├── main │ ├── switch │ └── once ├── cuda-mode │ └── .yas-parents ├── erlang-mode │ ├── .yas-parents │ ├── undef │ ├── after │ ├── begin │ ├── def │ ├── fun │ ├── inc │ ├── rec │ ├── beh │ ├── case │ ├── inc.lib │ ├── compile │ ├── rcv │ ├── ifdef │ ├── ifndef │ ├── if │ ├── rcv.after │ ├── try │ ├── tryof │ ├── exp │ ├── imp │ ├── loop │ ├── mod │ └── func ├── sigdb-mode │ ├── alias │ ├── attr │ ├── desc │ ├── equal │ ├── or │ ├── and │ ├── wsig │ └── sig ├── go-mode │ ├── if │ ├── imp │ ├── main │ ├── imp2 │ ├── log │ ├── print │ ├── range │ ├── for │ ├── case │ ├── new │ ├── struct │ ├── for3 │ ├── array │ ├── interface │ ├── switch │ ├── map │ ├── for2 │ ├── function │ ├── function2 │ ├── function3 │ └── map_with_select ├── clojure-mode │ ├── imp │ ├── def │ ├── def- │ ├── defn │ ├── defn- │ ├── opts │ ├── if │ ├── defproto │ └── ns ├── ess-mode │ ├── else │ ├── if │ ├── for │ └── elif ├── js-mode │ ├── al │ ├── el │ ├── ev.fire │ ├── log │ ├── if │ ├── com │ ├── f │ ├── def │ ├── f.1 │ ├── each │ ├── init │ ├── ev.add │ ├── for │ ├── class │ ├── req.json │ └── req.html ├── sh-mode │ ├── trap │ ├── func │ ├── if │ ├── for │ ├── while │ ├── elseif │ ├── case │ └── args ├── scheme-mode │ ├── def │ ├── defun │ ├── let │ ├── print │ └── if ├── muse-mode │ └── src ├── org-mode │ ├── prop │ ├── block │ ├── example │ └── src ├── haskell-mode │ ├── main │ ├── case │ ├── if │ └── moddef └── emacs-lisp-mode │ └── defun-ni.yasnippet ├── auto-insert ├── insert.muse ├── insert.sh ├── insert.lisp ├── insert-home.cpp ├── insert-home.h ├── insert.el ├── insert.erl ├── insert-work.cpp └── insert-work.h ├── rc ├── mac │ ├── run-growl.applescript │ └── register-growl.applescript ├── emacs-rc-eblogger.el ├── emacs-rc-html.el ├── emacs-rc-autocomplete.el ├── emacs-rc-gdb.el ├── emacs-rc-company-mode.el ├── emacs-rc-gclient.el ├── emacs-rc-mercurial.el ├── emacs-rc-octave.el ├── emacs-rc-ruby.el ├── emacs-rc-epg.el ├── emacs-rc-dvc.el ├── emacs-rc-remember.el ├── emacs-rc-w3.el ├── emacs-rc-ecb.el ├── emacs-rc-info.el ├── emacs-rc-gnuplot.el ├── emacs-rc-css.el ├── emacs-rc-vcs-misc.el ├── emacs-rc-twitter.el ├── emacs-rc-lj.el ├── emacs-rc-jdee.el ├── emacs-rc-prolog.el ├── emacs-rc-scala.el ├── emacs-rc-mailcrypt.el ├── emacs-rc-cmake.el ├── emacs-rc-distel.el ├── emacs-rc-lisp.el ├── emacs-rc-tramp.el ├── emacs-rc-doxygen.el ├── emacs-rc-ess.el ├── emacs-rc-git.el ├── emacs-rc-yasnippet.el ├── emacs-rc-mule.el ├── emacs-rc-javascript.el ├── emacs-rc-go.el ├── emacs-rc-perl.el ├── emacs-rc-sdcv.el ├── emacs-rc-ispell.el ├── emacs-rc-emms.el ├── emacs-rc-decor.el ├── emacs-rc-python.el ├── emacs-rc-timeclock.el ├── emacs-rc-server.el ├── emacs-rc-elisp.el ├── emacs-rc-bbdb.el ├── emacs-rc-wikis.el ├── emacs-rc-nxml.el ├── emacs-rc-sh-mode.el ├── emacs-rc-w3m.el ├── emacs-rc-dict.el ├── emacs-rc-tex.el ├── emacs-rc-clojure.el ├── emacs-rc-desktop.el ├── emacs-rc-flymake.el ├── emacs-rc-ocaml.el ├── emacs-rc-haskell.el ├── emacs-rc-erlang.el ├── emacs-rc-common-hooks.el ├── emacs-rc-kbd.el ├── emacs-rc-erc.el ├── emacs-rc-osd.el ├── emacs-rc-slime.el ├── emacs-rc-scheme.el ├── emacs-rc-iswitchb.el ├── emacs-rc-jabber.el ├── emacs-rc-prog-misc.el ├── emacs-rc-misc-things.el ├── emacs-rc-local-flash.el ├── emacs-rc-auto-insert.el ├── emacs-rc-ccmode.el ├── emacs-rc-supercite.el ├── emacs-rc-pretty-lambda.el ├── emacs-rc-org-mode.el ├── emacs-rc-cedet.el ├── emacs-rc-cedet-old.el └── emacs-rc-muse.el ├── README ├── .gitignore ├── .emacs └── .gnus /snippets/js2-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | js-mode -------------------------------------------------------------------------------- /snippets/c++-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | cc-mode 2 | -------------------------------------------------------------------------------- /snippets/c-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | cc-mode 2 | -------------------------------------------------------------------------------- /snippets/cc-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | text-mode 2 | -------------------------------------------------------------------------------- /snippets/cuda-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | cc-mode 2 | -------------------------------------------------------------------------------- /snippets/erlang-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | text-mode 2 | -------------------------------------------------------------------------------- /auto-insert/insert.muse: -------------------------------------------------------------------------------- 1 | #title 2 | #keywords 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /snippets/cc-mode/ret: -------------------------------------------------------------------------------- 1 | # key: ret 2 | # name: return 3 | # -- 4 | return $0; -------------------------------------------------------------------------------- /snippets/c++-mode/ns: -------------------------------------------------------------------------------- 1 | # key: ns 2 | # name: namespace ... 3 | # -- 4 | namespace -------------------------------------------------------------------------------- /snippets/sigdb-mode/alias: -------------------------------------------------------------------------------- 1 | # key: alias 2 | # name: aliases 3 | # -- 4 | aliases {$0} -------------------------------------------------------------------------------- /snippets/go-mode/if: -------------------------------------------------------------------------------- 1 | # name: if 2 | # key: if 3 | # -- 4 | if ($1) { 5 | $0 6 | } 7 | -------------------------------------------------------------------------------- /snippets/sigdb-mode/attr: -------------------------------------------------------------------------------- 1 | # key: attr 2 | # name: attributes 3 | # -- 4 | attributes {$0} -------------------------------------------------------------------------------- /snippets/cc-mode/inc: -------------------------------------------------------------------------------- 1 | # key: inc 2 | # name: #include "..." 3 | # -- 4 | #include "$1" 5 | -------------------------------------------------------------------------------- /snippets/cc-mode/inc.1: -------------------------------------------------------------------------------- 1 | # key: inc 2 | # name: #include <...> 3 | # -- 4 | #include <$1> 5 | -------------------------------------------------------------------------------- /snippets/clojure-mode/imp: -------------------------------------------------------------------------------- 1 | # key: imp 2 | # name: (import '() ...) 3 | # -- 4 | (import '($0)) -------------------------------------------------------------------------------- /snippets/sigdb-mode/desc: -------------------------------------------------------------------------------- 1 | # key: desc 2 | # name: description 3 | # -- 4 | description {"$0"} -------------------------------------------------------------------------------- /snippets/sigdb-mode/equal: -------------------------------------------------------------------------------- 1 | # key: eq 2 | # name: (= @N "") 3 | # -- 4 | (= @${1:offset} "$0") -------------------------------------------------------------------------------- /snippets/sigdb-mode/or: -------------------------------------------------------------------------------- 1 | # key: or 2 | # name: or 3 | # -- 4 | (or (${1:first_expression}) ($0)) -------------------------------------------------------------------------------- /snippets/cc-mode/else: -------------------------------------------------------------------------------- 1 | # key: else 2 | # name : else { ... } 3 | # -- 4 | else { 5 | $0$> 6 | }$> -------------------------------------------------------------------------------- /snippets/clojure-mode/def: -------------------------------------------------------------------------------- 1 | # key: def 2 | # name: (def var ...) 3 | # -- 4 | (def ${1:name} $0)$> -------------------------------------------------------------------------------- /snippets/erlang-mode/undef: -------------------------------------------------------------------------------- 1 | # name: -undef(...). 2 | # key: undef 3 | # -- 4 | -undef($1). 5 | $0 -------------------------------------------------------------------------------- /snippets/ess-mode/else: -------------------------------------------------------------------------------- 1 | # key: else 2 | # name : else { ... } 3 | # -- 4 | else { 5 | $0$> 6 | }$> -------------------------------------------------------------------------------- /snippets/go-mode/imp: -------------------------------------------------------------------------------- 1 | # name: empty import 2 | # key: imp 3 | # -- 4 | import ( 5 | "$0"$> 6 | )$> -------------------------------------------------------------------------------- /snippets/js-mode/al: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # key: al 3 | #name : alert 4 | # -- 5 | alert($0); -------------------------------------------------------------------------------- /snippets/sh-mode/trap: -------------------------------------------------------------------------------- 1 | # key: trap 2 | # name: trap 3 | # -- 4 | trap "${1:handler}" 0 1 2 13 15 -------------------------------------------------------------------------------- /snippets/sigdb-mode/and: -------------------------------------------------------------------------------- 1 | # key: and 2 | # name: and 3 | # -- 4 | (and (${1:first_expression}) ($0)) -------------------------------------------------------------------------------- /snippets/erlang-mode/after: -------------------------------------------------------------------------------- 1 | # name: after ... -> 2 | # key: after 3 | # -- 4 | after 5 | $1 -> $0 -------------------------------------------------------------------------------- /snippets/erlang-mode/begin: -------------------------------------------------------------------------------- 1 | # name: begin ... end 2 | # key: begin 3 | # -- 4 | begin 5 | $0 6 | end -------------------------------------------------------------------------------- /snippets/erlang-mode/def: -------------------------------------------------------------------------------- 1 | # name: -define(...,...). 2 | # key: def 3 | # -- 4 | -define($1,$2). 5 | $0 -------------------------------------------------------------------------------- /snippets/erlang-mode/fun: -------------------------------------------------------------------------------- 1 | # name: fun (...) -> ... end 2 | # key: fun 3 | # -- 4 | fun ($1) -> $0 end -------------------------------------------------------------------------------- /snippets/erlang-mode/inc: -------------------------------------------------------------------------------- 1 | # name: -include("..."). 2 | # key: inc 3 | # -- 4 | -include("$1"). 5 | $0 -------------------------------------------------------------------------------- /snippets/erlang-mode/rec: -------------------------------------------------------------------------------- 1 | # name: -record(...,{...}). 2 | # key: rec 3 | # -- 4 | -record($1,{$2}). 5 | $0 -------------------------------------------------------------------------------- /snippets/js-mode/el: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # key: el 3 | #name : else 4 | # -- 5 | else { 6 | $0 7 | } -------------------------------------------------------------------------------- /snippets/c++-mode/beginend: -------------------------------------------------------------------------------- 1 | # key: beginend 2 | # name : v.begin(), v.end() 3 | # -- 4 | ${1:v}.begin(), $1.end -------------------------------------------------------------------------------- /snippets/cc-mode/if: -------------------------------------------------------------------------------- 1 | # key: if 2 | # name: if (...) { ... } 3 | # -- 4 | if (${1:condition}) { 5 | $0$> 6 | }$> -------------------------------------------------------------------------------- /snippets/cc-mode/union: -------------------------------------------------------------------------------- 1 | # key: union 2 | # name: union ... { ... } 3 | # -- 4 | union ${1:name} { 5 | $0$> 6 | };$> -------------------------------------------------------------------------------- /snippets/erlang-mode/beh: -------------------------------------------------------------------------------- 1 | # name: -behaviour(...). 2 | # key: beh 3 | # -- 4 | -behaviour(${1:gen_server}). 5 | $0 -------------------------------------------------------------------------------- /snippets/erlang-mode/case: -------------------------------------------------------------------------------- 1 | # name: case ... of ... end 2 | # key: case 3 | # -- 4 | case $1 of 5 | $0 6 | end -------------------------------------------------------------------------------- /snippets/erlang-mode/inc.lib: -------------------------------------------------------------------------------- 1 | # name: -include_lib("..."). 2 | # key: inc 3 | # -- 4 | -include_lib("$1"). 5 | $0 -------------------------------------------------------------------------------- /snippets/ess-mode/if: -------------------------------------------------------------------------------- 1 | # key: if 2 | # name: if (...) { ... } 3 | # -- 4 | if (${1:condition}) { 5 | $0$> 6 | }$> -------------------------------------------------------------------------------- /snippets/js-mode/ev.fire: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # key: ev 3 | #name : fireEvent 4 | # -- 5 | fireEvent('$0') -------------------------------------------------------------------------------- /snippets/js-mode/log: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # key: log 3 | #name : console.log 4 | # -- 5 | console.log($0); -------------------------------------------------------------------------------- /snippets/scheme-mode/def: -------------------------------------------------------------------------------- 1 | # key: def 2 | # name: (define var val) 3 | # -- 4 | (define ${1:var} ${2:value}) 5 | $0 -------------------------------------------------------------------------------- /rc/mac/run-growl.applescript: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexott/emacs-configs/master/rc/mac/run-growl.applescript -------------------------------------------------------------------------------- /snippets/c++-mode/template: -------------------------------------------------------------------------------- 1 | # key: template 2 | # name: template 3 | # -- 4 | template -------------------------------------------------------------------------------- /snippets/c++-mode/using: -------------------------------------------------------------------------------- 1 | # key: using 2 | # name: using namespace ... 3 | # -- 4 | using namespace ${1:std}; 5 | $0 -------------------------------------------------------------------------------- /snippets/cc-mode/struct: -------------------------------------------------------------------------------- 1 | # key: struct 2 | # name: struct ... { ... } 3 | # -- 4 | struct ${1:name} { 5 | $0$> 6 | };$> -------------------------------------------------------------------------------- /snippets/cc-mode/while: -------------------------------------------------------------------------------- 1 | # key: while 2 | # name: while (...) { ... } 3 | # -- 4 | while (${1:condition}) { 5 | $0 6 | } -------------------------------------------------------------------------------- /snippets/clojure-mode/def-: -------------------------------------------------------------------------------- 1 | # key: def- 2 | # name: (def- var ...) 3 | # -- 4 | (def ^{:private true} ${1:name} $0)$> -------------------------------------------------------------------------------- /snippets/erlang-mode/compile: -------------------------------------------------------------------------------- 1 | # name: -compile(...). 2 | # key: compile 3 | # -- 4 | -compile([${1:export_all}]). 5 | $0 -------------------------------------------------------------------------------- /snippets/erlang-mode/rcv: -------------------------------------------------------------------------------- 1 | # name: receive ... -> ... end 2 | # key: rcv 3 | # -- 4 | receive 5 | $1 -> $0 6 | end -------------------------------------------------------------------------------- /snippets/ess-mode/for: -------------------------------------------------------------------------------- 1 | # key: for 2 | # name: for (...) { ... } 3 | # -- 4 | for (${1:condition}) { 5 | $0$> 6 | }$> -------------------------------------------------------------------------------- /snippets/scheme-mode/defun: -------------------------------------------------------------------------------- 1 | # key: defun 2 | # name: (define (fun ...) 3 | # -- 4 | (define (${1:func}) 5 | $0$> 6 | )$> -------------------------------------------------------------------------------- /snippets/scheme-mode/let: -------------------------------------------------------------------------------- 1 | # key: let 2 | # name: (let (..)) 3 | # -- 4 | (let ((${1:var} ${2:value})) 5 | $0$> 6 | )$> -------------------------------------------------------------------------------- /snippets/scheme-mode/print: -------------------------------------------------------------------------------- 1 | # key: print 2 | # name: (fprintf) 3 | # -- 4 | (fprintf (current-output-port) "$1~n" $0) -------------------------------------------------------------------------------- /snippets/sh-mode/func: -------------------------------------------------------------------------------- 1 | # key: func 2 | # name: function .. {...} 3 | # -- 4 | function ${1:name} () { 5 | $0$> 6 | }$> -------------------------------------------------------------------------------- /auto-insert/insert.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # File: (>>FILE<<) 4 | # 5 | # Created: (>>DATE<<) by Alex Ott 6 | # 7 | 8 | -------------------------------------------------------------------------------- /snippets/c++-mode/print: -------------------------------------------------------------------------------- 1 | # key: print 2 | # name: std::cout << ... << std::endl; 3 | # -- 4 | std::cout << $0 << std::endl; -------------------------------------------------------------------------------- /snippets/cc-mode/do: -------------------------------------------------------------------------------- 1 | # key: do 2 | # name : do { ... } while (...) 3 | # -- 4 | do { 5 | $0 6 | } while (${1:condition}); -------------------------------------------------------------------------------- /snippets/erlang-mode/ifdef: -------------------------------------------------------------------------------- 1 | # name: -ifdef(...). ... -endif. 2 | # key: ifdef 3 | # -- 4 | -ifdef($1). 5 | $0 6 | -endif. -------------------------------------------------------------------------------- /snippets/erlang-mode/ifndef: -------------------------------------------------------------------------------- 1 | # name: -ifndef(...). ... -endif. 2 | # key: ifndef 3 | # -- 4 | -ifndef($1). 5 | $0 6 | -endif. -------------------------------------------------------------------------------- /snippets/js-mode/if: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # key: if 3 | #name : if 4 | # -- 5 | if (${1:condition}) { 6 | $0 7 | } -------------------------------------------------------------------------------- /snippets/muse-mode/src: -------------------------------------------------------------------------------- 1 | # key: src 2 | # name: ... 3 | # -- 4 | 5 | $0 6 | -------------------------------------------------------------------------------- /snippets/sh-mode/if: -------------------------------------------------------------------------------- 1 | # key: if 2 | # name: if ... ; then ... ; fi 3 | # -- 4 | if [ ${1:expression} ]; then 5 | $0$> 6 | fi$> -------------------------------------------------------------------------------- /rc/mac/register-growl.applescript: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexott/emacs-configs/master/rc/mac/register-growl.applescript -------------------------------------------------------------------------------- /snippets/c++-mode/btest.req2: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # key: req 3 | # name: BOOST_REQUIRE 4 | # -- 5 | BOOST_REQUIRE($0); -------------------------------------------------------------------------------- /snippets/c++-mode/catch: -------------------------------------------------------------------------------- 1 | # key: catch 2 | # name: catch (...) { ... } 3 | # -- 4 | catch (${1:condition}) { 5 | $0 6 | } 7 | -------------------------------------------------------------------------------- /snippets/c++-mode/errprint: -------------------------------------------------------------------------------- 1 | # key: errprint 2 | # name: std::cerr << ... << std::endl; 3 | # -- 4 | std::cerr << $0 << std::endl; -------------------------------------------------------------------------------- /snippets/c++-mode/stdprint: -------------------------------------------------------------------------------- 1 | # key: stdprint 2 | # name: std::cout << ... << std::endl; 3 | # -- 4 | std::cout << $0 << std::endl; -------------------------------------------------------------------------------- /snippets/cc-mode/case: -------------------------------------------------------------------------------- 1 | # key: case 2 | # name : case ...: { ... } 3 | # -- 4 | case ${1:value}: {$> 5 | $0$> 6 | break;$> 7 | }$> -------------------------------------------------------------------------------- /snippets/clojure-mode/defn: -------------------------------------------------------------------------------- 1 | # key: defn 2 | # name: (defn fun ...) 3 | # -- 4 | (defn ${1:func} [${2:args}]$> 5 | $0$> 6 | )$> -------------------------------------------------------------------------------- /snippets/clojure-mode/defn-: -------------------------------------------------------------------------------- 1 | # key: defn- 2 | # name: (defn- fun ...) 3 | # -- 4 | (defn- ${1:func} [${2:args}]$> 5 | $0$> 6 | )$> -------------------------------------------------------------------------------- /snippets/clojure-mode/opts: -------------------------------------------------------------------------------- 1 | # key: keys 2 | # name: (:keys [] :or {}) 3 | # -- 4 | {:keys [${1:options}] :or {${2:defvalues}}}$0$> -------------------------------------------------------------------------------- /snippets/ess-mode/elif: -------------------------------------------------------------------------------- 1 | # key: elif 2 | # name: else if (...) { ... } 3 | # -- 4 | else if (${1:condition}) { 5 | $0$> 6 | }$> -------------------------------------------------------------------------------- /snippets/go-mode/main: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: func main 3 | # key: main 4 | # -- 5 | func main() { 6 | $0$> 7 | } -------------------------------------------------------------------------------- /snippets/js-mode/com: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # key: com 3 | #name : comment (/* ... */) 4 | # -- 5 | /* 6 | * $0 7 | */ -------------------------------------------------------------------------------- /snippets/js-mode/f: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # key: f 3 | #name : anonymous function 4 | # -- 5 | function($1) { 6 | $0 7 | } -------------------------------------------------------------------------------- /snippets/org-mode/prop: -------------------------------------------------------------------------------- 1 | # key: prop 2 | # name: prop (:PROPERTIES:....:END:) 3 | # -- 4 | :PROPERTIES:$> 5 | $0$> 6 | :END:$> 7 | -------------------------------------------------------------------------------- /snippets/c-mode/fopen: -------------------------------------------------------------------------------- 1 | # key: fopen 2 | # name: FILE *fp = fopen(..., ...); 3 | # -- 4 | FILE *${fp} = fopen(${"file"}, "${r}"); 5 | -------------------------------------------------------------------------------- /snippets/js-mode/def: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # key: def 3 | #name : function 4 | # -- 5 | ${1:name}: function($2) { 6 | $0 7 | } -------------------------------------------------------------------------------- /snippets/org-mode/block: -------------------------------------------------------------------------------- 1 | # key: block 2 | # name: block (#+BEGIN_N...#+END_N) 3 | # -- 4 | #+BEGIN_${1:TYPE} $2 5 | $0 6 | #+END_$1 -------------------------------------------------------------------------------- /snippets/sh-mode/for: -------------------------------------------------------------------------------- 1 | # key: for 2 | # name: for .. in .... ; do ... ; done 3 | # -- 4 | for f in ${1:range}; do 5 | $0$> 6 | done$> -------------------------------------------------------------------------------- /snippets/sh-mode/while: -------------------------------------------------------------------------------- 1 | # key: while 2 | # name: while ... ; do ... ; done 3 | # -- 4 | while ${1:condition}; do 5 | $0$> 6 | done$> -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | This repository contains emacs configuration files. Questions about this config you can 2 | send to me (alexott@gmail.com) 3 | 4 | -------------------------------------------------------------------------------- /snippets/erlang-mode/if: -------------------------------------------------------------------------------- 1 | # name: if ... -> ... ; true -> ... end 2 | # key: if 3 | # -- 4 | if 5 | $1 -> $2; 6 | true -> $0 7 | end -------------------------------------------------------------------------------- /snippets/erlang-mode/rcv.after: -------------------------------------------------------------------------------- 1 | # name: receive after ... -> ... end 2 | # key: rcv 3 | # -- 4 | receive 5 | after 6 | $1 -> $0 7 | end -------------------------------------------------------------------------------- /snippets/js-mode/f.1: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # key: f 3 | #name : named function 4 | # -- 5 | function ${1:name}($2) { 6 | $0 7 | } -------------------------------------------------------------------------------- /snippets/org-mode/example: -------------------------------------------------------------------------------- 1 | # key: ex 2 | # name: example (#+BEGIN_EXAMPLE...) 3 | # -- 4 | #+BEGIN_EXAMPLE 5 | $0 6 | #+END_EXAMPLE 7 | -------------------------------------------------------------------------------- /snippets/sh-mode/elseif: -------------------------------------------------------------------------------- 1 | # key: elif 2 | # name: elif [ .. ] ; then ... ; fi 3 | # -- 4 | elif [ ${1:expression} ]; then 5 | $0$> 6 | fi$> -------------------------------------------------------------------------------- /snippets/c++-mode/btest.ceq: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # key: eq 3 | # name: BOOST_CHECK_EQUAL 4 | # -- 5 | BOOST_CHECK_EQUAL(${1:left}, $0); -------------------------------------------------------------------------------- /snippets/c++-mode/btest.clt: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # key: lt 3 | # name: BOOST_CHECK_LT 4 | # -- 5 | BOOST_CHECK_LT(${1:left}, $0); 6 | -------------------------------------------------------------------------------- /snippets/c++-mode/btest.cne: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # key: ne 3 | # name: BOOST_CHECK_NE 4 | # -- 5 | BOOST_CHECK_NE(${1:left}, $0); 6 | -------------------------------------------------------------------------------- /snippets/c++-mode/try: -------------------------------------------------------------------------------- 1 | # key: try 2 | # name: try {} catch (...) { ... } 3 | # -- 4 | try { 5 | $0 6 | } catch (${1:condition}) { 7 | } 8 | -------------------------------------------------------------------------------- /snippets/cc-mode/for: -------------------------------------------------------------------------------- 1 | # key: for 2 | # name : for (...; ...; ...) { ... } 3 | # -- 4 | for (${1:init}; ${2:condition}; ${3:post}) { 5 | $0 6 | } -------------------------------------------------------------------------------- /snippets/clojure-mode/if: -------------------------------------------------------------------------------- 1 | # key: if 2 | # name: (if cond true-cond else-cond) 3 | # -- 4 | (if ${1:condition} 5 | ${2:value}$> 6 | $0$> 7 | )$> -------------------------------------------------------------------------------- /snippets/erlang-mode/try: -------------------------------------------------------------------------------- 1 | # name: try ... of ... catch after end 2 | # key: try 3 | # -- 4 | try $1 of 5 | $0 6 | catch 7 | after 8 | end -------------------------------------------------------------------------------- /snippets/erlang-mode/tryof: -------------------------------------------------------------------------------- 1 | # key: try 2 | # name: try ... of ... catch end 3 | # -- 4 | try $1 of$> 5 | $0$> 6 | catch$> 7 | end.$> 8 | -------------------------------------------------------------------------------- /snippets/js-mode/each: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # key: each 3 | #name : each 4 | # -- 5 | ${1:collection}.each(function($2) { 6 | $0 7 | }); -------------------------------------------------------------------------------- /snippets/js-mode/init: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # key: init 3 | #name : Constructor 4 | # -- 5 | initialize: function($1) { 6 | $0 7 | } -------------------------------------------------------------------------------- /snippets/sigdb-mode/wsig: -------------------------------------------------------------------------------- 1 | # key: wsig 2 | # name: only description 3 | # -- 4 | ${1:mimetype} => extensions {${2:extensions}} description {"$0"} -------------------------------------------------------------------------------- /snippets/c++-mode/btest.req: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # key: eq 3 | # name: BOOST_REQUIRE_EQUAL 4 | # -- 5 | BOOST_REQUIRE_EQUAL(${1:left}, $0); -------------------------------------------------------------------------------- /snippets/c++-mode/btest.rlt: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # key: lt 3 | # name: BOOST_REQUIRE_LT 4 | # -- 5 | BOOST_REQUIRE_LT(${1:left}, $0); 6 | -------------------------------------------------------------------------------- /snippets/c++-mode/btest.rne: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # key: ne 3 | # name: BOOST_REQUIRE_NE 4 | # -- 5 | BOOST_REQUIRE_NE(${1:left}, $0); 6 | -------------------------------------------------------------------------------- /snippets/cc-mode/ifelse: -------------------------------------------------------------------------------- 1 | # key: ifelse 2 | # name: ifelse (...) { ... } { ... } 3 | # -- 4 | if (${1:condition}) { 5 | $0$> 6 | } else {$> 7 | }$> -------------------------------------------------------------------------------- /snippets/scheme-mode/if: -------------------------------------------------------------------------------- 1 | # key: if 2 | # name: (if cond true-cond else-cond) 3 | # -- 4 | (if ${1:condition} 5 | ${2:value}$> 6 | $0$> 7 | )$> 8 | -------------------------------------------------------------------------------- /snippets/js-mode/ev.add: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # key: ev 3 | #name : addEvent 4 | # -- 5 | addEvent('${1:event}', function($2) { 6 | $0 7 | }); -------------------------------------------------------------------------------- /snippets/erlang-mode/exp: -------------------------------------------------------------------------------- 1 | # name: -export([]). 2 | # contributor: hitesh 3 | # key: exp 4 | # -- 5 | -export([${1:start/0}]). 6 | $0 -------------------------------------------------------------------------------- /snippets/haskell-mode/main: -------------------------------------------------------------------------------- 1 | # contributor: Alex Ott 2 | # key: main 3 | # name: main 4 | # -- 5 | 6 | main :: IO () 7 | main = do 8 | $0 -------------------------------------------------------------------------------- /snippets/cc-mode/main: -------------------------------------------------------------------------------- 1 | # key: main 2 | # name: int main(argc, argv) { ... } 3 | # -- 4 | int main(int argc, char **argv) { 5 | $0 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /snippets/js-mode/for: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # key: for 3 | #name : for 4 | # -- 5 | for(var ${1:i} = ${2:0}; $1 < ${3:collection}.length; $1++) { 6 | $0 7 | } -------------------------------------------------------------------------------- /snippets/c++-mode/btest.test-case1: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # key: tcase 3 | # name: normal test case 4 | # -- 5 | BOOST_AUTO_TEST_CASE(${1:name}) 6 | {$> 7 | $0$> 8 | }$> -------------------------------------------------------------------------------- /snippets/c++-mode/prcopy: -------------------------------------------------------------------------------- 1 | # key: prcopy 2 | # name: prcopy (make private copy operator & constructor) 3 | # -- 4 | ${1:CLASSNAME}(const $1&); 5 | $1& operator=(const $1&); -------------------------------------------------------------------------------- /snippets/erlang-mode/imp: -------------------------------------------------------------------------------- 1 | # name: -import([]). 2 | # contributor: hitesh 3 | # key: imp 4 | # -- 5 | -import(${1:lists}, [${2:map/2, sum/1}]). 6 | $0 -------------------------------------------------------------------------------- /snippets/haskell-mode/case: -------------------------------------------------------------------------------- 1 | # contributor: Alex Ott 2 | # key: case 3 | # name: case ... of ... 4 | # -- 5 | case ${1:var} of 6 | ${2:condition} -> $0 ; -------------------------------------------------------------------------------- /auto-insert/insert.lisp: -------------------------------------------------------------------------------- 1 | ;;; 2 | ;;; File: (>>FILE<<) 3 | ;;; Author: Alex Ott 4 | ;;; 5 | ;;; Created: (>>DATE<<) 6 | ;;; 7 | ;;; 8 | ;;; 9 | 10 | -------------------------------------------------------------------------------- /snippets/haskell-mode/if: -------------------------------------------------------------------------------- 1 | # contributor: Alex Ott 2 | # key: if 3 | # name: if ... then ... else ... 4 | # -- 5 | if ${1:condition} 6 | then $0 7 | else -------------------------------------------------------------------------------- /snippets/haskell-mode/moddef: -------------------------------------------------------------------------------- 1 | # contributor: Alex Ott 2 | # key: moddef 3 | # name: module ... where ... 4 | # -- 5 | module ${1:Main} 6 | where 7 | 8 | $0 -------------------------------------------------------------------------------- /snippets/js-mode/class: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # key: class 3 | #name : Class 4 | # -- 5 | var ${1:name} = new Class({ 6 | initialize: function($2) { 7 | $0 8 | } 9 | }); -------------------------------------------------------------------------------- /snippets/erlang-mode/loop: -------------------------------------------------------------------------------- 1 | # name: loop(...) -> receive _ -> loop(...) end. 2 | # key: loop 3 | # -- 4 | ${1:loop}($2) -> 5 | receive 6 | ${3:_} -> 7 | $1($2) 8 | end. 9 | $0 -------------------------------------------------------------------------------- /snippets/sh-mode/case: -------------------------------------------------------------------------------- 1 | # key: case 2 | # name: case ... ; ... esac 3 | # -- 4 | case ${1:dispatch name} in 5 | ${2:condition}) 6 | $0 7 | ;; 8 | *) 9 | ;; 10 | esac -------------------------------------------------------------------------------- /rc/emacs-rc-eblogger.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-eblogger.el --- 2 | 3 | ;; Copyright (C) 2007 Alex Ott 4 | ;; 5 | 6 | (load "~/emacs/e-blog/e-blog.el") 7 | 8 | ;;; emacs-rc-eblogger.el ends here 9 | -------------------------------------------------------------------------------- /snippets/go-mode/imp2: -------------------------------------------------------------------------------- 1 | # name: import with fmt, strings, io, log, ... 2 | # key: imp 3 | # -- 4 | import ( 5 | "fmt"$> 6 | "strings"$> 7 | "io"$> 8 | "log"$> 9 | $0$> 10 | )$> -------------------------------------------------------------------------------- /snippets/go-mode/log: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: log.Fatal(...) 3 | # key: log 4 | # expand-env: ((yas/indent-line 'fixed) (yas/wrap-around-region 'nil)) 5 | # -- 6 | log.Fatal($0) 7 | -------------------------------------------------------------------------------- /snippets/sh-mode/args: -------------------------------------------------------------------------------- 1 | # key: args 2 | # name: args 3 | # -- 4 | if [ $# -ne ${1:numargs} ]; then 5 | echo "usage: \`basename \$0\` ${2:args_description}" 6 | exit 1 7 | fi 8 | 9 | $0 -------------------------------------------------------------------------------- /snippets/c++-mode/btest.test-case2: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # key: tcase 3 | # name: test case with fixture 4 | # -- 5 | BOOST_FIXTURE_TEST_CASE(${1:name}, ${2:fixture}) 6 | {$> 7 | $0$> 8 | }$> -------------------------------------------------------------------------------- /snippets/clojure-mode/defproto: -------------------------------------------------------------------------------- 1 | # key: defproto 2 | # name: (defproto name ...) 3 | # -- 4 | (defprotocol ${1:name} 5 | "${2:proto-doc}"$> 6 | (${3:func-name} [${4:args}] "${5:func-doc}")$0$> 7 | )$> -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/defun-ni.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Alex Ott (alexott.net) 2 | # name: non-interactive defun 3 | # key: defun 4 | # key: d 5 | # -- 6 | (defun $1 ($2) 7 | "$3" 8 | $0 9 | ) -------------------------------------------------------------------------------- /auto-insert/insert-home.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file (>>FILE<<) 3 | * @author Alex Ott 4 | * 5 | * @brief 6 | * 7 | * 8 | */ 9 | 10 | /*#include "HHHH"*/ 11 | 12 | -------------------------------------------------------------------------------- /snippets/go-mode/print: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: fmt.Ptrintf 3 | # key: pr 4 | # expand-env: ((yas/indent-line 'fixed) (yas/wrap-around-region 'nil)) 5 | # -- 6 | fmt.Printf("$1\n", $0) 7 | -------------------------------------------------------------------------------- /snippets/go-mode/range: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: range 3 | # key: range 4 | # contributor: Alex Lispython (alex@obout.ru) 5 | # -- 6 | for ${1:pos}, ${2:value} := range ${3:} { 7 | $0 8 | } 9 | -------------------------------------------------------------------------------- /snippets/sigdb-mode/sig: -------------------------------------------------------------------------------- 1 | # key: sig 2 | # name: signature 3 | # -- 4 | ${1:mimetype} => extensions {${2:extensions}} 5 | attributes {final} 6 | description {"${3:description}"} 7 | signatures { 8 | $0 9 | } -------------------------------------------------------------------------------- /snippets/c-mode/printf: -------------------------------------------------------------------------------- 1 | # key: printf 2 | # name: printf 3 | # contributor: joaotavora 4 | # -- 5 | printf ("${1:%s}\\n"${1:$(if (string-match "%" text) "," "\);") 6 | }$2${1:$(if (string-match "%" text) "\);" "")} -------------------------------------------------------------------------------- /snippets/c++-mode/btest.include: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # key: tinc 3 | # name: includes for boost test 4 | # -- 5 | #define BOOST_TEST_MODULE ${1:description} 6 | #include 7 | 8 | $0 -------------------------------------------------------------------------------- /snippets/c++-mode/btest.test-suite1: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # key: tsuite 3 | # name: normal test suite 4 | # -- 5 | BOOST_AUTO_TEST_SUITE(${1:name}) 6 | 7 | $0 8 | 9 | BOOST_AUTO_TEST_SUITE_END() 10 | -------------------------------------------------------------------------------- /snippets/c++-mode/class: -------------------------------------------------------------------------------- 1 | # key: class 2 | # name: class ... { ... } 3 | # -- 4 | class ${1:Name} { 5 | public: 6 | ${1:$(yas/substr text "[^: ]*")}($2); 7 | virtual ~${1:$(yas/substr text "[^: ]*")}(); 8 | }; -------------------------------------------------------------------------------- /snippets/js-mode/req.json: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # key: req 3 | #name : json 4 | # -- 5 | new Request.JSON({ 6 | onSuccess: function(responseJSON, responseText) { 7 | $0 8 | } 9 | }).${1:send}(${2:url}); -------------------------------------------------------------------------------- /snippets/org-mode/src: -------------------------------------------------------------------------------- 1 | # key: src 2 | # name: src (#+BEGIN_SRC...) 3 | # -- 4 | #+BEGIN_SRC ${1:$$(yas/choose-value (reverse (mapcar (lambda (x) (symbol-name (car x))) org-babel-load-languages)))} 5 | $0 6 | #+END_SRC -------------------------------------------------------------------------------- /snippets/cc-mode/switch: -------------------------------------------------------------------------------- 1 | # key: switch 2 | # name : switch (...) { ... } 3 | # -- 4 | switch (${1:int-or-char}) {$> 5 | case ${2:value}: {$> 6 | $0$> 7 | break;$> 8 | }$> 9 | 10 | default:$> 11 | break;$> 12 | }$> -------------------------------------------------------------------------------- /auto-insert/insert-home.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file (>>FILE<<) 3 | * @author Alex Ott 4 | * 5 | * @brief 6 | * 7 | * 8 | */ 9 | 10 | #ifndef ### 11 | #define ### 12 | 13 | #endif /* ### */ 14 | -------------------------------------------------------------------------------- /snippets/c++-mode/btest.test-suite2: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # key: tsuite 3 | # name: test suite with fixture 4 | # -- 5 | BOOST_FIXTURE_TEST_SUITE(${1:name}, ${2:fixture}) 6 | 7 | $0 8 | 9 | BOOST_AUTO_TEST_SUITE_END() 10 | -------------------------------------------------------------------------------- /snippets/cc-mode/once: -------------------------------------------------------------------------------- 1 | # key: once 2 | # name: #ifndef XXX; #define XXX; #endif 3 | # -- 4 | #ifndef ${1:_`(upcase (file-name-nondirectory (file-name-sans-extension (buffer-file-name))))`_H_} 5 | #define $1 6 | 7 | $0 8 | 9 | #endif /* $1 */ -------------------------------------------------------------------------------- /snippets/js-mode/req.html: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # key: req 3 | #name : html 4 | # -- 5 | new Request.HTML({ 6 | onSuccess: function(responseTree, responseElements, responseHTML, responseJavaScript) { 7 | $0 8 | } 9 | }).${1:get}(${2:url}); -------------------------------------------------------------------------------- /snippets/erlang-mode/mod: -------------------------------------------------------------------------------- 1 | # name: -module(). 2 | # contributor: hitesh 3 | # key: mod 4 | # -- 5 | -module(${1:`(file-name-nondirectory 6 | (file-name-sans-extension (or (buffer-file-name) (buffer-name))))`}). 7 | $0 -------------------------------------------------------------------------------- /snippets/go-mode/for: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: for { ... } 3 | # key: for 4 | # contributor: Alex Lispython (alex@obout.ru) 5 | # expand-env: ((yas/indent-line 'fixed) (yas/wrap-around-region 'nil)) 6 | # -- 7 | for { 8 | $0 9 | } 10 | -------------------------------------------------------------------------------- /snippets/go-mode/case: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: case 3 | # key: case 4 | # contributor: Alex Lispython (alex@obout.ru) 5 | # expand-env: ((yas/indent-line 'fixed) (yas/wrap-around-region 'nil)) 6 | # -- 7 | case ${1:condition}: 8 | $0 9 | 10 | -------------------------------------------------------------------------------- /snippets/go-mode/new: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: i := new(StructName) 3 | # key: new 4 | # contributor : Alexandr Lispython (alex@obout.ru) 5 | # expand-env: ((yas/indent-line 'fixed) (yas/wrap-around-region 'nil)) 6 | # -- 7 | ${1:name} = new(${2:StructName}) 8 | $0 -------------------------------------------------------------------------------- /snippets/go-mode/struct: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: type Name struct { ... } 3 | # key: struct 4 | # contributor : Alexandr Lispython (alex@obout.ru) 5 | # expand-env: ((yas/indent-line 'fixed) (yas/wrap-around-region 'nil)) 6 | # -- 7 | type ${1:name} struct { 8 | $0 9 | } -------------------------------------------------------------------------------- /auto-insert/insert.el: -------------------------------------------------------------------------------- 1 | ;;; (>>FILE<<) --- 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | 11 | 12 | 13 | ;;; (>>FILE<<) ends here 14 | -------------------------------------------------------------------------------- /snippets/go-mode/for3: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: for condition { ... } 3 | # key: for 4 | # contributor: Alex Lispython (alex@obout.ru) 5 | # expand-env: ((yas/indent-line 'fixed) (yas/wrap-around-region 'nil)) 6 | # -- 7 | for ${1:condition} { 8 | $0 9 | } 10 | -------------------------------------------------------------------------------- /auto-insert/insert.erl: -------------------------------------------------------------------------------- 1 | %%% File : (>>FILE<<) 2 | %%% Author : Alex Ott 3 | %%% Created : (>>DATE<<) by Alex Ott 4 | %%% Description : 5 | %%% 6 | 7 | -module((>>FILE_NO_EXT<<)). 8 | %% -export([]). 9 | %% -import(,[]) 10 | %% -compile(export_all). 11 | 12 | -------------------------------------------------------------------------------- /snippets/go-mode/array: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: array := [...]type{values} 3 | # key: arr 4 | # contributor : Alexandr Lispython (alex@obout.ru) 5 | # expand-env: ((yas/indent-line 'fixed) (yas/wrap-around-region 'nil)) 6 | # -- 7 | ${1:name} := [...]${2:type}{${3:values}} 8 | $0 -------------------------------------------------------------------------------- /snippets/go-mode/interface: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: type Name interface { ... } 3 | # key: intf 4 | # contributor : Alexandr Lispython (alex@obout.ru) 5 | # expand-env: ((yas/indent-line 'fixed) (yas/wrap-around-region 'nil)) 6 | # -- 7 | type ${1:name} interface { 8 | $0 9 | } -------------------------------------------------------------------------------- /snippets/go-mode/switch: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: switch 3 | # key: switch 4 | # contributor: Alex Lispython (alex@obout.ru) 5 | # expand-env: ((yas/indent-line 'fixed) (yas/wrap-around-region 'nil)) 6 | # -- 7 | switch $1 { 8 | case ${2:condition}: 9 | $0 10 | } 11 | 12 | -------------------------------------------------------------------------------- /snippets/go-mode/map: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: var name = map[type] type{ ... } 3 | # key: map 4 | # contributor : Alexandr Lispython (alex@obout.ru) 5 | # expand-env: ((yas/indent-line 'fixed) (yas/wrap-around-region 'nil)) 6 | # -- 7 | var ${1:name} = map[${2:string}] ${3:value type}{ 8 | $0 9 | } -------------------------------------------------------------------------------- /snippets/go-mode/for2: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: for init; condition; post { ... } 3 | # key: for 4 | # contributor: Alex Lispython (alex@obout.ru) 5 | # expand-env: ((yas/indent-line 'fixed) (yas/wrap-around-region 'nil)) 6 | # -- 7 | for ${1:init}; ${2:condition}; ${3:post} { 8 | $0 9 | } 10 | -------------------------------------------------------------------------------- /snippets/erlang-mode/func: -------------------------------------------------------------------------------- 1 | #name : func (...) -> ... 2 | # -- 3 | %%-------------------------------------------------------------------- 4 | %% @doc 5 | 6 | %% @spec $1($2) -> 7 | %% @end 8 | %%-------------------------------------------------------------------- 9 | ${1:func_name} (${2:}) -> 10 | $0$> 11 | 12 | -------------------------------------------------------------------------------- /rc/emacs-rc-html.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-html.el --- 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;; (load "~/emacs/nxhtml/autostart.el") 11 | 12 | 13 | 14 | ;;; emacs-rc-html.el ends here 15 | -------------------------------------------------------------------------------- /snippets/go-mode/function: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: func name(param_name Struct) (types) { ... } 3 | # key: func 4 | # contributor : Alexandr Lispython (alex@obout.ru) 5 | # expand-env: ((yas/indent-line 'fixed) (yas/wrap-around-region 'nil)) 6 | # -- 7 | func ${1:name}(${2:params}) ${3:return type} { 8 | `yas/selected-text`$0 9 | } -------------------------------------------------------------------------------- /snippets/go-mode/function2: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: func name(param_name Struct) (types) { ... } 3 | # key: func 4 | # contributor : Alexandr Lispython (alex@obout.ru) 5 | # expand-env: ((yas/indent-line 'fixed) (yas/wrap-around-region 'nil)) 6 | # -- 7 | func ${1:name}(${2:params}) (${3:returns}) { 8 | `yas/selected-text`$0 9 | } -------------------------------------------------------------------------------- /snippets/go-mode/function3: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: func name(param_name Struct) (types) { ... } 3 | # key: func 4 | # contributor : Alexandr Lispython (alex@obout.ru) 5 | # expand-env: ((yas/indent-line 'fixed) (yas/wrap-around-region 'nil)) 6 | # -- 7 | func (${1:self name} *${2:struct name}) ${3:method name}(${4:params}) ${5:return type} { 8 | `yas/selected-text`$0 9 | } -------------------------------------------------------------------------------- /rc/emacs-rc-autocomplete.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-autocomplete.el --- 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | 7 | (require 'auto-complete-config) 8 | (ac-config-default) 9 | (setq-default ac-auto-start nil) 10 | (define-key ac-mode-map [(meta return)] 'auto-complete) 11 | 12 | (add-to-list 'ac-dictionary-directories "~/emacs/ac-dicts") 13 | 14 | -------------------------------------------------------------------------------- /rc/emacs-rc-gdb.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-gdb.el --- gdb/gud settings 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: gdb 7 | ;; Status: not intended to be distributed yet 8 | 9 | (setq gdb-many-windows t) 10 | (setq gdb-show-main t) 11 | (setq gud-chdir-before-run nil) 12 | (setq gud-tooltip-mode t) 13 | 14 | ;;; emacs-rc-gdb.el ends here 15 | -------------------------------------------------------------------------------- /rc/emacs-rc-company-mode.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-company-mode.el --- 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | 11 | (add-to-list 'load-path "~/emacs/company-mode") 12 | (autoload 'company-mode "company" nil t) 13 | 14 | ;;; emacs-rc-company-mode.el ends here 15 | -------------------------------------------------------------------------------- /rc/emacs-rc-gclient.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-gclient.el --- 2 | 3 | ;;(add-to-list 'load-path "~/emacs/g-client") 4 | ;;(load-library "g") 5 | (setq g-user-email "alexott@gmail.com") 6 | (setq g-html-handler 'w3m-buffer) 7 | ;;(load-library "gblogger") 8 | ;;(load-library "greader") 9 | ;;(load-library "gcal") 10 | ;;(load-library "gcontacts") 11 | 12 | 13 | 14 | ;;; emacs-rc-gclient.el ends here 15 | -------------------------------------------------------------------------------- /snippets/go-mode/map_with_select: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: var name = map[select] select{ ... } 3 | # key: map 4 | # contributor : Alexandr Lispython (alex@obout.ru) 5 | # expand-env: ((yas/indent-line 'fixed) (yas/wrap-around-region 'nil)) 6 | # -- 7 | var ${1:name} = map[${2:$$(yas/choose-value '("string" "int" "float"))}] ${3:$$(yas/choose-value '("string" "int" "bool" "float"))}{ 8 | $0 9 | } -------------------------------------------------------------------------------- /rc/emacs-rc-mercurial.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-mercurial.el --- 2 | 3 | ;; Copyright (C) 2007 Alex Ott 4 | ;; 5 | ;; Author: alex_ott@securecomputing.com 6 | ;; Version: $Id: emacs-rc-mercurial.el,v 0.0 2007/06/06 11:53:56 ott Exp $ 7 | ;; Keywords: 8 | ;; Requirements: 9 | ;; Status: not intended to be distributed yet 10 | 11 | (require 'mercurial) 12 | 13 | 14 | ;;; emacs-rc-mercurial.el ends here 15 | -------------------------------------------------------------------------------- /rc/emacs-rc-octave.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-octave.el --- 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | (add-to-list 'auto-mode-alist '("\\.m$" . octave-mode)) 11 | 12 | (defun alexott/octave-mode-hook () 13 | ) 14 | (add-hook 'octave-mode-hook 'alexott/octave-mode-hook) 15 | 16 | ;;; emacs-rc-octave.el ends here 17 | -------------------------------------------------------------------------------- /auto-insert/insert-work.cpp: -------------------------------------------------------------------------------- 1 | /* -*- mode: c++; tab-width: 4; c-basic-offset:4; indent-tabs-mode: t -*- */ 2 | /* @doc 3 | * @module <(>>FILE<<)> | 4 | * 5 | * $Revision$ 6 | * $Author$ 7 | * $Date$ 8 | * 9 | * All rights reserved. No part hereof may be used or reproduced in any form 10 | * without written permission by the owner. Any violation is a punishable crime. 11 | * 12 | */ 13 | 14 | #include "HHHH" 15 | 16 | -------------------------------------------------------------------------------- /rc/emacs-rc-ruby.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-ruby.el --- 2 | ;; Copyright (C) 2007 Alex Ott 3 | 4 | (add-to-list 'load-path "~/emacs/emacs-rails") 5 | 6 | (defun try-complete-abbrev (old) 7 | (if (expand-abbrev) t nil)) 8 | 9 | (setq hippie-expand-try-functions-list 10 | '(try-complete-abbrev 11 | try-complete-file-name 12 | try-expand-dabbrev)) 13 | 14 | (require 'rails) 15 | 16 | ;; (turn-on-eldoc-mode) 17 | 18 | ;;; emacs-rc-ruby.el ends here 19 | -------------------------------------------------------------------------------- /rc/emacs-rc-epg.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-epg.el --- 2 | 3 | ;; Copyright (C) 2007 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Version: $Id: emacs-rc-epg.el,v 0.0 2007/09/10 13:04:59 ott Exp $ 7 | ;; Keywords: 8 | ;; Requirements: 9 | ;; Status: not intended to be distributed yet 10 | 11 | (add-to-list 'load-path "~/emacs/epg") 12 | (require 'epa-setup) 13 | (setq epa-file-cache-passphrase-for-symmetric-encryption nil) 14 | 15 | ;;; emacs-rc-epg.el ends here 16 | 17 | -------------------------------------------------------------------------------- /auto-insert/insert-work.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c++; tab-width: 4; c-basic-offset:4; indent-tabs-mode: t -*- */ 2 | /* @doc 3 | * @module <(>>FILE<<)> | 4 | * 5 | * $Revision$ 6 | * $Author$ 7 | * $Date$ 8 | * 9 | * All rights reserved. No part hereof may be used or reproduced in any form 10 | * without written permission by the owner. Any violation is a punishable crime. 11 | * 12 | */ 13 | 14 | #ifndef ### 15 | #define ### 16 | 17 | #endif /* ### */ 18 | -------------------------------------------------------------------------------- /rc/emacs-rc-dvc.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-dvc.el --- 2 | 3 | ;; Copyright (C) 2007 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;;(add-to-list 'load-path "~/emacs/dvc/") 11 | ;;(require 'dvc-autoloads) 12 | 13 | (custom-set-variables 14 | '(dvc-prompt-active-dvc nil) 15 | '(dvc-select-priority '(xgit xhg bzr baz)) 16 | '(dvc-tips-enabled nil) 17 | ) 18 | 19 | ;;; emacs-rc-dvc.el ends here 20 | -------------------------------------------------------------------------------- /rc/emacs-rc-remember.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-remember.el --- 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;;(add-to-list 'load-path "~/emacs/planner") 11 | ;;(add-to-list 'load-path "~/emacs/remember") 12 | 13 | ;;(autoload 'remember "remember" nil t) 14 | ;;(autoload 'remember-region "remember" nil t) 15 | 16 | 17 | 18 | ;;; emacs-rc-remember.el ends here 19 | -------------------------------------------------------------------------------- /rc/emacs-rc-w3.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-w3.el --- 2 | 3 | ;; Copyright (C) 2003 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | (condition-case () (require 'w3-auto "w3-auto") (error nil)) 11 | ;; (setq url-proxy-services 12 | ;; '(("http" . "192.168.10.98:8080") 13 | ;; ("ftp" . "192.168.10.98:8080") 14 | ;; ("no_proxy" . "^.*jet\.msk\.su"))) 15 | 16 | ;;; emacs-rc-w3.el ends here 17 | -------------------------------------------------------------------------------- /rc/emacs-rc-ecb.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-ecb.el --- 2 | 3 | ;; Copyright (C) 2003 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;; Emacs code browser 11 | (add-to-list 'load-path "~/projects/ecb") 12 | ;;(require 'cl) 13 | ;;(require 'ecb) 14 | 15 | (setq ecb-version-check nil) ; to prevent ecb failing to start up 16 | (setq-default ecb-tip-of-the-day nil) 17 | 18 | 19 | ;;; emacs-rc-ecb.el ends here 20 | -------------------------------------------------------------------------------- /rc/emacs-rc-info.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-info.el --- 2 | 3 | ;; Copyright (C) 2003 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | (require 'info) 11 | (add-to-list 'Info-directory-list "~/emacs/info") 12 | (add-to-list 'Info-directory-list "/usr/share/info") 13 | 14 | (when (equal system-type 'darwin) 15 | (add-to-list 'Info-directory-list "/opt/local/share/info")) 16 | 17 | ;;; emacs-rc-info.el ends here 18 | -------------------------------------------------------------------------------- /rc/emacs-rc-gnuplot.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-gnuplot.el --- 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | (add-to-list 'load-path "~/emacs/gnuplot") 11 | (autoload 'gnuplot-mode "gnuplot" "gnuplot major mode" t) 12 | (autoload 'gnuplot-make-buffer "gnuplot" "open a buffer in gnuplot mode" t) 13 | 14 | (add-to-list 'auto-mode-alist '("\\.gp$" . gnuplot-mode)) 15 | 16 | ;;; emacs-rc-gnuplot.el ends here 17 | -------------------------------------------------------------------------------- /rc/emacs-rc-css.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-css.el --- 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;; TODO: add css-rainbow mode 11 | 12 | (defun alexott/css-mode-hook () 13 | (rainbow-mode t) 14 | (set (make-local-variable 'ac-auto-start) 2) 15 | (set (make-local-variable 'ac-auto-show-menu) t) 16 | ) 17 | 18 | (add-hook 'css-mode-hook 'alexott/css-mode-hook) 19 | 20 | ;;; emacs-rc-css.el ends here 21 | -------------------------------------------------------------------------------- /rc/emacs-rc-vcs-misc.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-vcs-misc.el --- 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;; PSVN customization 11 | (custom-set-variables 12 | '(svn-status-svn-environment-var-list (quote ("LC_MESSAGES=C" "LANG=C" "LC_ALL=C")))) 13 | (autoload 'svn-status "psvn" nil t) 14 | 15 | ;;(setq vc-handled-backends nil) 16 | 17 | (setq vc-follow-symlinks t) 18 | 19 | ;;; emacs-rc-vcs-misc.el ends here 20 | -------------------------------------------------------------------------------- /rc/emacs-rc-twitter.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-twitter.el --- 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;; twitter 11 | (autoload 'twitter-get-friends-timeline "twitter" nil t) 12 | (autoload 'twitter-status-edit "twitter" nil t) 13 | (global-set-key "\C-xt" 'twitter-get-friends-timeline) 14 | ;; (add-hook 'twitter-status-edit-mode-hook 'longlines-mode) 15 | (setq twitter-include-replies t) 16 | 17 | 18 | ;;; emacs-rc-twitter.el ends here 19 | -------------------------------------------------------------------------------- /rc/emacs-rc-lj.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-lj.el --- 2 | 3 | ;; Copyright (C) 2003 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | (add-to-list 'load-path "~/emacs/ljupdate/") 11 | (require 'ljupdate) 12 | 13 | (add-hook 'lj-compose-common-hook 14 | (lambda () 15 | (auto-fill-mode nil) 16 | )) 17 | 18 | 19 | (custom-set-variables 20 | '(lj-cache-login-information t) 21 | '(lj-default-username "alexott") 22 | ) 23 | 24 | ;;; emacs-rc-lj.el ends here 25 | -------------------------------------------------------------------------------- /snippets/clojure-mode/ns: -------------------------------------------------------------------------------- 1 | # key: ns 2 | # name: (ns ns-name ...) 3 | # -- 4 | (ns `(let* ((nsname '()) 5 | (dirs (split-string (buffer-file-name) "/")) 6 | (aftersrc nil)) 7 | (dolist (dir dirs) 8 | (if aftersrc 9 | (progn 10 | (setq nsname (cons dir nsname)) 11 | (setq nsname (cons "." nsname))) 12 | (when (or (string= dir "src") (string= dir "test")) 13 | (setq aftersrc t)))) 14 | (when nsname 15 | (replace-regexp-in-string "_" "-" (substring (apply 'concat (reverse nsname)) 0 -5))))` 16 | $1 17 | ) -------------------------------------------------------------------------------- /rc/emacs-rc-jdee.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-jdee.el --- 2 | 3 | ;; Copyright (C) 2003 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;; For JDE 11 | (add-to-list 'load-path "/home/ott/emacs/jde/lisp") 12 | (require 'jde) 13 | (add-to-list 'load-path "/home/ott/emacs/jde-docindex/lisp") 14 | ;(require 'jde-docindex) 15 | 16 | (require 'generic-x) 17 | (add-to-list 'auto-mode-alist 18 | '("\\.properties$" . java-properties-generic-mode)) 19 | 20 | ;;; emacs-rc-jdee.el ends here 21 | -------------------------------------------------------------------------------- /rc/emacs-rc-prolog.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-prolog.el --- 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | (autoload 'run-prolog "prolog" "Start a Prolog sub-process." t) 11 | (autoload 'prolog-mode "prolog" "Major mode for editing Prolog programs." t) 12 | (autoload 'mercury-mode "prolog" "Major mode for editing Mercury programs." t) 13 | (setq prolog-system 'swi) 14 | 15 | (add-to-list 'auto-mode-alist '("\\.plg$" . prolog-mode)) 16 | 17 | ;; (turn-on-eldoc-mode) 18 | 19 | ;;; emacs-rc-prolog.el ends here 20 | -------------------------------------------------------------------------------- /rc/emacs-rc-scala.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-scala.el --- 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | 11 | (defun alexott/scala-mode-hook () 12 | (setq indent-tabs-mode nil) 13 | (local-set-key [return] 'newline-and-indent) 14 | ) 15 | (add-hook 'scala-mode-hook 'alexott/scala-mode-hook) 16 | ;; (add-hook 'scala-mode-hook 'ensime-scala-mode-hook) 17 | 18 | ;; TODO: add setting of 19 | ;; https://github.com/aemoncannon/ensime 20 | ;; https://github.com/RayRacine/scallap 21 | 22 | ;;; emacs-rc-scala.el ends here 23 | -------------------------------------------------------------------------------- /rc/emacs-rc-mailcrypt.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-mailcrypt.el --- Settings for mailcrypt 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | 11 | (add-to-list 'load-path "~/emacs/mailcrypt") 12 | (require 'mailcrypt) 13 | (mc-setversion "gpg") 14 | (add-hook 'gnus-summary-mode-hook 'mc-install-read-mode) 15 | (add-hook 'message-mode-hook 'mc-install-write-mode) 16 | (add-hook 'news-reply-mode-hook 'mc-install-write-mode) 17 | (setq mc-gpg-user-id "Alex Ott ") 18 | 19 | 20 | 21 | ;;; emacs-rc-mailcrypt.el ends here 22 | -------------------------------------------------------------------------------- /rc/emacs-rc-cmake.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-cmake.el --- 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;; support for CMake 11 | (autoload 'cmake-mode "cmake-mode" t) 12 | (add-to-list 'auto-mode-alist '("CMakeLists\\.txt\\'" . cmake-mode)) 13 | (add-to-list 'auto-mode-alist '("\\.cmake\\'" . cmake-mode)) 14 | 15 | (defun alexott/cmake-mode-hook () 16 | (setq tab-width 4) 17 | (setq indent-tabs-mode t) 18 | (local-set-key [return] 'newline-and-indent) 19 | ) 20 | (add-hook 'cmake-mode-hook 'alexott/cmake-mode-hook) 21 | 22 | ;;; emacs-rc-cmake.el ends here 23 | -------------------------------------------------------------------------------- /rc/emacs-rc-distel.el: -------------------------------------------------------------------------------- 1 | (require 'distel) 2 | (distel-setup) 3 | 4 | ;; A number of the erlang-extended-mode key bindings are useful in the shell too 5 | (defconst distel-shell-keys 6 | '(("\C-\M-i" erl-complete) 7 | ("\M-?" erl-complete) 8 | ("\M-." erl-find-source-under-point) 9 | ("\M-," erl-find-source-unwind) 10 | ("\M-*" erl-find-source-unwind) 11 | ) 12 | "Additional keys to bind when in Erlang shell.") 13 | 14 | (add-hook 'erlang-shell-mode-hook 15 | (lambda () 16 | ;; add some Distel bindings to the Erlang shell 17 | (dolist (spec distel-shell-keys) 18 | (define-key erlang-shell-mode-map (car spec) (cadr spec))))) 19 | -------------------------------------------------------------------------------- /rc/emacs-rc-lisp.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-lisp.el --- 2 | 3 | ;; Copyright (C) 2004 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | (defun alexott/lisp-mode-hook () 11 | (setq indent-tabs-mode t) 12 | (abbrev-mode 1) 13 | (auto-fill-mode 1) 14 | (turn-on-eldoc-mode) 15 | ;; (paredit-mode 1) 16 | (local-set-key [return] 'newline-and-indent) 17 | ) 18 | (add-hook 'lisp-mode-hook 'alexott/lisp-mode-hook) 19 | 20 | (defun alexott/lisp-interact-mode-hook () 21 | ;; (paredit-mode 1) 22 | ) 23 | (add-hook 'lisp-interaction-mode-hook 'alexott/lisp-interact-mode-hook) 24 | 25 | 26 | ;;; emacs-rc-slime.el ends here 27 | -------------------------------------------------------------------------------- /rc/emacs-rc-tramp.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-tramp.el --- 2 | 3 | ;; Copyright (C) 2003 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | (require 'tramp) 11 | 12 | (setq tramp-default-method "ssh") 13 | (add-to-list 'tramp-default-method-alist 14 | '("\\`localhost\\'" "\\`root\\'" "su")) 15 | (add-to-list 'tramp-default-method-alist '("" "ott" "ssh")) 16 | (add-to-list 'tramp-default-method-alist '("" "root" "ssh")) 17 | 18 | 19 | (tramp-set-completion-function "ssh" 20 | '((tramp-parse-sconfig "/etc/ssh_config") 21 | (tramp-parse-sconfig "~/.ssh/config"))) 22 | 23 | ;;; emacs-rc-tramp.el ends here 24 | -------------------------------------------------------------------------------- /rc/emacs-rc-doxygen.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-doxygen.el --- 2 | 3 | ;; Copyright (C) 2003 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;; (require 'doc-mode) 11 | ;; (add-hook 'c-mode-common-hook 'doc-mode) 12 | 13 | (require 'tempo) 14 | (require 'doxymacs) 15 | (add-hook 'c-mode-common-hook 'doxymacs-mode) 16 | 17 | (defun my-doxymacs-font-lock-hook () 18 | (if (or (eq major-mode 'c-mode) 19 | (eq major-mode 'c++-mode)) 20 | (doxymacs-font-lock))) 21 | (add-hook 'font-lock-mode-hook 'my-doxymacs-font-lock-hook) 22 | 23 | (setq-default doxymacs-doxygen-style "JavaDoc") 24 | 25 | ;;; emacs-rc-doxygen.el ends here 26 | -------------------------------------------------------------------------------- /rc/emacs-rc-ess.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-ess.el --- 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;; R doc 11 | (add-to-list 'auto-mode-alist '("\\.r\\'" . ess-mode)) 12 | 13 | (defun alexott/ess-mode-hook () 14 | (local-set-key [(control return)] 'ess-eval-line-and-step) 15 | (font-lock-mode 1) 16 | ) 17 | (add-hook 'ess-mode-hook 'alexott/ess-mode-hook) 18 | 19 | ;; Rd-mode... 20 | (add-to-list 'auto-mode-alist '("\\.rd\\'" . Rd-mode)) 21 | (defun alexott/rd-mode-hook () 22 | (abbrev-mode 1) 23 | (font-lock-mode 1) 24 | ) 25 | (add-hook 'Rd-mode-hook 'alexott/rd-mode-hook) 26 | 27 | ;;; emacs-rc-ess.el ends here 28 | -------------------------------------------------------------------------------- /rc/emacs-rc-git.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-git.el --- 2 | 3 | ;; magit 4 | ;(add-to-list 'load-path "~/projects/magit") 5 | (require 'magit) 6 | (require 'magit-svn) 7 | (global-set-key "\C-cm" 'magit-status) 8 | (custom-set-variables 9 | '(magit-save-some-buffers (quote dontask))) 10 | 11 | (add-hook 'magit-mode-hook 'turn-on-magit-svn) 12 | 13 | (setq magit-process-connection-type nil) 14 | (setq magit-emacsclient-executable nil) 15 | (setq magit-stage-all-confirm nil) 16 | (setq magit-unstage-all-confirm nil) 17 | (setq magit-restore-window-configuration t) 18 | 19 | (define-key magit-mode-map "q" 'bury-buffer) 20 | 21 | (custom-set-faces 22 | '(magit-item-highlight ((t (:background "CadetBlue1")))) 23 | ) 24 | 25 | 26 | 27 | ;;; emacs-rc-git.el ends here 28 | -------------------------------------------------------------------------------- /rc/emacs-rc-yasnippet.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-yasnippet.el --- 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | 7 | (require 'yasnippet) 8 | (setq yas/snippet-dirs (append '("~/emacs/snippets/") yas/snippet-dirs)) 9 | (yas/global-mode 1) 10 | ;;(yas/reload-all) 11 | 12 | (add-to-list 'auto-mode-alist '("/snippets/" . snippet-mode)) 13 | 14 | ;; hook for automatic reloading of changed snippets 15 | ;; TODO: do we really need it still? 16 | (defun alexott/update-yasnippets-on-save () 17 | (when (string-match "/snippets/" buffer-file-name) 18 | ;; (yas/load-snippet-dirs) 19 | (yas/reload-all) 20 | )) 21 | ;(add-hook 'after-save-hook 'alexott/update-yasnippets-on-save) 22 | 23 | 24 | ;;; emacs-rc-yasnippet.el ends here 25 | -------------------------------------------------------------------------------- /rc/emacs-rc-mule.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-mule.el --- 2 | 3 | ;; Copyright (C) 2005 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;; (set-language-environment 'Cyrillic-KOI8) 11 | ;; (set-selection-coding-system 'cyrillic-koi8) 12 | 13 | (custom-set-variables 14 | '(current-language-environment "UTF-8") 15 | '(default-input-method "russian-computer") 16 | '(x-select-enable-clipboard t) 17 | ;; '(interprogram-paste-function (quote x-clipboard-yank)) 18 | ) 19 | 20 | (set-input-method "russian-computer" nil) 21 | 22 | (define-coding-system-alias 'koi8-ru 'koi8-u) 23 | (define-coding-system-alias 'koi8-r 'koi8-u) 24 | 25 | (define-coding-system-alias 'UTF-8 'utf-8) 26 | 27 | 28 | 29 | ;;; emacs-rc-mule.el ends here 30 | -------------------------------------------------------------------------------- /rc/emacs-rc-javascript.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-javascript.el --- 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;;(load-library "js2-mode") 11 | (autoload 'js2-mode "js2-mode" nil t) 12 | (setq js2-use-font-lock-faces t) 13 | (setq js2-indent-on-enter-key t) 14 | (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode)) 15 | 16 | (setq js2-basic-offset 2) 17 | (setq js2-use-font-lock-faces t) 18 | 19 | (defun alexott/js2-mode-hook () 20 | (local-set-key [return] 'newline-and-indent) 21 | (set (make-local-variable 'ac-auto-start) 3) 22 | (set (make-local-variable 'ac-auto-show-menu) t) 23 | ) 24 | (add-hook 'js2-mode-hook 'alexott/js2-mode-hook) 25 | 26 | ;;; emacs-rc-javascript.el ends here 27 | -------------------------------------------------------------------------------- /rc/emacs-rc-go.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-go.el --- 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | (when (file-exists-p "~/exp/go/src/github.com/nsf/gocode/emacs/") 11 | (load "~/exp/go/src/github.com/nsf/gocode/emacs/go-autocomplete.el")) 12 | 13 | (defun alexott/go-mode-hook () 14 | (setq tab-width 4) 15 | (setq indent-tabs-mode t) 16 | ;; minor modes 17 | (auto-fill-mode 0) 18 | ;; local keys 19 | (local-set-key [return] 'newline-and-indent) 20 | 21 | ;; autocomplete 22 | (set (make-local-variable 'ac-auto-start) 3) 23 | (set (make-local-variable 'ac-auto-show-menu) 0.5) 24 | 25 | ) 26 | (add-hook 'go-mode-hook 'alexott/go-mode-hook) 27 | 28 | 29 | ;;; emacs-rc-go.el ends here 30 | -------------------------------------------------------------------------------- /rc/emacs-rc-perl.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-perl.el --- 2 | 3 | ;; Copyright (C) 2003 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;(require 'cperl-mode) 11 | (autoload 'perl-mode "cperl-mode" "alternate mode for editing Perl progs" t) 12 | ;; (setq cperl-hairy t) 13 | (defun alexott/perl-mode-hook () 14 | ;; (setq tab-width 2) 15 | (local-set-key [return] 'newline-and-indent) 16 | (setq indent-tabs-mode nil) 17 | (line-number-mode 1) 18 | (column-number-mode 1) 19 | (abbrev-mode 1) 20 | (turn-on-eldoc-mode) 21 | (cperl-mode) 22 | (setq compile-command (concat "perl -cw " buffer-file-name)) 23 | ) 24 | (add-hook 'perl-mode-hook 'alexott/perl-mode-hook) 25 | 26 | (setq cperl-auto-newline-after-colon t) 27 | (setq cperl-autoindent-on-semi t) 28 | (setq cperl-extra-newline-before-brace nil) 29 | (setq cperl-indent-parens-as-block t) 30 | 31 | ;;; emacs-rc-perl.el ends here 32 | -------------------------------------------------------------------------------- /rc/emacs-rc-sdcv.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-sdcv.el --- 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;; (require 'sdcv-mode) 11 | ;; (global-set-key (kbd "C-c s") 'sdcv-search) 12 | 13 | (defun kid-star-dict () 14 | (interactive) 15 | (let ((begin (point-min)) 16 | (end (point-max))) 17 | (if mark-active 18 | (setq begin (region-beginning) 19 | end (region-end)) 20 | (save-excursion 21 | (backward-word) 22 | (mark-word) 23 | (setq begin (region-beginning) 24 | end (region-end)))) 25 | (message "searching for %s ..." (buffer-substring begin end)) 26 | (tooltip-show (shell-command-to-string 27 | (concat "sdcv -n --utf8-output --utf8-input " 28 | (buffer-substring begin end)))))) 29 | (global-set-key (kbd "C-c s") 'kid-star-dict) 30 | 31 | ;;; emacs-rc-sdcv.el ends here 32 | -------------------------------------------------------------------------------- /rc/emacs-rc-ispell.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-ispell.el --- 2 | 3 | ;; Copyright (C) 2003 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;;(require 'ispell) 11 | (set-default 'ispell-skip-html t) 12 | 13 | (setq ispell-local-dictionary "english") 14 | ;(setq ispell-skip-html t) 15 | 16 | (defun turn-on-flyspell () 17 | "Force flyspell-mode on using a positive arg. For use in hooks." 18 | (interactive) 19 | (flyspell-mode 1)) 20 | 21 | (autoload 'flyspell-mode "flyspell" "On-the-fly spelling checker." t) 22 | (add-hook 'message-mode-hook 'turn-on-flyspell) 23 | (add-hook 'text-mode-hook 'turn-on-flyspell) 24 | (add-hook 'nxml-mode-hook 'turn-on-flyspell) 25 | (add-hook 'texinfo-mode-hook 'turn-on-flyspell) 26 | (add-hook 'TeX-mode-hook 'turn-on-flyspell) 27 | 28 | (add-hook 'c-mode-common-hook 'flyspell-prog-mode) 29 | (add-hook 'lisp-mode-hook 'flyspell-prog-mode) 30 | (add-hook 'emacs-lisp-mode-hook 'flyspell-prog-mode) 31 | 32 | ;;; emacs-rc-ispell.el ends here 33 | -------------------------------------------------------------------------------- /rc/emacs-rc-emms.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-emms.el --- 2 | 3 | ;; Copyright (C) 2004 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | (add-to-list 'load-path "/jet/ott/reps/anon/emacs-stuff/emms") 11 | (require 'emms) 12 | 13 | (require 'emms-default) 14 | (require 'later-do) 15 | (emms-setup 'advanced "/net/smap1/mmedia/Music/") 16 | (require 'emms-pbi) 17 | (require 'emms-pbi-mark) 18 | 19 | ;;(add-hook 'emms-player-started-hook 'emms-show) 20 | ;;(remove-hook 'emms-player-started-hook 'emms-show) 21 | (setq emms-show-format "emms now playing: %s") 22 | 23 | (setq emms-source-file-default-directory "/net/smap1/mmedia/Music/") 24 | (setq emms-player-mpg321-parameters '("-o" "alsa")) 25 | 26 | (global-set-key "\C-cew" 'emms-show) 27 | (global-set-key "\C-cen" 'emms-next) 28 | (global-set-key "\C-cep" 'emms-previous) 29 | (global-set-key "\C-ces" 'emms-stop) 30 | (global-set-key "\C-cer" 'emms-start) 31 | (global-set-key "\C-cel" 'emms-pbi) 32 | 33 | ;;; emacs-rc-emms.el ends here 34 | -------------------------------------------------------------------------------- /rc/emacs-rc-decor.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-decor.el --- 2 | 3 | ;; Copyright (C) 2003 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | (require 'tree-widget) 11 | 12 | (load-library "time") 13 | (setq display-time-24hr-format t 14 | display-time-mail-file t 15 | display-time-form-list (list 'time 'load) 16 | display-time-day-and-date t) 17 | (display-time) 18 | (blink-cursor-mode t) 19 | 20 | ;; 21 | (require 'mwheel) 22 | (mwheel-install) 23 | 24 | ;; use y/n instead of yes/no 25 | (fset 'yes-or-no-p 'y-or-n-p) 26 | 27 | ;; set misc decoration variables 28 | (custom-set-variables 29 | '(global-font-lock-mode t) 30 | '(scalable-fonts-allowed t) 31 | '(uniquify-buffer-name-style (quote forward)) 32 | '(use-dialog-box nil) 33 | '(column-number-mode t) 34 | '(display-time-mode t) 35 | '(show-paren-mode t) 36 | '(tool-bar-mode nil) 37 | '(custom-buffer-done-kill t) 38 | '(initial-scratch-message nil) 39 | '(transient-mark-mode t)) 40 | 41 | ;;; emacs-rc-decor.el ends here 42 | -------------------------------------------------------------------------------- /rc/emacs-rc-python.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-python.el --- 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | (defun electric-pair () 11 | "Insert character pair without sournding spaces" 12 | (interactive) 13 | (let (parens-require-spaces) 14 | (insert-pair))) 15 | 16 | (defun alexott/python-mode-hook () 17 | ;; (setq tab-width 2) 18 | (local-set-key [return] 'newline-and-indent) 19 | (setq indent-tabs-mode t) 20 | (auto-fill-mode 1) 21 | (turn-on-eldoc-mode) 22 | 23 | (define-key python-mode-map "\"" 'electric-pair) 24 | (define-key python-mode-map "\'" 'electric-pair) 25 | (define-key python-mode-map "(" 'electric-pair) 26 | (define-key python-mode-map "[" 'electric-pair) 27 | (define-key python-mode-map "{" 'electric-pair) 28 | ) 29 | (add-hook 'python-mode-hook 'alexott/python-mode-hook) 30 | 31 | (add-hook 'python-mode-hook 'flyspell-prog-mode) 32 | 33 | (custom-set-variables 34 | '(python-remove-cwd-from-path nil) 35 | ) 36 | 37 | 38 | ;;; emacs-rc-python.el ends here 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.orig 2 | *.rej 3 | *~ 4 | .svn 5 | *.elc 6 | .git 7 | .bzr 8 | semantic.cache 9 | CVS 10 | \{arch\} 11 | .arch-ids 12 | TEMPLATE.cc.tpl 13 | TEMPLATE.cpp.tpl 14 | TEMPLATE.c++.tpl 15 | TEMPLATE.cxx.tpl 16 | TEMPLATE.hpp.tpl 17 | TEMPLATE.h++.tpl 18 | emacs/info/dir.old 19 | emacs/ecb/html-help/ 20 | emacs/ecb/info-help/ 21 | emacs/slime/doc/contributors.texi 22 | emacs/cedet/*/*-compile-script 23 | emacs/cedet/*/*-make-script 24 | emacs/cedet/*/*.info 25 | *.log 26 | *-compile-script 27 | *-make-script 28 | emacs/cedet/semantic/doc/*.info 29 | /emacs/cedet/*/*-loaddefs.el 30 | /emacs/g-client/g-cus-load.el 31 | /emacs/g-client/g-loaddefs.el 32 | GPATH 33 | GRTAGS 34 | GSYMS 35 | GTAGS 36 | 37 | /emacs/cedet/test-p.el 38 | /emacs/nxhtml/etc/schema/xhtml-loader.rnc 39 | /rc/emacs-rc-local-alexott.el 40 | /rc/emacs-rc-local-Alex-Otts-iMac.el 41 | /rc/emacs-rc-local-aott.el 42 | /rc/emacs-rc-local-flash2.el 43 | /snippets/c++-mode/wwdbg.always 44 | /snippets/c++-mode/wwdbg.detail 45 | /snippets/c++-mode/wwdbg.max_detail 46 | /snippets/c++-mode/wwdbg.normal 47 | /rc/emacs-rc-local-colibri.el 48 | /rc/emacs-rc-local-mwg-e6500.el 49 | /rc/emacs-rc-local-mercury.el 50 | -------------------------------------------------------------------------------- /rc/emacs-rc-timeclock.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-timeclock.el --- 2 | 3 | ;; Copyright (C) 2003 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | (require 'timeclock) 11 | (global-set-key "\C-ccst" 'timeclock-in) 12 | (global-set-key "\C-cce" 'timeclock-out) 13 | (global-set-key "\C-ccr" 'timeclock-reread-log) 14 | (global-set-key "\C-ccu" 'timeclock-update-string) 15 | ;;(global-set-key "\C-ct" 'timeclock-when-to-leave) 16 | 17 | (defvar timeclock-string nil) 18 | 19 | (nconc global-mode-string '(timeclock-string)) 20 | 21 | (defun timeclock-update-string () 22 | (interactive) 23 | (let* ((remainder (timeclock-workday-remaining t)) 24 | (last-in (equal (car timeclock-last-event) "i"))) 25 | (setq timeclock-string 26 | (format " %c%s%c" 27 | (if last-in ?< ?[) 28 | remainder 29 | (if last-in ?> ?]))))) 30 | 31 | ;;(run-at-time nil 60 'timeclock-update-string) 32 | 33 | (add-hook 'timeclock-event-hook 'timeclock-update-string) 34 | (add-hook 'timeclock-in-hook 'timeclock-reread-log) 35 | (add-hook 'timeclock-out-hook 'timeclock-reread-log) 36 | 37 | ;;; emacs-rc-timeclock.el ends here 38 | -------------------------------------------------------------------------------- /rc/emacs-rc-server.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-server.el --- working with server/client 2 | 3 | ;; Copyright (C) 2003 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | (unless (string-equal "root" (getenv "USER")) 11 | ;; Only start server mode if I'm not root 12 | (require 'server) 13 | (server-start)) 14 | 15 | (setq oldframe (selected-frame)) 16 | (defun alexott/client-start-hook () 17 | (let* ( 18 | (wd (- (frame-parameter nil 'width) 10)) 19 | (hg (- (frame-parameter nil 'height) 5)) 20 | (fn (frame-parameter nil 'font)) 21 | (newframe (make-frame 22 | `((width . ,wd) 23 | (height . ,hg) 24 | (font . ,fn))))) 25 | ; (setq oldframe (selected-frame)) 26 | (select-frame newframe) 27 | (setq server-window newframe)) 28 | ) 29 | 30 | (defun alexott/client-done-hook () 31 | (delete-frame (selected-frame)) 32 | (select-frame oldframe) 33 | (setq server-window oldframe) 34 | ) 35 | 36 | (custom-set-variables 37 | '(server-done-hook (quote (delete-frame))) 38 | '(server-window (quote switch-to-buffer-other-frame)) 39 | ) 40 | ;;; emacs-rc-server.el ends here 41 | -------------------------------------------------------------------------------- /rc/emacs-rc-elisp.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-elisp.el --- Settings for Emacs Lisp editing 2 | 3 | ;; Copyright (C) 2004 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | (defun alexott/elisp-mode-hook () 11 | (setq indent-tabs-mode t) 12 | (abbrev-mode 1) 13 | (auto-fill-mode 1) 14 | (turn-on-eldoc-mode) 15 | 16 | (paredit-mode 1) 17 | 18 | (local-set-key [return] 'newline-and-indent) 19 | 20 | (local-set-key "\C-cf" 'find-function) 21 | (local-set-key "\C-c4f" 'find-function-other-window) 22 | (local-set-key "\C-c5f" 'find-function-other-frame) 23 | (local-set-key "\C-ck" 'find-function-on-key) 24 | 25 | ;; (add-to-list 'ac-sources 'ac-source-emacs-lisp-features) 26 | (set (make-local-variable 'ac-auto-start) 3) 27 | (set (make-local-variable 'ac-auto-show-menu) 0.5) 28 | ) 29 | (add-hook 'emacs-lisp-mode-hook 'alexott/elisp-mode-hook) 30 | (add-hook 'emacs-lisp-mode-hook 'alexott/common-prog-hook) 31 | (add-hook 'emacs-lisp-mode-hook 'alexott/common-hook) 32 | 33 | ;; 34 | (add-to-list 'auto-mode-alist '("\\.gnus$" . emacs-lisp-mode)) 35 | (add-to-list 'auto-mode-alist '("\\.emacs$" . emacs-lisp-mode)) 36 | 37 | 38 | ;;; emacs-rc-elisp.el ends here 39 | -------------------------------------------------------------------------------- /rc/emacs-rc-bbdb.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-bbdb.el --- 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;; Using BBDB 11 | ;;(add-to-list 'load-path "~/emacs/bbdb") 12 | ;;(require 'bbdb) 13 | (bbdb-initialize 'gnus 'message) 14 | 15 | (add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus) 16 | ;(add-hook 'message-setup-hook 'bbdb-define-all-aliases) 17 | 18 | (custom-set-variables 19 | '(bbdb-use-pop-up nil) 20 | '(bbdb-sounds-directory nil) 21 | '(news-reply-header-hook nil) 22 | '(bbdb-offer-save (quote savenoprompt)) 23 | '(bbdb-north-american-phome-numbers-p nil) 24 | '(bbdb-complete-name-allow-cycling t) 25 | '(bbdb-quiet-about-name-mismatches t) 26 | '(bbdb-use-alternate-names nil) 27 | '(bbdb-extract-address-component-ignore-regexp "noreply-comment@blogger\\.com\\|\\(\\(undisclosed\\|unlisted\\)[^,]*recipients\\)\\|no To-header on input")) 28 | 29 | 30 | ;; complete from bbdb 31 | (defun alexott/bbdb-tab-complete () 32 | (interactive) 33 | (if (mail-abbrev-in-expansion-header-p) 34 | (bbdb-complete-name) 35 | (message-tab))) 36 | (define-key message-mode-map [tab] 'alexott/bbdb-tab-complete) 37 | 38 | (add-to-list 'file-coding-system-alist (cons "\\.bbdb" 'utf-8)) 39 | 40 | ;;; emacs-rc-bbdb.el ends here 41 | -------------------------------------------------------------------------------- /rc/emacs-rc-wikis.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-wikis.el --- 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;; moin-moin editing 11 | (require 'moinmoin-mode) 12 | (add-hook 'outline-mode-hook 'turn-on-flyspell) 13 | ;;(defun alexott/outline-mode-hook () 14 | ;; (longlines-mode +1) 15 | ;; ) 16 | ;;(add-hook 'outline-mode-hook 'alexott/outline-mode-hook) 17 | 18 | ;; dokuwiki 19 | (global-unset-key [(control v)]) 20 | (require 'dokuwiki) 21 | (add-to-list 'auto-mode-alist '("\\.doku?$" . simple-dokuwiki-mode)) 22 | (add-hook 'simple-dokuwiki-mode-hook 'turn-on-flyspell) 23 | (custom-set-faces 24 | '(simple-wiki-teletype-face ((((class color) (background light)) (:underline "darkgreen"))))) 25 | 26 | (autoload 'markdown-mode "markdown-mode.el" "Major mode for editing Markdown files" t) 27 | ;;(add-to-list 'auto-mode-alist '("\\.te?xt$" . markdown-mode)) 28 | (add-to-list 'auto-mode-alist '("\\.markdown?$" . markdown-mode)) 29 | (add-to-list 'auto-mode-alist '("\\.md$" . markdown-mode)) 30 | 31 | ;; media wiki 32 | (add-to-list 'auto-mode-alist '("\\.mwiki?$" . simple-mediawiki-mode)) 33 | (add-hook 'simple-mediawiki-mode-hook 'turn-on-flyspell) 34 | (add-hook 'simple-mediawiki-mode-hook 'turn-off-auto-fill) 35 | 36 | ;;; emacs-rc-wikis.el ends here 37 | -------------------------------------------------------------------------------- /rc/emacs-rc-nxml.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-nxml.el --- customisation of nXML-mode 2 | 3 | ;; Copyright (C) 2003 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;; NXML mode 11 | 12 | (defun alexott/nxml-mode-hook () 13 | (local-set-key "\C-c/" 'nxml-finish-element) 14 | (auto-fill-mode -1) 15 | (rng-validate-mode) 16 | (unify-8859-on-decoding-mode) 17 | (setq ispell-skip-html t) 18 | (hs-minor-mode 1) 19 | ) 20 | (add-hook 'nxml-mode-hook 'alexott/nxml-mode-hook) 21 | (add-hook 'nxml-mode-hook 'alexott/common-hook) 22 | 23 | (add-to-list 24 | 'auto-mode-alist 25 | (cons (concat "\\." 26 | (regexp-opt 27 | '("xml" "xsd" "sch" "rng" "xslt" "svg" "rss" "rdf") t) "\\'") 28 | 'nxml-mode)) 29 | (push '("<\\?xml" . nxml-mode) magic-mode-alist) 30 | 31 | ;; (add-to-list 'load-path "~/emacs/docbook-menu") 32 | ;; (require 'docbk-menu) 33 | ;; (add-hook 'nxml-mode-hook 'docbook-menu-mode) 34 | 35 | (custom-set-variables 36 | '(nxml-auto-insert-xml-declaration-flag nil) 37 | '(nxml-attribute-indent 2) 38 | '(nxml-bind-meta-tab-to-complete-flag t) 39 | '(nxml-slash-auto-complete-flag t) 40 | ) 41 | 42 | (add-to-list 'hs-special-modes-alist 43 | '(nxml-mode 44 | "\\|<[^/>]&>\\|<[^/][^>]*[^/]>" 45 | "" 46 | nil)) 47 | 48 | ;;; emacs-nxml.el ends here 49 | -------------------------------------------------------------------------------- /rc/emacs-rc-sh-mode.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-sh-mode.el --- 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;; 11 | 12 | (defun alexott/sh-check-finish-hook (buf msg) 13 | "Function, that is executed at the end of sh check" 14 | (when (not (string-match "finished" msg)) 15 | (next-error 1 t))) 16 | 17 | (define-compilation-mode sh-check-mode "SH" 18 | "Mode for check sh source code." 19 | (set (make-local-variable 'compilation-disable-input) t) 20 | (set (make-local-variable 'compilation-scroll-output) nil) 21 | (set (make-local-variable 'compilation-finish-functions) 22 | (list 'alexott/sh-check-finish-hook)) 23 | ) 24 | 25 | (defun alexott/sh-check-syntax () 26 | "Check syntax of current file" 27 | (interactive) 28 | (when (string-match "^\\(ba\\|z\\)sh" (symbol-name sh-shell)) 29 | (save-some-buffers t) 30 | (compilation-start (concat (symbol-name sh-shell) " -n " (buffer-file-name)) 31 | 'sh-check-mode)) 32 | ) 33 | 34 | ;; sh mode hook 35 | (defun alexott/sh-mode-hook () 36 | (local-set-key "\C-cl" 'alexott/sh-check-syntax) 37 | (local-set-key [return] 'newline-and-indent) 38 | ) 39 | (add-hook 'sh-mode-hook 'alexott/sh-mode-hook) 40 | 41 | (autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t) 42 | (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on) 43 | 44 | ;;; emacs-rc-sh-mode.el ends here 45 | -------------------------------------------------------------------------------- /rc/emacs-rc-w3m.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-w3m.el --- 2 | 3 | ;; Copyright (C) 2003 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;;(add-to-list 'load-path "~/emacs/emacs-w3m") 11 | ;;(autoload 'w3m "w3m" "Interface for w3m on Emacs." t) 12 | (setq w3m-coding-system 'utf-8 13 | w3m-file-coding-system 'utf-8 14 | w3m-file-name-coding-system 'utf-8 15 | w3m-input-coding-system 'utf-8 16 | w3m-output-coding-system 'utf-8 17 | w3m-terminal-coding-system 'utf-8 18 | w3m-use-cookies t 19 | ) 20 | 21 | (add-hook 'w3m-display-hook 22 | (lambda (url) 23 | (rename-buffer 24 | (format "*w3m: %s*" (or w3m-current-title 25 | w3m-current-url)) t))) 26 | 27 | (defun w3m-open-current-page-in-firefox () 28 | "Opens the current URL in Mozilla Firefox." 29 | (interactive) 30 | (browse-url-firefox w3m-current-url)) 31 | 32 | (defun w3m-open-link-or-image-in-firefox () 33 | "Opens the current link or image in Firefox." 34 | (interactive) 35 | (browse-url-firefox (or (w3m-anchor) 36 | (w3m-image)))) 37 | 38 | ;; (eval-after-load 'w3m 39 | ;; (progn 40 | ;; (define-key w3m-mode-map "f" 'w3m-open-current-page-in-firefox) 41 | ;; (define-key w3m-mode-map "F" 'w3m-open-link-or-image-in-firefox))) 42 | 43 | 44 | ;;; emacs-rc-w3m.el ends here 45 | -------------------------------------------------------------------------------- /rc/emacs-rc-dict.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-dict.el --- 2 | 3 | ;; Copyright (C) 2003 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | (add-to-list 'load-path "~/emacs/dict/") 11 | (autoload 'dictionary-search "dictionary" 12 | "Ask for a word and search it in all dictionaries" t) 13 | (autoload 'dictionary-match-words "dictionary" 14 | "Ask for a word and search all matching words in the dictionaries" t) 15 | (autoload 'dictionary-lookup-definition "dictionary" 16 | "Unconditionally lookup the word at point." t) 17 | (autoload 'dictionary "dictionary" 18 | "Create a new dictionary buffer" t) 19 | (autoload 'dictionary-mouse-popup-matching-words "dictionary" 20 | "Display entries matching the word at the cursor" t) 21 | (autoload 'dictionary-popup-matching-words "dictionary" 22 | "Display entries matching the word at the point" t) 23 | (autoload 'dictionary-tooltip-mode "dictionary" 24 | "Display tooltips for the current word" t) 25 | (autoload 'global-dictionary-tooltip-mode "dictionary" 26 | "Enable/disable dictionary-tooltip-mode for all buffers" t) 27 | 28 | ;; Key binding to invoke the dictionary client 29 | (global-set-key "\C-cs" 'dictionary-search) 30 | (global-set-key "\C-cm" 'dictionary-match-words) 31 | ;; Popup menu for GNU Emacs 21, and XEmacs 21 32 | (global-set-key [mouse-3] 'dictionary-mouse-popup-matching-words) 33 | 34 | ;; Tool-tip support for GNU Emacs 21 35 | (setq dictionary-tooltip-dictionary "mueller7") 36 | (global-dictionary-tooltip-mode 0) 37 | 38 | 39 | ;;; emacs-rc-dict.el ends here 40 | -------------------------------------------------------------------------------- /rc/emacs-rc-tex.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-tex.el --- 2 | 3 | ;; Copyright (C) 2003 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | (setenv "TEXINPUTS" 11 | (concat (getenv "TEXINPUTS") 12 | ":/home/ott/tex/styles//:/home/ott/projects/fprog/journal-issues/class//")) 13 | 14 | ;(require 'tex-site) 15 | (setq-default TeX-master nil) 16 | (setq TeX-parse-self t) 17 | (setq TeX-auto-save t) 18 | (setq TeX-default-mode 'latex-mode) 19 | (setq TeX-open-quote "``") 20 | (setq TeX-close-quote "''") 21 | 22 | ;(autoload 'turn-on-bib-cite "bib-cite") 23 | 24 | (defun alexott/TeX-keymap () 25 | (local-set-key [(meta i)] 26 | '(lambda () 27 | (interactive) 28 | (insert "\n\\item ")))) 29 | 30 | (defun alexott/texinfo-hook () 31 | (local-set-key [delete] 'delete-char) 32 | (setq delete-key-deletes-forward t)) 33 | (add-hook 'texinfo-mode-hook 'alexott/texinfo-hook) 34 | 35 | (defun alexott/tex-mode-hook () 36 | (local-set-key "\\" 'TeX-electric-macro) 37 | ; (turn-on-bib-cite) 38 | (alexott/TeX-keymap) 39 | ; (setq bib-cite-use-reftex-view-crossref t) 40 | ) 41 | (add-hook 'TeX-mode-hook 'alexott/tex-mode-hook) 42 | (add-hook 'LaTeX-mode-hook 'TeX-PDF-mode) 43 | 44 | ;; CDLaTeX mode 45 | ;(autoload 'cdlatex-mode "cdlatex" "CDLaTeX Mode" t) 46 | ;(autoload 'turn-on-cdlatex "cdlatex" "CDLaTeX Mode" nil) 47 | ;(add-hook 'LaTeX-mode-hook 'turn-on-cdlatex) ; with AUCTeX LaTeX mode 48 | ;(add-hook 'latex-mode-hook 'turn-on-cdlatex) 49 | ; with Emacs latex mode 50 | 51 | ;;; emacs-rc-tex.el ends here 52 | -------------------------------------------------------------------------------- /rc/emacs-rc-clojure.el: -------------------------------------------------------------------------------- 1 | 2 | ;;; emacs-rc-clojure.el --- 3 | 4 | ;; Copyright (C) Alex Ott 5 | ;; 6 | ;; Author: Alex Ott 7 | ;; Keywords: 8 | ;; Requirements: 9 | ;; Status: not intended to be distributed yet 10 | 11 | (require 'clojure-mode) 12 | (require 'cider) 13 | (require 'clj-refactor) 14 | (autoload 'align-cljlet "align-cljlet" nil t) 15 | 16 | (add-to-list 'auto-mode-alist '("\\.\\(cljs?\\|dtm\\|edn\\)$" . clojure-mode)) 17 | 18 | (setq cider-words-of-inspiration '("")) 19 | 20 | ;; Custom indentation rules; see clojure-indent-function 21 | (define-clojure-indent 22 | (describe 'defun) 23 | (testing 'defun) 24 | (given 'defun) 25 | (using 'defun) 26 | (with 'defun) 27 | (it 'defun) 28 | (do-it 'defun) 29 | (go-loop 'defun)) 30 | 31 | (defun alexott/clojure-mode-hook () 32 | "Hook for Clojure mode" 33 | (turn-on-eldoc-mode) 34 | (whitespace-mode 1) 35 | ;; (smartparens-mode 1) 36 | (paredit-mode 1) 37 | (rainbow-delimiters-mode 1) 38 | (clj-refactor-mode 1) 39 | (local-set-key [return] 'newline-and-indent) 40 | (local-set-key "\C-c\C-c" 'cider-eval-expression-at-point) 41 | ) 42 | (add-hook 'clojure-mode-hook 'alexott/clojure-mode-hook) 43 | 44 | ;; NRepl/CIDER 45 | (defun alexott/nrepl-mode-hook () 46 | (cider-turn-on-eldoc-mode) 47 | ;; (smartparens-mode 1) 48 | (paredit-mode 1) 49 | (rainbow-delimiters-mode 1) 50 | (ac-nrepl-setup) 51 | (local-set-key [return] 'cider-repl-return) 52 | (local-set-key "\C-c\C-c" 'cider-interrupt) 53 | ) 54 | (add-hook 'cider-repl-mode-hook 'alexott/nrepl-mode-hook) 55 | 56 | (add-hook 'cider-repl-mode-hook 'ac-nrepl-setup) 57 | 58 | (add-to-list 'same-window-buffer-names "*cider-repl*") 59 | 60 | 61 | (cljr-add-keybindings-with-prefix "C-c C-q") 62 | -------------------------------------------------------------------------------- /rc/emacs-rc-desktop.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-desktop.el --- Load desktop settings 2 | 3 | ;; Copyright (C) 2003 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | (setq-default desktop-missing-file-warning nil) 11 | (setq-default desktop-path (quote ("~"))) 12 | (setq-default desktop-save t) 13 | (setq-default desktop-save-mode t) 14 | (setq-default save-place t) 15 | 16 | (add-to-list 'desktop-locals-to-save 'buffer-file-coding-system) 17 | (add-to-list 'desktop-locals-to-save 'tab-width) 18 | 19 | (defun alexott/desktop-ignore-semantic (desktop-buffer-file-name) 20 | "Function to ignore cedet minor modes during restore of buffers" 21 | nil) 22 | (add-to-list 'desktop-minor-mode-handlers '(semantic-stickyfunc-mode . alexott/desktop-ignore-semantic)) 23 | (add-to-list 'desktop-minor-mode-handlers '(senator-minor-mode . alexott/desktop-ignore-semantic)) 24 | (add-to-list 'desktop-minor-mode-handlers '(semantic-idle-scheduler-mode . alexott/desktop-ignore-semantic)) 25 | (add-to-list 'desktop-minor-mode-handlers '(semantic-idle-summary-mode . alexott/desktop-ignore-semantic)) 26 | (add-to-list 'desktop-minor-mode-handlers '(semantic-idle-completions-mode . alexott/desktop-ignore-semantic)) 27 | (add-to-list 'desktop-minor-mode-handlers '(semantic-mru-bookmark-mode . alexott/desktop-ignore-semantic)) 28 | (add-to-list 'desktop-minor-mode-handlers '(semantic-decoration-mode . alexott/desktop-ignore-semantic)) 29 | (add-to-list 'desktop-minor-mode-handlers '(srecode-minor-mode . alexott/desktop-ignore-semantic)) 30 | (add-to-list 'desktop-minor-mode-handlers '(ede-minor-mode . alexott/desktop-ignore-semantic)) 31 | 32 | (desktop-read) 33 | 34 | ;;; emacs-rc-desktop.el ends here 35 | -------------------------------------------------------------------------------- /rc/emacs-rc-flymake.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-flymake.el --- 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;; flymake 11 | (require 'flymake) 12 | ;; todo - simply clear all default rules? 13 | (setq flymake-allowed-file-name-masks (delete '("\\.c\\'" flymake-simple-make-init) flymake-allowed-file-name-masks)) 14 | (setq flymake-allowed-file-name-masks (delete '("\\.cpp\\'" flymake-simple-make-init) flymake-allowed-file-name-masks)) 15 | (setq flymake-allowed-file-name-masks (delete '("\\.cs\\'" flymake-simple-make-init) flymake-allowed-file-name-masks)) 16 | (setq flymake-allowed-file-name-masks (delete '("\\.h\\'" flymake-master-make-header-init flymake-master-cleanup) flymake-allowed-file-name-masks)) 17 | (setq flymake-allowed-file-name-masks (delete '("\\.\\(?:c\\(?:pp\\|xx\\|\\+\\+\\)?\\|CC\\)\\'" flymake-simple-make-init) flymake-allowed-file-name-masks)) 18 | (setq flymake-allowed-file-name-masks (delete '("\\.xml\\'" flymake-xml-init) flymake-allowed-file-name-masks)) 19 | (setq flymake-allowed-file-name-masks (delete '("\\.html?\\'" flymake-xml-init) flymake-allowed-file-name-masks)) 20 | (setq flymake-allowed-file-name-masks (delete '("\\.tex\\'" flymake-simple-tex-init) flymake-allowed-file-name-masks)) 21 | (setq flymake-allowed-file-name-masks (delete '("[0-9]+\\.tex\\'" flymake-master-tex-init flymake-master-cleanup) flymake-allowed-file-name-masks)) 22 | (setq flymake-allowed-file-name-masks (delete '("\\.java\\'" flymake-simple-make-java-init flymake-simple-java-cleanup) flymake-allowed-file-name-masks)) 23 | ;; (delete ' flymake-allowed-file-name-masks) 24 | (add-hook 'find-file-hook 'flymake-find-file-hook) 25 | 26 | ;;; emacs-rc-flymake.el ends here 27 | -------------------------------------------------------------------------------- /rc/emacs-rc-ocaml.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-ocaml.el --- 2 | 3 | ;; Copyright (C) 2003 Alex Ott 4 | ;; 5 | ;; Author: ott@jet.msk.su 6 | ;; Version: $Id: emacs-rc-ocaml.el,v 0.0 2003/11/20 07:48:55 ott Exp $ 7 | ;; Keywords: 8 | ;; Requirements: 9 | ;; Status: not intended to be distributed yet 10 | 11 | ;;(add-to-list 'load-path "~/emacs/tuareg") 12 | (require 'tuareg) 13 | (defun alexott/tuareg-hook () 14 | (turn-on-eldoc-mode) 15 | (local-set-key [return] 'newline-and-indent) 16 | (setq tuareg-lazy-= t) ; indent `=' like a standard keyword 17 | ;; (setq tuareg-lazy-paren t) ; indent [({ like standard keywords 18 | (setq tuareg-in-indent 0) ; no indentation after `in' keywords 19 | (setq tuareg-font-lock-governing '("brown" "cyan" nil t t t)) 20 | ;;; bold leading keywords in color mode 21 | ;; bold-italic in font mode 22 | ;; (auto-fill-mode 1) ; turn on auto-fill minor mode 23 | (if (featurep 'sym-lock) ; Sym-Lock customization only 24 | (setq sym-lock-mouse-face-enabled nil)) ; turn off special face under mouse 25 | ) 26 | (add-hook 'tuareg-mode-hook 'alexott/tuareg-hook) 27 | 28 | (if (featurep 'sym-lock) 29 | (setq tuareg-sym-lock-keywords 30 | '(("<-" 0 1 172) ("->" 0 1 174) 31 | ;; (":=" 0 1 220) 32 | ("<=" 0 1 163) (">=" 0 1 179) 33 | ("<>" 0 1 185) ("==" 0 1 186) 34 | ("||" 0 1 218) ("&&" 0 1 217) 35 | ("[^*]\\(\\*\\)\\." 1 8 180) 36 | ("\\(/\\)\\." 1 3 184) 37 | ;; (":>" 0 1 202) 38 | ;; (";;" 0 1 191) 39 | ("\\<_\\>" 0 3 188) ("\\" 0 3 214) 40 | ("\\" 0 3 198) ("\\" 0 3 108) 41 | ("\\" 0 3 218) ("\\" 0 3 216)))) 42 | 43 | (add-to-list 'auto-mode-alist '("\\.mli?$" . tuareg-mode)) 44 | 45 | ;;; emacs-rc-ocaml.el ends here 46 | -------------------------------------------------------------------------------- /rc/emacs-rc-haskell.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-haskell.el --- 2 | 3 | ;; Copyright (C) 2008 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Version: $Id: emacs-rc-haskell.el,v 0.0 2008/01/28 08:58:32 ott Exp $ 7 | ;; Keywords: 8 | ;; Requirements: 9 | ;; Status: not intended to be distributed yet 10 | 11 | 12 | (add-to-list 'load-path "~/projects/haskell-mode") 13 | (load "~/projects/haskell-mode/haskell-site-file.el") 14 | 15 | (require 'haskell-checkers) 16 | 17 | (add-to-list 'auto-mode-alist '("\\.hsc$" . haskell-mode)) 18 | 19 | (autoload 'ghc-init "ghc" nil t) 20 | 21 | (custom-set-variables 22 | '(haskell-program-name "ghci") 23 | '(inferior-haskell-wait-and-jump t) 24 | ; '(hs-lint-replace-with-suggestions t) 25 | ) 26 | 27 | (defun alexott/haskell-mode-hook () 28 | (ghc-init) 29 | (turn-on-haskell-doc-mode) 30 | (haskell-indent-mode 1) 31 | ;; (turn-on-haskell-ghci) 32 | (turn-on-eldoc-mode) 33 | (haskell-indentation-mode 1) 34 | (local-set-key [return] 'newline-and-indent) 35 | (local-set-key "\C-cl" 'hs-lint) 36 | (local-set-key "\C-ch" 'haskell-hoogle) 37 | (local-set-key "\C-c\C-h" 'haskell-hayoo) 38 | (setq tab-width 4) 39 | ;; (turn-on-haskell-simple-indent) 40 | (setq haskell-font-lock-symbols nil) 41 | 42 | (add-to-list 'ac-sources 'ac-source-ghc-mod) 43 | ) 44 | (add-hook 'haskell-mode-hook 'alexott/haskell-mode-hook) 45 | 46 | (require 'haskell-interactive-mode) 47 | (defun alexott/hs-interactive-hook () 48 | (local-set-key (kbd "C-") 49 | '(lambda () (haskell-interactive-mode-history-toggle 1))) 50 | (local-set-key (kbd "C-") 51 | '(lambda () (haskell-interactive-mode-history-toggle -1))) 52 | ) 53 | (add-hook 'haskell-interactive-mode-hook 'alexott/hs-interactive-hook) 54 | 55 | ;; 56 | (add-to-list 'exec-path "~/.cabal/bin") 57 | 58 | ;;; emacs-rc-haskell.el ends here 59 | -------------------------------------------------------------------------------- /rc/emacs-rc-erlang.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-erlang.el --- 2 | 3 | ;; Copyright (C) 2008 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | 7 | (add-to-list 'load-path "~/emacs/erlang-mode") 8 | (require 'erlang-start) 9 | (require 'erlang-flymake) 10 | 11 | (add-to-list 'auto-mode-alist '("\\.erl?$" . erlang-mode)) 12 | (add-to-list 'auto-mode-alist '("\\.hrl?$" . erlang-mode)) 13 | 14 | (defun alexott/erlang-mode-hook () 15 | ;; when starting an Erlang shell in Emacs, default in the node name 16 | (setq inferior-erlang-machine-options '("-sname" "emacs")) 17 | ;; add Erlang functions to an imenu menu 18 | (imenu-add-to-menubar "imenu") 19 | (when (and buffer-file-name 20 | (string-match "flymake" buffer-file-name)) 21 | (flymake-mode -1)) 22 | (local-set-key [return] 'newline-and-indent) 23 | ) 24 | (add-hook 'erlang-mode-hook 'alexott/erlang-mode-hook) 25 | 26 | (eval-after-load "erlang-skels" 27 | (progn 28 | (setq erlang-skel-mail-address "alexott@gmail.com"))) 29 | 30 | (when (locate-library "distel") 31 | (require 'distel) 32 | (distel-setup)) 33 | 34 | (setq alexott/wrangler-path (file-name-as-directory (expand-file-name "~/projects/wrangler"))) 35 | (when (file-exists-p alexott/wrangler-path) 36 | (add-to-list 'load-path (concat alexott/wrangler-path "elisp")) 37 | (require 'wrangler) 38 | ) 39 | 40 | (defun alexott/get-erlang-app-dir () 41 | (let* ((src-path (file-name-directory (buffer-file-name))) 42 | (pos (string-match "/src/" src-path))) 43 | (if pos 44 | (substring src-path 0 (+ 1 pos)) 45 | src-path))) 46 | 47 | ;; (setq erlang-flymake-get-code-path-dirs-function 48 | ;; (lambda () 49 | ;; (concat (alexott/get-erlang-app-dir) "ebin"))) 50 | 51 | ;; (setq erlang-flymake-get-code-include-dirs-function 52 | ;; (lambda () 53 | ;; (concat (alexott/get-erlang-app-dir) "include"))) 54 | 55 | ;;; emacs-rc-erlang.el ends here 56 | -------------------------------------------------------------------------------- /rc/emacs-rc-common-hooks.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-common-hooks.el --- 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;; common settings for different text & programming modes 11 | (defun alexott/common-hook () 12 | (local-set-key "\C-c:" 'uncomment-region) 13 | (local-set-key "\C-c;" 'comment-region) 14 | (local-set-key "\C-c\C-c" 'comment-region) 15 | (font-lock-mode 1) 16 | ) 17 | (add-hook 'prog-mode-hook 'alexott/common-hook) 18 | 19 | ;; show FIXME/TODO/BUG keywords 20 | (defun alexott/show-prog-keywords () 21 | ;; highlight additional keywords 22 | (font-lock-add-keywords nil '(("\\<\\(FIXME\\|TODO\\|BUG\\):" 1 font-lock-warning-face t))) 23 | (font-lock-add-keywords nil '(("\\<\\(DONE\\):" 1 font-lock-string-face t))) 24 | ;; highlight too long lines 25 | ;;(font-lock-add-keywords nil '(("^[^\n]\\{120\\}\\(.*\\)$" 1 font-lock-warning-face t))) 26 | ) 27 | 28 | (defun alexott/common-prog-hook () 29 | (subword-mode 1) 30 | (alexott/show-prog-keywords) 31 | ) 32 | (add-hook 'prog-mode-hook 'alexott/common-prog-hook) 33 | 34 | ;; clean trailing whitespaces automatically 35 | (setq alexott/trailing-whitespace-modes '(haskell-mode lisp-mode scheme-mode erlang-mode)) 36 | 37 | (defun alexott/trailing-whitespace-hook () 38 | (when (member major-mode alexott/trailing-whitespace-modes) 39 | (delete-trailing-whitespace))) 40 | (add-hook 'before-save-hook 'alexott/trailing-whitespace-hook) 41 | 42 | ;; untabify some modes 43 | ;; (setq alexott/untabify-modes '(haskell-mode lisp-mode scheme-mode erlang-mode clojure-mode)) 44 | ;; (defun alexott/untabify-hook () 45 | ;; (when (member major-mode alexott/untabify-modes) 46 | ;; (untabify (point-min) (point-max)))) 47 | ;; (add-hook 'before-save-hook 'alexott/untabify-hook) 48 | 49 | 50 | 51 | ;;; emacs-rc-common-hooks.el ends here 52 | -------------------------------------------------------------------------------- /rc/emacs-rc-kbd.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-kbd.el --- 2 | 3 | ;; Copyright (C) 2003 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;; (global-set-key [button5] 'scroll-up) 11 | ;; (global-set-key [button4] 'scroll-down) 12 | ;; (global-set-key [(kp-7)] 'beginning-of-line) 13 | ;; (global-set-key [(kp-8)] 'previous-line) 14 | ;; (global-set-key [(kp-9)] 'scroll-down) 15 | ;; (global-set-key [(kp-4)] 'backward-char) 16 | ;; (global-set-key [(kp-6)] 'forward-char) 17 | ;; (global-set-key [(kp-1)] 'end-of-line) 18 | ;; (global-set-key [(kp-2)] 'next-line) 19 | ;; (global-set-key [(kp-3)] 'scroll-up) 20 | ;; (global-set-key [(kp-5)] 'next-line) 21 | ;; (global-set-key [(kp-0)] 'overwrite-mode) 22 | ;; (global-set-key [(kp-decimal)] 'backward-or-forward-delete-char) 23 | ;; (global-set-key [(shift kp-0)] 'yank) 24 | ;; (global-set-key [(shift kp-decimal)] 'copy-region-as-kill) 25 | (global-set-key [help] 'info) 26 | (global-set-key [f5] 'delete-other-windows) 27 | (global-set-key [f6] 'other-window) 28 | ;; (global-set-key [f6] 'bury-buffer) 29 | (global-set-key [f7] 'replace-string) 30 | (global-set-key [f8] 'next-error) 31 | ;;(global-set-key [f10] 'delete-frame) 32 | ;; (global-set-key "\M-0" 'buffer-menu) 33 | ;; (global-set-key [(control menu)] 'popup-mode-menu) 34 | (global-set-key [(shift insert)] 'clipboard-yank) 35 | (global-set-key [(shift delete)] 'clipboard-kill-region) 36 | (global-set-key [(control insert)] 'clipboard-kill-ring-save) 37 | (global-set-key [(control x) r j] 'bookmark-jump) 38 | 39 | ;; (global-set-key [(control tab)] `other-window) 40 | ;; (defun switch-to-other-buffer () (interactive) (switch-to-buffer (other-buffer))) 41 | (global-set-key [home] 'beginning-of-line) 42 | (global-set-key [end] 'end-of-line) 43 | (global-set-key [(meta g)] 'goto-line) 44 | 45 | ;; popup menus 46 | (global-set-key [(mouse-3)] 'mouse-major-mode-menu) 47 | ;; (global-set-key [(shift mouse-3)] 'mouse-buffer-menu) 48 | 49 | ;;; emacs-rc-kbd.el ends here 50 | -------------------------------------------------------------------------------- /rc/emacs-rc-erc.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-erc.el --- 2 | 3 | ;; Copyright (C) 2004 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;;(add-to-list 'load-path "~/emacs/erc") 11 | (require 'erc) 12 | 13 | (require 'erc-join) 14 | (erc-autojoin-mode t) 15 | (setq erc-autojoin-channels-alist 16 | '( 17 | ("freenode.net" "#clojure" "#clojure.de" "#muse") 18 | ;; ("freenode.net" "#couchdb" "#haskell") 19 | ("irc.int.ru" "#unix") 20 | ("irc.fu-berlin.de" "#unix.ru" "#fidorus") 21 | ("fu-berlin.de" "#unix.ru" "#fidorus") 22 | )) 23 | 24 | (require 'erc-lang) 25 | 26 | (require 'erc-fill) 27 | (erc-fill-mode t) 28 | 29 | (setq erc-user-full-name "Alex Ott") 30 | (setq erc-email-userid "alexott@gmail.com") 31 | 32 | (require 'erc-log) 33 | (setq erc-log-insert-log-on-open nil) 34 | (setq erc-log-channels t) 35 | (setq erc-log-channels-directory "~/.irclogs/") 36 | (setq erc-save-buffer-on-part t) 37 | (setq erc-hide-timestamps nil) 38 | 39 | (setq erc-max-buffer-size 20000) 40 | 41 | (require 'erc-autoaway) 42 | (setq erc-autoaway-idle-seconds 1200) 43 | (setq erc-autoaway-message "I'm gone (autoaway after %i seconds)") 44 | (setq erc-auto-discard-away t) 45 | 46 | (setq erc-auto-query 'buffer) 47 | 48 | (setq erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT")) 49 | 50 | (require 'erc-services) 51 | (erc-nickserv-mode 1) 52 | (setq erc-prompt-for-nickserv-password nil) 53 | 54 | (require 'erc-menu) 55 | 56 | (defun erc-connect () 57 | "Connect to IRC." 58 | (interactive) 59 | (progn 60 | ;; (erc-select :server "irc.int.ru" :port 6667 :nick "alexott") 61 | (erc-select :server "irc.freenode.net" :port 6667 :nick "alexott") 62 | ;; (erc-select :server "irc.fu-berlin.de" :port 6667 :nick "alexott") 63 | )) 64 | 65 | (custom-set-variables 66 | '(erc-encoding-coding-alist (quote (("#clojure-de" . utf-8) ("#debian-russian" . cyrillic-koi8) ("#altlinux" . cyrillic-koi8) ("#unix.ru" . cyrillic-koi8) ("#fidorus" . cyrillic-koi8)))) 67 | '(erc-nick "alexott") 68 | '(erc-nick-uniquifier "_") 69 | '(erc-prompt-for-password nil) 70 | '(erc-kill-queries-on-quit t) 71 | '(erc-server-coding-system (quote utf-8)) 72 | ) 73 | 74 | ;;; emacs-rc-erc.el ends here 75 | -------------------------------------------------------------------------------- /rc/emacs-rc-osd.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-osd.el --- 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;; for linux via dbus -> http://nroff.livejournal.com/3605.html 11 | 12 | ;; rewrite to utf-8 -> byte-string 13 | ;; see also http://bbs.macscripter.net/viewtopic.php?id=20553&action=new 14 | ;; utxt --> Unicode-16, native byte order, with an optional byte-order mark (BOM). 15 | (defun osd-text-to-utf-16-hex (text) 16 | (let* ((utext (encode-coding-string text 'utf-16)) 17 | (ltext (string-to-list utext))) 18 | (apply #'concat 19 | (mapcar (lambda (x) (format "%02x" x)) ltext)))) 20 | 21 | ;; тест -> feff0442043504410442 22 | ;; (osd-text-to-utf-16-hex "тест") 23 | 24 | (defun output-to-growl (msg) 25 | (let ((fname (make-temp-file "/tmp/growlXXXXXX.applescript"))) 26 | (with-temp-file fname 27 | (setq coding-system-for-write 'utf-16) 28 | (insert (format "tell application \"GrowlHelperApp\" 29 | notify with name \"Emacs Notification\" title \"Emacs alert\" description «data utxt%s» as Unicode text application name \"Aquamacs Emacs\" 30 | end tell" (osd-text-to-utf-16-hex msg)))) 31 | (shell-command (format "osascript %s" fname)) 32 | (delete-file fname))) 33 | 34 | ;; osd notifications 35 | (defun osd-display (id msg &optional delay vattrib hattrib font) 36 | "Display a message with an id of ID for delay seconds with message msg" 37 | (unless vattrib (setq vattrib "center")) 38 | (unless hattrib (setq hattrib "center")) 39 | (unless delay (setq delay 5000)) 40 | (unless font (setq font "Serif Bold Italic 32")) 41 | 42 | (cond 43 | ((string= system-type "gnu/linux") 44 | (save-window-excursion 45 | (shell-command 46 | (format 47 | "gnome-osd-client -f \"%s\"" 48 | id 49 | font 50 | delay 51 | vattrib 52 | hattrib 53 | msg) 54 | nil nil))) 55 | ((string= system-type "darwin") 56 | (save-window-excursion 57 | (output-to-growl msg))) 58 | (t 59 | nil))) 60 | 61 | ;;; emacs-rc-osd.el ends here 62 | -------------------------------------------------------------------------------- /rc/emacs-rc-slime.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-slime.el --- 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;;; SLIME 11 | (require 'inf-lisp) 12 | ;(setq inferior-lisp-program "sbcl") 13 | (setq slime-net-coding-system 'utf-8-unix) 14 | (require 'slime) 15 | (slime-setup) 16 | (add-hook 'lisp-mode-hook 17 | (lambda () 18 | (slime-mode t))) 19 | 20 | (add-hook 'inferior-lisp-mode-hook 21 | (lambda () 22 | (inferior-slime-mode t))) 23 | 24 | ;;(add-hook 'slime-mode-hook (lambda () (slime-autodoc-mode t))) 25 | 26 | (setq slime-lisp-implementations '((clojure ("clj-cmd") :init swank-clojure-init))) 27 | ;(add-to-list 'slime-lisp-implementations '(sbcl ("sbcl") :coding-system utf-8-unix)) 28 | 29 | (setq slime-use-autodoc-mode nil) 30 | (eval-after-load "slime" 31 | '(progn 32 | (slime-setup '(slime-fancy slime-asdf slime-banner slime-fuzzy slime-repl)) 33 | (setq slime-complete-symbol*-fancy t) 34 | (setq slime-complete-symbol-function 'slime-fuzzy-complete-symbol) 35 | (setq slime-repl-history-remove-duplicates t) 36 | (setq slime-repl-history-trim-whitespaces t) 37 | (setq slime-protocol-version 'ignore) ;; ignore version mismatch 38 | )) 39 | 40 | (global-set-key [(control f11)] 'slime-selector) 41 | 42 | (add-hook 'slime-repl-mode-hook 43 | (lambda () 44 | (clojure-mode-font-lock-setup) 45 | (font-lock-mode 1))) 46 | 47 | ;; (defun fix-paredit-repl () 48 | ;; (interactive) 49 | ;; (local-set-key "{" 'paredit-open-curly) 50 | ;; (local-set-key "}" 'paredit-close-curly) 51 | ;; (modify-syntax-entry ?\{ "(}") 52 | ;; (modify-syntax-entry ?\} "){") 53 | ;; (modify-syntax-entry ?\[ "(]") 54 | ;; (modify-syntax-entry ?\] ")[")) 55 | 56 | ;; 57 | ;;(require 'ac-slime) 58 | ;;(add-hook 'slime-mode-hook 'set-up-slime-ac) 59 | ;;(add-hook 'slime-connected-hook 60 | ;; (lambda () 61 | ;; (define-key slime-mode-map (kbd "TAB") 'auto-complete) 62 | ;; (define-key slime-repl-mode-map (kbd "TAB") 'auto-complete))) 63 | ;;(add-hook 'slime-mode-hook (lambda () (auto-complete-mode t))) 64 | ;;(add-hook 'slime-repl-mode-hook (lambda () (auto-complete-mode t))) 65 | 66 | ;;; emacs-rc-slime.el ends here 67 | -------------------------------------------------------------------------------- /rc/emacs-rc-scheme.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-scheme.el --- 2 | 3 | ;; Copyright (C) 2003 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | (autoload 'run-scheme "cmuscheme" "Run an inferior Scheme" t) 11 | (setq scheme-program-name "mzscheme") 12 | 13 | (require 'quack) 14 | (setq quack-remap-find-file-bindings-p nil) 15 | 16 | (defun insert-balanced-comments (arg) 17 | "Insert a set of balanced comments around the s-expression 18 | containing the point. If this command is invoked repeatedly 19 | (without any other command occurring between invocations), the 20 | comment progressively moves outward over enclosing expressions." 21 | (interactive "*p") 22 | (save-excursion 23 | (when (eq last-command this-command) 24 | (when (search-backward "#|" nil t) 25 | (save-excursion 26 | (delete-char 2) 27 | (while (and (< (point) (point-max)) (not (looking-at " *|#"))) 28 | (forward-sexp)) 29 | (replace-match "")))) 30 | (while (> arg 0) 31 | (backward-char 1) 32 | (cond ((looking-at ")") (incf arg)) 33 | ((looking-at "(") (decf arg)))) 34 | (insert "#|") 35 | (forward-sexp) 36 | (insert "|#"))) 37 | 38 | (defun remove-balanced-comments () 39 | "Remove a set of balanced comments enclosing point." 40 | (interactive "*") 41 | (save-excursion 42 | (when (search-backward "#|" nil t) 43 | (delete-char 2) 44 | (while (and (< (point) (point-max)) (not (looking-at " *|#"))) 45 | (forward-sexp)) 46 | (replace-match "")))) 47 | 48 | (add-hook 'inferior-scheme-mode-hook 49 | '(lambda () 50 | (split-window))) 51 | 52 | (defun r5rs-call () 53 | "Calls r5rs info for current symbol" 54 | (interactive) 55 | (ignore-errors 56 | (let ((symbol (thing-at-point 'symbol))) 57 | (info "(r5rs)") 58 | (Info-index symbol)))) 59 | 60 | (defun alexott/scheme-mode-hook () 61 | "My customization of Scheme Mode" 62 | (turn-on-eldoc-mode) 63 | (local-set-key [return] 'newline-and-indent) 64 | (local-set-key [f1] 'r5rs-call) 65 | ;; (paredit-mode +1) 66 | ) 67 | 68 | (add-hook 'scheme-mode-hook 'alexott/scheme-mode-hook) 69 | 70 | (add-to-list 'auto-mode-alist '("\\.scm$" . scheme-mode)) 71 | 72 | ;; (add-to-list 'load-path "~/emacs/geiser") 73 | ;; (require 'geiser-install) 74 | ;; (setq geiser-impl-installed-implementations '(plt guile)) 75 | ;; (setq geiser-impl-default-implementation 'plt) 76 | 77 | ;;; emacs-rc-scheme.el ends here 78 | -------------------------------------------------------------------------------- /rc/emacs-rc-iswitchb.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-iswitchb.el --- 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | (require 'iswitchb) 11 | (iswitchb-mode 1) 12 | (setq iswitchb-case t) 13 | 14 | ;;(require 'filecache) 15 | ;;(load "iswitchb-fc") 16 | 17 | (add-to-list 'iswitchb-buffer-ignore "^ ") 18 | (add-to-list 'iswitchb-buffer-ignore "\\*ECB") 19 | (add-to-list 'iswitchb-buffer-ignore "\\*ESS\\*") 20 | (add-to-list 'iswitchb-buffer-ignore "\\*Backtrace") 21 | (add-to-list 'iswitchb-buffer-ignore "\\*Quail Com") 22 | (add-to-list 'iswitchb-buffer-ignore "\\*Buffer") 23 | (add-to-list 'iswitchb-buffer-ignore "\\*Help") 24 | (add-to-list 'iswitchb-buffer-ignore "\\*fsm-debug") 25 | (add-to-list 'iswitchb-buffer-ignore "\\*Completions") 26 | (add-to-list 'iswitchb-buffer-ignore "\\.cvsignore") 27 | (add-to-list 'iswitchb-buffer-ignore "\\*cvs-commit") 28 | (add-to-list 'iswitchb-buffer-ignore "\\*info\\*") 29 | (add-to-list 'iswitchb-buffer-ignore "\\*sent reply") 30 | (add-to-list 'iswitchb-buffer-ignore "\\.newsrc-dribble") 31 | (add-to-list 'iswitchb-buffer-ignore "\\*Calendar\\*") 32 | (add-to-list 'iswitchb-buffer-ignore "\\*reg group-leader\\*") 33 | (add-to-list 'iswitchb-buffer-ignore "^[tT][aA][gG][sS]$") 34 | (add-to-list 'iswitchb-buffer-ignore "\\*sent mail") 35 | (add-to-list 'iswitchb-buffer-ignore "\\*sent wide reply") 36 | (add-to-list 'iswitchb-buffer-ignore "\\*trace of SMTP") 37 | (add-to-list 'iswitchb-buffer-ignore "\\*Compile-Log\\*") 38 | (add-to-list 'iswitchb-buffer-ignore "\\*semantic") 39 | (add-to-list 'iswitchb-buffer-ignore "\\*Calc") 40 | (add-to-list 'iswitchb-buffer-ignore "\\*Article\\*") 41 | (add-to-list 'iswitchb-buffer-ignore "\\.bbdb") 42 | (add-to-list 'iswitchb-buffer-ignore "irc\\.") 43 | (add-to-list 'iswitchb-buffer-ignore "\\*Customize") 44 | (add-to-list 'iswitchb-buffer-ignore "\\*Shell Command") 45 | (add-to-list 'iswitchb-buffer-ignore "\\*svn") 46 | (add-to-list 'iswitchb-buffer-ignore "\\*w3m\\*") 47 | (add-to-list 'iswitchb-buffer-ignore "\\.hgignore") 48 | (add-to-list 'iswitchb-buffer-ignore "\\*git-") 49 | (add-to-list 'iswitchb-buffer-ignore "\\*Git ") 50 | ;;(add-to-list 'iswitchb-buffer-ignore "\\*slime-") 51 | ;;(add-to-list 'iswitchb-buffer-ignore "\\*inferior-") 52 | (add-to-list 'iswitchb-buffer-ignore "\\*Apropos\\*") 53 | (add-to-list 'iswitchb-buffer-ignore "\\*BBDB\\*") 54 | (add-to-list 'iswitchb-buffer-ignore "\\*magit") 55 | (add-to-list 'iswitchb-buffer-ignore "\\*cvs\\*") 56 | (add-to-list 'iswitchb-buffer-ignore "\\*CEDET") 57 | (add-to-list 'iswitchb-buffer-ignore "\\*GTAGS") 58 | (add-to-list 'iswitchb-buffer-ignore "\\*Symref") 59 | (add-to-list 'iswitchb-buffer-ignore "^\\.cabal$") 60 | (add-to-list 'iswitchb-buffer-ignore "-preprocessed\\*\\(<[0-9]*>\\)?$") 61 | (add-to-list 'iswitchb-buffer-ignore "\\*nnimap") 62 | (add-to-list 'iswitchb-buffer-ignore "\\*nntpd") 63 | ;;(add-to-list 'iswitchb-buffer-ignore "") 64 | ;;(add-to-list 'iswitchb-buffer-ignore "") 65 | ;;(add-to-list 'iswitchb-buffer-ignore "") 66 | 67 | 68 | ;;; emacs-rc-iswitchb.el ends here 69 | -------------------------------------------------------------------------------- /rc/emacs-rc-jabber.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-jabber.el --- 2 | 3 | ;; Copyright (C) 2004 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;;(add-to-list 'load-path "~/emacs/emacs-jabber") 11 | ;;(require 'jabber) 12 | (require 'jabber-bookmarks) 13 | 14 | (defun alexott/jabber-connect-hook (jc) 15 | (jabber-send-presence "" "I'm online" 10) 16 | (let* ((state-data (fsm-get-state-data jc)) 17 | (server (plist-get state-data :server))) 18 | (message "%s" server) 19 | (if (string-equal server "gmail.com") 20 | (progn 21 | ;; (jabber-groupchat-join jc "devil@conference.jabber.ru" "alexott") 22 | ;; (jabber-groupchat-join jc "haskell@conference.jabber.ru" "alexott") 23 | ;; (jabber-groupchat-join jc "lisp@conference.jabber.ru" "alexott") 24 | ;; (jabber-groupchat-join jc "emacs@conference.jabber.ru" "alexott") 25 | ;; (jabber-groupchat-join jc "icfpc@conference.jabber.ru" "alexott") 26 | ;; (jabber-groupchat-join jc "wax@conference.jabber.ru" "alexott") 27 | ;; (jabber-groupchat-join jc "erlang@conference.jabber.ru" "alexott") 28 | ;; (jabber-groupchat-join jc "clojure@conference.jabber.ru" "alexott") 29 | )))) 30 | (add-hook 'jabber-post-connect-hooks 'alexott/jabber-connect-hook) 31 | 32 | (defun alexott/jabber-chat-hook () 33 | (auto-fill-mode -1) 34 | (flyspell-mode -1)) 35 | (add-hook 'jabber-chat-mode-hook 'alexott/jabber-chat-hook) 36 | 37 | (require 'jabber-chatbuffer) 38 | (eval-after-load "jabber-chatbuffer" 39 | (progn 40 | (define-key jabber-chat-mode-map "\r" 'newline) 41 | (define-key jabber-chat-mode-map [return] 'newline) 42 | (define-key jabber-chat-mode-map [C-return] 'jabber-chat-buffer-send) 43 | t)) 44 | 45 | (setq jabber-history-enabled t) 46 | (setq jabber-use-global-history nil) 47 | (setq jabber-roster-show-bindings nil) 48 | (setq jabber-vcard-avatars-retrieve nil) 49 | 50 | (require 'jabber-autoaway) 51 | (add-hook 'jabber-post-connect-hook 'jabber-autoaway-start) 52 | 53 | (setq jabber-alert-info-message-hooks (quote (jabber-info-echo))) 54 | (setq jabber-alert-message-hooks (quote (jabber-message-beep jabber-message-scroll))) 55 | (setq jabber-alert-presence-hooks (quote (jabber-presence-update-roster))) 56 | (setq jabber-nickname "alexott") 57 | (setq jabber-resource (concat "at-" 58 | (if (string-equal (system-name) "alexott") 59 | "work" 60 | "home"))) 61 | 62 | (setq jabber-chat-buffer-show-avatar nil) 63 | 64 | (custom-set-variables 65 | '(jabber-auto-reconnect t) 66 | '(jabber-groupchat-buffer-format "*-jg-%n-*") 67 | '(jabber-roster-buffer "*-jroster-*") 68 | '(jabber-roster-line-format " %c %-25n %u %-8s %S") 69 | '(jabber-chat-buffer-format "*-jc-%n-*") 70 | '(jabber-muc-private-buffer-format "*-jmuc-priv-%g-%n-*") 71 | '(jabber-rare-time-format "%e %b %Y %H:00") 72 | ) 73 | 74 | (custom-set-faces 75 | '(jabber-chat-prompt-system ((t (:foreground "darkgreen" :weight bold)))) 76 | ) 77 | 78 | (setq fsm-debug nil) 79 | 80 | ;;; emacs-rc-jabber.el ends here 81 | -------------------------------------------------------------------------------- /rc/emacs-rc-prog-misc.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-prog-misc.el --- 2 | 3 | ;; Copyright (C) 2003 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Version: $Id: emacs-prog-misc.el,v 0.0 2003/11/20 11:30:47 ott Exp $ 7 | ;; Keywords: 8 | ;; Requirements: 9 | ;; Status: not intended to be distributed yet 10 | 11 | ;; setup some variables explicitly 12 | (setenv "CVS_RSH" "ssh") 13 | 14 | ;; gtags 15 | (autoload 'gtags-mode "gtags" "" t) 16 | 17 | ;; Working with RPM specs 18 | (autoload 'rpm-spec-mode "rpm-spec-mode" "RPM spec mode." t) 19 | (add-to-list 'auto-mode-alist '("\\.spec$" . rpm-spec-mode)) 20 | 21 | ;; 22 | (autoload 'smerge-mode "smerge-mode" nil t) 23 | 24 | ;; 25 | (autoload 'po-mode "po-mode" "Major mode for translators to edit PO files" t) 26 | (add-to-list 'auto-mode-alist '("\\.po$\\|\\.po\\." . po-mode)) 27 | 28 | ;; 29 | (require 'imenu) 30 | 31 | ;; whitespace mode 32 | (autoload 'whitespace-mode "whitespace" "Toggle whitespace visualization." t) 33 | (autoload 'whitespace-toggle-options "whitespace" "Toggle local `whitespace-mode' options." t) 34 | (setq whitespace-style '(trailing lines space-before-tab indentation space-after-tab) 35 | whitespace-line-column 400) 36 | (custom-set-variables 37 | '(whitespace-global-mode nil) 38 | '(whitespace-modes (quote (awk-mode clojure-mode))) 39 | '(whitespace-silent t)) 40 | 41 | ;; 42 | (autoload 'rebox-comment "rebox" nil t) 43 | (autoload 'rebox-region "rebox" nil t) 44 | 45 | ;; automatically indenting yanked text if in programming-modes 46 | (defvar yank-indent-modes '(emacs-lisp-mode lisp-mode 47 | c-mode c++-mode js2-mode 48 | tcl-mode sql-mode 49 | perl-mode cperl-mode 50 | java-mode jde-mode 51 | lisp-interaction-mode 52 | LaTeX-mode TeX-mode 53 | go-mode cuda-mode 54 | scheme-mode clojure-mode) 55 | "Modes in which to indent regions that are yanked (or yank-popped)") 56 | 57 | (defadvice yank (after indent-region activate) 58 | "If current mode is one of 'yank-indent-modes, indent yanked text (with prefix arg don't indent)." 59 | (if (member major-mode yank-indent-modes) 60 | (let ((mark-even-if-inactive t)) 61 | (indent-region (region-beginning) (region-end) nil)))) 62 | 63 | (defadvice yank-pop (after indent-region activate) 64 | "If current mode is one of 'yank-indent-modes, indent yanked text (with prefix arg don't indent)." 65 | (if (member major-mode yank-indent-modes) 66 | (let ((mark-even-if-inactive t)) 67 | (indent-region (region-beginning) (region-end) nil)))) 68 | 69 | ;; company-mode 70 | ;; (require 'company-mode) 71 | ;; (require 'company-bundled-completions) 72 | ;; (company-install-bundled-completions-rules) 73 | 74 | ;; 75 | ;;(autoload 'paredit-mode "paredit" "Minor mode for pseudo-structurally editing Lisp code." t) 76 | 77 | (require 'eldoc) 78 | ;;(eldoc-add-command 'paredit-backward-delete 'paredit-close-round) 79 | 80 | ;; smartparens 81 | ;;(require 'smartparens-config) 82 | ;;(require 'smartparens-latex) 83 | ;;(smartparens-global-mode +1) 84 | ;;(show-smartparens-global-mode +1) 85 | 86 | ;;; emacs-prog-misc.el ends here 87 | 88 | -------------------------------------------------------------------------------- /rc/emacs-rc-misc-things.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-misc-things.el --- 2 | 3 | ;; Copyright (C) 2003 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;; misc variables 11 | (setq auto-compression-mode t) 12 | (setq text-mode-hook (quote (turn-on-auto-fill text-mode-hook-identify))) 13 | (setq user-full-name "Alex Ott") 14 | 15 | (setq longlines-show-hard-newlines t) ;; FIX for crash 16 | 17 | (custom-set-variables 18 | '(delete-selection-mode t) 19 | '(fill-column 90) 20 | '(kill-whole-line t) 21 | '(tab-always-indent t) 22 | '(indent-tabs-mode nil) 23 | '(tab-width 8) 24 | '(next-line-add-newlines t) 25 | '(disabled-command-function nil) 26 | ) 27 | 28 | ;; set safe-local varaibles 29 | (custom-set-variables 30 | '(safe-local-variable-values (quote ( 31 | (c-file-offsets (substatement-open . 0)) 32 | (prompt-to-byte-compile) 33 | (c-indentation-style . k&r) 34 | (indent-tabs-mode . 1) 35 | (folded-file . t) 36 | (TeX-open-quote . "<<") 37 | (TeX-close-quote . ">>") 38 | )))) 39 | 40 | ;; htmlize 41 | (require 'htmlize) 42 | (setq htmlize-output-type 'inline-css) 43 | (defun alexott/add-google-analytics () 44 | (while (search-forward "" nil t) 45 | (replace-match "\n\n\n" nil t)) 46 | ) 47 | (add-hook 'htmlize-after-hook 'alexott/add-google-analytics) 48 | 49 | ;; footnote mode 50 | (autoload 'footnote-mode "footnote" nil t) 51 | 52 | ;; 53 | (add-to-list 'auto-mode-alist '("\\.log$" . auto-revert-mode)) 54 | (add-to-list 'auto-mode-alist '("/logs/[^/]*\\.out$" . auto-revert-mode)) 55 | 56 | ;; 57 | (defun uniq () 58 | "Trying to leave only unique strings from selection" 59 | (interactive) 60 | (let ((beg (point)) 61 | (end (mark)) 62 | (hash (make-hash-table :test 'equal)) 63 | ) 64 | (if (not end) 65 | (error "Please, mark text to uniquify") 66 | (save-excursion 67 | (narrow-to-region beg end) 68 | (goto-char (point-min)) 69 | 70 | ;; store strings in hash 71 | (while (not (eobp)) 72 | (beginning-of-line) 73 | (puthash (buffer-substring (point) (point-at-eol)) 0 hash) 74 | (forward-line 1)) 75 | (delete-region beg end) 76 | ;; insert strings from hash 77 | (maphash (lambda (key val) 78 | (insert key "\n") 79 | (message "%s" key) 80 | ) 81 | hash) 82 | (widen))))) 83 | 84 | (defun string-join (joiner strings) 85 | (string-join-accum joiner strings "")) 86 | 87 | (defun string-join-accum (joiner strings accum) 88 | (cond ((not strings) accum) 89 | ((not (cdr strings)) (concat accum (car strings))) 90 | (t (string-join-accum joiner (cdr strings) 91 | (concat accum (car strings) joiner))))) 92 | 93 | ;; fix for broken hex-mode hook 94 | 95 | (setq revert-buffer-function nil) 96 | 97 | -------------------------------------------------------------------------------- /rc/emacs-rc-local-flash.el: -------------------------------------------------------------------------------- 1 | ;; local settings for mac 2 | 3 | (semantic-add-system-include "/opt/local/include/" 'c++-mode) 4 | (semantic-add-system-include "/opt/local/include/" 'c-mode) 5 | 6 | (c++-setup-boost "/opt/local/include/boost") 7 | 8 | ;; info 9 | (push "/opt/local/share/info" Info-directory-list) 10 | (setenv "MANPATH" "/opt/local/man:/usr/share/man:/usr/local/man") 11 | 12 | ;; 13 | (set-file-name-coding-system 'utf-8) 14 | ;; (normal-erase-is-backspace-mode t) 15 | 16 | ;; auto-inserts 17 | (add-to-list 'auto-insert-alist '("\\.cpp$" . ["insert-home.cpp" auto-update-c-source-file])) 18 | (add-to-list 'auto-insert-alist '("\\.h$" . ["insert-home.h" auto-update-header-file])) 19 | (add-to-list 'auto-insert-alist '("\\.c$" . ["insert-home.cpp" auto-update-c-source-file])) 20 | 21 | ;; 22 | (custom-set-variables 23 | ;; '(custom-file "~/.emacs") 24 | '(default-frame-alist nil) 25 | ;; '(one-buffer-one-frame-mode nil nil (aquamacs-frame-setup)) 26 | '(cua-mode nil) 27 | '(transient-mark-mode t) 28 | ;; '(aquamacs-styles-mode nil nil (color-theme)) 29 | ;; '(mac-input-method-mode nil) 30 | '(smart-frame-positioning-mode nil) 31 | ;; '(default-input-method "russian-computer") 32 | ) 33 | 34 | (setq delete-selection-mode t) 35 | 36 | (global-set-key [delete] 'delete-char) 37 | (global-set-key [kp-delete] 'delete-char) 38 | 39 | ;;; (setq-default mac-command-key-is-meta t) 40 | (setq mac-command-modifier 'meta) 41 | ;;; (setq mac-option-modifier 'super) 42 | ;;; (setq mac-pass-command-to-system nil) 43 | (setq special-display-regexps (remove "[ ]?\\*[hH]elp.*" special-display-regexps)) 44 | 45 | (custom-set-faces 46 | '(default ((t (:background "grey90" :foreground "Black")))) 47 | '(font-lock-comment-face ((((class color) (min-colors 88) (background light)) 48 | (:foreground "gray50")))) 49 | '(org-hide ((((background light)) (:foreground "grey90"))))) 50 | 51 | ;; (when (string-match "22\\." (emacs-version)) 52 | ;; (custom-set-faces 53 | ;; '(default ((t (:stipple nil :background "grey90" :foreground "Black" :inverse-video nil 54 | ;; :box nil :strike-through nil :overline nil :underline nil :slant 55 | ;; normal :weight normal :height 160 :width normal :family 56 | ;; "apple-monaco")))))) 57 | 58 | ;;(when (or (string-match "23\\." (emacs-version)) (string-match "24\\." (emacs-version)))) 59 | (set-fontset-font "fontset-default" '(#x0000 . #xFFFFF) '("Apple Monaco" . "unicode-bmp")) 60 | (setq ns-command-modifier 'meta 61 | ns-alternate-modifier 'super) 62 | (setq-default cursor-type 'box) 63 | (setq ns-antialias-text t) 64 | (setq mac-allow-anti-aliasing t) 65 | 66 | (setq default-frame-alist '((background-color . "grey90") 67 | (left . 0) 68 | (width . 130) 69 | (height . 43))) 70 | (setq initial-frame-alist (copy-alist default-frame-alist)) 71 | (setq special-display-frame-alist (copy-alist default-frame-alist)) 72 | 73 | ;; erlang 74 | (setq erlang-root-dir "/opt/local/lib/erlang") 75 | (push "/opt/local/lib/erlang/bin" exec-path) 76 | (setq erlang-man-root-dir "/opt/local/lib/erlang/man") 77 | 78 | ;; redefine some keys to more useful 79 | ;; (define-key osx-key-mode-map (kbd "") 'beginning-of-line) 80 | ;; (define-key osx-key-mode-map (kbd "") 'end-of-line) 81 | 82 | ;; 83 | (setq special-display-regexps (remove "[ ]?\\*[hH]elp.*" special-display-regexps)) 84 | (setq special-display-regexps (remove "[ ]?\\*info.*\\*[ ]?" special-display-regexps)) 85 | (setq special-display-regexps (remove "[ ]?\\*Messages\\*[ ]?" special-display-regexps)) 86 | 87 | ;;(setenv "LANG" "ru_RU.UTF-8") 88 | -------------------------------------------------------------------------------- /rc/emacs-rc-auto-insert.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-auto-insert.el --- 2 | 3 | ;; Copyright (C) 2008 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Version: $Id: emacs-rc-auto-insert.el,v 0.0 2008/03/10 14:12:35 ott Exp $ 7 | ;; Keywords: 8 | ;; Requirements: 9 | ;; Status: not intended to be distributed yet 10 | 11 | ;; auto-insert stuff 12 | (add-hook 'find-file-hooks 'auto-insert) 13 | (setq auto-insert-directory (concat (getenv "HOME") "/emacs/auto-insert/")) 14 | (setq auto-insert 'other) 15 | (setq auto-insert-query nil) 16 | 17 | (setq auto-insert-alist '(("\\.muse$" . ["insert.muse"]) 18 | ("\\.sh$" . ["insert.sh" alexott/auto-update-defaults]) 19 | ("\\.lisp$" . ["insert.lisp" alexott/auto-update-defaults]) 20 | ("\\.el$" . ["insert.el" alexott/auto-update-defaults]) 21 | ("\\.erl$" . ["insert.erl" alexott/auto-update-defaults]) 22 | )) 23 | (add-to-list 'auto-insert-alist '(".*/projects/.*\\.cpp$" . ["insert-home.cpp" alexott/auto-update-c-source-file])) 24 | (add-to-list 'auto-insert-alist '(".*/projects/.*\\.h$" . ["insert-home.h" alexott/auto-update-header-file])) 25 | (add-to-list 'auto-insert-alist '(".*/projects/.*\\.hpp$" . ["insert-home.h" alexott/auto-update-header-file])) 26 | (add-to-list 'auto-insert-alist '(".*/projects/.*\\.c$" . ["insert-home.cpp" alexott/auto-update-c-source-file])) 27 | 28 | (defun alexott/auto-replace-header-name () 29 | (save-excursion 30 | (while (search-forward "###" nil t) 31 | (save-restriction 32 | (narrow-to-region (match-beginning 0) (match-end 0)) 33 | (replace-match (upcase (file-name-nondirectory buffer-file-name))) 34 | (subst-char-in-region (point-min) (point-max) ?. ?_) 35 | (subst-char-in-region (point-min) (point-max) ?- ?_) 36 | )) 37 | ) 38 | ) 39 | 40 | (defun alexott/auto-replace-file-name () 41 | (save-excursion 42 | ;; Replace @@@ with file name 43 | (while (search-forward "(>>FILE<<)" nil t) 44 | (save-restriction 45 | (narrow-to-region (match-beginning 0) (match-end 0)) 46 | (replace-match (file-name-nondirectory buffer-file-name) t) 47 | )) 48 | ) 49 | ) 50 | 51 | (defun alexott/auto-replace-file-name-no-ext () 52 | (save-excursion 53 | ;; Replace @@@ with file name 54 | (while (search-forward "(>>FILE_NO_EXT<<)" nil t) 55 | (save-restriction 56 | (narrow-to-region (match-beginning 0) (match-end 0)) 57 | (replace-match (file-name-sans-extension (file-name-nondirectory buffer-file-name)) t) 58 | )) 59 | ) 60 | ) 61 | 62 | (defun alexott/insert-today () 63 | "Insert today's date into buffer" 64 | (interactive) 65 | (insert (format-time-string "%A, %B %e %Y" (current-time)))) 66 | 67 | (defun alexott/auto-replace-date-time () 68 | (save-excursion 69 | ;; replace DDDD with today's date 70 | (while (search-forward "(>>DATE<<)" nil t) 71 | (save-restriction 72 | (narrow-to-region (match-beginning 0) (match-end 0)) 73 | (replace-match "" t) 74 | (alexott/insert-today) 75 | )))) 76 | 77 | (defun alexott/auto-update-header-file () 78 | (alexott/auto-replace-header-name) 79 | (alexott/auto-replace-file-name) 80 | ) 81 | 82 | (defun alexott/auto-update-c-source-file () 83 | (save-excursion 84 | ;; Replace HHHH with file name sans suffix 85 | (while (search-forward "HHHH" nil t) 86 | (save-restriction 87 | (narrow-to-region (match-beginning 0) (match-end 0)) 88 | (replace-match (concat (file-name-sans-extension (file-name-nondirectory buffer-file-name)) ".h") t)))) 89 | (alexott/auto-replace-file-name) 90 | (alexott/auto-replace-date-time)) 91 | 92 | (defun alexott/auto-update-defaults () 93 | (alexott/auto-replace-file-name) 94 | (alexott/auto-replace-file-name-no-ext) 95 | (alexott/auto-replace-date-time) 96 | ) 97 | 98 | ;;; emacs-rc-auto-insert.el ends here 99 | -------------------------------------------------------------------------------- /rc/emacs-rc-ccmode.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-ccmode.el --- 2 | 3 | ;; Copyright (C) 2003 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | (require 'cc-mode) 11 | 12 | (load "c-eldoc") 13 | (setq c-eldoc-includes "-I~/exp/include -I./ -I../ ") 14 | 15 | ;; taken from http://stackoverflow.com/questions/14715689/emacs-different-indentation-for-class-and-struct 16 | (defun my-c-lineup-inclass (langelem) 17 | (let ((inclass (assoc 'inclass c-syntactic-context))) 18 | (save-excursion 19 | (goto-char (c-langelem-pos inclass)) 20 | (if (or (looking-at "struct") 21 | (looking-at "typedef struct")) 22 | '+ 23 | '++)))) 24 | 25 | ;; customisation of cc-mode 26 | (defun alexott/c-mode-common-hook () 27 | ;; style customization 28 | (c-set-style "bsd") 29 | (setq tab-width 4) 30 | (setq indent-tabs-mode t) 31 | ;; (c-set-offset 'substatement-open 0) 32 | (c-set-offset 'access-label '-) 33 | (c-set-offset 'topmost-intro 0) 34 | (c-set-offset 'inclass 'my-c-lineup-inclass) 35 | ;; (c-set-offset 'member-init-intro '++) 36 | (c-toggle-auto-hungry-state 0) 37 | (setq c-basic-offset 4) 38 | ;; minor modes 39 | (auto-fill-mode 1) 40 | (c-turn-on-eldoc-mode) 41 | (gtags-mode 1) 42 | (hs-minor-mode 1) 43 | ;; local keys 44 | (local-set-key [return] 'newline-and-indent) 45 | ) 46 | (add-hook 'c-mode-common-hook 'alexott/c-mode-common-hook) 47 | (add-hook 'c-mode-common-hook 'alexott/common-hook) 48 | (add-hook 'c-mode-common-hook 'alexott/common-prog-hook) 49 | 50 | (require 'info-look) 51 | (info-lookup-add-help 52 | :mode 'c-mode 53 | :regexp "[^][()'\" \t\n]+" 54 | :ignore-case t 55 | :doc-spec '(("(libc)Symbol Index" nil nil nil))) 56 | 57 | (defun fp-c-mode-routine () 58 | (local-set-key "\M-q" 'rebox-comment)) 59 | (add-hook 'c-mode-hook 'fp-c-mode-routine) 60 | 61 | (setq-default c-default-style (quote ((java-mode . "java") (other . "gnu")))) 62 | 63 | (add-to-list 'auto-mode-alist '("\\.ipp$" . c++-mode)) 64 | (add-to-list 'auto-mode-alist '("\\.h$" . c++-mode)) 65 | 66 | ;; 67 | (require 'cuda-mode) 68 | 69 | ;; function args... 70 | (require 'function-args) 71 | (fa-config-default) 72 | 73 | ;; documentation browser for C++ 74 | ;; taken from https://gist.github.com/randomphrase/9177867 75 | 76 | (defun c++-type-at (point) 77 | "Use semantic to determine the fully namespace-qualified type of the symbol at POINT." 78 | (interactive "d") 79 | (let* ((ctxt (semantic-analyze-current-context point)) 80 | (pf (reverse (oref ctxt prefix))) 81 | (lastname (pop pf)) 82 | (tag (if (semantic-tag-p lastname) lastname (car pf))) 83 | (names (append 84 | (when (semantic-tag-p tag) 85 | (save-excursion 86 | (when (semantic-tag-with-position-p tag) 87 | (set-buffer (semantic-tag-buffer tag)) 88 | (semantic-go-to-tag tag) 89 | (mapcar 'semantic-tag-name (semantic-analyze-scope-nested-tags (point) nil))))) 90 | (list (if (semantic-tag-p lastname) (semantic-tag-name lastname) lastname))))) 91 | (concat (mapconcat 'concat names "::")))) 92 | 93 | (defvar c++-doco-sources 94 | '(("std::" . 95 | "http://en.cppreference.com/mwiki/index.php?title=Special:Search&search=%s") 96 | ("boost::" . "http://google.com/search?q=site:boost.org%%20%s") 97 | )) 98 | 99 | (defun semantic-browse-c++-doc (point) 100 | "Browse the documentation for the C++ symbol at POINT." 101 | (interactive "d") 102 | (let* ((cpptype (c++-type-at point)) 103 | (ref (when (stringp cpptype) 104 | (car (cl-member-if (lambda (S) (string-prefix-p (car S) cpptype)) 105 | c++-doco-sources))))) 106 | (if ref 107 | (browse-url (format (cdr ref) cpptype)) 108 | (message "No documentation source found for %s" cpptype)))) 109 | 110 | (defun alexott/c++-doc-hook () 111 | (local-set-key "\C-cw" 'semantic-browse-c++-doc) 112 | ) 113 | (add-hook 'c++-mode-hook 'alexott/c++-doc-hook) 114 | 115 | ;;; emacs-rc-cmode.el ends here 116 | -------------------------------------------------------------------------------- /rc/emacs-rc-supercite.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-supercite.el --- Settings for supercite library 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | 11 | ;; Setting up Supercite library 12 | (autoload 'sc-cite-original "supercite" nil t) 13 | ;; (load-library "supercite") 14 | 15 | (setq sc-confirm-always-p nil 16 | sc-nested-citation-p t 17 | sc-preferred-header-style 4 18 | ) 19 | 20 | 21 | (defun Ran:citation-line () 22 | (insert "\n\n") 23 | (insert (SNP:email->stripped-full-name (mail-header-from message-reply-headers))) 24 | (insert " at \"" (mail-header-date message-reply-headers) "\" wrote:\n")) 25 | 26 | (setq message-citation-line-function 'Ran:citation-line) 27 | 28 | (defun Ran:citation () 29 | (let ((beg (point)) 30 | (end (mark t)) 31 | (initials (SNP:full-name->initials 32 | (SNP:email->stripped-full-name 33 | (message-fetch-reply-field "From"))))) 34 | (save-excursion 35 | (narrow-to-region beg end) 36 | ;; delete headers 37 | (goto-char (point-min)) 38 | (search-forward "\n\n") 39 | (delete-region (point-min) (point)) 40 | 41 | (while (and (point-min) 42 | (eolp) 43 | (not (eobp))) 44 | (message-delete-line)) 45 | 46 | (when (search-forward-regexp "^-- ?$" (point-max) t) 47 | (delete-region (match-beginning 0) (point-max))) 48 | 49 | (goto-char beg) 50 | (while (not (eobp)) 51 | (beginning-of-line) 52 | (unless (eolp) 53 | (if (re-search-forward "^ *\\(\\w*\\)\\(>\\)" (point-at-eol) 54 | t) 55 | (replace-match " \\1>\\2") 56 | (insert " " initials "> "))) 57 | (forward-line 1)) 58 | (widen) 59 | (insert "\n")))) 60 | 61 | (setq mail-citation-hook 62 | '(lambda () 63 | (Ran:citation) 64 | (let ((p (point))) 65 | (Ran:citation-line) 66 | (goto-char p)))) 67 | 68 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 69 | ;; 70 | ;; Разные полезные функции из gnus-snp 71 | ;; 72 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 73 | 74 | ;; 75 | ;; Удалить пробелы в начале и в конце строки 76 | ;; 77 | (defun SNP:strip-string (str) 78 | (let ((s str)) 79 | (when (string-match "^[ \"]+" s) 80 | (setq s (substring s (match-end 0)))) 81 | (when (string-match "[ \"]+$" s) 82 | (setq s (substring s 0 (match-beginning 0)))) 83 | (symbol-value 's))) 84 | 85 | ;; 86 | ;; Получить имя из e-mail'а 87 | ;; 88 | (defun SNP:email->full-name (from) 89 | (if from 90 | (let ((s)) 91 | (if (cdr (setq s (split-string from "<\\|>"))) 92 | (car s) 93 | (if (cdr (setq s (split-string from "\(\\|\)"))) 94 | (cadr s) 95 | from))) 96 | "")) 97 | 98 | (defun SNP:email->stripped-full-name (from) 99 | (SNP:strip-string (SNP:email->full-name from))) 100 | 101 | ;; 102 | ;; Получить начало имени из полного имени 103 | ;; 104 | (defun SNP:full-name->first-name (name) 105 | (when (string-match "[^ ]*" name) 106 | (substring name (match-beginning 0) (match-end 0)))) 107 | 108 | ;; 109 | ;; Получить инициалы из имени 110 | ;; 111 | (defun SNP:full-name->initials (name) 112 | (let ((lst (split-string name " +")) 113 | (out "")) 114 | (while lst 115 | (setq out (concat out (char-to-string (car (string-to-list (car lst)))))) 116 | (setq lst (cdr lst)) 117 | ) 118 | (symbol-value 'out))) 119 | 120 | ;; 121 | ;; Разрыв строки, сохраняющий квотинг 122 | ;; 123 | (defun Ran:break-cited-line () 124 | (interactive) 125 | (if (or (bolp) (eolp)) 126 | (insert "\n") 127 | (let ((quote-string nil)) 128 | (save-excursion 129 | (beginning-of-line) 130 | (when (re-search-forward "^ *\\w*>+" (point-at-eol) t) 131 | (setq quote-string (match-string 0)))) 132 | (if quote-string 133 | (insert (concat "\n" quote-string)) 134 | (insert "\n"))))) 135 | 136 | 137 | ;;; emacs-rc-supercite.el ends here 138 | -------------------------------------------------------------------------------- /rc/emacs-rc-pretty-lambda.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-pretty-lambda.el --- 2 | 3 | ;; Copyright (C) Alex Ott 4 | ;; 5 | ;; Author: Alex Ott 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | 11 | ;; Unicode symbols in buffer 12 | (defun unicode-symbol (name) 13 | "Translate a symbolic name for a Unicode character -- e.g., LEFT-ARROW 14 | or GREATER-THAN into an actual Unicode character code. " 15 | (decode-char 'ucs (case name 16 | ('right-triangle #X22b3) 17 | ('left-triangle #X22b2) 18 | ('left-arrow 8592) 19 | ('up-arrow 8593) 20 | ('right-arrow 8594) 21 | ('down-arrow 8595) 22 | ('right-double-arrow 8658) 23 | ('left-double-arrow 8656) 24 | ('double-vertical-bar #X2551) 25 | ('equal #X003d) 26 | ('not-equal #X2260) 27 | ('identical #X2261) 28 | ('not-identical #X2262) 29 | ('much-less-than #X226a) 30 | ('much-greater-than #X226b) 31 | ('less-than #X003c) 32 | ('greater-than #X003e) 33 | ('less-than-or-equal-to #X2264) 34 | ('greater-than-or-equal-to #X2265) 35 | ('logical-and #X2227) 36 | ('logical-or #X2228) 37 | ('logical-neg #X00AC) 38 | ('nil #X2205) 39 | ('horizontal-ellipsis #X2026) 40 | ('double-exclamation #X203C) 41 | ('prime #X2032) 42 | ('double-prime #X2033) 43 | ('for-all #X2200) 44 | ('there-exists #X2203) 45 | ('element-of #X2208) 46 | ('square-root #X221A) 47 | ('squared #X00B2) 48 | ('cubed #X00B3) 49 | ('lambda #X03BB) 50 | ('alpha #X03B1) 51 | ('beta #X03B2) 52 | ('gamma #X03B3) 53 | ('delta #X03B4)))) 54 | 55 | (defun substitute-pattern-with-unicode (pattern symbol) 56 | "Add a font lock hook to replace the matched part of PATTERN with the 57 | Unicode symbol SYMBOL looked up with UNICODE-SYMBOL." 58 | (interactive) 59 | (font-lock-add-keywords 60 | nil `((,pattern 61 | (0 (progn (compose-region (match-beginning 1) (match-end 1) 62 | ,(unicode-symbol symbol) 63 | 'decompose-region) 64 | nil)))))) 65 | 66 | (defun substitute-patterns-with-unicode (patterns) 67 | "Call SUBSTITUTE-PATTERN-WITH-UNICODE repeatedly." 68 | (mapcar #'(lambda (x) 69 | (substitute-pattern-with-unicode (car x) 70 | (cdr x))) 71 | patterns)) 72 | 73 | ;; symbol replacements for erlang 74 | (defun erlang-unicode () 75 | (interactive) 76 | (substitute-patterns-with-unicode 77 | (list 78 | ;; (cons "\\(<<\\)" 'left-arrow) 79 | ;; (cons "\\(>>\\)" 'left-arrow) 80 | (cons "\\s \\(->\\)\\(\\s \\|$\\)" 'right-arrow)))) 81 | (add-hook 'erlang-mode-hook 'erlang-unicode) 82 | 83 | (defun fsharp-unicode () 84 | (interactive) 85 | (substitute-patterns-with-unicode 86 | (list (cons "\\(<-\\)" 'left-arrow) 87 | (cons "\\(->\\)" 'right-arrow) 88 | (cons "\\[^=\\]\\(=\\)\\[^=\\]" 'equal) 89 | (cons "\\(==\\)" 'identical) 90 | (cons "\\(\\!=\\)" 'not-identical) 91 | (cons "\\(<>\\)" 'not-equal) 92 | (cons "\\(()\\)" 'nil) 93 | (cons "\\<\\(sqrt\\)\\>" 'square-root) 94 | (cons "\\(&&\\)" 'logical-and) 95 | (cons "\\(||\\)" 'logical-or) 96 | (cons "\\<\\(not\\)\\>" 'logical-neg) 97 | (cons "\\(>\\)\\[^=\\]" 'greater-than) 98 | (cons "\\(<\\)\\[^=\\]" 'less-than) 99 | (cons "\\(>=\\)" 'greater-than-or-equal-to) 100 | (cons "\\(<=\\)" 'less-than-or-equal-to) 101 | (cons "\\<\\(alpha\\)\\>" 'alpha) 102 | (cons "\\<\\(beta\\)\\>" 'beta) 103 | (cons "\\<\\(gamma\\)\\>" 'gamma) 104 | (cons "\\<\\(delta\\)\\>" 'delta) 105 | (cons "\\(''\\)" 'double-prime) 106 | (cons "\\('\\)" 'prime) 107 | (cons "\\<\\(List.forall\\)\\>" 'for-all) 108 | (cons "\\<\\(List.exists\\)\\>" 'there-exists) 109 | (cons "\\(>>\\)" 'much-greater-than) 110 | (cons "\\(<<\\)" 'much-less-than) 111 | ;;(cons "\\(|>\\)" 'right-triangle) 112 | ;;(cons "\\(<|\\)" 'left-triangle) 113 | ;;(cons "\\<\\(List.mem\\)\\>" 'element-of) 114 | (cons "^ +\\(|\\)" 'double-vertical-bar)))) 115 | (add-hook 'fsharp-mode-hook 'fsharp-unicode) 116 | 117 | 118 | ;;; emacs-rc-pretty-lambda.el ends here 119 | -------------------------------------------------------------------------------- /rc/emacs-rc-org-mode.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-org-mode.el --- 2 | 3 | ;; Copyright (C) 2004 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | ;;(add-to-list 'load-path "~/emacs/org-mode") 11 | ;;(add-to-list 'load-path "~/emacs/org-mode/contrib") 12 | 13 | (custom-set-variables 14 | '(org-startup-folded nil) 15 | '(org-log-done t) 16 | '(org-hide-leading-stars t) 17 | '(org-agenda-include-diary t) 18 | '(org-agenda-skip-scheduled-if-done t) 19 | '(org-agenda-skip-deadline-if-done t) 20 | '(org-agenda-include-all-todo t) 21 | '(org-use-property-inheritance t) 22 | ; '(org-enforce-todo-dependencies t) 23 | '(org-special-ctrl-a/e t) 24 | '(org-special-ctrl-k t) 25 | '(org-blank-before-new-entry (quote ((heading . auto) (plain-list-item)))) 26 | '(org-agenda-dim-blocked-tasks 'invisible) 27 | '(org-enforce-todo-checkbox-dependencies t) 28 | '(org-completion-use-iswitchb t) 29 | '(org-export-allow-BIND t) 30 | '(diary-file "~/Dropbox/OrgMode/diary") 31 | '(mark-diary-entries-in-calendar t) 32 | '(org-export-html-postamble t) 33 | '(org-export-html-postamble-format (quote (("en" "

Author: %a (%e), Date: %d

34 | ")))) 35 | '(org-todo-keywords '((sequence "TODO(t)" "WAITING(w)" "STARTED(s)" "|" "DONE(d)" 36 | "CANCELED(c)"))) 37 | '(org-directory "~/Dropbox/OrgMode") 38 | '(org-agenda-files (directory-files org-directory t ".*\.org$"))) 39 | 40 | (require 'org) 41 | 42 | (add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|/TODO\\)$" . org-mode)) 43 | (add-to-list 'file-coding-system-alist (cons "\\.\\(org\\|org_archive\\|/TODO\\)$" 'utf-8)) 44 | 45 | (define-key global-map "\C-cl" 'org-store-link) 46 | (define-key global-map "\C-ca" 'org-agenda) 47 | (define-key global-map "\C-cb" 'org-iswitchb) 48 | 49 | (defun alexott/org-mode-hook () 50 | (local-set-key "\C-x\C-a" 'show-all) 51 | (imenu-add-to-menubar "Imenu") 52 | (setq comment-start nil) 53 | (make-variable-buffer-local 'yas/trigger-key) 54 | (setq yas/trigger-key [tab]) 55 | (local-set-key [tab] 'yas/expand) 56 | (local-set-key [(meta tab)] 'pcomplete) 57 | ) 58 | (add-hook 'org-mode-hook 'alexott/org-mode-hook) 59 | (add-hook 'org-mode-hook 'turn-on-font-lock) 60 | 61 | ;; 62 | (setq org-fontify-done-headline t) 63 | ;;(set-face-attribute 'org-done nil :strike-through t) 64 | (set-face-attribute 'org-headline-done nil :strike-through t) 65 | 66 | ;; blorg mode 67 | ;;(require 'blorg) 68 | 69 | ;; diary setup 70 | (require 'diary-lib) 71 | (add-hook 'diary-display-hook 'fancy-diary-display) 72 | 73 | ;; link abbrevs 74 | (add-to-list 'org-link-abbrev-alist '("emacswiki" . "http://www.emacswiki.org/cgi-bin/wiki/")) 75 | (add-to-list 'org-link-abbrev-alist '("google" . "http://www.google.com/search?q=")) 76 | (add-to-list 'org-link-abbrev-alist '("ms-spec" . "http://localhost/~ott/data-formats-doc/Microsoft%20Specs/[%s].pdf")) 77 | (add-to-list 'org-link-abbrev-alist '("BZ" . "https://bugzilla.corp.nai.org/bugzilla/show_bug.cgi?id=")) 78 | 79 | ;; remember mode 80 | ;;(org-remember-insinuate) 81 | ;;(setq org-default-notes-file (concat org-directory "/notes.org")) 82 | ;;(define-key global-map "\C-cr" 'org-remember) 83 | 84 | ;; mobile org support 85 | (setq org-mobile-inbox-for-pull (concat org-directory "/mobile.org")) 86 | (setq org-mobile-directory "~/Dropbox/MobileOrg") 87 | 88 | (setq org-remember-templates 89 | '( 90 | ("Todo" ?t "* TODO %?\n %i\n %a" (concat org-directory "/TODO.org") "Tasks") 91 | )) 92 | 93 | ;; icalendar 94 | (autoload 'icalendar-import-buffer "icalendar" "Import iCalendar data from current buffer" t) 95 | 96 | ;; org + appt 97 | ;; Run once, activate and schedule refresh 98 | ;; (defun alexott/org-agenda-to-appt () 99 | ;; (interactive) 100 | ;; (setq appt-time-msg-list nil) 101 | ;; (org-agenda-to-appt)) 102 | 103 | ;; (add-hook 'org-finalize-agenda-hook 'alexott/org-agenda-to-appt) 104 | ;; (alexott/org-agenda-to-appt) 105 | ;; (run-at-time "24:01" nil 'alexott/org-agenda-to-appt) 106 | ;; (run-at-time "00:59" 3600 'org-save-all-org-buffers) 107 | ;; ;; (run-at-time nil 3600 'org-agenda-to-appt) 108 | ;; (appt-activate t) 109 | 110 | ;; ;; 5 minute warning 111 | ;; (setq appt-message-warning-time '60) 112 | ;; (setq appt-display-interval '15) 113 | 114 | ;; ;; on screen display 115 | ;; (defun org-osd-display (min-to-app new-time msg) 116 | ;; (osd-display msg msg -1 "center" "center" "Verdana 40") 117 | ;; ) 118 | 119 | ;; (setq appt-disp-window-function (function org-osd-display)) 120 | ;; ;; Update appt each time agenda opened. 121 | ;; (setq appt-display-format 'window) 122 | 123 | ;; drawing diagrams with ditaa 124 | (setq org-ditaa-jar-path "~/bin/ditaa0_6b.jar") 125 | 126 | ;; babel setup 127 | (org-babel-do-load-languages 128 | 'org-babel-load-languages 129 | '((clojure . t) 130 | (haskell . t) 131 | (C . t) 132 | (emacs-lisp . t) 133 | (R . t) 134 | (sh . t) 135 | )) 136 | 137 | ;; Org-Drill - flash-cards, a-la Anki... 138 | ;;(require 'org-drill) 139 | 140 | 141 | ;;; emacs-rc-org-mode.el ends here 142 | 143 | -------------------------------------------------------------------------------- /.emacs: -------------------------------------------------------------------------------- 1 | ;; set init file for custom settings 2 | (setq custom-file "~/.emacs.d/custom.el") 3 | 4 | ;; init PATH & exec-path from current shell 5 | (defun set-exec-path-from-shell-PATH () 6 | (let ((path-from-shell (shell-command-to-string "$SHELL -c 'echo $PATH'"))) 7 | (setenv "PATH" path-from-shell) 8 | (setq exec-path (split-string path-from-shell path-separator)))) 9 | (when window-system (set-exec-path-from-shell-PATH)) 10 | 11 | (load "~/emacs/rc/emacs-rc-cedet.el") 12 | (load "~/emacs/rc/emacs-rc-erlang.el") 13 | 14 | ;; el-get 15 | (add-to-list 'load-path "~/projects/el-get/") 16 | (require 'el-get) 17 | (setq el-get-byte-compile nil) 18 | (setq el-get-recipe-path '("~/projects/el-get/recipes/")) 19 | (setq el-get-sources '(magit psvn org-mode auctex scala-mode 20 | distel bbdb ess emacs-jabber ahg doxymacs 21 | emacs-w3m geiser planner remember 22 | xml-rpc-el n3-mode yasnippet 23 | android-mode elein json tuareg-mode 24 | htmlize cmake-mode quack 25 | js2-mode oddmuse markdown-mode 26 | graphviz-dot-mode google-contacts 27 | ghc-mod auto-complete auto-complete-clang 28 | auto-complete-emacs-lisp auto-complete-latex 29 | auto-complete-css auto-complete-etags 30 | rainbow-mode go-mode rainbow-delimiters 31 | clojure-mode cider ac-nrepl smartparens paredit 32 | )) 33 | (el-get 'sync) 34 | 35 | ;;(el-get-update-all) 36 | 37 | ;; add commonly used paths 38 | (push "~/emacs/misc" load-path) 39 | (push "~/projects/emacs-addons" load-path) 40 | (push "~/emacs/programming" load-path) 41 | 42 | ;; load concrete packages 43 | (load "~/emacs/rc/emacs-rc-mule.el") 44 | (load "~/emacs/rc/emacs-rc-misc-things.el") 45 | (load "~/emacs/rc/emacs-rc-common-hooks.el") 46 | (load "~/emacs/rc/emacs-rc-decor.el") 47 | (load "~/emacs/rc/emacs-rc-kbd.el") 48 | (load "~/emacs/rc/emacs-rc-info.el") 49 | (load "~/emacs/rc/emacs-rc-osd.el") 50 | (load "~/emacs/rc/emacs-rc-yasnippet.el") 51 | (load "~/emacs/rc/emacs-rc-autocomplete.el") 52 | ;; TODOs, etc. 53 | (load "~/emacs/rc/emacs-rc-remember.el") 54 | (load "~/emacs/rc/emacs-rc-org-mode.el") 55 | ;; text editing 56 | (load "~/emacs/rc/emacs-rc-ispell.el") 57 | (load "~/emacs/rc/emacs-rc-muse.el") 58 | (load "~/emacs/rc/emacs-rc-tex.el") 59 | (load "~/emacs/rc/emacs-rc-nxml.el") 60 | (load "~/emacs/rc/emacs-rc-html.el") 61 | (load "~/emacs/rc/emacs-rc-wikis.el") 62 | ;; programming tools & languages 63 | (load "~/emacs/rc/emacs-rc-prog-misc.el") 64 | (load "~/emacs/rc/emacs-rc-flymake.el") 65 | (load "~/emacs/rc/emacs-rc-gdb.el") 66 | (load "~/emacs/rc/emacs-rc-ccmode.el") 67 | (load "~/emacs/rc/emacs-rc-python.el") 68 | (load "~/emacs/rc/emacs-rc-doxygen.el") 69 | (load "~/emacs/rc/emacs-rc-elisp.el") 70 | (load "~/emacs/rc/emacs-rc-ecb.el") 71 | (load "~/emacs/rc/emacs-rc-prolog.el") 72 | (load "~/emacs/rc/emacs-rc-javascript.el") 73 | (load "~/emacs/rc/emacs-rc-css.el") 74 | (load "~/emacs/rc/emacs-rc-scheme.el") 75 | (load "~/emacs/rc/emacs-rc-go.el") 76 | ;;(load "~/emacs/rc/emacs-rc-ocaml.el") 77 | (load "~/emacs/rc/emacs-rc-lisp.el") 78 | (load "~/emacs/rc/emacs-rc-clojure.el") 79 | ;;(load "~/emacs/rc/emacs-rc-slime.el") 80 | (load "~/emacs/rc/emacs-rc-haskell.el") 81 | (load "~/emacs/rc/emacs-rc-scala.el") 82 | (load "~/emacs/rc/emacs-rc-sh-mode.el") 83 | (load "~/emacs/rc/emacs-rc-auto-insert.el") 84 | (load "~/emacs/rc/emacs-rc-cmake.el") 85 | (load "~/emacs/rc/emacs-rc-distel.el") 86 | (load "~/emacs/rc/emacs-rc-octave.el") 87 | ;; 88 | ;; VCS & DVCS 89 | (load "~/emacs/rc/emacs-rc-mercurial.el") 90 | ;;(load "~/emacs/rc/emacs-rc-dvc.el") 91 | (load "~/emacs/rc/emacs-rc-git.el") 92 | (load "~/emacs/rc/emacs-rc-vcs-misc.el") 93 | ;; 94 | ;; WWW, IM, social networking & blogging 95 | ;;(load "~/emacs/rc/emacs-rc-twitter.el") 96 | (load "~/emacs/rc/emacs-rc-jabber.el") 97 | (load "~/emacs/rc/emacs-rc-w3.el") 98 | ;(load "~/emacs/rc/emacs-rc-erc.el") 99 | (load "~/emacs/rc/emacs-rc-w3m.el") 100 | ;;(load "~/emacs/rc/emacs-rc-eblogger.el") 101 | ;;(load "~/emacs/rc/emacs-rc-lj.el") 102 | ;; 103 | (load "~/emacs/rc/emacs-rc-epg.el") 104 | (load "~/emacs/rc/emacs-rc-server.el") 105 | (load "~/emacs/rc/emacs-rc-ess.el") 106 | (load "~/emacs/rc/emacs-rc-pretty-lambda.el") 107 | (load "~/emacs/rc/emacs-rc-sdcv.el") 108 | (load "~/emacs/rc/emacs-rc-iswitchb.el") 109 | 110 | ;;(load "~/emacs/rc/emacs-rc-timeclock.el") 111 | ;;(load "~/emacs/rc/emacs-rc-autocomplete.el") 112 | ;;(load "~/emacs/rc/emacs-rc-gclient.el") 113 | ;; (load "~/emacs/rc/emacs-rc-.el") 114 | ;; (load "~/emacs/rc/emacs-rc-.el") 115 | 116 | (defun alexott/get-short-hostname () 117 | (let* ((sys-name (system-name)) 118 | (idx (string-match "\\." sys-name))) 119 | (if idx 120 | (substring sys-name 0 idx) 121 | sys-name))) 122 | 123 | (let* ((fname (concat "~/emacs/rc/emacs-rc-local-" (alexott/get-short-hostname) ".el"))) 124 | (when (file-exists-p fname) 125 | (load fname))) 126 | 127 | (load "~/emacs/rc/emacs-rc-desktop.el") 128 | 129 | (load "~/emacs/passwords.el.gpg") 130 | 131 | (load custom-file 'noerror) 132 | 133 | ;; for org-mode 134 | (setq comment-start nil) 135 | 136 | ;; for emacs-jabber 137 | (define-key ctl-x-map "\C-j" jabber-global-keymap) 138 | -------------------------------------------------------------------------------- /rc/emacs-rc-cedet.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-cedet.el --- 2 | 3 | (load-file "~/projects/cedet-bzr/cedet-devel-load.el") 4 | (load-file "~/projects/cedet-bzr/contrib/cedet-contrib-load.el") 5 | ;;(add-to-list 'load-path "~/projects/cedet-bzr/contrib/") 6 | (add-to-list 'Info-directory-list "~/projects/cedet-bzr/doc/info") 7 | 8 | (add-to-list 'semantic-default-submodes 'global-semanticdb-minor-mode) 9 | (add-to-list 'semantic-default-submodes 'global-semantic-mru-bookmark-mode) 10 | (add-to-list 'semantic-default-submodes 'global-semanticdb-minor-mode) 11 | (add-to-list 'semantic-default-submodes 'global-semantic-idle-scheduler-mode) 12 | ;(add-to-list 'semantic-default-submodes 'global-semantic-stickyfunc-mode) 13 | (add-to-list 'semantic-default-submodes 'global-cedet-m3-minor-mode) 14 | (add-to-list 'semantic-default-submodes 'global-semantic-highlight-func-mode) 15 | ;;(add-to-list 'semantic-default-submodes 'global-semantic-show-unmatched-syntax-mode) 16 | ;;(add-to-list 'semantic-default-submodes 'global-semantic-highlight-edits-mode) 17 | ;;(add-to-list 'semantic-default-submodes 'global-semantic-show-parser-state-mode) 18 | 19 | ;; Activate semantic 20 | (semantic-mode 1) 21 | 22 | (require 'semantic/bovine/c) 23 | (require 'semantic/bovine/clang) 24 | 25 | (require 'cedet-files) 26 | 27 | ;; loading contrib... 28 | (require 'eassist) 29 | 30 | ;; customisation of modes 31 | (defun alexott/cedet-hook () 32 | (local-set-key [(control return)] 'semantic-ia-complete-symbol-menu) 33 | (local-set-key "\C-c?" 'semantic-ia-complete-symbol) 34 | ;; 35 | (local-set-key "\C-c>" 'semantic-complete-analyze-inline) 36 | (local-set-key "\C-c=" 'semantic-decoration-include-visit) 37 | 38 | (local-set-key "\C-cj" 'semantic-ia-fast-jump) 39 | (local-set-key "\C-cq" 'semantic-ia-show-doc) 40 | (local-set-key "\C-cs" 'semantic-ia-show-summary) 41 | (local-set-key "\C-cp" 'semantic-analyze-proto-impl-toggle) 42 | ;; (local-set-key (kbd "C-c ") 'semantic-tag-folding-fold-block) 43 | ;; (local-set-key (kbd "C-c ") 'semantic-tag-folding-show-block) 44 | 45 | (add-to-list 'ac-sources 'ac-source-semantic) 46 | ) 47 | ;; (add-hook 'semantic-init-hooks 'alexott/cedet-hook) 48 | (add-hook 'c-mode-common-hook 'alexott/cedet-hook) 49 | (add-hook 'lisp-mode-hook 'alexott/cedet-hook) 50 | (add-hook 'scheme-mode-hook 'alexott/cedet-hook) 51 | (add-hook 'emacs-lisp-mode-hook 'alexott/cedet-hook) 52 | (add-hook 'erlang-mode-hook 'alexott/cedet-hook) 53 | 54 | (defun alexott/c-mode-cedet-hook () 55 | ;; (local-set-key "." 'semantic-complete-self-insert) 56 | ;; (local-set-key ">" 'semantic-complete-self-insert) 57 | (local-set-key "\C-ct" 'eassist-switch-h-cpp) 58 | (local-set-key "\C-xt" 'eassist-switch-h-cpp) 59 | (local-set-key "\C-ce" 'eassist-list-methods) 60 | (local-set-key "\C-c\C-r" 'semantic-symref) 61 | 62 | (add-to-list 'ac-sources 'ac-source-gtags) 63 | ) 64 | (add-hook 'c-mode-common-hook 'alexott/c-mode-cedet-hook) 65 | 66 | (when (cedet-gnu-global-version-check t) 67 | (semanticdb-enable-gnu-global-databases 'c-mode t) 68 | (semanticdb-enable-gnu-global-databases 'c++-mode t)) 69 | 70 | (when (cedet-ectag-version-check t) 71 | (semantic-load-enable-primary-ectags-support)) 72 | 73 | ;; SRecode 74 | (global-srecode-minor-mode 1) 75 | 76 | ;; EDE 77 | (global-ede-mode 1) 78 | (ede-enable-generic-projects) 79 | 80 | ;; helper for boost setup... 81 | (defun c++-setup-boost (boost-root) 82 | (when (file-accessible-directory-p boost-root) 83 | (let ((cfiles (cedet-files-list-recursively boost-root "\\(config\\|user\\)\\.hpp"))) 84 | (dolist (file cfiles) 85 | (add-to-list 'semantic-lex-c-preprocessor-symbol-file file))))) 86 | 87 | 88 | ;; my functions for EDE 89 | (defun alexott/ede-get-local-var (fname var) 90 | "fetch given variable var from :local-variables of project of file fname" 91 | (let* ((current-dir (file-name-directory fname)) 92 | (prj (ede-current-project current-dir))) 93 | (when prj 94 | (let* ((ov (oref prj local-variables)) 95 | (lst (assoc var ov))) 96 | (when lst 97 | (cdr lst)))))) 98 | 99 | ;; setup compile package 100 | (require 'compile) 101 | (setq compilation-disable-input nil) 102 | (setq compilation-scroll-output t) 103 | (setq mode-compile-always-save-buffer-p t) 104 | 105 | (defun alexott/compile () 106 | "Saves all unsaved buffers, and runs 'compile'." 107 | (interactive) 108 | (save-some-buffers t) 109 | (let* ((fname (or (buffer-file-name (current-buffer)) default-directory)) 110 | (current-dir (file-name-directory fname)) 111 | (prj (ede-current-project current-dir))) 112 | (if prj 113 | (project-compile-project prj) 114 | (compile compile-command)))) 115 | (global-set-key [f9] 'alexott/compile) 116 | 117 | ;; 118 | (defun alexott/gen-std-compile-string () 119 | "Generates compile string for compiling CMake project in debug mode" 120 | (let* ((current-dir (file-name-directory 121 | (or (buffer-file-name (current-buffer)) default-directory))) 122 | (prj (ede-current-project current-dir)) 123 | (root-dir (ede-project-root-directory prj))) 124 | (concat "cd " root-dir "; make -j2"))) 125 | 126 | ;; 127 | (defun alexott/gen-cmake-debug-compile-string () 128 | "Generates compile string for compiling CMake project in debug mode" 129 | (let* ((current-dir (file-name-directory 130 | (or (buffer-file-name (current-buffer)) default-directory))) 131 | (prj (ede-current-project current-dir)) 132 | (root-dir (ede-project-root-directory prj)) 133 | (subdir "") 134 | ) 135 | (when (string-match root-dir current-dir) 136 | (setf subdir (substring current-dir (match-end 0)))) 137 | (concat "cd " root-dir "Debug/" "; make -j3"))) 138 | 139 | ;;; Projects 140 | 141 | ;; cpp-tests project definition 142 | (when (file-exists-p "~/projects/lang-exp/cpp/CMakeLists.txt") 143 | (setq cpp-tests-project 144 | (ede-cpp-root-project "cpp-tests" 145 | :file "~/projects/lang-exp/cpp/CMakeLists.txt" 146 | :system-include-path '("/home/ott/exp/include" 147 | boost-base-directory) 148 | :compile-command "cd Debug && make -j2" 149 | ))) 150 | 151 | (when (file-exists-p "~/projects/squid-gsb/README") 152 | (setq squid-gsb-project 153 | (ede-cpp-root-project "squid-gsb" 154 | :file "~/projects/squid-gsb/README" 155 | :system-include-path '("/home/ott/exp/include" 156 | boost-base-directory) 157 | :compile-command "cd Debug && make -j2" 158 | ))) 159 | 160 | ;; Setup JAVA.... 161 | (require 'semantic/db-javap) 162 | 163 | ;; example of java-root project 164 | 165 | ;; (ede-ant-project "Lucene" 166 | ;; :file "~/work/lucene-solr/lucene-4.0.0/build.xml" 167 | ;; :srcroot '("core/src") 168 | ;; :classpath (cedet-files-list-recursively "~/work/lucene-solr/lucene-4.0.0/" ".*\.jar$") 169 | ;; ) 170 | -------------------------------------------------------------------------------- /.gnus: -------------------------------------------------------------------------------- 1 | ;;;; -*- mode: emacs-lisp -*- 2 | ;; 3 | ;; GNUS Customization 4 | ;; Alex Ott 5 | ;; 6 | 7 | (require 'gnus-setup) 8 | (require 'gnus-art) 9 | (require 'gnus-cite) 10 | 11 | ;; setting for sending mail via smtp-server 12 | (setq send-mail-function 'smtpmail-send-it 13 | message-send-mail-function 'smtpmail-send-it 14 | smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil)) 15 | smtpmail-default-smtp-server "smtp.gmail.com" 16 | smtpmail-smtp-server "smtp.gmail.com" 17 | smtpmail-smtp-service 587 18 | smtpmail-debug-info t 19 | starttls-use-gnutls t) 20 | (require 'starttls) 21 | (require 'smtpmail) 22 | 23 | 24 | ;; Gnus Mail setup 25 | (setq gnus-secondary-select-methods 26 | '((nnimap "gmail" 27 | (nnimap-address "imap.gmail.com") 28 | (nnimap-server-port 993) 29 | (nnimap-stream ssl) 30 | (nnimap-expunge-on-close always) 31 | ;; (nnmail-expiry-target "nnimap+gmail:[Gmail]/Trash") 32 | ;; (nnmail-expiry-wait immediate) 33 | ) 34 | (nnml ""))) 35 | 36 | ;; (setq gnus-parameters '(("^nntp.*" 37 | ;; (gnus-fetch-old-headers t)) 38 | ;; ("^nnimap.*" 39 | ;; (gnus-fetch-old-headers t)))) 40 | 41 | (setq gnus-posting-styles '((".*" 42 | (Gcc "nnml:sent") 43 | (Organization "Alex Ott's Consulting") 44 | (signature-file "~/.signature")))) 45 | 46 | ;; Moving mails to trash in google mail 47 | (setq gdt-trash-newsgroup "nnimap+gmail:[Gmail]/Trash") 48 | (defun gdt-gnus-move-to-trash () 49 | (interactive) 50 | (gnus-summary-move-article nil gdt-trash-newsgroup)) 51 | 52 | (add-hook 'gnus-summary-mode-hook 53 | (lambda () 54 | (local-set-key "D" 'gdt-gnus-move-to-trash))) 55 | 56 | ;; Mail decoding 57 | (eval-after-load "mm-decode" 58 | '(progn 59 | (add-to-list 'mm-discouraged-alternatives "text/html") 60 | (add-to-list 'mm-discouraged-alternatives "text/richtext"))) 61 | 62 | ;; Hooks 63 | (defun alexott/message-mode-hook () 64 | (auto-fill-mode t) 65 | (font-lock-mode t) 66 | (abbrev-mode t) 67 | (setq fill-column 75) 68 | (orgstruct++-mode 1) 69 | (flyspell-mode 1)) 70 | (add-hook 'message-mode-hook 'alexott/message-mode-hook) 71 | 72 | (defun alexott/mime/editor-mode-hook () 73 | ;; (put-alist 'koi8-r nil 74 | ;; mime-editor/charset-default-encoding-alist) 75 | (put-alist "Subject" nil mime/field-encoding-method-alist) 76 | (put-alist "To" nil mime/field-encoding-method-alist)) 77 | (add-hook 'mime/editor-mode-hook 'alexott/mime/editor-mode-hook) 78 | 79 | (defun alexott/gnus-article-display-hook () 80 | (gnus-article-highlight) 81 | (gnus-article-hide-headers-if-wanted) 82 | (setq gnus-visible-headers 83 | '("^From:" "^X-Comment-To:" "^Comment-To:" "^Subject:" "^Date:" 84 | "^Followup-To:" "^Reply-To:" "^Organization:" "^Summary:" 85 | "^Keywords:" "^To:" "^Cc:" "^Posted-To:" "^Mail-Copies-To:" 86 | "^Apparently-To:" "^Gnus-Warning:" "^Resent-From" "^Bcc:" )) 87 | (article-emphasize)) 88 | (add-hook 'gnus-article-display-hook 'alexott/gnus-article-display-hook) 89 | 90 | (defun alexott/gnus-summary-mode-hook () 91 | ;; (local-set-key [tab] 'gnus-summary-next-unread-article) 92 | (save-excursion 93 | (goto-char (point-min)))) 94 | (add-hook 'gnus-summary-mode-hook 'alexott/gnus-summary-mode-hook) 95 | 96 | ;; automatic import of ical notice 97 | ;;(add-hook 'gnus-article-prepare-hook 'icalendar-import-buffer) 98 | 99 | ;; remove automatic total expire hook 100 | (remove-hook 'gnus-summary-prepare-exit-hook 101 | 'gnus-summary-expire-articles) 102 | (add-hook 'gnus-exit-gnus-hook 103 | 'gnus-group-expire-all-groups) 104 | 105 | ;; Sorting 106 | (setq gnus-article-sort-functions '(gnus-article-sort-by-number 107 | gnus-article-sort-by-subject 108 | gnus-article-sort-by-date)) 109 | 110 | (setq gnus-thread-sort-functions '(gnus-thread-sort-by-number 111 | gnus-thread-sort-by-subject 112 | gnus-thread-sort-by-total-score 113 | gnus-thread-sort-by-date)) 114 | 115 | ;; ;; Set format of group description 116 | (setq gnus-group-line-format "%M\%S\%p\%5y: %g\n") 117 | 118 | ;; ;; Topic-Mode 119 | (add-hook 'gnus-group-mode-hook 'gnus-topic-mode) 120 | (setq gnus-topic-line-format "%i%3A: %(%{%n%}%)%v\n") 121 | 122 | ;; ;; fix summary mode error 123 | ;; (copy-face 'default 'mythreads) 124 | ;; (set-face-foreground 'mythreads "blue") 125 | ;; (setq gnus-face-3 'mythreads) 126 | 127 | ;; (copy-face 'default 'mybiggernumbers) 128 | ;; (set-face-foreground 'mybiggernumbers "indianred4") 129 | ;; (setq gnus-face-6 'mybiggernumbers) 130 | (setq gnus-summary-line-format "%U%R%z%I%(%[%4L: %-23,23n%]%) %s\n") 131 | 132 | ;; Fetch headers for old articles in current thread 133 | (setq gnus-fetch-old-headers '500) 134 | 135 | (setq rfc2047-header-encoding-alist 136 | '(("Newsgroups" . nil) 137 | ("Message-ID" . nil) 138 | ("Subject" . mime) 139 | ("From" . default) 140 | ("To" . default) 141 | (t . mime))) 142 | 143 | (setq mm-body-charset-encoding-alist 144 | '((windows-1251 . 8bit) 145 | (koi8-r . 8bit))) 146 | 147 | (setq news-reply-header-hook nil) 148 | 149 | ;; 150 | (setq gnus-gcc-mark-as-read t 151 | nntp-marks-is-evil nil 152 | nnml-marks-is-evil nil 153 | gnus-show-mime t 154 | gnus-show-mime-method 'gnus-article-preview-mime-message 155 | gnus-expert-user t 156 | gnus-suppress-duplicates t 157 | gnus-confirm-mail-reply-to-news t 158 | gnus-ignored-newsgroups "" 159 | nnml-get-new-mail t 160 | gnus-add-to-list t 161 | gnus-large-newsgroup nil 162 | gnus-inhibit-startup-message t 163 | gnus-read-active-file nil 164 | gnus-check-new-newsgroups 'ask-server 165 | gnus-use-sc t 166 | gnus-select-method '(nnnil "") 167 | mail-signature t 168 | ;; default-mime-charset 'koi8-r 169 | ;; message-default-charset 'koi8-r 170 | gnus-strict-mime t 171 | mime-editor/transfer-level 8 172 | mime-editor/transfer-level-string "8bit" 173 | gnus-novice-user nil 174 | gnus-auto-select-next nil 175 | gnus-cite-minimum-match-count 1 176 | ) 177 | 178 | (custom-set-variables 179 | '(gnus-activate-level 3) 180 | '(gnus-agent nil) 181 | '(gnus-agent-cache nil) 182 | '(gnus-asynchronous t) 183 | '(gnus-use-header-prefetch t) 184 | ;; '(gnus-default-charset (quote koi8-r)) 185 | ;; '(gnus-default-posting-charset (quote koi8-r)) 186 | ;; '(gnus-newsgroup-charset (quote koi8-r) t) 187 | '(gnus-expert-user nil) 188 | '(gnus-group-name-charset-group-alist nil) 189 | '(gnus-group-name-charset-method-alist (quote (("nil" . koi8-r)))) 190 | '(gnus-newsgroup-ignored-charsets (quote (unknown-8bit x-unknown koi8-u))) 191 | '(gnus-summary-ignore-duplicates t) 192 | '(gnus-use-cache (quote passive)) 193 | '(mail-source-delete-incoming t) 194 | '(message-send-mail-function (quote smtpmail-send-it)) 195 | '(message-send-mail-partially-limit 3000000) 196 | '(mm-default-directory "~/") 197 | '(mm-inline-text-html-with-images t) 198 | '(mm-discouraged-alternatives nil) 199 | '(mm-w3m-safe-url-regexp nil) 200 | '(mm-text-html-renderer (quote w3m)) 201 | '(nnimap-split-rule nil) 202 | '(nnmail-crosspost nil) 203 | '(message-send-mail-partially-limit nil)) 204 | 205 | ;; gnus daemon settings 206 | ;;(gnus-demon-add-handler 'gnus-demon-scan-mail 20 10) 207 | ;;(gnus-demon-add-handler 'gnus-demon-scan-news 60 nil) 208 | ;;(gnus-demon-add-scanmail) 209 | ;;(setq gnus-use-demon t) 210 | ;;(gnus-demon-init) 211 | 212 | 213 | 214 | 215 | ;; load auxiliary packages 216 | (load "~/emacs/rc/emacs-rc-bbdb.el") 217 | (load "~/emacs/rc/emacs-rc-mailcrypt.el") 218 | (load "~/emacs/rc/emacs-rc-supercite.el") 219 | 220 | ;;(load (concat "~/emacs/rc/emacs-rc-gnus-" (system-name) ".el")) 221 | 222 | ;; to work faster 223 | (gnus-compile) 224 | 225 | 226 | 227 | -------------------------------------------------------------------------------- /rc/emacs-rc-cedet-old.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-cedet.el --- 2 | 3 | ;; Copyright (C) 2003 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | (add-to-list 'load-path "~/projects/cedet-git/common/") 11 | (load-file "~/projects/cedet-git/common/cedet.el") 12 | 13 | (semantic-load-enable-excessive-code-helpers) 14 | ;;(semantic-load-enable-semantic-debugging-helpers) 15 | 16 | (custom-set-variables 17 | '(semantic-idle-scheduler-idle-time 3) 18 | '(semantic-self-insert-show-completion-function (lambda nil (semantic-ia-complete-symbol-menu (point)))) 19 | '(global-semantic-tag-folding-mode t nil (semantic-util-modes))) 20 | 21 | (setq senator-minor-mode-name "SN") 22 | (setq semantic-imenu-auto-rebuild-directory-indexes nil) 23 | (global-srecode-minor-mode 1) 24 | (global-semantic-mru-bookmark-mode 1) 25 | (global-semantic-folding-mode 1) 26 | 27 | 28 | (require 'semantic-decorate-include) 29 | 30 | ;; gcc setup 31 | (require 'semantic-gcc) 32 | 33 | ;; smart complitions 34 | (require 'semantic-ia) 35 | 36 | (setq-mode-local c-mode semanticdb-find-default-throttle 37 | '(project unloaded system recursive)) 38 | (setq-mode-local c++-mode semanticdb-find-default-throttle 39 | '(project unloaded system recursive)) 40 | (setq-mode-local erlang-mode semanticdb-find-default-throttle 41 | '(project unloaded system recursive)) 42 | 43 | (require 'eassist) 44 | 45 | ;; customisation of modes 46 | (defun alexott/cedet-hook () 47 | (local-set-key [(control return)] 'semantic-ia-complete-symbol-menu) 48 | (local-set-key "\C-c?" 'semantic-ia-complete-symbol) 49 | ;; 50 | (local-set-key "\C-c>" 'semantic-complete-analyze-inline) 51 | (local-set-key "\C-c=" 'semantic-decoration-include-visit) 52 | 53 | (local-set-key "\C-cj" 'semantic-ia-fast-jump) 54 | (local-set-key "\C-cq" 'semantic-ia-show-doc) 55 | (local-set-key "\C-cs" 'semantic-ia-show-summary) 56 | (local-set-key "\C-cp" 'semantic-analyze-proto-impl-toggle) 57 | (local-set-key (kbd "C-c ") 'semantic-tag-folding-fold-block) 58 | (local-set-key (kbd "C-c ") 'semantic-tag-folding-show-block) 59 | ) 60 | ;; (add-hook 'semantic-init-hooks 'alexott/cedet-hook) 61 | (add-hook 'c-mode-common-hook 'alexott/cedet-hook) 62 | (add-hook 'lisp-mode-hook 'alexott/cedet-hook) 63 | (add-hook 'scheme-mode-hook 'alexott/cedet-hook) 64 | (add-hook 'emacs-lisp-mode-hook 'alexott/cedet-hook) 65 | (add-hook 'erlang-mode-hook 'alexott/cedet-hook) 66 | 67 | (defun alexott/c-mode-cedet-hook () 68 | ;; (local-set-key "." 'semantic-complete-self-insert) 69 | ;; (local-set-key ">" 'semantic-complete-self-insert) 70 | (local-set-key "\C-ct" 'eassist-switch-h-cpp) 71 | (local-set-key "\C-xt" 'eassist-switch-h-cpp) 72 | (local-set-key "\C-ce" 'eassist-list-methods) 73 | (local-set-key "\C-c\C-r" 'semantic-symref) 74 | ) 75 | (add-hook 'c-mode-common-hook 'alexott/c-mode-cedet-hook) 76 | 77 | ;; hooks, specific for semantic 78 | (defun alexott/semantic-hook () 79 | ;; (semantic-tag-folding-mode 1) 80 | (imenu-add-to-menubar "TAGS") 81 | ) 82 | (add-hook 'semantic-init-hooks 'alexott/semantic-hook) 83 | 84 | ;; gnu global support 85 | (when (cedet-gnu-global-version-check t) 86 | (require 'semanticdb-global) 87 | (semanticdb-enable-gnu-global-databases 'c-mode) 88 | (semanticdb-enable-gnu-global-databases 'c++-mode)) 89 | 90 | ;; ctags 91 | (when (cedet-ectag-version-check t) 92 | (require 'semanticdb-ectag) 93 | (semantic-load-enable-primary-exuberent-ctags-support)) 94 | 95 | ;; 96 | (semantic-add-system-include "~/exp/include" 'c++-mode) 97 | (semantic-add-system-include "~/exp/include" 'c-mode) 98 | 99 | (defun recur-list-files (dir re) 100 | "Returns list of files in directory matching to given regex" 101 | (when (file-accessible-directory-p dir) 102 | (let ((files (directory-files dir t)) 103 | matched) 104 | (dolist (file files matched) 105 | (let ((fname (file-name-nondirectory file))) 106 | (cond 107 | ((or (string= fname ".") 108 | (string= fname "..")) nil) 109 | ((and (file-regular-p file) 110 | (string-match re fname)) 111 | (setq matched (cons file matched))) 112 | ((file-directory-p file) 113 | (let ((tfiles (recur-list-files file re))) 114 | (when tfiles (setq matched (append matched tfiles))))))))))) 115 | 116 | (defun c++-setup-boost (boost-root) 117 | (when (file-accessible-directory-p boost-root) 118 | (let ((cfiles (recur-list-files boost-root "\\(config\\|user\\)\\.hpp"))) 119 | (dolist (file cfiles) 120 | (add-to-list 'semantic-lex-c-preprocessor-symbol-file file))))) 121 | 122 | 123 | ;; 124 | ;;(global-semantic-idle-tag-highlight-mode 1) 125 | 126 | ;;; ede customization 127 | (require 'semantic-lex-spp) 128 | (global-ede-mode t) 129 | (ede-enable-generic-projects) 130 | 131 | ;; maven-based projects 132 | ;;(ede-maven2-project "clojure-hadoop" :file "~/projects/clojure-hadoop/pom.xml") 133 | 134 | ;; cpp-tests project definition 135 | (when (file-exists-p "~/projects/lang-exp/cpp/CMakeLists.txt") 136 | (setq cpp-tests-project 137 | (ede-cpp-root-project "cpp-tests" 138 | :file "~/projects/lang-exp/cpp/CMakeLists.txt" 139 | :system-include-path '("/home/ott/exp/include" 140 | boost-base-directory) 141 | :local-variables (list 142 | (cons 'compile-command 'alexott/gen-cmake-debug-compile-string) 143 | ) 144 | ))) 145 | 146 | (when (file-exists-p "~/projects/squid-gsb/README") 147 | (setq squid-gsb-project 148 | (ede-cpp-root-project "squid-gsb" 149 | :file "~/projects/squid-gsb/README" 150 | :system-include-path '("/home/ott/exp/include" 151 | boost-base-directory) 152 | :local-variables (list 153 | (cons 'compile-command 'alexott/gen-cmake-debug-compile-string) 154 | ) 155 | ))) 156 | 157 | (when (file-exists-p "~/work/emacs-head/README") 158 | (setq emacs-project 159 | (ede-emacs-project "emacs-head" 160 | :file "~/work/emacs-head/README"))) 161 | 162 | ;; (setq arabica-project 163 | ;; (ede-cpp-root-project "arabica" 164 | ;; :file "~/projects/arabica-devel/README" 165 | ;; :system-include-path '("/home/ott/exp/include" 166 | ;; boost-base-directory) 167 | ;; :local-variables (list 168 | ;; (cons 'compile-command 'alexott/gen-std-compile-string) 169 | ;; ) 170 | ;; )) 171 | 172 | ;; my functions for EDE 173 | (defun alexott/ede-get-local-var (fname var) 174 | "fetch given variable var from :local-variables of project of file fname" 175 | (let* ((current-dir (file-name-directory fname)) 176 | (prj (ede-current-project current-dir))) 177 | (when prj 178 | (let* ((ov (oref prj local-variables)) 179 | (lst (assoc var ov))) 180 | (when lst 181 | (cdr lst)))))) 182 | 183 | ;; setup compile package 184 | ;; TODO: allow to specify function as compile-command 185 | (require 'compile) 186 | (setq compilation-disable-input nil) 187 | (setq compilation-scroll-output t) 188 | (setq mode-compile-always-save-buffer-p t) 189 | 190 | (defun alexott/compile () 191 | "Saves all unsaved buffers, and runs 'compile'." 192 | (interactive) 193 | (save-some-buffers t) 194 | (let* ((r (alexott/ede-get-local-var 195 | (or (buffer-file-name (current-buffer)) default-directory) 196 | 'compile-command)) 197 | (cmd (if (functionp r) (funcall r) r))) 198 | ;; (message "AA: %s" cmd) 199 | (set (make-local-variable 'compile-command) (or cmd compile-command)) 200 | (compile compile-command))) 201 | 202 | (global-set-key [f9] 'alexott/compile) 203 | 204 | ;; 205 | (defun alexott/gen-std-compile-string () 206 | "Generates compile string for compiling CMake project in debug mode" 207 | (let* ((current-dir (file-name-directory 208 | (or (buffer-file-name (current-buffer)) default-directory))) 209 | (prj (ede-current-project current-dir)) 210 | (root-dir (ede-project-root-directory prj)) 211 | ) 212 | (concat "cd " root-dir "; make -j2"))) 213 | 214 | ;; 215 | (defun alexott/gen-cmake-debug-compile-string () 216 | "Generates compile string for compiling CMake project in debug mode" 217 | (let* ((current-dir (file-name-directory 218 | (or (buffer-file-name (current-buffer)) default-directory))) 219 | (prj (ede-current-project current-dir)) 220 | (root-dir (ede-project-root-directory prj)) 221 | (subdir "") 222 | ) 223 | (when (string-match root-dir current-dir) 224 | (setf subdir (substring current-dir (match-end 0)))) 225 | (concat "cd " root-dir "Debug/" "; make -j3"))) 226 | 227 | (defun alexott/gen-cmake-debug/release-compile-string () 228 | "Generates compile string for compiling CMake project in debug & release modes" 229 | (let* ((current-dir (file-name-directory 230 | (or (buffer-file-name (current-buffer)) default-directory))) 231 | (prj (ede-current-project current-dir)) 232 | (root-dir (ede-project-root-directory prj)) 233 | (subdir "") 234 | ) 235 | (when (string-match root-dir current-dir) 236 | (setf subdir (substring current-dir (match-end 0)))) 237 | (concat "cd " root-dir "Debug/ && make -j3 && cd " root-dir "Release/ && make -j3" ))) 238 | 239 | ;; clang setup 240 | (require 'semantic-clang) 241 | 242 | ;;; emacs-rc-cedet.el ends here 243 | 244 | -------------------------------------------------------------------------------- /rc/emacs-rc-muse.el: -------------------------------------------------------------------------------- 1 | ;;; emacs-rc-muse.el --- -*- coding: utf-8 -*- 2 | 3 | ;; Copyright (C) 2006 Alex Ott 4 | ;; 5 | ;; Author: alexott@gmail.com 6 | ;; Keywords: 7 | ;; Requirements: 8 | ;; Status: not intended to be distributed yet 9 | 10 | (add-to-list 'load-path "~/projects/muse.el/lisp") 11 | ;;(add-to-list 'load-path "~/emacs/planner") 12 | ;;(add-to-list 'load-path "~/emacs/remember") 13 | 14 | (require 'muse-mode) ; load authoring mode 15 | (require 'muse-html) ; load publishing styles I use 16 | (require 'muse-colors) 17 | (require 'muse-wiki) 18 | (require 'muse-latex) 19 | (require 'muse-texinfo) 20 | (require 'muse-docbook) 21 | (require 'muse-project) 22 | 23 | (muse-derive-style "my-page-html" "html" 24 | :header "~/Dropbox/my-page-muse/header.tmpl" 25 | :footer "~/Dropbox/my-page-muse/footer.tmpl") 26 | 27 | (muse-derive-style "my-page-pdf" "pdf" 28 | :header "~/Dropbox/my-page-muse/header.tex" 29 | :footer "~/Dropbox/my-page-muse/footer.tex") 30 | 31 | (muse-derive-style "fp-journal-tex" "latex" 32 | :header "~/projects/Muse/FP-Journal/header.tex" 33 | :footer "~/projects/Muse/FP-Journal/footer.tex") 34 | 35 | (muse-derive-style "fp-journal-pdf" "pdf" 36 | :header "~/projects/Muse/FP-Journal/header.tex" 37 | :footer "~/projects/Muse/FP-Journal/footer.tex") 38 | 39 | (muse-derive-style "my-presentations" "slides" 40 | :header "~/projects/Muse/Presentations/header.tex" 41 | :footer "~/projects/Muse/Presentations/footer.tex") 42 | 43 | (muse-derive-style "emacs-guide-html" "html" 44 | :header "~/projects/emacs-guide-ru/styles/header.tmpl" 45 | :footer "~/projects/emacs-guide-ru/styles/footer.tmpl") 46 | 47 | (setq muse-project-alist 48 | `(("personal-notes" 49 | (,@(muse-project-alist-dirs "~/projects/Muse") :default "index") 50 | ,@(muse-project-alist-styles "~/projects/Muse" 51 | "~/projects/Muse" 52 | "html") 53 | (:base "fp-journal-tex" 54 | :path "~/projects/Muse/FP-Journal" 55 | :include "/FP-Journal/[^/]*.muse$") 56 | ;; (:base "fp-journal-pdf" 57 | ;; :path "~/projects/Muse/FP-Journal" 58 | ;; :include "/FP-Journal/[^/]*.muse$") 59 | (:base "my-presentations" 60 | :path "~/projects/Muse/Presentations" 61 | :include "/Presentations/[^/]*.muse$") 62 | ) 63 | ("my-page-project" 64 | (,@(muse-project-alist-dirs "~/Dropbox/my-page-muse") :default "index") 65 | ,@(muse-project-alist-styles "~/Dropbox/my-page-muse" 66 | "~/Dropbox/my-page-muse" 67 | "my-page-html") 68 | (:base "my-page-pdf" 69 | :path "~/Dropbox/my-page-muse/en" 70 | :include "/alexott-cv-en[^/]*$") 71 | (:base "my-page-pdf" 72 | :path "~/Dropbox/my-page-muse/ru" 73 | :include "/alexott-cv-ru[^/]*$")) 74 | ("emacs-guide-ru" 75 | (,@(muse-project-alist-dirs "~/projects/emacs-guide-ru") :default "index") 76 | ,@(muse-project-alist-styles "~/projects/emacs-guide-ru" 77 | "~/projects/emacs-guide-ru" 78 | "emacs-guide-html")) 79 | )) 80 | 81 | (add-to-list 'auto-mode-alist '("\\.muse$" . muse-mode)) 82 | 83 | ;;(add-to-list 'file-coding-system-alist (cons "/Muse/" 'utf-8)) 84 | (add-to-list 'file-coding-system-alist (cons "/my-page-muse/" 'utf-8)) 85 | (add-to-list 'file-coding-system-alist (cons "\\.muse$" 'utf-8)) 86 | 87 | (defun muse-gen-relative-name (name) 88 | (concat 89 | (file-name-directory (muse-wiki-resolve-project-page (muse-project))) 90 | name)) 91 | 92 | (defun muse-get-current-project-root (fname) 93 | (let ((dname (file-truename (file-name-directory fname))) 94 | (rname (file-name-directory (muse-wiki-resolve-project-page (muse-project))))) 95 | (file-truename (concat dname rname)))) 96 | 97 | (defun muse-get-file-relative-name (fname) 98 | (substring (file-truename fname) (length (muse-get-current-project-root fname)))) 99 | 100 | (custom-set-variables 101 | '(muse-html-encoding-default (quote utf-8)) 102 | '(muse-html-meta-content-encoding (quote utf-8)) 103 | '(muse-html-charset-default "utf-8") 104 | '(muse-file-extension "muse") 105 | '(muse-mode-auto-p nil) 106 | '(muse-wiki-allow-nonexistent-wikiword nil) 107 | '(muse-wiki-use-wikiword nil) 108 | '(muse-html-footer "~/emacs/muse/templates/footer.html") 109 | '(muse-html-header "~/emacs/muse/templates/header.html") 110 | '(muse-latex-footer "~/emacs/muse/templates/footer.tex") 111 | '(muse-latex-header "~/emacs/muse/templates/header.tex") 112 | '(muse-html-style-sheet 113 | " 114 | ") 115 | '(muse-ignored-extensions (quote ("bz2" "gz" "[Zz]" "rej" "orig" "png" "hgignore" "gif" 116 | "css" "jpg" "html" "sh" "lftp" "pdf"))) 117 | ) 118 | 119 | (defun alexott/muse-mode-hook () 120 | (auto-fill-mode -1) 121 | ;; (longlines-mode -1) 122 | (footnote-mode 1) 123 | ) 124 | (add-hook 'muse-mode-hook 'alexott/muse-mode-hook) 125 | (add-hook 'muse-mode-hook 'alexott/common-hook) 126 | (add-hook 'muse-mode-hook 'alexott/show-prog-keywords) 127 | (add-hook 'muse-mode-hook 'turn-on-flyspell) 128 | 129 | ;;;;; for my page 130 | 131 | ;;; variable buffer-file-name - contain name of the current buffer 132 | (setq my-page-menu '(("ru" . ( 133 | ("index.html" . "Главная") 134 | ("cf/" . "Информационная безопасность") 135 | ("fp/" . "Функциональное программирование") 136 | ("lisp/" . "Lisp") 137 | ("clojure/" . "Clojure") 138 | ("scheme/" . "Scheme") 139 | ("erlang/" . "Erlang") 140 | ("cpp/" . "C++") 141 | ("oss/" . "Open Source Projects") 142 | ("emacs/" . "Emacs") 143 | ("writings/" . "Статьи") 144 | ; ("macosx/" . "Mac OS X") 145 | ;;; ("" . "") 146 | )) 147 | ("en" . ( 148 | ("index.html" . "Main") 149 | ("fp/" . "Functional programming") 150 | ("clojure/" . "Clojure") 151 | ("emacs/" . "Emacs") 152 | ("cf/" . "Information Security") 153 | ("cpp/" . "C++") 154 | ("oss/" . "Open Source Projects") 155 | ("writings/" . "Articles") 156 | )) 157 | )) 158 | 159 | (defun generate-change-date (file) 160 | (when (file-exists-p file) 161 | (let* ((fa (file-attributes file)) 162 | (mod-time (nth 6 fa))) 163 | (format-time-string "%d.%m.%Y %R" mod-time)))) 164 | 165 | (defun muse-mp-detect-language () 166 | (let ((lang "NN") 167 | (cur-dir (file-name-directory (muse-current-file))) 168 | ) 169 | (let ((smatch (string-match "/\\(ru\\|en\\|de\\)/" cur-dir))) 170 | (when smatch 171 | (setq lang (substring cur-dir (+ smatch 1) (+ smatch 3))))) 172 | lang)) 173 | 174 | (defun muse-mp-generate-menu () 175 | (let* ((menu-lang (muse-mp-detect-language)) 176 | (menu-struct (assoc menu-lang my-page-menu)) 177 | (menu-string "") 178 | (rel-dir (file-name-directory (muse-wiki-resolve-project-page (muse-project)))) 179 | (rel-path (if (> (length rel-dir) 2) (substring rel-dir 3) "")) 180 | (cur-path-muse (muse-current-file)) 181 | (cur-path-html (replace-regexp-in-string "\\.muse" ".html" cur-path-muse)) 182 | ) 183 | (when menu-struct 184 | (let ((menu-list (if (not (null menu-struct)) (cdr menu-struct)))) 185 | (setq menu-string 186 | (concat "
    " 187 | (apply #'concat 188 | (mapcar 189 | (lambda (x) 190 | (concat "
  • " (cdr x) "
  • ")) 196 | menu-list)) 197 | "
")))) 198 | menu-string)) 199 | 200 | 201 | ;;;;; for docbook quick-conversion 202 | 203 | (setq my-muse-docbook-replacements 204 | '( 205 | ("" . "") 206 | ("" . "") 207 | ("" . "") 208 | ("" . "") 209 | ("" . "") 210 | ("" . "") 211 | ("" . "") 212 | ("—" . " -- ") 213 | ("&EMACS;" . "Emacs") 214 | ("&GNUEMACS;" . "GNU Emacs") 215 | ("&XEMACS;" . "XEmacs") 216 | ("\\([^<]*\\)" . "\"\\1\"") 217 | ("\\([^<]*\\)" . "[[\\1][\\2]]") 218 | ("\\([^<]*\\)" . "=\\1=") 219 | ("\\([^<]*\\)" . "=\\1=") 220 | ("" . "=\\1=") 221 | ("\\([^<]*\\)" . "=\\1=") 222 | ("\\([^<]*\\)" . "*\\1*") 223 | ("\\([^<]*\\)" . "=\\1=") 224 | ("\\([^<]*\\)" . "=\\1=") 225 | ("\\([^<]*\\)" . "=\\1=") 226 | ("^\\s *]*>\\([^<]*\\)" . "* \\1") 227 | ("\\([^<]*\\)" . "*\\1*") 228 | ("\\s *\\([^<]*\\)\\s *\\([^<]*\\)\\s *" . "\\1-\\2") 229 | ("\\([^<]*\\)" . "\\1") 230 | ("\\([^<]*\\)" . "=\\1=") 231 | ("\\([^<]*\\)" . "*\\1*") 232 | ("\\([^<]*\\)" . "\\1 :: ") 233 | ;; ("<>\\([^<]*\\)" . "\\1") 234 | ;; ("<>\\([^<]*\\)" . "\\1") 235 | ("" . "") 236 | ("" . "
") 237 | ("<" . "<") ; 238 | (">" . ">") 239 | ("&" . "&") 240 | ("^\\s *" . " - ") 241 | (" " . " ") 242 | ("" . "") 243 | (""" . "\"") 244 | ;; ("" . "") 245 | ;; ("" . "") 246 | ("&PSGML;" . "*PSGML*") 247 | ("&NXML;" . "*nXML*") 248 | ("&RCS;" . "*RCS*") 249 | ("&VSS;" . "*Visual SourceSafe*") 250 | ("&CVS;" . "*CVS*") 251 | ("&MCVS;" . "*MetaCVS*") 252 | ("&SCCS;" . "*SCCS*") 253 | ("&GNUARCH;" . "*GNU Arch*") 254 | ("&BAZAAR;" . "*Bazaar*") 255 | ("&SUBVERSION;" . "*Subversion*") 256 | ("&DARCS;" . "*Darcs*") 257 | ("&CLEARCASE;" . "*ClearCase*") 258 | ("&SOURCESAFE;" . "*SourceSafe*") 259 | ("&BITKEEPER;" . "*BitKeeper*") 260 | ("&AEGIS;" . "*Aegis*") 261 | ("&PERFORCE;" . "*Perforce*") 262 | ("&MONOTONE;" . "*Monotone*") 263 | ("&GIT;" . "*Git*") 264 | ("&DVC;" . "*dvc*") 265 | ("&BAZAARNG;" . "*Bazaar-NG*") 266 | ("&MERCURIAL;" . "*Mercurial*") 267 | ("&MERCURIALEL;" . "*mercurial.el*") 268 | ("&VC;" . "*VC*") 269 | ("&DVC;" . "*DVC*") 270 | ("&P4;" . "*p4*") 271 | ("&BK;" . "*bk*") 272 | ("&CLEARCASEEL;" . "*clearcase*") 273 | ("&PCLCVS;" . "*PCL-CVS*") 274 | ("&XTLA;" . "*xtla*") 275 | ("&DARCSUM;" . "*darcsum*") 276 | ("&PSVN;" . "*PSVN*") 277 | ("&SSEL;" . "*source-safe.el*") 278 | ("&AEGISMODE;" . "*aegis-mode*") 279 | ("&MONOTONEEL;" . "*monotone.el*") 280 | ("&GITEL;" . "*git.el*") 281 | ("&ELGYACH;" . "*ElGyach*") 282 | ("&TNT;" . "*TNT*") 283 | ("&JABBEREL;" . "*Jabber.el*") 284 | ("&ERC;" . "*Erc*") 285 | ("&RCIRC;" . "*Rcirc*") 286 | ("&EDIFF;" . "*Ediff*") 287 | ("&EMERGE;" . "*Emerge*") 288 | ("&GNUS;" . "*Gnus*") 289 | ("&RMAIL;" . "*Rmail*") 290 | ("&MAILCRYPT;" . "*Mailcrypt*") 291 | ("&SUPERCITE;" . "*Supercite*") 292 | ("&AUCTEX;" . "*AUCTeX*") 293 | ("&TEXMODE;" . "*TeX-mode*") 294 | ("&REFTEX;" . "*RefTeX*") 295 | ("&PLATEX;" . "*Preview-LaTeX*") 296 | ("&BIBTEXMODE;" . "*bibtex*") 297 | ("&ITE;" . "*iTe*") 298 | ("&YATEX;" . "*yatex*") 299 | ("&XSYMBOL;" . "*X-Symbol*") 300 | ("&LSYMBOLS;" . "*latex-symbols*") 301 | ("&WHIZZYTEX;" . "*WhizzyTeX*") 302 | ("&TEX;" . "TeX") 303 | ("&LATEX;" . "LaTeX") 304 | )) 305 | 306 | (defun alexott/muse-replace-text (from to) 307 | (save-excursion 308 | (while (re-search-forward from nil t) 309 | (save-restriction 310 | (narrow-to-region (match-beginning 0) (match-end 0)) 311 | (replace-match to t))))) 312 | 313 | (defun alexott/muse-convert-docbook () 314 | (interactive) 315 | (mapcar (lambda (x) (alexott/muse-replace-text (car x) (cdr x))) 316 | my-muse-docbook-replacements)) 317 | 318 | (setq my-dwiki-latex-replacements 319 | '( 320 | ("^======\\s *\\(.*?\\)\\s *======$" . "\\\\chapter{\\1}") 321 | ("^=====\\s *\\(.*?\\)\\s *=====$" . "\\\\section{\\1}") 322 | ("^====\\s *\\(.*?\\)\\s *====$" . "\\\\subsection{\\1}") 323 | ("^===\\s *\\(.*?\\)\\s *===$" . "\\\\subsubsection{\\1}") 324 | ("^==\\s *\\(.*?\\)\\s *==$" . "\\\\paragraph{\\1}") 325 | ;; ("((\\(\\(\\ca\\|\\Ca\\)*?\\)))" . "\\\\footnote{\\1}") 326 | ("\\[\\[\\(.*?\\)\\s ?|\\s ?\\(.*?\\)\\]\\]" . "\\\\href{\\1}{\\2}") 327 | ("\\[\\[\\(.*?\\)\\]\\]" . "\\\\url{\\1}") 328 | ("''\\(.*?\\)''" . "\\\\code{\\1}") 329 | ("\\*\\*\\(.*?\\)\\*\\*" . "\\\\textbf{\\1}") 330 | ("" . "\\\\begin{lstlisting}[lang=lisp]") 331 | ("" . "\\\\begin{lstlisting}[lang=lisp]") 332 | ("" . "\\\\begin{lstlisting}") 333 | ("" . "\\\\end{lstlisting}") 334 | ;; ("//\\([^]]*?\\)//" . "\\\\textit{\\1}") 335 | ;; ("" . "") 336 | ;; ("" . "") 337 | )) 338 | 339 | (defun alexott/dokuwiki-to-latex () 340 | (interactive) 341 | (mapcar (lambda (x) (alexott/muse-replace-text (car x) (cdr x))) 342 | my-dwiki-latex-replacements)) 343 | 344 | ;; ------------------------------------------------------------------------------------------ 345 | ;; implementation of additional tags 346 | 347 | ;; (add-to-list 'muse-publish-markup-tags '("div" t t t muse-publish-div-tag)) 348 | ;; (defalias 'muse-publish-div-tag 'ignore) 349 | 350 | ;; (defun muse-html-div-tag (beg end attrs) 351 | ;; (let ((id (cdr (assoc "id" attrs))) 352 | ;; (style (cdr (assoc "style" attrs)))) 353 | ;; (when (or id style) 354 | ;; (goto-char beg) 355 | ;; (if (null id) 356 | ;; (muse-insert-markup "
") 357 | ;; (muse-insert-markup "
")) 358 | ;; (save-excursion 359 | ;; (goto-char end) 360 | ;; (muse-insert-markup "
"))))) 361 | ;; (add-to-list 'muse-html-markup-tags '("div" t t t muse-html-div-tag)) 362 | 363 | (defun compare-mod-times (f1 f2) 364 | "compare two file modification time and return -1, 0 or 1 if first time 365 | is less, equal or greater then second" 366 | (let ((f1-h (car f1)) 367 | (f1-l (cadr f1)) 368 | (f2-h (car f2)) 369 | (f2-l (cadr f2))) 370 | (cond 371 | ((< f1-h f2-h) -1) 372 | ((> f1-h f2-h) 1) 373 | (t 374 | (cond 375 | ((< f1-l f2-l) -1) 376 | ((> f1-l f2-l) 1) 377 | (t 0)))))) 378 | 379 | ;; hook to publish blorg pages 380 | ;; TODO: restore windows positions and so on 381 | (defun alexott/blorg-publish-file (fname) 382 | (save-excursion 383 | (when (file-exists-p fname) 384 | (let* ((cb (current-buffer)) 385 | (test-name (concat (file-name-directory fname) "index.html")) 386 | (fname-mod (nth 5 (file-attributes fname))) 387 | (test-mod (if (file-exists-p test-name) 388 | (nth 5 (file-attributes test-name)) 389 | (list 0 0)))) 390 | (message "%s %s" fname test-name) 391 | (when (or 392 | (not (file-exists-p test-name)) 393 | (= (compare-mod-times fname-mod test-mod) 1)) 394 | (find-file fname) 395 | (blorg-publish t) 396 | (kill-buffer (current-buffer)) 397 | (pop-to-buffer cb)))))) 398 | 399 | ;; (defun muse-mp-publish-hook (data) 400 | ;; (if (string-equal (car data) "my-page-project") 401 | ;; (progn 402 | ;; (alexott/blorg-publish-file "~/Dropbox/my-page-muse/ru/news/news.org") 403 | ;; (alexott/blorg-publish-file "~/Dropbox/my-page-muse/en/news/news.org")))) 404 | ;; (add-hook 'muse-after-project-publish-hook 'muse-mp-publish-hook) 405 | 406 | ;; command to fix links in blorg-generated files 407 | ;; for i in *.html *.xml ; do sed -i -e 's|\[\[\([^]]*\)\]\[\([^]]*\)\]\]|\2|' -- $i ; done 408 | 409 | ;;; emacs-rc-muse.el ends here 410 | --------------------------------------------------------------------------------