Category: Emacs

  • Handy emacs printing trick

    emacs -nw myfile.c -e “ps-print-buffer” -e “save-buffers-kill-terminal” By extension, you can keep stacking -e’s with interactive functions that take no arguments for as many commands as you want. I would imagine there is a way to pass arguments to the functions you list, but I haven’t found that yet. Also, it might be nice to […]

  • Emacs Mode for Protobuf editing

    I like using Google’s Protocol Buffers (aka protobuf). It is faster and more bandwidth/disk efficient than JSON, but perhaps not quite as simple or flexible. In protobuf you have messages. In messages, everything is a key/value pair. Keys are tagged to show the type of the value (int, float, string, sub-message), then followed by the […]

  • Must have Emacs Mode

    If you ever edit javascript code, the only emacs mode to consider is Steve Yegge’s JS2 mode.  The official page for it is here.  The annoucement page is here.  This javascript mode is an example of what more modes should aspire to.  It parses your buffer into a javascript AST and uses that for syntax […]

  • Hex in elisp

    ?\x48fc is a 16bit hex value in emacs.  So, for example: (- ?\x4ffb ?\x48fc)

  • eval-exp-insert

    I often want to calculate something quickly then stick it into the buffer I am currently editing. Previously, I would do something like type (+ 3 5) into the buffer, Type C-x C-e, see the result in the minibuffer at the bottom of the screen (are re-evaluate repeatedly if I didn’t quite catch it, say […]