From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#9898: 24.0.90; doc of :key-sequence Date: Fri, 24 Mar 2017 23:22:56 -0400 Message-ID: <87ziga11m7.fsf@users.sourceforge.net> References: <8738jsaktq.fsf@building.gnus.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1490412144 5354 195.159.176.226 (25 Mar 2017 03:22:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 25 Mar 2017 03:22:24 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: 9898@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 25 04:22:18 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1crcHM-0008ES-8Y for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Mar 2017 04:22:12 +0100 Original-Received: from localhost ([::1]:35756 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1crcHP-0008Jx-06 for geb-bug-gnu-emacs@m.gmane.org; Fri, 24 Mar 2017 23:22:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58239) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1crcHG-0008DI-Fx for bug-gnu-emacs@gnu.org; Fri, 24 Mar 2017 23:22:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1crcHC-0001jV-Ru for bug-gnu-emacs@gnu.org; Fri, 24 Mar 2017 23:22:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44839) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1crcHC-0001jR-Ny for bug-gnu-emacs@gnu.org; Fri, 24 Mar 2017 23:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1crcHC-00029q-IG for bug-gnu-emacs@gnu.org; Fri, 24 Mar 2017 23:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Mar 2017 03:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9898 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9898-submit@debbugs.gnu.org id=B9898.14904121098271 (code B ref 9898); Sat, 25 Mar 2017 03:22:02 +0000 Original-Received: (at 9898) by debbugs.gnu.org; 25 Mar 2017 03:21:49 +0000 Original-Received: from localhost ([127.0.0.1]:43038 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1crcGv-00029G-Bg for submit@debbugs.gnu.org; Fri, 24 Mar 2017 23:21:48 -0400 Original-Received: from mail-it0-f42.google.com ([209.85.214.42]:35957) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1crcGp-00028i-IA for 9898@debbugs.gnu.org; Fri, 24 Mar 2017 23:21:43 -0400 Original-Received: by mail-it0-f42.google.com with SMTP id w124so26717155itb.1 for <9898@debbugs.gnu.org>; Fri, 24 Mar 2017 20:21:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=+XGBGl4yNQInOjhfySkL6HOcNgEI4nL7RpKx4ajAOLA=; b=iu+WEMUr9YjXEdQi6y4tZkUL8udZH07U2v3jh5PZ688LsTgLeaK5gx+6ikILkopyRB QkweH4fOlv5YOmvRII4F8e6hfBXKQUSpvP7j4rz2tv3YxaSs6LZgm+sjGPyEcDNz9K7u S2ey83LtlbdS3N6Rn7s6x8KblnwzuI54rjuXgtjQ6rkpLjgiHgvnlYiQe/8fsjrypvCi Evrj0nElnouvpViV48mh1K8M4NuOrM2h42/cgRaSIwpNk9ihWjYI3VtbBkdgpvZ3vyw6 cY/hGD5odw14ilXVMcqH0jOgTpTvdb5Stnzvj9AOB4Bjsd133TCnppOKQoi9/lsLFOkH WJzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=+XGBGl4yNQInOjhfySkL6HOcNgEI4nL7RpKx4ajAOLA=; b=FBLXYzLazGB5TNxDSUkpc3r3RBUD02eclWnTUND2KEBodMXs1jKuEYJ1PJdVkjiIyZ F24UAf9OwaRNDehuzBtVVkFMOPag/Bg2bUOa9ArJ4EezzPtqQf3/4fWp5PL1dU2kg6qT FJKFwC1wBVKakX1QzPowoOfP20VT07NQkqQz5mN5tynKJuKZkYE6/jzv9CZRFgEATZ47 l+bh8ru0MXtK34sYEeObVim4LpRPARHzjgUvMdN8oHMZoEYIR//UzZcOyWjFsgylA9uk SRXQsKmfJrXovpEUhMy1zfAalkctHMnFzr3vBLLZevI7fp7ditQ8FavkJ5sSF07xYvQU XRQg== X-Gm-Message-State: AFeK/H3Uk3Gc0mgpkEAcUO897BZz0Tx1SSHcwQHgHpbRRSXqCnbCQFoTjxAHOxLyX0VWGg== X-Received: by 10.107.191.67 with SMTP id p64mr11090051iof.236.1490412093875; Fri, 24 Mar 2017 20:21:33 -0700 (PDT) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id y125sm1955017itb.4.2017.03.24.20.21.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 Mar 2017 20:21:33 -0700 (PDT) In-Reply-To: <8738jsaktq.fsf@building.gnus.org> (Lars Ingebrigtsen's message of "Sat, 08 Feb 2014 21:58:41 -0800") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:130905 Archived-At: Lars Ingebrigtsen writes: > "Drew Adams" writes: > >> (elisp) Extended Menu Items >> >> "`:key-sequence nil' >> This property indicates that there is normally no key binding >> which is equivalent to this menu item. Using this property saves >> time in preparing the menu for display, because Emacs does not >> need to search the keymaps for a keyboard equivalent for this menu >> item. >> >> However, if the user has rebound this item's definition to a key >> sequence, Emacs ignores the `:keys' property and finds the keyboard >> equivalent anyway." >> >> Should that `:keys' be `:key-sequence'? Since when do we override :keys >> with whatever the command is bound to? > > Looking at the code, it looks to me that the documentation is wrong > here. But I might be wrong. The function in question that uses this > stuff is `easy-menu-convert-item-1'. Somebody should take a look and > decide. I think the relevant code is in `parse_menu_item' of keyboard.c, `easy-menu-convert-item-1' is only constructing menu items, not interpreting them. As far as I can tell, `:key-sequence nil' doesn't actually do anything different from just not specifying `:key-sequence' at all (with the minor exception that passing both `:keys STRING' and `:key-sequence nil' causes the `:keys STRING' to be ignored). So I propose just removing both `:key-sequence nil' paragraphs. parse_menu_item (Lisp_Object item, int inmenubar) { Lisp_Object def, tem, item_string, start; Lisp_Object filter; Lisp_Object keyhint; int i; filter = Qnil; keyhint = Qnil; [...] /* Parse properties. */ while (CONSP (item) && CONSP (XCDR (item))) { tem = XCAR (item); item = XCDR (item); [...] else if (EQ (tem, QCkey_sequence)) { tem = XCAR (item); if (SYMBOLP (tem) || STRINGP (tem) || VECTORP (tem)) /* Be GC protected. Set keyhint to item instead of tem. */ keyhint = item; } [...] /* The previous code preferred :key-sequence to :keys, so we preserve this behavior. */ if (STRINGP (keyeq) && !CONSP (keyhint)) keyeq = concat2 (space_space, Fsubstitute_command_keys (keyeq)); else { [...] if (CONSP (keyhint) && !NILP (XCAR (keyhint))) { keys = XCAR (keyhint); [...] } if (NILP (keys)) keys = Fwhere_is_internal (def, Qnil, Qt, Qnil, Qnil);