Tag | unix

Adding your custom fonts to Cygwin’s XWin

Sep 29th, 2009No Comments

I decided to finally make the leap and install Cygwin’s XWindows and run Emacs out of that instead of NTEmacs.  There wasn’t one big thing, but a bunch of little things, including:

  • I wanted to stop using Plink in TRAMP, because that was a mess.  I know that it works better with a command line SSH client, like what I was using for Cygwin.
  • They took my Win32 grep away!  How else am I going to use grep-mode?
  • Pasting a path/filename from my Cygwin prompt to NTEmacs always involved an extra step — calling cygpath and the copying the value.
  • I wanted to mess around with BicycleRepairMan but my Python environment is in Cygwin and my Emacs environment wasn’t.

If you read between the lines, you see a common theme — control.  In my entire Windows workstation, I have very little control over the environment.  In my little Cygwin world,  I have almost complete control.

I had installed and used Emacs within Cygwin/X before, but found that it was slow and clusmey.  Now they’ve had a few years to work out the kinks and I have a much more powerful workstation. And so I tried it again. Yep, things are much better!  However, I like some of the functionality of Emacs 22 but Cygwin doesn’t have Emacs 22 — they still have Emacs 21 as “stable” and Emacs 23 as experimental!  So I jumped through the hoops to install the “unstable” Emacs 23 along with X-windows (XWin, the Cygwin/X world.)

And thus our story begins.  Since I now have complete control on one part of my GUI and one of the things I’m picky about is fonts.  I like to use ProggyClean and, now, heck I can install it. So I downloaded it, move it to the right file, did the magic “xset fp rehash” and  . . . nothing.  Nadda.  XWin couldn’t find it.

I won’t depress you with a play-by-play, but this is an overview:

  • I made ~/.fonts a font directory
  • fonconfig ignores any addition to the /etc/fonts/local.conf file even though it says I loaded it.
  • I decided to kick up old school and edit the ~/.xinitrc file — only to find out that if XWin starts in Rootless most it doesn’t even look at the ~/.xinitirc.

What ended up working was that I added the following to the /usr/bin/startxwin.bat file just before the last command (an xterm, I believe):


%RUN% /usr/bin/xset +fp /cygdrive/h/.fonts &

Then the font is loaded! Then I just make sure my ~/.emacs says:

(set-default-font  
"-windows-proggyclean-medium-r-normal--13-80-96-96-c-70-iso8859-1"
)

And then you see such beautiful things as:

Emacs using Proggy Clean

Emacs using Proggy Clean

How to stop zshell from dumping

Jun 12th, 2009No Comments

I fixed this once couple years ago, with more than a little guidance from the ZSH-Users list.  But it started happening to me again a few weeks ago and I couldn’t remember how I fixed it. After searching through my GMail this morning, I found it.  Maybe if I put it here I will remember how to fix it next time.  And maybe help someone else.

This only happens to me when I use zsh  via Cygwin (I also use zsh on OSX and Linux).  What happens is that when zsh hits compinit in my ~/.zshrc, it prints a ton of the built-in functions to standard error and that’s it.  No error, no complaints . . . and no completion.  None at all!  See this article for a decent idea on how wonderful zsh does completion.

The fix is easy — manually remove ~/.zcompdump and manually run compinit. That instance of compinit will complete fine.  Then start a new shell and you are good to go!  Note that you have to manually run compinit – just starting a new shell won’t fix it.

I’m not sure why my ~/.zcompdump keeps getting corrupted . . . maybe because my home directory is on a shared drive?

Magic Space in ZSH

May 29th, 2009No Comments

Since writing this post about bash, I’ve switched to zsh.  A lot of the functionality is there, plus quite a bit more.  But zsh doesn’t use GNU Readline, so you can’t add anything to inputrc.  But you can put something in your ~./zshrc:

bindkey ' ' magic-space # also do history expansion on space