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

Re: Adding error_message function?

Expand Messages
  • Bram Moolenaar
    ... Looks OK. ... This can be removed, because the function can t be called for another Ex command. I never add checks for simple programming mistakes like
    Message 1 of 8 , Dec 1, 2000
      Mark Waggoner wrote:

      > I don't know if this fully meets the "proper" test, but here's a patch
      > that implements and documents:
      >
      > :echoerr
      >
      > and
      >
      > :echomsg

      Looks OK.

      > In particular, there is one error message (about an incorrect command
      > calling ex_echomsg) that should probably be more descriptive and go
      > through the translation thing-a-ma-jig

      This can be removed, because the function can't be called for another
      Ex command. I never add checks for simple programming mistakes like this.

      > and I'd be interested in comments on whether the method I used to collect
      > all the arguments into a string looks acceptable.

      Using a growarray will be easier. See ex_execute() for an example.
      Actually, it looks like ex_execute() does something very similar. Can't these
      two functions be merged? They functionally do the same thing with their
      argument.

      --
      Q: Is selling software the same as selling hardware?
      A: No, good hardware is sold new, good software has already been used by many.

      /// Bram Moolenaar Bram@... http://www.moolenaar.net \\\
      \\\ Vim: http://www.vim.org ICCF Holland: http://iccf-holland.org ///
    • Mark Waggoner
      On Fri, 1 Dec 2000, Bram Moolenaar wrote:Mark Waggoner wrote: I don t know if this fully meets the proper test, but here s a patch that
      Message 2 of 8 , Dec 1, 2000
        On Fri, 1 Dec 2000, Bram Moolenaar wrote:

        > Mark Waggoner wrote:
        >
        > > I don't know if this fully meets the "proper" test, but here's a patch
        > > that implements and documents:
        > >
        > > :echoerr
        > >
        > > and
        > >
        > > :echomsg
        >
        > Looks OK.
        >
        > > In particular, there is one error message (about an incorrect command
        > > calling ex_echomsg) that should probably be more descriptive and go
        > > through the translation thing-a-ma-jig
        >
        > This can be removed, because the function can't be called for another
        > Ex command. I never add checks for simple programming mistakes like this.
        >
        > > and I'd be interested in comments on whether the method I used to collect
        > > all the arguments into a string looks acceptable.
        >
        > Using a growarray will be easier. See ex_execute() for an example.
        > Actually, it looks like ex_execute() does something very similar. Can't these
        > two functions be merged? They functionally do the same thing with their
        > argument.

        The force (of code familiarity) is with you!

        Attached is a new improved patch which re-uses the ex_execute()
        function instead of creating a whole new function for the :echoerr and
        :echomsg commands.

        --------------------------------------------------------------------------
        Mark Waggoner waggoner@... (503) 712-3335
        But I think the most likely reason of all
        May have been that his heart was two sizes too small
      • Bram Moolenaar
        ... Ah, that s a lot simpler. I ll include it, thanks! -- ARTHUR: You fight with the strength of many men, Sir knight. I am Arthur, King of the Britons.
        Message 3 of 8 , Dec 1, 2000
          Mark Waggoner wrote:

          > > Using a growarray will be easier. See ex_execute() for an example.
          > > Actually, it looks like ex_execute() does something very similar. Can't
          > > these two functions be merged? They functionally do the same thing with
          > > their argument.
          >
          > The force (of code familiarity) is with you!
          >
          > Attached is a new improved patch which re-uses the ex_execute()
          > function instead of creating a whole new function for the :echoerr and
          > :echomsg commands.

          Ah, that's a lot simpler. I'll include it, thanks!

          --
          ARTHUR: You fight with the strength of many men, Sir knight.
          I am Arthur, King of the Britons. [pause]
          I seek the finest and the bravest knights in the land to join me
          in my Court of Camelot. [pause]
          You have proved yourself worthy; will you join me? [pause]
          You make me sad. So be it. Come, Patsy.
          BLACK KNIGHT: None shall pass.
          The Quest for the Holy Grail (Monty Python)

          /// Bram Moolenaar Bram@... http://www.moolenaar.net \\\
          \\\ Vim: http://www.vim.org ICCF Holland: http://iccf-holland.org ///
        Your message has been successfully submitted and would be delivered to recipients shortly.