From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dieter Deyke Newsgroups: gmane.emacs.bugs Subject: bug#51527: 29.0.50; (wrong-type-argument symbolp 1) lookup-key((keymap) [menu-bar buffer 1]) Date: Sun, 31 Oct 2021 14:56:54 +0100 Message-ID: <87lf29uwk9.fsf@gmail.com> References: <87tugxodyn.fsf@gmail.com> <834k8xnxbt.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11646"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 51527@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 31 14:58:17 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mhBLk-0002qs-PA for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 31 Oct 2021 14:58:16 +0100 Original-Received: from localhost ([::1]:35668 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mhBLj-0007qj-DU for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 31 Oct 2021 09:58:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58350) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhBLX-0007qb-A8 for bug-gnu-emacs@gnu.org; Sun, 31 Oct 2021 09:58:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49393) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mhBLW-0002vq-Jo for bug-gnu-emacs@gnu.org; Sun, 31 Oct 2021 09:58:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mhBLW-0001LV-IU for bug-gnu-emacs@gnu.org; Sun, 31 Oct 2021 09:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dieter Deyke Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 31 Oct 2021 13:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51527 X-GNU-PR-Package: emacs Original-Received: via spool by 51527-submit@debbugs.gnu.org id=B51527.16356886255107 (code B ref 51527); Sun, 31 Oct 2021 13:58:02 +0000 Original-Received: (at 51527) by debbugs.gnu.org; 31 Oct 2021 13:57:05 +0000 Original-Received: from localhost ([127.0.0.1]:60939 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mhBKb-0001KJ-Cm for submit@debbugs.gnu.org; Sun, 31 Oct 2021 09:57:05 -0400 Original-Received: from mail-wm1-f42.google.com ([209.85.128.42]:51725) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mhBKZ-0001Jp-Ir for 51527@debbugs.gnu.org; Sun, 31 Oct 2021 09:57:04 -0400 Original-Received: by mail-wm1-f42.google.com with SMTP id z200so10768636wmc.1 for <51527@debbugs.gnu.org>; Sun, 31 Oct 2021 06:57:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=1CAp0QwQwt+zX876on6ykNu5pkdiZRI/Py/7br5WsmU=; b=om0KimZG1Co/4o5t74trLEjeo7BInq3FJPtyvbY9exIc+U2uJlm09JNkcZIohVv3cT zlpV5mgtLZxb+BZlFNLtRvcSLyINJaN5IzGRPB2sxM+/YSKBfSzIyR0FClSHzETtg681 gW3LAiQ4o7jUctuRAi0FVqYmGndjmwo0rUFp2I+fe9lG1S/ZBLbLtG4HEO/1bY36Os+8 ZqQef9u3aeWr5zlMotP7my3clfc9JYxpqkrlC7Z77RESiUKvzJYkKoLPRPlLQyVy4wzY uXAs6bSbgQtLWTXcZH9QQrwhUA8+o84PxTm69867sbWD/S3yuJNugLvAE5R2XPR0FQDw W8pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=1CAp0QwQwt+zX876on6ykNu5pkdiZRI/Py/7br5WsmU=; b=ZVZxEz2EO9FcklW4qc/N/BQ+RyNk0NADjlbefXw9A8EmsEwD1JhnkLFjP7x4J44E45 ahP8pgk4v+gpLl1LYzrTtvQ3VlobJZJ0IRUMpdjNhgVUuUL15kmAg9MLtBJNsp3rE6Ym ZgWKrfmm/XtI2WYDXUL6Q0OJy6F91dDtWfC135TSb3ATpBQojRK/6aUl45STYPZ34Rx6 7ijDqxPpfbMGbwm+JIwV03blzuiMBO7V2jIiPHmnRybqGQUdS+SEBcLrGYM4+SL/mBhd 3l42PFRT28qVZ4qfdjlQR3NK1zKKpmJTDtNNABBh/3hWQ2ifP4q36isfwoYxQFBRYaO2 VLyw== X-Gm-Message-State: AOAM532gS+QXXohbBVu0ma75TlOSVvV2hjyKyPID+x7O2oAMsAW4azh4 RDtfVVTnA+VdV+m3AAGNtN62VYji7jAHYw== X-Google-Smtp-Source: ABdhPJzAiDr734xuW98/Pp1f1J4l+RPQ0xjAqH7njizvDDYaXJB3beANU5iR2ZgIpTIzeMSqbr8LwA== X-Received: by 2002:a1c:9ad4:: with SMTP id c203mr24618156wme.23.1635688616258; Sun, 31 Oct 2021 06:56:56 -0700 (PDT) Original-Received: from deyke2.fritz.box (p200300dbaf3d9d00d25099fffe0f9cc9.dip0.t-ipconnect.de. [2003:db:af3d:9d00:d250:99ff:fe0f:9cc9]) by smtp.gmail.com with ESMTPSA id y12sm9462283wrn.73.2021.10.31.06.56.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Oct 2021 06:56:55 -0700 (PDT) Original-Received: from [127.0.0.1] (helo=deyke2.localdomain) by deyke2.fritz.box with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1mhBKQ-000Srm-Rz; Sun, 31 Oct 2021 14:56:54 +0100 In-Reply-To: <834k8xnxbt.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 31 Oct 2021 15:22:14 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:218683 Archived-At: Eli Zaretskii writes: >> From: Dieter Deyke >> Date: Sun, 31 Oct 2021 08:22:56 +0100 >> >> >> Using emacs -Q (build from git master) works fine. Starting it with my >> customizations fails: >> >> Debugger entered--Lisp error: (wrong-type-argument symbolp 1) >> lookup-key((keymap) [menu-bar buffer 1]) >> substitute-key-definition-key(("Most recently used (1)" keymap >> "Most recently used (1)" ("*Messages*" "*% *Messages*" >> . msb--select-buffer)) beginning-of-line allout-beginning-of-line >> [menu-bar buffer 1] (keymap)) > > Thanks. > > Does the patch below fix this? > > diff --git a/src/keymap.c b/src/keymap.c > index 5ff13ba..4d8944d 100644 > --- a/src/keymap.c > +++ b/src/keymap.c > @@ -1314,36 +1314,44 @@ DEFUN ("lookup-key", Flookup_key, Slookup_key, 2, 3, 0, > "foo-bar-baz". */ > for (int i = 0; i < key_len; i++) > { > - Lisp_Object key_item = Fsymbol_name (AREF (key, i)); > - Lisp_Object new_item; > - if (!STRING_MULTIBYTE (key_item)) > - new_item = Fdowncase (key_item); > + Lisp_Object item = AREF (key, i); > + if (!SYMBOLP (item)) > + ASET (new_key, i, item); > else > { > - USE_SAFE_ALLOCA; > - ptrdiff_t size = SCHARS (key_item), n; > - if (INT_MULTIPLY_WRAPV (size, MAX_MULTIBYTE_LENGTH, &n)) > - n = PTRDIFF_MAX; > - unsigned char *dst = SAFE_ALLOCA (n); > - unsigned char *p = dst; > - ptrdiff_t j_char = 0, j_byte = 0; > - > - while (j_char < size) > + Lisp_Object key_item = Fsymbol_name (item); > + Lisp_Object new_item; > + if (!STRING_MULTIBYTE (key_item)) > + new_item = Fdowncase (key_item); > + else > { > - int ch = fetch_string_char_advance (key_item, &j_char, &j_byte); > - Lisp_Object ch_conv = CHAR_TABLE_REF (tables[tbl_num], ch); > - if (!NILP (ch_conv)) > - CHAR_STRING (XFIXNUM (ch_conv), p); > - else > - CHAR_STRING (ch, p); > - p = dst + j_byte; > + USE_SAFE_ALLOCA; > + ptrdiff_t size = SCHARS (key_item), n; > + if (INT_MULTIPLY_WRAPV (size, MAX_MULTIBYTE_LENGTH, &n)) > + n = PTRDIFF_MAX; > + unsigned char *dst = SAFE_ALLOCA (n); > + unsigned char *p = dst; > + ptrdiff_t j_char = 0, j_byte = 0; > + > + while (j_char < size) > + { > + int ch = fetch_string_char_advance (key_item, > + &j_char, &j_byte); > + Lisp_Object ch_conv = CHAR_TABLE_REF (tables[tbl_num], > + ch); > + if (!NILP (ch_conv)) > + CHAR_STRING (XFIXNUM (ch_conv), p); > + else > + CHAR_STRING (ch, p); > + p = dst + j_byte; > + } > + new_item = make_multibyte_string ((char *) dst, > + SCHARS (key_item), > + SBYTES (key_item)); > + SAFE_FREE (); > } > - new_item = make_multibyte_string ((char *) dst, > - SCHARS (key_item), > - SBYTES (key_item)); > - SAFE_FREE (); > + ASET (new_key, i, Fintern (new_item, Qnil)); > } > - ASET (new_key, i, Fintern (new_item, Qnil)); > } > > /* Check for match. */ > @@ -1356,6 +1364,9 @@ DEFUN ("lookup-key", Flookup_key, Slookup_key, 2, 3, 0, > "foo-bar-baz". */ > for (int i = 0; i < key_len; i++) > { > + if (!SYMBOLP (AREF (new_key, i))) > + continue; > + > Lisp_Object lc_key = Fsymbol_name (AREF (new_key, i)); > > /* If there are no spaces in this symbol, just skip it. */ > Yes, the patch fixed it. Thank you, Eli. -- Dieter Deyke mailto:dieter.deyke@gmail.com Get my Gnupg key: gpg --keyserver keys.gnupg.net --recv-keys B116EA20