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

Help with my macro

Expand Messages
  • salmankhilji
    To convert tabs to spaces in batch to a collection of files, I created a macro named untabify.emf and put it in $HOME/.jasspa/ The contents of the macro are:
    Message 1 of 3 , Jun 22, 2004
    • 0 Attachment
      To convert tabs to spaces in batch to a collection of files, I created
      a macro named untabify.emf and put it in $HOME/.jasspa/

      The contents of the macro are:

      define-macro start-up
      delete-other-windows
      !while ¬ &seq $buffer-bname "*scratch*"
      ml-write &spr "Processing [%s]" $buffer-fname
      tabs-to-spaces
      save-buffer
      delete-buffer $buffer-bname
      !done
      exit-emacs
      !emacro

      This is basically a copy of the dos2unix macro that ships with ME.
      However, this does not work. ME complains that it does not know the
      tabs-to-spaces macro. I have to copy the macro definition into
      untabify.emf. Is there a way to not have to copy the macro definition
      and have ME somehow know the existence of other macros within a file
      like untabify.emf or dos2unix.emf?

      Salman
    • Phillips, Steven
      Salman, If you look in me.emf you will see a long list of define-macro-file lines, these do what you are try to do. You need a line like the following:
      Message 2 of 3 , Jun 22, 2004
      • 0 Attachment
        Salman,

        If you look in me.emf you will see a long list of define-macro-file lines, these do what you are try to do. You need a line like the following:

        define-macro-file format tabs-to-spaces

        These lines are like a prototype, rather than loading all the macro files to fully define all commands (which would really slow down start-up) it creates the command as undinied with a pointer to where to get the definition.

        The alternative technique would be to simply execute the format.emf file, i.e.

        execute-file "format"

        Which will full define the macro straight away,

        Steve

        > -----Original Message-----
        > From: salmankhilji [mailto:salmankhilji@...]
        > Sent: 22 June 2004 14:18
        > To: jasspa@yahoogroups.com
        > Subject: [jasspa] Help with my macro
        >
        >
        > To convert tabs to spaces in batch to a collection of files, I created
        > a macro named untabify.emf and put it in $HOME/.jasspa/
        >
        > The contents of the macro are:
        >
        > define-macro start-up
        > delete-other-windows
        > !while ¬ &seq $buffer-bname "*scratch*"
        > ml-write &spr "Processing [%s]" $buffer-fname
        > tabs-to-spaces
        > save-buffer
        > delete-buffer $buffer-bname
        > !done
        > exit-emacs
        > !emacro
        >
        > This is basically a copy of the dos2unix macro that ships with ME.
        > However, this does not work. ME complains that it does not know the
        > tabs-to-spaces macro. I have to copy the macro definition into
        > untabify.emf. Is there a way to not have to copy the macro definition
        > and have ME somehow know the existence of other macros within a file
        > like untabify.emf or dos2unix.emf?
        >
        > Salman
        >
        >
        >
        >
        >
        >
        > ------------------------ 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
        >
        >
        >
        >
        >
        >
      • Jon Green
        ... When you run as startup then none of the macros are known. You need to declare where it is - much the same as an extern in C. Add the following to the
        Message 3 of 3 , Jun 22, 2004
        • 0 Attachment
          salmankhilji wrote:
          > To convert tabs to spaces in batch to a collection of files, I created
          > a macro named untabify.emf and put it in $HOME/.jasspa/
          >
          > The contents of the macro are:
          >
          > define-macro start-up
          > delete-other-windows
          > !while ¬ &seq $buffer-bname "*scratch*"
          > ml-write &spr "Processing [%s]" $buffer-fname
          > tabs-to-spaces
          > save-buffer
          > delete-buffer $buffer-bname
          > !done
          > exit-emacs
          > !emacro
          >
          > This is basically a copy of the dos2unix macro that ships with ME.
          > However, this does not work. ME complains that it does not know the
          > tabs-to-spaces macro. I have to copy the macro definition into
          > untabify.emf. Is there a way to not have to copy the macro definition
          > and have ME somehow know the existence of other macros within a file
          > like untabify.emf or dos2unix.emf?
          >
          > Salman
          >

          When you run as startup then none of the macros are known.
          You need to declare where it is - much the same as an extern in C.
          Add the following to the file:-

          define-macro-file format tabs-to-spaces

          This tells me that tabs-to-spaces may be found in the file format.emf

          Jon.
        Your message has been successfully submitted and would be delivered to recipients shortly.