emacs-devel
[Top][All Lists]
Advanced

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

Re: master c5cf630: Don't clobber match data in utf-8-hfs conversion (bu


From: Stefan Monnier
Subject: Re: master c5cf630: Don't clobber match data in utf-8-hfs conversion (bug#41445)
Date: Thu, 28 May 2020 09:40:32 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>  ;; Pre-write conversion for `utf-8-hfs'.
>  ;; _from and _to are legacy arguments (see `define-coding-system').
>  (defun ucs-normalize-hfs-nfd-pre-write-conversion (_from _to)
> -  (ucs-normalize-HFS-NFD-region (point-min) (point-max)))
> +  (save-match-data
> +    (ucs-normalize-HFS-NFD-region (point-min) (point-max))))

IIUC this is needed because `(en|de)code-coding-string`  is not supposed
to touch the match-data, right?

If so, I think we should do two things:

1- document that `(en|de)code-coding-string` preserve the match-data.
2- document in `define-coding-system` that the pre/post-conversion
   functions should preserve the match-data.

WDYT?


        Stefan




reply via email to

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