Lacking Natural Simplicity

Random musings on books, code, and tabletop games.

Sorting differs between LANG=C and LANG=en_US.UTF-8, even in ls

This is here mostly to give me a concrete example of this happening.

I have a directory, with two files in it, ab.txt and a-c.txt. Which sorts first when I do a ls? It depends on what locale is set. Like this:

$ LANG=en_US.UTF-8 ls
ab.txt       a-c.txt
$ LANG=C ls
a-c.txt  ab.txt

Same thing happens with the sort command:

$ cat >a-c-first.txt
$ cat >ab-first.txt
$ LANG=C sort ab-first.txt
$ LANG=en_US.UTF-8 sort a-c-first.txt

I found this surprising when it first broke some code I was using, since I'd spent so much of my existence in LANG=C (I'm still surprised that Unicode has existed for more than half my life), but once I set LANG=en_US.UTF-8 because I was using UTF-8 characters in my documents I found I was in a different (sorting) world.

Making a newer version of groff work with man and emacs on macOS

I'm posting this mostly to remind myself if I ever have to fiddle with this again.

I use a version of groff installed from git because some of my documents depend on fixes that are coming out in the next release, 1.23.0. I install it on my macOS machine in /usr/local/sw/versions/groff/git. (The directory hierarchy under /usr/local/sw/versions is where I put programs that I compile from scratch, to keep them separated from the programs that come from the operating system and/or package managers. I often have more than one version of a program installed, therefore the versions component of the name.)

Because the groff that is first in my path is the new one I installed, and because man on macOS knows to look for man pages according to what your PATH is, when I say man groff_ms I get the new man page for groff_ms. Yay! Unfortunately, it gets rendered with the old groff that macOS supplies, version 1.19.2, which doesn't include the .SY macro that current versions of groff supply in their man macros, and which they use in their man pages, so it renders wrong. A typical example is that when it renders groff_ms(7) the groff -ms and groff -m ms are missing from the lines in the SYNOPSIS section. Boo!

Luckily, man takes a -C option that lets you specify an alternate configuration file (on macOS the default one is in /private/etc/man.conf), so you can supply one that specifies the absolute path to the newer groff you are using. So I added

alias man='man -C ~/local/etc/man.conf'

to the appropriate shell startup file. And I can add

(setq Man-switches "-C ~/local/etc/man.conf")

to my emacs configuration so it uses the right version of groff too.

But a modern groff produces ANSI escapes for bold and underline, rather than the older convention of over-striking via the backspace character with the same character for bold or with the underscore character for underlining. My pager, less, can deal with that, but something in emacs doesn't like that, leaving the buffer with groff_ms(7) with underlining on every line.1

Eventually I figured out that the old style over-striking via backspaces worked just fine with emacs, so I added the -P-c option to the invocation of groff in the NROFF definition in my modified man.conf file. That tells groff to pass the -c option to the grotty output driver, which tells it to use old-style backspace over-striking.

This seems overly complicated.

I suspect I'll need to do something different on the Linux boxes I use.


Aannnd I was right. Fedora 33 has a similar problem, which I fixed by creating a ~/.manpath file with

DEFINE       nroff   /sw/versions/groff/git/bin/nroff -mandoc -P-c

in it. I found the information I needed in manpath(5), which documents the format of the /etc/man_db.conf file. (Why isn't it man_db.conf(5), then?)


Oddly, if I direct man's output to a file, visit that file in emacs, and manually invoke the Man-fontify-manpage function emacs uses to fontify the man page, it doesn't end up erroneously underlined.

Last edited: 2021-09-09 10:11:03 EDT

BX Options: Class Builder

BX Options: Class BuilderBX Options: Class Builder by Erin D. Smale
My rating: 5 of 5 stars

If you are looking for a way to customize existing classes or create new classes for B/X D&D style games, especially Old-School Essentials, this book is a wonderful resource. It breaks the original classes down into their fundamental parts and provides a simple system for building those parts into new or customized classes. It presents the breakdown for each of the original classes, then provides a list of class variants, customized versions of the original class, as well as sub-classes, heavily redesigned classes. For instance, for the Cleric, the class variants are: Cleric (Dead God), Cleric (God of Death), Cleric (God of Knowledge), Cleric (God of Life), Cleric (God of Nature), and Cleric (God of War); and the sub-classes are Crusader and Shaman. Class variants and sub-classes are presented for Cleric, Dwarf, Elf, Fighter, Halfling, Magic-User, and Thief. It also provides a version of Thief skills using the d6, other d6 skills that can be used in creating classes, some additional armour, weapons, and ammunition, an optional table for spell failure in appropriate circumstances (for example, when non-casters read a spell scroll), a table of special abilities gained by classes that have animal companions, differing depending on the animal in question, and options for characters to gain at high levels, beyond the limits of their level progression tables.

I'll definitely be using this in my next B/X-style game!

View all my reviews at Goodreads

I wish the B/X and OD&D retro-clones had added a "Saving Throw" entry for spells

One simple improvement on B/X D&D and OD&D that wouldn't have been a change in the rules, just a change in presentation, that I've wished that the B/X and OD&D retro-clones had made was adding a “Saving Throw” entry to their spell descriptions, like that of AD&D. As it is, you have to read the spell description to figure out if a saving throw is allowed and what it means.

Basic Fantasy; Labyrinth Lord and Advanced Edition Companion; Old-School Essentials Classic Fantasy and Advanced Fantasy; Sword & Wizardry Complete, Core, and Whitebox; and Delving Deeper, all fail to do this.

I'm really surprised that Old-School Essentials didn't do this, with all its other improvements to the presentation of B/X style games.

Oh well. Maybe OSE will add it in a later edition.

Last edited: 2021-07-25 13:23:05 EDT

Echoes of Valor II, ed. by Karl Edward Wagner

Echoes of Valor IIEchoes of Valor II by Karl Edward Wagner
My rating: 5 of 5 stars

Another excellent collection of heroic fantasy edited by Karl Edward Wagner. I think I had read all the fiction before, by Robert E. Howard, C. L. Moore, (with Henry Kuttner and Forest J. Ackerman as coauthors on different stories), Leigh Brackett with Ray Bradbury as coauthor, and Manly Wade Wellman, but I was glad to read them again. KEW's introductions are worth reading, as were the nonfiction giving the stories context.

Anyway, I greatly enjoyed this collection.

View all my reviews at Goodreads

I had not known about C.L. Moore's disappearance from the science fiction scene and her struggle with Alzheimer's disease and her eventual coma and finally death on April 4th, 1987. I don't remember having read C.L. Moore at that time; I came to it much later, when I was reading swords and sorcery and sword and planet fiction in the 2000s, rereading old favorites and reading stories I'd not read before. That's also when I read the Leigh Brackett and Ray Bradbury story in this collection, though I'd read her John Eric Stark stories and novels sometime before. And the 2000s is also probably when I first read Manly Wade Wellman's stories of Hok the Mighty.

Echoes of Valor, ed. by Karl Edward Wagner

Echoes of ValorEchoes of Valor by Karl Edward Wagner
My rating: 4 of 5 stars

Excellent collection of what I've read Wagner prefered to call heroic fantasy, but which is often called sword & sorcery. I had already read Howard's "The Black Stranger", first in its rewritten version ad a pirate story, "Swords of the Red Brotherhood", with Conan replaced with Howard's swashbuckling hero Black Vulmea, and later in its original form in the Del Rey trade paperback collection The Conquering Sword of Conan, but it was good to read it again. I was also familiar with Leiber's "Adept's Gambit", and enjoyed rereading it as well. Kuttner's "Wet Magic" was new to me, and I liked it, though not as well as the Howard and Leiber stories.

View all my reviews at Goodreads