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

indenting and outdenting blocks of text

Expand Messages
  • Thomas Hundt
    ... 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.
    Message 1 of 19 , Sep 28, 2004
    • 0 Attachment
      >>[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
    • Tony Bedford
      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
      Message 2 of 19 , 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
      • Tony Bedford
        ... Yes, this works fine now thanks. Very nifty. ... OK! I have a toolbar - just need to figure out how to configure it now! ... I now have (Jon s) indent
        Message 3 of 19 , Sep 29, 2004
        • 0 Attachment
          >But the better way is to use Help -> User Setup -> Mouse, change the Button
          >to Wheel Up and >Down.

          Yes, this works fine now thanks. Very nifty.

          >Help -> User Setup -> Platform -> Enable Toolbar

          OK! I have a toolbar - just need to figure out how to configure it now!

          >a proper 'indent-region' macro to do this.

          I now have (Jon's) indent region macro working - just need an outdent macro
          now...I'll use your doc to see if I can figure out how to write my own :>

          Thanks,
          Tony


          >From: "Phillips, Steven" <sphillips@...>
          >Reply-To: jasspa@yahoogroups.com
          >To: <jasspa@yahoogroups.com>
          >Subject: RE: [jasspa] 3 questions
          >Date: Tue, 28 Sep 2004 11:34:15 -0400
          >
          >
          >
          > > -----Original Message-----
          > > From: Tony Bedford [mailto:tbedford_csl@...]
          > > Sent: Tuesday, September 28, 2004 2:48 PM
          > > To: jasspa@yahoogroups.com
          > > Subject: [jasspa] 3 questions
          > >
          > >
          > > 3 questions guys:
          > >
          > > 1) How can I bind the mouse wheel to scroll? I had the
          > > following, which
          > > didn't work:
          > >
          > > global-bind-key "1 scroll-down" "mouse-wdown"
          > > global-bind-key "1 scroll-up" "mouse-wup"
          >
          >This should be:
          >
          >1 global-bind-key "scroll-down" "mouse-wdown"
          >
          >But the better way is to use Help -> User Setup -> Mouse, change the Button
          >to Wheel Up and Down.
          >
          > > 2) This page:
          > >
          > > http://www.microemacs.de/microemacs_tour.html
          > >
          > > shows a nifty toolbar - it looks like it is a kind of
          > > workspace that list
          > > files that are part of a project - how do I get this up please?
          >
          >Help -> User Setup -> Platform -> Enable Toolbar
          >
          > > 3) Last, but not least, how do I indent or outdent blocks of
          > > text, I really
          > > miss this feature?!
          >
          >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.
          >
          >Steve
          >
          > >
          > > Thanks,
          > > Tony
          > > =================
          > >
          > > _________________________________________________________________
          > > Want to block unwanted pop-ups? Download the free MSN Toolbar now!
          > > http://toolbar.msn.co.uk/
          > >
          > >
          > >
          > > ------------------------ Yahoo! Groups Sponsor
          > > --------------------~-->
          > > Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
          > > Now with Pop-Up Blocker. Get it for free!
          > > http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/89EolB/TM
          > > --------------------------------------------------------------
          > > ------~->
          > >
          > > ______________________________________________________________
          > > ____________
          > >
          > > This is an unmoderated list. JASSPA is not responsible for
          > > the content of
          > > any material posted to this list.
          > >
          > > To unsubscribe, send a mail message to
          > >
          > > mailto:jasspa-unsubscribe@yahoogroups.com
          > >
          > > or visit http://groups.yahoo.com/group/jasspa and
          > > modify your account settings manually.
          > >
          > >
          > >
          > > Yahoo! Groups Links
          > >
          > >
          > >
          > >
          > >
          > >

          _________________________________________________________________
          It's fast, it's easy and it's free. Get MSN Messenger today!
          http://www.msn.co.uk/messenger
        • Thomas Hundt
          Ah, shift-tab, yet another new thing I haven t seen. (I keep discovering new features. Yesterday I found the Insert Date menu, long after writing my own
          Message 4 of 19 , Sep 29, 2004
          • 0 Attachment
            Ah, shift-tab, yet another new thing I haven't seen. (I keep
            discovering new features. Yesterday I found the Insert>Date menu, long
            after writing my own insert-date. Jasspa just keeps getting better!)
            Tab and shift-tab won't work for multiple lines with ^U, though. Maybe
            I'll rewrite mine to just be a wrapper around 'tab' :-)

            -Th


            Tony Bedford wrote:

            > 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
            >
            --
            Thomas Hundt
          • Tony Bedford
            ... Yes!! Re: Insert date...very nice feature...but how to map the insert date menu option to a key combo? I could only find ascii-time - I didn;t see any
            Message 5 of 19 , Sep 29, 2004
            • 0 Attachment
              >>Jasspa just keeps getting better!)

              Yes!!

              Re: Insert date...very nice feature...but how to map the insert date menu
              option to a key combo? I could only find ascii-time - I didn;t see any
              insert date commands in the manual.

              Cheers,
              Tony



              >From: Thomas Hundt <thundt@...>
              >Reply-To: jasspa@yahoogroups.com
              >To: jasspa@yahoogroups.com
              >Subject: Re: [jasspa] indenting and outdenting blocks of text
              >Date: Wed, 29 Sep 2004 08:46:55 -0700
              >
              >Ah, shift-tab, yet another new thing I haven't seen. (I keep
              >discovering new features. Yesterday I found the Insert>Date menu, long
              >after writing my own insert-date. Jasspa just keeps getting better!)
              >Tab and shift-tab won't work for multiple lines with ^U, though. Maybe
              >I'll rewrite mine to just be a wrapper around 'tab' :-)
              >
              >-Th
              >
              >
              >Tony Bedford wrote:
              >
              > > 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
              > >
              >--
              >Thomas Hundt

              _________________________________________________________________
              Use MSN Messenger to send music and pics to your friends
              http://www.msn.co.uk/messenger
            • Phillips, Steven
              There are 2 approaches to this depending on what you are after: If you want the key binding to insert a specific date form straight away then start a keyboard
              Message 6 of 19 , Sep 29, 2004
              • 0 Attachment
                There are 2 approaches to this depending on what you are after:

                If you want the key binding to insert a specific date form straight away then start a keyboard macro, use hot keys to insert the correct date (do not use the mouse) end the keyboard macro and then use commands name-kbd-macro and insert-macro to get macro into your user setup file. This should give you a macro like the following:

                define-macro fred
                execute-string "\s\CDidE\CX)"
                !emacro

                (This inserted date form 'E') If you want the key to open the menu so you can choose the format then either use the first approach and edit the macro so it does not select the date, i.e. something like:

                define-macro fred
                execute-string "\s\CDid"
                !emacro

                Note that execute-strings using "\s..." (stands for special char) can stop working with the next release as the special key mappings can change, so alternatively copy the following into your user setup emf file:

                0 define-macro-file insdate osd-insert-date
                define-macro insert-date
                31 osd-insert-date
                31 osd
                !emacro

                You then just need to create a suitable global-bind-key line.

                Steve

                > -----Original Message-----
                > From: Tony Bedford [mailto:tbedford_csl@...]
                > Sent: Wednesday, September 29, 2004 5:26 PM
                > To: jasspa@yahoogroups.com
                > Subject: Re: [jasspa] indenting and outdenting blocks of text
                >
                >
                >
                > >>Jasspa just keeps getting better!)
                >
                > Yes!!
                >
                > Re: Insert date...very nice feature...but how to map the
                > insert date menu
                > option to a key combo? I could only find ascii-time - I
                > didn;t see any
                > insert date commands in the manual.
                >
                > Cheers,
                > Tony
                >
                >
                >
                > >From: Thomas Hundt <thundt@...>
                > >Reply-To: jasspa@yahoogroups.com
                > >To: jasspa@yahoogroups.com
                > >Subject: Re: [jasspa] indenting and outdenting blocks of text
                > >Date: Wed, 29 Sep 2004 08:46:55 -0700
                > >
                > >Ah, shift-tab, yet another new thing I haven't seen. (I keep
                > >discovering new features. Yesterday I found the Insert>Date
                > menu, long
                > >after writing my own insert-date. Jasspa just keeps getting better!)
                > >Tab and shift-tab won't work for multiple lines with ^U,
                > though. Maybe
                > >I'll rewrite mine to just be a wrapper around 'tab' :-)
                > >
                > >-Th
                > >
                > >
                > >Tony Bedford wrote:
                > >
                > > > 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
                > > >
                > >--
                > >Thomas Hundt
                >
                > _________________________________________________________________
                > Use MSN Messenger to send music and pics to your friends
                > http://www.msn.co.uk/messenger
                >
                >
                >
                > ------------------------ Yahoo! Groups Sponsor
                > --------------------~-->
                > $9.95 domain names from Yahoo!. Register anything.
                > http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/89EolB/TM
                > --------------------------------------------------------------
                > ------~->
                >
                > ______________________________________________________________
                > ____________
                >
                > This is an unmoderated list. JASSPA is not responsible for
                > the content of
                > any material posted to this list.
                >
                > To unsubscribe, send a mail message to
                >
                > mailto:jasspa-unsubscribe@yahoogroups.com
                >
                > or visit http://groups.yahoo.com/group/jasspa and
                > modify your account settings manually.
                >
                >
                >
                > Yahoo! Groups Links
                >
                >
                >
                >
                >
                >
                >
                >
              • Jon Green
                ... If you have the latest 0407 patches then there is a directory /.../jasspa/contrib (or c:/Program Files/JASSPA/MicroEmacs/contrib/ in MS-Windows) in this
                Message 7 of 19 , Sep 29, 2004
                • 0 Attachment
                  Tony Bedford wrote:

                  >>>Jasspa just keeps getting better!)
                  >
                  >
                  > Yes!!
                  >
                  > Re: Insert date...very nice feature...but how to map the insert date menu
                  > option to a key combo? I could only find ascii-time - I didn;t see any
                  > insert date commands in the manual.
                  >
                  > Cheers,
                  > Tony
                  >
                  >
                  >

                  If you have the latest 0407 patches then there is a directory
                  /.../jasspa/contrib (or c:/Program Files/JASSPA/MicroEmacs/contrib/
                  in MS-Windows) in this directory there are useful extensions
                  to the base macro set that are not installed by default.
                  These files can be edited (or copied for the myxxx.emf files)
                  into the user directory. The user.emf file contains
                  extensions that you can insert into your "user.emf" file
                  (i.e. tony.emf). Inside this file you will find a
                  macro "insert-date" and you can bind this to a key.

                  If you cannot find it then the macro is simple
                  as below:-

                  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                  ; insert-date; Insert the current date into the text.
                  define-macro insert-date
                  ascii-time
                  ; ascii-time returns a formatted string in #l9
                  insert-string #l9
                  !emacro

                  Then simply do the binding:-

                  global-bind-key insert-date "<My fav. key>"

                  I must admit I do not normally bind it, but use
                  "M-x insert-date" when I want the date and
                  "M-x insert-file-name" when I want the
                  filename.

                  Jon.
                • Thomas Hundt
                  Well, you know you can do Alt-i-d... (Alt-i should open the Insert menu; if it doesn t, look for Alt key settings in Help User Setup General.) I think the menu
                  Message 8 of 19 , Sep 29, 2004
                  • 0 Attachment
                    Well, you know you can do Alt-i-d... (Alt-i should open the Insert menu;
                    if it doesn't, look for Alt key settings in Help>User Setup>General.)

                    I think the menu items are macros named osd-something-something... you
                    probably have to read through some of that osd code (OSD = on screen
                    display, aka menu).

                    In addition to looking in the manual, you might want to try
                    command-apropos (^H-a) and list-commands. (The latter reveals a macro
                    named osd-insert-date. Aha!)

                    Here is my old insert-date; you can hack it for whatever format you want:

                    ;------------------------------------------------------------
                    ; insert-date: as 01-Oct-99
                    ;------------------------------------------------------------
                    define-macro insert-date
                    insert-string &add 0 &mid $time 9 1 ; make space into '0'
                    insert-string &mid $time 10 1
                    insert-string "-"
                    insert-string &mid "JanFebMarAprMayJunJulAugSepOctNovDec" &add 0
                    &mul 3 &sub &mid $time 7 2 1 3 ; MMM
                    insert-string "-"
                    insert-string &mid $time 2 2 ; YY
                    !emacro ; insert-date
                    global-bind-key insert-date "esc @"




                    Tony Bedford wrote:
                    >>>Jasspa just keeps getting better!)
                    >
                    >
                    > Yes!!
                    >
                    > Re: Insert date...very nice feature...but how to map the insert date menu
                    > option to a key combo? I could only find ascii-time - I didn;t see any
                    > insert date commands in the manual.
                    >
                    > Cheers,
                    > Tony
                    >
                    >

                    --
                    Thomas Hundt
                  • Steven Phillips
                    ... If you do you should probably look at the normal-tab macro defined in format.emf Steve
                    Message 9 of 19 , Sep 29, 2004
                    • 0 Attachment
                      > Subject: [jasspa] indenting and outdenting blocks of text
                      > From: Thomas Hundt <thundt@...>
                      > Date: Wednesday, September 29, 2004, 4:46:55 PM
                      > To: jasspa@yahoogroups.com
                      > Ah, shift-tab, yet another new thing I haven't seen. (I keep
                      > discovering new features. Yesterday I found the Insert>Date menu, long
                      > after writing my own insert-date. Jasspa just keeps getting better!)
                      > Tab and shift-tab won't work for multiple lines with ^U, though. Maybe
                      > I'll rewrite mine to just be a wrapper around 'tab' :-)

                      If you do you should probably look at the normal-tab macro defined in
                      format.emf

                      Steve

                      > -Th


                      > Tony Bedford wrote:

                      >> 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
                      >>
                    • Jon Green
                      ... ... Attached is my latest offering for the shove-over and shove-back macros to perform the indent and outdent. These are a little more
                      Message 10 of 19 , Sep 29, 2004
                      • 0 Attachment
                        Tony Bedford wrote:
                        > 3 questions guys:
                        >

                        <SNIP>

                        >
                        > 3) Last, but not least, how do I indent or outdent blocks of text, I really
                        > miss this feature?!
                        >

                        Attached is my latest offering for the 'shove-over' and
                        'shove-back' macros to perform the indent and outdent.
                        These are a little more sophisticated than the original
                        circa 2002 macros as they handle both numeric arguments
                        and selected regions with the same command. Hopefully
                        I have not messed up, it is the first time that I've
                        really tried to combine both hilighted regions and
                        argument commands in a single macro. The region
                        selection is a little hairy, but otherwise
                        the macro is reasonably straight forward.

                        They are bundled up with the other utilty
                        contribution macros so will get shipped
                        in future as an example.

                        Regards
                        Jon.
                      • Tony Bedford
                        Very useful tips guys: Insert date using alt-i-d works fine, as does the insert-date macro. I m just using Esc-x insert-date and it seems fine. Thanks all,
                        Message 11 of 19 , Sep 30, 2004
                        • 0 Attachment
                          Very useful tips guys:

                          Insert date using alt-i-d works fine, as does the insert-date macro. I'm
                          just using Esc-x insert-date and it seems fine.

                          Thanks all,
                          Tony

                          _________________________________________________________________
                          Stay in touch with absent friends - get MSN Messenger
                          http://www.msn.co.uk/messenger
                        • Tony Bedford
                          These are cool. But, (I know I m being a pain now) the only slight problem is, if you want to outdent by several tabs you have to reselect the region again. I
                          Message 12 of 19 , Sep 30, 2004
                          • 0 Attachment
                            These are cool.

                            But, (I know I'm being a pain now) the only slight problem is, if you want
                            to outdent by
                            several tabs you have to reselect the region again.

                            I think I will need to come up with some sort of macro that will
                            outdent/indent by the specified number of stops. And basically use a
                            keyboard macro to apply it on a line by line basis.

                            Cheers all,
                            Tony

                            >From: Jon Green <jon@...>
                            >Reply-To: jasspa@yahoogroups.com
                            >To: jasspa@yahoogroups.com
                            >Subject: Re: [jasspa] 3 questions - Indent/Outdent region.
                            >Date: Thu, 30 Sep 2004 00:18:04 +0100
                            >
                            >Tony Bedford wrote:
                            > > 3 questions guys:
                            > >
                            >
                            > <SNIP>
                            >
                            > >
                            > > 3) Last, but not least, how do I indent or outdent blocks of text, I
                            >really
                            > > miss this feature?!
                            > >
                            >
                            >Attached is my latest offering for the 'shove-over' and
                            >'shove-back' macros to perform the indent and outdent.
                            >These are a little more sophisticated than the original
                            >circa 2002 macros as they handle both numeric arguments
                            >and selected regions with the same command. Hopefully
                            >I have not messed up, it is the first time that I've
                            >really tried to combine both hilighted regions and
                            >argument commands in a single macro. The region
                            >selection is a little hairy, but otherwise
                            >the macro is reasonably straight forward.
                            >
                            >They are bundled up with the other utilty
                            >contribution macros so will get shipped
                            >in future as an example.
                            >
                            >Regards
                            >Jon.
                            >; -!- emf -!-
                            >; This is part of the JASSPA MicroEmacs macro files
                            >; Copyright (C) 1999-2004 JASSPA (www.jasspa.com)
                            >; See the file me.emf for copying and conditions.
                            >;
                            >; Created: Thu Mar 25 21:49:50 2004
                            >; Synopsis: Useful extensions to user.emf file
                            >; Add to your file ~/.jasspa/$LOGNAME.emf
                            >; Authors: Jon Green
                            >;
                            >
                            >;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            >;; ; Set up CVS to be compressed.
                            >;; set-variable %cvs-com "cvs -z9 "
                            >
                            >;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            >; spotless; Perform a clean and remove any multi-blank lines.
                            >define-macro spotless
                            > -1 clean
                            >!emacro
                            >
                            >;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            >; comment-adjust; Used for comments in electric-c mode (and the other
                            >; electic modes. Moves to the comment fill position, saves having to mess
                            >; around with comments at the end of the line.
                            >0 define-macro comment-adjust
                            > ; delete all spaces up until the next character
                            > !while &sin @wc " \t"
                            > forward-delete-char
                            > !done
                            > ; Fill the line to the current $c-margin. We use this as
                            > ; this is the only variable that tells us where the margin
                            > ; should be.
                            > !if &gre $window-acol 0
                            > backward-char
                            > !if &sin @wc " \t"
                            > forward-delete-char
                            > !jump -4
                            > !else
                            > forward-char
                            > !endif
                            > !endif
                            > ; Now fill to the $c-margin
                            > &sub $c-margin $window-acol insert-string " "
                            >!emacro
                            >global-bind-key comment-adjust "esc tab"
                            >global-bind-key comment-adjust "C-insert"
                            >; Comment margin to adjust to.
                            >set-variable $c-margin 40
                            >
                            >;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            >; insert-date; Insert the current date into the text.
                            >define-macro insert-date
                            > ascii-time
                            > ; ascii-time returns a formatted string in #l9
                            > insert-string #l9
                            >!emacro
                            >
                            >;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            >; Macro to delete the whitespace, or if on a word all of the word until the
                            >; next word is reached.
                            >0 define-macro super-delete
                            > set-variable #l0 0
                            > !while ¬ &sin @wc " \t\n"
                            > forward-char
                            > set-variable #l0 &add #l0 1
                            > !done
                            > !repeat
                            > !force forward-char
                            > !if $status
                            > set-variable #l0 &add #l0 1
                            > !endif
                            > !until &or &seq @wc "" ¬ &sin @wc " \t\n"
                            > #l0 backward-delete-char
                            > !return
                            >!emacro
                            >global-bind-key super-delete "C-delete"
                            >
                            >;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            >; Macro to backspace the whitespace, or if on a word all of the word until
                            >the
                            >; previous word is reached.
                            >0 define-macro super-backspace
                            > set-variable #l0 -1
                            > set-variable #l1 0
                            > !repeat
                            > !force backward-char
                            > !if $status
                            > set-variable #l0 &add #l0 1
                            > !if &sin @wc " \t\n"
                            > set-variable #l1 1
                            > !endif
                            > !else
                            > set-variable #l1 1
                            > !endif
                            > !until #l1
                            > !repeat
                            > !force backward-char
                            > !if $status
                            > set-variable #l0 &add #l0 1
                            > !else
                            > &add #l0 1 forward-delete-char
                            > !return
                            > !endif
                            > !until ¬ &sin @wc " \t\n"
                            > forward-char
                            > #l0 forward-delete-char
                            > !return
                            >!emacro
                            >global-bind-key super-backspace "C-backspace"
                            >
                            >;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            >; Command to move to the previous buffer.
                            >define-macro previous-buffer
                            > &neg @# next-buffer
                            >!emacro
                            >
                            >;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            >; Macro to increase 'n' lines by a tab stop. If a region is hilighted then
                            >; the whole region is shoved back by a tab stop. If there is no region, or
                            >a
                            >; numeric argument is specified then 'n' lines are indented by a tab stop.
                            >define-macro shove-back
                            > ; Test the region first before we destroy the region by executing
                            > ; some macro commands
                            > 0 show-region
                            > !if &equ &band $result 5 5
                            > !if ¬ &band $result 2
                            > 3 show-region
                            > !endif
                            > ; Save the position for later.
                            > set-position "\x82"
                            > ; Determine if there is a hilight region in effect.
                            > -2 show-region
                            > set-variable #l0 $window-line
                            > set-variable #l2 $window-col
                            > 2 show-region
                            > set-variable #l1 $window-line
                            > set-variable #l3 $window-col
                            > !if &les #l0 #l1
                            > ; If we are in the firat column then back up a line as the
                            > ; user will have selected the previous lines not this one.
                            > !if &equ #l3 0
                            > set-variable #l1 &sub #l1 1
                            > !endif
                            > !else
                            > !if &equ #l2 0
                            > set-variable #l0 &sub #l0 1
                            > !endif
                            > ; Swap #l0<=>#l1, #l2<=>#l3
                            > set-variable #l4 #l0
                            > set-variable #l0 #l1
                            > set-variable #l1 #l4
                            > !endif
                            > !force -3 show-region
                            > !force 3 show-region
                            > !force -1 show-region
                            > !else
                            > ; No region assume a single line.
                            > set-position "\x82"
                            > set-variable #l0 $window-line
                            > set-variable #l1 #l0
                            > !endif
                            > ; If there is a numeric argument then we loose the region and use the
                            > ; numeric argument as the number of lines to process.
                            > !if @?
                            > goto-position "\x82"
                            > set-variable #l0 $window-line
                            > !if &les @# 0
                            > ; -ve argument then abort.
                            > !abort
                            > !elif &gre @# 1
                            > set-variable #l1 &add #l0 &sub @# 1
                            > !endif
                            > !endif
                            > ; Processing lines #l0 to #l1 inclusive, move back by a tab stop on
                            >all
                            > ; given lines.
                            > !if ¬ &equ #l0 $window-line
                            > goto-line #l0
                            > !endif
                            > !repeat
                            > beginning-of-line
                            > set-variable #l5 $tabsize
                            > !while &gre &pdec #l5 1 0
                            > !if &ise @wc " "
                            > forward-delete-char
                            > !else
                            > ; Any tab is consumed and we stop, any other character and
                            >we
                            > ; stop.
                            > !if &ise @wc "\t"
                            > forward-delete-char
                            > !endif
                            > set-variable #l5 0
                            > !endif
                            > !done
                            > !force forward-line
                            > ; Check for end of buffer.
                            > !if ¬ $status
                            > goto-position "\x82"
                            > !return
                            > !endif
                            > !until &gre $window-line #l1
                            >!emacro
                            >global-bind-key shove-back "C-x left"
                            >
                            >;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            >; Macro to decrease 'n' lines by a tab stop. If a region is hilighted then
                            >; the whole region is indented back by a tab stop. If there is no region,
                            >or
                            >; a numeric argument is specified then 'n' lines are indented by a tab
                            >stop.
                            >define-macro shove-over
                            > ; Test the region first before we destroy the region by executing
                            > ; some macro commands
                            > 0 show-region
                            > !if &equ &band $result 5 5
                            > !if ¬ &band $result 2
                            > 3 show-region
                            > !endif
                            > ; Save the position for later.
                            > set-position "\x82"
                            > ; Determine if there is a hilight region in effect.
                            > -2 show-region
                            > set-variable #l0 $window-line
                            > set-variable #l2 $window-col
                            > 2 show-region
                            > set-variable #l1 $window-line
                            > set-variable #l3 $window-col
                            > !if &les #l0 #l1
                            > ; If we are in the firat column then back up a line as the
                            > ; user will have selected the previous lines not this one.
                            > !if &equ #l3 0
                            > set-variable #l1 &sub #l1 1
                            > !endif
                            > !elif &gre #l0 #l1
                            > !if &equ #l2 0
                            > set-variable #l0 &sub #l0 1
                            > !endif
                            > ; Swap #l0<=>#l1, #l2<=>#l3
                            > set-variable #l4 #l0
                            > set-variable #l0 #l1
                            > set-variable #l1 #l4
                            > !endif
                            > !force -3 show-region
                            > !force 3 show-region
                            > !force -1 show-region
                            > !else
                            > ; No region assume a single line.
                            > set-position "\x82"
                            > set-variable #l0 $window-line
                            > set-variable #l1 #l0
                            > !endif
                            > ; If there is a numeric argument then we loose the region and use the
                            > ; numeric argument as the number of lines to process.
                            > !if @?
                            > goto-position "\x82"
                            > set-variable #l0 $window-line
                            > !if &les @# 0
                            > ; -ve argument then abort.
                            > !abort
                            > !elif &gre @# 1
                            > set-variable #l1 &add #l0 &sub @# 1
                            > !endif
                            > !endif
                            > ; processing lines #l0 to #l1 inclusive, move back by a tab stop on
                            >all
                            > ; given lines.
                            > !if ¬ &equ #l0 $window-line
                            > goto-line #l0
                            > !endif
                            > !repeat
                            > ; Go forward first to make sure we are not at end of buffer.
                            > !force forward-line
                            > ; Check for end of buffer.
                            > !if ¬ $status
                            > goto-position "\x82"
                            > !return
                            > !endif
                            > backward-line
                            > beginning-of-line
                            > $tabsize insert-string " "
                            > beginning-of-line
                            > forward-line
                            > !until &gre $window-line #l1
                            >!emacro
                            >global-bind-key shove-over "C-x right"
                            >
                            >;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            >;; ; If you loose the C-k kill-line key then you are miss-typing and
                            >unbinding.
                            >;; ; Remove the global-unbind-key binding so this cannot happen.
                            >;; !force global-unbind-key "esc C-k"
                            >
                            >;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            >;; ; If you can never remember the undo key then bind to a function key.
                            >;; global-bind-key undo "f12"

                            _________________________________________________________________
                            Use MSN Messenger to send music and pics to your friends
                            http://www.msn.co.uk/messenger
                          • Thomas Hundt
                            I would write it as: if no ^U (C-u) value given, indent the current tab width (i.e., one tab stop); if ^U value given, indent it that much. The ^U value is in
                            Message 13 of 19 , Sep 30, 2004
                            • 0 Attachment
                              I would write it as: if no ^U (C-u) value given, indent the current tab
                              width (i.e., one tab stop); if ^U value given, indent it that much.

                              The ^U value is in variable @#. You will see it used in loops, like
                              this, to perform a function over @# number of lines:

                              define-macro quote-line
                              !while &gre &pdec @# 1 0 ; C-u prefix support
                              beginning-of-line
                              insert-string "|"
                              forward-line
                              !done
                              !emacro ; quote-line
                              global-bind-key quote-line "C-x q"

                              Good luck

                              -Th



                              Tony Bedford wrote:

                              > These are cool.
                              >
                              > But, (I know I'm being a pain now) the only slight problem is, if you want
                              > to outdent by
                              > several tabs you have to reselect the region again.
                              >
                              > I think I will need to come up with some sort of macro that will
                              > outdent/indent by the specified number of stops. And basically use a
                              > keyboard macro to apply it on a line by line basis.
                              >
                              > Cheers all,
                              > Tony
                              >
                              >
                              >>From: Jon Green <jon@...>
                              >>Reply-To: jasspa@yahoogroups.com
                              >>To: jasspa@yahoogroups.com
                              >>Subject: Re: [jasspa] 3 questions - Indent/Outdent region.
                              >>Date: Thu, 30 Sep 2004 00:18:04 +0100
                              >>
                              >>Tony Bedford wrote:
                              >>
                              >>>3 questions guys:
                              >>>
                              >>
                              >> <SNIP>
                              >>
                              >>>3) Last, but not least, how do I indent or outdent blocks of text, I
                              >>
                              >>really
                              >>
                              >>>miss this feature?!
                              >>>
                              >>
                              >>Attached is my latest offering for the 'shove-over' and
                              >>'shove-back' macros to perform the indent and outdent.
                              >>These are a little more sophisticated than the original
                              >>circa 2002 macros as they handle both numeric arguments
                              >>and selected regions with the same command. Hopefully
                              >>I have not messed up, it is the first time that I've
                              >>really tried to combine both hilighted regions and
                              >>argument commands in a single macro. The region
                              >>selection is a little hairy, but otherwise
                              >>the macro is reasonably straight forward.
                              >>
                              >>They are bundled up with the other utilty
                              >>contribution macros so will get shipped
                              >>in future as an example.
                              >>
                              >>Regards
                              >>Jon.
                              >>; -!- emf -!-
                              >>; This is part of the JASSPA MicroEmacs macro files
                              >>; Copyright (C) 1999-2004 JASSPA (www.jasspa.com)
                              >>; See the file me.emf for copying and conditions.
                              >>;
                              >>; Created: Thu Mar 25 21:49:50 2004
                              >>; Synopsis: Useful extensions to user.emf file
                              >>; Add to your file ~/.jasspa/$LOGNAME.emf
                              >>; Authors: Jon Green
                              >>;
                              >>
                              >>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                              >>;; ; Set up CVS to be compressed.
                              >>;; set-variable %cvs-com "cvs -z9 "
                              >>
                              >>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                              >>; spotless; Perform a clean and remove any multi-blank lines.
                              >>define-macro spotless
                              >> -1 clean
                              >>!emacro
                              >>
                              >>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                              >>; comment-adjust; Used for comments in electric-c mode (and the other
                              >>; electic modes. Moves to the comment fill position, saves having to mess
                              >>; around with comments at the end of the line.
                              >>0 define-macro comment-adjust
                              >> ; delete all spaces up until the next character
                              >> !while &sin @wc " \t"
                              >> forward-delete-char
                              >> !done
                              >> ; Fill the line to the current $c-margin. We use this as
                              >> ; this is the only variable that tells us where the margin
                              >> ; should be.
                              >> !if &gre $window-acol 0
                              >> backward-char
                              >> !if &sin @wc " \t"
                              >> forward-delete-char
                              >> !jump -4
                              >> !else
                              >> forward-char
                              >> !endif
                              >> !endif
                              >> ; Now fill to the $c-margin
                              >> &sub $c-margin $window-acol insert-string " "
                              >>!emacro
                              >>global-bind-key comment-adjust "esc tab"
                              >>global-bind-key comment-adjust "C-insert"
                              >>; Comment margin to adjust to.
                              >>set-variable $c-margin 40
                              >>
                              >>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                              >>; insert-date; Insert the current date into the text.
                              >>define-macro insert-date
                              >> ascii-time
                              >> ; ascii-time returns a formatted string in #l9
                              >> insert-string #l9
                              >>!emacro
                              >>
                              >>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                              >>; Macro to delete the whitespace, or if on a word all of the word until the
                              >>; next word is reached.
                              >>0 define-macro super-delete
                              >> set-variable #l0 0
                              >> !while ¬ &sin @wc " \t\n"
                              >> forward-char
                              >> set-variable #l0 &add #l0 1
                              >> !done
                              >> !repeat
                              >> !force forward-char
                              >> !if $status
                              >> set-variable #l0 &add #l0 1
                              >> !endif
                              >> !until &or &seq @wc "" ¬ &sin @wc " \t\n"
                              >> #l0 backward-delete-char
                              >> !return
                              >>!emacro
                              >>global-bind-key super-delete "C-delete"
                              >>
                              >>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                              >>; Macro to backspace the whitespace, or if on a word all of the word until
                              >>the
                              >>; previous word is reached.
                              >>0 define-macro super-backspace
                              >> set-variable #l0 -1
                              >> set-variable #l1 0
                              >> !repeat
                              >> !force backward-char
                              >> !if $status
                              >> set-variable #l0 &add #l0 1
                              >> !if &sin @wc " \t\n"
                              >> set-variable #l1 1
                              >> !endif
                              >> !else
                              >> set-variable #l1 1
                              >> !endif
                              >> !until #l1
                              >> !repeat
                              >> !force backward-char
                              >> !if $status
                              >> set-variable #l0 &add #l0 1
                              >> !else
                              >> &add #l0 1 forward-delete-char
                              >> !return
                              >> !endif
                              >> !until ¬ &sin @wc " \t\n"
                              >> forward-char
                              >> #l0 forward-delete-char
                              >> !return
                              >>!emacro
                              >>global-bind-key super-backspace "C-backspace"
                              >>
                              >>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                              >>; Command to move to the previous buffer.
                              >>define-macro previous-buffer
                              >> &neg @# next-buffer
                              >>!emacro
                              >>
                              >>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                              >>; Macro to increase 'n' lines by a tab stop. If a region is hilighted then
                              >>; the whole region is shoved back by a tab stop. If there is no region, or
                              >>a
                              >>; numeric argument is specified then 'n' lines are indented by a tab stop.
                              >>define-macro shove-back
                              >> ; Test the region first before we destroy the region by executing
                              >> ; some macro commands
                              >> 0 show-region
                              >> !if &equ &band $result 5 5
                              >> !if ¬ &band $result 2
                              >> 3 show-region
                              >> !endif
                              >> ; Save the position for later.
                              >> set-position "\x82"
                              >> ; Determine if there is a hilight region in effect.
                              >> -2 show-region
                              >> set-variable #l0 $window-line
                              >> set-variable #l2 $window-col
                              >> 2 show-region
                              >> set-variable #l1 $window-line
                              >> set-variable #l3 $window-col
                              >> !if &les #l0 #l1
                              >> ; If we are in the firat column then back up a line as the
                              >> ; user will have selected the previous lines not this one.
                              >> !if &equ #l3 0
                              >> set-variable #l1 &sub #l1 1
                              >> !endif
                              >> !else
                              >> !if &equ #l2 0
                              >> set-variable #l0 &sub #l0 1
                              >> !endif
                              >> ; Swap #l0<=>#l1, #l2<=>#l3
                              >> set-variable #l4 #l0
                              >> set-variable #l0 #l1
                              >> set-variable #l1 #l4
                              >> !endif
                              >> !force -3 show-region
                              >> !force 3 show-region
                              >> !force -1 show-region
                              >> !else
                              >> ; No region assume a single line.
                              >> set-position "\x82"
                              >> set-variable #l0 $window-line
                              >> set-variable #l1 #l0
                              >> !endif
                              >> ; If there is a numeric argument then we loose the region and use the
                              >> ; numeric argument as the number of lines to process.
                              >> !if @?
                              >> goto-position "\x82"
                              >> set-variable #l0 $window-line
                              >> !if &les @# 0
                              >> ; -ve argument then abort.
                              >> !abort
                              >> !elif &gre @# 1
                              >> set-variable #l1 &add #l0 &sub @# 1
                              >> !endif
                              >> !endif
                              >> ; Processing lines #l0 to #l1 inclusive, move back by a tab stop on
                              >>all
                              >> ; given lines.
                              >> !if ¬ &equ #l0 $window-line
                              >> goto-line #l0
                              >> !endif
                              >> !repeat
                              >> beginning-of-line
                              >> set-variable #l5 $tabsize
                              >> !while &gre &pdec #l5 1 0
                              >> !if &ise @wc " "
                              >> forward-delete-char
                              >> !else
                              >> ; Any tab is consumed and we stop, any other character and
                              >>we
                              >> ; stop.
                              >> !if &ise @wc "\t"
                              >> forward-delete-char
                              >> !endif
                              >> set-variable #l5 0
                              >> !endif
                              >> !done
                              >> !force forward-line
                              >> ; Check for end of buffer.
                              >> !if ¬ $status
                              >> goto-position "\x82"
                              >> !return
                              >> !endif
                              >> !until &gre $window-line #l1
                              >>!emacro
                              >>global-bind-key shove-back "C-x left"
                              >>
                              >>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                              >>; Macro to decrease 'n' lines by a tab stop. If a region is hilighted then
                              >>; the whole region is indented back by a tab stop. If there is no region,
                              >>or
                              >>; a numeric argument is specified then 'n' lines are indented by a tab
                              >>stop.
                              >>define-macro shove-over
                              >> ; Test the region first before we destroy the region by executing
                              >> ; some macro commands
                              >> 0 show-region
                              >> !if &equ &band $result 5 5
                              >> !if ¬ &band $result 2
                              >> 3 show-region
                              >> !endif
                              >> ; Save the position for later.
                              >> set-position "\x82"
                              >> ; Determine if there is a hilight region in effect.
                              >> -2 show-region
                              >> set-variable #l0 $window-line
                              >> set-variable #l2 $window-col
                              >> 2 show-region
                              >> set-variable #l1 $window-line
                              >> set-variable #l3 $window-col
                              >> !if &les #l0 #l1
                              >> ; If we are in the firat column then back up a line as the
                              >> ; user will have selected the previous lines not this one.
                              >> !if &equ #l3 0
                              >> set-variable #l1 &sub #l1 1
                              >> !endif
                              >> !elif &gre #l0 #l1
                              >> !if &equ #l2 0
                              >> set-variable #l0 &sub #l0 1
                              >> !endif
                              >> ; Swap #l0<=>#l1, #l2<=>#l3
                              >> set-variable #l4 #l0
                              >> set-variable #l0 #l1
                              >> set-variable #l1 #l4
                              >> !endif
                              >> !force -3 show-region
                              >> !force 3 show-region
                              >> !force -1 show-region
                              >> !else
                              >> ; No region assume a single line.
                              >> set-position "\x82"
                              >> set-variable #l0 $window-line
                              >> set-variable #l1 #l0
                              >> !endif
                              >> ; If there is a numeric argument then we loose the region and use the
                              >> ; numeric argument as the number of lines to process.
                              >> !if @?
                              >> goto-position "\x82"
                              >> set-variable #l0 $window-line
                              >> !if &les @# 0
                              >> ; -ve argument then abort.
                              >> !abort
                              >> !elif &gre @# 1
                              >> set-variable #l1 &add #l0 &sub @# 1
                              >> !endif
                              >> !endif
                              >> ; processing lines #l0 to #l1 inclusive, move back by a tab stop on
                              >>all
                              >> ; given lines.
                              >> !if ¬ &equ #l0 $window-line
                              >> goto-line #l0
                              >> !endif
                              >> !repeat
                              >> ; Go forward first to make sure we are not at end of buffer.
                              >> !force forward-line
                              >> ; Check for end of buffer.
                              >> !if ¬ $status
                              >> goto-position "\x82"
                              >> !return
                              >> !endif
                              >> backward-line
                              >> beginning-of-line
                              >> $tabsize insert-string " "
                              >> beginning-of-line
                              >> forward-line
                              >> !until &gre $window-line #l1
                              >>!emacro
                              >>global-bind-key shove-over "C-x right"
                              >>
                              >>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                              >>;; ; If you loose the C-k kill-line key then you are miss-typing and
                              >>unbinding.
                              >>;; ; Remove the global-unbind-key binding so this cannot happen.
                              >>;; !force global-unbind-key "esc C-k"
                              >>
                              >>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                              >>;; ; If you can never remember the undo key then bind to a function key.
                              >>;; global-bind-key undo "f12"
                              >
                              --
                              Thomas Hundt
                            • Jon Green
                              ... With a little bit of tweeking then we can make a version with a sticky region that remains active. It is a little wierd as nothing else operates like this
                              Message 14 of 19 , Sep 30, 2004
                              • 0 Attachment
                                Tony Bedford wrote:
                                > These are cool.
                                >
                                > But, (I know I'm being a pain now) the only slight problem is, if you want
                                > to outdent by
                                > several tabs you have to reselect the region again.
                                >
                                > I think I will need to come up with some sort of macro that will
                                > outdent/indent by the specified number of stops. And basically use a
                                > keyboard macro to apply it on a line by line basis.
                                >
                                > Cheers all,
                                > Tony

                                With a little bit of tweeking then we can make a version with
                                a sticky region that remains active. It is a little wierd
                                as nothing else operates like this but may be more
                                appropriate. So you can continue to change the indent until
                                the region is removed.

                                Jon.
                              • Tony Bedford
                                I think that would be very useful, indenting and outdenting on blocks is something I do a LOT and I m sure others do too. By the way I have just being reading
                                Message 15 of 19 , Oct 1, 2004
                                • 0 Attachment
                                  I think that would be very useful, indenting and outdenting on blocks is
                                  something I do a LOT and I'm sure others do too.

                                  By the way I have just being reading info pages in ME, very nice :)

                                  Many thanks,
                                  Tony

                                  >From: Jon Green <jon@...>
                                  >Reply-To: jasspa@yahoogroups.com
                                  >To: jasspa@yahoogroups.com
                                  >Subject: Re: [jasspa] 3 questions - Indent/Outdent region.
                                  >Date: Thu, 30 Sep 2004 22:01:09 +0100
                                  >
                                  >Tony Bedford wrote:
                                  > > These are cool.
                                  > >
                                  > > But, (I know I'm being a pain now) the only slight problem is, if you
                                  >want
                                  > > to outdent by
                                  > > several tabs you have to reselect the region again.
                                  > >
                                  > > I think I will need to come up with some sort of macro that will
                                  > > outdent/indent by the specified number of stops. And basically use a
                                  > > keyboard macro to apply it on a line by line basis.
                                  > >
                                  > > Cheers all,
                                  > > Tony
                                  >
                                  >With a little bit of tweeking then we can make a version with
                                  >a sticky region that remains active. It is a little wierd
                                  >as nothing else operates like this but may be more
                                  >appropriate. So you can continue to change the indent until
                                  >the region is removed.
                                  >
                                  >Jon.
                                  >;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                                  >; Macro to decrease 'n' lines by a tab stop. If a region is hilighted then
                                  >; the whole region is shoved back by a tab stop. The there is no region, or
                                  >a
                                  >; numeric argument is specified then 'n' lines are indented by a tab stop.
                                  >define-macro shove-back
                                  > ; Test the region first before we destroy the region by executing
                                  > ; some macro commands
                                  > 0 show-region
                                  > !if &equ &band $result 5 5
                                  > !if ¬ &band $result 2
                                  > 3 show-region
                                  > !endif
                                  > ; Save the position for later.
                                  > set-position "\x82"
                                  > ; Determine if there is a hilight region in effect.
                                  > -2 show-region
                                  > set-variable #l0 $window-line
                                  > set-variable #l2 $window-col
                                  > 2 show-region
                                  > set-variable #l1 $window-line
                                  > set-variable #l3 $window-col
                                  > !if &les #l0 #l1
                                  > ; If we are in the firat column then back up a line as the
                                  > ; user will have selected the previous lines not this one.
                                  > !if &equ #l3 0
                                  > set-variable #l1 &sub #l1 1
                                  > !endif
                                  > !else
                                  > !if &equ #l2 0
                                  > set-variable #l0 &sub #l0 1
                                  > !endif
                                  > ; Swap #l0<=>#l1, #l2<=>#l3
                                  > set-variable #l4 #l0
                                  > set-variable #l0 #l1
                                  > set-variable #l1 #l4
                                  > !endif
                                  > set-variable #l7 1
                                  > !else
                                  > ; No region assume a single line.
                                  > set-position "\x82"
                                  > set-variable #l0 $window-line
                                  > set-variable #l1 #l0
                                  > set-variable #l7 0
                                  > !endif
                                  > ; If there is a numeric argument then we loose the region and use the
                                  > ; numeric argument as the number of lines to process.
                                  > !if @?
                                  > goto-position "\x82"
                                  > set-variable #l0 $window-line
                                  > !if ¬ &gre @# 0
                                  > ; -ve argument then abort.
                                  > !return
                                  > !endif
                                  > set-variable #l1 &add #l0 &sub @# 1
                                  > !endif
                                  > ; 3000 ml-write &spr "start line = %d end line = %d" #l0 #l1 We are
                                  > ; processing lines #l0 to #l1 inclusive, move back by a tab stop on
                                  >all
                                  > ; given lines.
                                  > !if ¬ &equ #l0 $window-line
                                  > goto-line #l0
                                  > !endif
                                  > ; If region mark the starting point.
                                  > !if #l7
                                  > set-mark
                                  > !endif
                                  > !repeat
                                  > beginning-of-line
                                  > set-variable #l5 $tabsize
                                  > !while &gre &pdec #l5 1 0
                                  > !if &ise @wc " "
                                  > forward-delete-char
                                  > !else
                                  > ; Any tab is consumed and we stop, any other character and
                                  >we
                                  > ; stop.
                                  > !if &ise @wc "\t"
                                  > forward-delete-char
                                  > !endif
                                  > set-variable #l5 0
                                  > !endif
                                  > !done
                                  > !force forward-line
                                  > ; Check for end of buffer.
                                  > !if ¬ $status
                                  > ; End of buffer - re-enable the region.
                                  > !if #l7
                                  > exchange-point-and-mark
                                  > -3 show-region
                                  > exchange-point-and-mark
                                  > 3 show-region
                                  > 1 show-region
                                  > !endif
                                  > !return
                                  > !endif
                                  > !until &gre $window-line #l1
                                  > ; Reenable the region.
                                  > !if #l7
                                  > exchange-point-and-mark
                                  > -3 show-region
                                  > exchange-point-and-mark
                                  > 3 show-region
                                  > 1 show-region
                                  > !endif
                                  >!emacro
                                  >global-bind-key shove-back "C-x left"
                                  >
                                  >;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                                  >; Macro to increase 'n' lines by a tab stop. If a region is hilighted then
                                  >; the whole region is indented back by a tab stop. The there is no region,
                                  >or
                                  >; a numeric argument is specified then 'n' lines are indented by a tab
                                  >stop.
                                  >define-macro shove-over
                                  > ; Test the region first before we destroy the region by executing
                                  > ; some macro commands
                                  > 0 show-region
                                  > !if &equ &band $result 5 5
                                  > !if ¬ &band $result 2
                                  > 3 show-region
                                  > !endif
                                  > ; Save the position for later.
                                  > set-position "\x82"
                                  > ; Determine if there is a hilight region in effect.
                                  > -2 show-region
                                  > set-variable #l0 $window-line
                                  > set-variable #l2 $window-col
                                  > 2 show-region
                                  > set-variable #l1 $window-line
                                  > set-variable #l3 $window-col
                                  > !if &les #l0 #l1
                                  > ; If we are in the firat column then back up a line as the
                                  > ; user will have selected the previous lines not this one.
                                  > !if &equ #l3 0
                                  > set-variable #l1 &sub #l1 1
                                  > !endif
                                  > !elif &gre #l0 #l1
                                  > !if &equ #l2 0
                                  > set-variable #l0 &sub #l0 1
                                  > !endif
                                  > ; Swap #l0<=>#l1, #l2<=>#l3
                                  > set-variable #l4 #l0
                                  > set-variable #l0 #l1
                                  > set-variable #l1 #l4
                                  > !endif
                                  > set-variable #l7 1
                                  > !else
                                  > ; No region assume a single line.
                                  > set-position "\x82"
                                  > set-variable #l0 $window-line
                                  > set-variable #l1 #l0
                                  > set-variable #l7 0
                                  > !endif
                                  > ; If there is a numeric argument then we loose the region and use the
                                  > ; numeric argument as the number of lines to process.
                                  > !if @?
                                  > goto-position "\x82"
                                  > set-variable #l0 $window-line
                                  > !if ¬ &gre @# 0
                                  > ; -ve argument then abort.
                                  > !return
                                  > !endif
                                  > set-variable #l1 &add #l0 &sub @# 1
                                  > !endif
                                  > ; processing lines #l0 to #l1 inclusive, move back by a tab stop on
                                  >all
                                  > ; given lines.
                                  > !if ¬ &equ #l0 $window-line
                                  > goto-line #l0
                                  > !endif
                                  > ; If region mark the starting point.
                                  > !if #l7
                                  > set-mark
                                  > !endif
                                  > !repeat
                                  > ; Go forward first to make sure we are not at end of buffer.
                                  > !force forward-line
                                  > ; Check for end of buffer.
                                  > !if ¬ $status
                                  > beginning-of-line
                                  > !if #l7
                                  > exchange-point-and-mark
                                  > -3 show-region
                                  > exchange-point-and-mark
                                  > 3 show-region
                                  > 1 show-region
                                  > !endif
                                  > !return
                                  > !endif
                                  > backward-line
                                  > beginning-of-line
                                  > $tabsize insert-string " "
                                  > forward-line
                                  > !until &gre $window-line #l1
                                  > beginning-of-line
                                  > ; Reenable the region.
                                  > !if #l7
                                  > exchange-point-and-mark
                                  > -3 show-region
                                  > exchange-point-and-mark
                                  > 3 show-region
                                  > 1 show-region
                                  > !endif
                                  >!emacro
                                  >global-bind-key shove-over "C-x right"

                                  _________________________________________________________________
                                  It's fast, it's easy and it's free. Get MSN Messenger today!
                                  http://www.msn.co.uk/messenger
                                • Thomas Hundt
                                  Personally I wish there were a good outline mode that would do all this for me... but then you re getting into is it a word processor or an editor and
                                  Message 16 of 19 , Oct 1, 2004
                                  • 0 Attachment
                                    Personally I wish there were a good outline mode that would do all this
                                    for me... but then you're getting into "is it a word processor or an
                                    editor" and potentially a whole lot of work. And different people have
                                    different ideas about how plain-text word processing/formatting should
                                    be done.

                                    BTW, for some reason often I seem to end up using the rectangle
                                    functions to tweak indentation on large blocks of text. You know about
                                    those, right? Kill-rectangle etc.

                                    -Th


                                    Tony Bedford wrote:
                                    > I think that would be very useful, indenting and outdenting on blocks is
                                    > something I do a LOT and I'm sure others do too.


                                    --
                                    Thomas Hundt
                                  • Tony Bedford
                                    ... This sounds like what I wanted...basically common programming related editing tasks would be reindenting the body of a for loop, if block or while loop. In
                                    Message 17 of 19 , Oct 4, 2004
                                    • 0 Attachment
                                      >BTW, for some reason often I seem to end up using the rectangle
                                      >functions to tweak indentation on large blocks of text. You know about
                                      >those, right? Kill-rectangle etc.


                                      This sounds like what I wanted...basically common programming related
                                      editing tasks would be reindenting the body of a for loop, if block or while
                                      loop. In XSLT and XML there are similar tasks that require this - even in
                                      plain text.

                                      Are you saying one way is to kill a rectangle and then yank it back in at
                                      the right location? I hadnp;t thought of doing it like that, also it's a
                                      little harder to get it right like that too.

                                      OK I'll try some more experimentation today.

                                      Cheers,
                                      Tony




                                      >From: Thomas Hundt <thundt@...>
                                      >Reply-To: jasspa@yahoogroups.com
                                      >To: jasspa@yahoogroups.com
                                      >Subject: Re: [jasspa] 3 questions - Indent/Outdent region.
                                      >Date: Fri, 01 Oct 2004 10:07:56 -0700
                                      >
                                      >Personally I wish there were a good outline mode that would do all this
                                      >for me... but then you're getting into "is it a word processor or an
                                      >editor" and potentially a whole lot of work. And different people have
                                      >different ideas about how plain-text word processing/formatting should
                                      >be done.
                                      >
                                      >BTW, for some reason often I seem to end up using the rectangle
                                      >functions to tweak indentation on large blocks of text. You know about
                                      >those, right? Kill-rectangle etc.
                                      >
                                      >-Th
                                      >
                                      >
                                      >Tony Bedford wrote:
                                      > > I think that would be very useful, indenting and outdenting on blocks is
                                      > > something I do a LOT and I'm sure others do too.
                                      >
                                      >
                                      >--
                                      >Thomas Hundt

                                      _________________________________________________________________
                                      It's fast, it's easy and it's free. Get MSN Messenger today!
                                      http://www.msn.co.uk/messenger
                                    Your message has been successfully submitted and would be delivered to recipients shortly.