List Infection

Posted on Mon 28 February 2005 in general

I passed a milestone with Emacs today. I did some boolean logic is Emacs LISP. I have to be careful here. LISP has a bit of a cult following among language weenies and you will find staunch defenders (and critics) of it in FOSS circles. For me its just another language to learn and allow me to mold my .emacs
into something that it not only useful, but my kind of useful. The thing is I know my solution is not perfect.
@@ -411,6 +411,9 @@
 ; There should be an easier way to set the default
 ; however I'm currently setting each time a file
 ; is opened using the find-file-hooks
+;
+; Also if I'm on a odd machine I'll skip it as they have the ispell.el
+; library but not the actual ispell program

 ; I'm British, not Amercian damit!
 (defun set-british-dict ()
@@ -418,17 +421,17 @@
   (ispell-change-dictionary "british")
   (message "Set ispell to British Dictionary"))

-(if (locate-library "ispell")
+(if (or I-am-at-work I-am-at-home)
+    (if (locate-library "ispell")
     (progn
       (message "Doing ispell dict setting")

-; set British dict for all files
+                                       ; set British dict for all files
       (add-hook 'find-file-hooks 'set-british-dict)

       ; if we are editing text turn on flyspell mode
       (add-hook 'text-mode-hook 'flyspell-mode)))
-
-(message "past ispell setup")
+  (message "Skipping ispell"))

 ;; calculator
 ;

You see the I-am-at-work and I-am-at-home variables are the result of a string comparison to the machines hostname. However at home I certainly work on more than one machine. I suspect the answer lies in using a list somewhere.

While I'm at it I should point out that my mobile is currently playing silly buggers in recieving texts. If you want to be sure to get hold of me please ring or IM until I get round to writting the letter to T-Mobile.