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

Re: [Clip] Trailing Spacs learnings...

Expand Messages
  • hsavage
    ... Trailing blanks; If you check View/Options/Documents/Trim White Spaces, then, if/when using the clip editor Trailing Blanks are automatically deleted when
    Message 1 of 6 , Jun 1, 2003
      Bob Gorman wrote:

      >At 10:31 AM 6/1/2003, Larry wrote:
      >
      > > Hi All,
      > >
      > > I have found that the ^!Replace command should really
      > > be treated like a poisonous cobra in the clip editor,
      >
      ><snip>
      >
      > > A possible solution to this is to select the entire
      > > contents of the clip editor and use the H option
      > > to limit the search and replace to the
      > > selected/highlighted text.
      >
      >
      >I like this approach to reducing the snakes venom....
      >
      > > Here is the changed clip:
      > >
      > > H="Remove Trailing Spaces"
      > > ;Larry Thomas <larryt@...>
      > > ;06/01/2003, 09:24:11 AM
      > > ;With help from "Alec Burgess" <burale@...>
      > > ;and "Mark B." <breaumark@...>
      > > ^!Select All
      > > ^!Replace "\s+\n" >> "\n" HISAR
      > > ^!Jump 1


      Trailing blanks;

      If you check View/Options/Documents/Trim White Spaces, then, if/when
      using the clip editor Trailing Blanks are automatically deleted when the
      clip is saved and the editor closed.

      When editing a clip/clipbook that is Open As A Document trailing blanks
      are deleted in the copy saved to disk, not in the visible copy. If you
      close and reload the clipbook trailing blanks will be gone.

      For the occasions when you don't want to close/reopen a file the clip
      below will remove trailing blanks from a selected area. You can select
      this area either before or during clip execution.

      The clip displays a banner to remind you to make a selection to operate
      on. The trigger action may be changed from a 'copy' action to a
      "keypress" by changing the comment semicolon of the 'IfFalse and IfTrue'
      commands.

      hrs

      H="Remove Trailing Spaces"
      ; make selection, run clip
      ; Hugo's replace regexp with
      ; current options works
      ; on selected text only
      ^!Set %ww%=^$IsWordWrap$
      ^!SetWordWrap 0
      ^!IfCancel END
      ;¯¯¯¯¯¯¯¯¯¯¯¯\
      ^!SetClipboard ^%Empty%
      ^!StatusShow Select and Copy area to remove Spaces...
      :EWL
      ^!SetHintInfo SELECT AND COPY AREA TO REMOVE SPACES...
      ^!Delay 1
      ;
      ^!IfTrue ^$IsEmpty(^$GetClipboard$)$ EWL
      ;^!IfFalse ^$IsCtrlKeyDown$ EWL
      ;^!IfFalse ^$IsShiftKeyDown$ EWL
      ;____________/
      ^!Set %gr%=^$GetRow$
      ^!Replace "\s+\n" >> "\n" HRSA
      ^!Jump ^%gr%
      :END
      ^!SetWordWrap ^%ww%
    • Larry Thomas
      Hi Harvey, ... I think your clip will work just fine although I think mine is simpler. It is possible that Bob wanted to manually select the lines that he
      Message 2 of 6 , Jun 1, 2003
        Hi Harvey,

        At 12:53 PM 6/1/03 -0500, you wrote:
        >Trailing blanks;
        >
        >If you check View/Options/Documents/Trim White Spaces, then, if/when
        >using the clip editor Trailing Blanks are automatically deleted when the
        >clip is saved and the editor closed.
        >
        >When editing a clip/clipbook that is Open As A Document trailing blanks
        >are deleted in the copy saved to disk, not in the visible copy. If you
        >close and reload the clipbook trailing blanks will be gone.
        >
        >For the occasions when you don't want to close/reopen a file the clip
        >below will remove trailing blanks from a selected area. You can select
        >this area either before or during clip execution.
        >
        >The clip displays a banner to remind you to make a selection to operate
        >on. The trigger action may be changed from a 'copy' action to a
        >"keypress" by changing the comment semicolon of the 'IfFalse and IfTrue'
        >commands.

        I think your clip will work just fine although I think mine is simpler. It
        is possible that Bob wanted to manually select the lines that he wanted
        trimmed and that is why he removed the select all line. I do like the idea
        of setting the options to Trim Blanks very much though and I have now set
        mine to do so. I have tried it and it appears to work very well and it
        does not fail as Modify/Line/Trim Blanks does.

        Thank you Harvey.

        Regards,

        Larry
        larryt@...
      • Bob Gorman
        ... This I did not know. ... Again, thanks for the new info. Bob It is easier to build strong children than to repair broken men ....Frederick Douglass
        Message 3 of 6 , Jun 1, 2003
          At 01:07 PM 6/1/2003, you wrote:


          >Welll, ok but you have removed the safety feature. If nothing is selected,
          >the clip will still replace everthing in the library starting from the clip
          >to the end of the library.

          This I did not know.

          >But ^!Select All is necessary if you want to
          >restrict your replace to the current clip because select all will not
          >select the whole library but only the clip in the clip editor window. And
          >as I said before, if you have nothing selected, then the H option has no
          >effect at all. It is just ignored.

          Again, thanks for the new info.

          Bob

          It is easier to build strong children than to repair broken men
          ....Frederick Douglass


          [Non-text portions of this message have been removed]
        Your message has been successfully submitted and would be delivered to recipients shortly.