Towards a Cleaner Emacs Build

I’m planning on getting back into Emacs development after being mostly absent for a couple of years. One thing that’s long annoyed me when tinkering with the Lisp bits of Emacs is the huge number of compilation warnings. The C parts of Emacs were fixed up at least a decade ago, but this is what compiling the Lisp directory looks like:

For me, this has been a source of having to go slower when coding: I make a change, look at the output from the compilation window, and then do a double take when I see some warning about something I didn’t think I had touched.

And then it turns out to be an old warning about something completely different.

The number of warnings in an Emacs build has been fluctuating, but sort of growing. There were 440 Warning: lines output by the build process, totalling 1800 lines on stderr. That’s kinda a lot to look at when doing a build.

There’s a number of reasons that the Emacs build looks like this, but the most important is perhaps the somewhat unique way the Emacs Lisp code has traditionally been developed: Many of the major modules have been maintained out-of-tree, and often support a huge number of Emacs versions dating back to the 1980s. Not to mention XEmacs.

This leads to there being conditional calls to code that doesn’t exist in modern Emacs, and code that doesn’t use new calling conventions.

The other is that, well, Emacs has a long history, but the Emacs Lisp language is evolving constantly, what with lexical binding and all. What was good code in 1993 now uses outmoded idioms, and these idioms trigger compilation warnings.

The development situation has changed somewhat over the last few years: Now most of the code in the Emacs tree is developed in the Emacs git repository, and the external packages are instead distributed using the Emacs package system. So the half-external/half-internal development isn’t as big an issue any more (although there are still (very) significant packages developed this way, like CC mode).

And XEmacs compatibility isn’t a major issue any more for many people.

So I thought now was the time to roll up my t-shirt sleeves and get stuck in to the code and get organisised.

90% of the warnings took 10% of the time: They were easy syntactic changes to bring code up to date with the new Emacs Lisp standards. The next 9% took 90% of the time. And then the last 1% took another 90% of the time.

So there was a lot of questions asked and some new tests implemented to ensure that the changes didn’t break anything.

And a lot of questions answered by all the smart people on emacs-devel.

But now it’s over! That is, there’s one single Warning: left, and that’s being pondered.

The total output from a “make bootstrap” is down from 5200 lines to 2900 lines (on this machine; it may vary somewhat), which is a 40% reduction. Looking at Emacs compiling now is a calmer experience.

I also added some new progress messaging in parts where a single section takes so long that it looks like it’s crashed or something, so it’s not purely a “get rid of lines” project.

Virtually all of the warnings fixed were valid warnings (i.e., they were about things we’d rather not see in the Emacs Lisp code), but some warnings were false positives. For instance, Emacs has a method to mark functions as obsolete, and then you get a warning if you load that code, which is a nice way of letting users know that something is going to disappear in a few years. (And Emacs has a very conservative removal policy; obsolete functions are kept around for like a decade.)

But functions are sometimes obsoleted in groups, so you may have one obsolete function calling another obsolete function in that group, and that will issue a compilation warning… and it shouldn’t.

So we’ve introduced a new macro

(with-suppressed-warnings ((obsolete an-old-function))
  (an-old-function :foo :bar))

to make the byte compiler know that we know about this, and not issue any warnings about that. (And there are similar things about the number of arguments to the functions.)

I had to use the macro about a dozen places, which isn’t a lot, percentage wise.

I hope the somewhat less daunting compilation output will help developers, old and new, to get more stuff done. At least a little bit.

NFLX2019 June 14th: Murder Mystery


Murder Mystery. Kyle Newacheck. 2019. ☆☆☆☆★★

Oh deer. Adam Sandler. Jennifer Aniston. And the director has a long an undistinguished career in television.

But, you know, Netflix is TV, so…

I assumed that this was going to completely horrendous, but it’s actually not that bad. The concept here is that Aniston and Sandler are working class Americans incongruously dropped into the midst of a bunch of very, very high class Brits in Malaga, and hilarity is supposed to ensue.

It’s kinda unpretentious silliness, really, set in a classic English murder mystery setting.

That said, so many of these scenes don’t really work. It’s like they’re almost there, but then the jokes just aren’t delivered fast enough, so you get an awkward pause where insanity should be. Or perhaps the jokes just aren’t funny enough.

But it’s way, way better than it has any reason to be. It rolls along in a very pleasant way and there’s a bunch of chuckles to be had.

This post is part of the NFLX2019 blog series.

NFLX2019 June 7th: Elisa & Marcela

Elisa & Marcela. Isabel Coixet. 2019. ☆☆☆★★★

Another Spanish Netflix Original? Sure, I’m game.

And it’s in black and white? Great. But… it looks kinda like an odd black and white? It’s looks a bit washed out… as if it was done on colour video and then they just dropped all the colour? I don’t know. But I’m oddly reminded of El abrazo de la serpiente. I mean, the movies couldn’t be more different, but I wonder whether the idea of not using colour while filming in famously scenic South America stems from the same place: i.e., going against cliché.

It’s been savagely panned by the critics, so I’m an optimist: Perhaps this’ll be great?

There’s a lot here I like: The languid pacing, the cameras getting way up into the actors’ faces, the two main actors themselves, the sparing use of music.

But it’s no masterpiece, unfortunately. The other characters are just too schematic and the dialogue doesn’t convince.

The squid thing is odd.

This post is part of the NFLX2019 blog series.

Ununicode

I’ve been messing around to see whether running a WordPress installation is fun or not (spoilers: it’s really not), and all of a sudden my test blog articles had turned a strange shade of non-UTF-8.

For instance, some texts I had quoted used that strange apostrophe in “it’s”, and that had turned into “it’s”.

Now, that sequence of characters (which are Unicode code points 0xE2, 0x20AC and 0x2122) bears no resemblance to the code point for ’, which is 0x2019. But the UTF-8 for ’ is #xE2 #x80 #x99, and that’s the clue: In Windows Code Page 1252, the Euro sign in #x80 and the TM sign is #x99, so what I had on my hands was UTF-8 interpreted as CP1252, and then output as UTF-8 by WordPress.

*phew*

I wondered whether any series of calls to `{en,de}code-coding-region’ coupled with `string-{as,to}-unibyte’ would possibly allow me to un-destroy the text, but that made my head hurt, so I wrote undecodify.el and put it on Microsoft Github.

(undecodify "it’s") => "it’s"

It’s trivial, but at least that fixed the blog articles.

Now I just have to wait for the next thing to go wrong with WordPress…

May Music

Music I’ve bought in May.

After restraining my music buying impulses for a very, very long time (a month or two?), I broke down in May and went on several shopping sprees.

In particular, I’ve been buying Joe Jackson live albums and singles and stuff. I grew up with Beat Crazy, that wild and weird new wave album, because one of my older sisters had it, but I haven’t really explored the “misc.” stuff he released in this period, and the live albums are surprisingly amazing. New versions of all the songs I love.

I mean.

And then… more more more stuff. *sigh*

jukebox.php?image=micro.png&group=R%C3%B3is%C3%ADn+Murphy&album=All+My+Dreams jukebox.php?image=micro.png&group=Ultra+Nat%C3%A9&album=Blue+Notes+in+the+Basement jukebox.php?image=micro.png&group=Machinedrum&album=Cached jukebox.php?image=micro.png&group=Joe+Jackson&album=Chrome jukebox.php?image=micro.png&group=Nils+Frahm&album=Encores+2
jukebox.php?image=micro.png&group=Lubomyr+Melnyk&album=Fallen+Trees jukebox.php?image=micro.png&group=Shockout&album=If+Yu+Know+Yu+Cockie+Bruck+Dung jukebox.php?image=micro.png&group=R%C3%B3is%C3%ADn+Murphy&album=Jacuzzi+Rollercoaster jukebox.php?image=micro.png&group=Bruce+Geduldig&album=Learning+To+Breathe jukebox.php?image=micro.png&group=Daniel+Thorne&album=Lines+of+Sight
jukebox.php?image=micro.png&group=Joe+Jackson&album=Live+1980-86+(1) jukebox.php?image=micro.png&group=Joe+Jackson&album=Live+1980-86+(2) jukebox.php?image=micro.png&group=Joe+Jackson&album=Mad+At+You jukebox.php?image=micro.png&group=Men&album=Making+Art+Remix+EP jukebox.php?image=micro.png&group=New+Order&album=Movement%3A+Remaster+(1)
jukebox.php?image=micro.png&group=New+Order&album=Movement%3A+Remaster+(2) jukebox.php?image=micro.png&group=Various&album=Nigeria+70+(No+Wahala%3A+Highlife%2C+Afro-Funk+%26+Juju+1973-1987) jukebox.php?image=micro.png&group=KH&album=Only+Human jukebox.php?image=micro.png&group=R%C3%B3is%C3%ADn+Murphy&album=Play+Thing jukebox.php?image=micro.png&group=Andy+Moor%2C+Yannis+Kyriakides&album=Red+v+Green
jukebox.php?image=micro.png&group=Fat+White+Family&album=Serfs+Up jukebox.php?image=micro.png&group=The+Clash&album=Super+Black+Market+Clash jukebox.php?image=micro.png&group=The+Oh+Sees&album=The+Cool+Deaths+of+Island+Raiders jukebox.php?image=micro.png&group=KiTsuNe+and+Brian+the+Fox&album=The+Future+Eve jukebox.php?image=micro.png&group=Joe+Jackson&album=The+Harder+They+Come
jukebox.php?image=micro.png&group=David+Cronenberg's+Wife&album=The+Octoberman+Sequence jukebox.php?image=micro.png&group=Hannah+Jones&album=The+Remixes+(CD3) jukebox.php?image=micro.png&group=R%C3%B3is%C3%ADn+Murphy&album=The+Rumble jukebox.php?image=micro.png&group=Deathcrush&album=The+Single+Series jukebox.php?image=micro.png&group=Machinedrum%2C+Sun+Ra&album=Views+of+Saturn
jukebox.php?image=micro.png&group=Paula+Frazer+and+Tarnation&album=What+Is+And+Was

NFLX2019 May 30th: Chopsticks

Chopsticks. Sachin Yardi. 2019. ☆☆☆☆★★

Hey, yet another Indian movie…

They have been of more variable quality than the American movies (which are mostly er not very good), so perhaps this’ll be good? It’s a comedy, at least.

This is mainly a Hindi-speaking film (I think?), but when they speak English (as all Indians seem to do at the drop of a hat), the subtitles disappear and it’s all pretty incomprehensible.

It’s got some pretty charming actors. Especially the lead, Mithila Palkar, is great as the hapless young woman doing her level best to live her life. The problem is that that level is so modest that you can’t help respond to most of these scenes with OH NOOOOOOOES! So there’s some cringe, but it winds its way through its plot in a quite pleasant way. It’s well made, but slight.

I laughed out loud at the antics here and there.

Uhm:

Like the inconvenient cutlery it is named after, there’s little reason to try it if there are alternatives to be found.

That’s a weird flex, but whatevs.

The plot is basically Pygmalion, but in a very tidy Indian underworld. The education she’s subjected to feels more than a little abusive at times, though. And some of the twists are just too too.

This post is part of the NFLX2019 blog series.