# HG changeset patch # User Steve Losh # Date 1471992499 0 # Node ID 1d6b60fde7f1c0eb6ceda27ea357e6efc2196b9e # Parent 122228d53e7a0261b67e95a797fd1b845dca441b more diff -r 122228d53e7a -r 1d6b60fde7f1 bin/code-to-pdf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/code-to-pdf Tue Aug 23 22:48:19 2016 +0000 @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +TITLE="$1" +shift + +enscript -1 --media=A4 \ + --toc \ + --header '%H - $N | | page $% of $= in file $v' \ + --font "Menlo-Regular@8.5" \ + --header-font "Menlo-Bold@10" \ + --margins=60:60:18:60 \ + --fancy-header=sjl \ + --title $TITLE \ + --baselineskip 3 \ + --line-numbers \ + --highlight \ + --color \ + --mark-wrapped-lines=arrow \ + -p - \ + --word-wrap $* \ + | pstopdf -i -o code.pdf + diff -r 122228d53e7a -r 1d6b60fde7f1 bin/lec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/lec Tue Aug 23 22:48:19 2016 +0000 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +echo $* | peat "ldown $* > index.html" + diff -r 122228d53e7a -r 1d6b60fde7f1 bin/lecdown --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/lecdown Tue Aug 23 22:48:19 2016 +0000 @@ -0,0 +1,68 @@ +#!/usr/bin/env bash + +set -e + +echo "" + +cat < + +EOF + + +cat < +EOF + +cat < +MathJax.Hub.Config({ + tex2jax: { + inlineMath: [[',,',',,'], ['\\\\(','\\\\)']], + processEscapes: true + } +}); + + +EOF + +echo "" + +pandoc --from markdown --to html $* + +echo "" + diff -r 122228d53e7a -r 1d6b60fde7f1 fish/functions/dump.fish --- a/fish/functions/dump.fish Sat Aug 20 21:21:56 2016 +0000 +++ b/fish/functions/dump.fish Tue Aug 23 22:48:19 2016 +0000 @@ -4,8 +4,8 @@ hg -R ~/src/cl-nrepl push - hg -R ~/src/bones push - hg -R ~/src/bones push git + hg -R ~/src/temperance push + hg -R ~/src/temperance push git hg -R ~/src/mazes push hg -R ~/src/mazes push git diff -r 122228d53e7a -r 1d6b60fde7f1 lispwords --- a/lispwords Sat Aug 20 21:21:56 2016 +0000 +++ b/lispwords Tue Aug 23 22:48:19 2016 +0000 @@ -17,6 +17,7 @@ (1 dis) (1 do-array) (1 recursively) +(2 when-found) ; fiveam (1 test) @@ -53,3 +54,5 @@ (1 with-curses) +; dissect +(1 with-capped-stack with-truncated-stack) diff -r 122228d53e7a -r 1d6b60fde7f1 roswell/lispindent.ros --- a/roswell/lispindent.ros Sat Aug 20 21:21:56 2016 +0000 +++ b/roswell/lispindent.ros Tue Aug 23 22:48:19 2016 +0000 @@ -113,13 +113,15 @@ (defun lisp-indent-number (s &optional (possible-keyword-p t)) (or (cdr (assoc s *lisp-keywords* :test #'string-equal)) - (if (zerop (or (search "def" s :test #'char-equal) -1)) - 0 + (if (zerop (or (search "def" s :test #'char-equal) + (search "with-" s :test #'char-equal) + -1)) + 0 (if possible-keyword-p - (let ((p (position #\: s :from-end t))) - (if p - (lisp-indent-number (subseq s (1+ p)) nil) - -1)) + (let ((p (position #\: s :from-end t))) + (if p + (lisp-indent-number (subseq s (1+ p)) nil) + -1)) -1)))) (defun literal-token-p (s) diff -r 122228d53e7a -r 1d6b60fde7f1 vim/bundle/ooze/plugin/ooze.vim --- a/vim/bundle/ooze/plugin/ooze.vim Sat Aug 20 21:21:56 2016 +0000 +++ b/vim/bundle/ooze/plugin/ooze.vim Tue Aug 23 22:48:19 2016 +0000 @@ -24,8 +24,11 @@ endfunction " }}} let g:ooze_scratch_buffer_name = '__OozeScratch__' +let g:ooze_traceback_buffer_name = '__OozeTraceback__' + function! s:OpenOozeScratch(contents) " {{{ if bufname('%') != g:ooze_scratch_buffer_name + " TODO: go to the window if it's already showing... wincmd s execute "edit " . g:ooze_scratch_buffer_name endif @@ -38,16 +41,67 @@ setlocal buflisted setlocal noreadonly - normal! ggdG + normal! gg"_dG call append(0, a:contents) setlocal readonly endfunction " }}} +function! s:DumpTraceback(frames) " {{{ + let current = bufnr('%') + let bn = bufnr(g:ooze_traceback_buffer_name) + + if bn == -1 + execute "edit " . g:ooze_traceback_buffer_name + setlocal buftype=nofile + setlocal bufhidden=hide + setlocal noswapfile + setlocal buflisted + else + execute "buffer " . bn + endif + + normal! gg"_dG + + for frame in a:frames + let call_form = frame[0] + let file = frame[1] + let line = frame[2] + + call append(line('$'), call_form . "\t" . file . "\t" . line) + endfor + normal! gg"_dd + set errorformat=%m\ %f\ %l,%m\ %f\ + execute "cbuffer" + + execute "buffer " . current + + return 1 +endfunction " }}} + +function! s:HandleMacroexpand(msg) " {{{ + let moutput = s:GetString(a:msg, 'macroexpand-1', "") + call s:OpenOozeScratch(split(moutput, "\n")) +endfunction " }}} +function! s:HandleStackTrace(msg) " {{{ + call s:DumpTraceback(get(a:msg, 'stack-trace')) + + let output = '' + + let output .= s:GetString(a:msg, 'error', "\n\n") + let output .= s:GetString(a:msg, 'original', "\n\n") + + if output != '' + echo substitute(output, '\n\+$', '', '') + endif + + copen +endfunction " }}} function! s:HandleMessage(msg) " {{{ - let moutput = s:GetString(a:msg, 'macroexpand-1', "") - if moutput != '' - call s:OpenOozeScratch(split(moutput, "\n")) - return + if has_key(a:msg, 'macroexpand-1') + return s:HandleMacroexpand(a:msg) + endif + if has_key(a:msg, 'stack-trace') + return s:HandleStackTrace(a:msg) endif let output = '' @@ -55,10 +109,6 @@ let output .= s:GetString(a:msg, 'stderr', "") let output .= s:GetString(a:msg, 'value', "") - let output .= s:GetString(a:msg, 'error', "\n\n") - let output .= s:GetString(a:msg, 'original', "\n\n") - let output .= s:GetString(a:msg, 'backtrace', "\n") - let output .= s:GetString(a:msg, 'function-arglist', "\n\n") let output .= s:GetString(a:msg, 'function-docstring', "\n") if output != '' @@ -210,8 +260,10 @@ function! OozeArglistFormHead() " {{{ let view = winsaveview() - if synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") == "Comment" - " bail if we're in a comment + let syntaxElement = synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") + + if syntaxElement == "Comment" || syntaxElement == "String" + " bail if we're in a comment or string " TODO: make this suck less else execute "normal v\(sexp_inner_list)o\(sexp_inner_element)" diff -r 122228d53e7a -r 1d6b60fde7f1 vim/ftplugin/lisp/lispfolding.vim --- a/vim/ftplugin/lisp/lispfolding.vim Sat Aug 20 21:21:56 2016 +0000 +++ b/vim/ftplugin/lisp/lispfolding.vim Tue Aug 23 22:48:19 2016 +0000 @@ -164,6 +164,9 @@ elseif getline(a:lnum) =~ '^(let ' " let over lambda return ">1" + elseif getline(a:lnum) =~ '^(adt:defdata' + " let over lambda + return ">1" elseif getline(a:lnum) =~ '^$' && getline(a:lnum - 1) =~ '^$' return "0" elseif getline(a:lnum) =~ '^$' diff -r 122228d53e7a -r 1d6b60fde7f1 vim/vimrc --- a/vim/vimrc Sat Aug 20 21:21:56 2016 +0000 +++ b/vim/vimrc Tue Aug 23 22:48:19 2016 +0000 @@ -2156,6 +2156,7 @@ let NERDTreeIgnore = ['\~$', '.*\.pyc$', 'pip-log\.txt$', 'whoosh_index', \ 'xapian_index', '.*.pid', 'monitor.py', '.*-fixtures-.*.json', \ '.*\.o$', 'db.db', 'tags.bak', '.*\.pdf$', '.*\.mid$', + \ '^tags$', \ '.*\.midi$'] let NERDTreeMinimalUI = 1 @@ -2171,6 +2172,7 @@ let g:paredit_shortmaps = 0 let g:paredit_electric_return = 1 let g:paredit_disable_lisp = 1 +let g:paredit_matchlines = 200 function! EnableParedit() call PareditInitBuffer()