]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(doc): document vim-script library function
authorChristian Brabandt <cb@256bit.org>
Sun, 5 Nov 2023 09:45:12 +0000 (10:45 +0100)
committerChristian Brabandt <cb@256bit.org>
Sun, 5 Nov 2023 09:45:49 +0000 (10:45 +0100)
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/doc/eval.txt
runtime/doc/pi_gzip.txt
runtime/doc/pi_zip.txt
runtime/doc/tags

index e7152bb6708195fbb9f5a96016080ee13acc8582..c91145ce7379c84a45b4fd133bf949e42b15ad55 100644 (file)
@@ -1,4 +1,4 @@
-*eval.txt*     For Vim version 9.0.  Last change: 2023 Jun 01
+*eval.txt*     For Vim version 9.0.  Last change: 2023 Nov 05
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -36,6 +36,7 @@ a remark is given.
 11. No +eval feature           |no-eval-feature|
 12. The sandbox                        |eval-sandbox|
 13. Textlock                   |textlock|
+14. Vim script library         |vim-script-library|
 
 Testing support is documented in |testing.txt|.
 Profiling is documented at |profiling|.
@@ -4801,5 +4802,37 @@ This is not allowed when the textlock is active:
        - closing a window or quitting Vim
        - etc.
 
+==============================================================================
+14. Vim script library                                 *vim-script-library*
+
+Vim comes bundled with a Vim script library, that can be used by runtime,
+script authors.  Currently, it only includes very few functions, but it may
+grow over time.
+
+The functions are available as |Vim9-script| as well as using legacy vim
+script (to be used for non Vim 9.0 versions and Neovim).
+
+                                                       *dist#vim* *dist#vim9*
+The functions make use of the autoloaded prefix "dist#vim" (for legacy Vim script and
+Neovim) and "dist#vim9" for Vim9 script.
+
+The following functions are available:
+
+dist#vim#IsSafeExecutable(filetype, executable) ~
+dist#vim9#IsSafeExecutable(filetype:string, executable:string): bool ~
+
+This function takes a filetype and an executable and checks whether it is safe
+to execute the given executable.  For security reasons users may not want to
+have Vim execute random executables or may have forbidden to do so for
+specific filetypes by setting the "<filetype>_exec" variable (|plugin_exec|).
+
+It returns |true| or |false| to indicate whether the plugin should run the given
+exectuable.  It takes the following arguments:
+
+       argument        type ~
+
+       filetype        string
+       executable      string
+
 
  vim:tw=78:ts=8:noet:ft=help:norl:
index e5d5ffb25f52423418bfc1606a0ad83d3c6a7147..c5d8ab0d84214064adf24d2eca210eaead4b4779 100644 (file)
@@ -1,4 +1,4 @@
-*pi_gzip.txt*   For Vim version 9.0.  Last change: 2019 May 05
+*pi_gzip.txt*   For Vim version 9.0.  Last change: 2023 Nov 05
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -12,9 +12,17 @@ The functionality mentioned here is a |standard-plugin|.
 This plugin is only available if 'compatible' is not set.
 You can avoid loading this plugin by setting the "loaded_gzip" variable: >
        :let loaded_gzip = 1
+<
+                                                       *g:gzip_exec*
+
+For security reasons, one may prevent that Vim runs executables automatically
+when opening a buffer.  This option (default: "1") can be used to prevent
+executing the executables command when set to "0": >
+       :let g:gzip_exec = 0
+<
 
 ==============================================================================
-1. Autocommands                                                *gzip-autocmd*
+2. Autocommands                                                *gzip-autocmd*
 
 The plugin installs autocommands to intercept reading and writing of files
 with these extensions:
index 8673324e110c464b11c8174ef26f373dbc2de418..14ae3401553aac4bb3c1173550f826ea8852752e 100644 (file)
@@ -1,4 +1,4 @@
-*pi_zip.txt*   For Vim version 9.0.  Last change: 2023 Mar 12
+*pi_zip.txt*   For Vim version 9.0.  Last change: 2023 Nov 05
 
                                +====================+
                                | Zip File Interface |
@@ -69,6 +69,13 @@ Copyright: Copyright (C) 2005-2015 Charles E Campbell         *zip-copyright*
    This option specifies the program (and any options needed) used to
    extract a file from a zip archive.  By default, >
        let g:zip_extractcmd= g:zip_unzipcmd
+<
+                                                       *g:zip_exec*
+   For security reasons, one may prevent that Vim runs executables
+   automatically when opening a buffer.  This option (default: "1")
+   can be used to prevent executing the "unzip" command when set to
+   "0": >
+       let g:zip_exec=0
 <
    PREVENTING LOADING~
 
index fde5bda1a4a4a4a49ffb4d056fab946e32333e4d..f450288fd8df15ee16dce7a125cf9bdde91ed24a 100644 (file)
@@ -6758,6 +6758,8 @@ dircolors.vim     syntax.txt      /*dircolors.vim*
 dis    motion.txt      /*dis*
 disable-menus  gui.txt /*disable-menus*
 discard        editing.txt     /*discard*
+dist#vim       eval.txt        /*dist#vim*
+dist#vim9      eval.txt        /*dist#vim9*
 distribute-script      usr_51.txt      /*distribute-script*
 distributed-plugins    usr_05.txt      /*distributed-plugins*
 distribution   intro.txt       /*distribution*
@@ -7422,6 +7424,7 @@ g:gnat.Project_File       ft_ada.txt      /*g:gnat.Project_File*
 g:gnat.Set_Project_File()      ft_ada.txt      /*g:gnat.Set_Project_File()*
 g:gnat.Tags()  ft_ada.txt      /*g:gnat.Tags()*
 g:gnat.Tags_Command    ft_ada.txt      /*g:gnat.Tags_Command*
+g:gzip_exec    pi_gzip.txt     /*g:gzip_exec*
 g:html_charset_override        syntax.txt      /*g:html_charset_override*
 g:html_diff_one_file   syntax.txt      /*g:html_diff_one_file*
 g:html_dynamic_folds   syntax.txt      /*g:html_dynamic_folds*
@@ -7616,6 +7619,7 @@ g:vimsyn_minlines syntax.txt      /*g:vimsyn_minlines*
 g:vimsyn_noerror       syntax.txt      /*g:vimsyn_noerror*
 g:yaml_schema  syntax.txt      /*g:yaml_schema*
 g:zipPlugin_ext        pi_zip.txt      /*g:zipPlugin_ext*
+g:zip_exec     pi_zip.txt      /*g:zip_exec*
 g:zip_extractcmd       pi_zip.txt      /*g:zip_extractcmd*
 g:zip_nomax    pi_zip.txt      /*g:zip_nomax*
 g:zip_shq      pi_zip.txt      /*g:zip_shq*
@@ -10987,6 +10991,7 @@ vim-modes       intro.txt       /*vim-modes*
 vim-modes-intro        intro.txt       /*vim-modes-intro*
 vim-raku       ft_raku.txt     /*vim-raku*
 vim-script-intro       usr_41.txt      /*vim-script-intro*
+vim-script-library     eval.txt        /*vim-script-library*
 vim-use        intro.txt       /*vim-use*
 vim-variable   eval.txt        /*vim-variable*
 vim.b  if_lua.txt      /*vim.b*