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

Re: [jasspa] short questions

Expand Messages
  • Christof Boeckler
    ... From next-buffer(2): find-buffer switches to buffer buffer-name in the current window. If the buffer does not exist and a zero argument n is supplied
    Message 1 of 11 , Nov 6, 2006
      dsjkvf schrieb:
      > On 11/6/06, dsjkvf <dsjkvf@...> wrote:
      >> i want to create a new file and apply certain template to it (in my
      >> particular case i want the file's major mode be set to doc). of
      >> course, i want to do it with one keypress :) (with macro, i think) --
      >> in fact, it should be something like that: ask for a name for a new
      >> buffer, create buffer with this name and then set buffer's major mode
      >> to doc.
      >>
      >> how new buffers are created in ME at all? i don't seem to find any
      >> create-buffer command :).

      From next-buffer(2):

      "find-buffer switches to buffer "buffer-name" in the current window. If
      the buffer does not exist and a zero argument n is supplied then the
      command fails. If the buffer does not exist but no argument or a positive
      argument n is specified then a new buffer is created, at which point the
      file-hook is evaluated."

      > in fact, i can even operate this way:
      >
      > define-macro new-doc-file
      > find-buffer "*scratch*"
      > insert-string "> -!- document -!-"
      > write-buffer
      > !emacro
      >
      > but then the highlighting will not work -- the file needs either to be
      > reopen (and then the header will set it's major mode to doc) or i
      > should set his mode manually via Tools -> Buffer setup -> Major mode.
      >
      > what do you think, is there any way to automate this procedure?

      I would rather try to set up a <mode>.etf file in your ME search path. It
      will be inserted automatically if you create a new file of the chosen mode.

      E.g. I have a latex.etf in my ~/.jasspa file on Linux and if I press C-x
      C-f newfile.tex then I get a new buffer with content of latex.etf in it.

      Gruß / Regards
      Christof

      --
      Da sie sich für weise hielten, sind sie zu Narren geworden. Rö 1,22
    • dsjkvf
      ... oops, sorry, haven t thought taht it could be so obvious :). thank you, Christof, for pointing me to that. ... yes, that s quite nice, thank you once again
      Message 2 of 11 , Nov 6, 2006
        On 11/6/06, Christof Boeckler <cb@...> wrote:

        > From next-buffer(2):
        > "find-buffer switches to buffer "buffer-name" in the current window. If
        > the buffer does not exist and a zero argument n is supplied then the
        > command fails. If the buffer does not exist but no argument or a positive
        > argument n is specified then a new buffer is created, at which point the
        > file-hook is evaluated."

        oops, sorry, haven't thought taht it could be so obvious :). thank
        you, Christof, for pointing me to that.

        > I would rather try to set up a <mode>.etf file in your ME search path. It
        > will be inserted automatically if you create a new file of the chosen mode.

        yes, that's quite nice, thank you once again :).




        --
        dsjkvf
      • dsjkvf
        ... Steven, thank you for your help. what would be the best way to override preinstalled macroses in general? e.g., in this case should i copy osd-new-buffer
        Message 3 of 11 , Nov 6, 2006
          On 11/6/06, Phillips, Steven <sphillips@...> wrote:

          > I suggest you take the osd-new-buffer macro from osd.emf and change the
          > "new%d" to "new%d.doc".

          Steven, thank you for your help.

          what would be the best way to override preinstalled macroses in
          general? e.g., in this case should i copy osd-new-buffer to my
          .emf-file and correct it to my needs there? or should i copy (and
          correct then) osd.emf to myosd.emf in MEUSERPATH? or any other way?

          and another question: for now doc-mode "works" only for files wiith
          extension ".doc". is it possible to make it also work with ".txt"
          files?

          > See the goto-matching-fence command, writing a macro around this should
          > be trivial. Note that matching a '"' fence is non-trivial because ME
          > will not know whether it is currently at the openning or closing '"' -
          > see the docs for more info.

          yes, i thought so -- that with "" it will not be so easy. however,
          thank you for your explanation.



          --
          dsjkvf
        • jon@jasspa.com
          ... This depends. If you can simply over-ride some settings or re-define a macro then the myXXXX.emf should be used to do this. If the changes are more
          Message 4 of 11 , Nov 6, 2006
            > On 11/6/06, Phillips, Steven <sphillips@...> wrote:
            >
            >> I suggest you take the osd-new-buffer macro from osd.emf and change the
            >> "new%d" to "new%d.doc".
            >
            > Steven, thank you for your help.
            >
            > what would be the best way to override preinstalled macroses in
            > general? e.g., in this case should i copy osd-new-buffer to my
            > .emf-file and correct it to my needs there? or should i copy (and
            > correct then) osd.emf to myosd.emf in MEUSERPATH? or any other way?
            >

            This depends. If you can simply over-ride some settings or re-define a
            macro then the myXXXX.emf should be used to do this. If the changes are
            more widespread then it is better to copy the whole macro file to your
            user directory and then modify it. Do not change the system macros because
            if you mess up then you cannot fall back on the originals.

            > and another question: for now doc-mode "works" only for files wiith
            > extension ".doc". is it possible to make it also work with ".txt"
            > files?

            Put "> -!- document -!-" in the top of the document or add the following
            to the end of your <user>.emf

            add-file-hook ".txt .doc" fhook-doc

            Jon.

            >
            >> See the goto-matching-fence command, writing a macro around this should
            >> be trivial. Note that matching a '"' fence is non-trivial because ME
            >> will not know whether it is currently at the openning or closing '"' -
            >> see the docs for more info.
            >
            > yes, i thought so -- that with "" it will not be so easy. however,
            > thank you for your explanation.
            >
            >
            >
            > --
            > dsjkvf
          • Phillips, Steven
            ... I think in this case you are creating a new macro so I would copy it into your user my???.emf and call it something else (like create-new-doc), that way
            Message 5 of 11 , Nov 6, 2006
              > -----Original Message-----
              > From: jasspa@yahoogroups.com [mailto:jasspa@yahoogroups.com]
              > On Behalf Of dsjkvf
              > Sent: Monday, November 06, 2006 9:55 AM
              > To: jasspa@yahoogroups.com
              > Subject: Re: [jasspa] short questions
              >
              > On 11/6/06, Phillips, Steven <sphillips@...> wrote:
              >
              > > I suggest you take the osd-new-buffer macro from osd.emf
              > and change
              > > the "new%d" to "new%d.doc".
              >
              > Steven, thank you for your help.
              >
              > what would be the best way to override preinstalled macroses
              > in general? e.g., in this case should i copy osd-new-buffer
              > to my .emf-file and correct it to my needs there? or should i
              > copy (and correct then) osd.emf to myosd.emf in MEUSERPATH?
              > or any other way?

              I think in this case you are creating a new macro so I would copy it
              into your user my???.emf and call it something else (like
              create-new-doc), that way you avoid any future upgrade problems.

              Steve

              >
              > and another question: for now doc-mode "works" only for files
              > wiith extension ".doc". is it possible to make it also work
              > with ".txt"
              > files?
              >
              > > See the goto-matching-fence command, writing a macro around this
              > > should be trivial. Note that matching a '"' fence is non-trivial
              > > because ME will not know whether it is currently at the
              > openning or
              > > closing '"' - see the docs for more info.
              >
              > yes, i thought so -- that with "" it will not be so easy.
              > however, thank you for your explanation.
              >
              >
              >
              > --
              > dsjkvf
              >
              >
              > ______________________________________________________________
              > ____________
              >
              > 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
              >
              >
              >
              >
            • dsjkvf
              ... i see. ... yes, i ve faced something like that just recently when upgrading to 06 release :) (and as a result, i was using diff a lot to find all my
              Message 6 of 11 , Nov 6, 2006
                On 11/6/06, jon@... <jon@...> wrote:

                > This depends. If you can simply over-ride some settings or re-define a
                > macro then the myXXXX.emf should be used to do this. If the changes are
                > more widespread then it is better to copy the whole macro file to your
                > user directory and then modify it.

                i see.

                > Do not change the system macros because
                > if you mess up then you cannot fall back on the originals.

                yes, i've faced something like that just recently when upgrading to
                '06 release :) (and as a result, i was using diff a lot to find all my
                changes :)).

                > Put "> -!- document -!-" in the top of the document or add the following
                > to the end of your <user>.emf
                >
                > add-file-hook ".txt .doc" fhook-doc

                thank you, Jon!



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