From 142c34d6de584bafd5f55034840c5e2f59c3c104 Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Mon, 3 Aug 2015 21:44:27 +0300 Subject: [PATCH] Added documentation strings to the commands that didn't have one already --- rc/autorestore.kak | 4 ++-- rc/autowrap.kak | 6 +++--- rc/clang.kak | 14 +++++++------- rc/ctags.kak | 16 ++++++++-------- rc/git-tools.kak | 2 +- rc/golang.kak | 4 ++-- rc/grep.kak | 2 +- rc/jedi.kak | 6 +++--- rc/make.kak | 2 +- rc/man.kak | 2 +- 10 files changed, 29 insertions(+), 29 deletions(-) diff --git a/rc/autorestore.kak b/rc/autorestore.kak index f505044a..6f75d15d 100644 --- a/rc/autorestore.kak +++ b/rc/autorestore.kak @@ -36,7 +36,7 @@ def -hidden _autorestore-restore-buffer %{ } ## Remove all the backups that have been created for the current buffer -def autorestore-purge-backups %{ +def autorestore-purge-backups -docstring "Remove all the backups of the current buffer" %{ nop %sh{ buffer_basename="${kak_bufname##*/}" buffer_dirname=$(dirname "${kak_bufname}") @@ -46,7 +46,7 @@ def autorestore-purge-backups %{ } ## If for some reason, backup files need to be ignored -def autorestore-disable %{ +def autorestore-disable -docstring "Disable automatic backup recovering" %{ rmhooks global autorestore } diff --git a/rc/autowrap.kak b/rc/autowrap.kak index 17d11da1..42d384b1 100644 --- a/rc/autowrap.kak +++ b/rc/autowrap.kak @@ -2,7 +2,7 @@ decl int autowrap_column 80 ## Automatically wrap the selection -def autowrap-selection %{ +def autowrap-selection -docstring "Wrap the selection" %{ try %{ ## : ensure that the cursor is located after the anchor, then reverse the ## selection (make sure the cursor is at the beginning of the selection) @@ -20,7 +20,7 @@ def autowrap-selection %{ } ## Add a hook that will wrap the entire line every time a key is pressed -def autowrap-enable %{ +def autowrap-enable -docstring "Wrap the lines in which characters are inserted" %{ hook -group autowrap window InsertChar [^\n] %{ try %{ exec -draft "x:autowrap-selection" @@ -29,6 +29,6 @@ def autowrap-enable %{ } ## Disable the automatic line wrapping, autowrap-selection remains available though -def autowrap-disable %{ +def autowrap-disable -docstring "Disable automatic line wrapping" %{ rmhooks window autowrap } diff --git a/rc/clang.kak b/rc/clang.kak index bbb7c840..e56f87e5 100644 --- a/rc/clang.kak +++ b/rc/clang.kak @@ -5,7 +5,7 @@ decl -hidden str-list clang_completions decl -hidden line-flag-list clang_flags decl -hidden str clang_errors -def -shell-params clang-parse %{ +def -shell-params clang-parse -docstring "Parse the contents of the current buffer with clang" %{ %sh{ dir=$(mktemp -d -t kak-clang.XXXXXXXX) mkfifo ${dir}/fifo @@ -85,9 +85,9 @@ def -shell-params clang-parse %{ } } -def clang-complete %{ clang-parse -complete } +def clang-complete -docstring "Complete the current selection with clang" %{ clang-parse -complete } -def clang-enable-autocomplete %{ +def clang-enable-autocomplete -docstring "Enable completion with clang" %{ set window completers "option=clang_completions:%opt{completers}" hook window -group clang-autocomplete InsertIdle .* %{ try %{ exec -draft (\.|->|::).\' @@ -97,7 +97,7 @@ def clang-enable-autocomplete %{ alias window complete clang-complete } -def clang-disable-autocomplete %{ +def clang-disable-autocomplete -docstring "Disable automatic clang completion" %{ set window completers %sh{ echo "'${kak_opt_completers}'" | sed -e 's/option=clang_completions://g' } rmhooks window clang-autocomplete unalias window complete clang-complete @@ -111,17 +111,17 @@ def -hidden clang-show-error-info %{ %sh{ done } } -def clang-enable-diagnostics %{ +def clang-enable-diagnostics -docstring "Activate automatic diagnostics of the code by clang" %{ addhl flag_lines default clang_flags hook window -group clang-diagnostics NormalIdle .* %{ clang-show-error-info } } -def clang-disable-diagnostics %{ +def clang-disable-diagnostics -docstring "Disable automatic diagnostics of the code" %{ rmhl hlflags_clang_flags rmhooks window clang-diagnostics } -def clang-diagnostics-next %{ %sh{ +def clang-diagnostics-next -docstring "Jump to the next line that contains an error" %{ %sh{ echo "${kak_opt_clang_errors}" | ( line=-1 first_line=-1 diff --git a/rc/ctags.kak b/rc/ctags.kak index e0f5059b..ab7b1cb0 100644 --- a/rc/ctags.kak +++ b/rc/ctags.kak @@ -7,7 +7,7 @@ decl str-list ctagsfiles 'tags' def -shell-params \ -shell-completion 'readtags -p "$1" | cut -f 1 | sort | uniq' \ - -docstring 'jump to tag definition' \ + -docstring 'Jump to tag definition' \ tag \ %{ %sh{ export tagname=${1:-${kak_selection}} @@ -25,7 +25,7 @@ def -shell-params \ END { print length(out) == 0 ? "echo -color Error no such tag " ENVIRON["tagname"] : "menu -auto-single " out }' }} -def tag-complete %{ eval -draft %{ +def tag-complete -docstring "Insert completion candidates for the current selection into the buffer's local variables" %{ eval -draft %{ exec hb^\w+$ %sh{ ( compl=$(readtags -p "$kak_selection" | cut -f 1 | sort | uniq | sed -e 's/:/\\:/g' | sed -e 's/\n/:/g' ) @@ -34,7 +34,7 @@ def tag-complete %{ eval -draft %{ ) > /dev/null 2>&1 < /dev/null & } }} -def funcinfo %{ +def ctags-funcinfo -docstring "Display ctags information about a selected function" %{ eval -draft %{ exec '[(;B[a-zA-Z_]+\(' %sh{ @@ -46,16 +46,16 @@ def funcinfo %{ } } -def ctags-enable-autoinfo %{ - hook window -group ctags-autoinfo NormalKey .* funcinfo - hook window -group ctags-autoinfo InsertKey .* funcinfo +def ctags-enable-autoinfo -docstring "Automatically display ctags information about function" %{ + hook window -group ctags-autoinfo NormalKey .* ctags-funcinfo + hook window -group ctags-autoinfo InsertKey .* ctags-funcinfo } -def ctags-disable-autoinfo %{ rmhooks window ctags-autoinfo } +def ctags-disable-autoinfo -docstring "Disable automatic ctags information displaying" %{ rmhooks window ctags-autoinfo } decl str ctagsopts "-R ." -def gentags -docstring 'generate tag file asynchronously' %{ +def gentags -docstring 'Generate tag file asynchronously' %{ echo -color Information "launching tag generation in the background" %sh{ ( if ctags -f .tags.kaktmp ${kak_opt_ctagsopts}; then diff --git a/rc/git-tools.kak b/rc/git-tools.kak index 57c6072d..16dcf698 100644 --- a/rc/git-tools.kak +++ b/rc/git-tools.kak @@ -23,7 +23,7 @@ decl line-flag-list git_blame_flags decl line-flag-list git_diff_flags def -shell-params \ - -docstring %sh{printf "%%{git wrapping helper\navailable commands:\n add\n rm\n blame\n commit\n checkout\n diff\n hide-blame\n log\n show\n show-diff\n status\n update-diff}"} \ + -docstring %sh{printf "%%{Git wrapping helper\navailable commands:\n add\n rm\n blame\n commit\n checkout\n diff\n hide-blame\n log\n show\n show-diff\n status\n update-diff}"} \ -shell-completion %{ shift $(expr ${kak_token_to_complete}) prefix=${1:0:${kak_pos_in_token}} diff --git a/rc/golang.kak b/rc/golang.kak index 7bd43a90..83a7d773 100644 --- a/rc/golang.kak +++ b/rc/golang.kak @@ -59,13 +59,13 @@ def -hidden _golang-indent-on-closing-curly-brace %[ try %[ exec -itersel -draft ^\h+\}$hms\`|.\'1 ] ] -def golang-enable-gofmt %{ +def golang-enable-gofmt -docstring "Format the code using the gofmt utility upon saving" %{ hook buffer -group golang-formatter BufWritePre .* %{ exec -draft %{%|"gofmt"} } } -def golang-disable-gofmt %{ +def golang-disable-gofmt -docstring "Disable automatic code formatting" %{ rmhooks buffer golang-formatter } diff --git a/rc/grep.kak b/rc/grep.kak index d83469b6..a009dad2 100644 --- a/rc/grep.kak +++ b/rc/grep.kak @@ -3,7 +3,7 @@ decl str toolsclient decl -hidden int _grep_current_line 0 def -shell-params -file-completion \ - grep %{ %sh{ + grep -docstring "Grep utility wrapper" %{ %sh{ output=$(mktemp -d -t kak-grep.XXXXXXXX)/fifo mkfifo ${output} if [ $# -gt 0 ]; then diff --git a/rc/jedi.kak b/rc/jedi.kak index ef0f44a7..c588968e 100644 --- a/rc/jedi.kak +++ b/rc/jedi.kak @@ -1,7 +1,7 @@ decl -hidden str jedi_tmp_dir decl -hidden str-list jedi_completions -def jedi-complete %{ +def jedi-complete -docstring "Complete the current selection with jedi" %{ %sh{ dir=$(mktemp -d -t kak-jedi.XXXXXXXX) mkfifo ${dir}/fifo @@ -27,7 +27,7 @@ def jedi-complete %{ } } -def jedi-enable-autocomplete %{ +def jedi-enable-autocomplete -docstring "Add jedi completion candidates to the completer" %{ set window completers "option=jedi_completions:%opt{completers}" hook window -group jedi-autocomplete InsertIdle .* %{ try %{ exec -draft \..\' @@ -37,7 +37,7 @@ def jedi-enable-autocomplete %{ alias window complete jedi-complete } -def jedi-disable-autocomplete %{ +def jedi-disable-autocomplete -docstring "Disable jedi completion" %{ set window completers %sh{ echo "'${kak_opt_completers}'" | sed -e 's/option=jedi_completions://g' } rmhooks window jedi-autocomplete unalias window complete jedi-complete diff --git a/rc/make.kak b/rc/make.kak index 96f11890..ca946d55 100644 --- a/rc/make.kak +++ b/rc/make.kak @@ -2,7 +2,7 @@ decl str makecmd make decl str toolsclient decl -hidden int _make_current_error_line -def -shell-params make %{ %sh{ +def -shell-params make -docstring "Make utility wrapper" %{ %sh{ output=$(mktemp -d -t kak-make.XXXXXXXX)/fifo mkfifo ${output} ( eval ${kak_opt_makecmd} "$@" > ${output} 2>&1 ) > /dev/null 2>&1 < /dev/null & diff --git a/rc/man.kak b/rc/man.kak index 1f58d829..22f3ac6b 100644 --- a/rc/man.kak +++ b/rc/man.kak @@ -44,7 +44,7 @@ def -shell-params \ esac done } \ - man %{ %sh{ + man -docstring "Manpages viewer wrapper" %{ %sh{ [ -z "$@" ] && set -- "$kak_selection" echo "eval -try-client %opt{docsclient} _man $@" } }