vendredi 1 avril 2011

Poor man's Emacs Scrabble®-mode

An itch I had,
Scratch it I did.

Listen, listener, for here is my story...

Since time's dawn I've enjoyed playing scrabble, then I moved far east. While in Việt Nam my usual, some might say traditional, playing partners went amiss and withdrawal started to show its head. FOSS, as always, came to the rescue and first brought the ancestral xscrabble, then eliot, and lastly scribble. Lovingly I packaged these gifts for my BFF Slackware @ https://github.com/cycojesus/slackbuilds/tree/master/y


But still, user interaction with xscrabble and eliot is far from ideal, requiring a lot of clicks. Scribble is near perfect (if for the lack of a french dictionary...) but where, might you ask, is the Emacs love‽ I too wondered and finally commited this:

(defun cyco:scribble (level)
    (interactive "sLevel(easy:1..9:hard): ")
    (make-term "Scribble-Scrabble" "/usr/games/scribble" nil level)
    (switch-to-buffer "*Scribble-Scrabble*"))
  
  (global-set-key (kbd "C-c s") 'cyco:scribble)

et voilà, nice and neat.

But.

But, what if I start a game, get distracted to another buffer, forget the on-going game, later want again to play and would be pleasantly surprised to have an on-going game? Glad you asked, so there you go:

(defun cyco:run-or-resume-scribble()
    (interactive)
    (if (eq nil (get-buffer "*Scribble-Scrabble*"))
      (let ((level (read-string "sLevel(easy:1..9:hard): " "1")))
        (make-term "Scribble-Scrabble" "/usr/games/scribble" nil level)))
    (switch-to-buffer "*Scribble-Scrabble*"))
  (global-set-key (kbd "C-c s") 'cyco:run-or-resume-scribble) 

mission accomplished, procrastinating goal achieved.

[my full emacs' config is @ https://github.com/cycojesus/emacs]

mercredi 15 décembre 2010

placeholder

Là y'a rien mais bientôt, bientôt du contenu d'une folle perspicacité il y aura.

Des esprits seront soufflés, des vaches décornées et des lutins propulsés dans la stratosphère...

Ici on cuisinera avec attention des scripts et du kernel candide

En ces lieux seront compilés des tartes asymptotiques, rédigés des gâtapaördinaire et au kilomètre nous tisseront le spaghetti.

Tout ça !