aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa1997-08-26 11:42:33 +0000
committerKenichi Handa1997-08-26 11:42:33 +0000
commit450c1a67cad77252304df2f06596cdb1d183eb79 (patch)
treed95d6137759aa7f74e49f2b22dd3622f6ff1c1ea /src
parentb24014d4ab5bfa62966ea657bb28a03fe3592746 (diff)
downloademacs-450c1a67cad77252304df2f06596cdb1d183eb79.tar.gz
emacs-450c1a67cad77252304df2f06596cdb1d183eb79.zip
(Fwrite_region): Convert EOL format even if
enable-multibyte-characters is nil. (Fread_file_name): Call Fcompleting_read with INHERIT-INPUT-METHOD nil.
Diffstat (limited to 'src')
-rw-r--r--src/fileio.c35
1 files changed, 30 insertions, 5 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 2a9f3dcb444..99c9b0f30e4 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3860,9 +3860,32 @@ to the file, instead of any buffer contents, and END is ignored.")
3860 else if (!NILP (Vcoding_system_for_write)) 3860 else if (!NILP (Vcoding_system_for_write))
3861 val = Vcoding_system_for_write; 3861 val = Vcoding_system_for_write;
3862 else if (NILP (current_buffer->enable_multibyte_characters)) 3862 else if (NILP (current_buffer->enable_multibyte_characters))
3863 val = (NILP (Flocal_variable_p (Qbuffer_file_coding_system, Qnil)) 3863 {
3864 ? Qnil 3864 /* If the variable `buffer-file-coding-system' is set locally,
3865 : Fsymbol_value (Qbuffer_file_coding_system)); 3865 it means that the file was read with some kind of code
3866 conversion or the varialbe is explicitely set by users. We
3867 had better write it out with the same coding system even if
3868 `enable-multibyte-characters' is nil.
3869
3870 If is is not set locally, we anyway have to convert EOL
3871 format if the default value of `buffer-file-coding-system'
3872 tells that it is not Unix-like (LF only) format. */
3873 val = current_buffer->buffer_file_coding_system;
3874 if (NILP (Flocal_variable_p (Qbuffer_file_coding_system, Qnil)))
3875 {
3876 struct coding_system coding_temp;
3877
3878 setup_coding_system (Fcheck_coding_system (val), &coding_temp);
3879 if (coding_temp.eol_type == CODING_EOL_CRLF
3880 || coding_temp.eol_type == CODING_EOL_CR)
3881 {
3882 setup_coding_system (Qemacs_mule, &coding);
3883 coding.eol_type = coding_temp.eol_type;
3884 goto done_setup_coding;
3885 }
3886 val = Qnil;
3887 }
3888 }
3866 else 3889 else
3867 { 3890 {
3868 Lisp_Object args[7], coding_systems; 3891 Lisp_Object args[7], coding_systems;
@@ -3876,6 +3899,8 @@ to the file, instead of any buffer contents, and END is ignored.")
3876 : current_buffer->buffer_file_coding_system); 3899 : current_buffer->buffer_file_coding_system);
3877 } 3900 }
3878 setup_coding_system (Fcheck_coding_system (val), &coding); 3901 setup_coding_system (Fcheck_coding_system (val), &coding);
3902
3903 done_setup_coding:
3879 if (!STRINGP (start) && !NILP (current_buffer->selective_display)) 3904 if (!STRINGP (start) && !NILP (current_buffer->selective_display))
3880 coding.selective = 1; 3905 coding.selective = 1;
3881 } 3906 }
@@ -4920,7 +4945,7 @@ DIR defaults to current buffer's directory default.")
4920 GCPRO2 (insdef, default_filename); 4945 GCPRO2 (insdef, default_filename);
4921 val = Fcompleting_read (prompt, intern ("read-file-name-internal"), 4946 val = Fcompleting_read (prompt, intern ("read-file-name-internal"),
4922 dir, mustmatch, insdef1, 4947 dir, mustmatch, insdef1,
4923 Qfile_name_history, default_filename); 4948 Qfile_name_history, default_filename, Qnil);
4924 /* If Fcompleting_read returned the default string itself 4949 /* If Fcompleting_read returned the default string itself
4925 (rather than a new string with the same contents), 4950 (rather than a new string with the same contents),
4926 it has to mean that the user typed RET with the minibuffer empty. 4951 it has to mean that the user typed RET with the minibuffer empty.
@@ -4995,7 +5020,7 @@ DEFUN ("read-file-name", Fread_file_name, Sread_file_name, 1, 5, 0,
4995 val = Fcompleting_read (prompt, intern ("read-file-name-internal"), 5020 val = Fcompleting_read (prompt, intern ("read-file-name-internal"),
4996 dir, mustmatch, 5021 dir, mustmatch,
4997 insert_default_directory ? insdef : Qnil, 5022 insert_default_directory ? insdef : Qnil,
4998 Qfile_name_history, Qnil); 5023 Qfile_name_history, Qnil, Qnil);
4999 5024
5000#ifdef VMS 5025#ifdef VMS
5001 unbind_to (count, Qnil); 5026 unbind_to (count, Qnil);