Mercurial > emacs
comparison lisp/emacs-lisp/easy-mmode.el @ 62181:14a20ce36638
(easy-mmode-pretty-mode-name): Improve commentary.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Sun, 08 May 2005 19:38:06 +0000 |
parents | e64f1e2ecec2 |
children | 50ff61f0f99d 62afea0771d8 |
comparison
equal
deleted
inserted
replaced
62180:c93c7826e334 | 62181:14a20ce36638 |
---|---|
59 (defun easy-mmode-pretty-mode-name (mode &optional lighter) | 59 (defun easy-mmode-pretty-mode-name (mode &optional lighter) |
60 "Turn the symbol MODE into a string intended for the user. | 60 "Turn the symbol MODE into a string intended for the user. |
61 If provided, LIGHTER will be used to help choose capitalization by, | 61 If provided, LIGHTER will be used to help choose capitalization by, |
62 replacing its case-insensitive matches with the literal string in LIGHTER." | 62 replacing its case-insensitive matches with the literal string in LIGHTER." |
63 (let* ((case-fold-search t) | 63 (let* ((case-fold-search t) |
64 ;; Produce "Foo-Bar Minor mode" from foo-bar-minor-mode. | 64 ;; Produce "Foo-Bar minor mode" from foo-bar-minor-mode. |
65 (name (concat (replace-regexp-in-string | 65 (name (concat (replace-regexp-in-string |
66 ;; "Foo-Bar-Minor" -> "Foo-Bar minor" | 66 ;; If the original mode name included "-minor" (some |
67 ;; of them don't, e.g. auto-revert-mode), then | |
68 ;; replace it with " minor". | |
67 "-Minor" " minor" | 69 "-Minor" " minor" |
68 ;; "foo-bar-minor" -> "Foo-Bar-Minor" | 70 ;; "foo-bar-minor" -> "Foo-Bar-Minor" |
69 (capitalize (replace-regexp-in-string | 71 (capitalize (replace-regexp-in-string |
70 ;; "foo-bar-minor-mode" -> "foo-bar-minor" | 72 ;; "foo-bar-minor-mode" -> "foo-bar-minor" |
71 "-mode\\'" "" (symbol-name mode)))) | 73 "-mode\\'" "" (symbol-name mode)))) |