Cheetah Mode for Emacs

Here is a simple html derived mode for Cheetah templates files. The font-locking regexp can be improved thought but that’s a start.

(define-derived-mode cheetah-mode html-mode "Cheetah"
(make-face ‘cheetah-variable-face)
(font-lock-add-keywords
nil
‘(
("\\(#\\(from\\|else\\|include\\|set\\|import\\|for\\|if\\|end\\)+\\)\\>" 1 font-lock-type-face)
("\\(#\\(from\\|for\\|end\\)\\).*\\<\\(for\\|import\\|if\\|in\\)\\>" 3 font-lock-type-face)
("\\(\\$\\(?:\\sw\\|}\\|{\\|\\s_\\)+\\)" [...]

Access Gajim within Emacs

Here is some function to launch a gajim window from Emacs :

(defvar gajim-remote "/usr/bin/gajim-remote")
(defvar gajim-user-list ())
 
(defun my-gajim-get-list()
(save-excursion
(with-temp-buffer
(call-process gajim-remote nil t nil "list_contacts")
(goto-char (point-min))
(while (re-search-forward "^jid[ ]*:[ ]*\\(.*\\)$" (point-max) t )
[...]

Assignement in Python with list.extend()

This is weird for me :

d = [’foo’, ‘bar’, ‘ba’, ‘c’]
print d
f = d
f.extend(d)
print d

give me the result
-*- mode: compilation; default-directory: “/tmp/” -*-
Compilation started at Mon Jul 31 16:49:41
python “/tmp/a.py”
['foo', 'bar', 'ba', 'c']
['foo', 'bar', 'ba', 'c', 'foo', 'bar', 'ba', 'c']
Compilation finished at Mon Jul 31 16:49:4
It seems that extend assign as well the non extended [...]

crypt(3) on unix maximal length

When i have a password comparaison function using crypt(3) i really should remember that the comparaison stop at the 7 bytes, because that stuff is weird for me :
In [1]: import crypt
In [2]: seed=’foo!bar’
In [3]: crypt.crypt(’abcdefghaa123456681′, seed)
Out[3]: ‘foEoVhbk7ad7A’
In [4]: crypt.crypt(’abcdefghpax;lalx;al’, seed)
Out[4]: ‘foEoVhbk7ad7A’
In [5]:
any stuff after the 6 char will always get ignored by the hash [...]

chmouel.com is moved.

I have finally changed chmouel.com over a new provider. The new
provider is called WebHost and i got a VPS with 50GB of
bandwith and 2GB of storage for 10US$ a month.
My first task was to compile python2.4 on that box which look like
it’s based on RH7.3 with heavy customization. Hopefully python really can compile everywhere.
I would [...]

Going over Israel

Tuesday i will fly from Sydney, Australia to Jerusalem via Jordan.
For a lot of people it does not look it is the right time to get there but i am sure it all going to be fine.
As my experience when people say ”don’t go to a country” it is exactly the right time to get [...]