unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Dieter Wilhelm <dieter@duenenhof-wilhelm.de>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Properly indenting a defun (sexp tips)
Date: Mon, 16 Oct 2006 02:39:38 +0200	[thread overview]
Message-ID: <87u0253xh1.fsf@hans.local.net> (raw)
In-Reply-To: <slrnej5cdc.ptd.tim@linus.johnson.com> (Tim Johnson's message of "Sun\, 15 Oct 2006 22\:40\:53 -0000")

Tim Johnson <tim@johnsons-web.com> writes:

> I have a piece of code that looks like this:
> ;; code:
> (defun mu-modifier-char ()
>   "Create colorized modifier symbol"
>   (interactive)
>   (let (my-char)
> 	(save-excursion
> 	  (backward-char 1)
> 	  (setq my-char (char-at))
> 	  (cond ((member my-char mu-modifiers)
> 			 (upcase my-char)
> 			 )
> 			)
> 	)))


> ;; And I want it to look like this
> (defun mu-modifier-char ()
>   "Create colorized modifier symbol"
>   (interactive)
>   (let (my-char)
> 	(save-excursion
> 	  (backward-char 1)
> 	  (setq my-char (char-at))
> 	  (cond ((member my-char mu-modifiers)
> 			 (upcase my-char))))))
> ;; that is, properly indented per emacs-lisp-mode
>
> Is there a single command to do this?

Not exactly a single one but place your cursor in the last line of the
defun and type 3 times M-^.

-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany

  parent reply	other threads:[~2006-10-16  0:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-15 22:40 Properly indenting a defun (sexp tips) Tim Johnson
2006-10-16  0:16 ` Drew Adams
2006-10-16  0:39 ` Dieter Wilhelm [this message]
2006-10-16  1:12   ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87u0253xh1.fsf@hans.local.net \
    --to=dieter@duenenhof-wilhelm.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).