Mercurial > vim
comparison src/gui_gtk_x11.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 | f2972ff144ab |
children | d89c5b339c2a |
comparison
equal
deleted
inserted
replaced
15469:bc9b5261ed01 | 15470:55ccc2d353bd |
---|---|
1662 p = mch_getenv((char_u *)"DISPLAY"); | 1662 p = mch_getenv((char_u *)"DISPLAY"); |
1663 if (p == NULL || *p == NUL) | 1663 if (p == NULL || *p == NUL) |
1664 { | 1664 { |
1665 gui.dying = TRUE; | 1665 gui.dying = TRUE; |
1666 if (give_message) | 1666 if (give_message) |
1667 EMSG(_((char *)e_opendisp)); | 1667 emsg(_((char *)e_opendisp)); |
1668 return FAIL; | 1668 return FAIL; |
1669 } | 1669 } |
1670 return OK; | 1670 return OK; |
1671 } | 1671 } |
1672 | 1672 |
1708 | 1708 |
1709 /* Don't use gtk_init() or gnome_init(), it exits on failure. */ | 1709 /* Don't use gtk_init() or gnome_init(), it exits on failure. */ |
1710 if (!gtk_init_check(&gui_argc, &gui_argv)) | 1710 if (!gtk_init_check(&gui_argc, &gui_argv)) |
1711 { | 1711 { |
1712 gui.dying = TRUE; | 1712 gui.dying = TRUE; |
1713 EMSG(_((char *)e_opendisp)); | 1713 emsg(_((char *)e_opendisp)); |
1714 return FAIL; | 1714 return FAIL; |
1715 } | 1715 } |
1716 | 1716 |
1717 return OK; | 1717 return OK; |
1718 } | 1718 } |
5245 } | 5245 } |
5246 | 5246 |
5247 if (font == NULL) | 5247 if (font == NULL) |
5248 { | 5248 { |
5249 if (report_error) | 5249 if (report_error) |
5250 EMSG2(_((char *)e_font), name); | 5250 semsg(_((char *)e_font), name); |
5251 return NULL; | 5251 return NULL; |
5252 } | 5252 } |
5253 | 5253 |
5254 return font; | 5254 return font; |
5255 } | 5255 } |
7136 | 7136 |
7137 if (message != NULL) | 7137 if (message != NULL) |
7138 { | 7138 { |
7139 /* The error message is already translated and will be more | 7139 /* The error message is already translated and will be more |
7140 * descriptive than anything we could possibly do ourselves. */ | 7140 * descriptive than anything we could possibly do ourselves. */ |
7141 EMSG2("E255: %s", message); | 7141 semsg("E255: %s", message); |
7142 | 7142 |
7143 if (input_conv.vc_type != CONV_NONE) | 7143 if (input_conv.vc_type != CONV_NONE) |
7144 vim_free(message); | 7144 vim_free(message); |
7145 } | 7145 } |
7146 g_error_free(error); | 7146 g_error_free(error); |