Assorted notes

Many random notes (some for my own reference), each of which is too short to warrant a full blog post:


It had always bothered me, just a little, that C-v and M-v, in addition to scrolling, move the cursor to the bottom or top of the screen. This has the odd effect that C-v M-v is not a no-op. Turns out that setting the variable scroll-preserve-screen-position appropriately can fix this. (via emacs-devel)


  • Have you ever wondered why running Firefox instances get broken when new versions are installed? On GNU/Linux systems the package manager, which runs as root, pays no mind to what non-root users are doing. Some apps, like Firefox, run into major trouble because they'll load additional files after startup that can't be mixed and matched with the previous versions (this isn't really a problem for programs that are essentially just one binary). Chrome acquires immunity to this with its Zygote mode, which basically means do not load anything from disk after startup. A simple idea, but it takes some work to follow through with it.
  • Among visitors to this blog, Chrome is the second most popular browser, with a 9.5% share! Chrome leads IE (6.6%), Safari (5.9%), and Opera (4.3%), and trails only Firefox (72.6%). You can sort of see what a non-representative sample of web users happens across this blog.


  • Soundconverter (aptitude install soundconverter) is a handy GTK/GNOME program for converting (transcoding) audio between formats. It is easy to use, transfers all the music metadata, and seems to take full advantage of multicore processors. (I use it to downsample my music, mostly in FLAC, to Ogg or MP3 for use on portable devices.)

  • When using find with xargs, xargs will get tripped up by filenames with spaces (it will treat each space-delimited component as a different argument). You can get around this by changing the delimiter in both find and xargs to \0 instead of space, as follows:

    find . -iname '*.tmp' -print0 | xargs -0 rm

    You can usually achieve the same effect with find ... -exec but I can never remember how to use it.


Some things I picked up while working on Zeya:


  1. The 'find' command has also an option just for the purpose of deleting files:

    find -iname '*.tmp' -delete

  2. setting the variable scroll-preserve-screen-position appropriately can fix this.

    Oh thank you thank you thank you!!!

  3. @mmassonnet: thanks! I *really* should invest some time familiarizing myself with what 'find' can do.

  4. BTW have you noticed that ctrl-L behaves differently in Emacs 23? Calling it once puts you in the middle of the screen, as before, but subsequent calls cycle you through top and bottom.

  5. @Allen: yes. In 23, C-l was mapped to 'recenter-top-bottom. Previously it was bound to 'recenter, if you wish to restore the old behavior.