all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Shutko <ats@acm.org>
Subject: Re: yank-and-indent
Date: Wed, 20 Nov 2002 21:07:59 GMT	[thread overview]
Message-ID: <87n0o4ez7i.fsf@wesley.springies.com> (raw)
In-Reply-To: O4SdnWlgF5V3ckagXTWcpA@giganews.com

"Timur Aydin" <asdfweasdf@diowekfsdf.dersdre> writes:

> In programming, very often a number of lines are killed, yanked to another
> location and are reindented according to the new location. 

Try this.  No idea where i got it.  Actually, looks like I got it
from http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=u66crixve.fsf%40sdm.de&rnum=1

;; automatically indenting yanked text if in programming-modes
(defadvice yank (after indent-region activate)
  (if (member major-mode '(emacs-lisp-mode
			   c-mode c++-mode
			   tcl-mode sql-mode
			   perl-mode cperl-mode
			   java-mode jde-mode
			   LaTeX-mode TeX-mode))
      (let ((transient-mark-mode nil))
	(indent-region (region-beginning) (region-end) nil))))

-- 
Alan Shutko <ats@acm.org> - In a variety of flavors!
Parrot in a raincoat: polyunsaturated.

  parent reply	other threads:[~2002-11-20 21:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-20 20:28 yank-and-indent Timur Aydin
2002-11-20 21:01 ` yank-and-indent Michael Slass
2002-11-20 21:43   ` yank-and-indent Arnaldo Mandel
2002-11-20 21:07 ` Alan Shutko [this message]
2002-11-20 21:29   ` yank-and-indent Michael Slass
2002-11-20 21:39   ` yank-and-indent Timur Aydin

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=87n0o4ez7i.fsf@wesley.springies.com \
    --to=ats@acm.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.