Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Matthieu Moy
"rio.jean" writes:
Je désire ecrire la fonction suivante :
(defun par () "création d'une parenthèse et positionnement du curseur" (interactive) (progn (insert "{" ) (return) (return) (insert "}" )
(insert "{nn}")
(backward-char) ))
bien sur l'écriture n'est pas correct : la fonction return n'étant pas acceptée
,----[ C-h f return RET ] | return is a Lisp macro in `cl-macs'. | (return &optional RESULT) | | Return from the block named nil. | This is equivalent to `(return-from nil RESULT)'. `----
Mais ça ne fait pas ce que tu veux ;-)
. Que faut il écrire à la place ?
,----[ C-h f newline RET ] | newline is an interactive compiled Lisp function in `simple'. | (newline &optional ARG) | | Insert a newline, and move to left margin of the new line if it's blank. | The newline is marked with the text-property `hard'. | With ARG, insert that many newlines. | In Auto Fill mode, if no numeric arg, break the preceding line if it's long. `----
En fait, si tu écris ce que tu écris, il faut aussi que tu te renseignes de toute urgence sur les skeletons :
,----[ C-h f define-skeleton RET ] | define-skeleton is an autoloaded Lisp macro in `skeleton'. | [Arg list not available until function definition is loaded.] | | Define a user-configurable COMMAND that enters a statement skeleton. | DOCUMENTATION is that of the command, while the variable of the same name, | which contains the skeleton, has a documentation to that effect. | INTERACTOR and ELEMENT ... are as defined under `skeleton-insert'. `----
-- Matthieu
"rio.jean" <rio.jean@wanadoo.fr> writes:
Je désire ecrire la fonction suivante :
(defun par ()
"création d'une parenthèse et positionnement du curseur"
(interactive)
(progn
(insert "{" )
(return)
(return)
(insert "}" )
(insert "{nn}")
(backward-char)
))
bien sur l'écriture n'est pas correct : la fonction return n'étant pas
acceptée
,----[ C-h f return RET ]
| return is a Lisp macro in `cl-macs'.
| (return &optional RESULT)
|
| Return from the block named nil.
| This is equivalent to `(return-from nil RESULT)'.
`----
Mais ça ne fait pas ce que tu veux ;-)
. Que faut il écrire à la place ?
,----[ C-h f newline RET ]
| newline is an interactive compiled Lisp function in `simple'.
| (newline &optional ARG)
|
| Insert a newline, and move to left margin of the new line if it's blank.
| The newline is marked with the text-property `hard'.
| With ARG, insert that many newlines.
| In Auto Fill mode, if no numeric arg, break the preceding line if it's long.
`----
En fait, si tu écris ce que tu écris, il faut aussi que tu te
renseignes de toute urgence sur les skeletons :
,----[ C-h f define-skeleton RET ]
| define-skeleton is an autoloaded Lisp macro in `skeleton'.
| [Arg list not available until function definition is loaded.]
|
| Define a user-configurable COMMAND that enters a statement skeleton.
| DOCUMENTATION is that of the command, while the variable of the same name,
| which contains the skeleton, has a documentation to that effect.
| INTERACTOR and ELEMENT ... are as defined under `skeleton-insert'.
`----
(defun par () "création d'une parenthèse et positionnement du curseur" (interactive) (progn (insert "{" ) (return) (return) (insert "}" )
(insert "{nn}")
(backward-char) ))
bien sur l'écriture n'est pas correct : la fonction return n'étant pas acceptée
,----[ C-h f return RET ] | return is a Lisp macro in `cl-macs'. | (return &optional RESULT) | | Return from the block named nil. | This is equivalent to `(return-from nil RESULT)'. `----
Mais ça ne fait pas ce que tu veux ;-)
. Que faut il écrire à la place ?
,----[ C-h f newline RET ] | newline is an interactive compiled Lisp function in `simple'. | (newline &optional ARG) | | Insert a newline, and move to left margin of the new line if it's blank. | The newline is marked with the text-property `hard'. | With ARG, insert that many newlines. | In Auto Fill mode, if no numeric arg, break the preceding line if it's long. `----
En fait, si tu écris ce que tu écris, il faut aussi que tu te renseignes de toute urgence sur les skeletons :
,----[ C-h f define-skeleton RET ] | define-skeleton is an autoloaded Lisp macro in `skeleton'. | [Arg list not available until function definition is loaded.] | | Define a user-configurable COMMAND that enters a statement skeleton. | DOCUMENTATION is that of the command, while the variable of the same name, | which contains the skeleton, has a documentation to that effect. | INTERACTOR and ELEMENT ... are as defined under `skeleton-insert'. `----
-- Matthieu
Jacques L'helgoualc'h
Le 10-05-2005, Matthieu Moy a écrit :
"rio.jean" writes:
Je désire ecrire la fonction suivante :
(defun par () "création d'une parenthèse et positionnement du curseur" (interactive) (progn (insert "{" ) (return) (return) (insert "}" )
(insert "{nn}")
(backward-char) ))
[...]
,----[ C-h f newline RET ]
(newline-and-indent) ; est peut-être utile aussi, tout comme (indent-for-tab-command) ; et (previous-line 1)
-- Jacques L'helgoualc'h
Le 10-05-2005, Matthieu Moy <MatthieuNOSPAM.Moy@imag.fr.invalid> a écrit :
"rio.jean" <rio.jean@wanadoo.fr> writes:
Je désire ecrire la fonction suivante :
(defun par ()
"création d'une parenthèse et positionnement du curseur"
(interactive)
(progn
(insert "{" )
(return)
(return)
(insert "}" )
(insert "{nn}")
(backward-char)
))
[...]
,----[ C-h f newline RET ]
(newline-and-indent) ; est peut-être utile aussi, tout comme
(indent-for-tab-command) ; et
(previous-line 1)