From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eduardo Ochs Newsgroups: gmane.emacs.help Subject: Re: Is there any handy way to view a custom key map? Date: Sat, 15 Jan 2022 13:19:51 -0300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14445"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help GNU Emacs To: Jean Louis Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 15 17:21:09 2022 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 1n8lnh-0003dL-Pn for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 15 Jan 2022 17:21:09 +0100 Original-Received: from localhost ([::1]:45300 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8lng-00084v-5O for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 15 Jan 2022 11:21:08 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:60936) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8lmh-00084f-Er for help-gnu-emacs@gnu.org; Sat, 15 Jan 2022 11:20:07 -0500 Original-Received: from [2607:f8b0:4864:20::433] (port=46807 helo=mail-pf1-x433.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n8lmf-0002Y4-7e for help-gnu-emacs@gnu.org; Sat, 15 Jan 2022 11:20:07 -0500 Original-Received: by mail-pf1-x433.google.com with SMTP id i129so5642762pfe.13 for ; Sat, 15 Jan 2022 08:20:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Gv3TaK7FK49fR2rrurw4kbd2waTciQw0sSgCQpCLr4Q=; b=ZjDKgAqliU7CVrVdU1oNEOm2S6hRWK9fa/t7dJrL6WW60Rm0D2ZJf6LP6Jm4QGEdNF +nOdEQE6KJn1ChcoCe+5IRJzC9amO+pcuLCiBTK3c5S0bQgpKuX4S55ZcuuN2XQl+cT9 kOPi1Kn+q0OU9bYchqGQyIkmqmkeI5FGsrMnqVt+xA5J08zqcr7IeOuQiN6KT1ZDMrCF xFpWc1vObSF2iL37DIyDmwVBNKneMoGheaAY2+D/4xApw7KXdc21PbfsAX3iaOcMl00a KvSaCzR1Ex3wpOMZZaGgzmjyd6epC0ERRBvsiRko/E1dd27p0EU8qJ114aiLoFvXnP+c 07Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Gv3TaK7FK49fR2rrurw4kbd2waTciQw0sSgCQpCLr4Q=; b=g8A6iZEZ5JEgmZpa0Yk/l3gWIhvlNThj/NHraQLmqkIdi1y08eu5OzfdZMXoMuuAn8 8kNrn2IKvOkYhph6DleBCZ7rSTUZ+9Am0pyw1UJXhB1IB8MZFMrNLgiLT7CZEI6EahvW szd1FQNFYOd06gHCYMtrrSkZxmwz90/YezIVDXUmeiqoH6IeOBNyZuX8JpSUm9hAtILO rhUj4nt/cIh6wchOyXq6WeNugK3bltTRlZtRYoBdGlOKj7bvbRu/vSfZD36uYvnuWYPh XMep/0Z9k5ONP5HzV/7mu+njFuQe3LpaSVnPPbRAc2aoyu9v8oM/Z1AIZf4aaHyfe+g2 geqw== X-Gm-Message-State: AOAM532gwUGYEZylmuwQXxyal4WqAj2GjBOGx/pa0vIIIhWTdq7dyOrL wS8bBaQDFg4243GOAziGSkE3qaMH3g8sbXB35VHKVRGEz0qFnw== X-Google-Smtp-Source: ABdhPJw5RRRpp/zZ6wSGYUN1OuZ2fvLerrPOrLY2qr/gRA5jesetzqbr8FiW4v41UB/NF2xEu7avzPR7yco2tGfLek0= X-Received: by 2002:aa7:9d01:0:b0:4bd:ea4b:bec8 with SMTP id k1-20020aa79d01000000b004bdea4bbec8mr13924380pfp.43.1642263603415; Sat, 15 Jan 2022 08:20:03 -0800 (PST) In-Reply-To: X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::433 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=eduardoochs@gmail.com; helo=mail-pf1-x433.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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" Xref: news.gmane.io gmane.emacs.help:135332 Archived-At: On Sat, 15 Jan 2022 at 12:02, Jean Louis wrote: > I have plethora of various screens displaying lists of items from the > database. Different database tables have different key maps. > > Example: > > (defvar rcd-db-mode-map > (let ((map (make-sparse-keymap))) > (set-keymap-parent map tabulated-list-mode-map) > (define-key map (kbd "/") #'rcd-tabulated-filter) > (define-key map (kbd "G") #'goto-line) > (define-key map (kbd "Q") 'rcd-db-kill-database-buffers) > (define-key map (kbd "U") 'rcd-tabulated-remove-marks) > (define-key map (kbd "V") #'rcd-tabulated-id-to-register) > (define-key map (kbd "\\") #'rcd-tabulated-filter-reset) > (define-key map (kbd "d") #'rcd-db-delete-tab-database-entry) > (define-key map (kbd "e") #'rcd-db-edit-tab-database-entry) > (define-key map (kbd "g") #'rcd-tabulated-refresh) > (define-key map (kbd "j") #'next-line) > (define-key map (kbd "k") #'previous-line) > (define-key map (kbd "m") #'rcd-tabulated-mark-id) > (define-key map (kbd "u") #'rcd-tabulated-unmark-id) > (define-key map (kbd "z") #'rcd-tabulated-refresh) > map) > "The basic RCD database keymap") > > Similarly to command C-h m I would like to display those key bindings, > though separate from C-h m screen. > > Something like this below would be fine: > > Key Binding > > Q rcd-db-kill-database-buffers > U rcd-tabulated-remove-marks > V rcd-tabulated-id-to-register > d rcd-db-delete-tab-database-entry > > I would even prefer that key bindings have their description, so that > instead of the name of function under "Binding" there appears human > readable text something like "Remove Marks" instead of > "rcd-tabulated-remove-marks". > > Hi Jean-Louis, If you have eev installed, try this: (defvar rcd-db-mode-map (let ((map (make-sparse-keymap))) (set-keymap-parent map tabulated-list-mode-map) (define-key map (kbd "/") #'rcd-tabulated-filter) (define-key map (kbd "G") #'goto-line) (define-key map (kbd "Q") 'rcd-db-kill-database-buffers) (define-key map (kbd "U") 'rcd-tabulated-remove-marks) (define-key map (kbd "V") #'rcd-tabulated-id-to-register) (define-key map (kbd "\\") #'rcd-tabulated-filter-reset) (define-key map (kbd "d") #'rcd-db-delete-tab-database-entry) (define-key map (kbd "e") #'rcd-db-edit-tab-database-entry) (define-key map (kbd "g") #'rcd-tabulated-refresh) (define-key map (kbd "j") #'next-line) (define-key map (kbd "k") #'previous-line) (define-key map (kbd "m") #'rcd-tabulated-mark-id) (define-key map (kbd "u") #'rcd-tabulated-unmark-id) (define-key map (kbd "z") #'rcd-tabulated-refresh) map) "The basic RCD database keymap") (find-ekeymapdescr rcd-db-mode-map) The source code of `find-ekeymapdescr' is here, http://angg.twu.net/eev-current/eev-blinks.el.html#find-einternals and it should be easy to adapt it to what you need. Cheers, Eduardo Ochs http://angg.twu.net/#eev