emacs-devel
[Top][All Lists]
Advanced

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

Re: Questionable code in handling of wordend in the regexp engine in reg


From: Eli Zaretskii
Subject: Re: Questionable code in handling of wordend in the regexp engine in regex-emacs.c
Date: Sat, 02 Mar 2019 14:21:49 +0200

> Date: Sat, 2 Mar 2019 11:16:40 +0000
> From: Alan Mackenzie <address@hidden>
> Cc: address@hidden, address@hidden

Forgot to answer this part:

> In fact, is buf_bytepos_to_charpos the Right Thing to use here?

Yes, because decode-coding-region must also work in a multibyte
buffer.  The code in buf_bytepos_to_charpos takes care of the unibyte
use case right away, returning a trivial 1:1 mapping:

  /* If this buffer has as many characters as bytes,
     each character must be one byte.
     This takes care of the case where enable-multibyte-characters is nil.  */
  if (best_above == best_above_byte)
    return bytepos;



reply via email to

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