Category Archives: Programming

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

Timing Execution In Emacs

Xah Lee has a short post on find-file vs. with-temp-buffer for loading a large number of files. The results were sort of surprising, at least to me, so you should take a look if you need to load several files … Continue reading

Posted in Programming | Tagged , | 1 Comment

The Power Of S-Expressions

In view of the fact that my last few posts have concentrated on the use of S-expressions to represent data—in particular, to represent log file entries—this seems like a good time to link to S-expressions: The most powerful data structure … Continue reading

Posted in Programming | Tagged , | Leave a comment

Exploratory Programming In Emacs

This is the final post of my series on storing data as Lisp programs (see here, here, here, here, and here). I hope that those of you have read the whole series have a new or renewed appreciation for the … Continue reading

Posted in Programming | Tagged , | 1 Comment

Filtering Lisp-Based Log Files With Emacs Wrap-Up

Yesterday’s post discussed some rudimentary methods of having log files stored as Lisp filter themselves. Today I planned to finish that discussion and remark on how Emacs provides a powerful environment for exploratory programming. The discussion of the 3 challenge … Continue reading

Posted in Programming | Tagged , , | Leave a comment

Filtering Log Files Stored As Lisp With Emacs

Yesterday, I wrote about transforming log files stored as Lisp. Today, I want to continue that theme by considering how we can have the log file filter itself so that we can pick out records meeting certain criteria. I wasn’t … Continue reading

Posted in Programming | Tagged , , | Leave a comment