Illusory stillness

mumble mumble techblog

Fixing Geiser-racket-repl’s Error Links

Geiser REPL mode is pretty good, but man the error links were (a) broken and (b) eyewatering. Here’s an example:

Error processing input, expected syntax: {% img [class name(s)] [http[s]:/]/path/to/image [width [height]] [title text | “title text” [“alt text”]] %}

I mean, are there error messages somewhere in all those pathnames and red?

After some fussing I got it to look better.

Editing Structured Regexes Interactively in Emacs

I was using regex-builder to make something, but it still looked like this:

1
"^ *\\([^:(\t\n]+\\)\\(:\\([0-9]+\\)\\)?\\(:\\([0-9]+\\)\\)?\\(: \\(\\(\\w\\|\\s_\\)+\\|\\[\\(\\w\\|\\s \\)+\\]\\)\\)?\\(: \\(.*\\)\\)?"

Leaning-toothpicks syndrome is kicking my ass. What if I write a regex using S-expressions? Wouldn’t that be the bee’s knees?

Get Emacs Set Up for Racket

I want to get back to doing problems out of SICP, but I want to use a more familiar editor.

Racket suggests Geiser and Quack. I already have Geiser installed from sopme package archive when I aborted an earlier attempt (and Geiser is supposed to, independently, include a version of Quack, or something?)

Replace Less With Emacs

I use shell-mode in Emacs a lot (and have never been that taken with Eshell or term-mode). I got tired of seeing this sort of thing:

1
2
3
dekkera:htlatex-maximal peter$ git log
WARNING: terminal is not fully functional
-  (press RETURN)

Hevea

So I wrote a thesis, using some self-torturing chain of LyX, knitr, and a build tool of my own devising. It made a PDF, now I want to make it a webpage.

I tried a few tools, and settled on HeVeA as the tool that showed the most promise (as in, ‘it actually generated some HTML for a subset of my files, within a few hours of work’). That’s not close to “working” though.

Whitespace-mode

Why does whitespace-mode fuck up longlines mode when it’s supposed to be disabled?

I’d like to edit markdown files with longlines-mode (word wrapping). Clearly when longlines-mode is enabled, I don’t want to highlight 80+ char lines, as I do when editing code. However, I still want the other whitespace-mode features (highlight trailing spaces, tabs, etc)

Time Shifting an Internet Stream With VLC

(content note: this didn’t work.)

I want to listen to this upcoming show but don’t know if it’ll be downloadable later.

I worked out a VLC command line:

1
2
3
4
5
6
7
/Applications/VLC.app/Contents/MacOS/VLC \
http://delicious.wavestreamer.com:4626/listen.pls?sid=1 \
    vlc://quit \
    --network-caching=10000 \
    --sout /Users/peter/2014-05-16_yppah_shisho_room_mix.ogg \
    --run-time=7400 \
    --intf rc

I put the command in an executable .sh file and scheduled it to run using LaunchControl.

huh?

Note that I mistakenly tried to actually read the documentation and used

1
--sout "#standard{access=file,mux=ogg,dst=/Users/peter/2014-05-16_yppah_shisho_room_mix.ogg}"

I don’t know what’s wrong or missing about this, but VLC decided to treat it as a filename instead of the syntax in the docs:

1
[0x109c21840] filesystem access error: cannot open file /Users/peter/#standard{access=file,mux=ogg,dst=/Users/peter/2014-05-16_yppah_shisho_room_mix.ogg} (No such file or directory)

Anyway, I forget what I did after that, but the VLC command never actually launched. There was an MP3 of the show available anyway.

Setting Up Online Help in Homebrew Erlang/Emacs/Distel

Now IN THEORY, Distel-mode is supposed to show me the online help when I point by cursor at a function name and press C-c C-d h. What I actually get is:

I am unable to Google up a description of how to let Distel know where the HTML documentaiton is (as I installed Erlang from Homebrew, I find the HTML docs under /usr/local/Cellar/erlang/17.0/share/doc/erlang/doc/.)

Now looking in what distel.el actually does with a C-c C-d h I find that Distel contains a module otp_doc which is a singleton gen_server… so I go to an erlang shell on that node and type

1
2
(emacs@dekkera)3> whereis(otp_doc).
<0.44.0>

Now I also saw that the otp_doc module had a property list as the init of its gen_server state. The state contained a root_dir variable. The root_dir variable is initialized to a default of code:root_dir(), which is currently set to:

1
2
(emacs@dekkera)4> code:root_dir().
"/usr/local/Cellar/erlang/17.0/lib/erlang"

Aping Distel and calling otp_doc does:

1
2
(emacs@dekkera)9> otp_doc:distel(link, "orddict", "find", 2).
no_html

Meanwhile, another Distel function C-c C-d A which is bound to erl-show-arglist works fine when pressed ad orddict:find|. And C-c C-d d also comes up with useful information — but this information doesn’t look like /documentation/.

From Emacs. C-c C-d h does (erl-do-find-doc 'link 'point 'coderoot_dir 0)`,

And it looks like init() calls index_html() the no_html is coming from init() I guess. Here’s how:

1
2
3
html_index(file,Dir) ->
  FN = filename:join([Dir,"doc","man_index.html"]),
  fold_file(curry(fun lines/3,Dir),[],FN).

So do I need to set root_dir to /usr/local/Cellar/erlang/17.0/share/erlang? Or alter how otp_doc is being initialized? Looks like it is accessed through otp_doc:start.

So how to provide the start state from Emacs?

I can’t find where this value is configured, anywhere.

So I just crapped out and made a symlink:

1
2
dekkera:lib peter$ cd /usr/local/Cellar/erlang/17.0/lib/erlang
dekkera:lib peter$ ln -s ../../share/doc/erlang/doc doc

This got rid of no_html error but I still don’t find any HTML documentation! What the hell. I’ll have to see why it’s not reading the HTML file and populating the ETS database, or something.

This is more debugging of Erlang than I can handle when all I’m trying to do is write Erlang code. Argh.

Un-pause Programs in OS X

I’m not sure why there isn’t a builtin way to do this. When a process eats all memory on OS X, it starts “pausing” applications. Upon killing the offending app, one wants to un-pause all the apps. But if you close the dialog, you can’t resume!

I can “resume” like this:

1
pgrep Chrome | xargs kill -CONT

which appears to make the apps usable again but the processes still show up as “paused” in the force quit dialog. Also, I think the unpausing should respect the process tree (not process names.)