]> git.eshelyaron.com Git - emacs.git/commit
Do not alter match data in Fcapitalize etc.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 9 Jul 2019 20:10:27 +0000 (13:10 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 9 Jul 2019 20:11:45 +0000 (13:11 -0700)
commit412139f1be7415791a0d964f95f319c86eded426
treef6f2326b39ea44a93004df25ba98ab210246860f
parentce59b41a28aba629dd126e7af3c6e45909de6a83
Do not alter match data in Fcapitalize etc.

Without this patch, (capitalize "x") can alter the match data,
which is not what users expect.  Problem found by running
morse-tests-unnato-region in a stripped-down Emacs.
Perhaps ‘load’ should also save and restore the match data?
That would be a simpler fix, though arguably incompatible.
* src/lread.c (save_match_data_load): New function.
* src/chartab.c (uniprop_table):
* src/doc.c (reread_doc_file):
* src/eval.c (Fautoload_do_load):
* src/fns.c (Frequire): Use it.
src/chartab.c
src/doc.c
src/eval.c
src/fns.c
src/lisp.h
src/lread.c