From 1d58ab89ca6eb1f87a812e23ffca210e15c4fb5f Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Tue, 5 Aug 2014 10:04:38 +0400 Subject: Fix bug with uninitialized undo list of an indirect buffer (Bug#18180). * buffer.c (Fmake_indirect_buffer): Initialize undo list with the base buffer's undo list. --- src/ChangeLog | 6 ++++++ src/buffer.c | 3 +++ 2 files changed, 9 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 3f9b4577460..de56e3501d8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2014-08-05 Dmitry Antipov + + Fix bug with uninitialized undo list of an indirect buffer (Bug#18180). + * buffer.c (Fmake_indirect_buffer): Initialize undo list with the + base buffer's undo list. + 2014-08-03 Dmitry Antipov Fix bug with an attempt to select uninitialized frame (Bug#18161). diff --git a/src/buffer.c b/src/buffer.c index 8077e47fa0b..495f937d83f 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -809,6 +809,9 @@ CLONE nil means the indirect buffer's state is reset to default values. */) set_string_intervals (name, NULL); bset_name (b, name); + /* An indirect buffer shares undo list of its base (Bug#18180). */ + bset_undo_list (b, BVAR (b->base_buffer, undo_list)); + reset_buffer (b); reset_buffer_local_variables (b, 1); -- cgit v1.2.3 From 518edaef88a458add904026a1c877a884c0a7f06 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 6 Aug 2014 20:37:22 +0300 Subject: src/coding.c: Fix typos in comments and doc strings. --- src/coding.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/coding.c b/src/coding.c index bd4a8be08b3..31303e2ba42 100644 --- a/src/coding.c +++ b/src/coding.c @@ -1190,8 +1190,8 @@ alloc_destination (struct coding_system *coding, ptrdiff_t nbytes, #define UTF_8_BOM_2 0xBB #define UTF_8_BOM_3 0xBF -/* Unlike the other detect_coding_XXX, this function counts number of - characters and check EOL format. */ +/* Unlike the other detect_coding_XXX, this function counts the number + of characters and checks the EOL format. */ static bool detect_coding_utf_8 (struct coding_system *coding, @@ -11276,7 +11276,7 @@ decode text as usual. */); DEFVAR_BOOL ("disable-ascii-optimization", disable_ascii_optimization, doc: /* If non-nil, Emacs does not optimize code decoder for ASCII files. -Internal use only. Removed after the experimental optimizer gets stable. */); +Internal use only. Remove after the experimental optimizer becomes stable. */); disable_ascii_optimization = 0; DEFVAR_LISP ("translation-table-for-input", Vtranslation_table_for_input, -- cgit v1.2.3 From 8db811eff1b890cfc12e065d86a9f93bf974e364 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 7 Aug 2014 18:18:10 +0300 Subject: Fix bug #18162 with assertion violations due to empty face cache. src/fontset.c (Finternal_char_font): Recompute basic faces if the frame's face cache was cleared. --- src/ChangeLog | 5 +++++ src/fontset.c | 4 ++++ 2 files changed, 9 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index de56e3501d8..a3ebe781be5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2014-08-07 Eli Zaretskii + + * fontset.c (Finternal_char_font): Recompute basic faces if the + frame's face cache was cleared. (Bug#18162) + 2014-08-05 Dmitry Antipov Fix bug with uninitialized undo list of an indirect buffer (Bug#18180). diff --git a/src/fontset.c b/src/fontset.c index 13f5357be64..08413ae1571 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -1860,6 +1860,10 @@ DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0, return Qnil; if (!FRAME_WINDOW_P (f)) return Qnil; + /* We need the basic faces to be valid below, so recompute them if + some code just happened to clear the face cache. */ + if (FRAME_FACE_CACHE (f)->used == 0) + recompute_basic_faces (f); face_id = FACE_FOR_CHAR (f, FACE_FROM_ID (f, face_id), c, pos, Qnil); face = FACE_FROM_ID (f, face_id); if (face->font) -- cgit v1.2.3 From 8faa5ee738c269d19071354b63cd64688f6ba101 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Fri, 8 Aug 2014 11:52:59 +0200 Subject: Fix some doc-strings in window.c (Bug#18112) (Bug#18194). * window.c (Fwindow_valid_p): Fix doc-string (Bug#18194). (Fwindow_new_total, Fwindow_normal_size, Fwindow_new_normal) (Fwindow_new_pixel, Fset_window_new_pixel) (Fset_window_new_total, Fset_window_new_normal) (Fwindow_resize_apply): Fix doc-strings (see Bug#18112). --- src/ChangeLog | 8 ++++++++ src/window.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 61 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index a3ebe781be5..6272361196c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2014-08-08 Martin Rudalics + + * window.c (Fwindow_valid_p): Fix doc-string (Bug#18194). + (Fwindow_new_total, Fwindow_normal_size, Fwindow_new_normal) + (Fwindow_new_pixel, Fset_window_new_pixel) + (Fset_window_new_total, Fset_window_new_normal) + (Fwindow_resize_apply): Fix doc-strings (see Bug#18112). + 2014-08-07 Eli Zaretskii * fontset.c (Finternal_char_font): Recompute basic faces if the diff --git a/src/window.c b/src/window.c index 5c4e2f97a3b..8502e7b022c 100644 --- a/src/window.c +++ b/src/window.c @@ -311,7 +311,7 @@ DEFUN ("windowp", Fwindowp, Swindowp, 1, 1, 0, DEFUN ("window-valid-p", Fwindow_valid_p, Swindow_valid_p, 1, 1, 0, doc: /* Return t if OBJECT is a valid window and nil otherwise. A valid window is either a window that displays a buffer or an internal -window. Deleted windows are not live. */) +window. Windows that have been deleted are not valid. */) (Lisp_Object object) { return WINDOW_VALID_P (object) ? Qt : Qnil; @@ -792,7 +792,10 @@ total width of WINDOW. */) DEFUN ("window-new-total", Fwindow_new_total, Swindow_new_total, 0, 1, 0, doc: /* Return the new total size of window WINDOW. -WINDOW must be a valid window and defaults to the selected one. */) +WINDOW must be a valid window and defaults to the selected one. + +The new total size of WINDOW (see `window-total-size') is that set by +the last call of `set-window-new-total' for WINDOW. */) (Lisp_Object window) { return decode_valid_window (window)->new_total; @@ -801,7 +804,25 @@ WINDOW must be a valid window and defaults to the selected one. */) DEFUN ("window-normal-size", Fwindow_normal_size, Swindow_normal_size, 0, 2, 0, doc: /* Return the normal height of window WINDOW. WINDOW must be a valid window and defaults to the selected one. -If HORIZONTAL is non-nil, return the normal width of WINDOW. */) +If HORIZONTAL is non-nil, return the normal width of WINDOW. + +The normal height of a frame's root window or a window that is +horizontally combined (a window that has a left or right sibling) is +1.0. The normal height of a window that is vertically combined (has a +sibling above or below) is the fraction of the window's height with +respect to its parent. The sum of the normal heights of all windows in a +vertical combination equals 1.0. + +Similarly, the normal width of a frame's root window or a window that is +vertically combined equals 1.0. The normal width of a window that is +horizontally combined is the fraction of the window's width with respect +to its parent. The sum of the normal widths of all windows in a +horizontal combination equals 1.0. + +The normal sizes of windows are used to restore the proportional sizes +of windows after they have been shrunk to their minimum sizes; for +example when a frame is temporarily made very small and afterwards gets +re-enlarged to its previous size. */) (Lisp_Object window, Lisp_Object horizontal) { struct window *w = decode_valid_window (window); @@ -811,7 +832,10 @@ If HORIZONTAL is non-nil, return the normal width of WINDOW. */) DEFUN ("window-new-normal", Fwindow_new_normal, Swindow_new_normal, 0, 1, 0, doc: /* Return new normal size of window WINDOW. -WINDOW must be a valid window and defaults to the selected one. */) +WINDOW must be a valid window and defaults to the selected one. + +The new normal size of WINDOW (see `window-normal-size') is that set by +the last call of `set-window-new-normal' for WINDOW. */) (Lisp_Object window) { return decode_valid_window (window)->new_normal; @@ -819,7 +843,12 @@ WINDOW must be a valid window and defaults to the selected one. */) DEFUN ("window-new-pixel", Fwindow_new_pixel, Swindow_new_pixel, 0, 1, 0, doc: /* Return new pixel size of window WINDOW. -WINDOW must be a valid window and defaults to the selected one. */) +WINDOW must be a valid window and defaults to the selected one. + +The new pixel size of WINDOW is the value set by the last call of +`set-window-new-pixel' for WINDOW. If set correctly, it gets eventually +installed by the function `window-resize-apply' and will be returned by +the functions `window-pixel-height' or `window-pixel-width'. */) (Lisp_Object window) { return decode_valid_window (window)->new_pixel; @@ -3715,6 +3744,10 @@ Return SIZE. Optional argument ADD non-nil means add SIZE to the new pixel size of WINDOW and return the sum. +The new pixel size of WINDOW is used by `window-resize-apply' and, if +that function succeeds, will be subsequently returned by the functions +`window-pixel-height' and `window-pixel-width'. + Note: This function does not operate on any child windows of WINDOW. */) (Lisp_Object window, Lisp_Object size, Lisp_Object add) { @@ -3739,6 +3772,9 @@ Return SIZE. Optional argument ADD non-nil means add SIZE to the new total size of WINDOW and return the sum. +The new total size of WINDOW is used by `window-resize-apply-total' and, +after calling that function, will be returned by `window-total-size'. + Note: This function does not operate on any child windows of WINDOW. */) (Lisp_Object window, Lisp_Object size, Lisp_Object add) { @@ -3758,6 +3794,10 @@ DEFUN ("set-window-new-normal", Fset_window_new_normal, Sset_window_new_normal, WINDOW must be a valid window and defaults to the selected one. Return SIZE. +The new normal size of WINDOW is used by `window-resize-apply' and, if +that function succeeds, will be subsequently returned by the function +`window-normal-size'. + Note: This function does not operate on any child windows of WINDOW. */) (Lisp_Object window, Lisp_Object size) { @@ -4025,9 +4065,14 @@ If FRAME is omitted or nil, it defaults to the selected frame. Optional argument HORIZONTAL omitted or nil means apply requested height values. HORIZONTAL non-nil means apply requested width values. -This function checks whether the requested values sum up to a valid -window layout, recursively assigns the new sizes of all child windows -and calculates and assigns the new start positions of these windows. +The requested size values are those set by `set-window-new-pixel' and +`set-window-new-normal'. This function checks whether the requested +values sum up to a valid window layout, recursively assigns the new +sizes of all child windows and calculates and assigns the new start +positions of these windows. + +Return t if the requested values have been applied correctly, nil +otherwise. Note: This function does not check any of `window-fixed-size-p', `window-min-height' or `window-min-width'. All these checks have to -- cgit v1.2.3 From c70e7e185e670b63fd46f6a1f59289816bbab098 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Sat, 9 Aug 2014 13:12:45 +0200 Subject: Second attempt to fix some doc-strings in window.c. * window.c (Fwindow_new_total, Fwindow_new_normal) (Fwindow_new_pixel, Fset_window_new_pixel) (Fset_window_new_total, Fset_window_new_normal): Second attempt to fix the doc-strings of these functions. See: http://lists.gnu.org/archive/html/bug-gnu-emacs/2014-08/msg00287.html --- src/ChangeLog | 8 ++++++++ src/window.c | 33 ++++++++++++++++++--------------- 2 files changed, 26 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 6272361196c..6ecce26be14 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2014-08-09 Martin Rudalics + + * window.c (Fwindow_new_total, Fwindow_new_normal) + (Fwindow_new_pixel, Fset_window_new_pixel) + (Fset_window_new_total, Fset_window_new_normal): Second attempt + to fix the doc-strings of these functions. See: + http://lists.gnu.org/archive/html/bug-gnu-emacs/2014-08/msg00287.html + 2014-08-08 Martin Rudalics * window.c (Fwindow_valid_p): Fix doc-string (Bug#18194). diff --git a/src/window.c b/src/window.c index 8502e7b022c..3fefd9ce682 100644 --- a/src/window.c +++ b/src/window.c @@ -794,8 +794,10 @@ DEFUN ("window-new-total", Fwindow_new_total, Swindow_new_total, 0, 1, 0, doc: /* Return the new total size of window WINDOW. WINDOW must be a valid window and defaults to the selected one. -The new total size of WINDOW (see `window-total-size') is that set by -the last call of `set-window-new-total' for WINDOW. */) +The new total size of WINDOW is the value set by the last call of +`set-window-new-total' for WINDOW. If it is valid, it will be shortly +installed as WINDOW's total height (see `window-total-height') or total +width (see `window-total-width'). */) (Lisp_Object window) { return decode_valid_window (window)->new_total; @@ -834,8 +836,9 @@ DEFUN ("window-new-normal", Fwindow_new_normal, Swindow_new_normal, 0, 1, 0, doc: /* Return new normal size of window WINDOW. WINDOW must be a valid window and defaults to the selected one. -The new normal size of WINDOW (see `window-normal-size') is that set by -the last call of `set-window-new-normal' for WINDOW. */) +The new normal size of WINDOW is the value set by the last call of +`set-window-new-normal' for WINDOW. If valid, it will be shortly +installed as WINDOW's normal size (see `window-normal-size'). */) (Lisp_Object window) { return decode_valid_window (window)->new_normal; @@ -846,9 +849,9 @@ DEFUN ("window-new-pixel", Fwindow_new_pixel, Swindow_new_pixel, 0, 1, 0, WINDOW must be a valid window and defaults to the selected one. The new pixel size of WINDOW is the value set by the last call of -`set-window-new-pixel' for WINDOW. If set correctly, it gets eventually -installed by the function `window-resize-apply' and will be returned by -the functions `window-pixel-height' or `window-pixel-width'. */) +`set-window-new-pixel' for WINDOW. If it is valid, it will be shortly +installed as WINDOW's pixel height (see `window-pixel-height') or pixel +width (see `window-pixel-width'). */) (Lisp_Object window) { return decode_valid_window (window)->new_pixel; @@ -3744,9 +3747,9 @@ Return SIZE. Optional argument ADD non-nil means add SIZE to the new pixel size of WINDOW and return the sum. -The new pixel size of WINDOW is used by `window-resize-apply' and, if -that function succeeds, will be subsequently returned by the functions -`window-pixel-height' and `window-pixel-width'. +The new pixel size of WINDOW, if valid, will be shortly installed as +WINDOW's pixel height (see `window-pixel-height') or pixel width (see +`window-pixel-width'). Note: This function does not operate on any child windows of WINDOW. */) (Lisp_Object window, Lisp_Object size, Lisp_Object add) @@ -3772,8 +3775,9 @@ Return SIZE. Optional argument ADD non-nil means add SIZE to the new total size of WINDOW and return the sum. -The new total size of WINDOW is used by `window-resize-apply-total' and, -after calling that function, will be returned by `window-total-size'. +The new total size of WINDOW, if valid, will be shortly installed as +WINDOW's total height (see `window-total-height') or total width (see +`window-total-width'). Note: This function does not operate on any child windows of WINDOW. */) (Lisp_Object window, Lisp_Object size, Lisp_Object add) @@ -3794,9 +3798,8 @@ DEFUN ("set-window-new-normal", Fset_window_new_normal, Sset_window_new_normal, WINDOW must be a valid window and defaults to the selected one. Return SIZE. -The new normal size of WINDOW is used by `window-resize-apply' and, if -that function succeeds, will be subsequently returned by the function -`window-normal-size'. +The new normal size of WINDOW, if valid, will be shortly installed as +WINDOW's normal size (see `window-normal-size'). Note: This function does not operate on any child windows of WINDOW. */) (Lisp_Object window, Lisp_Object size) -- cgit v1.2.3 From f314e84fce8b394da20aa1d69121c74fb34f9a1e Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 10 Aug 2014 17:38:19 -0700 Subject: Revert 2013-01-31 change that decides coding system before backing up It causes a more serious problem than the one it solves. This closes bug#18141, and reopens bug#13522. * lisp/files.el (basic-save-buffer-2): Revert 2013-01-31 change. * src/fileio.c: Revert 2013-01-31 change. (choose_write_coding_system): No longer callable from Lisp. Move last piece back here from Fwrite_region. (Fwrite_region, syms_of_fileio): Update for above changes. * test/automated/data/files-bug18141.el.gz: New file. * test/automated/files.el (files-test-bug-18141-file): New variable and test. --- lisp/ChangeLog | 7 ++++++ lisp/files.el | 13 ++--------- src/ChangeLog | 9 ++++++++ src/fileio.c | 36 ++++++++++--------------------- test/ChangeLog | 6 ++++++ test/automated/data/files-bug18141.el.gz | Bin 0 -> 77 bytes test/automated/files.el | 18 ++++++++++++++++ 7 files changed, 53 insertions(+), 36 deletions(-) create mode 100644 test/automated/data/files-bug18141.el.gz (limited to 'src') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cec6e709c2b..ba8dac2c4e9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2014-08-11 Glenn Morris + + * files.el (basic-save-buffer-2): Revert 2013-01-31 change, which + chose coding system for writing before backing up, since it causes + a more serious problem than the one it solves. (Closes Bug#18141, + reopens Bug#13522.) + 2014-08-10 Martin Rudalics * window.el (window-total-size): Make doc-string more diff --git a/lisp/files.el b/lisp/files.el index 6c3b8f4fa4d..5ed5f8a6e1e 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4756,7 +4756,7 @@ Before and after saving the buffer, this function runs ;; This returns a value (MODES EXTENDED-ATTRIBUTES BACKUPNAME), like ;; backup-buffer. (defun basic-save-buffer-2 () - (let (tempsetmodes setmodes writecoding) + (let (tempsetmodes setmodes) (if (not (file-writable-p buffer-file-name)) (let ((dir (file-name-directory buffer-file-name))) (if (not (file-directory-p dir)) @@ -4772,14 +4772,6 @@ Before and after saving the buffer, this function runs buffer-file-name))) (setq tempsetmodes t) (error "Attempt to save to a file which you aren't allowed to write")))))) - ;; This may involve prompting, so do it now before backing up the file. - ;; Otherwise there can be a delay while the user answers the - ;; prompt during which the original file has been renamed. (Bug#13522) - (setq writecoding - ;; Args here should match write-region call below around - ;; which we use writecoding. - (choose-write-coding-system nil nil buffer-file-name nil t - buffer-file-truename)) (or buffer-backed-up (setq setmodes (backup-buffer))) (let* ((dir (file-name-directory buffer-file-name)) @@ -4861,11 +4853,10 @@ Before and after saving the buffer, this function runs (logior (car setmodes) 128)))))) (let (success) (unwind-protect + (progn ;; Pass in nil&nil rather than point-min&max to indicate ;; we're saving the buffer rather than just a region. ;; write-region-annotate-functions may make us of it. - (let ((coding-system-for-write writecoding) - (coding-system-require-warning nil)) (write-region nil nil buffer-file-name nil t buffer-file-truename) (setq success t)) diff --git a/src/ChangeLog b/src/ChangeLog index 6ecce26be14..92d90accc60 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2014-08-11 Glenn Morris + + * fileio.c: Revert 2013-01-31 change, which chose coding system for + writing before backing up, since it causes a more serious problem + than the one it solves. (Closes Bug#18141, reopens Bug#13522.) + (choose_write_coding_system): No longer callable from Lisp. + Move last piece back here from Fwrite_region. + (Fwrite_region, syms_of_fileio): Update for above changes. + 2014-08-09 Martin Rudalics * window.c (Fwindow_new_total, Fwindow_new_normal) diff --git a/src/fileio.c b/src/fileio.c index c87a6f71312..261928dd821 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -323,7 +323,6 @@ static Lisp_Object Qfile_acl; static Lisp_Object Qset_file_acl; static Lisp_Object Qfile_newer_than_file_p; Lisp_Object Qinsert_file_contents; -static Lisp_Object Qchoose_write_coding_system; Lisp_Object Qwrite_region; static Lisp_Object Qverify_visited_file_modtime; static Lisp_Object Qset_visited_file_modtime; @@ -4531,24 +4530,14 @@ build_annotations_unwind (Lisp_Object arg) /* Decide the coding-system to encode the data with. */ -DEFUN ("choose-write-coding-system", Fchoose_write_coding_system, - Schoose_write_coding_system, 3, 6, 0, - doc: /* Choose the coding system for writing a file. -Arguments are as for `write-region'. -This function is for internal use only. It may prompt the user. */ ) - (Lisp_Object start, Lisp_Object end, Lisp_Object filename, - Lisp_Object append, Lisp_Object visit, Lisp_Object lockname) +static Lisp_Object +choose_write_coding_system (Lisp_Object start, Lisp_Object end, Lisp_Object filename, + Lisp_Object append, Lisp_Object visit, Lisp_Object lockname, + struct coding_system *coding) { Lisp_Object val; Lisp_Object eol_parent = Qnil; - /* Mimic write-region behavior. */ - if (NILP (start)) - { - XSETFASTINT (start, BEGV); - XSETFASTINT (end, ZV); - } - if (auto_saving && NILP (Fstring_equal (BVAR (current_buffer, filename), BVAR (current_buffer, auto_save_file_name)))) @@ -4641,6 +4630,10 @@ This function is for internal use only. It may prompt the user. */ ) } val = coding_inherit_eol_type (val, eol_parent); + setup_coding_system (val, coding); + + if (!STRINGP (start) && !NILP (BVAR (current_buffer, selective_display))) + coding->mode |= CODING_MODE_SELECTIVE_DISPLAY; return val; } @@ -4809,14 +4802,9 @@ write_region (Lisp_Object start, Lisp_Object end, Lisp_Object filename, We used to make this choice before calling build_annotations, but that leads to problems when a write-annotate-function takes care of unsavable chars (as was the case with X-Symbol). */ - Vlast_coding_system_used = - Fchoose_write_coding_system (start, end, filename, - append, visit, lockname); - - setup_coding_system (Vlast_coding_system_used, &coding); - - if (!STRINGP (start) && !NILP (BVAR (current_buffer, selective_display))) - coding.mode |= CODING_MODE_SELECTIVE_DISPLAY; + Vlast_coding_system_used + = choose_write_coding_system (start, end, filename, + append, visit, lockname, &coding); #ifdef CLASH_DETECTION if (open_and_close_file && !auto_saving) @@ -5861,7 +5849,6 @@ syms_of_fileio (void) DEFSYM (Qset_file_acl, "set-file-acl"); DEFSYM (Qfile_newer_than_file_p, "file-newer-than-file-p"); DEFSYM (Qinsert_file_contents, "insert-file-contents"); - DEFSYM (Qchoose_write_coding_system, "choose-write-coding-system"); DEFSYM (Qwrite_region, "write-region"); DEFSYM (Qverify_visited_file_modtime, "verify-visited-file-modtime"); DEFSYM (Qset_visited_file_modtime, "set-visited-file-modtime"); @@ -6100,7 +6087,6 @@ This includes interactive calls to `delete-file' and defsubr (&Sdefault_file_modes); defsubr (&Sfile_newer_than_file_p); defsubr (&Sinsert_file_contents); - defsubr (&Schoose_write_coding_system); defsubr (&Swrite_region); defsubr (&Scar_less_than_car); defsubr (&Sverify_visited_file_modtime); diff --git a/test/ChangeLog b/test/ChangeLog index d68c5b6bb07..d5c5e58f09c 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,9 @@ +2014-08-11 Glenn Morris + + * automated/data/files-bug18141.el.gz: New file. + * automated/files.el (files-test-bug-18141-file): + New variable and test. (Bug#18141) + 2014-08-07 Glenn Morris * automated/Makefile.in (check-tar): Remove, no longer needed. diff --git a/test/automated/data/files-bug18141.el.gz b/test/automated/data/files-bug18141.el.gz new file mode 100644 index 00000000000..53d463e85b5 Binary files /dev/null and b/test/automated/data/files-bug18141.el.gz differ diff --git a/test/automated/files.el b/test/automated/files.el index 44816bc33f5..8db06f7dfe3 100644 --- a/test/automated/files.el +++ b/test/automated/files.el @@ -148,6 +148,24 @@ form.") (should (file-test--do-local-variables-test str subtest)))))) (ad-disable-advice 'hack-local-variables-confirm 'around 'files-test))) +(defvar files-test-bug-18141-file + (expand-file-name "data/files-bug18141.el.gz" (getenv "EMACS_TEST_DIRECTORY")) + "Test file for bug#18141.") + +(ert-deftest files-test-bug-18141 () + "Test for http://debbugs.gnu.org/18141 ." + (skip-unless (executable-find "gzip")) + (let ((tempfile (make-temp-file "files-test-bug-18141" nil ".gz"))) + (unwind-protect + (progn + (copy-file files-test-bug-18141-file tempfile t) + (with-current-buffer (find-file-noselect tempfile) + (set-buffer-modified-p t) + (save-buffer) + (should (eq buffer-file-coding-system 'iso-2022-7bit-unix)))) + (delete-file tempfile)))) + + ;; Stop the above "Local Var..." confusing Emacs. -- cgit v1.2.3