Loading ...
Sorry, an error occurred while loading the content.

1179RE: [jasspa] indenting and outdenting blocks of text

Expand Messages
  • Tony Bedford
    Sep 29, 2004
    • 0 Attachment
      Thanks a lot Thomas.

      The indent region works fine, I'll try to figure out an outdent region
      macro. Surprised no one has come up against this before.

      For indenting a line I can simply use tab and shift tab - that seems to work
      OK.

      Cheers,
      Tony


      >From: Thomas Hundt <thundt@...>
      >Reply-To: jasspa@yahoogroups.com
      >To: jasspa@yahoogroups.com
      >Subject: [jasspa] indenting and outdenting blocks of text
      >Date: Tue, 28 Sep 2004 10:46:01 -0700
      >
      > >>[Tony]
      > >> 3) Last, but not least, how do I indent or outdent blocks of text,
      > >> I really miss this feature?!
      >
      > > [Steve]
      > > I would currently write a quick key board macro, but if used a lot I
      > > would suggest the creation of a proper 'indent-region' macro to do
      > > this. I have created a quick 'writing macros' doc which is still
      > > under construction but I post now in the hope that it helps, see next
      > > email.
      >
      >Here are a couple of really simple macros that help quite a bit. If
      >you're on a line, and type ^X^I, it will shove the line over (indent) by
      >four spaces. Use the one below, shove-back (^X^U), to shove it left by
      >the same amount. If you're on the first line of a paragraph, and indent
      >it four spaces, and then use ifill-paragraph, it will indent the whole
      >paragraph for you. I think I asked about this before, and then Jon
      >posted the shove-over-region one, which of course is much better than
      >mine. These live in my main "company" setup file.
      >
      >;------------------------------------------------------------
      >; shove-over
      >;------------------------------------------------------------
      >define-macro shove-over
      > !while &gre &pdec @# 1 0 ; C-u prefix support
      > beginning-of-line
      > insert-string " "
      > forward-line
      > beginning-of-line
      > !done
      >!emacro
      >global-bind-key shove-over "C-x C-i"
      >global-bind-key shove-over "C-x tab" ; for non-gui unix
      >
      >;------------------------------------------------------------
      >; shove-back
      >;------------------------------------------------------------
      >define-macro shove-back
      > !while &gre &pdec @# 1 0 ; C-u prefix support
      > beginning-of-line
      > !if &ise @wc " "
      > forward-delete-char
      > !if &ise @wc " "
      > forward-delete-char
      > !if &ise @wc " "
      > forward-delete-char
      > !if &ise @wc " "
      > forward-delete-char
      > !endif
      > !endif
      > !endif
      > !endif
      > forward-line
      > beginning-of-line
      > !done
      >!emacro
      >global-bind-key shove-back "C-x C-u"
      >
      >;------------------------------------------------------------
      >; shove-over-region: (posted 2/23/02 by Jon Green)
      >;------------------------------------------------------------
      >define-macro shove-over-region
      > set-variable #l0 $window-line
      > set-alpha-mark "<"
      > exchange-point-and-mark
      > !if &gre $window-line #l0
      > set-variable #l0 $window-line
      > set-alpha-mark "<"
      > exchange-point-and-mark
      > !endif
      > beginning-of-line
      > set-variable #l1 @wl
      > !while &less $window-line #l0
      > beginning-of-line
      > $tabsize insert-string " "
      > !force forward-line
      > ; Check for end of buffer.
      > !if ¬ $status
      > goto-alpha-mark "<"
      > !return
      > !endif
      > !done
      > goto-alpha-mark "<"
      >!emacro
      >
      >
      >--
      >Thomas Hundt

      _________________________________________________________________
      Use MSN Messenger to send music and pics to your friends
      http://www.msn.co.uk/messenger
    • Show all 19 messages in this topic