Variable Pitch Tables

While using the Emacs WordPress interface on various screens here, it became clear that the sloppy way I was laying out various tables just didn’t really work. I was using the `variable-pitch’ font and sort of eyeballing how much space each column would take and then using `display ‘(space :align-to 100))’ to line stuff up.

But the size of fonts varies wildly from computer to computer, and what looked nice on my HiDPI laptop didn’t line up at all on my LoDPI screen.

So I switched to using fixed-width fonts:

And I just thought, *sigh*.

It just looks so oldz. I spend a lot of time in Emacs in eww which does nice fonts, so I’ve grown less used to the er starkness of tables like this.

Surely there has to be a way to do tables with proportional fonts, and of course there is: eww/shr lays stuff out without a problem, so I just had to take a similar approach here.

And behold:

The package is on Microsoft Github now.

This also allowed me to implement table headings that you can click on to sort the table on the different columns. And I wanted to keep the interface really simple, because I have to say that I hate working with the tabulated-list.el interface, which is a mess of buffer-local variables and magic always happening wherever you’re not looking in the code.

So the interface is one simple function that takes obvious parameters: A list of column names and max widths, and then a list of row contents:

(variable-pitch-table
 '((:name "First" :width 10)
   (:name "Second" :width 5))
 '(("A thing" "Yes")
   ("A wide thing that needs chopping" "And more")
   ("And the last one" "Foo")))

But you’d normally pass in strings that are made with something like

(propertize "At thing" 'face 'variable-pitch)

to get whatever proportional font you want on each element.

Further Fun With the Clipboard

In the previous episode of this blog, I mused about how Emacs should perhaps handle non-text yanking (i.e., HTML and images).

I didn’t really want to write a mode to examine the clipboard and the selections, but I did anyway just now, and I discovered something kinda interesting.

Well I never!

Anyway, this is basically what the mode looks like:

It just lists all the types of selection that exist under the primary/secondary selections, as well as the clipboard. In this instance, I’ve done a “Copy image” in Firefox. So I can inspect the text/html “version” the image…

Which turns out to be the <img;> bit, logically enough.

And the image/png is the image itself, even more logically enough.

But here’s the slightly interesting bit: If you mark some text in Firefox (i.e., put the text into the primary selection in nerd speak), you get these selection types:

And the TEXT bit is as you’d expect…

But what’s that text/x-moz-url-priv?

It’s the URL of the page you marked the text on! This can obviously be used for UX purposes, like providing a function that’d simultaneously quote something and do the link at the same time. Like this:

So something like:

  (when-let ((url (x-get-selection-internal 'PRIMARY 'text/x-moz-url-priv)))
    (insert (format "On <a href="%S">somebody</a> wrote:\n\n"
                    (ewp-decode-text-selection url))))
  (insert "<blockquote>\n")
  (insert (substring-no-properties (current-kill 0)))
  (insert "</blockquote>\n\n")

You can find this stuff on Microsoft Github.

Chrome isn’t as helpful as Firefox here, you just get a very minimal selection list when marking some text there:

(Oh, yeah, I added a command to do screenshots directly from the ewp composition buffer. Otherwise this blog would have taken me HOURS and HOURS to make.)

Of course, how useful this stuff is outside of a writing-for-the-web context is debatable…

PERSON A: It’s not useful!

PERSON B: Oh, OK.

Well, that was a short debate!

March 1942: Reap the Wild Wind




















When I saw the start of the title sequence, with the American eagle and everything, I thought that we’d finally arrived at a honest-to-goodness American war movie.

But no: It’s a Cecil B. DeMille extravaganza set in 1840.

It’s a romantic/comedic/epic kind of thing, and I had no idea that the plot would get this complicated. It’s very nice watching a movie and not really knowing where it’s going, in a general sense. And it doesn’t happen that often. I wasn’t even sure what genre this was going to turn out to be.

Paulette Goddard is great as the leading character here, and it’s fun seeing John Wayne not on a horse. And looking younger than most films I’ve seen him in.

If you want to be picky, I thing you could say that this film just goes through too many phases: Naval adventure, romantic intrigue, courtroom drama and finally undersea horror. But I like it. It’s huge and unwieldy, but it’s good.

Reap the Wild Wind. Cecil B. DeMille. 1942.

Popular movies in March 1942 according to IMDB:

PosterVotesRatingMovie
3966.8Star Spangled Rhythm
8776.8The Male Animal
22856.8Reap the Wild Wind
3696.7The Courtship of Andy Hardy
3976.7Rings on Her Fingers
3056.5Always in My Heart
5886.2To the Shores of Tripoli
41206.1The Ghost of Frankenstein
8084.2Black Dragons

This blog post is part of the Decade series.

February 1942: To Be Or Not To Be














To Be Or Not To Be. Ernst Lubitsch. 1942.

Oh yeah! This one! I’ve seen it several times before. And the Mel Brooks remake, of course. I’ve been attempting to avoid movies I’ve seen before in this blog series, but my research sucks!
“Heil myself.”

It’s a very funny film, of course, and as a comedy/thriller everything fits together so neatly. Masterful. But I wonder what on earth they were thinking when making this. I mean, Germany had invaded Poland in 1939, and the horrors in Poland were ongoing when they made it. So… they responded by making a very funny movie making fun of Germans.
Ah, yeah, not everybody were amused:

To Be or Not To Be, now regarded as one of the best films of Lubitsch’s, Benny’s and Lombard’s careers, was initially not well received by the public, many of whom could not understand the notion of making fun out of such a real threat as the Nazis. According to Jack Benny’s unfinished memoir, published in 1991, his own father walked out of the theater early in the film, disgusted that his son was in a Nazi uniform, and vowed not to set foot in the theater again. Benny convinced him otherwise and his father ended up loving the film, and saw it forty-six times.

(According to a wikipedia.)

Popular movies in February 1942 according to IMDB:

PosterVotesRatingMovie
199808.2To Be or Not to Be
31827.7Kings Row
9747.6Castle in the Desert
70597.3Woman of the Year
11577.1Ride ‘Em Cowboy
4297.1Mr. Wise Guy
12647.0Roxie Hart
4576.7The Great Man’s Lady
10396.5Captains of the Clouds
4636.3The Lady Is Willing

This blog post is part of the Decade series.