From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thibaut Verron Newsgroups: gmane.emacs.help Subject: Re: Generality of defvar Date: Wed, 27 Jul 2022 15:47:20 +0200 Message-ID: References: <87r127h40s.fsf@posteo.net-N7wjq17--3-2> <87pmhqbuoo.fsf@dataswamp.org> Reply-To: thibaut.verron@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35474"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emanuel Berg , help-gnu-emacs To: carlmarcos@tutanota.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 27 15:50:30 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 1oGhQk-00091b-MK for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 27 Jul 2022 15:50:30 +0200 Original-Received: from localhost ([::1]:37712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oGhQj-0003zQ-M3 for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 27 Jul 2022 09:50:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39798) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGhNw-0003xt-Ic for help-gnu-emacs@gnu.org; Wed, 27 Jul 2022 09:47:42 -0400 Original-Received: from mail-il1-x134.google.com ([2607:f8b0:4864:20::134]:46908) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oGhNu-0005aJ-Bo for help-gnu-emacs@gnu.org; Wed, 27 Jul 2022 09:47:36 -0400 Original-Received: by mail-il1-x134.google.com with SMTP id f8so639378ils.13 for ; Wed, 27 Jul 2022 06:47:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=bpZoW3C+8/7t2u/r2OUqQGQtZeZ8VFvm/3dacUKppNc=; b=lmBXG8AUe4DVPoCPwFMPCU0IDSPkhlbd7/AJy8So+SqYzucBaqEEnp0Gx5HqSZllIX qAANUUX5f3nFNUQJVd1OurkhW55tDl3EGOdXWxSr2VT4VGb+aPDCbHaNMHnGL0l2Fc6F f6z7PUhxo5PZR/pMAnkAROe8/tu/S9uVwzWK3hbv0XhCyaHSEvGvfCak4Bmlotgw15Lc w5SqO2oendnd+iUd8Iwj813+sNI1TDshmh+cXZWM/M2z+R1o2xC3BwYXUqyHw3F4adCn UuB5PruC05vuZCGqnmPFvbwx3EiZ1pyFCYvDu8TKxVyBLAikm/wwOho+0tMCrYI0faqO t7og== 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:reply-to :from:date:message-id:subject:to:cc; bh=bpZoW3C+8/7t2u/r2OUqQGQtZeZ8VFvm/3dacUKppNc=; b=mMDBeNzTOrMRq7Dqqb3nM/dGrSddpk+L4/WR5+DECAc4i6vlPS79kxnxVyrVVjXhX6 Ob6pQN/eec4+MGbRtcrN9vCSiaqGJnMzmv34mi2V64SGGiOfY7rgsU/+v9IarXS8qpqY qN5NrtoC2mYnndRSEtoWBPnrNl8Auo2QBru0xa7BKcx5gbBc9sOGVAZD+IcqK8g8kmma q1Vjo9ZOqggycqIrRRFprvAphXLDXLiqH3SYBOg+/seiZZl8+kHuR2mlxg2yLWbu3D3M c9RLwX633DoqdLaGPu2tPbLp+ngmp0VC9hGVSkezu1JMfdTNz+8SkGbKA65PcNbNM9OF iPBQ== X-Gm-Message-State: AJIora/XToJ6349qq/bLABAnO346CxQV3OGrTLIitfcm+CPhDH4MNHGG XDmE0/+8MnaNWoQQK6Ep6/6x+5s3PWeQ3P+tbRA= X-Google-Smtp-Source: AGRyM1tiuIcPPerPv83cBPiy2rAdKXDMo1HOQOXxr3GE0iggdgvHvLmQiWnqdVDZhiDoHGe/3GtaK7s1IehMZXDpkXw= X-Received: by 2002:a92:cac1:0:b0:2da:d188:ad84 with SMTP id m1-20020a92cac1000000b002dad188ad84mr8458025ilq.21.1658929652557; Wed, 27 Jul 2022 06:47:32 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::134; envelope-from=thibaut.verron@gmail.com; helo=mail-il1-x134.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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:138648 Archived-At: Le mer. 27 juil. 2022 =C3=A0 15:24, a =C3=A9crit = : > > Jul 27, 2022, 13:21 by thibaut.verron@gmail.com: > > > Le mer. 27 juil. 2022 =C3=A0 14:52, carlmarcos--- via Users list for th= e GNU > Emacs text editor <> help-gnu-emacs@gnu.org> > a =C3=A9crit : > > > >> > >> > >> Jul 27, 2022, 12:34 by >> incal@dataswamp.org>> : > >> > >> > carlmarcos--- via Users list for the GNU Emacs text editor wrote: > >> > > >> >> (defun enable-error-diagnostics () > >> >> "Enable error diagnostics with backtrace buffer. > >> >> One can exit the debugger with the q command." > >> >> > >> > > >> > You can refer to keys in docstrings like this: > >> > > >> > \\[forward-word] > >> > > >> > That way, it isn't hardcoded so if later changed/configured > >> > it'll still show the right key. > >> > > >> How can I figure out what key to use in the docstring for exiting the > backtrace buffer? > >> > > > > The function bound to 'q' is quit-window. But since this function > doesn't have a global binding, you need to tell the docstring to use the > appropriate keymap to look the binding up. > > > > Something like > > > > "Enable error diagnostics with backtrace buffer. > > > > \\ (note: this is the part telling emacs where to > look for the key) > > One can exit the debugger with the `quit-window' command (bound to > \\[quit-window])." > > > > > Although quit-window is bound to q, the command \\[quit-window] just > inserts > M-x quit-window, rather than q. > Yes, that's precisely because quit-window doesn't have a global binding. You need to add \\ somewhere in the docstring to tell emacs to show bindings for the backtrace buffers, rather than global bindings. Best wishes, Thibaut