Function: mh-alias-canonicalize-suggestion

mh-alias-canonicalize-suggestion is a byte-compiled function defined in mh-alias.el.gz.

Signature

(mh-alias-canonicalize-suggestion STRING)

Documentation

Process STRING to replace spaces by periods.

First all spaces and commas are replaced by periods. Then every run
of consecutive periods are replaced with a single period. Finally the string is converted to lower case.

Source Code

;; Defined in /usr/src/emacs/lisp/mh-e/mh-alias.el.gz
(defun mh-alias-canonicalize-suggestion (string)
  "Process STRING to replace spaces by periods.
First all spaces and commas are replaced by periods.   Then every run
of consecutive periods are replaced with a single period.  Finally the
string is converted to lower case."
  (with-temp-buffer
    (insert string)
    ;; Replace spaces with periods
    (goto-char (point-min))
    (while (re-search-forward " +" nil t)
      (replace-match "." nil nil))
    ;; Replace commas with periods
    (goto-char (point-min))
    (while (re-search-forward ",+" nil t)
      (replace-match "." nil nil))
    ;; Replace consecutive periods with a single period
    (goto-char (point-min))
    (while (re-search-forward "\\.\\.+" nil t)
      (replace-match "." nil nil))
    ;; Convert to lower case
    (downcase-region (point-min) (point-max))
    ;; Whew! all done...
    (buffer-string)))