From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Dimech Newsgroups: gmane.emacs.help Subject: Re: Generality of defvar Date: Thu, 28 Jul 2022 15:57:01 +0200 Message-ID: References: <87pmhqbuoo.fsf@dataswamp.org> <95a861a4-56ab-de04-14a9-e0dbfee57253@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="39786"; mail-complaints-to="usenet@ciao.gmane.io" Cc: carlmarcos@tutanota.com, Emanuel Berg , help-gnu-emacs To: thibaut.verron@gmail.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 28 16:12:29 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 1oH4FZ-000AAH-Ja for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 28 Jul 2022 16:12:29 +0200 Original-Received: from localhost ([::1]:43926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oH4FY-00019i-2f for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 28 Jul 2022 10:12:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oH40i-0006HM-84 for help-gnu-emacs@gnu.org; Thu, 28 Jul 2022 09:57:09 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:54365) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oH40g-0003Fz-2a for help-gnu-emacs@gnu.org; Thu, 28 Jul 2022 09:57:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1659016621; bh=JRv7qAKuHBvOKeknb439bgPtH1MW4qSV88HDiM4ckgE=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=KBkQrY/VjUgJZWDAa5dTsXfIHkZ8z8uIvjN+3luJe5O+EezVgIZrhwv6t2BTTN7Pl iBjkrd/J+TTSdrUStNeXYipNAfseijYlsaYWWjak3UukuaQ+6ougJvebC7kE2zaz00 LebtpYsGz4rEpYUfoH7JQ5TP/JBkXRBmFJsgpBOw= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [92.251.127.164] ([92.251.127.164]) by web-mail.gmx.net (3c-app-mailcom-bs07.server.lan [172.19.170.175]) (via HTTP); Thu, 28 Jul 2022 15:57:01 +0200 Importance: normal Sensitivity: Normal In-Reply-To: <95a861a4-56ab-de04-14a9-e0dbfee57253@gmail.com> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:MzpqHdBKjy6u2rcMjxHb/bm4XLAsl9ulZ7yK6sumuxgTO/whviX95cZR6OokYBMFwpe9v SwAIHNZZRUWV8yOTsM5A9q924+6QNyhQWphUZkc7FeeOCJ5D9Qami3h8V5kQAgAxpobCxyxSMiZk Yqhx9jn4eZikA6/Ddg4oQruM7A/UGwzKmi9ZZ+vJDRsOE3+5cT+rGcbunrw2Rzm/1mvdtR0GB0KM b6jCoqejCjkcPDSm/R519ENg2CMLmvitvhgEgKPmo+G2kDj8LCV2TcRJ8WXqewGzKrcL6UccmWg2 X8= X-UI-Out-Filterresults: notjunk:1;V03:K0:D0XKIpI1/kQ=:OVrxqkyZgoVn8B8PYBSu98 nyoN5X0IQGT26ONcxsNPWB16es8BO6PYyFhd80EgzWoEHBHdhnOOyu2RECPsBfA//sIMVEg7A vbvsEceo/9iC4OQBLMllh3apUQWyTNnyxilcEqtcDEw3ljqx0K+FgeQIbEucrDXRwVkf9TAKH lfelz0wEqHeu4eZcsxHrmtykozkqxBrrsQm5NKza6AsPul3202nYsPxl+IABYXaEultPGXeva uBQQ31a44MtYMY5KO5GJSOKC9rMUUrGRJQMBwvJ7BJHuKwWy3i+QfKOY3mGst36B0b7Z0eM4e d92UqG3qKrTp4bZZ6faFBDkfDM+sXf5cvFV9PPdV0ktoHm8DzcJ4wxejjr+5Ppwt5Msl0+VPY IHIRg9nTwzCauCDxSqvvr9nb6WiizaP5jB1MQyUnmD/LZPBtg379HR+BlWfHkM3ZUHL39pkMH OOITJZ4/XMMWiacCAOhu/CaOaVVpDVruaMAXMhOgl4R52VYTB3SDb6Kzl3BGQ6ok7/6sytIVD lwOpfI6V8RqZLw389AsPQflfgg5Wv2fjLY98393Q3P1+Nh3m5I41f09bEYOB1IHsMVJCcSBVh t76yNpwLZ/9cHgSUgND7El+OxX0dIYSOP/7JesaAbOQ/s0cLrAb1DroDd+NTtjjskvdjdwU5Z nteC5E5JJs9rzUU5P8YIhRutGCDDD0mBQu0WOYO22yabs5ZznW3fKKOvK7uJjYlwcxpTNntD8 FK4O2pqnRG9JGliicnyXvlZ/mnSp5dVqD0Gt121JrLBFxecsdbher6eHvhFwq+4kh0CMT4YF Received-SPF: pass client-ip=212.227.17.20; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, 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-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:138656 Archived-At: > Sent: Thursday, July 28, 2022 at 9:37 PM > From: thibaut=2Everron@gmail=2Ecom > To: "Christopher Dimech" , carlmarcos@tutanota=2Ecom, = "Emanuel Berg" , "help-gnu-emacs" > Subject: Re: Generality of defvar > > On 28/07/2022 09:34, Christopher Dimech wrote: > > *Sent:*=C2=A0Thursday, July 28, 2022 at 7:06 PM > > *From:*=C2=A0"Thibaut Verron" > > *To:*=C2=A0"Christopher Dimech" > > *Cc:*=C2=A0carlmarcos@tutanota=2Ecom, "Emanuel Berg" ,=20 > > "help-gnu-emacs" > > *Subject:*=C2=A0Re: Generality of defvar > > Le=C2=A0jeu=2E 28 juil=2E 2022 =C3=A0=C2=A008:42, Christopher Dimech <= dimech@gmx=2Ecom=20 > > > a =C3=A9crit=C2=A0: > >=20 > > *Sent:*=C2=A0Thursday, July 28, 2022 at 4:39 AM > > *From:*=C2=A0"Thibaut Verron" > > > > *To:*=C2=A0"Christopher Dimech" > > > *Cc:* carlmarcos@tutanota=2Ecom = , > > "Emanuel Berg" >, > > "help-gnu-emacs" > > > > *Subject:*=C2=A0Re: Generality of defvar > > Le=C2=A0mer=2E 27 juil=2E 2022 =C3=A0=C2=A018:29, Christopher Dime= ch > > a =C3=A9crit=C2=A0: > >=20 > >=20 > >=20 > > > Sent: Thursday, July 28, 2022 at 1:47 AM > > > From: "Thibaut Verron" > > > > > To: carlmarcos@tutanota=2Ecom > > > Cc: "Emanuel Berg" > >, "help-gnu-emacs" > > > > > > Subject: Re: Generality of defvar > > > > > > Le mer=2E 27 juil=2E 2022 =C3=A0 15:24, > > a =C3=A9crit : > > > > > > > > > > > Jul 27, 2022, 13:21 by thibaut=2Everron@gmail=2Ecom > > : > > > > > > > > > Le mer=2E 27 juil=2E 2022 =C3=A0 14:52, carlmarcos--- v= ia Users > > list for the GNU > > > > Emacs text editor <> help-gnu-emacs@gnu=2Eorg > > > > a =C3=A9crit : > > > > > > > > > >> > > > > >> > > > > >>=C2=A0 Jul 27, 2022, 12:34 by >> incal@dataswamp=2Eorg > > >> : > > > > >> > > > > >>=C2=A0 > carlmarcos--- via Users list for the GNU Emacs= text > > editor wrote: > > > > >>=C2=A0 > > > > > >>=C2=A0 >> (defun enable-error-diagnostics () > > > > >>=C2=A0 >>=C2=A0 "Enable error diagnostics with backtrac= e buffer=2E > > > > >>=C2=A0 >> One can exit the debugger with the q command= =2E" > > > > >>=C2=A0 >> > > > > >>=C2=A0 > > > > > >>=C2=A0 > You can refer to keys in docstrings like this: > > > > >>=C2=A0 > > > > > >>=C2=A0 >=C2=A0 \\[forward-word] > > > > >>=C2=A0 > > > > > >>=C2=A0 > That way, it isn't hardcoded so if later > > changed/configured > > > > >>=C2=A0 > it'll still show the right key=2E > > > > >>=C2=A0 > > > > > >>=C2=A0 How can I figure out what key to use in the docs= tring > > for exiting the > > > > backtrace buffer? > > > > >> > > > > > > > > > > The function bound to 'q' is quit-window=2E But since t= his > > function > > > > doesn't have a global binding, you need to tell the > > docstring to use the > > > > appropriate keymap to look the binding up=2E > > > > > > > > > > Something like > > > > > > > > > >=C2=A0 =C2=A0"Enable error diagnostics with backtrace bu= ffer=2E > > > > > > > > > > \\ (note: this is the part telling > > emacs where to > > > > look for the key) > > > > > One can exit the debugger with the `quit-window' comman= d > > (bound to > > > > \\[quit-window])=2E" > > > > > > > > > > > > > > Although quit-window is bound to q, the command > > \\[quit-window] just > > > > inserts > > > > M-x quit-window, rather than q=2E > > > > > > > > > > Yes, that's precisely because quit-window doesn't have a > > global binding=2E > > > You need to add \\ somewhere in the > > docstring to tell > > > emacs to show bindings for the backtrace buffers, rather th= an > > global > > > bindings=2E > > > > > > Best wishes, > > > Thibaut > >=20 > > Sounds good advice, but the result could be > >=20 > > Uses keymap =E2=80=98backtrace-mode-map=E2=80=99, which is not= currently defined=2E > >=20 > > My bad, it should have been debugger-mode-map=2E > > Not quite right yet=2E > >=20 > > I guess one should also put (require 'debug) at some point along with= =20 > > the function definition? > > Seems more bother than it solves=2E=C2=A0 Cannot see how users would b= e able to=20 > > figure all this complication > > out=2E >=20 > For sure=2E But it's really a rare situation, and not one that is likely= to hit first time users: one has to be writing a function with a docstring= , and this docstring has to involve a key bound in a keymap defined in anot= her file, and not loaded by default=2E >=20 > Even for users developing their own packages, usually the keymap will be= defined in a file loaded at the same time as the function, completely hidi= ng this subtlety=2E >=20 > Still, I would almost be tempted to consider this case a bug, and to exp= ect that emacs should autoload debug=2Eel to display the relevant informati= on=2E >=20 > Thibaut I concur Thibaut=2E Do send a report as you suggest=2E =20