Serializable Emacs Objects

Christopher Wellons over at null program has a very nice post on readable closures in Emacs. With the introduction of lexical scoping and, consequently, closures in Emacs 24 it’s nice to discover that Elisp closures are readable. That is, you can print them and read the resulting text back in to create an object that is equal to the original.

The post is a bit more general than the title suggests. It provides a list of Elisp objects that are readable and another of those objects that are not. I don’t think I’ve ever seen that information written down before so it’s very useful. For example, as of Emacs 23, Emacs hash tables are readable. That’s something I didn’t know. Actually, Emacs does a better job of serializing its objects than Common Lisp does. As Wellons explains, a lot of that has to do with the fact that Elisp compiles to byte code.

Even if you aren’t interested in closures, this post is worth reading for what it tells you about serialization in Emacs Lisp.

Posted in General | Tagged , | Leave a comment

The Sins of the Technical Press

Regular readers know that I’m inclined to a jaundiced view of the press. They are, far too often, biased and lazy and write stories that aren’t simply wrong but the opposite of the truth. The late Michael Crichton famously described this in a speech where he discussed the Gell-Mann Amnesia Effect.

One would hope that the technical press would do better but, sadly, they are in many ways worse. Consider, for example, this righteous takedown by John Gruber of Christopher Mimms’ article in Quartz. The nonsense that passes for reporting is unbelievable. As Gruber says, much of it is obviously and provably untrue.

The technical press appears to be at their worst when reporting or commenting on Apple. I’m not sure what it is but something about Apple seems to drive reporters crazy. Don’t take my word for it; read Grubers post. He describes the results in great detail. One needn’t be an Apple Fan Boy to see how wrong and unfair much of the reporting on Apple is. And although they seem at their worst when reporting on Apple, they don’t do a whole lot better in general.

Posted in General | Tagged | Leave a comment

Popup Windows in Emacs

Kris Jenkins has a nice post on using the popup package to pop up help windows in Emacs. He shows a tiny amount of Elisp that pops up the system help for the symbol at point. It would be easy to adapt it to pop up other types of help or any other information.

You can get the popup package from Marmalade through ELPA. Read the README at github to learn about its capabilities. It’s a nice package.

Posted in Programming | Tagged , | Leave a comment

Bozhidar Batsov on Emacs 24.4

Over at Emacs Redux, Bozhidar Batsov is promising a peek at some of the Emacs 24.4 features. Because he contributed code to the release, he’s followed the development carefully and has been using it exclusively for the last six months so he’s in a good position to give us some insights into the new release.

His first post, on a smarter show-paren-mode, is already up. It’s got an animated gif that shows the new mode in action. The mode now matches a number of delimiters including language specific ones such as do/end.

Both posts are well worth your time. Of course, that’s true of all the posts at Emacs Redux.

Last-Minute Update

As I was getting ready to publish this, I noticed that Batsov has published his second post on rectangular selection. As in the show-paren-mode post, he demonstrates the new functionality with an animated gif. It’s a little hard—at least on my MacBook Pro—to see the highlighting so look carefully.

Posted in General | Tagged | Leave a comment

RTFM

Some time ago1, I noticed that the Org footnote mechanism was not working correctly. As with similar footnote facilities, you add a footnote by marking where you want the footnote to appear in the text and then adding a paragraph starting with the same marker that contains the text of the footnote. Usually, you add the footnote definition in the next paragraph so that the definition is near its reference in the text. For example, the text generating the above footnote is

Some time ago[fn:1], I noticed that the Org footnote mechanism was not…


[fn:1] Most likely when I upgraded to Org Mode 8.

Org is supposed to collect the footnotes and put them at the end of the page on which they occur. Instead, the footnotes were being added at the spot where they were defined. Org mode is under constant development so I assumed, as I had with Magit, that one of the updates introduced the error and that it would be fixed the next time I updated. In the meantime, I just moved the footnote definitions to the end of the text.

When I finally got around to updating however, the error was still there. So I did what I should have done originally: I read the manual. It turns out that somewhere along the line Org was updated to require two blank lines after the footnote definition. That was presumably so that you could have a multi-paragraph footnote. Once I added to second blank line, everything worked correctly.

As geeks, we’re fond of invoking the RTFM mantra but sometimes we forget it ourselves. Anyway, this post is a heads up to anyone who is experiencing the same problem.

Footnotes:

1

Most likely when I upgraded to Org Mode 8.

Posted in General | Tagged , | Leave a comment

Mickey on Emacs 24.4

As he has for the past several releases, Mickey over at Mastering Emacs has perused the NEWS file for the upcoming Emacs 24.4 and produced an informative post on what’s new. There are a couple of good reasons to read his post. The first is obvious: curiosity as to what’s coming. The average Emacs Knight is going to be excited at the prospect of a new release and will want to know what’s in it.

The second reason is advance planning. Most of us have large and complex Emacs initialization systems and each new release can break it in various ways. For example, Emacs 24.4 has removed or renamed several functions that your init.el or associated files might use. Similarly, some commands have had their functionality changed in subtle ways that may interact with your custom Elisp. Finally, new capabilities have been added that may negate the need for some of your custom code.

You can always discover this stuff by reading the NEWS file when you install the new Emacs but I like having advance notice of what I should be looking for. Even if you don’t agree, you know you’re curious so go on over to Mastering Emacs and read Mickey’s post.

Posted in General | Tagged | Leave a comment

Progress on the Discrete Logarithm Problem

A team of French mathematicians and computer scientists have developed a new algorithm that makes substantial progress on certain types of discrete logarithms. The general discrete log problem is given a and b from a finite field find n also from the finite field such that a = bn. It turns out that this problem has about the same difficulty as factoring and, in fact, the two problems are related.

The discrete logarithm problem is important because its difficulty is what makes the Diffie-Hellman key exchange protocol and elliptic curve cryptography secure. Additionally, progress with the discrete logarithm problem can often be carried over to the factorization problem.

The French team’s algorithm works only for low characteristic finite fields, which means it does not affect Diffie-Hellman or elliptic curve cryptography but does effect certain other less-used cryptosystems. The bottom line is that there’s no reason for panic: all our important asymmetric cryptosystems are still secure. Still, as Bruce Schneier says, attacks only get better.

Posted in General | Tagged | Leave a comment

No

Why not?

Posted in General | Tagged | Leave a comment

LispStick!

If you’re a Windows user and want to try Lisp, getting started can be a bit of a hassle. Now Patrick Krusenotto has come to the rescue with LispStick!, a Zip file that has everything you need to get started. Included in the package are

  • SBCL
  • Emacs
  • SLIME
  • Quicklisp

The software is installed in a single directory so you don’t have files scattered all over you file system. You can even run it from a flash drive if you want to carry your Lisp development environment with you.

If you’ve already had some experience with CL, you’ll know that the four pieces of software in the package are really everything you need. Having the easy-to-use Quicklisp available means that you can easily add libraries as you need them, something that was fussy and difficult before Quicklisp. Very nice.

Posted in Programming | Tagged , | Leave a comment

Data Loss and Reproducible Research

As long-time readers know, I’m a big fan of reproducible research (1, 2, 3, 4, 5, 6, 7). The aspect that I’m particularly interested in is keeping the data, software, and other supporting material together with the source for the actual paper. This is especially convenient with the Emacs/Org mode/Babel combination as many of the above posts discuss.

One thing I hadn’t considered is its role in preventing data loss. UPI is reporting that scientific data is disappearing at an alarming rate. Researchers from the University of British Columbia looked at 516 research papers and tried to locate the data underlying the papers. They found that most of the data was available two years after the papers were published but that the availability of the data dropped off by about 17% for each year after the second.

The problem seems rooted in the fact that the data stays with the researchers. Researchers move, retire, or die making it difficult or impossible to get in touch with them. Even when a researcher can be reached, the data may have been lost or trapped on old media that can no longer be read. Reproducible research by itself doesn’t help with any of those problems, of course, but it can help if the original files are held by the journals that publish the papers. The authors of the University of British Columbia study recommend that journals require authors to upload data to public servers as a condition of publication.

An even better solution is to require that authors generate reproducible research files1 and escrow them with the journal or on public servers set up for that purpose. Keeping digital files readable is a difficult problem—just ask the Library of Congress—but it’s one that’s more suited to professionals than individual researchers, most of whom lack the necessary background and skills.

I’ve long believed that journals should insist that authors submit reproducible research files as part of the publication process. That was to allow other researchers to verify and perhaps extend the original research. As the UPI report makes clear, keeping valuable scientific data from disappearing is an even better reason.

Update dissapearing → disappearing

Footnotes:

1

Ideally, this would be a single file containing the text of the paper, data, calculations, and programs used to manipulate the data. In some cases the data sets or programs may be too large to make that practical but they should all be included in the reproducible research file set and be linked to from the main file.

Posted in General | Tagged , , , | 2 Comments