Function: decipher-loop-with-breaks

decipher-loop-with-breaks is a byte-compiled function defined in decipher.el.gz.

Signature

(decipher-loop-with-breaks FUNC)

Documentation

Loop through ciphertext, calling FUNC once for each letter & word division.

FUNC is called with no arguments, and its return value is unimportant. It may examine decipher-char to see the current ciphertext character. decipher-char contains either an uppercase letter or a space.

FUNC is called exactly once between words, with decipher-char set to a space.

See decipher-loop-no-breaks if you do not care about word divisions.

Source Code

;; Defined in /usr/src/emacs/lisp/play/decipher.el.gz
;;--------------------------------------------------------------------
(defun decipher-loop-with-breaks (func)
  "Loop through ciphertext, calling FUNC once for each letter & word division.

FUNC is called with no arguments, and its return value is unimportant.
It may examine `decipher-char' to see the current ciphertext
character.  `decipher-char' contains either an uppercase letter or a space.

FUNC is called exactly once between words, with `decipher-char' set to
a space.

See `decipher-loop-no-breaks' if you do not care about word divisions."
  (let ((decipher-char ?\s)
        (decipher--loop-prev-char ?\s))
    (save-excursion
      (goto-char (point-min))
      (funcall func)              ;Space marks beginning of first word
      (while (search-forward-regexp "^:" nil t)
        (while (not (eolp))
          (setq decipher-char (upcase (following-char)))
          (or (and (>= decipher-char ?A) (<= decipher-char ?Z))
              (setq decipher-char ?\s))
          (or (and (equal decipher-char ?\s)
                   (equal decipher--loop-prev-char ?\s))
              (funcall func))
          (setq decipher--loop-prev-char decipher-char)
          (forward-char))
        (or (equal decipher-char ?\s)
            (progn
              (setq decipher-char ?\s
                    decipher--loop-prev-char ?\s)
              (funcall func)))))))