Elisp/Emacs Examples

Caio Rordrigues has an excellent resource for beginning/intermediate Elisp programmers that also lists some of the common Emacs customizations that many Emacs users end up making. For example, it tells you how to turn off requiring a “yes” or “no” response to certain prompts and enabling a simple ‘y’ or ‘n’ instead.

The real meat, though, is the list of Elisp examples. You can think of it as an Elisp cookbook. It covers things like filtering lists, reading or writing from/to strings, splitting strings, mapping, structures, the loop macro, working with buffers and files, and a host of other useful examples. It’s fun just to read through it and when you do, you’re likely to learn a few things you didn’t know.

This is a really useful resource, especially for learning Elisp idioms and what sort of functions are available. As I’ve written before, the basics of Lisp programming are easy; it’s learning the library that’s hard. That’s especially true of Elisp, which has many specialized functions for editing text. Sometimes you know what you want to do but it’s not clear what terms you should search for to tell you how to implement it. Rordrigues’ examples covers most types of actions and will at least get you to the right set of functions. Even new Emacs users will find the section on customizations helpful.

Posted in General | Tagged , | Leave a comment

Draft #4

I’ve had this post in my blog-ideas queue for some time but it’s always seemed too far afield from Irreal’s interests—being about writing and dictionaries, and stuff—to write about. Now, happily, I’ve found the perfect hook. I wrote previously about DuckDuckGo bang shortcuts and gave some examples. Another example is !webster which takes you to the 1913 + 1828 Webster’s Revised Unabridged Dictionary. Why should you care?

The answer to that is in James Somers’ beautiful post, You’re probably using the wrong dictionary. In it, he describes a New Yorker article, Draft #4, by the prose stylist John McPhee. In that article, McPhee explains that the fourth draft comes after he’s done all the creative work and is ready to “punch up” his language. His main tool for doing that is to identify words that aren’t quite right or perhaps present an opportunity to do better and then look those words up in the dictionary. Note that it’s dictionary not thesaurus.

The problem, says Somers, is that most dictionaries are dry and give efficient, juiceless definitions. Although McPhee doesn’t say what dictionary he uses, Somers was able to track it down—it’s Webster’s Revised Unabridged, of course—and add it to his dictionary app. You really have to read his post to see why that’s worthwhile but if you’d like to improve your writing it’s well worth the read.

After reading Somers’ post, I bookmarked the dictionary but it was a bit of a pain to look up the bookmark. It would be easy to add some Elisp to pop me into the right definition in my browser or perhaps even the in the minibuffer the way abo-abo’s excellent define-word package does but I don’t use it that often so it never seemed worthwhile. Now with the DuckDuckGo bang shortcut it’s really easy and I’ll probably start using it more. Maybe enough to justify writing the Elisp.

UPDATE: he → he’s; prefect → perfect; unabdridged → unabridged

Posted in General | Tagged , | 3 Comments

Mastering Emacs in Emacs

Virtually every Emacs geek knows about and has probably purchased Mickey’s Mastering Emacs. Álvaro Ramírez wanted a bit more: he wanted to be able to search it from Emacs.

That turns out to be surprisingly easy. Just download the epub and convert it to Org mode, and you’re all set. There’s a little cleanup involved but it seems a reasonably easy process. Check out Ramírez’s post for the details. If you want to be able to bring up Mickey’s wisdom as you’re working, this seems like just the thing.

UPDATE: Matering → Mastering

Posted in General | Tagged | 7 Comments

Roundup of Open Plan Office Research

Jack Schofield over at ZD Net has a nice post on the evils of open plan office layouts. That’s a favored Irreal hobbyhorse, of course, so you might think I’ve said just about everything there is to say about the matter. Schofield’s post is useful because it has links to the multitude of research showing the harm to productivity and employee health that inevitably accompany such plans.

As I’ve stressed many times, the only real benefit of open plan offices is that they’re cheaper. That means facts probably won’t have much of an impact on management but if you think you have a fighting chance, the links may help.

Posted in General | Tagged | Leave a comment

Obscure Math Curiosity of the Day

The Fibonacci sequence: it’s everywhere.

Posted in General | Tagged , | 1 Comment

SBCL 1.2.13 Released

The Steel Bank Common Lisp developers have released version 1.2.13. The release fixes 8 bugs and has a few enhancements for the Windows port and for threading. See the NEWS file for the details.

The system compiled without incident as usual. The regression test error that I wrote about last time is still there so I may have to look into myself. The only other problem is that it’s still being hosted on Source Forge. That’s not a problem for me because I compile from source but if you’re downloading a prebuilt binary, make sure that you don’t click on any of the crapware download buttons that are positioned to look like what you should click to download SBCL.

As I always do, I urge anyone who wants to try out Lisp or who is looking for a first rate CL implementation to give SBCL a try. It’s a great system and one that many use for production systems. Definitely recommended.

Posted in General | Tagged , | Leave a comment

Big Data

Cory Doctorow has an interesting piece in The Guardian positing that in the commercial sphere, if not the world of spies, big data has run its course. I especially like this quote:

The fact that the billions spent spying on everyone, always, has spectacularly failed to catch any terrorists is taken as proof that they’re not doing enough surveillance – not that untargeted, mass surveillance without particularised suspicion is a waste of money.

Posted in General | Tagged | Leave a comment

Magit 2.1.0

I just installed the new version of magit (2.1.0) and even though I’ve made only two commits so far, I really like the new functionality. One of the first things you’ll notice is that when you commit, a diff is popped up in another window so you can see what’s changed. That’s handy when composing a commit message.

It’s very important that you follow the Installation instructions in the new User Manual. This is true even if you’re just updating from one of the ELPA repositories. You must delete

  1. magit
  2. git-commit-mode
  3. git-rebase-mode

and then quit Emacs. Next, restart Emacs and install magit from ELPA. Many of the variable names have been changed so if you are using any in your init.el you will probably need to change them. In my case, I had to change magit-repo-dirs to magit-repository-directories.

This is a big release with lots of new and improved functionality. If, like me, you’re a heavy magit user, you might want to contribute to keep the goodness coming.

Posted in General | Tagged , | 1 Comment

Flash and Security

In an editor’s note to the SANS Newsbites piece on Flash being used as a vector for the ransomware CryptoWall, William Hugh Murray speaks the uncomfortable truth on what Flash tells us about security.

Posted in General | Tagged | Leave a comment

Emacs and Data Science

Robert Vesco has an interesting post on why he uses Emacs in his data science work. Vesco is a data scientist for Bloomberg so he’s a serious practitioner of the art. Working in data science means he uses a variety of languages such as Python, R, SQL, Stata, and SAS. He notes that most of those languages have an associated IDE that simplifies working with them but that that means learning multiple editors and probably mastering none. He also notes that those specialized IDEs may fall out of favor and not be supported in the future, that they are not portable across platforms, and that they are hard to customize.

Happily, those defects do not apply to Emacs. It runs on essentially every (serious) platform, is open source, will be supported for as long as there are a few programmers still interested in using it, and, of course, is famously customizable. One consequence of that customizability is it can become a reasonable IDE for almost any language. That means that a single tool can be used for all those languages and that it’s worthwhile mastering that tool because it’s the only (editing) tool you need to learn.

The bulk of Vesco’s post covers those features of Emacs that he finds most useful in his work. One of those features is Org mode that allows him to use reproducible research methods in his research and publishing. It’s an interesting read even if you’re not a data scientist.

Posted in General | Tagged , , | Leave a comment