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 all text in a given region to NATO phonetic alphabet.
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 all text in a given region to NATO phonetic 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 "")))))))