From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Thorpe Newsgroups: gmane.emacs.help Subject: Re: Supplying DOC string in a `defun' using `defvar' Date: Tue, 01 Jun 2021 23:15:19 +0100 Message-ID: <8735u18c5k.fsf@robertthorpeconsulting.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37368"; mail-complaints-to="usenet@ciao.gmane.io" Cc: ndokos@gmail.com, help-gnu-emacs@gnu.org To: Christopher Dimech Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 02 00:16:46 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 1loCgo-0009c2-Ga for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 02 Jun 2021 00:16:46 +0200 Original-Received: from localhost ([::1]:38406 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loCgm-0002EU-VC for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 01 Jun 2021 18:16:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39322) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loCgF-0002EC-38 for help-gnu-emacs@gnu.org; Tue, 01 Jun 2021 18:16:11 -0400 Original-Received: from outbound-smtp49.blacknight.com ([46.22.136.233]:60755) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loCg9-0006B8-Ku for help-gnu-emacs@gnu.org; Tue, 01 Jun 2021 18:16:09 -0400 Original-Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp49.blacknight.com (Postfix) with ESMTPS id 110EDFB09B for ; Tue, 1 Jun 2021 23:16:01 +0100 (IST) Original-Received: (qmail 6439 invoked from network); 1 Jun 2021 22:16:00 -0000 Original-Received: from unknown (HELO rt-inspiron-3480) (rt@robertthorpeconsulting.com@[109.76.69.158]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 1 Jun 2021 22:16:00 -0000 In-Reply-To: (message from Christopher Dimech on Tue, 1 Jun 2021 21:02:00 +0200) Received-SPF: pass client-ip=46.22.136.233; envelope-from=rt@robertthorpeconsulting.com; helo=outbound-smtp49.blacknight.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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:130475 Archived-At: I tried this example out. In a emacs-lisp-mode buffer I put the following: (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. BR, Robert Thorpe