Running Emacs from inside Emacs

I’m experimenting with screen recordings at the moment and just out of curiosity decided to see if I can load and edit a text file inside the main Emacs process from inside an ansi-term using emacsclient.

Spoiler alert – yes, you can. At least the way it is set up on my system, emacsclient doesn’t play with text mode (-nw) as it doesn’t reconise eterm-color as a valid terminal type, but loading and editing the file into the GUI works flawlessly.

Emacs on the Linux Subsystem for Windows

I’ve had the Linux Subsystem for Windows enabled for quite a while during the time it was in Beta. With the release of the Fall Creators Update, I ended up redoing my setup from scratch. As usual I grabbed Emacs and a bunch of other packages and was initially disappointed that I was looking at a text-mode only Emacs. That might have something to do with the lack of an X Server…

For a free X Server on Windows, I had a choice of Xming and VcXsrv. I had used Xming a long time ago and while I’m happy to pay for software, I figured I’d just go with something free for this initial proof of concept. Plus, I was curious about VcXsrv, so I picked that. I really like that its installer includes everything I needed right out of the box, including the fonts.

Read More

SE-Radio interviews Ron Lichty, must listen for development managers

The Software Engineering Radio podcast has just published an episode with an interview with Ron Lichty. If you’re either thinking about moving from development into management or already have, it’s well worth a listen. Unfortunately there is only so much that can be packed into an hour’s worth of a podcast, but just based on the podcast, Ron’s book “Managing the Unmanageable” just found itself added to my ever-growing reading list.

Direct link to the episode.

Installing specific major Java JDK versions on OS X via Homebrew

In an earlier post, I described how to install the latest version of the Oracle Java JDK using homebrew. What hadn’t been completely obvious to me when I wrote the original blog post is that the ‘java’ cask will install the latest major version of the JDK. As a result, when I upgraded my JDK install today, I ended up with an upgrade from Java 8 to Java 9. On my personal machine that’s not a problem, but what if I wanted to stick with a specific major version  of Java?

Read More

Emacs 25.3 released

Emacs 25.3 has been released on Monday. Given that it’s a security fix I’m downloading the source as I write this. If you’re using the latest Emacs I’d recommend you update your Emacs. The vulnerability as been around since Emacs 19.29, you probably want to upgrade anyway.

Build instructions for Ubuntu and friends are the same as before, the FreeBSD port appears to have been updated already and I’m sure homebrew is soon to follow if they haven’t updated it already.

Cleaning up UTF-8 character entities when exporting from WordPress to Jekyll

I’ve been experimenting with converting this blog to Jekyll or another static blog generator. I’m sticking with Jekyll at the moment due to its ease of use and its plugin environment. The main idea behind this is to reduce the resource consumption and hopefully also speed up the delivery of the blog. In fact, there is a static version of the blog available right now, even though it’s kinda pre-alpha and not always up to date. The Jekyll version also doesn’t have the comments set up yet nor does it have a theme I like, so it’s still very much work in slow progress.

To export the contents from WordPress to Jekyll I use the surprisingly named WordPress to Jekyll exporter plugin. This plugin dumps the whole WordPress data including pictures into a zip file in a format that is mostly markdown grokked by Jekyll. It doesn’t convert all the links to markdown, so the generated files need some manual cleanup. One problem I keep running into is that the exporter dumps out certain UTF-8 character entities as their numerical code. Unfortunately when processing the data with Jekyll afterwards, those UTF-8 entities get turned into strings that are displayed as is. Please note I’m not complaining about this functionality, I’d rather have this information preserved so I can rework it later on. So I wrote a script to help with this task.

Read More

Building Emacs 25.2 on XUbuntu 17.04

I haven’t done much with Ubuntu recently, but had to set up a laptop with XUbuntu 17.04. That came with Emacs 24.5 as the default emacs package, and as skeeto pointed out in the comments, with a separate emacs25 package for Emacs 25.1. I tend to run the latest release Emacs everywhere out of habit, so I revisited my build instructions to build a current Emacs on Ubuntu and its derivates. The good news is that in thanks to some changes in the Emacs build, the build is as straightforward as it used to be prior to the combination of Ubuntu 16.10 and Emacs 25.1. In other words, no need to remember to switch off PIE as was necessary when building GNU Emacs 25.1 on Ubuntu 16.10.

Here’s a brief recap of the build steps so you don’t have to go back and click your way through my old posts.

First, if you haven’t enabled the ‘source code’ repository in Ubuntu’s software sources, do so now. If you don’t, you’ll run into the following error when installing the build dependencies for Emacs:

E: You must put some 'source' URIs in your sources.list

Assuming you have added the source code repositories to your software sources, execute the following commands. The first command installs the build tools, the second one installs all the build dependencies for the stock Emacs build. Those dependencies will give you a fully functioning GUI Emacs. If you need additional third party libraries for additional functionality that aren’t covered by the regular Ubuntu Emacs build dependencies, make sure you install those also. I usually go with the stock configuration so for me, these are the two commands I need to run:

sudo apt install build-essential
sudo apt build-dep emacs25

On my fresh install of XUbuntu 17.04, the build-essential packages were already installed, so it may not be necessary to execute that step any longer. However, it was necessary in the past so I’m still leaving it in there as it makes sure you have the normal build setup.

You can install the build-deps for either the emacs or the emacs24 package instead of the one for the emacs25 package as I show in the example above. They all appear to install the same dependencies as trying to install all three doesn’t appear to result in any additional packages being installed.

At this point, it’s time to download the GNU Emacs 25.2 tarball from your favourite GNU mirror, extract it to a suitable place and do the usual configure/make/make install dance. I prefer to install my home built binaries in a local subtree in my user directory, hence the $HOME/local prefix passed to configure:

./configure --prefix=$HOME/local
make && make install

At this point, we’re good to go:

timo-xubuntu-VirtualBox% emacs --version
GNU Emacs 25.2.1
Copyright (C) 2017 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

The instructions above will also work for building Emacs 25.2 on older versions of Ubuntu, although you have to make sure that you pick the correct build-dep package to install the build dependencies first.

Why I don’t like getter and setter functions in C++, reason #314.15

This is a post I wrote several years ago and it’s been languishing in my drafts folder ever since. I’m not working on this particular codebase any more. That said, the problems caused by using Java-like getter and setter functions as the sole interface to an object in the context described in the post have a bigger impact these days as they will also affect move construction and move assignment. While I’m not opposed to using getter and setter functions in C++ in general, I am opposed to using them as the only member access method and especially in this particular context where they had to be used to initialise class members that were complex objects themselves.

Read More

Tracking down why the iOS mail app couldn’t retrieve my email over an LTE connection

We all love the odd debugging story, so I finally sat down and wrote up how I debugged a configuration issue that got in the way of the iOS mail app’s ability to retrieve email while I was on the go.

tl;dr – iOS Mail uses IPV6 to access you email server when the server supports IPV6 and doesn’t fall back to IPV4 if the IPV6 connection attempt fails. If if fails, you don’t get an error, but you don’t get any email either.

The long story of why I sporadically couldn’t access my email from the iOS 10 Mail app

Somewhere around the time of upgrading my iPhone 6 to iOS 10 or even iOS 10.2, I lost the ability to check my email using the built-in iOS Mail app over an LTE connection. I am not really able to nail down the exact point in time was because I used Spark for a little while on my phone. Spark is a very good email app and I like it a lot, but it turned out that I’m not that much of an email power user on the go. I didn’t really need Spark as Apple had added the main reason for my Spark usage to the built-in Mail app. In case you’re wondering, it’s the heuristics determining which folder you want to move an email to that allow both Spark and now Mail to suggest a usually correct destination folder when you want to move the message.

Read More

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. Of course these keybindings 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.