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

RE: [jasspa] rectangles

Expand Messages
  • Steven Phillips
    Ahh, now overwrite with a rectangle yank is easily defined and implemented (I think), try: define-macro yank-rectangle-over yank-rectangle !if &bmo over
    Message 1 of 7 , Feb 21, 2002
    • 0 Attachment
      Ahh, now overwrite with a rectangle yank is easily defined and implemented
      (I think), try:

      define-macro yank-rectangle-over
      yank-rectangle
      !if &bmo "over"
      set-variable #l0 $window-line
      set-variable #l1 $window-acol
      exchange-point-and-mark
      set-variable #l2 &add #l1 &sub #l1 $window-acol
      set-variable $window-acol #l1
      set-mark
      set-variable $window-line #l0
      !force set-variable $window-acol #l2
      !if &gre $window-acol #l2
      ; previous char is a multi-char display char (i.e. a tab)
      backward-char
      !endif
      !if &les $window-acol #l2
      ; last line not long enough (or multi display char), pad with
      spaces
      &sub #l2 $window-acol insert-space
      !endif
      kill-rectangle
      -1 yank
      !endif
      !emacro

      This should do the trick - probably should be added as a submission,

      Steve

      > -----Original Message-----
      > From: un_x [mailto:un_x@...]
      > Sent: 21 February 2002 12:20
      > To: jasspa@yahoogroups.com
      > Subject: [jasspa] rectangles
      >
      >
      > aaaa
      > bbbb
      > cccc
      > dddd
      >
      > middle 4 put into kill buffer via rectangle selection.
      > pasted on top of the lower 4:
      >
      > OVER....INSERT
      > ............
      > aaaa....aaaa
      > bbbb....bbbb
      > ccbb....ccbbcc
      > ddcc....ddccdd
      > ............
      >
      > pasted far off to the right, past all EOL's:
      >
      > ............
      > aaaa
      > bbbb....bb
      > ccbb....cc
      > ddcc
      > ............
      >
      > pasted into a file whose 1st and only line is "Hello World!"
      > pasted onto the letter W:
      >
      > OVER
      > ............
      > Hello bbrld![EOL]
      > ......cc[EOL]
      > [EOF]
      > ............
      >
      > INSERT
      > ............
      > Hello bbWorld![EOL]
      > ......cc[EOL]
      > [EOF]
      > ............
      >
      >
      >
      >
      > __________________________________________________________________________
      >
      > 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.
      >
      >
      >
      >
      > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      >
      >
    • Rick Owen
      Greetings, Is there a standard macro that will trim trailing white spaces? If so, is there a way to hook the file save process so that the trim trailing white
      Message 2 of 7 , Feb 21, 2002
      • 0 Attachment
        Greetings,

        Is there a standard macro that will trim trailing white spaces? If so, is
        there a way to hook the file save process so that the trim trailing white
        spaces macro can process the file being saved?

        This would be on an HPUX system running me via telnet.

        Thanks,
        Rick.


        __________________________________________________
        Do You Yahoo!?
        Yahoo! Sports - Coverage of the 2002 Olympic Games
        http://sports.yahoo.com
      • Jon Green
        The macro clean will remove all trailing white space from all lines. (format.emf) I usually define a macro called spotless which cleans all lines and
        Message 3 of 7 , Feb 21, 2002
        • 0 Attachment
          The macro "clean" will remove all trailing
          white space from all lines. (format.emf)

          I usually define a macro called "spotless"
          which cleans all lines and removes any
          double white space lines:-

          > ; spotless; Perform a clean and remove any multi-blank lines.
          > define-macro spotless
          > -1 clean
          > !emacro

          This just calls 'clean' with a -1 argument
          that does the line killing as well.

          The best way to do what you want is to redefine
          the C-x C-s binding with a macro that performs
          the save for you and does some other work that
          you want. The following would be defined in
          your <user>.emf file i.e.

          > define-macro my-save-buffer
          > clean
          > !nma save-buffer
          > !emacro
          >
          > global-bind-key my-save-buffer "C-x C-s"

          Regards
          Jon.


          Rick Owen wrote:
          >
          > Greetings,
          >
          > Is there a standard macro that will trim trailing white spaces? If so, is
          > there a way to hook the file save process so that the trim trailing white
          > spaces macro can process the file being saved?
          >
          > This would be on an HPUX system running me via telnet.
          >
          > Thanks,
          > Rick.
          >
          > __________________________________________________
          > Do You Yahoo!?
          > Yahoo! Sports - Coverage of the 2002 Olympic Games
          > http://sports.yahoo.com
          >
          >
          > __________________________________________________________________________
          >
          > 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.
          >
          >
          >
          > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

          --
          ______________________________________________________________________

          Jon Green J.D.Naughton-Green
          Project Manager

          SAMSUNG Electronics (UK) Ltd
          Samsung Electronics Research Institute (Audio / Visual Labs)
          The Communication Centre
          South Street
          Staines Tel(direct): +44 (0)1784 428614
          MIDDLESEX Tel(s/w board): +44 (0)1784 428600 ext 614
          TW18 4QE Fax: +44 (0)1784 428620
          England Email (work): jon@...
          Email (home): jon@...
          _______________________________________________________________________
        • Rick Owen
          Hi Jon, That works great. One last question if you don t mind. How would you go about writing a macro that does the equivalent of save-buffers-exit-emacs but
          Message 4 of 7 , Feb 21, 2002
          • 0 Attachment
            Hi Jon,

            That works great. One last question if you don't mind. How would you go about
            writing a macro that does the equivalent of

            save-buffers-exit-emacs

            but cleans and saves each modified file before exiting instead of just saves.

            Thanks,
            Rick.


            --- Jon Green <jnaught@...> wrote:
            > The macro "clean" will remove all trailing
            > white space from all lines. (format.emf)
            >
            > I usually define a macro called "spotless"
            > which cleans all lines and removes any
            > double white space lines:-
            >
            > > ; spotless; Perform a clean and remove any multi-blank lines.
            > > define-macro spotless
            > > -1 clean
            > > !emacro
            >
            > This just calls 'clean' with a -1 argument
            > that does the line killing as well.
            >
            > The best way to do what you want is to redefine
            > the C-x C-s binding with a macro that performs
            > the save for you and does some other work that
            > you want. The following would be defined in
            > your <user>.emf file i.e.
            >
            > > define-macro my-save-buffer
            > > clean
            > > !nma save-buffer
            > > !emacro
            > >
            > > global-bind-key my-save-buffer "C-x C-s"
            >
            > Regards
            > Jon.
            >
            >
            > Rick Owen wrote:
            > >
            > > Greetings,
            > >
            > > Is there a standard macro that will trim trailing white spaces? If so, is
            > > there a way to hook the file save process so that the trim trailing white
            > > spaces macro can process the file being saved?
            > >
            > > This would be on an HPUX system running me via telnet.
            > >
            > > Thanks,
            > > Rick.
            > >
            > > __________________________________________________
            > > Do You Yahoo!?
            > > Yahoo! Sports - Coverage of the 2002 Olympic Games
            > > http://sports.yahoo.com
            > >
            > >
            > > __________________________________________________________________________
            > >
            > > 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.
            > >
            > >
            > >
            > > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
            >
            > --
            > ______________________________________________________________________
            >
            > Jon Green J.D.Naughton-Green
            > Project Manager
            >
            > SAMSUNG Electronics (UK) Ltd
            > Samsung Electronics Research Institute (Audio / Visual Labs)
            > The Communication Centre
            > South Street
            > Staines Tel(direct): +44 (0)1784 428614
            > MIDDLESEX Tel(s/w board): +44 (0)1784 428600 ext 614
            > TW18 4QE Fax: +44 (0)1784 428620
            > England Email (work): jon@...
            > Email (home): jon@...
            > _______________________________________________________________________
            >


            =====
            "And the only reason a road is good, as every wanderer knows,
            Is just because of the homes, the homes, the homes to which it goes."
            (Joyce Kilmer - "Main Street" and other poems)

            __________________________________________________
            Do You Yahoo!?
            Yahoo! Sports - Coverage of the 2002 Olympic Games
            http://sports.yahoo.com
          • Steven Phillips
            Look at the macro osd-save-all defined in osd.emf, Steve ... http://docs.yahoo.com/info/terms/ ... ===== And the only reason a road is good, as every wanderer
            Message 5 of 7 , Feb 22, 2002
            • 0 Attachment
              Look at the macro osd-save-all defined in osd.emf,

              Steve

              > -----Original Message-----
              > From: Rick Owen [mailto:rickowen@...]
              > Sent: 21 February 2002 19:27
              > To: jasspa@yahoogroups.com
              > Subject: Re: [jasspa] Question regarding trailing white spaces
              >
              >
              > Hi Jon,
              >
              > That works great. One last question if you don't mind. How
              > would you go about
              > writing a macro that does the equivalent of
              >
              > save-buffers-exit-emacs
              >
              > but cleans and saves each modified file before exiting instead of
              > just saves.
              >
              > Thanks,
              > Rick.
              >
              >
              > --- Jon Green <jnaught@...> wrote:
              > > The macro "clean" will remove all trailing
              > > white space from all lines. (format.emf)
              > >
              > > I usually define a macro called "spotless"
              > > which cleans all lines and removes any
              > > double white space lines:-
              > >
              > > > ; spotless; Perform a clean and remove any multi-blank lines.
              > > > define-macro spotless
              > > > -1 clean
              > > > !emacro
              > >
              > > This just calls 'clean' with a -1 argument
              > > that does the line killing as well.
              > >
              > > The best way to do what you want is to redefine
              > > the C-x C-s binding with a macro that performs
              > > the save for you and does some other work that
              > > you want. The following would be defined in
              > > your <user>.emf file i.e.
              > >
              > > > define-macro my-save-buffer
              > > > clean
              > > > !nma save-buffer
              > > > !emacro
              > > >
              > > > global-bind-key my-save-buffer "C-x C-s"
              > >
              > > Regards
              > > Jon.
              > >
              > >
              > > Rick Owen wrote:
              > > >
              > > > Greetings,
              > > >
              > > > Is there a standard macro that will trim trailing white
              > spaces? If so, is
              > > > there a way to hook the file save process so that the trim
              > trailing white
              > > > spaces macro can process the file being saved?
              > > >
              > > > This would be on an HPUX system running me via telnet.
              > > >
              > > > Thanks,
              > > > Rick.
              > > >
              > > > __________________________________________________
              > > > Do You Yahoo!?
              > > > Yahoo! Sports - Coverage of the 2002 Olympic Games
              > > > http://sports.yahoo.com
              > > >
              > > >
              > > >
              > __________________________________________________________________________
              > > >
              > > > 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.
              > > >
              > > >
              > > >
              > > > Your use of Yahoo! Groups is subject to
              http://docs.yahoo.com/info/terms/
              >
              > --
              > ______________________________________________________________________
              >
              > Jon Green J.D.Naughton-Green
              > Project Manager
              >
              > SAMSUNG Electronics (UK) Ltd
              > Samsung Electronics Research Institute (Audio / Visual Labs)
              > The Communication Centre
              > South Street
              > Staines Tel(direct): +44 (0)1784 428614
              > MIDDLESEX Tel(s/w board): +44 (0)1784 428600 ext 614
              > TW18 4QE Fax: +44 (0)1784 428620
              > England Email (work): jon@...
              > Email (home): jon@...
              > _______________________________________________________________________
              >


              =====
              "And the only reason a road is good, as every wanderer knows,
              Is just because of the homes, the homes, the homes to which it goes."
              (Joyce Kilmer - "Main Street" and other poems)

              __________________________________________________
              Do You Yahoo!?
              Yahoo! Sports - Coverage of the 2002 Olympic Games
              http://sports.yahoo.com


              __________________________________________________________________________

              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.




              Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
            • thundt
              Here is a macro to clean just ONE line: ;------------------------------------------------------------ ; trim-line: get rid of whitespace at end of line
              Message 6 of 7 , Feb 22, 2002
              • 0 Attachment
                Here is a macro to 'clean' just ONE line:

                ;------------------------------------------------------------
                ; trim-line: get rid of whitespace at end of line
                ;------------------------------------------------------------
                define-macro trim-line
                beginning-of-line
                set-variable #l1 &trright @wl
                !if &gre &len #l1 0
                kill-line
                insert-string #l1
                !if ¬ &bmode "line"
                newline
                !endif
                !endif
                !emacro


                And here is one to 'clean' the spaces from the BEGINNING of lines
                (useful when copy/pasting from Netscape into a ME buffer)

                ;------------------------------------------------------------
                ; kill-leading-whitespace
                ;------------------------------------------------------------
                define-macro kill-leading-whitespace
                beginning-of-buffer
                replace-string "^[ \t]+" ""
                beginning-of-buffer
                !emacro






                --- In jasspa@y..., Jon Green <jnaught@s...> wrote:
                > The macro "clean" will remove all trailing
                > white space from all lines. (format.emf)
                >
                > I usually define a macro called "spotless"
                > which cleans all lines and removes any
                > double white space lines:-
                >
                > > ; spotless; Perform a clean and remove any multi-blank lines.
                > > define-macro spotless
                > > -1 clean
                > > !emacro
                >
                > This just calls 'clean' with a -1 argument
                > that does the line killing as well.
                >
                > The best way to do what you want is to redefine
                > the C-x C-s binding with a macro that performs
                > the save for you and does some other work that
                > you want. The following would be defined in
                > your <user>.emf file i.e.
                >
                > > define-macro my-save-buffer
                > > clean
                > > !nma save-buffer
                > > !emacro
                > >
                > > global-bind-key my-save-buffer "C-x C-s"
                >
                > Regards
                > Jon.
                >
                >
                > Rick Owen wrote:
                > >
                > > Greetings,
                > >
                > > Is there a standard macro that will trim trailing white spaces?
                If so, is
                > > there a way to hook the file save process so that the trim
                trailing white
                > > spaces macro can process the file being saved?
                > >
                > > This would be on an HPUX system running me via telnet.
                > >
                > > Thanks,
                > > Rick.
                > >
                > > __________________________________________________
                > > Do You Yahoo!?
                > > Yahoo! Sports - Coverage of the 2002 Olympic Games
                > > http://sports.yahoo.com
                > >
                > >
                > >
                ______________________________________________________________________
                ____
                > >
                > > 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@y...
                > >
                > > or visit http://groups.yahoo.com/group/jasspa and
                > > modify your account settings manually.
                > >
                > >
                > >
                > > Your use of Yahoo! Groups is subject to
                http://docs.yahoo.com/info/terms/
                >
                > --
                >
                ______________________________________________________________________
                >
                > Jon Green
                J.D.Naughton-Green
                > Project Manager
                >
                > SAMSUNG Electronics (UK) Ltd
                > Samsung Electronics Research Institute (Audio / Visual Labs)
                > The Communication Centre
                > South Street
                > Staines Tel(direct): +44 (0)1784 428614
                > MIDDLESEX Tel(s/w board): +44 (0)1784 428600 ext 614
                > TW18 4QE Fax: +44 (0)1784 428620
                > England Email (work): jon@s...
                > Email (home): jon@j...
                >
                ______________________________________________________________________
                _
              Your message has been successfully submitted and would be delivered to recipients shortly.