summaryrefslogtreecommitdiff
path: root/src/doc.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2019-07-09 13:10:27 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2019-07-09 13:11:45 -0700
commit412139f1be7415791a0d964f95f319c86eded426 (patch)
treef6f2326b39ea44a93004df25ba98ab210246860f /src/doc.c
parentce59b41a28aba629dd126e7af3c6e45909de6a83 (diff)
downloademacs-412139f1be7415791a0d964f95f319c86eded426.tar.gz
emacs-412139f1be7415791a0d964f95f319c86eded426.tar.bz2
emacs-412139f1be7415791a0d964f95f319c86eded426.zip
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.
Diffstat (limited to 'src/doc.c')
-rw-r--r--src/doc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/doc.c b/src/doc.c
index 8875360d6e6..8b663f0f249 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -302,7 +302,7 @@ reread_doc_file (Lisp_Object file)
if (NILP (file))
Fsnarf_documentation (Vdoc_file_name);
else
- Fload (file, Qt, Qt, Qt, Qnil);
+ save_match_data_load (file, Qt, Qt, Qt, Qnil);
return 1;
}