RTFM, or how to make unnecessary work for yourself editing inf-mongo

Turns out I made some unnecessary “work” for myself when I tried to add support for command history to inf-mongo. As Mickey over at Mastering Emacs points out in a blog post, comint mode already comes with M-n and M-p mapped to comint-next-input and comint-previous-input. And of course they work in inf-mongo right out of the box. I still prefer using M-up and M-down, plus I learned a bit about sparse key maps and general interaction with comint-mode. So from that perspective, no time was wasted although it wasn’t strictly necessary to put in the work.

But with Emacs being the box of wonders it is, it’s still fun to learn about features and new ways of doing things even after using it for a couple of decades.

There are a more gems hidden in Mickey’s blog post so if you’re using anything that is based on comint, I would really recommend reading it.

Extending inf-mongo to support scrolling through command history

I’m spending a lot of time in the MongoDB shell at the moment, so of course I went to see if someone had built an Emacs mode to support the MongoDB shell. Google very quickly pointed me at endofunky’s inf-mongo mode, which implements a basic shell interaction mode with MongoDB using comint. We have a winner, well, almost. The mode does exactly what it says on the tin, but I wanted a little more, namely being able to scroll through my command history. Other repl modes like Cider have this functionality already, so it couldn’t be too hard to implement, could it?

Read More

What happened to XEmacs?

I used XEmacs quite a lot in the 2000s before I switched back to the more stable GNU Emacs. That was back then before GNU Emacs offered a stable official Windows build when XEmacs did, and at the time I was doing a lot of Windows development.

Out of curiosity and for some research I tried to look into the current state of the project and found that the www.xemacs.org appears to be unreachable. The domain still exists and according to whois was last updated in September 2015. The XEmacs Sourceforge page is still around, but appears to have received its last set of updates in 2009. Obviously a lot of links to the bug tracker, mailing list hosts etc are dead as they’re point to subdomains of xemacs.org.

Anybody know what happened to the project? The only reference I found was a post from January 2016 on a website I’ve never heard of (8ch.net) referencing a post on the XEmacs development that I can’t get at anymore (becauses lists.xemacs.org is dead) that suggests XEmacs development is officially dead now.

Building Emacs 25.1 on Ubuntu 16.10

A reader of this blog kindly pointed out that my instructions for building Emacs 25.1 on Ubuntu 16.10 result in a core dump when the build process bootstraps emacs. I only tested the instructions on 16.04 so I hadn’t run into this issue yet.

The core dump on 16.10 appears to be a known issue and there is a workaround. Instead of running configure with just the prefix argument, run it as follows:

./configure CFLAGS=-no-pie --prefix=$HOME/local

The in-depth bug description is here in message #38. The short version is that gcc in Ubuntu 16.10 defaults to building code with -pie and this breaks Emacs. Turning off -pie results in a working executable.

How to build GNU Emacs 25.1 on (X)Ubuntu 16.04

Now that GNU Emacs 25.1 has been released, it is time for my customary “how to install Emacs 25.1 on a recent Ubuntu” post. In my case I’m using XUbuntu 16.04, but the instructions are pretty much the same for just about every recent Ubuntu version. The package versions of the referenced packages differ, but the package names haven’t changed since I first published one of these posts.

Read More

Scheduling WordPress posts with org2blog

Another metablogging post, but this may come in handy for people who like to produce blog posts in bulk and schedule them for publication in WordPress at a later date.

In my case, my ability to find time to blog is directly correlated to my workload in my day job. That’s why you see regular gaps in my posting that may last for a few weeks to a month or two.

To counteract this, I try to write multiple blog posts in one sitting when I’ve got both the time and am inspired to write, then schedule them such that WordPress pushes them out automatically over the next few days or weeks. My normal workflow for this was:

  • Write post in org2blog
  • Publish post to WordPress, adjust the publication date
  • Edit the post in org2blog again, push in and then remember to tweak the publication date because org2blog overwrote the publication date

The last two steps of course are unnecessary. See the #+DATE: line in the first line of the screenshot?

org2blog highlighted date entry
Date section in an org2blog post during editing

When you create a new blog post using org2blog/wp-new-entry, just edit the date that org2blog automatically inserts to your desired post schedule and the setting will carry over into WordPress. Easy if you know how.