;;; decipher.el --- cryptanalyze monoalphabetic substitution ciphers
;;
-;; Copyright (C) 1995, 1996, 2003 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:
;;
(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)
;;--------------------------------------------------------------------