Tag Archives: Emacs

The Emacs count-lines-region Command

I’ve been working on a Lisp program that generates combinations of certain objects. During development, I like to print them out to see what, exactly, is getting generated. Often, I’ll realize that I also need to know how many objects … Continue reading

Posted in General | Tagged | 3 Comments

Lexical Scoping In Emacs Lisp

I’ve said before that Emacs Lisp is pretty much like other Lisps but one area where that is not true is in variable scoping. Common Lisp and Scheme both enjoy lexical scoping whereas Emacs Lisp has dynamic scoping. Until you … Continue reading

Posted in Programming | Tagged , | 6 Comments

File Loading In Emacs

Xah Lee has a very nice post up that explores Emacs Lisp’s Library System and what require, load, load-file, autoload, and feature really do and how they differ. This is one of those subject areas that most of us just … Continue reading

Posted in Programming | Tagged , | Leave a comment

The Emacs compile-command Local Variable

I just ran across this gem in an old Justinhj’s Coding Blog post. Most of the time developers are working on projects that are complex enough to require a make file and for them, Emacs does the right thing when … Continue reading

Posted in Programming | Tagged | 3 Comments

Emacs Syntax Classes

This is sort of a note to myself. I sometimes need to know the character designation of a syntax class. Most often this is for use with the \sC syntax in a regexp. For example (looking-at “^\\s-*$\\|\\s-*;”) asks if we’re … Continue reading

Posted in Programming | Tagged , | 3 Comments

The Emacs regexp-opt Function

Sacha Chua introduced me to regexp-opt, an Emacs function that I hadn’t seen before. The idea is that regexp-opt will take a list of strings and return a more or less optimal regexp to recognize any of those strings. Because … Continue reading

Posted in Programming | Tagged , | Leave a comment

Solution To The Emacs Programming Challenge

A few days ago, I posed an Elisp programming challenge that asked you to make the record (record (date “2005-02-21T18:57:39”) (millis 1109041059800) (sequence 1) (logger nil) (level ‘SEVERE) (class “java.util.logging.LogManager$RootLogger”) (method ‘log) (thread 10) (emessage “A very very bad thing … Continue reading

Posted in Programming | Tagged , | 3 Comments

Emacs’ jump-to-register In Exploratory Programming

I’ve written before about Emacs Registers and how you can store the mark in a register with 【Ctrl+x r Space】 register. That’s one of those things that’s occasionally useful because you can then jump to that position with 【Ctrl+x r … Continue reading

Posted in Programming | Tagged | Leave a comment

An Emacs Programming Challenge

In Converting S-Expressions To XML In Emacs, I showed how to take a log record expressed as Lisp and turn it into the equivalent XML. In More Fun With Log Files Stored As Lisp, I showed how to take that … Continue reading

Posted in Programming | Tagged , | 2 Comments

More Details On find-file Vs. with-temp-buffer

Yesterday, I mentioned that Xah Lee had a short post on dramatically differing run times for processing several files with find-file versus processing the same files using with-temp-buffer. His post was fairly short and didn’t have a lot of details. … Continue reading

Posted in Programming | Tagged , | Leave a comment