summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2014-08-10 17:59:34 -0700
committerGlenn Morris <rgm@gnu.org>2014-08-10 17:59:34 -0700
commitc7367d2de3343e56171c4fe6d439a3ed5f40d06c (patch)
tree54fe9166f6b4320d9518bbac11e2d575a9fda7c2 /src
parent6b7d077506304f440d311fa7b29d210b7a3e121c (diff)
parentf314e84fce8b394da20aa1d69121c74fb34f9a1e (diff)
downloademacs-c7367d2de3343e56171c4fe6d439a3ed5f40d06c.tar.gz
emacs-c7367d2de3343e56171c4fe6d439a3ed5f40d06c.tar.bz2
emacs-c7367d2de3343e56171c4fe6d439a3ed5f40d06c.zip
Merge from emacs-24; up to 2014-06-28T23:35:17Z!rgm@gnu.org
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog30
-rw-r--r--src/buffer.c3
-rw-r--r--src/coding.c6
-rw-r--r--src/fileio.c36
-rw-r--r--src/fontset.c4
-rw-r--r--src/window.c64
6 files changed, 107 insertions, 36 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 0bc8a712112..aa2f95907eb 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,33 @@
+2014-08-11 Glenn Morris <rgm@gnu.org>
+
+ * 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-11 Martin Rudalics <rudalics@gmx.at>
+
+ * 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).
+ See also:
+ http://lists.gnu.org/archive/html/bug-gnu-emacs/2014-08/msg00287.html
+
+2014-08-11 Eli Zaretskii <eliz@gnu.org>
+
+ * fontset.c (Finternal_char_font): Recompute basic faces if the
+ frame's face cache was cleared. (Bug#18162)
+
+2014-08-11 Dmitry Antipov <dmantipov@yandex.ru>
+
+ 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-10 Reuben Thomas <rrt@sc3d.org>
Fix a couple of recent inadvertent breaks of the MSDOS port.
diff --git a/src/buffer.c b/src/buffer.c
index 1973a93a57d..d2c7729d1c2 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -826,6 +826,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);
diff --git a/src/coding.c b/src/coding.c
index 523a6bf0f27..8b620af8695 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,
@@ -11265,7 +11265,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,
diff --git a/src/fileio.c b/src/fileio.c
index f0bd75b170e..d9c7397c2de 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;
@@ -4525,24 +4524,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))))
@@ -4635,6 +4624,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;
}
@@ -4803,14 +4796,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);
if (open_and_close_file && !auto_saving)
{
@@ -5829,7 +5817,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");
@@ -6068,7 +6055,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/src/fontset.c b/src/fontset.c
index e34719e5cdf..d99a3bcb7ef 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -1843,6 +1843,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)
diff --git a/src/window.c b/src/window.c
index 049c0d122a3..ac685f6867f 100644
--- a/src/window.c
+++ b/src/window.c
@@ -329,7 +329,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;
@@ -810,7 +810,12 @@ 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 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;
@@ -819,7 +824,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);
@@ -829,7 +852,11 @@ 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 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;
@@ -837,7 +864,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 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;
@@ -3705,6 +3737,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, 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)
{
@@ -3729,6 +3765,10 @@ 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, 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)
{
@@ -3748,6 +3788,9 @@ 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, 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)
{
@@ -4012,9 +4055,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