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: Supplying DOC string in a `defun' using `defvar' Date: Wed, 2 Jun 2021 01:08:00 +0200 Message-ID: References: <8735u18c5k.fsf@robertthorpeconsulting.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="1285"; mail-complaints-to="usenet@ciao.gmane.io" Cc: ndokos@gmail.com, help-gnu-emacs@gnu.org To: Robert Thorpe Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 02 01:09:06 2021 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 1loDVS-000072-CM for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 02 Jun 2021 01:09:06 +0200 Original-Received: from localhost ([::1]:56100 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loDVR-0000Im-Ew for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 01 Jun 2021 19:09:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loDUT-0000Hr-FS for help-gnu-emacs@gnu.org; Tue, 01 Jun 2021 19:08:05 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:51795) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loDUR-0007By-1q for help-gnu-emacs@gnu.org; Tue, 01 Jun 2021 19:08:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1622588880; bh=w37Uj3q/3seAUTWhhh8LEy1F35fJxJdARUXCOjIlm/w=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=GfIHecf7pRRLmDVxwg10mTDZUj+lBeBnd7xYDWDmCtSX7z/Tn5gQNwTfpQRoEVhgV XRj9moPpyMWS7D8yH3grBT6nltzNgsKWNEPsxS2qYCi7eTbMLB2P0LNXJ7bxQe/bnC ZN77WVKwni0s9tOvDZnF0TjdMlGAH930PUs89DzM= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [213.165.168.94] ([213.165.168.94]) by web-mail.gmx.net (3c-app-mailcom-bs03.server.lan [172.19.170.169]) (via HTTP); Wed, 2 Jun 2021 01:08:00 +0200 Importance: normal Sensitivity: Normal In-Reply-To: <8735u18c5k.fsf@robertthorpeconsulting.com> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:bK7zOhQZQjJJ9cInavPAky4i+1wzY04b3SyAFhfeIjX7rSzzgGdlju5Hfmn68frR/fP9h jwlxPimHBMKQvOauTZ2D+7KXbhnBNyE0pElhNVOvFDu8AfoU6QWJFb/NBxHGMti42Y+k8+wBWZ22 Tc+rzWKaBgIRAVCAv7Z4HNpDFO3Rxnwwu5rNsAKoPAcQPNFuOGzqzj0UnHPvjTW09Hb0ED0b5Mf1 jrp+ZHZyO89DM8mQb9wvospDCb+DZGLJ+RPy+NhJS0M8rtQeu4BlHP1+kds1rQnMkvwtkWojm5cs cY= X-UI-Out-Filterresults: notjunk:1;V03:K0:VDRGvYbayDk=:5gNAxQEoJqCuMZS3C7fSHu NORB8hWdd7sTkCNWYivOXgsasl2bSUFC5CrQ6QkyWiN4qmlhuON60jmf47W9IcRtwcoinTEoW g4A44paBcXolVGsX2DY1rjvZaVn2LpTQ51oUkFg5fTc52iviTWsfJibHaBVLZ9JN+Y9sw1qpl qboOVku5jPRR1vFuE4dZXNeuE0iNYpmgMxUg7UkzZ2s5E70kBUTYiWv4USqaq+SBG1rX/w0PJ NBjZYP63h80WL2Vqog0Sv8bIRppv9csaqSn0OB1c6R55pSDL8ZElgO78ualYshuje8G661ayz UGpjRL7YAIokjihPdKwoVGtLE8oISDJIKvy2UoEulA0CFeONk5MQR3nPeubSVHJPczI3I1N7d hY0VnaPOIPF9Mo/0Sg2CVHWRrbgk+FdRl3WCDcRnL+3cGkITzmdGuzje37gEpQ1VI8cnPTXEL C2XA2xWUynDRPOc2VRFNkqORSXJZxE2w4N1exmrcGkLrKaMUyHWQgE1Uu2JSWCSIXP5IrzT6P PvOlbZ/qejUeNaddQ9Se6T8BwEA8mzb/RKw6w7goALXdFeS5pPlhzygRGipKU4sXamSf5hyP0 uXKTnDyOGCWf8mbjzrmOiq7CUxNdIbXAFjQhTMjtaRvhyR8V7kaACEznZXK3ghcaiKMZIQwhT LdUNrn9xaOyyhODfCGZY547PF3ljC4tqisjE18ffC9snQFYmAiyD1w2D77sTKlxyl0u0HvdaZ Y0w1IU/R+NYIu0DLG0wuZAmrhdoDDuqBfjK9O7+Ovqgi4TWSG7ejukHIVVlgAEfnnTM1JVfw Received-SPF: pass client-ip=212.227.17.20; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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:130480 Archived-At: > Sent: Wednesday, June 02, 2021 at 10:15 AM > From: "Robert Thorpe" > To: "Christopher Dimech" > Cc: ndokos@gmail.com, help-gnu-emacs@gnu.org > Subject: Re: Supplying DOC string in a `defun' using `defvar' > > I tried this example out. In a emacs-lisp-mode buffer I put the followi= ng: > > (setq lexical-binding t) > > (defvar my-doc "foobar") > > (defun my-fun (x) > (:documentation my-doc) > (+ x 42)) > > I evaluated each of them in turn. After that when I do C-h f on my-fun > I get "foobar". What is a little strange is that Emacs tells me that > my-fun is a "Lisp closure". > > If I *don't* have the first line (the lexical-binding one) then this > doesn't work. In that case C-h f tells me that my-fun is a "Lisp > function" and has no documentation. Correct > BR, > Robert Thorpe >