all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Add examples to elisp method documentation
@ 2016-06-12 18:01 Ruslan Kiselev
  2016-06-13  1:34 ` Michael Heerdegen
  0 siblings, 1 reply; 2+ messages in thread
From: Ruslan Kiselev @ 2016-06-12 18:01 UTC (permalink / raw)
  To: emacs-devel

Hopefully this is the correct place to aks for this. I'm relatively new to
Emacs/Elisp. It would be extremely helpful if at least some Elisp
function docs included examples.

For example, (describe-function 'let) returns the following:

    let is a special form in `C source code'.

    (let VARLIST BODY...)

    Bind variables according to VARLIST then eval BODY.
    The value of the last form in BODY is returned.
    Each element of VARLIST is a symbol (which is bound to nil)
    or a list (SYMBOL VALUEFORM) (which binds SYMBOL to the value of VALUEFORM).
    All the VALUEFORMs are evalled before any symbols are bound.

Addition of an example would make it easier for beginners to
understand/use:

  let is a special form in `C source code'.

  (let VARLIST BODY...)

  Bind variables according to VARLIST then eval BODY.
  The value of the last form in BODY is returned.
  Each element of VARLIST is a symbol (which is bound to nil)
  or a list (SYMBOL VALUEFORM) (which binds SYMBOL to the value of VALUEFORM).
  All the VALUEFORMs are evalled before any symbols are bound.

  Example:

  (let ((apple "apple")
       (orange "orange")
       (banana "banana"))
       (message (format "Fruits: %s %s %s" apple orange banana)))

I'd like to create a branch and work on adding snippets like this. It
would help me learn Emacs's funcs and IMO help future Emacs users.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-13  1:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-12 18:01 Add examples to elisp method documentation Ruslan Kiselev
2016-06-13  1:34 ` Michael Heerdegen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.