diff options
| author | Miles Bader | 2007-07-18 22:15:15 +0000 |
|---|---|---|
| committer | Miles Bader | 2007-07-18 22:15:15 +0000 |
| commit | 4dacf5c59890f619e2285e6afae1061c763d87fa (patch) | |
| tree | eee51e638782332d75082c4f420708c35ffdd451 /src | |
| parent | 4bb99e3a15f1e7e13103df4908814294dc974463 (diff) | |
| parent | 6e3aa3f58ef253559ce6416d6aa02885cd944ff1 (diff) | |
| download | emacs-4dacf5c59890f619e2285e6afae1061c763d87fa.tar.gz emacs-4dacf5c59890f619e2285e6afae1061c763d87fa.zip | |
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 814-815)
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-232
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 43 | ||||
| -rw-r--r-- | src/abbrev.c | 74 | ||||
| -rw-r--r-- | src/makefile.w32-in | 4 | ||||
| -rw-r--r-- | src/process.c | 6 | ||||
| -rw-r--r-- | src/window.c | 109 |
5 files changed, 182 insertions, 54 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 76c8c8ef163..af29937753c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,46 @@ | |||
| 1 | 2007-07-17 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * window.c (Fdisplay_buffer): If largest or LRU window is the | ||
| 4 | only window, split it even if it is not eligible for splitting. | ||
| 5 | This restores the original behavior broken by the 2007-07-15 | ||
| 6 | change. | ||
| 7 | |||
| 8 | 2007-07-17 Glenn Morris <rgm@gnu.org> | ||
| 9 | |||
| 10 | * abbrev.c (abbrev_check_chars): New function. | ||
| 11 | (Fdefine_global_abbrev, Fdefine_mode_abbrev): Call | ||
| 12 | abbrev_check_chars to check abbrev characters are word | ||
| 13 | constituents. Doc fix. | ||
| 14 | |||
| 15 | 2007-07-17 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 16 | |||
| 17 | * process.c (Fstart_process, Fmake_network_process) | ||
| 18 | (read_process_output): Fix up last changes. | ||
| 19 | |||
| 20 | 2007-07-16 Eli Zaretskii <eliz@gnu.org> | ||
| 21 | |||
| 22 | * makefile.w32-in (clean): Don't delete *~. | ||
| 23 | |||
| 24 | 2007-07-16 Andreas Schwab <schwab@suse.de> | ||
| 25 | |||
| 26 | * window.c (Fdisplay_buffer): Use NILP. | ||
| 27 | (Fset_window_scroll_bars): Likewise. | ||
| 28 | |||
| 29 | 2007-07-15 Martin Rudalics <rudalics@gmx.at> | ||
| 30 | |||
| 31 | * window.c (window_min_size_2): New function. | ||
| 32 | (window_min_size_1, size_window, Fdisplay_buffer) | ||
| 33 | (Fsplit_window, adjust_window_trailing_edge): Use it to avoid | ||
| 34 | windows without mode- or header-lines when window-min-height is | ||
| 35 | too small. | ||
| 36 | (size_window): Reset nodelete_p after testing it, following an | ||
| 37 | earlier note by Kim F. Storm. | ||
| 38 | (display_buffer): Do not set split_height_threshold to twice the | ||
| 39 | value of window_min_height to avoid changing the value of a | ||
| 40 | customizable variable. Rather explicitly check whether the | ||
| 41 | height of the window that shall be splitted is at least as large | ||
| 42 | as split_height_threshold. | ||
| 43 | |||
| 1 | 2007-07-14 Jason Rumney <jasonr@gnu.org> | 44 | 2007-07-14 Jason Rumney <jasonr@gnu.org> |
| 2 | 45 | ||
| 3 | * process.c [WINDOWSNT]: Don't undefine AF_INET6. | 46 | * process.c [WINDOWSNT]: Don't undefine AF_INET6. |
diff --git a/src/abbrev.c b/src/abbrev.c index cb8e334591c..dd075364507 100644 --- a/src/abbrev.c +++ b/src/abbrev.c | |||
| @@ -172,12 +172,79 @@ overwrite a non-system abbreviation of the same name. */) | |||
| 172 | return name; | 172 | return name; |
| 173 | } | 173 | } |
| 174 | 174 | ||
| 175 | /* Check if the characters in ABBREV have word syntax in either the | ||
| 176 | * current (if global == 0) or standard syntax table. */ | ||
| 177 | static void | ||
| 178 | abbrev_check_chars (abbrev, global) | ||
| 179 | Lisp_Object abbrev; | ||
| 180 | int global; | ||
| 181 | { | ||
| 182 | int i, i_byte, len, nbad = 0; | ||
| 183 | int j, found, nuniq = 0; | ||
| 184 | char *badchars, *baduniq; | ||
| 185 | |||
| 186 | CHECK_STRING (abbrev); | ||
| 187 | len = SCHARS (abbrev); | ||
| 188 | |||
| 189 | badchars = (char *) alloca (len + 1); | ||
| 190 | |||
| 191 | for (i = 0, i_byte = 0; i < len; ) | ||
| 192 | { | ||
| 193 | int c; | ||
| 194 | |||
| 195 | FETCH_STRING_CHAR_ADVANCE (c, abbrev, i, i_byte); | ||
| 196 | |||
| 197 | if (global) | ||
| 198 | { | ||
| 199 | /* Copied from SYNTAX in syntax.h, except using FOLLOW_PARENT. */ | ||
| 200 | Lisp_Object syntax_temp | ||
| 201 | = SYNTAX_ENTRY_FOLLOW_PARENT (Vstandard_syntax_table, c); | ||
| 202 | if ( (CONSP (syntax_temp) | ||
| 203 | ? (enum syntaxcode) (XINT (XCAR (syntax_temp)) & 0xff) | ||
| 204 | : Swhitespace) != Sword ) badchars[nbad++] = c; | ||
| 205 | } | ||
| 206 | else if (SYNTAX (c) != Sword) | ||
| 207 | badchars[nbad++] = c; | ||
| 208 | } | ||
| 209 | |||
| 210 | if (nbad == 0) return; | ||
| 211 | |||
| 212 | baduniq = (char *) alloca (nbad + 1); | ||
| 213 | |||
| 214 | for (i = 0; i < nbad; i++) | ||
| 215 | { | ||
| 216 | found = 0; | ||
| 217 | |||
| 218 | for (j = 0; j < nuniq; j++) | ||
| 219 | { | ||
| 220 | if (badchars[i] == baduniq[j]) | ||
| 221 | { | ||
| 222 | found = 1; | ||
| 223 | break; | ||
| 224 | } | ||
| 225 | } | ||
| 226 | |||
| 227 | if (found) continue ; | ||
| 228 | |||
| 229 | baduniq[nuniq++] = badchars[i]; | ||
| 230 | } | ||
| 231 | |||
| 232 | baduniq[nuniq] = '\0'; | ||
| 233 | |||
| 234 | error ("Some abbrev characters (%s) are not word constituents %s", | ||
| 235 | baduniq, global ? "in the standard syntax" : "in this mode" ); | ||
| 236 | } | ||
| 237 | |||
| 175 | DEFUN ("define-global-abbrev", Fdefine_global_abbrev, Sdefine_global_abbrev, 2, 2, | 238 | DEFUN ("define-global-abbrev", Fdefine_global_abbrev, Sdefine_global_abbrev, 2, 2, |
| 176 | "sDefine global abbrev: \nsExpansion for %s: ", | 239 | "sDefine global abbrev: \nsExpansion for %s: ", |
| 177 | doc: /* Define ABBREV as a global abbreviation for EXPANSION. */) | 240 | doc: /* Define ABBREV as a global abbreviation for EXPANSION. |
| 241 | The characters in ABBREV must all be word constituents in the standard | ||
| 242 | syntax table. */) | ||
| 178 | (abbrev, expansion) | 243 | (abbrev, expansion) |
| 179 | Lisp_Object abbrev, expansion; | 244 | Lisp_Object abbrev, expansion; |
| 180 | { | 245 | { |
| 246 | abbrev_check_chars (abbrev, 1); | ||
| 247 | |||
| 181 | Fdefine_abbrev (Vglobal_abbrev_table, Fdowncase (abbrev), | 248 | Fdefine_abbrev (Vglobal_abbrev_table, Fdowncase (abbrev), |
| 182 | expansion, Qnil, make_number (0), Qnil); | 249 | expansion, Qnil, make_number (0), Qnil); |
| 183 | return abbrev; | 250 | return abbrev; |
| @@ -185,13 +252,16 @@ DEFUN ("define-global-abbrev", Fdefine_global_abbrev, Sdefine_global_abbrev, 2, | |||
| 185 | 252 | ||
| 186 | DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev, Sdefine_mode_abbrev, 2, 2, | 253 | DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev, Sdefine_mode_abbrev, 2, 2, |
| 187 | "sDefine mode abbrev: \nsExpansion for %s: ", | 254 | "sDefine mode abbrev: \nsExpansion for %s: ", |
| 188 | doc: /* Define ABBREV as a mode-specific abbreviation for EXPANSION. */) | 255 | doc: /* Define ABBREV as a mode-specific abbreviation for EXPANSION. |
| 256 | The characters in ABBREV must all be word-constituents in the current mode. */) | ||
| 189 | (abbrev, expansion) | 257 | (abbrev, expansion) |
| 190 | Lisp_Object abbrev, expansion; | 258 | Lisp_Object abbrev, expansion; |
| 191 | { | 259 | { |
| 192 | if (NILP (current_buffer->abbrev_table)) | 260 | if (NILP (current_buffer->abbrev_table)) |
| 193 | error ("Major mode has no abbrev table"); | 261 | error ("Major mode has no abbrev table"); |
| 194 | 262 | ||
| 263 | abbrev_check_chars (abbrev, 0); | ||
| 264 | |||
| 195 | Fdefine_abbrev (current_buffer->abbrev_table, Fdowncase (abbrev), | 265 | Fdefine_abbrev (current_buffer->abbrev_table, Fdowncase (abbrev), |
| 196 | expansion, Qnil, make_number (0), Qnil); | 266 | expansion, Qnil, make_number (0), Qnil); |
| 197 | return abbrev; | 267 | return abbrev; |
diff --git a/src/makefile.w32-in b/src/makefile.w32-in index 280429b5a71..ea5382ff9f3 100644 --- a/src/makefile.w32-in +++ b/src/makefile.w32-in | |||
| @@ -257,8 +257,10 @@ install: $(ALL) | |||
| 257 | # | 257 | # |
| 258 | # Maintenance | 258 | # Maintenance |
| 259 | # | 259 | # |
| 260 | # We used to delete *~, s/*~, m/*~ here, but that might inadvertently | ||
| 261 | # remove precious files if it happens to match their short 8+3 aliases. | ||
| 260 | clean: | 262 | clean: |
| 261 | - $(DEL) *~ "s/*~" "m/*~" | 263 | - $(DEL) "s/*.h~" "m/*.h~" |
| 262 | - $(DEL) $(COMPILER_TEMP_FILES) | 264 | - $(DEL) $(COMPILER_TEMP_FILES) |
| 263 | - $(DEL_TREE) $(OBJDIR) | 265 | - $(DEL_TREE) $(OBJDIR) |
| 264 | - $(DEL) stamp_BLD | 266 | - $(DEL) stamp_BLD |
diff --git a/src/process.c b/src/process.c index 5551c0610d0..30cc13cfb2c 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -1775,7 +1775,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */) | |||
| 1775 | XPROCESS (proc)->encoding_buf = make_uninit_string (0); | 1775 | XPROCESS (proc)->encoding_buf = make_uninit_string (0); |
| 1776 | 1776 | ||
| 1777 | XPROCESS (proc)->inherit_coding_system_flag | 1777 | XPROCESS (proc)->inherit_coding_system_flag |
| 1778 | = (NILP (buffer) || !inherit_process_coding_system); | 1778 | = !(NILP (buffer) || !inherit_process_coding_system); |
| 1779 | 1779 | ||
| 1780 | create_process (proc, (char **) new_argv, current_dir); | 1780 | create_process (proc, (char **) new_argv, current_dir); |
| 1781 | 1781 | ||
| @@ -3547,7 +3547,7 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3547 | p->encoding_buf = make_uninit_string (0); | 3547 | p->encoding_buf = make_uninit_string (0); |
| 3548 | 3548 | ||
| 3549 | p->inherit_coding_system_flag | 3549 | p->inherit_coding_system_flag |
| 3550 | = (!NILP (tem) || NILP (buffer) || !inherit_process_coding_system); | 3550 | = !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system); |
| 3551 | 3551 | ||
| 3552 | UNGCPRO; | 3552 | UNGCPRO; |
| 3553 | return proc; | 3553 | return proc; |
| @@ -5176,7 +5176,7 @@ read_process_output (proc, channel) | |||
| 5176 | p->decoding_carryover = coding->carryover_bytes; | 5176 | p->decoding_carryover = coding->carryover_bytes; |
| 5177 | } | 5177 | } |
| 5178 | /* Adjust the multibyteness of TEXT to that of the filter. */ | 5178 | /* Adjust the multibyteness of TEXT to that of the filter. */ |
| 5179 | if (p->filter_multibyte != STRING_MULTIBYTE (text)) | 5179 | if (!p->filter_multibyte != !STRING_MULTIBYTE (text)) |
| 5180 | text = (STRING_MULTIBYTE (text) | 5180 | text = (STRING_MULTIBYTE (text) |
| 5181 | ? Fstring_as_unibyte (text) | 5181 | ? Fstring_as_unibyte (text) |
| 5182 | : Fstring_to_multibyte (text)); | 5182 | : Fstring_to_multibyte (text)); |
diff --git a/src/window.c b/src/window.c index 42a33828d8d..59b70152b09 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -62,6 +62,7 @@ static void window_scroll P_ ((Lisp_Object, int, int, int)); | |||
| 62 | static void window_scroll_pixel_based P_ ((Lisp_Object, int, int, int)); | 62 | static void window_scroll_pixel_based P_ ((Lisp_Object, int, int, int)); |
| 63 | static void window_scroll_line_based P_ ((Lisp_Object, int, int, int)); | 63 | static void window_scroll_line_based P_ ((Lisp_Object, int, int, int)); |
| 64 | static int window_min_size_1 P_ ((struct window *, int)); | 64 | static int window_min_size_1 P_ ((struct window *, int)); |
| 65 | static int window_min_size_2 P_ ((struct window *, int)); | ||
| 65 | static int window_min_size P_ ((struct window *, int, int, int *)); | 66 | static int window_min_size P_ ((struct window *, int, int, int *)); |
| 66 | static void size_window P_ ((Lisp_Object, int, int, int, int, int)); | 67 | static void size_window P_ ((Lisp_Object, int, int, int, int, int)); |
| 67 | static int freeze_window_start P_ ((struct window *, void *)); | 68 | static int freeze_window_start P_ ((struct window *, void *)); |
| @@ -2553,7 +2554,6 @@ check_frame_size (frame, rows, cols) | |||
| 2553 | *cols = MIN_SAFE_WINDOW_WIDTH; | 2554 | *cols = MIN_SAFE_WINDOW_WIDTH; |
| 2554 | } | 2555 | } |
| 2555 | 2556 | ||
| 2556 | |||
| 2557 | /* Value is non-zero if window W is fixed-size. WIDTH_P non-zero means | 2557 | /* Value is non-zero if window W is fixed-size. WIDTH_P non-zero means |
| 2558 | check if W's width can be changed, otherwise check W's height. | 2558 | check if W's width can be changed, otherwise check W's height. |
| 2559 | CHECK_SIBLINGS_P non-zero means check resizablity of WINDOW's | 2559 | CHECK_SIBLINGS_P non-zero means check resizablity of WINDOW's |
| @@ -2655,6 +2655,33 @@ window_fixed_size_p (w, width_p, check_siblings_p) | |||
| 2655 | return fixed_p; | 2655 | return fixed_p; |
| 2656 | } | 2656 | } |
| 2657 | 2657 | ||
| 2658 | /* Return the minimum size for leaf window W. WIDTH_P non-zero means | ||
| 2659 | take into account fringes and the scrollbar of W. WIDTH_P zero | ||
| 2660 | means take into account mode-line and header-line of W. Return 1 | ||
| 2661 | for the minibuffer. */ | ||
| 2662 | |||
| 2663 | static int | ||
| 2664 | window_min_size_2 (w, width_p) | ||
| 2665 | struct window *w; | ||
| 2666 | int width_p; | ||
| 2667 | { | ||
| 2668 | int size; | ||
| 2669 | |||
| 2670 | if (width_p) | ||
| 2671 | size = max (window_min_width, | ||
| 2672 | (MIN_SAFE_WINDOW_WIDTH | ||
| 2673 | + WINDOW_FRINGE_COLS (w) | ||
| 2674 | + WINDOW_SCROLL_BAR_COLS (w))); | ||
| 2675 | else if (MINI_WINDOW_P (w)) | ||
| 2676 | size = 1; | ||
| 2677 | else | ||
| 2678 | size = max (window_min_height, | ||
| 2679 | (MIN_SAFE_WINDOW_HEIGHT | ||
| 2680 | + (WINDOW_WANTS_MODELINE_P (w) ? 1 : 0) | ||
| 2681 | + (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0 ))); | ||
| 2682 | |||
| 2683 | return size; | ||
| 2684 | } | ||
| 2658 | 2685 | ||
| 2659 | /* Return the minimum size of window W, not taking fixed-width windows | 2686 | /* Return the minimum size of window W, not taking fixed-width windows |
| 2660 | into account. WIDTH_P non-zero means return the minimum width, | 2687 | into account. WIDTH_P non-zero means return the minimum width, |
| @@ -2724,22 +2751,7 @@ window_min_size_1 (w, width_p) | |||
| 2724 | } | 2751 | } |
| 2725 | } | 2752 | } |
| 2726 | else | 2753 | else |
| 2727 | { | 2754 | size = window_min_size_2 (w, width_p); |
| 2728 | if (width_p) | ||
| 2729 | size = max (window_min_width, | ||
| 2730 | (MIN_SAFE_WINDOW_WIDTH | ||
| 2731 | + WINDOW_FRINGE_COLS (w) | ||
| 2732 | + WINDOW_SCROLL_BAR_COLS (w))); | ||
| 2733 | else | ||
| 2734 | { | ||
| 2735 | if (MINI_WINDOW_P (w) | ||
| 2736 | || (!WINDOW_WANTS_MODELINE_P (w) | ||
| 2737 | && !WINDOW_WANTS_HEADER_LINE_P (w))) | ||
| 2738 | size = 1; | ||
| 2739 | else | ||
| 2740 | size = window_min_height; | ||
| 2741 | } | ||
| 2742 | } | ||
| 2743 | 2755 | ||
| 2744 | return size; | 2756 | return size; |
| 2745 | } | 2757 | } |
| @@ -2981,11 +2993,6 @@ size_window (window, size, width_p, nodelete_p, first_only, last_only) | |||
| 2981 | Lisp_Object child, *forward, *sideward; | 2993 | Lisp_Object child, *forward, *sideward; |
| 2982 | int old_size, min_size, safe_min_size; | 2994 | int old_size, min_size, safe_min_size; |
| 2983 | 2995 | ||
| 2984 | /* We test nodelete_p != 2 and nodelete_p != 1 below, so it | ||
| 2985 | seems like it's too soon to do this here. ++KFS. */ | ||
| 2986 | if (nodelete_p == 2) | ||
| 2987 | nodelete_p = 0; | ||
| 2988 | |||
| 2989 | check_min_window_sizes (); | 2996 | check_min_window_sizes (); |
| 2990 | size = max (0, size); | 2997 | size = max (0, size); |
| 2991 | 2998 | ||
| @@ -2996,22 +3003,23 @@ size_window (window, size, width_p, nodelete_p, first_only, last_only) | |||
| 2996 | { | 3003 | { |
| 2997 | old_size = WINDOW_TOTAL_COLS (w); | 3004 | old_size = WINDOW_TOTAL_COLS (w); |
| 2998 | min_size = window_min_width; | 3005 | min_size = window_min_width; |
| 2999 | /* Ensure that there is room for the scroll bar and fringes! | 3006 | safe_min_size = window_min_size_2 (w, 1); |
| 3000 | We may reduce display margins though. */ | ||
| 3001 | safe_min_size = (MIN_SAFE_WINDOW_WIDTH | ||
| 3002 | + WINDOW_FRINGE_COLS (w) | ||
| 3003 | + WINDOW_SCROLL_BAR_COLS (w)); | ||
| 3004 | } | 3007 | } |
| 3005 | else | 3008 | else |
| 3006 | { | 3009 | { |
| 3007 | old_size = XINT (w->total_lines); | 3010 | old_size = XINT (w->total_lines); |
| 3008 | min_size = window_min_height; | 3011 | min_size = window_min_height; |
| 3009 | safe_min_size = MIN_SAFE_WINDOW_HEIGHT; | 3012 | safe_min_size = window_min_size_2 (w, 0); |
| 3010 | } | 3013 | } |
| 3011 | 3014 | ||
| 3012 | if (old_size < min_size && nodelete_p != 2) | 3015 | if (old_size < min_size && nodelete_p != 2) |
| 3013 | w->too_small_ok = Qt; | 3016 | w->too_small_ok = Qt; |
| 3014 | 3017 | ||
| 3018 | /* Move the following test here since otherwise the | ||
| 3019 | preceding test doesn't make sense. martin. */ | ||
| 3020 | if (nodelete_p == 2) | ||
| 3021 | nodelete_p = 0; | ||
| 3022 | |||
| 3015 | /* Maybe delete WINDOW if it's too small. */ | 3023 | /* Maybe delete WINDOW if it's too small. */ |
| 3016 | if (nodelete_p != 1 && !NILP (w->parent)) | 3024 | if (nodelete_p != 1 && !NILP (w->parent)) |
| 3017 | { | 3025 | { |
| @@ -3708,9 +3716,6 @@ displayed. */) | |||
| 3708 | frames = Qnil; | 3716 | frames = Qnil; |
| 3709 | if (FRAME_MINIBUF_ONLY_P (f)) | 3717 | if (FRAME_MINIBUF_ONLY_P (f)) |
| 3710 | XSETFRAME (frames, last_nonminibuf_frame); | 3718 | XSETFRAME (frames, last_nonminibuf_frame); |
| 3711 | /* Don't try to create a window if we would get an error. */ | ||
| 3712 | if (split_height_threshold < window_min_height << 1) | ||
| 3713 | split_height_threshold = window_min_height << 1; | ||
| 3714 | 3719 | ||
| 3715 | /* Note that both Fget_largest_window and Fget_lru_window | 3720 | /* Note that both Fget_largest_window and Fget_lru_window |
| 3716 | ignore minibuffers and dedicated windows. | 3721 | ignore minibuffers and dedicated windows. |
| @@ -3733,25 +3738,30 @@ displayed. */) | |||
| 3733 | else | 3738 | else |
| 3734 | window = Fget_largest_window (frames, Qt); | 3739 | window = Fget_largest_window (frames, Qt); |
| 3735 | 3740 | ||
| 3736 | /* If we got a tall enough full-width window that can be split, | 3741 | /* If the largest window is tall enough, full-width, and either eligible |
| 3737 | split it. */ | 3742 | for splitting or the only window, split it. */ |
| 3738 | if (!NILP (window) | 3743 | if (!NILP (window) |
| 3739 | && ! FRAME_NO_SPLIT_P (XFRAME (XWINDOW (window)->frame)) | 3744 | && ! FRAME_NO_SPLIT_P (XFRAME (XWINDOW (window)->frame)) |
| 3740 | && window_height (window) >= split_height_threshold | 3745 | && WINDOW_FULL_WIDTH_P (XWINDOW (window)) |
| 3741 | && WINDOW_FULL_WIDTH_P (XWINDOW (window))) | 3746 | && (window_height (window) >= split_height_threshold |
| 3747 | || (NILP (XWINDOW (window)->parent))) | ||
| 3748 | && (window_height (window) | ||
| 3749 | >= (2 * window_min_size_2 (XWINDOW (window), 0)))) | ||
| 3742 | window = Fsplit_window (window, Qnil, Qnil); | 3750 | window = Fsplit_window (window, Qnil, Qnil); |
| 3743 | else | 3751 | else |
| 3744 | { | 3752 | { |
| 3745 | Lisp_Object upper, other; | 3753 | Lisp_Object upper, other; |
| 3746 | 3754 | ||
| 3747 | window = Fget_lru_window (frames, Qt); | 3755 | window = Fget_lru_window (frames, Qt); |
| 3748 | /* If the LRU window is selected, and big enough, | 3756 | /* If the LRU window is tall enough, and either eligible for splitting |
| 3749 | and can be split, split it. */ | 3757 | and selected or the only window, split it. */ |
| 3750 | if (!NILP (window) | 3758 | if (!NILP (window) |
| 3751 | && ! FRAME_NO_SPLIT_P (XFRAME (XWINDOW (window)->frame)) | 3759 | && ! FRAME_NO_SPLIT_P (XFRAME (XWINDOW (window)->frame)) |
| 3752 | && (EQ (window, selected_window) | 3760 | && ((EQ (window, selected_window) |
| 3753 | || EQ (XWINDOW (window)->parent, Qnil)) | 3761 | && window_height (window) >= split_height_threshold) |
| 3754 | && window_height (window) >= window_min_height << 1) | 3762 | || (NILP (XWINDOW (window)->parent))) |
| 3763 | && (window_height (window) | ||
| 3764 | >= (2 * window_min_size_2 (XWINDOW (window), 0)))) | ||
| 3755 | window = Fsplit_window (window, Qnil, Qnil); | 3765 | window = Fsplit_window (window, Qnil, Qnil); |
| 3756 | else | 3766 | else |
| 3757 | window = Fget_lru_window (frames, Qnil); | 3767 | window = Fget_lru_window (frames, Qnil); |
| @@ -4000,9 +4010,11 @@ See Info node `(elisp)Splitting Windows' for more details and examples.*/) | |||
| 4000 | 4010 | ||
| 4001 | if (NILP (horflag)) | 4011 | if (NILP (horflag)) |
| 4002 | { | 4012 | { |
| 4003 | if (size_int < window_min_height) | 4013 | int window_safe_height = window_min_size_2 (o, 0); |
| 4014 | |||
| 4015 | if (size_int < window_safe_height) | ||
| 4004 | error ("Window height %d too small (after splitting)", size_int); | 4016 | error ("Window height %d too small (after splitting)", size_int); |
| 4005 | if (size_int + window_min_height > XFASTINT (o->total_lines)) | 4017 | if (size_int + window_safe_height > XFASTINT (o->total_lines)) |
| 4006 | error ("Window height %d too small (after splitting)", | 4018 | error ("Window height %d too small (after splitting)", |
| 4007 | XFASTINT (o->total_lines) - size_int); | 4019 | XFASTINT (o->total_lines) - size_int); |
| 4008 | if (NILP (o->parent) | 4020 | if (NILP (o->parent) |
| @@ -4015,10 +4027,11 @@ See Info node `(elisp)Splitting Windows' for more details and examples.*/) | |||
| 4015 | } | 4027 | } |
| 4016 | else | 4028 | else |
| 4017 | { | 4029 | { |
| 4018 | if (size_int < window_min_width) | 4030 | int window_safe_width = window_min_size_2 (o, 1); |
| 4031 | |||
| 4032 | if (size_int < window_safe_width) | ||
| 4019 | error ("Window width %d too small (after splitting)", size_int); | 4033 | error ("Window width %d too small (after splitting)", size_int); |
| 4020 | 4034 | if (size_int + window_safe_width > XFASTINT (o->total_cols)) | |
| 4021 | if (size_int + window_min_width > XFASTINT (o->total_cols)) | ||
| 4022 | error ("Window width %d too small (after splitting)", | 4035 | error ("Window width %d too small (after splitting)", |
| 4023 | XFASTINT (o->total_cols) - size_int); | 4036 | XFASTINT (o->total_cols) - size_int); |
| 4024 | if (NILP (o->parent) | 4037 | if (NILP (o->parent) |
| @@ -4499,7 +4512,7 @@ adjust_window_trailing_edge (window, delta, horiz_flag) | |||
| 4499 | 4512 | ||
| 4500 | /* Don't make this window too small. */ | 4513 | /* Don't make this window too small. */ |
| 4501 | if (XINT (CURSIZE (window)) + delta | 4514 | if (XINT (CURSIZE (window)) + delta |
| 4502 | < (horiz_flag ? window_min_width : window_min_height)) | 4515 | < window_min_size_2 (XWINDOW (window), horiz_flag)) |
| 4503 | { | 4516 | { |
| 4504 | Fset_window_configuration (old_config); | 4517 | Fset_window_configuration (old_config); |
| 4505 | error ("Cannot adjust window size as specified"); | 4518 | error ("Cannot adjust window size as specified"); |
| @@ -6897,7 +6910,7 @@ Fourth parameter HORIZONTAL-TYPE is currently unused. */) | |||
| 6897 | vertical_type = Qnil; | 6910 | vertical_type = Qnil; |
| 6898 | } | 6911 | } |
| 6899 | 6912 | ||
| 6900 | if (!(EQ (vertical_type, Qnil) | 6913 | if (!(NILP (vertical_type) |
| 6901 | || EQ (vertical_type, Qleft) | 6914 | || EQ (vertical_type, Qleft) |
| 6902 | || EQ (vertical_type, Qright) | 6915 | || EQ (vertical_type, Qright) |
| 6903 | || EQ (vertical_type, Qt))) | 6916 | || EQ (vertical_type, Qt))) |
| @@ -7589,4 +7602,4 @@ keys_of_window () | |||
| 7589 | } | 7602 | } |
| 7590 | 7603 | ||
| 7591 | /* arch-tag: 90a9c576-0590-48f1-a5f1-6c96a0452d9f | 7604 | /* arch-tag: 90a9c576-0590-48f1-a5f1-6c96a0452d9f |
| 7592 | (do not change this comment) */ | 7605 | (do not change thisc omment) */ |