comparison lisp/gnus/messagexmas.el @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents e04119814345
children 0d2f883870bc
comparison
equal deleted inserted replaced
69:804d1389bcd6 70:131b0175ea99
1 ;;; messagexmas.el --- XEmacs extensions to message 1 ;;; messagexmas.el --- XEmacs extensions to message
2 ;; Copyright (C) 1996,97 Free Software Foundation, Inc. 2 ;; Copyright (C) 1996 Free Software Foundation, Inc.
3 3
4 ;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no> 4 ;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
5 ;; Keywords: mail, news 5 ;; Keywords: mail, news
6 6
7 ;; This file is part of GNU Emacs. 7 ;; This file is part of GNU Emacs.
25 25
26 ;;; Code: 26 ;;; Code:
27 27
28 (require 'nnheader) 28 (require 'nnheader)
29 29
30 (defvar message-xmas-dont-activate-region t 30 (defvar message-xmas-dont-activate-region nil
31 "If t, don't activate region after yanking.") 31 "If t, don't activate region after yanking.")
32 32
33 (defvar message-xmas-glyph-directory nil 33 (defvar message-xmas-glyph-directory nil
34 "*Directory where Message logos and icons are located. 34 "*Directory where Message logos and icons are located.
35 If this variable is nil, Message will try to locate the directory 35 If this variable is nil, Message will try to locate the directory
41 "*If nil, do not use a toolbar. 41 "*If nil, do not use a toolbar.
42 If it is non-nil, it must be a toolbar. The five legal values are 42 If it is non-nil, it must be a toolbar. The five legal values are
43 `default-toolbar', `top-toolbar', `bottom-toolbar', 43 `default-toolbar', `top-toolbar', `bottom-toolbar',
44 `right-toolbar', and `left-toolbar'.") 44 `right-toolbar', and `left-toolbar'.")
45 45
46 (defvar message-toolbar 46 (defvar message-toolbar
47 '([message-spell ispell-message t "Spell"] 47 '([message-spell ispell-message t "Spell"]
48 [message-help (Info-goto-node "(Message)Top") t "Message help"]) 48 [message-help (Info-goto-node "(Message)Top") t "Message help"])
49 "The message buffer toolbar.") 49 "The message buffer toolbar.")
50 50
51 (defun message-xmas-find-glyph-directory (&optional package) 51 (defun message-xmas-find-glyph-directory (&optional package)
90 "Exchange point and mark, but allow for XEmacs' optional argument." 90 "Exchange point and mark, but allow for XEmacs' optional argument."
91 (exchange-point-and-mark message-xmas-dont-activate-region)) 91 (exchange-point-and-mark message-xmas-dont-activate-region))
92 92
93 (fset 'message-exchange-point-and-mark 'message-xmas-exchange-point-and-mark) 93 (fset 'message-exchange-point-and-mark 'message-xmas-exchange-point-and-mark)
94 94
95 (defun message-xmas-maybe-fontify ()
96 (when (and (featurep 'font-lock)
97 font-lock-auto-fontify)
98 (turn-on-font-lock)))
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
121 (add-hook 'message-mode-hook 'message-xmas-maybe-fontify)
122
123 (provide 'messagexmas) 95 (provide 'messagexmas)
124 96
125 ;;; messagexmas.el ends here 97 ;;; messagexmas.el ends here