A Cool New Command: howmany
I wanted to know how many abbrevs I had defined in the file I use to store all
my abbrevs. The number of abbrevs correspond to the number of lines in the
files that begin with (define-abbrev
. But it is not as simple as counting the
number of lines in the file itself because there are more than just those kinds
of lines. I tried narrowing but there are some comments intermingled with
define-abbrev lines. Finally, I asked chatGPT how to do this from Emacs and it
recommended a command I never knew existed: how-many. It does exactly what I
need: it prints the count of lines that match a given regular expression. I
simply invoked how many and gave it the regexp ^(define-abbrev
and voilĂ . As of
writing this, I have a whopping 1574
abbrevs.