diff options
| author | Paul Eggert | 2019-04-14 23:10:45 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-04-14 23:11:40 -0700 |
| commit | 8065e05a9ce32d95b3c50d694375eca78a7b8aeb (patch) | |
| tree | 50e7627f7aab70d97ae133ddaa57869e1b4eb0d5 /src/coding.c | |
| parent | da3e3fc7971eab2391a745d9429c6c70bc70e27c (diff) | |
| download | emacs-8065e05a9ce32d95b3c50d694375eca78a7b8aeb.tar.gz emacs-8065e05a9ce32d95b3c50d694375eca78a7b8aeb.zip | |
Remove static var system_eol_type
* src/coding.c (system_eol_type): Remove.
(coding_inherit_eol_type, syms_of_coding):
Simplify to avoid the need for system_eol_type.
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 38 |
1 files changed, 14 insertions, 24 deletions
diff --git a/src/coding.c b/src/coding.c index e351cc72fab..2c6b2c4d051 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -302,12 +302,6 @@ encode_coding_XXX (struct coding_system *coding) | |||
| 302 | 302 | ||
| 303 | Lisp_Object Vcoding_system_hash_table; | 303 | Lisp_Object Vcoding_system_hash_table; |
| 304 | 304 | ||
| 305 | /* Format of end-of-line decided by system. This is Qunix on | ||
| 306 | Unix and Mac, Qdos on DOS/Windows. | ||
| 307 | This has an effect only for external encoding (i.e. for output to | ||
| 308 | file and process), not for in-buffer or Lisp string encoding. */ | ||
| 309 | static Lisp_Object system_eol_type; | ||
| 310 | |||
| 311 | /* Coding-systems are handed between Emacs Lisp programs and C internal | 305 | /* Coding-systems are handed between Emacs Lisp programs and C internal |
| 312 | routines by the following three variables. */ | 306 | routines by the following three variables. */ |
| 313 | /* Coding system to be used to encode text for terminal display when | 307 | /* Coding system to be used to encode text for terminal display when |
| @@ -5972,8 +5966,7 @@ raw_text_coding_system_p (struct coding_system *coding) | |||
| 5972 | 5966 | ||
| 5973 | /* If CODING_SYSTEM doesn't specify end-of-line format, return one of | 5967 | /* If CODING_SYSTEM doesn't specify end-of-line format, return one of |
| 5974 | the subsidiary that has the same eol-spec as PARENT (if it is not | 5968 | the subsidiary that has the same eol-spec as PARENT (if it is not |
| 5975 | nil and specifies end-of-line format) or the system's setting | 5969 | nil and specifies end-of-line format) or the system's setting. */ |
| 5976 | (system_eol_type). */ | ||
| 5977 | 5970 | ||
| 5978 | Lisp_Object | 5971 | Lisp_Object |
| 5979 | coding_inherit_eol_type (Lisp_Object coding_system, Lisp_Object parent) | 5972 | coding_inherit_eol_type (Lisp_Object coding_system, Lisp_Object parent) |
| @@ -5988,20 +5981,24 @@ coding_inherit_eol_type (Lisp_Object coding_system, Lisp_Object parent) | |||
| 5988 | eol_type = AREF (spec, 2); | 5981 | eol_type = AREF (spec, 2); |
| 5989 | if (VECTORP (eol_type)) | 5982 | if (VECTORP (eol_type)) |
| 5990 | { | 5983 | { |
| 5991 | Lisp_Object parent_eol_type; | 5984 | /* Format of end-of-line decided by system. |
| 5985 | This is Qunix on Unix and Mac, Qdos on DOS/Windows. | ||
| 5986 | This has an effect only for external encoding (i.e., for output to | ||
| 5987 | file and process), not for in-buffer or Lisp string encoding. */ | ||
| 5988 | Lisp_Object system_eol_type = Qunix; | ||
| 5989 | #ifdef DOS_NT | ||
| 5990 | system_eol_type = Qdos; | ||
| 5991 | #endif | ||
| 5992 | 5992 | ||
| 5993 | Lisp_Object parent_eol_type = system_eol_type; | ||
| 5993 | if (! NILP (parent)) | 5994 | if (! NILP (parent)) |
| 5994 | { | 5995 | { |
| 5995 | Lisp_Object parent_spec; | ||
| 5996 | |||
| 5997 | CHECK_CODING_SYSTEM (parent); | 5996 | CHECK_CODING_SYSTEM (parent); |
| 5998 | parent_spec = CODING_SYSTEM_SPEC (parent); | 5997 | Lisp_Object parent_spec = CODING_SYSTEM_SPEC (parent); |
| 5999 | parent_eol_type = AREF (parent_spec, 2); | 5998 | Lisp_Object pspec_type = AREF (parent_spec, 2); |
| 6000 | if (VECTORP (parent_eol_type)) | 5999 | if (!VECTORP (pspec_type)) |
| 6001 | parent_eol_type = system_eol_type; | 6000 | parent_eol_type = pspec_type; |
| 6002 | } | 6001 | } |
| 6003 | else | ||
| 6004 | parent_eol_type = system_eol_type; | ||
| 6005 | if (EQ (parent_eol_type, Qunix)) | 6002 | if (EQ (parent_eol_type, Qunix)) |
| 6006 | coding_system = AREF (eol_type, 0); | 6003 | coding_system = AREF (eol_type, 0); |
| 6007 | else if (EQ (parent_eol_type, Qdos)) | 6004 | else if (EQ (parent_eol_type, Qdos)) |
| @@ -11306,13 +11303,6 @@ internal character representation. */); | |||
| 11306 | for (int i = 0; i < coding_category_max; i++) | 11303 | for (int i = 0; i < coding_category_max; i++) |
| 11307 | Fset (AREF (Vcoding_category_table, i), Qno_conversion); | 11304 | Fset (AREF (Vcoding_category_table, i), Qno_conversion); |
| 11308 | 11305 | ||
| 11309 | #if defined (DOS_NT) | ||
| 11310 | system_eol_type = Qdos; | ||
| 11311 | #else | ||
| 11312 | system_eol_type = Qunix; | ||
| 11313 | #endif | ||
| 11314 | staticpro (&system_eol_type); | ||
| 11315 | |||
| 11316 | pdumper_do_now_and_after_load (reset_coding_after_pdumper_load); | 11306 | pdumper_do_now_and_after_load (reset_coding_after_pdumper_load); |
| 11317 | } | 11307 | } |
| 11318 | 11308 | ||