Function: nato-region

nato-region is an autoloaded, interactive and byte-compiled function defined in morse.el.gz.

Signature

(nato-region BEG END)

Documentation

Convert plain text in region to NATO spelling alphabet.

View in manual

Probably introduced at or before Emacs version 24.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/play/morse.el.gz
;;;###autoload
(defun nato-region (beg end)
  "Convert plain text in region to NATO spelling alphabet."
  ;; Copied from morse-region. -- ashawley 2009-02-10
  (interactive "*r")
  (if (integerp end)
      (setq end (copy-marker end)))
  (save-excursion
    (let ((sep "")
	  str nato)
      (goto-char beg)
      (while (< (point) end)
	(setq str (downcase (buffer-substring (point) (1+ (point)))))
	(cond ((looking-at "\\s-+")
	       (goto-char (match-end 0))
	       (setq sep ""))
	      ((setq nato (assoc str nato-alphabet))
	       (delete-char 1)
	       (insert-before-markers sep (cdr nato))
	       (setq sep "-"))
	      (t
	       (forward-char 1)
	       (setq sep "")))))))