[plt-scheme] Re: Useful Emacs code when working with PLT Scheme

From: Guillaume Marceau (gmarceau at cs.brown.edu)
Date: Sun Dec 7 19:58:58 EST 2003

I use the following snipet. It reindent the whole sexp under the cursor.

  (defun indent-current-sexp ()
    (interactive)
    (save-excursion
      (unless (= (char-after) 40)
        (up-list)
        (backward-sexp))
      (indent-according-to-mode)
      (indent-sexp)))

  (add-hook 'scheme-mode-hook
    (lambda () (define-key scheme-mode-map "\C-\M-q" 'indent-current-sexp)))


On Sun, 7 Dec 2003, Bill Clementson wrote:

>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
> Hmm, I haven't had any bites yet on my original post,
> so I'll suggest another useful snippet of Emacs code.
>
> This code comments out an s-expression using
> multi-line comments (e.g. -- #|...|#). The code is
> here:
> http://home.comcast.net/~bc19191/2003_12_07_bill-clementson_archive.html#107083580171772470
>
> Here are the rules:
> 1. When the insert-balanced-comments function is
> invoked, it will comment out the s-expression that the
> cursor is enclosed in.
> 2. If the function is evoked again immediately
> afterwards, the comment will move out an s-expression.
> 3. If a prefix key is used, it will comment out the
> s-expression that is "prefix-argument" away from the
> cursor.
> 4. When the remove-balanced-comments function is
> invoked, it will un-comment the nearest enclosing
> s-expression.
>
> Anybody else have any useful Emacs code snippets?
> Gosh, it gets a bit embarassing when I have to reply
> to my own posts ;-)
>
> --
> Bill Clementson
>
> __________________________________
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing.
> http://photos.yahoo.com/
>

-- 
"The thing I remember most about America is that it's silly.
 That can be quite a relief at times."  -- Thom Yorke, Radiohead

- Guillaume




Posted on the users mailing list.