Mercurial > vim
comparison src/hardcopy.c @ 26915:3631d2deb36c v8.2.3986
patch 8.2.3986: error messages are spread out
Commit: https://github.com/vim/vim/commit/b09feaa86ecc53b9b953710082496951776dc5c6
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 2 20:20:45 2022 +0000
patch 8.2.3986: error messages are spread out
Problem: Error messages are spread out.
Solution: Move more error messages to errors.h.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 02 Jan 2022 21:30:04 +0100 |
parents | d4e61d61afd9 |
children | d91aea2a612c |
comparison
equal
deleted
inserted
replaced
26914:21f9376239a4 | 26915:3631d2deb36c |
---|---|
1403 { | 1403 { |
1404 if (!prt_file_error | 1404 if (!prt_file_error |
1405 && fwrite(buffer, sizeof(char_u), bytes, prt_ps_fd) | 1405 && fwrite(buffer, sizeof(char_u), bytes, prt_ps_fd) |
1406 != (size_t)bytes) | 1406 != (size_t)bytes) |
1407 { | 1407 { |
1408 emsg(_("E455: Error writing to PostScript output file")); | 1408 emsg(_(e_error_writing_to_postscript_output_file)); |
1409 prt_file_error = TRUE; | 1409 prt_file_error = TRUE; |
1410 } | 1410 } |
1411 } | 1411 } |
1412 | 1412 |
1413 static void | 1413 static void |
1847 // Parse first line to ensure valid resource file | 1847 // Parse first line to ensure valid resource file |
1848 prt_resfile.len = (int)fread((char *)prt_resfile.buffer, sizeof(char_u), | 1848 prt_resfile.len = (int)fread((char *)prt_resfile.buffer, sizeof(char_u), |
1849 PRT_FILE_BUFFER_LEN, fd_resource); | 1849 PRT_FILE_BUFFER_LEN, fd_resource); |
1850 if (ferror(fd_resource)) | 1850 if (ferror(fd_resource)) |
1851 { | 1851 { |
1852 semsg(_("E457: Can't read PostScript resource file \"%s\""), | 1852 semsg(_(e_cant_read_postscript_resource_file_str), |
1853 resource->filename); | 1853 resource->filename); |
1854 fclose(fd_resource); | 1854 fclose(fd_resource); |
1855 return FALSE; | 1855 return FALSE; |
1856 } | 1856 } |
1857 fclose(fd_resource); | 1857 fclose(fd_resource); |
2673 size_t bytes_read; | 2673 size_t bytes_read; |
2674 | 2674 |
2675 fd_resource = mch_fopen((char *)resource->filename, READBIN); | 2675 fd_resource = mch_fopen((char *)resource->filename, READBIN); |
2676 if (fd_resource == NULL) | 2676 if (fd_resource == NULL) |
2677 { | 2677 { |
2678 semsg(_("E456: Can't open file \"%s\""), resource->filename); | 2678 semsg(_(e_cant_open_file_str_2), resource->filename); |
2679 return FALSE; | 2679 return FALSE; |
2680 } | 2680 } |
2681 prt_dsc_resources("BeginResource", prt_resource_types[resource->type], | 2681 prt_dsc_resources("BeginResource", prt_resource_types[resource->type], |
2682 (char *)resource->title); | 2682 (char *)resource->title); |
2683 | 2683 |
2687 { | 2687 { |
2688 bytes_read = fread((char *)resource_buffer, sizeof(char_u), | 2688 bytes_read = fread((char *)resource_buffer, sizeof(char_u), |
2689 sizeof(resource_buffer), fd_resource); | 2689 sizeof(resource_buffer), fd_resource); |
2690 if (ferror(fd_resource)) | 2690 if (ferror(fd_resource)) |
2691 { | 2691 { |
2692 semsg(_("E457: Can't read PostScript resource file \"%s\""), | 2692 semsg(_(e_cant_read_postscript_resource_file_str), |
2693 resource->filename); | 2693 resource->filename); |
2694 fclose(fd_resource); | 2694 fclose(fd_resource); |
2695 return FALSE; | 2695 return FALSE; |
2696 } | 2696 } |
2697 if (bytes_read == 0) | 2697 if (bytes_read == 0) |
2803 } | 2803 } |
2804 | 2804 |
2805 // Search for external resources VIM supplies | 2805 // Search for external resources VIM supplies |
2806 if (!prt_find_resource("prolog", res_prolog)) | 2806 if (!prt_find_resource("prolog", res_prolog)) |
2807 { | 2807 { |
2808 emsg(_("E456: Can't find PostScript resource file \"prolog.ps\"")); | 2808 semsg(_(e_cant_find_postscript_resource_file_str_ps), "prolog"); |
2809 goto theend; | 2809 goto theend; |
2810 } | 2810 } |
2811 if (!prt_open_resource(res_prolog)) | 2811 if (!prt_open_resource(res_prolog)) |
2812 goto theend; | 2812 goto theend; |
2813 if (!prt_check_resource(res_prolog, PRT_PROLOG_VERSION)) | 2813 if (!prt_check_resource(res_prolog, PRT_PROLOG_VERSION)) |
2815 if (prt_out_mbyte) | 2815 if (prt_out_mbyte) |
2816 { | 2816 { |
2817 // Look for required version of multi-byte printing procset | 2817 // Look for required version of multi-byte printing procset |
2818 if (!prt_find_resource("cidfont", res_cidfont)) | 2818 if (!prt_find_resource("cidfont", res_cidfont)) |
2819 { | 2819 { |
2820 emsg(_("E456: Can't find PostScript resource file \"cidfont.ps\"")); | 2820 semsg(_(e_cant_find_postscript_resource_file_str_ps), "cidfont"); |
2821 goto theend; | 2821 goto theend; |
2822 } | 2822 } |
2823 if (!prt_open_resource(res_cidfont)) | 2823 if (!prt_open_resource(res_cidfont)) |
2824 goto theend; | 2824 goto theend; |
2825 if (!prt_check_resource(res_cidfont, PRT_CID_PROLOG_VERSION)) | 2825 if (!prt_check_resource(res_cidfont, PRT_CID_PROLOG_VERSION)) |
2847 { | 2847 { |
2848 // Use latin1 as default printing encoding | 2848 // Use latin1 as default printing encoding |
2849 p_encoding = (char_u *)"latin1"; | 2849 p_encoding = (char_u *)"latin1"; |
2850 if (!prt_find_resource((char *)p_encoding, res_encoding)) | 2850 if (!prt_find_resource((char *)p_encoding, res_encoding)) |
2851 { | 2851 { |
2852 semsg(_("E456: Can't find PostScript resource file \"%s.ps\""), | 2852 semsg(_(e_cant_find_postscript_resource_file_str_ps), |
2853 p_encoding); | 2853 p_encoding); |
2854 goto theend; | 2854 goto theend; |
2855 } | 2855 } |
2856 } | 2856 } |
2857 } | 2857 } |
2868 if (prt_use_courier) | 2868 if (prt_use_courier) |
2869 { | 2869 { |
2870 // Include ASCII range encoding vector | 2870 // Include ASCII range encoding vector |
2871 if (!prt_find_resource(prt_ascii_encoding, res_encoding)) | 2871 if (!prt_find_resource(prt_ascii_encoding, res_encoding)) |
2872 { | 2872 { |
2873 semsg(_("E456: Can't find PostScript resource file \"%s.ps\""), | 2873 semsg(_(e_cant_find_postscript_resource_file_str_ps), |
2874 prt_ascii_encoding); | 2874 prt_ascii_encoding); |
2875 goto theend; | 2875 goto theend; |
2876 } | 2876 } |
2877 if (!prt_open_resource(res_encoding)) | 2877 if (!prt_open_resource(res_encoding)) |
2878 goto theend; | 2878 goto theend; |
2897 if (prt_out_mbyte && prt_custom_cmap) | 2897 if (prt_out_mbyte && prt_custom_cmap) |
2898 { | 2898 { |
2899 // Find user supplied CMap | 2899 // Find user supplied CMap |
2900 if (!prt_find_resource(prt_cmap, res_cmap)) | 2900 if (!prt_find_resource(prt_cmap, res_cmap)) |
2901 { | 2901 { |
2902 semsg(_("E456: Can't find PostScript resource file \"%s.ps\""), | 2902 semsg(_(e_cant_find_postscript_resource_file_str_ps), prt_cmap); |
2903 prt_cmap); | |
2904 goto theend; | 2903 goto theend; |
2905 } | 2904 } |
2906 if (!prt_open_resource(res_cmap)) | 2905 if (!prt_open_resource(res_cmap)) |
2907 goto theend; | 2906 goto theend; |
2908 } | 2907 } |