Using ELPA with pinned packages in GNU Emacs 24.4

The Lone C++ Coder's Blog from The Lone C++ Coder's Blog

Yes, I promise I’ll shut up about Emacs package management via ELPA any minute now. Based on the feedback I had on my last post about using a combination of melpa and melpa-stable, I looked into using pinned packages via the package-pinned-packages variable that’s new in Emacs 24.4’s package.el. I couldn’t find any simple examples on how to use it, but a quick look at the source code and some playing around in ielm got me there.

Set up Emacs to use both melpa and melpa-stable

The Lone C++ Coder's Blog from The Lone C++ Coder's Blog

I’ve blogged about a little elisp snippet I use to install my preferred base set of Emacs packages before. Thanks for all the feedback, it definitely helped improve the code. One issue that kept annoying me is that there is no simple way to tell ELPA to mainly pull packages from melpa-stable and only fall back to melpa for those packages I can’t get on melpa-stable yet. I decided to extend my code to handle that situation with some manual inputs as I know which packages can’t be found on melpa-stable.

Polymorphism and boost::shared_ptr

The Lone C++ Coder's Blog from The Lone C++ Coder's Blog

Reposted from my old blog. Here’s the news from 2009… I’m currently in the final stages of converting a library from raw pointers to boost::shared_ptr. I’m mainly doing this to ensure the correct pointer/pointee ownership rather than the outright prevention of memory leaks, but the latter is a nice side effect of the former. One problem I ran into was that the library I’m updating and its clients make rather heavy use of polymorphism.

The official GNU Emacs 24.4 build is available for Windows

The Lone C++ Coder's Blog from The Lone C++ Coder's Blog

Looks like the Windows build of Emacs 24.4 has been released to on November 15th. As usual, I appear to be a few days behind the times. Time to upgrade and see how it compares to the unofficial 64 bit builds I’ve been using recently. Top new feature in 24.4 for me so far is the new rectangle-mark-mode. I’m doing a bunch of code conversions right now - basically transferring a bunch of manual assignments into a big lookup table - and it’s seeing a lot of use because of it.

Using pantheios to log from a C++ JNI DLL

The Lone C++ Coder's Blog from The Lone C++ Coder's Blog

I originally published this post on my old blog in 2009. I’ve edited it a little for readability but left the contents unchanged, so it may be out of date and not reflect the current state of the pantheios library. I also haven’t been using pantheios for logging since about 2010, and have been using Boost.Log instead. I recently had to come up with a logging solution for C++ code a JNI DLL/shared library that is providing the data translation layer between Java and underlying native C and C++ libraries.

Using tortoisehg and mercurial on Windows with openssh

The Lone C++ Coder's Blog from The Lone C++ Coder's Blog

The default setup for the Mercurial DVCS on Windows with tortoisehg uses plink and Pageant to manage SSH keys when you are using ssh as the transport protocol for mercurial. That’s most likely the right choice for a normal Windows setup, but if you already have openssh installed and configured to talk to various servers, it’s easy to switch mercurial and tortoisehg to use openssh. It’s also very helpful if you’re forgetful like me and forget to start pageant, add new keys to it etc.

A neat way of handling common C++ exceptions

The Lone C++ Coder's Blog from The Lone C++ Coder's Blog

Another slightly edited post from my old C++ blog. Again, you may have seen this one before. This post is a quasi follow-up to the “little exception shop of horrors”_. As I mentioned in that post, I believe the reason for dumping all the exception handling code into a single header file was a misguided attempt at avoiding code duplication. No, I didn’t write that code, so I can only speculate as to why it was done.

The little exception shop of horrors

The Lone C++ Coder's Blog from The Lone C++ Coder's Blog

This post first appeared on my old C++ blog. You might have seen it before. I think by now we can all agree that exceptions are generally a good thing in C++. They allow us to separate the error handling from the general flow of control inside a program and also enable us to handle errors at the most appropriate point. More often than not, the best point to handle errors is quite far removed from the source of the exception.

Writing: Becoming a Better Programmer

Pete Goodliffe from Pete Goodliffe

It's finally here!

My new book, Becoming a Better Programmer, is fully edited, laid out, and is now available as a final product for your reading pleasure, published by O'Reilly. You can purchase it in printed form or as a digital version for your e-reader of choice.

Find out more about the book from the O'Reilly product page. You can view the full table of contents there. Or head over to Amazon to purchase. If you are a Safari subscriber, you can read it here. Grab your iBook here.

The cover image is a flying fish. I'll leave it to your imagination to work out the significance.

It's great to finally see this labour of love come to fruition, and I do hope that stands as a useful resource for programmers today.

One of my favourite parts of the book is a family in-joke in the "advance praise" at the front. Nestled amongst the luminaries and expert programmers who graciously contributed their honest thoughts on the book is another very honest opinion: