;;; decipher.el --- cryptanalyze monoalphabetic substitution ciphers
;;
-;; Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1996, 2002, 2003, 2004,
+;; 2005 Free Software Foundation, Inc.
;;
;; Author: Christopher J. Madsen <chris_madsen@geocities.com>
;; Keywords: games
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
;;; Commentary:
;;
(defcustom decipher-ignore-spaces nil
"*Non-nil means to ignore spaces and punctuation when counting digrams.
-You should set this to `nil' if the cipher message is divided into words,
-or `t' if it is not.
+You should set this to nil if the cipher message is divided into words,
+or t if it is not.
This variable is buffer-local."
:type 'boolean
:group 'decipher)
(define-key decipher-mode-map "R" 'decipher-restore-checkpoint)
(define-key decipher-mode-map "U" 'decipher-undo)
(define-key decipher-mode-map " " 'decipher-keypress)
- (substitute-key-definition 'undo 'decipher-undo
- decipher-mode-map global-map)
- (substitute-key-definition 'advertised-undo 'decipher-undo
- decipher-mode-map global-map)
+ (define-key decipher-mode-map [remap undo] 'decipher-undo)
+ (define-key decipher-mode-map [remap advertised-undo] 'decipher-undo)
(let ((key ?a))
(while (<= key ?z)
(define-key decipher-mode-map (vector key) 'decipher-keypress)
(setq case-fold-search nil)) ;Case is significant when searching
(use-local-map decipher-mode-map)
(set-syntax-table decipher-mode-syntax-table)
- (decipher-read-alphabet)
+ (unless (= (point-min) (point-max))
+ (decipher-read-alphabet))
(set (make-local-variable 'font-lock-defaults)
'(decipher-font-lock-keywords t))
;; Make the buffer writable when we exit Decipher mode:
(lambda () (setq buffer-read-only nil
buffer-undo-list nil))
nil t)
- (run-hooks 'decipher-mode-hook)
+ (run-mode-hooks 'decipher-mode-hook)
(setq buffer-read-only t))
(put 'decipher-mode 'mode-class 'special)
(forward-char))
(or (equal decipher-char ?\ )
(progn
- (setq decipher-char ?\ ;
+ (setq decipher-char ?\s
decipher--loop-prev-char ?\ )
(funcall func)))))))
major-mode 'decipher-stats-mode
mode-name "Decipher-Stats")
(use-local-map decipher-stats-mode-map)
- (run-hooks 'decipher-stats-mode-hook))
+ (run-mode-hooks 'decipher-stats-mode-hook))
(put 'decipher-stats-mode 'mode-class 'special)
;;--------------------------------------------------------------------
;;; (delete-backward-char 1)
;;; (insert ")\n"))))))
+;;; arch-tag: 8f094d88-ffe1-4f99-afe3-a5e81dd939d9
;;; decipher.el ends here