aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-05-23 00:42:21 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2009-05-23 00:42:21 +0300
commitd265dac0bf3d54ac0ef44a0c0b5d4f143f9e491d (patch)
tree010e405997b59f8efac19441420a3db137cbddd9
parentd69cbb9f799877c83c514893e10aa16fe0c91efc (diff)
downloadmailfromd-d265dac0bf3d54ac0ef44a0c0b5d4f143f9e491d.tar.gz
mailfromd-d265dac0bf3d54ac0ef44a0c0b5d4f143f9e491d.tar.bz2
Minor organizational changes.
* elisp/Makefile.am (LISPSRC): Add obfemail-mode.el * elisp/mfl-mode.el (mfl-mode): Fix docstring. * THANKS: Use obfemail mode to encode emails.
-rw-r--r--THANKS36
-rw-r--r--elisp/Makefile.am4
-rw-r--r--elisp/mfl-mode.el5
-rw-r--r--elisp/obfemail-mode.el75
4 files changed, 97 insertions, 23 deletions
diff --git a/THANKS b/THANKS
index 94e08035..7c7c9b50 100644
--- a/THANKS
+++ b/THANKS
@@ -1,27 +1,27 @@
Mailfromd THANKS file.
Many people further contributed to mailfromd by reporting problems,
-suggesting various improvements or submitting actual code. Here is a list
-of these people in alphabetical order. Help us keep it complete and exempt
-of errors.
+suggesting various improvements or submitting actual code. Here is a list
+of these people in alphabetical order. Help us keep it complete and exempt
+of errors. Use elisp/obfemail-mode.el to see mail addresses.
-Alan Dobkin <MailFromD --AT-- omnicomp --DOT-- org>
-Ben McKeegan <ben --AT-- netservers --DOT-- co --DOT-- uk>
-Brent Spencer <bspencer --AT-- XsiteDesigns --DOT-- com>
-Con Tassios <ct --AT-- swin --DOT-- edu --DOT-- au>
-Jan Rafaj <jr-mailfromd --AT-- cedric --DOT-- unob --DOT-- cz>
-Jeff Ballard <ballard --AT-- engr --DOT-- wisc --DOT-- edu>
-John McEleney <jmceleney --AT-- gmail --DOT-- com>
-Nacho González López <nacho --AT-- es --DOT-- gnu --DOT-- org>
-Patrick Dalais <patrick --AT-- depari --DOT-- co --DOT-- za>
-Peter Markeloff <magic --AT-- farlep --DOT-- net>
-Phil Miller <pmiller --AT-- hmc --DOT-- edu>
-Sergey Afonin <a_s_y --AT-- sama --DOT-- ru>
-Tom Lynch <tlynch --AT-- primate --DOT-- wisc --DOT-- edu>
-Zeus Panchenko <zeus --AT-- dn --DOT-- farlep --DOT-- net>
+Alan Dobkin <ZnvySebzQ@bzavpbzc.bet>
+Ben McKeegan <ora@argfreiref.pb.hx>
+Brent Spencer <ofcrapre@KfvgrQrfvtaf.pbz>
+Con Tassios <pg@fjva.rqh.nh>
+Jan Rafaj <we-znvysebzq@prqevp.habo.pm>
+Jeff Ballard <onyyneq@rate.jvfp.rqh>
+John McEleney <wzpryrarl@tznvy.pbz>
+Nacho González López <anpub@rf.tah.bet>
+Patrick Dalais <cngevpx@qrcnev.pb.mn>
+Peter Markeloff <zntvp@sneyrc.arg>
+Phil Miller <czvyyre@uzp.rqh>
+Sergey Afonin <n_f_l@fnzn.eh>
+Tom Lynch <gylapu@cevzngr.jvfp.rqh>
+Zeus Panchenko <mrhf@pnzo.hf>
;;;; Local Variables:
-;;;; mode: Fundamental
+;;;; mode: obfemail
;;;; coding: utf-8
;;;; End:
diff --git a/elisp/Makefile.am b/elisp/Makefile.am
index 51a4f185..ed0f0223 100644
--- a/elisp/Makefile.am
+++ b/elisp/Makefile.am
@@ -1,5 +1,5 @@
# This file is part of Mailfromd
-# Copyright (C) 2007, 2008 Sergey Poznyakoff
+# Copyright (C) 2007, 2008, 2009 Sergey Poznyakoff
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -14,6 +14,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-LISPSRC = mfl-mode.el
+LISPSRC = mfl-mode.el obfemail-mode.el
lisp_LISP=@lisp_LISP@
EXTRA_DIST=$(LISPSRC)
diff --git a/elisp/mfl-mode.el b/elisp/mfl-mode.el
index f6b4af99..a808d197 100644
--- a/elisp/mfl-mode.el
+++ b/elisp/mfl-mode.el
@@ -1,9 +1,8 @@
;;; mfl-mode.el --- major mode for editing MFL sources
-;; Authors: 2007, 2008 Sergey Poznyakoff
+;; Authors: 2007, 2008, 2009 Sergey Poznyakoff
;; Version: 0.1
;; Keywords: Mailfromd, MFL
-;; $Id$
;; This file is part of Mailfromd
;; Copyright (C) 2007, 2008 Sergey Poznyakoff
@@ -493,7 +492,7 @@ otherwise."
;;;###autoload
(defun mfl-mode ()
- "Major mode for viewing cflow output files
+ "Major mode for viewing MFL filter sources
Key bindings are:
\\{mfl-mode-map}
diff --git a/elisp/obfemail-mode.el b/elisp/obfemail-mode.el
new file mode 100644
index 00000000..6c1a575e
--- /dev/null
+++ b/elisp/obfemail-mode.el
@@ -0,0 +1,75 @@
+;;; obfemail-mode.el --- minor mode for editing files with obfuscated emails
+
+;; Authors: 2009 Sergey Poznyakoff
+;; Version: 1.0
+;; Keywords: Mailfromd, Email, Caesar, Rot13
+
+;; This file is part of Mailfromd
+;; Copyright (C) 2009 Sergey Poznyakoff
+
+;; Mailfromd is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3 of the License, or
+;; (at your option) any later version.
+
+;; Mailfromd is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with Mailfromd. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Code:
+
+(eval-when-compile
+ ;; We use functions from these modules
+ (mapcar 'require '(rot13)))
+
+(defun obfemail-region (beg end)
+ (interactive "*r")
+ (save-excursion
+ (goto-char beg)
+ (while (search-forward-regexp "<\\([^>@]+@[a-zA-Z0-9._+-]+\\)>" end t)
+ (rot13 (current-buffer) (match-beginning 1) (match-end 1)))))
+
+(defun obfemail-current-buffer ()
+ (obfemail-region 0 (point-max)))
+
+(defun obfemail-current-buffer-nomod ()
+ (let ((mod (buffer-modified-p)))
+ (obfemail-current-buffer)
+ (set-buffer-modified-p mod)))
+
+(defun obfemail-install ()
+ (add-hook 'write-contents-hooks 'obfemail-current-buffer)
+ (make-local-variable 'after-save-hook)
+ (add-hook 'after-save-hook 'obfemail-current-buffer-nomod)
+ (obfemail-current-buffer-nomod))
+
+(defun obfemail-installed-p ()
+ (member 'obfemail-current-buffer-nomod after-save-hook))
+
+(defun obfemail-uninstall ()
+ (remove-hook 'write-contents-hooks 'obfemail-current-buffer t)
+ (remove-hook 'after-save-hook 'obfemail-current-buffer-nomod t)
+ (obfemail-current-buffer-nomod))
+
+(and (obfemail-installed-p)
+ (obfemail-uninstall))
+
+;;;###autoload
+(define-minor-mode obfemail-mode
+ "Minor mode for displaying files containig email addresses encrypted using
+Caesar cipher."
+ :init-value nil :lighter "-ObfE"
+ (let ((installed (obfemail-installed-p))
+ (flag obfemail-mode))
+ (cond
+ ((and flag installed) t) ; ok, already installed
+ ((and (not flag) (not installed)) nil) ; ok, nothing to do
+ (flag (obfemail-install)) ; install the mode
+ (t (obfemail-uninstall)))))
+
+(provide 'obfemail-mode)
+;;; obfemail-mode ends

Return to:

Send suggestions and report system problems to the System administrator.