From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: ludvig-faddeev@gmx.com Newsgroups: gmane.emacs.help Subject: [External] : Supplying DOC string in a `defun' using `defvar' Date: Tue, 1 Jun 2021 23:50:07 +0200 Message-ID: References: <874keitr8t.fsf@web.de> <87o8cqsa07.fsf@web.de> <87zgwaqtlj.fsf@web.de> <877djdy83k.fsf@web.de> 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="34573"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 01 23:50:57 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 1loCHo-0008mT-Ra for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 01 Jun 2021 23:50:56 +0200 Original-Received: from localhost ([::1]:53322 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loCHn-0008Qc-Ai for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 01 Jun 2021 17:50:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34480) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loCH5-0008No-VV for help-gnu-emacs@gnu.org; Tue, 01 Jun 2021 17:50:11 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:52041) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loCH2-0006Hb-Uz for help-gnu-emacs@gnu.org; Tue, 01 Jun 2021 17:50:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1622584207; bh=IEmmjsarAQbaUBYd6COit71z1ZGCynk6r8h9lEFaTVc=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=Mn+uZ6Y/No7PTgFdXPBs/wHOf1YwMKgNovBsayO8dF83sFJIXgVtUDBBa1gv955ye EKijwR0MkHaGqfvG7oWalm5qmQkKMoedV+5dksKeDYijJP9L8xQ1GRyjJQYYVsdJ+C Vsymjls6IXgCw0WXeyORYvAUc3vOw24i1pO6T05o= 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); Tue, 1 Jun 2021 23:50:07 +0200 Importance: normal Sensitivity: Normal In-Reply-To: <877djdy83k.fsf@web.de> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:g4aHNu4pzS/jMIjI8cETlHayubMmIu+gId7TqlqoXNKIp27o4IEyjqKlo9ePK8ZfzLYhC hbhLDkLVRcm14LHwtTYN3R6vH5JrSIKLAFi0NiGXzAWPJtqylf19R8xI0HYPzgSI8Rn0xwW3Kva2 vZWaNSROjWkLJtgLO0/qgQGuGPTIg/Q+HocKoTxuedSKMZBLQfnoNC7v8DhMFWAmFriQbCiXrQRU y3TX3Np4KYVKiNdgHQ+vdlDHU/C2q3yLqi6MJhaJ3HmQUsVz9jCnuZ1clYT9L7pkCjfuemUsF9Uj rU= X-UI-Out-Filterresults: notjunk:1;V03:K0:mbwbhQjk86w=:7AOBIcjwBn5HfwI9iKsPSq A/oWr3o7EYxTxMTTbWExevqFqN6/lAqXcpG9kGpaVeD3xGBFTGE9L+H+pfIx6ovYdSN97eebC zjblGMTQ7iy/D8+Io7Zuc6oX1dCIzHAF8nvmVtzY5NHQ6v3Hj8Qtu6NOeszW4Yq3ftPilynUW WtmP7c+JSxEz9jawwFOPKxJiKMgezZJAzmdjzlpwhVUhgyY3hVQmbjdN5voimmuWrLSdYIegz laqupGU9GphOhTICAyvvDR2rKomu/dY9V2TUU5O7kAwvNVfUJEMTUuB/qfxYXVVne9ibgdmHU LBiFCCHkIjYBUavCIOrux2rmWGwpzEerO38+kyQvc6johzc75BX3kEKA5iOaIXySRj6NgDM1W DMWn8LD0MJQAzjN/pd2YmPFZDtQMkGZ/lmtf3SuiVq5I0A8AzHGX5RPhJFn69TnO7PJIwinSf kqy6cMNwTCW37/3qTZ5XiottJiB9oVZlYRs3fEG8gONde+tKZUA3fb4eNqD3+tcrEZFZGc1x+ A6ODb2tqadklInyW/1R223K1/FkuhEjIxKJhTwWuhk+U5fLECRYfrZ1bP+ymQrFcNObFhtcIL dXE/SOS1mx5C2wFmBx+ufB+WEgmrBfkzMIpTM1VKOgUApsDa8P7eUzVnFNRNW5dh5/oeDcd+A 6JHXt0UA4+SJrAkciEwU44ii9TayWmUDlMXARMHQ2SYVnzGjVdqSgVNKyJJUR17HALJ55LUgx nkkDbT3XS0g1OX5X3OjiYBWxmhUHONZDLA3DrB5v1bgqbQ+afHFSjn0fTUiNE/MD9e+x7OxA Received-SPF: pass client-ip=212.227.15.18; envelope-from=ludvig-faddeev@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 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:130473 Archived-At: > Sent: Wednesday, June 02, 2021 at 2:26 AM > From: "Michael Heerdegen" > To: help-gnu-emacs@gnu.org > Subject: Re: [External] : Supplying DOC string in a `defun' using `defva= r' > > ludvig-faddeev@gmx.com writes: > > > Is it possible to define a function that sets a documentation string a= nd > > then calls > > > > (put 'wyfunc > > 'function-documentation 'mydetail) > > You don't need a variable as an intermediate step in that case at all, > that would be redundant -- because can use `get' to look up what is > stored in the function-documentation property of your symbol so far. Could I ust use the string directly in the "put" statement? (put 'myfunc 'function-documentation ) I want to only have a brief docstring in the function definition, with mor= e details done somewhere else (which at the current time I can do using a put). I could call the following function (defun defun-detail (fname detail) "Put DETAIL in function-documentation property of FNAME. Usage: (defun-detail 'fname 'detail)" (put fname 'function-documentation detail)) =2D------- code ------- (defvar detail-ziggurat-bufr-wlabel "Generate new temporary buffer with a user defined label. User gets asked for a label name through thu mini-buffer. Usage: C-u M-x ziggurat-bufr-wlabel M-x ziggurat-bufr-wlabel One can use a key-sequence to call ziggurat-bufr-wlabel (global-unset-key (kbd \"\")) (global-set-key (kbd \"\") #'ziggurat-bufr-wlabel)" "Detailed doc-string for ziggurat-bufr-wlabel") =2D------- ;; puts documentation in function-documentation property (defun-detail 'ziggurat-bufr-wlabel 'detail-ziggurat-bufr-wlabel) =2D------ (defun ziggurat-bufr-wlabel () "Generate new temporary buffer with a user defined label." (interactive) (ziggurat-bufr (read-from-minibuffer "Buffer name: "))) =2D------- > Use `put' to set it to something else, whether that reuses the old value > or not. There is really no magic here at all, it's just that trivial. > That symbol property is where the documentation is stored, just like a > variable - only the way of getting and setting the value looks different > compared to a variable. > > If you need a more concrete suggestion, I need to know more about your > use case. > > > Regards, > > Michael. > > > >