Advertisement

Somebody help with emacs, indenting comments in scheme!

Started by March 27, 2012 02:23 PM
-1 comments, last by andrew111 12 years, 10 months ago
EDIT: Ok a few minutes later I figure out its only comments with a single semi-colon that don't align, but with two semi-colons it does align properly.
So the problem is solved, I cannot see any option to delete the post.


[color=#d3d3d3]How can I make comments indent in line with the code in scheme. I've been looking everywhere, but I cannot find anything to do it.
C in emacs has that behavior automatically built in, so it mustn't be that hard to do!

For example, the current behavior is shown below:

(define (abc x)
(if (= x 3)
;;then
'a
;;else
'b))


What I want it do when indented is this:

(define (abc x)
(if (= x 3)
;;then
'a
;;else
'b))


In my .emacs file I've got:

(add-hook 'scheme-mode-hook '(lambda ()
(setq comment-indent-function (lambda () 0)) ;;need to replace the lambda return 0 with a function that returns the appropriate indent position
))


Maybe this isn't the appropriate place to ask, but those newsgroups look scary.

Not sure if gamedev can do the highlighting properly for scheme/lisp..

This topic is closed to new replies.

Advertisement