Sunday, March 15, 2009

C. Shirky on the end of newspapers (again)

You must Read The Whole Thing, but here is a taste:

Revolutions create a curious inversion of perception. In ordinary times, people who do no more than describe the world around them are seen as pragmatists, while those who imagine fabulous alternative futures are viewed as radicals. The last couple of decades haven’t been ordinary, however. Inside the papers, the pragmatists were the ones simply looking out the window and noticing that the real world was increasingly resembling the unthinkable scenario. These people were treated as if they were barking mad. Meanwhile the people spinning visions of popular walled gardens and enthusiastic micropayment adoption, visions unsupported by reality, were regarded not as charlatans but saviors.

When reality is labeled unthinkable, it creates a kind of sickness in an industry. Leadership becomes faith-based, while employees who have the temerity to suggest that what seems to be happening is in fact happening are herded into Innovation Departments, where they can be ignored en masse. This shunting aside of the realists in favor of the fabulists has different effects on different industries at different times. One of the effects on the newspapers is that many of their most passionate defenders are unable, even now, to plan for a world in which the industry they knew is visibly going away.

(Some of these sentences strike me as being more widely applicable than upheavals in industry.)

If newspapers were truly serving a critical social function (keeping the powerful honest by shining light into dark corners of the body politic, etc.) in the 20th century, then it was always somewhat weird that this function was invariably impossible without adverts for department stores and used car salesmen and lonely people looking to get dates with strangers. Perhaps our current configuration of information production is also strange: Google, Yahoo, et al. appear to serve a different critical function in the information economy, and they're also supported by adverts (the equivalence isn't exact; but I won't get into the differences here). Even so, it's really deeply weird that people supposed that the old weird arrangement would last forever — that no possible technological innovation or economic reconfiguration would upset this duct-taped applecart.

I mean, if you explained this to aliens, they would laugh at you. "Ha ha! Your species' highest form of social organization, the 'hybrid capitalist/socialist democracy', cannot function correctly unless local distributors of colored fabric find it economically necessary to piggyback solicitations on the physical distribution network of their local information discovery node!"

As Shirky points out, there's nothing particularly natural about the way things used to be. And the people who will save journalism aren't the ones complaining about technological innovation; they're the ones who are building something new.

Incidentally, lately I'm tempted to get a Kindle and buy some periodical subscriptions. I've realized that the obstreperous physicality of codexes and broadsheets really does affect my reading habits these days. S. B. Johnson has already observed that the Kindle's much better for reading while eating than a codex. And, of course, holding a codex or broadsheet one-handed on a crowded Muni bus, and then turning the page, is a pain in the ass. Meanwhile, although my HTC Dream has a capable web browser that's fine for most RSS and blog reading, it's not the greatest device for reading long stretches of text. Now, all these obstacles can be overcome, but the overall effect of these physical annoyances is to reduce the amount of time I spend reading long-form text or text printed on paper, and increase the amount of time I spend reading short-form text available electronically. But I already read so much short-form electronic text that it would probably be better to shift my habits in the other direction.

On the other hand, for reasons I have difficulty completely articulating, I would feel like a huge tool holding a Kindle on Muni every morning. So there's that to consider.

p.s. Johnson also had a piece yesterday on roughly the same topic as the Shirky essay linked above.

Saturday, March 14, 2009

Fix dired under Fink xemacs (Mac annoyance Saturday)

Tonight I literally spent a couple of hours grappling with an uber-annoying bug under XEmacs in current Fink: dired-mode chokes on directories containing symbolic links. The symptom is that when you try to open a directory in dired, a cryptic "no file on this line" error appears in the minibuffer and dired fails to open.

To make a long story short: this fix from the Apple support forums is (unbelievably) the fastest and most foolproof way to fix this error. Step by step:

  1. sudo xemacs /sw/lib/xemacs/xemacs-packages/lisp/dired/dired.el
  2. Find the line containing the regex
    "[^ ][-r][-w][^ ][-r][-w][^ ][-r][-w][^ ][-+ 0-9+]"
    and change the regex to
    "[^ ][-r][-w][^ ][-r][-w][^ ][-r][-w][^ ][@\+]?[-+ 0-9+]"
  3. C-x C-s
  4. M-x byte-compile-file
  5. C-x C-c
  6. Quit and restart XEmacs.

Of course, you will need to do this again whenever Fink decides to overwrite dired.el; unless the Fink maintainers merge in the upstream fix.

Gory details below.

Under Mac OS X, unlike every other Unix in recorded history, ls inserts an @ or + sign after the permissions list on certain types of files (symlinks and files with "extended security information"). The dired.el code is brittle with respect to this oddity. Furthermore, it does not provide any way to customize the regular expression that matches and parses the output of ls (which, incidentally, is my primary evidence that Mac OS X is the first Unix in history to behave this way; it's essentially impossible that a Unix could have existed for any length of time like this without a patch being fed upstream to Emacs).

Now, it turns out that this bug was fixed in Dired 7.15. So the real problem is that Fink XEmacs has not pulled down the latest Dired; it's currently stuck on 7.13.

So, what's a hacker to do? Let me count the frustrations.

1. XEmacs has a built-in elisp package manager called pui. Maybe I can upgrade Dired that way?

I use M-x pui-list-packages; then I set a package mirror from the Tools > Packages menu; finally, I select the Dired package and type I to install:

(error/warning) Error in process filter: (ftp-error FTP Error: CWD 550 /pub/packages/editors/xemacs/packages/.: No such file or directory failed: )

Oh great. I try a half-dozen different package mirrors and every motherfucking one gives me this error (except when it dies even earlier due to some other FTP problem).

2. Aha, MacPorts has a more recent XEmacs! Screw Fink, maybe the MacPorts guys know what they're doing:

$ sudo fink remove xemacs
. . . long console spew . . . 
$ sudo port install xemacs
. . . long console spew . . . 
$ xemacs
Error: attempt to add non-widget child "*scratch*"
to parent "Buffers" which supports only widgets
[xemacs crashes]

The current MacPorts package of xemacs doesn't even start up. Bloody motherfucker.

3. Maybe I should just switch to FSF Emacs, which I already use on all my other boxes. I mean, Fink has emacs22-gtk now. Yeah, right:

$ sudo fink install emacs22-gtk
Information about 8097 packages read in 1 seconds.

. . . [deletia] . . .
The following package will be installed or updated:
. . . [deletia; making a long story short:] . . .
sed: /usr/X11/lib/ No such file or directory
### execution of /var/tmp/tmp.1.UdYe2K failed, exit code 1
Removing runtime build-lock...
Removing build-lock package...
/sw/bin/dpkg-lockwait -r fink-buildlock-fontconfig2-dev-2.4.1-106
(Reading database ... 42622 files and directories currently installed.)
Removing fink-buildlock-fontconfig2-dev-2.4.1-106 ...
Failed: phase installing: fontconfig2-dev-2.4.1-106 failed

4. So, I finally gave Carbon Emacs a try. Carbon Emacs runs, and dired actually works fine. Miracle of miracles.

Unfortunately, fonts are completely busted under Carbon Emacs. You get a slick anti-aliased font out of the box, but you can look forward to a hair-pulling exercise in frustration if you attempt to change that font to anything that's (a) legible and (b) fits more than 50 vertical lines of text on a Macbook Pro screen. Anti-aliased Courier looks even more terrible at 8pt than Courier usually looks. And Carbon Emacs is the first windowed Emacs I've used where no variant of the "Clean" font works out-of-the-box. Congratulations Apple! You've broken a piece of software that's basically worked for twenty years. So Carbon Emacs is out.

5. About twenty minutes of screwing around trying to install dired from CVS into a user-local directory, and have it override the one in the system directory, yields no progress.

6. I could try to install the latest dired package by hand, but I am sort of scared of what else might break if I do this. So, as much as I dislike manually twiddling with system files that should be under my package manager's control, I grit my teeth and did the voodoo noted at the top of this post. Which finally gets me everything I want, but my mouth is left with the distinct bitter residue of time sucked away from my life that I'll never get back.

My conclusions from this whole experience are as follows.

First, package maintainers for Fink and MacPorts aren't as good as the maintainers for Debian or Ubuntu. At any given time, a fair number of important packages will simply be nonfunctional. So the package situation will always be a pain in the ass on Mac compared to Linux.

Second, Mac OS X's random gratuitous differences from other *nix flavors will continue to suck away at least as much time from my life as I spent getting wireless and other random hardware widgets to work on a Linux laptop. Truly, for a programmer, there's no such thing as a laptop where you don't spend a significant amount of time fiddling with random bullshit just so you can get work done.