[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Redisplay: NS port, high CPU load

From: David Reitter
Subject: Re: Redisplay: NS port, high CPU load
Date: Fri, 10 Jun 2016 04:03:57 +1000

On Jun 10, 2016, at 12:11 AM, Anders Lindgren <address@hidden> wrote:

> Try to clear out one of :post-read-conversion and :pre-write-conversion to 
> see which of the two is the culprit. (While you're at it, try to clear out 
> both first just to make sure we're barking up the right tree.)

Bingo.  I had a look at the function and it’s the `insert’ into the temporary 
buffer that is causing this.

;; 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))

old-buf here is *code-conversion-work*.

I don’t understand this pre-write-conversion function.  According to the 
documentation of   `define-coding-system’, why would it make a new buffer and 
switch to it?

> VALUE must be a function to call after all functions in
> ‘write-region-annotate-functions’ and ‘buffer-file-format’ are
> called, and before the text is encoded by the coding system
> itself.  This function should convert the whole text in the
> current buffer.  For backward compatibility, this function is
> passed two arguments which can be ignored.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]