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

13915Re: Suggestion [was: Re: Easter exercise for the reader]

Expand Messages
  • Flemming Madsen
    May 1, 2000
    • 0 Attachment
      Bram Moolenaar wrote:
      > Flemming Madsen wrote:
      > [about switching of messages for a sequence of commands]
      > > Bram Moolenaar wrote:
      > > > My main reason to not want to include a way to disable messages in a
      > > > general way, is that people will switch it on, forget about it, and
      > > > complain that something doesn't work. It's even worse when some
      > > > system-wide vimrc file sets the option for you.
      > > >
      > > > Rule #1: Don't give somebody a tool that he's going to hurt himself with.
      > >
      > > Ok, that explains why :redirect is not actually a redirect :-)
      > > If it was (or had an option for it) we would already have the feature
      > > that most (?) people seem to expect from the silent command.
      > Yes, :redirect doesn't work very nice. I'm still looking for a solution.
      > Perhaps by not echoing until the user is asked to hit a key. Still, any
      > prompt would be missing then. How do you know you have to hit return if the
      > hit-return prompt isn't there? Probably have to remember the last message and
      > output that before waiting for the key.
      > > I would like to propose a combination of both worlds:
      > >
      > > :divert[!] reg command Redirect message output of 'command' to register
      > > 'reg'. Append to the contents of the registers {a-z}
      > > if its name is given uppercase {A-Z}. If [!] if
      > > given, messages will also appear on the screen.
      > > Use the "black hole" register '_' for discarding
      > > output altogether.
      > I think ":silent redir" can be used for this. Then it can work exactly like
      > ":redir", but without echoing the messages. The problem mentioned above will
      > probably have to be solved anyway, and it avoids the need for another command.
      > Hopefully the script writer remembers that any output from the script will be
      > redirected too, an ":echo "hello"" won't work!
      Yes, if :silent would cause :redir to stop messages from going to the screen,
      this would fill the void nicely. Of course it _does_ enable your .vimrc file
      or a faulty/rogue function to disable/hide messages on a global basis.
      That's fine with me though. :redir END is the programmers responsibility anyway.

    • Show all 21 messages in this topic