Sunday, December 21, 2014

Emacs and (synchronised) org-mode on Android

Running emacs and org-mode under Android. I’m doing this on my Android tablet - it’s not perhaps as useful on a phone, though it’s not unmanageable.

There used to be an Emacs app for Android in the Google Play store - in fact it’s still there, but the server it used to download its files from is no longer working - and the app was always a bit fiddly to get to work properly.

Here’s a better way of getting it working:
  • Install ZShaolin, a console terminal emulator (zsh shell) for Android with a number of useful commandline tools like rsync, awk, imagmagick etc.
  • Then install the files from the old Emacs app. They’re no longer accessible via the app from the Play store, but I had saved the files from back when it still worked, and have zipped them up and thrown them on mega:!B4AThKxI!_ImT57mJNirozxna-1SOcNGAzPRr9QacM34jUoPVMgo
  • Unzip the files from there and place at /sdcard/emacs/ on your device.
  • Then, open up ZShaolin and start a session, and type “emacs”. Voilà.
Now for getting org-mode to work. Org-mode is part of the basic Emacs setup in recent versions of Emacs (including the one above). For some reason, though, at least when I ran it, I had trouble turning on org-mode. Here’s the fix:
  • Create a .emacs file (if you don’t have one already) in ~ under ZShaolin and put the following into:
(defun load-history-filename-element (file-regexp)
  "Get the first elt of `load-history' whose car matches FILE-REGEXP.
        Return nil if there isn't one."
  (let* ((loads load-history)
         (load-elt (and loads (car loads))))
      (while (and loads
                  (or (null (car load-elt))
                      (not (and (stringp (car load-elt)) ; new condition
                                (string-match file-regexp (car load-elt))))))
        (setq loads (cdr loads)
              load-elt (and loads (car loads)))))
That gets org-mode to work as expected.
Figure 1: Emacing an org file on Android (with ZShaolin)

Now, most likely you will have org-files that you want to keep synchronized. You may already be running MobileOrg, with something like a Dropbox synchronisation. Note that the way that the MobileOrg app works, you can’t edit the org files that it uses directly. MobileOrg utilises some sort of database and the changes that it pushes back are done so through the database, so editing the org files that MobileOrg is synched with (say, in Dropbox) won’t result in any changes being propagated back to your other devices.

So, if you’re running MobileOrg with Dropbox, you’ll need to have a separate Dropbox synchronisation in order to be able to edit org-files in Emacs on Android in a way that allows for propagation of changes from Android to other devices/repositories.

Here’s a method which allows for editing of org-mode files on Emacs which allows for back-propagation via Dropbox:
  • Create a separate Dropbox synchronisation directory - that is, separate from the one you use for MobileOrg synchronisation. [The way I did this on my Linux desktop was to create a symlink from my “Org folder” in my Documents directory to the “actual” Org directory in my Dropbox folder. In my setup, this directory also synchs with a git repository, so I ended up excluding the hidden .git directory from synching with Dropbox, since I have only a free, very-limited-space Dropbox account.]
  • Open up the Dropbox app on your Android device. Navigate to your new Org directory (not the one you use for MobileOrg). “Open” any of the org files you want to have access to. It doesn’t matter if they successfully open or not - the act of “opening” them gets the Dropbox app to save a local copy which it will keep synchronised with your Dropbox repository.
  • The location for these local files is a path like this: /sdcard/Android/data/ the u-number part of the path I assume varies from user to user; and of course the final part of the path will depend on what you named your Org folder and files
  • Files in the above path can be opened in Emacs on Android. Any changes you make will be propagated via Dropbox.
Again, this will be perhaps of limited use on a phone — though ZShaolin does have a built-in software keyboard which works very well for Emacs — on a tablet device with a keyboard (I use an Asus tablet) it works pretty well. (Though I haven’t figured out how to remap CAPSLOCK on my tablet to CTRL yet….)

Saturday, December 20, 2014

In praise of DejaVu (Sans Mono)

I do the majority of my work in Emacs - from the composition of linguistics articles and chapters, to lecture slides, to keeping track of grades, to email. Much of what I do requires a monospaced font, and much of what I do requires a good Unicode font. Which narrows the range of potential font candidates significantly. And, since I spend so much time looking at it, I would like the font to be aesthetically-pleasing.
After trying many different fonts, at different sizes and so forth, I’ve found that DejaVu Sans Mono is really the only font which meets all of these criteria. It is really a good-looking font too. Here it is in a few different applications:

Figure 1: DejaVu Sans Mono in mu4e mail
Figure 2: DejaVu Sans Mono in LaTeX doc
Figure 3: DejaVu Sans Mono displaying some Unicode
And…it appears to be the same font used in the terminal in Tron: Legacy:
Figure 4: kill -9ing in Tron: Legacy with DejaVu

Saturday, June 23, 2012

Who uses Linux? (+Emacs, +TeX)

Some really rough notes. Suggestions welcome.

Notable people who use Linux (with additional notes on Emacs and TeX users), a first draft.

My rough criterion for determining who counts as "famous": does the person have a Wikipedia entry? 

Presumably many more can be added under "computer-related" (which is why I put it at the bottom). I'm only listing each person once, under most relevant/salient category (otherwise I could, for instance, list Shuttleworth also under an "astronaut" category).

See also: "The Setup / Linux" and "My Linux Rig" for more 'prominent' people and their Linux setups.


Rick Falkvinge, founder of Swedish Pirate Party [Wikipedia entry]

  • Uses an Ubuntu Linux set-up [1]

Christian Engström, Swedish Pirate Party MEP [Wikipedia entry]

  • Seems to use some sort of Ubuntu Linux set-up [1, 2, 3]
  • Couple of pics with Richard Stallman from 2004 [1, 2]

Amelia Andersdotter, Swedish Pirate Party MEP [Wikipedia entry]

  • Mentions using Arch, Fedora [1, 2]
  • Also Emacs and TeX (see above links)
Vinay Gupta, geopolitical risk analyst [Wikipedia entry]
  • uses Ubuntu Linux [1] 
  • inventor of Hexayurt [1]


Cory Doctorow, blogger, journalist, & sci-fi/fantasy author [Wikipedia entry]

Charlie Stross, sci-fi/horror/fantasy author [Wikipedia entry]

  • formerly the monthly Linux columnist for Computer Shopper
  • uses Linux, but mainly for running server, otherwise Mac [1, 2, 3]
  • position on piracy: "If you've downloaded unauthorized copies of my books, instead of hitting on a tipjar button, I urge you to buy a (new) copy of one of my books....Your typical book publisher is not like the music or movie industry; they run on thin margins, and they're staffed by underpaid, overworked folk who do it because they love books, not because they're trying to make themselves rich on the back of a thousand ruthlessly exploited artists. I think their effort deserves to be rewarded appropriately..." [1]

Piers Anthony, fantasy/sci-fi author [Wikipedia entry]

  • switched to Linux in 2000 [1, 2, 3, 4]
  • mentions using a number of different distros, including Ubuntu & Fedora [1]
  • use of Linux seems at least in part principle-driven [1, 2]
  • uses LibreOffice [1]
  • concerns about piracy:
    • speaks approvingly of Harlan Ellison's war on piracy (2002-4) [1, 2]
    • complaints about piracy & Ebay (2010) [1]
    • some recognition of danger of censoring internet: "THE WEEK had an item on Internet piracy of music, books, and movies, and efforts to stop it. I have discussed this here before, but it bears repeating: pirates are thieves who are destroying the ability of creative artists to make a living, myself included; a LOT of my works are chronically stolen. The pirates need to be stopped. The problem is how to do it without censoring free expression itself. I think there does have to be a law, but one carefully crafted to shut down only the pirates." (2012) [1]

Neal Stephenson, sci-fi/speculative fiction author [Wikipedia entry]

Actors & film-related

Stephen Fry, actor [Wikipedia entry]

  • big fan of Apple products [1, 2, etc.]
  • but also touts GNU [1, 2, 3]

Wil Wheaton, actor [Wikipedia entry]

  • primarily uses Macs, but also uses Linux [1, 2]
  • support for Bittorrent [1]
Asia Carrera, adult-film actress [Wikipedia entry] 
  • early Linux-adopter, ran own website since 1998 [1, 2]
Cindy Margolis, model [Wikipedia entry]
  • apparent Debian user [1, 2]

Programmers & computer-related

Linus Torvalds [Wikipedia entry]

Richard Stallman [Wikipedia entry]

Mark Shuttleworth, programmer, entreprenuer, astronaut [Wikipedia entry]

Donald Knuth, computer scientist & professor [Wikipedia entry]

  • creator of TeX typesetting system (1978), upon which LaTeX, LuaTeX etc. are based
  • uses Ubuntu Linux (as of 2008) [1]
  • uses Emacs to edit TeX [1]
  • friends with computer security researcher Jacob Appelbaum [1]

American McGee, game designer [Wikipedia entry

  •  switched to Ubuntu Linux (from Windows) with plans to "stay switched" (2006) [1]

John "maddog" Hall, director of Linux International & professor of computer science [Wikipedia entry]

  • runs different Linux distributions depending on employer [1]

Some Initial Ruminations

A number of the people above fall into two rough groupings: "technology/gadget-lovers" vs. "ideological-users". So Stephen Fry and Wil Wheaton would fall into the first category, as would perhaps Charlie Stross and even Linus Torvalds. On the ideological side are (of course) Richard Stallman, Cory Doctorow, Piers Anthony, and the Pirate Party MPs. Anthony's position in the latter grouping is interesting, given his position on piracy. Stallman's position is similar to the Pirate MPs in certain respects, but values the legal status of copyleft.

What about Free Culture proponents?

What computer setups do Free Culture proponents use? Particularly, I'm wondering about Lawrence Lessig, founding father of the Free Culture movement (largely based on Stallman's Free Software Foundation) and founder of the Creative Commons licences. Nina Paley is another prominent Free Culture activist, but I'm pretty sure she's largely (solely?) a Mac user.

Hattrick winners and other random notes

Amelia Andersdotter, Donald Knuth, and Richard Stallman take hattrick prizes for Linux-Emacs-TeX use. (For an extra bonus, Andersdotter also explicitly mentions use of org-mode in Emacs.) 

Of course there are various connections between some of the characters mentioned above. For instance, Doctorow releases his novels under Lessig's Creative Common licences; Doctorow & Stross are co-writing a novel [1]; etc.

In terms of the general public, the actors are (unsurprisingly) probably the best known: I would guess Stephen Fry is the most famous person listed above.

Again, suggestions/additions welcome.

Tuesday, June 19, 2012

Emacs in the future: after the ice-caps melt

Emacs 24.1 is out. I haven't really tried it properly yet. All of the pre-release Emacs 24 snapshots I tried had severe memory-leak problems (at least with my set-up) and the quick try-out of 24.1 I did do revealed that it seems to be incompatible with twittering-mode. Since Emacs 23.3 is still working nicely for me, perhaps I'll wait a bit before trying 24.1 seriously.

Speaking of the future of Emacs, a great quote from sociologist Kieran Healy on The Setup ("") site:
Emacs ... will be there when the icecaps melt and the cities drown, when humanity destroys itself in fire and zombies, when the roaches finally achieve sentience, take over, and begin using computers themselves - at which point its various Ctrl-Meta key-chords will seem not merely satisfyingly ergonomic for the typical arthropod, but also direct evidence for the universe's Intelligent Design by some six-legged, multi-jointed God.

Monday, April 23, 2012

History as revealed by Google Ngrams, I: UNIX

UNIX was apparently really first discovered in the 18th century, about fifty years before the American War of Independence. However, it wasn't until the 20th century that it gained wide-spread use, when it was repopularised by AT&T.

Source: Google Ngram Viewer.

Tuesday, June 7, 2011

Emacs user at work

Despite being designed by a Vim user, and despite its implied criticism of Emacs, I still enjoyed this image:

ashawley in the comments below points out the similarity with the 1981 cover of the EMACS Manual: