dgnushack.el (rot13-string): New macro for XEmacs. netrc.el uses it.
authorKatsumi Yamaoka <yamaoka@jpl.org>
Tue, 14 Dec 2010 01:34:35 +0000 (01:34 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Tue, 14 Dec 2010 01:34:35 +0000 (01:34 +0000)
lisp/ChangeLog
lisp/dgnushack.el

index 05d6e38..3d57959 100644 (file)
@@ -1,3 +1,7 @@
+2010-12-14  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * dgnushack.el (rot13-string): New macro for XEmacs.  netrc.el uses it.
+
 2010-12-13  Andrew Cohen  <cohen@andy.bu.edu>
 
        * nnir.el (nnir-run-gmane): Better check for gmane groups: error out if
index 7274cb0..3e38fcc 100644 (file)
     (autoload 'read-passwd "passwd")
     (autoload 'regexp-opt "regexp-opt")
     (autoload 'reporter-submit-bug-report "reporter")
+    (if (condition-case nil
+           (progn
+             (require 'rot13)
+             (not (fboundp 'rot13-string)))
+         (error nil))
+       (defmacro rot13-string (string)
+         "Return ROT13 encryption of STRING."
+         `(with-temp-buffer
+            (insert ,string)
+            (translate-region (point-min) (point-max) ,rot13-display-table)
+            (buffer-string))))
     (if (and (emacs-version>= 21 5)
             (not (featurep 'sxemacs)))
        (autoload 'setenv "process" nil t)