Tag: emacs

Avy Interactive

The excellent avy package for emacs provides an efficient mechanism for positioning the cursor in the current window. The avy workflow is: Active avy via one of several possible functions Type a few characters corresponding to the location on screen you want to navigate to Avy will highlight each occurrence of those characters with navigation hints Type the one or two letters corresponding to the desired destination Avy typically enables navigation to any position on screen in four or five ke…

Emacs Startup Optimization

Recently, I had the urge to optimize the startup time of my emacs configuration. I managed to reduce my startup time from three seconds to under half a second. It was a fun exercise even though I don't really start emacs that often. Even that minor reduction makes starting a new emacs instance (e.g., from mutt or in a terminal) much more pleasant. I could use the server functionality in emacs (along with emacsclient) to always connect to a single persistent instance, but I like the isolation…

Emacs and Terminal Pasting

Over the last few weeks, I've found myself having to copy and paste large chunks of text into emacs running in a terminal. This leads to some annoyance, as each character pasted triggers a keystroke. In particular, every newline triggers indentation via newline-and-indent. This is very annoying, as the indentation usually gets a bit messy and turns into an ugly staircase of text. Vim has a solution to this problem via a command :set paste, which turns off indentation while pasting. More gene…

Unusual Emacs keybindings

I recently ran into a strange problem with running emacs. A few days ago, my delete, page up, and page down keys stopped working, but only when emacs was run in the terminal. Whenever I hit one of those keys, emacs would complain that the region was empty. This was baffling for a while. Searching the internet turned up nothing, so I had to assume that it was something I had done. One further symptom manifest: when I used my M-[ keybinding, the bound function would execute and it inserted 3~…

TAGS for Haskell

I periodically try to use TAGS to navigate round my code in emacs. When it works, it is very convenient. I have not been using them lately, partly because generating the tags and keeping them up-to-date has always been a bit fiddly. In the past, I have tried to get emacs to automatically regenerate my tags when I save changes to a file. I have had solutions that work to a greater or lesser extent, but they are always a bit unsatisfying. Inevitably, I end up having to write an extra shell scr…

Project Management in Emacs

Over the years, I have tried many different "project management" libraries for emacs -- enough that I do not even remember which ones. I do not really remember finding one that did what I wanted (or could be coaxed into it within any reasonable amount of time). Sometime last year I stitched together something rudimentary that serves my workflow very well. With my recent emacs configuration rewrite, I took the opportunity to refine my solution into something slightly nicer. I am docu…

An Emacs Function for LLVM Assembly

I finally decided to use the power of emacs to automate a task that I perform at least a dozen times per day: converting a snippet of C source code into LLVM IR assembly. The command to do this is simple: clang -emit-llvm -c -o - file.c | opt -S The only annoying part about using the command was finding a spare terminal and finding the input file on the file system (and then remembering where I put that terminal when I wanted to refer to it later). Enter emacs. It took a while to navigate th…

Haskell in Emacs

Like many people, I use Emacs to edit my Haskell code. The standard haskell-mode works fine, but I always felt like I could use a bit more help from my editor. I recently ran across scion, which is something like a Haskell IDE library that provides deep information about programs to editors. It also happens to include Emacs integration. A few notable features: In-buffer error and warning highlighting Expression typechecking Completion of LANGUAGE pragmas Go-to-definition of symbols It does …

Emacs Fonts

I keep forgetting to update this blog. I feel bad about that; I thought that I would have more free time after I finished taking classes. I am going to try to force myself to update more frequently. I won't force myself to make the content insightful, though. Anyway, I have been writing code in Haskell lately, and the haskell-mode for emacs is very good. This mode has support for replacing common multi-character operators and identifiers with their Unicode equivalents. For example, -> bec…