]> git.eshelyaron.com Git - emacs.git/commitdiff
Simplify pre-write-conversion for utf-8-hfs coding system
authorDavid Reitter <david.reitter@gmail.com>
Fri, 10 Jun 2016 07:58:41 +0000 (17:58 +1000)
committerDavid Reitter <david.reitter@gmail.com>
Fri, 10 Jun 2016 08:00:03 +0000 (18:00 +1000)
* 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).

lisp/international/ucs-normalize.el

index 74978ce38a37b85898d1e7669b587aa4d209c6b5..8c4f49112287dcad9d340c96869f64fcef04a6ee 100644 (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