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

RE: [jasspa] Macro: reread-all-files

Expand Messages
  • Phillips, Steven
    Great minds think a like (or fools seldom differ!) following is my take on this functionality and will be included in the next release. The main advantage of
    Message 1 of 3 , Feb 7, 2007
    • 0 Attachment
      Great minds think a like (or fools seldom differ!) following is my take on this functionality and will be included in the next release.
       
      The main advantage of this version is a more complete prompt when handling buffers that contain edits.
       
      Steve
       
      define-macro reread-all
          0xde set-position "\x82"
          set-variable #l0 $buffer-bname
          set-variable #l1 0
          set-variable $buffer-names "[^*].*"
          !while &not &seq &set #l2 $buffer-names ""
              !if &nbmod #l2 "nact"
              !else
                  find-buffer #l2
                  !if &band $buffer-fmod 0x10000
                  !elif &len $buffer-fname
                      !if &bmod "edit"
                          !if &les #l1 0
                              set-variable #l3 "n"
                          !elif &gre #l1 0
                              set-variable #l3 "y"
                          !else
                              set-variable #l3 @mc5 &cat $buffer-fname ": Discard changes (?/y/n/a/o) ? " "aAnNoOyY"  "(Y)es, (N)o, Yes to (A)ll, N(o) to All, (C-g)Abort ? "
                              !if &iseq #l3 "a"
                                  set-variable #l1 1
                                  set-variable #l3 "y"
                              !elif &iseq #l3 "o"
                                  set-variable #l1 -1
                                  set-variable #l3 "n"
                              !endif
                          !endif
                      !else
                          set-variable #l3 "y"
                      !endif
                      !if &iseq #l3 "y"
                          !if &seq $buffer-bname #l0
                              !force goto-position "\x82"
                              0 reread-file
                              0xde set-position "\x82"
                          !else
                              0 reread-file
                          !endif
                      !endif
                  !endif
              !endif
          !done
          !force goto-position "\x82"
      !emacro


      From: jasspa@yahoogroups.com [mailto:jasspa@yahoogroups.com] On Behalf Of Bryan Schofield
      Sent: Wednesday, February 07, 2007 3:16 PM
      To: Jasspa
      Subject: [jasspa] Macro: reread-all-files

      Here's a macro that will reread all of the files loaded. It is useful
      after you've done an "update" of you version controlled project.

      ; Reread all files loaded
      define-macro reread-all-files
      set-variable #l9 $buffer-bname
      set-variable #l1 0
      set-variable #l2 0
      set-variable $buffer-names "[^\*].*"
      !while &not &seq &set #l0 $buffer-names ""
      find-buffer #l0
      !force reread-file
      !if $status
      set-variable #l1 &inc #l1 1
      !else
      set-variable #l2 &inc #l2 1
      !endif
      !done
      find-buffer #l9
      ml-write &spr "[reread %s, skipped %s]" #l1 #l2
      !emacro

    • Bryan Schofield
      Nifty, it s already in the current release. Thanks for going back in time and adding it to the last release! Let me ask the question we re all thinking: Now,
      Message 2 of 3 , Feb 7, 2007
      • 0 Attachment
        Nifty, it's already in the current release. Thanks for going back in
        time and adding it to the last release! Let me ask the question we're
        all thinking:

        Now, what can you do about that weekend in Vegas where I ended up with
        a tattoo of a ____ on my ____?

        Cheers
        -- bryan



        On 2/7/07, Phillips, Steven <sphillips@...> wrote:
        >
        >
        >
        >
        >
        >
        >
        > Great minds think a like (or fools seldom differ!) following is my take on this functionality and will be included in the next release.
      Your message has been successfully submitted and would be delivered to recipients shortly.