From: David Reitter Date: Fri, 10 Jun 2016 07:58:41 +0000 (+1000) Subject: Simplify pre-write-conversion for utf-8-hfs coding system X-Git-Tag: emacs-26.0.90~1840^2~243 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ff9ddda9069da6b4dbcc64615cb4cab9a1f4f8b7;p=emacs.git 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). --- diff --git a/lisp/international/ucs-normalize.el b/lisp/international/ucs-normalize.el index 74978ce38a3..8c4f4911228 100644 --- a/lisp/international/ucs-normalize.el +++ b/lisp/international/ucs-normalize.el @@ -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