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

Re: [jasspa] How to force ME to start in text mode

Expand Messages
  • Jon Green
    Follows is a solution. It is a little dirty but never mind !! In your add a binding for any filename that ends in 1/2/3/4/5/6/7/8/9 and bind it to
    Message 1 of 3 , Jan 8 2:59 PM
      Follows is a solution. It is a little dirty but never mind !!
      In your <user.emf> add a binding for any filename that ends
      in 1/2/3/4/5/6/7/8/9 and bind it to the "doc" macros.
      If you edit t/nroff files then re-add this hook again after
      the 1..9 doc binding, this will be checked before the
      previous hook added i.e.

      add-file-hook "0 1 2 3 4 5 6 7 8 9" fhook-doc
      add-file-hook ".n .1 .2 .3 .4 .5 .6 .7 .8 .9 .so .tni .sm"
      fhook-nroff

      I think you are right we probably do need to consider
      a prefix hook rather than a post-fix hook.

      Regards
      Jon.

      thundt wrote:
      >
      > Here's my problem: I use this mail program called 'elm' on one of my
      > machines, and it edits messages by placing them in /tmp/snd.12345 (or
      > some other random number -- the PID, I think) and then kicks off ME
      > against it. I can't figure out how to get ME to recognize this as a
      > text file.
      >
      > First I wanted to tell it a numeric file extension is a text file:
      > add-file-hook ".[0-9]+" fhook-txt
      > but it won't recognize regular expressions in this context.
      >
      > Then I naively tried
      > add-file-hook "snd.*" fhook-txt
      > but it won't match "snd*" because it doesn't recognize '*' in this
      > context (only when doing the other form of add-file-hook, which
      > matches lines of text within the file).
      >
      > Then I thought about telling it on the command line, trying things
      > like:
      > 'me32 @...'
      > but that fails as soon as it hits the first osd command (I'm
      > guessing because nothing is displayed yet, on startup).
      >
      > So, any suggestions?
      >
      > (To me, the most elegant solution would be to make add-file-hook
      > recognize regexps in the file extensions. This might be useful for
      > other things, later.)
      >
      > Thanks,
      >
      > -Tom Hundt
      >
      > P.S. Here are a couple of hooks that you might want to integrate into
      > me.emf:
      > add-file-hook ".frm" fhook-vb ; Visual BASIC
      > add-file-hook ".js" fhook-java ; JavaScript
      > add-file-hook ".bmp .jpg .gif" fhook-binary ; images
      > add-file-hook ".Z .tar .zip .bin .com .exe" fhook-binary ; binaries
      > add-file-hook ".obj .lib .o .a .so .gz" fhook-binary ; binaries
      > (You could go on all day with the binaries :-)
      >
    • Steven Phillips
      An alternative solution which I think is cleaner is to define a default hook as follows: define-macro-file hktxt fhook-txt define-macro fhook-default fhook-txt
      Message 2 of 3 , Jan 8 11:01 PM
        An alternative solution which I think is cleaner is to define a default hook
        as follows:

        define-macro-file hktxt fhook-txt
        define-macro fhook-default
        fhook-txt
        set-variable $buffer-bhook bhook-txt
        set-variable $buffer-ehook ehook-txt
        !emacro

        This way any file which has not been recognised will be put into text mode.
        But it restrict this to just the elm files, use:

        define-macro-file hktxt fhook-txt
        define-macro fhook-default
        !if &xse $buffer-fname "e:/tmp/snd.*"
        fhook-txt
        set-variable $buffer-bhook bhook-txt
        set-variable $buffer-ehook ehook-txt
        !endif
        !emacro

        Steve

        > -----Original Message-----
        > From: thundt [mailto:thundt@...]
        > Sent: 08 January 2002 21:23
        > To: jasspa@yahoogroups.com
        > Subject: [jasspa] How to force ME to start in text mode
        >
        >
        > Here's my problem: I use this mail program called 'elm' on one of my
        > machines, and it edits messages by placing them in /tmp/snd.12345 (or
        > some other random number -- the PID, I think) and then kicks off ME
        > against it. I can't figure out how to get ME to recognize this as a
        > text file.
        >
        > First I wanted to tell it a numeric file extension is a text file:
        > add-file-hook ".[0-9]+" fhook-txt
        > but it won't recognize regular expressions in this context.
        >
        > Then I naively tried
        > add-file-hook "snd.*" fhook-txt
        > but it won't match "snd*" because it doesn't recognize '*' in this
        > context (only when doing the other form of add-file-hook, which
        > matches lines of text within the file).
        >
        > Then I thought about telling it on the command line, trying things
        > like:
        > 'me32 @...'
        > but that fails as soon as it hits the first osd command (I'm
        > guessing because nothing is displayed yet, on startup).
        >
        > So, any suggestions?
        >
        > (To me, the most elegant solution would be to make add-file-hook
        > recognize regexps in the file extensions. This might be useful for
        > other things, later.)
        >
        > Thanks,
        >
        > -Tom Hundt
        >
        > P.S. Here are a couple of hooks that you might want to integrate into
        > me.emf:
        > add-file-hook ".frm" fhook-vb ; Visual BASIC
        > add-file-hook ".js" fhook-java ; JavaScript
        > add-file-hook ".bmp .jpg .gif" fhook-binary ; images
        > add-file-hook ".Z .tar .zip .bin .com .exe" fhook-binary ; binaries
        > add-file-hook ".obj .lib .o .a .so .gz" fhook-binary ; binaries
        > (You could go on all day with the binaries :-)
        >
        >
        >
        >
        >
        > __________________________________________________________________________
        >
        > 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/
        >
        >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.