From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#30660: mention describe-bindings on (info "(emacs) Keymaps") Date: Sat, 24 Aug 2019 00:40:34 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="64783"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 30660@debbugs.gnu.org, =?UTF-8?Q?=E7=A9=8D=E4=B8=B9=E5=B0=BC?= Dan Jacobson To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Aug 24 00:41:19 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i1IFB-000GXf-Gp for geb-bug-gnu-emacs@m.gmane.org; Sat, 24 Aug 2019 00:41:17 +0200 Original-Received: from localhost ([::1]:34526 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i1IF3-0004mx-UP for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Aug 2019 18:41:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44077) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i1IEw-0004mq-WC for bug-gnu-emacs@gnu.org; Fri, 23 Aug 2019 18:41:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i1IEw-0006lH-0S for bug-gnu-emacs@gnu.org; Fri, 23 Aug 2019 18:41:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60798) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i1IEv-0006l8-U0 for bug-gnu-emacs@gnu.org; Fri, 23 Aug 2019 18:41:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i1IEv-00063u-PR for bug-gnu-emacs@gnu.org; Fri, 23 Aug 2019 18:41:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Aug 2019 22:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30660 X-GNU-PR-Package: emacs Original-Received: via spool by 30660-submit@debbugs.gnu.org id=B30660.156660005523276 (code B ref 30660); Fri, 23 Aug 2019 22:41:01 +0000 Original-Received: (at 30660) by debbugs.gnu.org; 23 Aug 2019 22:40:55 +0000 Original-Received: from localhost ([127.0.0.1]:41386 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i1IEo-00063K-Q7 for submit@debbugs.gnu.org; Fri, 23 Aug 2019 18:40:55 -0400 Original-Received: from mail-pf1-f180.google.com ([209.85.210.180]:41162) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i1IEm-00062y-CM for 30660@debbugs.gnu.org; Fri, 23 Aug 2019 18:40:52 -0400 Original-Received: by mail-pf1-f180.google.com with SMTP id 196so7412220pfz.8 for <30660@debbugs.gnu.org>; Fri, 23 Aug 2019 15:40:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3ciAnNhOIkRBHqfnxAisysAtqvlhlttzwAGVoa1sOow=; b=n1ct5x4BCnmMR26QeMBM8NAHN4T7nnv7n0pxOeNzVxX3vx0KqjVQ0OwQlzvzCwIl2o xOonGBRLYeuR4ckgslJvhXqqNxd5XBo/23GaBSbZYml7lL8yePw4O+3/EQvXv+bWQ+hG nLjeUCZW3HmLExFJP0ozHWsiP1SS3WyDSWn3RSwx5eiRhnB1exfKafzHcsS0NlZEOxxx gfZ4I7VxFmmLt78BZSMdYZo7z+xfCbPayJ4iQc6egjgL3MwenTWwH0fbh7h3U3zRsyUA kZx40czRs4yKHQp4XxfLpLWAMECbsMuU2VwKVvg70Lz8iCuR8l103sPM5Ay+D65WeIKC p5WQ== X-Gm-Message-State: APjAAAUx3R/ohGreTuaqvFQ/o48IveO1Z7hDGT55/RV1gFG0MBdz60x2 Ey3HZk4b0effaHDx3QMP4CKdbPJiOyCZI0Q9BEo= X-Google-Smtp-Source: APXvYqwW6e53atPzxflvwcLVIZSyUIP4Mlyscls5yW8aVQreGTeiSEK755bVPqTS8e8M7PZnm7+ackfq1LrtzZshfs0= X-Received: by 2002:a17:90a:fa8f:: with SMTP id cu15mr7605869pjb.119.1566600046444; Fri, 23 Aug 2019 15:40:46 -0700 (PDT) In-Reply-To: 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: 209.51.188.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:165733 Archived-At: Drew Adams writes: > `Info-make-manuals-xref' _is_ defined in > help-fns+.el. OK, sorry about that. I must have missed it. > Bottom line, if you want to add only bare-bones > `describe-keymap' to vanilla Emacs then just > use the attached definition. Thanks. I tried it, and I personally think it's a useful addition. Maybe others disagree. I was going to pack it up as a patch for review but I have some questions about the code first. > Non-interactively: > * KEYMAP can be such a keymap variable or a keymap. > * Non-nil optional arg SEARCH-SYMBOLS-P means that if KEYMAP is not a > symbol then search all variables for one whose value is KEYMAP." Is the purpose of SEARCH-SYMBOLS-P just to allow for calling it like this: (describe-keymap 'my-keymap t) (describe-keymap my-keymap t) And have it work automatically? Or am I missing something? Also see below. > (unless (and (symbolp keymap) (boundp keymap) (keymapp (symbol-value keymap))) > (if (not (keymapp keymap)) > (error "%sot a keymap%s" > (if (symbolp keymap) (format "`%S' is n" keymap) "N") > (if (symbolp keymap) " variable" "")) > (let ((sym nil)) > (when search-symbols-p > (setq sym (catch 'describe-keymap > (mapatoms (lambda (symb) (when (and (boundp symb) > (eq (symbol-value symb) keymap) > (not (eq symb 'keymap)) > (throw 'describe-keymap symb))))) > nil))) > (unless sym > (setq sym (gentemp "KEYMAP OBJECT (no variable) ")) > (set sym keymap)) > (setq keymap sym)))) I admit that I find this code a bit hard to follow. If I understand correctly, then most of this can be removed if we don't want to support SEARCH-SYMBOLS-P, and instead just require that the KEYMAP argument is a symbol. Is that correct or am I missing something? I'm sort of leaning towards simplifying this by removing the SEARCH-SYMBOLS-P argument, but I might not understand the use case here. If I'm missing something, could you please briefly describe the use case for that and if and why it's important to keep? > (setq keymap (or (ignore-errors (indirect-variable keymap)) keymap)) ; Follow aliasing. > (let* ((name (symbol-name keymap)) > (doc (let ((raw-doc (documentation-property keymap 'variable-documentation 'RAW))) > (substitute-command-keys raw-doc))) Why not just say (documentation-property keymap 'variable-documentation) without the 'RAW argument? That should have the same effect as passing the 'RAW argument and then calling substitute-command-keys on the result, AFAICT. > (doc (and (not (equal "" doc)) doc))) Is this to allow us to simply say (when doc ...) below instead of (when (not (equal "" doc)) ...) or am I missing something? Thanks, Stefan Kangas