bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#50752: 28.0.50; easy-menu-define lowers the menu-bar key


From: Lars Ingebrigtsen
Subject: bug#50752: 28.0.50; easy-menu-define lowers the menu-bar key
Date: Tue, 19 Oct 2021 05:52:15 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Lars Ingebrigtsen <larsi@gnus.org> writes:

> So if the string is multibyte, it downcases correctly, but if not, it...
> turns a capital I into the digit 1?
>
> (downcase "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
> => "abcdefgh1jklmnopqrstuvwxyz"

I guess it's from this:

static Lisp_Object
do_casify_unibyte_string (struct casing_context *ctx, Lisp_Object obj)
{
  ptrdiff_t i, size = SCHARS (obj);
  int ch, cased;

  obj = Fcopy_sequence (obj);
  for (i = 0; i < size; i++)
    {
      ch = make_char_multibyte (SREF (obj, i));
      cased = case_single_character (ctx, ch);
      if (ch == cased)
        continue;
      cased = make_char_unibyte (cased);
      /* If the char can't be converted to a valid byte, just don't
         change it.  */
      if (SINGLE_BYTE_CHAR_P (cased))
        SSET (obj, i, cased);
    }
  return obj;
}

Which just looks wrong to me.  The logic in Fdowncase seems to assume
that a unibyte string can never be downcased to a multibyte one, but
that make_char_unibyte is picking out the lowest eight bits of the char
we've downcased to and puts that into the downcased string.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

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