From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: [External] : Re: Making new menu after Tools using keymap-set-after Date: Wed, 19 Jul 2023 14:58:49 +0300 Message-ID: <83edl45czq.fsf@gnu.org> References: <83ttu15gjz.fsf@gnu.org> <83o7k95ejr.fsf@gnu.org> <83lefd5b1m.fsf@gnu.org> <5CJ7IA6FUfpae6IJLkriZ9erzWkJP7y-GsJUYNBD1MXDgZG2q6Ho1gAxhmD_yf1fDZ9Ycw520lPskK17X77xwjM3n_VruWHV6kP7owNkWEo=@proton.me> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32195"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 19 13:59:19 2023 Return-path: Envelope-to: geh-help-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 1qM5pu-0008B3-S6 for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 19 Jul 2023 13:59:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qM5pK-0004P7-SK; Wed, 19 Jul 2023 07:58:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qM5pI-0004Oy-8a for help-gnu-emacs@gnu.org; Wed, 19 Jul 2023 07:58:41 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qM5pH-0007R1-OX for help-gnu-emacs@gnu.org; Wed, 19 Jul 2023 07:58:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=dtIgfzD8DKdnl6e3hA+gOMrpizPNTqkIIgAWmKscgqs=; b=LBxuD6feU59n2WZsMqMh DZXylEI96+Gc8y5U4dYupeLYQWyVV8NH6aTz3QHiCJUpo32QAyZMgNuxyixXVaAp0nR0wDoqIzfDW UidI0bCIME2ZRQS6he/5bUjZ5BjWfgIUJrbVpDxvk/PZL+1wkX6Glw7bC1WsxoWCxwugQ6pJlpJG6 KDFPEzKrJlbN4iaUJdmAgr6+qddltZ6BlYdbG+bp1WgYWFrOBryHvf0Ldk4dwvG0ODwIQMeqAOiAU 2BhnAs/99dww7P64zPHHtXmdhD4PYnaummFm2Us7OUY2sesOoSshQQsQQ9dnObcPJb4rkLQcE2dcn pNhWx5zOWYsYsQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qM5p1-0003qR-Q8 for help-gnu-emacs@gnu.org; Wed, 19 Jul 2023 07:58:32 -0400 In-Reply-To: (message from Drew Adams on Tue, 18 Jul 2023 20:42:18 +0000) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:144327 Archived-At: > From: Drew Adams > CC: "help-gnu-emacs@gnu.org" > Date: Tue, 18 Jul 2023 20:42:18 +0000 > > (keymap-set-after my-menu "" > '("Drink" . drink-command) 'eat) > > makes a binding for the fake function key and puts it right > after the binding for . > > Here is how to insert an item called ‘Work’ in the ‘Signals’ menu > of Shell mode, after the item ‘break’: > > (keymap-set-after shell-mode-map " " > '("Work" . work-command) 'break) > ___ > > This node of the manual comes after nodes that > specify defining menus in general. > ___ > > BTW, Eli, isn't `define-key' here a typo - > shouldn't it be `keymap-set': > > When you insert a new item in an existing menu, > you probably want to put it in a particular > place among the menu’s existing items. If you use > ‘define-key’ to add the item, it normally goes at > ^^^^^^^^^^ > the front of the menu. To put it elsewhere in the > menu, use ‘keymap-set-after’: Not a typo, because all the descriptions of making menu items in previous sections use define-key. If someone wants to rewrite those sections to use keymap-set, patches will be welcome.