Mercurial > hg > xemacs-beta
comparison lisp/gnus/messagexmas.el @ 100:4be1180a9e89 r20-1b2
Import from CVS: tag r20-1b2
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:15:11 +0200 |
parents | 0d2f883870bc |
children | 360340f9fd5f |
comparison
equal
deleted
inserted
replaced
99:2d83cbd90d8d | 100:4be1180a9e89 |
---|---|
95 (defun message-xmas-maybe-fontify () | 95 (defun message-xmas-maybe-fontify () |
96 (when (and (featurep 'font-lock) | 96 (when (and (featurep 'font-lock) |
97 font-lock-auto-fontify) | 97 font-lock-auto-fontify) |
98 (turn-on-font-lock))) | 98 (turn-on-font-lock))) |
99 | 99 |
100 (defun message-xmas-make-caesar-translation-table (n) | |
101 "Create a rot table with offset N." | |
102 (let ((i -1) | |
103 (table (make-string 256 0)) | |
104 (a (char-int ?a)) | |
105 (A (char-int ?A))) | |
106 (while (< (incf i) 256) | |
107 (aset table i i)) | |
108 (concat | |
109 (substring table 0 A) | |
110 (substring table (+ A n) (+ A n (- 26 n))) | |
111 (substring table A (+ A n)) | |
112 (substring table (+ A 26) a) | |
113 (substring table (+ a n) (+ a n (- 26 n))) | |
114 (substring table a (+ a n)) | |
115 (substring table (+ a 26) 255)))) | |
116 | |
117 (when (>= emacs-major-version 20) | |
118 (fset 'message-make-caesar-translation-table | |
119 'message-xmas-make-caesar-translation-table)) | |
120 | |
100 (add-hook 'message-mode-hook 'message-xmas-maybe-fontify) | 121 (add-hook 'message-mode-hook 'message-xmas-maybe-fontify) |
101 | 122 |
102 (provide 'messagexmas) | 123 (provide 'messagexmas) |
103 | 124 |
104 ;;; messagexmas.el ends here | 125 ;;; messagexmas.el ends here |