1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Simplify pre-write-conversion for utf-8-hfs coding system

* lisp/international/ucs-normalize.el
(ucs-normalize-hfs-nfd-pre-write-conversion): Refactor.

May address an issue where Emacs consumed large amounts of CPU
because of neverending toolbar updating (which was caused
by, but also called this function).
This commit is contained in:
David Reitter 2016-06-10 17:58:41 +10:00
parent 57e6c66dfb
commit ff9ddda906

View file

@ -614,13 +614,7 @@ COMPOSITION-PREDICATE will be used to compose region."
;; Pre-write conversion for `utf-8-hfs'.
(defun ucs-normalize-hfs-nfd-pre-write-conversion (from to)
(let ((old-buf (current-buffer)))
(set-buffer (generate-new-buffer " *temp*"))
(if (stringp from)
(insert from)
(insert-buffer-substring old-buf from to))
(ucs-normalize-HFS-NFD-region (point-min) (point-max))
nil))
(ucs-normalize-HFS-NFD-region (point-min) (point-max)))
;;; coding-system definition
(define-coding-system 'utf-8-hfs