Function: decipher-keypress

decipher-keypress is an interactive and byte-compiled function defined in decipher.el.gz.

Signature

(decipher-keypress)

Documentation

Enter a plaintext or ciphertext character.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/play/decipher.el.gz
;;--------------------------------------------------------------------
;; Normal key handling:
;;--------------------------------------------------------------------

(defun decipher-keypress ()
  "Enter a plaintext or ciphertext character."
  (interactive nil decipher-mode)
  (let ((decipher-function 'decipher-set-map)
        buffer-read-only)               ;Make buffer writable
    (save-excursion
      (or (save-excursion
            (beginning-of-line)
            (let ((first-char (following-char)))
              (cond
               ((= ?: first-char)
                t)
               ((= ?> first-char)
                nil)
               ((= ?\( first-char)
                (setq decipher-function #'decipher-alphabet-keypress)
                t)
               ((= ?\) first-char)
                (setq decipher-function #'decipher-alphabet-keypress)
                nil)
               (t
                (error "Bad location")))))
          (let (goal-column)
            (forward-line -1)))
      (let ((char-a (following-char))
            (char-b last-command-event))
        (or (and (not (= ?w (char-syntax char-a)))
                 (= char-b ?\s)) ;Spacebar just advances on non-letters
            (funcall decipher-function char-a char-b)))))
  (forward-char))