Function: woman-expand-locale

woman-expand-locale is a byte-compiled function defined in woman.el.gz.

Signature

(woman-expand-locale LOCALE)

Documentation

Expand a locale into a list suitable for man page lookup.

Expands a locale of the form LANGUAGE_TERRITORY.CHARSET into the list: LANGUAGE_TERRITORY.CHARSET LANGUAGE_TERRITORY LANGUAGE.CHARSET LANGUAGE. The TERRITORY and CHARSET portions may be absent.

Source Code

;; Defined in /usr/src/emacs/lisp/woman.el.gz
;; FIXME Is this a sensible list of alternatives?
(defun woman-expand-locale (locale)
  "Expand a locale into a list suitable for man page lookup.
Expands a locale of the form LANGUAGE_TERRITORY.CHARSET into the list:
LANGUAGE_TERRITORY.CHARSET LANGUAGE_TERRITORY LANGUAGE.CHARSET LANGUAGE.
The TERRITORY and CHARSET portions may be absent."
  (string-match "\\([^._]*\\)\\(_[^.]*\\)?\\(\\..*\\)?" locale)
  (let ((lang (match-string 1 locale))
        (terr (match-string 2 locale))
        (charset (match-string 3 locale)))
    (delq nil (list locale
                    (and charset terr (concat lang terr))
                    (and charset terr (concat lang charset))
                    (if (or charset terr) lang)))))