Function: decipher-mode

decipher-mode is an autoloaded, interactive and byte-compiled function defined in decipher.el.gz.

Signature

(decipher-mode)

Documentation

Major mode for decrypting monoalphabetic substitution ciphers.

Lower-case letters enter plaintext. Upper-case letters are commands.

The buffer is made read-only so that normal Emacs commands cannot modify it.

The most useful commands are:
D (decipher-digram-list) Display a list of all digrams & their frequency
F (decipher-frequency-count) Display the frequency of each ciphertext letter
N (decipher-adjacency-list) Show adjacency list for current letter (lists letters appearing next to it)
M (decipher-make-checkpoint) Save the current cipher alphabet (checkpoint)
R (decipher-restore-checkpoint) Restore a saved cipher alphabet (checkpoint)

This mode runs the hook decipher-mode-hook, as the final or penultimate step during initialization.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/play/decipher.el.gz
;;;###autoload
(define-derived-mode decipher-mode nil "Decipher"
  "Major mode for decrypting monoalphabetic substitution ciphers.
Lower-case letters enter plaintext.
Upper-case letters are commands.

The buffer is made read-only so that normal Emacs commands cannot
modify it.

The most useful commands are:
\\<decipher-mode-map>
\\[decipher-digram-list]  Display a list of all digrams & their frequency
\\[decipher-frequency-count]  Display the frequency of each ciphertext letter
\\[decipher-adjacency-list]\
  Show adjacency list for current letter (lists letters appearing next to it)
\\[decipher-make-checkpoint]  Save the current cipher alphabet (checkpoint)
\\[decipher-restore-checkpoint]  Restore a saved cipher alphabet (checkpoint)"
  (setq buffer-undo-list  t             ;Disable undo
        indent-tabs-mode  nil)          ;Do not use tab characters
  (if decipher-force-uppercase
      (setq case-fold-search nil))      ;Case is significant when searching
  (unless (= (point-min) (point-max))
    (decipher-read-alphabet))
  (setq-local font-lock-defaults
              '(decipher-font-lock-keywords t))
  ;; Make the buffer writable when we exit Decipher mode:
  (add-hook 'change-major-mode-hook
            (lambda () (setq buffer-read-only nil
                             buffer-undo-list nil))
            nil t)
  (setq buffer-read-only t))