I have an Elisp function which takes a string and performs capitalization (capitalize
) on it, and then inserts it into a file. Apparently capitalize
doesn't consider the single quote as a "word constituent" and therefore I get results like "I'M A Cat".
I understand that this is because of the syntax table in place. The default returned by (standard-syntax-table)
treats the quote as a "word constituent", so I'm assuming that code execution uses emacs-lisp-mode-syntax-table
which has it otherwise.
I tried executing capitalize
inside with-temp-buffer
but that didn't work for some reason.
So my questions are:
- Does the functions I have in my config use
emacs-lisp-mode-syntax-table
when I call them? - What's the standard way of dealing with this? What's a way to isolate my functions from inheriting all this context? I don't want to manually create a new table and use
with-syntax-table
for every function in my config or change the current table usingmodify-syntax-entry
, and I want my strings to be treated like normal English sentences.