| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Is there a way to set the indentation rules for scheme-mode in emacs (21.4.1) just as they are for example in drscheme? The default ones are just bizzare : (define (function arg) (cond ((<condition>) ( <--------- after hitting <TAB>, emacs puts the caret in the position of the paren (the parentheses don't line up) (define (function arg) (cond ((<condition>) ( <------- I'd rather it to be like this (one character to the left). I've put a (put 'cond 'scheme-indent-function 10) in my .emacs but it didn't help (on the other hand the "if" special form is indented nicely (with (put 'if 'scheme-indent-function 3))). |
|
#2
| |||
| |||
| "Juliusz.Gonera@gmail.com" <Juliusz.Gonera@gmail.com> writes: > Is there a way to set the indentation rules for scheme-mode in emacs > (21.4.1) > just as they are for example in drscheme? > > The default ones are just bizzare : > > (define (function arg) > (cond ((<condition>) > ( <--------- after hitting <TAB>, emacs puts the caret > in the position of the paren (the parentheses don't line up) > > (define (function arg) > (cond ((<condition>) > ( <------- I'd rather it to be like this (one character > to the left). > > I've put a (put 'cond 'scheme-indent-function 10) in my .emacs but it > didn't help (on the other hand the "if" special form is indented > nicely (with (put 'if 'scheme-indent-function 3))). The meaning of the number put in the scheme-indent-function property is the number of _forms_ that shall be indented slightly more than the normal body forms. For example: #+emacs (put 'my-operator 'scheme-indent-function 3) (my-operator a b c d e f g) (my-operator a b c d e f g) I don't observe your bizarre behavior: (define (function arg) (cond (<condition> <body> <body>) (<condition> <body> <body>) (else <body> <body>))) You should try paredit, it's really worthwhile an add-on to edit lisp code in emacs. With paredit, I didn't even had to type any TAB for the above examples, paredit-mode did indent automatically on RET. -- __Pascal Bourguignon__ http://www.informatimago.com/ READ THIS BEFORE OPENING PACKAGE: According to certain suggested versions of the Grand Unified Theory, the primary particles constituting this product may decay to nothingness within the next four hundred million years. |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.