all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nikolaj Schumacher <me@nschum.de>
To: "Luke Hoersten" <luke@hoersten.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Tabs for Indent and Spaces for Align
Date: Wed, 22 Oct 2008 22:13:57 +0200	[thread overview]
Message-ID: <m2tzb4fkvu.fsf@nschum.de> (raw)
In-Reply-To: <812fec5a0810221127n6b85345fl86ec1cbd08503b15@mail.gmail.com> (Luke Hoersten's message of "Wed\, 22 Oct 2008 13\:27\:17 -0500")

"Luke Hoersten" <luke@hoersten.org> wrote:

> ;; use only spaces for alignment
> (defun align-with-spaces (beg end)
>   "Align selected using only spaces for whitespace."
>   (interactive "r")
>   (let (tabs-mode (indent-tabs-mode))
> 	 (setq indent-tabs-mode nil)
> 	 (align beg end)
> 	 (setq indent-tabs-mode tabs-mode)))
>
> I'd love if an elisp expert could do something better though =)

You can shorten that to:

(defun align-with-spaces (beg end)
  "Align selected using only spaces for whitespace."
  (interactive "r")
  (let ((indent-tabs-mode nil))
    (align beg end)))


regards,
Nikolaj Schumacher




      reply	other threads:[~2008-10-22 20:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-21 20:15 Tabs for Indent and Spaces for Align Luke Hoersten
2008-10-22 13:40 ` Nikolaj Schumacher
2008-10-22 14:49   ` Luke Hoersten
2008-10-22 18:27     ` Luke Hoersten
2008-10-22 20:13       ` Nikolaj Schumacher [this message]

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

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

  git send-email \
    --in-reply-to=m2tzb4fkvu.fsf@nschum.de \
    --to=me@nschum.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=luke@hoersten.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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.