[vim/vim] Missing description of some errors in built-in documentation (Issue #10782)

2 views
Skip to first unread message

Restorer

unread,
Jul 25, 2022, 10:13:15 AM7/25/22
to vim/vim, Subscribed

Steps to reproduce

Run Vim
Type a command help E1082

For a full check, I attach the script:

" Maintainer:	Restorer, <rest...@mail2k.ru>

" Last change:	25 Jul 2022

" Version:	1.0.0

" Description:	проверка описания кодов ошибок во встроенной документации Vim

"		checking the description of error codes in the documentation Vim

" URL:		

" Copyright:	© Restorer, 2022

" License:	Vim



function s:LstChkFls(dirsrc)

  if empty(a:dirsrc)

    echoerr "The directory with the source code of the Vim program is not specified"

    return -1

  endif

  let s:lstfls = []

  let s:lstfls += globpath(a:dirsrc, '*.c', v:none, v:true)

  let s:lstfls += globpath(a:dirsrc, 'errors.h', v:none, v:true)

  let s:lstfls += globpath(a:dirsrc, 'globals.h', v:none, v:true)

  let s:lstfls += globpath(a:dirsrc, 'vim.h', v:none, v:true)

  let s:lstfls += globpath(a:dirsrc, 'GvimExt/gvimext.cpp', v:none, v:true)

  let s:lstfls += globpath(a:dirsrc, 'if_py_both.h', v:none, v:true)

  let s:lstfls += globpath(a:dirsrc, 'if_perl.xs', v:none, v:true)

  return s:lstfls

endfunction



function s:GetErrCod(lstfls)

  if empty(a:lstfls)

    echoerr "The source code files of the Vim program are not specified"

    return -1

  endif

  let s:lstcoderr = []

  for l:fl in a:lstfls

    buffer

    exe 'edit ' l:fl

    let l:lln = line('$')

"    let l:lst = []

    while search('\CE\d\{2,4\}:', 'w', l:lln) > 0

      normal yt:

      call add(s:lstcoderr, getreg('""'))

"      call add(l:lst, getreg('""'))

    endwhile

    while search('\CW\d\{2,4\}:', 'w', l:lln) > 0

      normal yt:

      call add(s:lstcoderr, getreg('""'))

"      call add(l:lst, getreg('""'))

    endwhile

    bw!

"    if !empty(l:lst)

"      call filter(l:lst, '1 == count(l:lst, v:val, v:true)')

"      call sort(l:lst, 'n')

"      call add(l:lstcoderr, {l:fl:l:lst})

"    endif

  endfor

  if !empty(s:lstcoderr)

    call filter(s:lstcoderr, '1 == count(s:lstcoderr, v:val, v:true)')

    call sort(s:lstcoderr, 'n')

  endif

  return s:lstcoderr

endfunction



function s:ChkECodInHlp(lstcoderr)

  if empty(a:lstcoderr)

    echoerr "The list of error codes is empty"

    return -1

  endif

  let s:lstnotdsc = []

  for l:err in a:lstcoderr

    try

      exe 'help ' l:err

    catch /^Vim\%((\a\+)\)\=:E149:/

      call add(s:lstnotdsc, l:err)

    endtry

  endfor

  helpclose

  return s:lstnotdsc

endfunction



function s:MainChkDscErrInHlp()

  let s:dirsrc = ''

  if empty(s:dirsrc)

    echoerr "In the variable s:dirsrc, you must specify the directory with the Vim sources"

    return -1

  endif

  let s:lstfls = s:LstChkFls(s:dirsrc)

  if empty(s:lstfls)

    echoerr "Something went wrong in the function s:LstChkFls(). The file list is empty"

    return -1

  endif

  let s:lstcoderr = s:GetErrCod(s:lstfls)

  if empty(s:lstcoderr)

    echoerr "Something went wrong in the function s:GetErrCod(). The list of error codes is empty"

    return -1

  endif

  let s:lstnotdsc = s:ChkECodInHlp(s:lstcoderr)

  if empty(s:lstnotdsc)

    echomsg "OK"

  else

    new

    buffer

    exe 'edit ' .. 'notdescription'

    call appendbufline(bufname('notdescription'), '0', s:lstnotdsc)

  endif

  return

endfunction

call s:MainChkDscErrInHlp()

Open in the Vim editor, specify the source code directory in the variable s:dirsrc and type the command source %

Expected behaviour

E149: Sorry, no help for E1082

Version of Vim

9.0.63

Environment

All

Logs and stack traces

E1082

E1088

E1267

E1268

E1269

E1272

E1273

E1275

E1277

E1279

E1280

E1284

E1285

E1286

E1287

E1288

E1289

E1290

E1291


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/10782@github.com>

Bram Moolenaar

unread,
Jul 29, 2022, 4:30:57 PM7/29/22
to vim/vim, Subscribed

I have added the tags. Please check at the next runtime files update.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/10782/1199924245@github.com>

Bram Moolenaar

unread,
Jul 29, 2022, 4:30:57 PM7/29/22
to vim/vim, Subscribed

Closed #10782 as completed.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/10782/issue_event/7091984184@github.com>

Restorer

unread,
Jul 30, 2022, 8:21:18 AM7/30/22
to vim/vim, Subscribed

Bram, it's okay.
Just one moment.
Error E1269 is only in errors.h and is not present anywhere else.
That is, the array e_cannot_create_vim9_script_variable_in_function_str[] is not used in the source code.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/10782/1200148065@github.com>

Bram Moolenaar

unread,
Jul 30, 2022, 8:47:59 AM7/30/22
to vim/vim, Subscribed


> Just one moment.
> Error E1269 is only in errors.h and is not present anywhere else.
> That is, the array e_cannot_create_vim9_script_variable_in_function_str[] is not used in the source code.

It is used in evalvars.c, line 3715.

--
Some of the well known MS-Windows errors:
EMEMORY Memory error caused by..., eh...
ELICENSE Your license has expired, give us more money!
EMOUSE Mouse moved, reinstall Windows
EILLEGAL Illegal error, you are not allowed to see this
EVIRUS Undetectable virus found

/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/10782/1200151575@github.com>

Restorer

unread,
Jul 30, 2022, 6:07:55 PM7/30/22
to vim/vim, Subscribed

It is used in evalvars.c, line 3715.

Yes, indeed.
And another point, there are E256 and E839 in the documentation, but they are not in the source code. More precisely, they are marked in errors.h as unused.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/10782/1200302017@github.com>

Bram Moolenaar

unread,
Jul 30, 2022, 6:16:51 PM7/30/22
to vim...@googlegroups.com, Restorer

> And another point, there are **E256** and **E839** in the
> documentation, but they are not in the source code. More precisely,
> they are marked in errors.h as unused.

Not sure what they were for, I'll remove the tags.

--
panic("Foooooooood fight!");
-- In the kernel source aha1542.c, after detecting a bad segment list

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
Reply all
Reply to author
Forward
0 new messages