From: Anders Lindgren <andlind@gmail.com>
To: David Reitter <david.reitter@gmail.com>
Cc: Alan Third <alan@idiocy.org>, Emacs-Devel devel <emacs-devel@gnu.org>
Subject: Re: Redisplay: NS port, high CPU load
Date: Thu, 9 Jun 2016 20:52:44 +0200 [thread overview]
Message-ID: <CABr8ebb_hctLX4eoaq4iA=k_bmJZ80VfOLkj6BNSvAAM3VErHA@mail.gmail.com> (raw)
In-Reply-To: <CDDC7ABF-24DF-4726-A8F9-8EA7CA2B82A8@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2267 bytes --]
>
> > 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.
>
Great news!
> ;; 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))
>
>
> 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.
>
>
It looks like this function needs to be modernized. (In my december rewrite
I simply started using it, assuming that it was fully functional.) Given
the documentation, it *should* be enough to implement it like this (with a
big reservation -- this is all new to me):
(defun ucs-normalize-hfs-nfd-pre-write-conversion (from to)
(ucs-normalize-HFS-NFD-region (point-min) (point-max))
nil)
If I remember correctly, the rewrite tried to correct two problems:
* When deleting a character like "ä" (which in the HFS file system is
decomposed into "a" and "¨") the full character should be deleted. Earlier,
when pressing backspace, "ä" was converted to an "a".
* Completion: If a directory contains files like "åäö.txt" and "aao.txt",
Emacs used to say that "a" was the common start to both sequences.
See the discussion in bug 22169 for more information.
-- Anders
[-- Attachment #2: Type: text/html, Size: 3256 bytes --]
next prev parent reply other threads:[~2016-06-09 18:52 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-08 6:04 Redisplay: NS port, high CPU load David Reitter
2016-06-08 7:50 ` Anders Lindgren
2016-06-08 10:44 ` David Reitter
2016-06-08 19:55 ` Alan Third
2016-06-08 20:12 ` David Reitter
2016-06-09 1:03 ` David Reitter
2016-06-09 8:22 ` David Reitter
2016-06-09 9:25 ` Anders Lindgren
2016-06-09 13:04 ` David Reitter
2016-06-09 14:11 ` Anders Lindgren
2016-06-09 18:03 ` David Reitter
2016-06-09 18:52 ` Anders Lindgren [this message]
2016-06-09 23:03 ` David Reitter
2016-06-10 6:02 ` Anders Lindgren
2016-06-10 8:16 ` David Reitter
2016-06-10 9:34 ` Eli Zaretskii
2016-06-10 9:46 ` David Reitter
2016-06-10 10:22 ` Eli Zaretskii
2016-06-10 10:36 ` David Reitter
2016-06-13 18:44 ` Anders Lindgren
2016-06-13 19:16 ` Eli Zaretskii
2016-06-14 12:07 ` David Reitter
2016-06-14 17:02 ` Eli Zaretskii
2016-06-15 3:55 ` Stefan Monnier
2016-06-14 11:50 ` David Reitter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CABr8ebb_hctLX4eoaq4iA=k_bmJZ80VfOLkj6BNSvAAM3VErHA@mail.gmail.com' \
--to=andlind@gmail.com \
--cc=alan@idiocy.org \
--cc=david.reitter@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.