Ramel Eshed wrote:

> On Wednesday, May 25, 2016 at 11:49:48 PM UTC+3, Bram Moolenaar wrote:
> > Ramel Eshed wrote:
> > 
> > > Is there any way to use a nomodifiable buffer as an output buffer for
> > > a job? If not, I think that it could be very useful.
> > 
> > The idea of making a buffer nomodifiable is that it's read-only, the
> > contents is not supposed to change.  That conflicts with writing to the
> > buffer.
> > 
> > -- 
> > hundred-and-one symptoms of being an internet addict:
> > 11. You find yourself typing "com" after every period when using a word
> >     processor.com
> > 
> >  /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
> > ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
> > \\\  an exciting new programming language -- http://www.Zimbu.org        ///
> >  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
> 
> Hi Bram,
> 
> It seems to me that in most cases plugins developers will want to
> protect the job's output buffer from being modified by the user. I
> know that in all the use cases I can think about now I want to set
> this buffer to be read-only or at least to be able to control when the
> user can modify it. A few examples might be: Live log file viewer,
> some sort of console, display search results (like I did in the plugin
> I mentioned in the other thread).

Well, running a plugin is also triggered by the user, thus it's a subtle
difference.

In most cases the user will know not to modify a buffer that is used by
a plugin.  Just like you would not change a log file, etc.

Perhaps you can guard modifications, and set/reset 'modifiable' at the
right moment.  Directly redirecting to the buffer doesn't work then
though.

-- 
hundred-and-one symptoms of being an internet addict:
23. You can't call your mother...she doesn't have a modem.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui