Skip to content

Commit

Permalink
Updated runtime files.
Browse files Browse the repository at this point in the history
  • Loading branch information
brammool committed Mar 26, 2016
1 parent c4dcd60 commit 4f3f668
Show file tree
Hide file tree
Showing 10 changed files with 232 additions and 120 deletions.
2 changes: 1 addition & 1 deletion runtime/doc/autocmd.txt
@@ -1,4 +1,4 @@
*autocmd.txt* For Vim version 7.4. Last change: 2015 Dec 05
*autocmd.txt* For Vim version 7.4. Last change: 2016 Mar 26


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down
97 changes: 63 additions & 34 deletions runtime/doc/channel.txt
@@ -1,4 +1,4 @@
*channel.txt* For Vim version 7.4. Last change: 2016 Mar 15
*channel.txt* For Vim version 7.4. Last change: 2016 Mar 26


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -120,24 +120,13 @@ Use |ch_status()| to see if the channel could be opened.

{address} has the form "hostname:port". E.g., "localhost:8765".

{options} is a dictionary with optional entries:
{options} is a dictionary with optional entries: *channel-open-options*

"mode" can be: *channel-mode*
"json" - Use JSON, see below; most convenient way. Default.
"js" - Use JS (JavaScript) encoding, more efficient than JSON.
"nl" - Use messages that end in a NL character
"raw" - Use raw messages
*in_mode* *out_mode* *err_mode*
"in_mode" mode specifically for stdin, only when using pipes
"out_mode" mode specifically for stdout, only when using pipes
"err_mode" mode specifically for stderr, only when using pipes
Note: when setting "mode" the part specific mode is
overwritten. Therefore set "mode" first and the part specific
mode later.

Note: when writing to a file or buffer and when reading from a
buffer NL mode is used by default.

*channel-callback* *E921*
"callback" A function that is called when a message is received that is
not handled otherwise. It gets two arguments: the channel
Expand All @@ -155,16 +144,8 @@ Use |ch_status()| to see if the channel could be opened.
as a string.

For all callbacks: Use |function()| to bind it to arguments
and/or a dictionary.
*out_cb*
"out_cb" A function like "callback" but used for stdout. Only for when
the channel uses pipes. When "out_cb" wasn't set the channel
callback is used.
*err_cb*
"err_cb" A function like "callback" but used for stderr. Only for when
the channel uses pipes. When "err_cb" wasn't set the channel
callback is used.

and/or a Dictionary. Or use the form "dict.function" to bind
the Dictionary.
*close_cb*
"close_cb" A function that is called when the channel gets closed, other
than by calling ch_close(). It should be defined like this: >
Expand All @@ -178,16 +159,10 @@ Use |ch_status()| to see if the channel could be opened.
actually uses a 1 msec timeout, that is required on many
systems. Use a larger value for a remote server, e.g. 10
msec at least.

*channel-timeout*
"timeout" The time to wait for a request when blocking, E.g. when using
ch_evalexpr(). In milliseconds. The default is 2000 (2
seconds).
*out_timeout* *err_timeout*
"out_timeout" Timeout for stdout. Only when using pipes.
"err_timeout" Timeout for stderr. Only when using pipes.
Note: when setting "timeout" the part specific mode is
overwritten. Therefore set "timeout" first and the part
specific mode later.

When "mode" is "json" or "js" the "callback" is optional. When omitted it is
only possible to receive a message after sending one.
Expand Down Expand Up @@ -215,6 +190,13 @@ pipes are used (stdin/stdout/stderr) they are all closed. This might not be
what you want! Stopping the job with job_stop() might be better.
All readahead is discarded, callbacks will no longer be invoked.

Note that a channel is closed in three stages:
- The I/O ends, log message: "Closing channel". There can still be queued
messages to read or callbacks to invoke.
- The readahead is cleared, log message: "Clearing channel". Some variables
may still reference the channel.
- The channel is freed, log message: "Freeing channel".

When the channel can't be opened you will get an error message. There is a
difference between MS-Windows and Unix: On Unix when the port doesn't exist
ch_open() fails quickly. On MS-Windows "waittime" applies.
Expand Down Expand Up @@ -326,6 +308,9 @@ completion or error. You could use functions in an |autoload| script:

You can also use "call |feedkeys()|" to insert any key sequence.

When there is an error a message is written to the channel log, if it exists,
and v:errmsg is set to the error.


Command "normal" ~

Expand Down Expand Up @@ -428,6 +413,23 @@ To read all output from a RAW channel that is available: >
To read the error output: >
let output = ch_readraw(channel, {"part": "err"})
ch_read() and ch_readraw() use the channel timeout. When there is nothing to
read within that time an empty string is returned. To specify a different
timeout in msec use the "timeout" option:
{"timeout": 123} ~
To read from the error output use the "part" option:
{"part": "err"} ~
To read a message with a specific ID, on a JS or JSON channel:
{"id": 99} ~
When no ID is specified or the ID is -1, the first message is returned. This
overrules any callback waiting for this message.

For a RAW channel this returns whatever is available, since Vim does not know
where a message ends.
For a NL channel this returns one message.
For a JS or JSON channel this returns one decoded message.
This includes any sequence number.

==============================================================================
8. Starting a job with a channel *job-start* *job*

Expand Down Expand Up @@ -524,15 +526,31 @@ job_setoptions(job, {options}). Many options can be used with the channel
related to the job, using ch_setoptions(channel, {options}).
See |job_setoptions()| and |ch_setoptions()|.

*in_mode* *out_mode* *err_mode*
"in_mode" mode specifically for stdin, only when using pipes
"out_mode" mode specifically for stdout, only when using pipes
"err_mode" mode specifically for stderr, only when using pipes
See |channel-mode| for the values.

Note: when setting "mode" the part specific mode is
overwritten. Therefore set "mode" first and the part
specific mode later.

Note: when writing to a file or buffer and when
reading from a buffer NL mode is used by default.

*job-callback*
"callback": handler Callback for something to read on any part of the
channel.
*job-out_cb*
*job-out_cb* *out_cb*
"out_cb": handler Callback for when there is something to read on
stdout.
*job-err_cb*
stdout. Only for when the channel uses pipes. When
"out_cb" wasn't set the channel callback is used.

*job-err_cb* *err_cb*
"err_cb": handler Callback for when there is something to read on
stderr.
stderr. Only for when the channel uses pipes. When
"err_cb" wasn't set the channel callback is used.
*job-close_cb*
"close_cb": handler Callback for when the channel is closed. Same as
"close_cb" on ch_open().
Expand All @@ -542,6 +560,17 @@ See |job_setoptions()| and |ch_setoptions()|.
Vim checks about every 10 seconds for jobs that ended.
The callback can also be triggered by calling
|job_status()|.
*job-timeout*
"timeout" The time to wait for a request when blocking, E.g.
when using ch_evalexpr(). In milliseconds. The
default is 2000 (2 seconds).
*out_timeout* *err_timeout*
"out_timeout" Timeout for stdout. Only when using pipes.
"err_timeout" Timeout for stderr. Only when using pipes.
Note: when setting "timeout" the part specific mode is
overwritten. Therefore set "timeout" first and the
part specific mode later.

*job-stoponexit*
"stoponexit": {signal} Send {signal} to the job when Vim exits. See
|job_stop()| for possible values.
Expand Down
72 changes: 20 additions & 52 deletions runtime/doc/eval.txt
@@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.4. Last change: 2016 Mar 20
*eval.txt* For Vim version 7.4. Last change: 2016 Mar 26


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -2716,13 +2716,6 @@ ch_close({handle}) *ch_close()*
Close {handle}. See |channel-close|.
{handle} can be Channel or a Job that has a Channel.

Note that a channel is closed in three stages:
- The I/O ends, log message: "Closing channel". There can
still be queued messages to read or callbacks to invoke.
- The readahead is cleared, log message: "Clearing channel".
Some variables may still reference the channel.
- The channel is freed, log message: "Freeing channel".

{only available when compiled with the |+channel| feature}

ch_evalexpr({handle}, {expr} [, {options}]) *ch_evalexpr()*
Expand All @@ -2732,7 +2725,8 @@ ch_evalexpr({handle}, {expr} [, {options}]) *ch_evalexpr()*
{handle} can be Channel or a Job that has a Channel.
*E917*
{options} must be a Dictionary. It must not have a "callback"
entry. It can have a "timeout" entry.
entry. It can have a "timeout" entry to specify the timeout
for this specific request.

ch_evalexpr() waits for a response and returns the decoded
expression. When there is an error or timeout it returns an
Expand Down Expand Up @@ -2816,65 +2810,34 @@ ch_logfile({fname} [, {mode}]) *ch_logfile()*

ch_open({address} [, {options}]) *ch_open()*
Open a channel to {address}. See |channel|.
Returns a Channel. Use |ch_status()| to check for
failure.
Returns a Channel. Use |ch_status()| to check for failure.

{address} has the form "hostname:port", e.g.,
"localhost:8765".

If {options} is given it must be a |Dictionary|. The optional
items are:
mode "raw", "js" or "json".
Default "json".
callback function to call for requests with a zero
sequence number. See |channel-callback|.
Default: none.
waittime Specify connect timeout as milliseconds.
Negative means forever.
Default: 0 (don't wait)
timeout Specify response read timeout value in
milliseconds.
Default: 2000.
If {options} is given it must be a |Dictionary|.
See |channel-open-options|.

{only available when compiled with the |+channel| feature}

ch_read({handle} [, {options}]) *ch_read()*
Read from {handle} and return the received message.
{handle} can be Channel or a Job that has a Channel.

This uses the channel timeout. When there is nothing to read
within that time an empty string is returned. To specify a
different timeout in msec use the "timeout" option:
{"timeout": 123} ~
To read from the error output use the "part" option:
{"part": "err"} ~
To read a message with a specific ID, on a JS or JSON channel:
{"id": 99} ~
When no ID is specified or the ID is -1, the first message is
returned. This overrules any callback waiting for this
message.

For a RAW channel this returns whatever is available, since
Vim does not know where a message ends.
For a NL channel this returns one message.
For a JS or JSON channel this returns one decoded message.
This includes any sequence number.
See |channel-more|.
{only available when compiled with the |+channel| feature}

ch_readraw({handle} [, {options}]) *ch_readraw()*
Like ch_read() but for a JS and JSON channel does not decode
the message.
the message. See |channel-more|.
{only available when compiled with the |+channel| feature}

ch_sendexpr({handle}, {expr} [, {options}]) *ch_sendexpr()*
Send {expr} over {handle}. The {expr} is encoded
according to the type of channel. The function cannot be used
with a raw channel. See |channel-use|. *E912*
with a raw channel.
See |channel-use|. *E912*
{handle} can be Channel or a Job that has a Channel.

{options} must be a Dictionary. The "callback" item is a
Funcref or the name of a function it is invoked when the
response is received. See |channel-callback|.
Without "callback" the channel handler is invoked, otherwise
any received message is dropped.

{only available when compiled with the |+channel| feature}

ch_sendraw({handle}, {string} [, {options}]) *ch_sendraw()*
Expand Down Expand Up @@ -6675,13 +6638,17 @@ string({expr}) Return {expr} converted to a String. If {expr} is a Number,
Float, String or a composition of them, then the result can be
parsed back with |eval()|.
{expr} type result ~
String 'string'
String 'string' (single quotes are doubled)
Number 123
Float 123.123456 or 1.123456e8
Funcref function('name')
List [item, item]
Dictionary {key: value, key: value}
Note that in String values the ' character is doubled.

When a List or Dictionary has a recursive reference it is
replaced by "[...]" or "{...}". Using eval() on the result
will then fail.

Also see |strtrans()|.

*strlen()*
Expand Down Expand Up @@ -7665,6 +7632,7 @@ unix Unix version of Vim.
user_commands User-defined commands.
vertsplit Compiled with vertically split windows |:vsplit|.
vim_starting True while initial source'ing takes place. |startup|
*vim_starting*
viminfo Compiled with viminfo support.
virtualedit Compiled with 'virtualedit' option.
visual Compiled with Visual mode.
Expand Down
4 changes: 3 additions & 1 deletion runtime/doc/helphelp.txt
@@ -1,4 +1,4 @@
*helphelp.txt* For Vim version 7.4. Last change: 2016 Mar 12
*helphelp.txt* For Vim version 7.4. Last change: 2016 Mar 26


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -208,9 +208,11 @@ command: >
sorted.
When there are duplicates an error message is given.
An existing tags file is silently overwritten.

The optional "++t" argument forces adding the
"help-tags" tag. This is also done when the {dir} is
equal to $VIMRUNTIME/doc.

To rebuild the help tags in the runtime directory
(requires write permission there): >
:helptags $VIMRUNTIME/doc
Expand Down
9 changes: 6 additions & 3 deletions runtime/doc/options.txt
@@ -1,4 +1,4 @@
*options.txt* For Vim version 7.4. Last change: 2016 Mar 19
*options.txt* For Vim version 7.4. Last change: 2016 Mar 24


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -2292,6 +2292,8 @@ A jump table for the options with a short description can be found at |Q_op|.
different. The whole undo file is encrypted, not just
the pieces of text.

You should use "blowfish2", also to re-encrypt older files.

When reading an encrypted file 'cryptmethod' will be set automatically
to the detected method of the file being read. Thus if you write it
without changing 'cryptmethod' the same method will be used.
Expand Down Expand Up @@ -3030,8 +3032,8 @@ A jump table for the options with a short description can be found at |Q_op|.
file only, the option is not changed.
When 'binary' is set, the value of 'fileformats' is not used.

Note that when Vim starts up with an empty buffer this option is not
used. Set 'fileformat' in your .vimrc instead.
When Vim starts up with an empty buffer the first item is used. You
can overrule this by setting 'fileformat' in your .vimrc.

For systems with a Dos-like <EOL> (<CR><NL>), when reading files that
are ":source"ed and for vimrc files, automatic <EOL> detection may be
Expand Down Expand Up @@ -5115,6 +5117,7 @@ A jump table for the options with a short description can be found at |Q_op|.
written. A ":set nomodified" command also resets the original
values to the current values and the 'modified' option will be
reset.
Similarly for 'eol' and 'bomb'.
This option is not set when a change is made to the buffer as the
result of a BufNewFile, BufRead/BufReadPost, BufWritePost,
FileAppendPost or VimLeave autocommand event. See |gzip-example| for
Expand Down

0 comments on commit 4f3f668

Please sign in to comment.