everything. I was wondering if Emacs lisp has a built-in function to verify that the string is entirely made up of capital letters. Here is what I am using now:
(setq capital-letters (string-to-list "ABCDEFGHIJKLMNOPQRSTUVWXYZ"))
(defun chars-are-capitalized (list-of-characters)
"Returns true if every character in a list of characters is a capital
letter. As a special case, the empty list returns true."
(cond
((equal list-of-characters nil) t)
((not (member (car list-of-characters) capital-letters)) nil)
(t (chars-are-capitalized (cdr list-of-characters)))))
(defun string-is-capitalized (string)
"Returns true if every character in a string is a capital letter. The
empty string returns true."
(chars-are-capitalized (string-to-list string)))
It works fine (although it relies on the assumption that I will only use ASCII characters), but I was wondering if I was missing some obvious function that I should know about.
source
share