How To Build the Development Version of Emacs on Windows

I think I’ve probably spent… more than an hour? but less than three hours? My entire life? on a Windows machine, so I’m the most qualified person ever to explain how to get started developing Emacs on Windows.

Because people who’ve used Windows before don’t really know what other people don’t know. It’s about the unknown unknowns.

So here’s a guide to get this working anyway, if you’re a Linux-ey person, and for some inexplicable reason you want to build the development version of Emacs on Windows.

1) Install Windows in a VM. Download the ISO from here. Then open virt-manager on your GNU/Linux machine, create a new machine, and point it at the ISO. You’ll be faced with a whole bunch of questions from Windows when installing, but answer “no” to as many as possible. Less surveillance is better.

2) After it’s up and running, search for “powershell” in the search field at the bottom of the screen. Start the “for administrators” version.

3) Type this:

Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0

Yes, those tildes and the numbers and all. And then:

Start-Service sshd
Set-Service -Name sshd -StartupType Automatic
ssh localhost

The latter should give you a login, so just try that to see whether it works.

4) From your GNU/Linux machine, say

scp ~/.ssh/authorized_keys windblows:.ssh/

This will later enable you to ssh to the machine without passwords, but first we have to do more confing, so we might as well just start installing the Linux-ey prerequisites already, because that makes things easier.

5) Install Cygwin by clicking on the “setup-x64_64.exe” link. It’ll ask you more questions, but just answer yes to everything.

6) Done! You don’t need to do anything more on the console, so get back to the couch and do the rest via ssh from a GNU/Linux machine, like a proper human being.

You can copy and paste the rest of this into your ssh session:

C:\cygwin64\bin\bash -l sed -i -E 's/^Match Group administrators|AuthorizedKeysFile __PROGRAMDATA__/#&/' /cygdrive/c/ProgramData/ssh/sshd_config
powershell -command "restart-service sshd"
curl -O https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg
install apt-cyg /bin
sed -i 's/lynx -source/curl/' /bin/apt-cyg
apt-cyg install wget
apt-cyg install gcc-core git automake autoconf libgnutls30 make gnutls libncurses-devel gnutls-devel libjpeg-devel libpng-devel libharfbuzz-devel libXpm-noX-devel libgif-devel libxml2-devel libjansson-devel libdbus1-devel librsvg2-devel libtiff-devel libXpm-devel
git clone https://git.savannah.gnu.org/git/emacs.git
cd emacs
./autogen.sh
./configure --with-native-image-api --with-w32
make -j8
./src/emacs

Presto! This should now be displaying in the VM, if you run over to it and have a look:

But you’d normally say

./src/emacs -nw

when working remotely from the sofa, of course.

Additional tweaks: Windows only uses one CPU by default (?), and qemu/virt-manager will tell the Windows client that it has many CPUs. To make it say that it has a lot of cores instead, say:

# virsh edit win10

Find the bit that says:

<cpu mode='host-model' check='partial'>

and edit that into:

<cpu mode='host-model' check='partial'>
    <topology sockets='1' dies='1' cores='8' threads='2'/>
</cpu>

Or however many cores/cpus you have. This will make building Emacs a lot quicker.

(Tips for improving the installation recipe are welcome, of course.)

The Best Albums of 2020

It’s that time of year again: December. Unlike other people who come up with “best of” lists, I use a totally scientific method, and therefore my list is more correct: Emacs tallies which albums I’ve listened to the most in 2020, and those are ipso facto cogito alea jacta hoc the best albums of the year.

ARE YOU DOUBTING SCIENCE

Irreversible Entanglements

Who Sent You?

Sacred Paws

Run Around The Sun

Gil Scott-Heron

We’re New Here (a Reimagining by Makaya McCraven)

Nihiloxica

Kaloli

75 Dollar Bill

I Was Real

Adult.

Perception is-as-of Deception

Joan as Police Woman

Cover Two

Max de Wardener

Music For Detuned Pianos

Peter Broderick & Friends

Play More Arthur Russell

Yves Tumor

Heaven To A Tortured Mind

Aksak Maboul

Figures

Four Tet

Sixteen Oceans

Shirley Collins

Heart’s Ease

Shopping

All Or Nothing

The Soft Pink Truth

Shall We Go On Sinning So That Grace May Increase

So there you have it: Irreversible Entanglements released the best album this year. I hope somebody notifies the AP of these developments.

But I didn’t just buy new music this year. No. I’ve never been discoging more. It’s almost like I was spending more time on the couch this year than previous years. I don’t know why. (I seem to have acquired about 450-ish releases this year.) So here’s the best old music that I discovered this year. It’s slightly less scientific because of the selection criteria.

Fad Gadget

Fireside Favourites

Trash Kit

Confidence

Severed Heads

Clifford Darling, Please Don’t Live In The Past

Tuxedomoon

Live At The Palms (1978)

Biting Tongues

Don’t Heal

Brian Auger & Julie Tippetts

Encore

Don Armando’s 2nd Avenue Band

Don Armando’s 2nd Avenue Band

Mike Rutherford

Smallcreep’s Day

Aksak Maboul

Before and After Bandits

David Allred

Alone on Friendship Island

Jerry Harrison

The Red And The Black

Jim Black Trio

Reckon

Keith Tippett, Julie Tippett, Trevor Watts, Colin McKenzie

Warm Spirits, Cool Spirits

Kid Creole & The Coconuts

Off the Coast of Me

Mars

3E

It’s been the best year ever, both for new and old music.

Except for some other years.

There. I said it.

MCMXXXIX VII: Nancy Drew… Reporter

Nancy Drew… Reporter. 1939. William Clemens.

I mean… I didn’t expect much from this movie — it’s a shortish, goofy B movie thing. But it seems odd to me how little of the Nancy Drewiverse they’ve retained? I mean… I don’t remember much of Nancy Drew… but didn’t she have a gal pal? And stuff? This just seems to be… kinda generic… “teenage girl detective” stuff?

I may be totally wrong, and this is canonical Nancy Drew.

Other than that, there doesn’t seem to be anything wrong with this move: It’s a kids’ mystery movie, and the performances are pretty fun to watch. The mystery isn’t very mysterious.

This is a pretty amusing movie.

I mean, it’s not… good? But it’s amusing.

This blog post is part of the 1939
series
.

MCMXXXIX VI: Made for Each Other

Made For Each Other. John Cromwell. 1939.

Oh, I’ve seen this one before! And not too long ago, either. I wonder where…

Emacs knows everything. I watched this in… October? Last year?

Hey! I even blogged about it. This is a serious break-down in my movie methodology.

Oh well! Now it’s in 2K.

I’m liking it a lot more this time around.

OK, now I see what I was talking about in the previous blog. It’s really odd in that … there’s not much of anything going on. It seems like it’s aiming for screball comedy, but the timing is all off.

It’s like they could have just changed these scenes a smidgen, and it’d be hilarious. But instead the scenes just … sit there: They’ve got all the ingredients right, but it just doesn’t work.

So weird.

I can only imagine what Preston Sturges would have done with this material. It’s got scenes that should be hilarious, but instead are just kinda tepid. It’s got scenes that should be seething with righteous anger, but instead are just vaguely annoyed with the extreme injustice of what’s happening.

It’s a movie of squandered opportunities, but the performances are really good. Carole Lombard, or course, but also the smaller roles, like Louise Beavers.

Just when you think it’s gotten as bad as it’s going to get, it get worse.

Man.

I wonder whether there was something here at some point, but then was somehow ruined during the making.

This blog post is part of the 1939
series
.