emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Add examples to elisp method documentation


From: Ruslan Kiselev
Subject: Add examples to elisp method documentation
Date: Sun, 12 Jun 2016 14:01:16 -0400

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]