Thursday, November 12, 2015

C-u M-x align

For years I've always been aligning columns of code by hand. GNU Emacs has a way to do some of this automatically. For example take this:

int m_myInt;
bool m_myBool;
std:string m_myString;

And use "C-u M-x align" to turn it into:

int         m_myInt;
bool        m_myBool;
std::string m_myString;

Friday, October 9, 2015

The Xorg fixed font

I've often wondered what exactly the "fixed" font is. Turns out that it is just an alias to whatever you want it to be (or whatever the maintainer decides it should be). On Fedora 22, the font alias file is kept at /usr/share/X11/fonts/misc/fonts.alias and the very first line of configuration says:

fixed    -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1

Friday, February 27, 2015

how slime enables debug info in sbcl

This is a copy-and-paste of an old Reddit post of mine.


Peter Keller (psilord) and I were talking about debugging CL and it prompted me to take a quick tour of how SLIME enables debug compilation for SBCL. This appears to be the general flow:
  1. C-u C-c C-k calls slime-compile-and-load-file (slime.el) with the default argument of 4. The default of 4 threw me. I don't know the history behind that.
  2. slime-compile-and-load-file (slime.el) generates a compute policy of '(cl:debug . 3)
  3. slime-compile-and-load-file (slime.el) calls slime-compile-file (slime.el) with arguments of (t '(cl:debug . 3))
  4. slime-compile-file (slime.el) calls the CL function swank:compile-file-for-emacs (swank.lisp)
  5. compile-file-for-emacs (swank.lisp) calls swank-compile-file* (swank.lisp)
  6. swank-compile-file* (swank.lisp) calls swank-compile-file (swank-sbcl.lisp)
  7. swank-compile-file (swank-sbcl.lisp) calls compiler-policy (swank-sbcl.lisp)
  8. compiler-policy (swank-sbcl.lisp) calls (sb-ext:restrict-compiler-policy 'cl:debug 3)

Sunday, February 22, 2015

Using LaTeX on FreeBSD

I've been using FreeBSD 10.1 on my laptop and had to relearn how to do some basic things in LaTeX. First of all, tetex is no longer a distribution that is used; look for "texlive" when installing. Secondly, I could not remember how to add local packages to my hash. After dusting many cobwebs, it appears to be the following:
  1. mkdir -p ~/texmf/tex/latex
  2. cp whatever.cls ~/texmf/tex/latex
  3. texhash