[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Thu, 13 Dec 2007 21:16:10 +0200
Gnus/5.110007 (No Gnus v0.7) Emacs/22.1 (gnu/linux)
Quoth HANS jackman <address@hidden>:
> i just want to know how to create interfaces with Emacs and how to
> create functions and calling them.
C-h f <function-name> RET
M-x describe-function RET <function-name> RET
for a short description about a function.
C-h f defun RET
"defun is a special form in `C source code'.
(defun NAME ARGLIST [DOCSTRING] BODY...)
Define NAME as a function.
The definition is (lambda ARGLIST [DOCSTRING] BODY...).
See also the function `interactive'."
Here's an example function definiton:
(defun foo (bar baz) "Join strings" (let ((fum (concat bar " " baz)))
(message "%s" fum)))
^ ^ ^ |________________________________|
| | | |
| | | |
NAME ARGLIST DOCSTRING BODY
Copy this function definition to the *scratch* buffer, place point (the
cursor) below it and type:
to 'evalute' the function. The word 'foo' should appear.
(foo "hello" "world")
and the string "hello world" should appear.
You have just written, evaluated and called your first function.
Hope this helps,
P.S. C-h is the key sequence Ctrl-h ('Ctrl' key + 'h' key, together)
- help, HANS jackman, 2007/12/13
- Re: help, Mike Mattie, 2007/12/13
- Re: help,
Sebastian Tennant <=