🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #736

Re: On-line documentation for buffer-locals

#736
From: Kevin Broadey
Date: Thu, 03 Sep 1992 12:59
41 lines
2112 bytes
>>>>> In article "On-line documentation for buffer-locals", "Jonas" ==
>>>>> jonas@ericad.ericsson.SE (Jonas Jaernestroem TG/HK) writes:

Jonas> In Emacs 18.57 on a Sun Sparc SLC running 4.1.1 BSD.

Jonas> When maintaining or using somebodys (for example your own) elisp
Jonas> code, the on-line documentation strings on defuns and global
Jonas> variables (defvar & defconst) are a true delight.

Jonas> However I miss this capability on buffer-local variables, which I
Jonas> say are at least as important to document as the global ones. In
Jonas> my view, this makes buffer-local variables less pleasant to use
Jonas> than global variables, which I guess was not the implementors
Jonas> intention.

Jonas> In other words, I would like make-local-variable to have an
Jonas> optional second argument for the document string.

`make-local-variable' simply gives the variable a separate VALUE in the
buffer.  The symbol retains its other properties, including its
documentation string.  You can therefore do something like:-

(defvar my-variable nil "Documentation string")

...

(defun foobar-mode ()
  ...
  (make-local-variable 'my-variable)
  (setq my-variable 'wibble)
  ...

When you do  C-h v my-variable RET  the *Help* window will show the
value associated with the current buffer and the documentation string
specified in the `defvar'.

--
Kevin Broadey <kbroadey@edscom.demon.co.uk>
EDS-Scicon, Wavendon Tower, Wavendon, Milton Keynes, MK17 8LX, England.
Phone: +44 908 284198 (direct) or +44 908 585858 ext 4198
These opinions are mine: others available on request.
Technical Details
Message-ID: <KEVIN.92Sep3125950@runningbear.edscom.demon.co.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!edscom.demon.co.uk!kevin
References: kevin@edscom.demon.co.uk (Kevin Broadey)

Show Full Headers
Complete Article Headers
Newsgroups: gnu.emacs.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!edscom.demon.co.uk!kevin
From: kevin@edscom.demon.co.uk (Kevin Broadey)
Subject: Re: On-line documentation for buffer-locals
Message-ID: <KEVIN.92Sep3125950@runningbear.edscom.demon.co.uk>
Sender: gnulists@ai.mit.edu
Organization: EDS-Scicon, Milton Keynes, UK
References: kevin@edscom.demon.co.uk (Kevin Broadey)
Distribution: gnu
Date: Thu, 3 Sep 1992 12:59:50 GMT
Approved: bug-gnu-emacs@prep.ai.mit.edu
Lines: 42