Avoid failing to entirely overwrite abbrev file

This can happen when the current buffer is smaller than the existing
content when a numerical APPEND argument to write-region.
This commit is contained in:
TEC 2024-03-27 01:03:49 +08:00
parent 9357cbb0fe
commit 44e3a693da
Signed by: tec
SSH Key Fingerprint: SHA256:eobz41Mnm0/iYWBvWThftS0ElEs1ftBr6jamutnXc/A
1 changed files with 1 additions and 1 deletions

View File

@ -4310,7 +4310,7 @@ Also set it as a parent of `global-abbrev-table'."
(setq coding-system-for-write 'utf-8-emacs))
(goto-char (point-min))
(insert (format ";;-*-coding: %s;-*-\n\n" coding-system-for-write))
(write-region nil nil autocorrect-abbrev-file 0)))
(write-region nil nil autocorrect-abbrev-file)))
(setq autocorrect-abbrev-table--saved-version
(abbrev-table-get autocorrect-abbrev-table
:abbrev-table-modiff))))