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

Re: Patch to try out: ":unsilent"

Expand Messages
  • Matt Wozniski
    ... It seems like a good idea, if only for the symmetry. Any chance for another change to how :silent works, though, while we re at it? I d find it very
    Message 1 of 8 , Jul 1, 2009
      On Wed, Jul 1, 2009 at 12:55 PM, Bram Moolenaar wrote:
      >
      > Any comments on adding the ":unsilent" command modifier?

      It seems like a good idea, if only for the symmetry. Any chance for
      another change to how :silent works, though, while we're at it? I'd
      find it very useful in my own scripts if

      :silent echomsg "hello"

      could be used to write a message to the :messages log without
      displaying it to the screen. I was surprised when I found out that
      this didn't work, but of course in retrospect that would have required
      that :echomsg have been special-cased in the code. Maybe we could add
      a :msgonly modifier that behaves like :silent but does add to the
      message history?

      ~Matt

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Bram Moolenaar
      ... The message history is to store displayed messages. If a message isn t displayed then it should not be in the history. If you want to log some things to
      Message 2 of 8 , Jul 2, 2009
        Matt Wozniski wrote:

        > On Wed, Jul 1, 2009 at 12:55 PM, Bram Moolenaar wrote:
        > >
        > > Any comments on adding the ":unsilent" command modifier?
        >
        > It seems like a good idea, if only for the symmetry. Any chance for
        > another change to how :silent works, though, while we're at it? I'd
        > find it very useful in my own scripts if
        >
        > :silent echomsg "hello"
        >
        > could be used to write a message to the :messages log without
        > displaying it to the screen. I was surprised when I found out that
        > this didn't work, but of course in retrospect that would have required
        > that :echomsg have been special-cased in the code. Maybe we could add
        > a :msgonly modifier that behaves like :silent but does add to the
        > message history?

        The message history is to store displayed messages. If a message isn't
        displayed then it should not be in the history.

        If you want to log some things to see what your plugin is doing you can
        use a global List and append to that.

        --
        The real
        trick is
        this: to
        keep the
        lines as
        short as
        possible
        and keep
        the size
        the same
        yet free
        from the
        need for
        hyphena-
        Dammit!! (Matthew Winn)

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ download, build and distribute -- http://www.A-A-P.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_dev" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Matt Wozniski
        Oops, accidentally sent this to Bram off-list. ... It just seems that it would be nicer if each plugin didn t need to roll its own ad-hoc logging solution.
        Message 3 of 8 , Jul 2, 2009
          Oops, accidentally sent this to Bram off-list.

          Bram Moolenaar wrote:
          >
          > Matt Wozniski wrote:
          >
          >> Bram Moolenaar wrote:
          >> >
          >> > Any comments on adding the ":unsilent" command modifier?
          >>
          >> Maybe we could add
          >> a :msgonly modifier that behaves like :silent but does add to the
          >> message history?
          >
          > The message history is to store displayed messages.  If a message isn't
          > displayed then it should not be in the history.
          >
          > If you want to log some things to see what your plugin is doing you can
          > use a global List and append to that.

          It just seems that it would be nicer if each plugin didn't need to
          roll its own ad-hoc logging solution.  When something goes wrong, a
          lot of experienced vim users will instinctively check :messages to see
          if an error managed to slip by them unnoticed, so the message history
          seems like an intuitive place to do logging.  It not only would save
          plugin authors the need to roll their own logging solution, but would
          save plugin users from having to learn which plugins do provide their
          own logging, and learning how to view the log for each.

          It's not something I feel terribly strongly about one way or the
          other, but I definitely think that extending the message history from
          it's current definition to "A list of messages that can give you
          insight about what happened recently" would be more useful.

          ~Matt

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_dev" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Ingo Karkat
          ... I guessed you would want this for debugging / logging, though one has to differentiate: If the plugin really needs to inform the user about something, ...
          Message 4 of 8 , Jul 2, 2009
            On 02-Jul-09 22:47, Matt Wozniski wrote:
            > Bram Moolenaar wrote:
            >> Matt Wozniski wrote:
            >>> Bram Moolenaar wrote:
            >>>> Any comments on adding the ":unsilent" command modifier?
            >>> Maybe we could add
            >>> a :msgonly modifier that behaves like :silent but does add to the
            >>> message history?
            >> The message history is to store displayed messages. If a message isn't
            >> displayed then it should not be in the history.
            >>
            >> If you want to log some things to see what your plugin is doing you can
            >> use a global List and append to that.
            >
            > It just seems that it would be nicer if each plugin didn't need to
            > roll its own ad-hoc logging solution. When something goes wrong, a
            > lot of experienced vim users will instinctively check :messages to see
            > if an error managed to slip by them unnoticed, so the message history
            > seems like an intuitive place to do logging. It not only would save
            > plugin authors the need to roll their own logging solution, but would
            > save plugin users from having to learn which plugins do provide their
            > own logging, and learning how to view the log for each.
            >
            > It's not something I feel terribly strongly about one way or the
            > other, but I definitely think that extending the message history from
            > it's current definition to "A list of messages that can give you
            > insight about what happened recently" would be more useful.

            I guessed you would want this for debugging / logging, though one has to
            differentiate: If the plugin really needs to inform the user about something,
            :echomsg fits perfectly, and the message should also be visible. If this is
            internal, implementation-specific tracing stuff for debugging by plugin writers
            or troubleshooting, this should normally be hidden from view.

            For the latter purpose, I use :echomsg during development, and comment out these
            before moving the script into production. I know about Dr.Chip's Decho plugin,
            which provides much more functionality in that area. Of course, as a plugin
            author, I would love to have :tracemsg, :set trace=myscript,yourscript and :set
            tracefile=/tmp/trace.log commands built-in. But I don't think these should be
            combined into the :messages functionality.

            -- just my two cents, ingo
            --
            -- Ingo Karkat -- /^-- /^-- /^-- /^-- /^-- /^-- http://ingo-karkat.de/ --
            -- http://vim.sourceforge.net/account/profile.php?user_id=9713 --


            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_dev" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • Bram Moolenaar
            ... Look at the stuff that Charles Campbell made. I don t think that uniform logging will help, really. I mean, what s simpler than: let g:mylog = [] ...
            Message 5 of 8 , Jul 3, 2009
              Matt Wozniski wrote:

              > Oops, accidentally sent this to Bram off-list.
              >
              > Bram Moolenaar wrote:
              > >
              > > Matt Wozniski wrote:
              > >
              > >> Bram Moolenaar wrote:
              > >> >
              > >> > Any comments on adding the ":unsilent" command modifier?
              > >>
              > >> Maybe we could add
              > >> a :msgonly modifier that behaves like :silent but does add to the
              > >> message history?
              > >
              > > The message history is to store displayed messages. Â If a message isn't
              > > displayed then it should not be in the history.
              > >
              > > If you want to log some things to see what your plugin is doing you can
              > > use a global List and append to that.
              >
              > It just seems that it would be nicer if each plugin didn't need to
              > roll its own ad-hoc logging solution. Â When something goes wrong, a
              > lot of experienced vim users will instinctively check :messages to see
              > if an error managed to slip by them unnoticed, so the message history
              > seems like an intuitive place to do logging. Â It not only would save
              > plugin authors the need to roll their own logging solution, but would
              > save plugin users from having to learn which plugins do provide their
              > own logging, and learning how to view the log for each.
              >
              > It's not something I feel terribly strongly about one way or the
              > other, but I definitely think that extending the message history from
              > it's current definition to "A list of messages that can give you
              > insight about what happened recently" would be more useful.

              Look at the stuff that Charles Campbell made.

              I don't think that "uniform logging" will help, really. I mean, what's
              simpler than:

              let g:mylog = []

              ...

              call add(g:mylog, "I did something!")

              ...

              echo g:mylog

              --
              hundred-and-one symptoms of being an internet addict:
              53. To find out what time it is, you send yourself an e-mail and check the
              "Date:" field.

              /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
              /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
              \\\ download, build and distribute -- http://www.A-A-P.org ///
              \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_dev" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            Your message has been successfully submitted and would be delivered to recipients shortly.