Function: decipher-make-checkpoint

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

Signature

(decipher-make-checkpoint DESC)

Documentation

Checkpoint the current cipher alphabet.

This records the current alphabet so you can return to it later. You may have any number of checkpoints. Type M-x decipher-restore-checkpoint (decipher-restore-checkpoint) to restore a checkpoint.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/play/decipher.el.gz
;;--------------------------------------------------------------------
;; Checkpoints:
;;--------------------------------------------------------------------
;; A checkpoint is a comment of the form:
;;   %!ABCDEFGHIJKLMNOPQRSTUVWXYZ! Description
;; Such comments are usually placed at the end of the buffer following
;; this header (which is inserted by decipher-make-checkpoint):
;;   %---------------------------
;;   % Checkpoints:
;;   % abcdefghijklmnopqrstuvwxyz
;; but this is not required; checkpoints can be placed anywhere.
;;
;; The description is optional; all that is required is the alphabet.

(defun decipher-make-checkpoint (desc)
  "Checkpoint the current cipher alphabet.
This records the current alphabet so you can return to it later.
You may have any number of checkpoints.
Type `\\[decipher-restore-checkpoint]' to restore a checkpoint."
  (interactive "sCheckpoint description: " decipher-mode)
  (or (stringp desc)
      (setq desc ""))
  (let (alphabet
        buffer-read-only)               ;Make buffer writable
    (goto-char (point-min))
    (re-search-forward "^)")
    (move-to-column 27 t)
    (setq alphabet (buffer-substring-no-properties (- (point) 26) (point)))
    (if (re-search-forward "^%![A-Z ]+!" nil 'end)
       nil ; Add new checkpoint with others
      (if (re-search-backward "^% *Local Variables:" nil t)
          ;; Add checkpoints before local variables list:
          (progn (forward-line -1)
                 (or (looking-at "^ *$")
                     (progn (forward-line) (insert ?\n) (forward-line -1)))))
      (insert "\n%" (make-string 69 ?\-)
              "\n% Checkpoints:\n% abcdefghijklmnopqrstuvwxyz\n"))
    (beginning-of-line)
    (insert "%!" alphabet "! " desc ?\n)))