Mercurial > vim
comparison src/if_tcl.c @ 15470:55ccc2d353bd v8.1.0743
patch 8.1.0743: giving error messages is not flexible
commit https://github.com/vim/vim/commit/f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 13 23:38:42 2019 +0100
patch 8.1.0743: giving error messages is not flexible
Problem: Giving error messages is not flexible.
Solution: Add semsg(). Change argument from "char_u *" to "char *", also
for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes
#3302) Also make emsg() accept a "char *" argument. Get rid of
an enormous number of type casts.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 13 Jan 2019 23:45:08 +0100 |
parents | 6e4e0d43b20b |
children | dd725a8ab112 |
comparison
equal
deleted
inserted
replaced
15469:bc9b5261ed01 | 15470:55ccc2d353bd |
---|---|
211 if (hTclLib) | 211 if (hTclLib) |
212 return OK; | 212 return OK; |
213 if (!(hTclLib = load_dll(libname))) | 213 if (!(hTclLib = load_dll(libname))) |
214 { | 214 { |
215 if (verbose) | 215 if (verbose) |
216 EMSG2(_(e_loadlib), libname); | 216 semsg(_(e_loadlib), libname); |
217 return FAIL; | 217 return FAIL; |
218 } | 218 } |
219 for (i = 0; tcl_funcname_table[i].ptr; ++i) | 219 for (i = 0; tcl_funcname_table[i].ptr; ++i) |
220 { | 220 { |
221 if (!(*tcl_funcname_table[i].ptr = symbol_from_dll(hTclLib, | 221 if (!(*tcl_funcname_table[i].ptr = symbol_from_dll(hTclLib, |
222 tcl_funcname_table[i].name))) | 222 tcl_funcname_table[i].name))) |
223 { | 223 { |
224 close_dll(hTclLib); | 224 close_dll(hTclLib); |
225 hTclLib = NULL; | 225 hTclLib = NULL; |
226 if (verbose) | 226 if (verbose) |
227 EMSG2(_(e_loadfunc), tcl_funcname_table[i].name); | 227 semsg(_(e_loadfunc), tcl_funcname_table[i].name); |
228 return FAIL; | 228 return FAIL; |
229 } | 229 } |
230 } | 230 } |
231 return OK; | 231 return OK; |
232 } | 232 } |
1537 return TCL_OK; | 1537 return TCL_OK; |
1538 } | 1538 } |
1539 reflist = reflist->next; | 1539 reflist = reflist->next; |
1540 } | 1540 } |
1541 /* This should never happen. Famous last word? */ | 1541 /* This should never happen. Famous last word? */ |
1542 EMSG(_("E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim.org")); | 1542 emsg(_("E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim.org")); |
1543 Tcl_SetResult(interp, _("cannot register callback command: buffer/window reference not found"), TCL_STATIC); | 1543 Tcl_SetResult(interp, _("cannot register callback command: buffer/window reference not found"), TCL_STATIC); |
1544 return TCL_ERROR; | 1544 return TCL_ERROR; |
1545 } | 1545 } |
1546 | 1546 |
1547 | 1547 |
1707 char *name; | 1707 char *name; |
1708 | 1708 |
1709 #ifdef DYNAMIC_TCL | 1709 #ifdef DYNAMIC_TCL |
1710 if (!tcl_enabled(TRUE)) | 1710 if (!tcl_enabled(TRUE)) |
1711 { | 1711 { |
1712 EMSG(_("E571: Sorry, this command is disabled: the Tcl library could not be loaded.")); | 1712 emsg(_("E571: Sorry, this command is disabled: the Tcl library could not be loaded.")); |
1713 return FAIL; | 1713 return FAIL; |
1714 } | 1714 } |
1715 #endif | 1715 #endif |
1716 | 1716 |
1717 if (!tclinfo.interp) | 1717 if (!tclinfo.interp) |
1815 char *next; | 1815 char *next; |
1816 | 1816 |
1817 while ((next=strchr(text, '\n'))) | 1817 while ((next=strchr(text, '\n'))) |
1818 { | 1818 { |
1819 *next++ = '\0'; | 1819 *next++ = '\0'; |
1820 EMSG(text); | 1820 emsg(text); |
1821 text = next; | 1821 text = next; |
1822 } | 1822 } |
1823 if (*text) | 1823 if (*text) |
1824 EMSG(text); | 1824 emsg(text); |
1825 } | 1825 } |
1826 | 1826 |
1827 static void | 1827 static void |
1828 tclmsg(char *text) | 1828 tclmsg(char *text) |
1829 { | 1829 { |