diff options
| author | Karoly Lorentey | 2005-11-07 14:56:19 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2005-11-07 14:56:19 +0000 |
| commit | 79c3172f78d56cf88c927fb0ff5c3b30fd676686 (patch) | |
| tree | 20932caaa9695f3bb29b543f46107319a687308d /src | |
| parent | 9684e4c92f12f7c31f5e6fda7742960b403395f6 (diff) | |
| parent | fab0d3087eb5215a5d08379ac765af27abc28842 (diff) | |
| download | emacs-79c3172f78d56cf88c927fb0ff5c3b30fd676686.tar.gz emacs-79c3172f78d56cf88c927fb0ff5c3b30fd676686.zip | |
Merged from miles@gnu.org--gnu-2005 (patch 149-151, 629-641)
Patches applied:
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-629
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-630
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-631
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-632
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-633
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-634
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-635
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-636
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-637
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-638
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-639
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-640
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-641
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-149
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-150
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-151
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-437
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 147 | ||||
| -rw-r--r-- | src/Makefile.in | 6 | ||||
| -rw-r--r-- | src/alloc.c | 165 | ||||
| -rw-r--r-- | src/bytecode.c | 8 | ||||
| -rw-r--r-- | src/data.c | 22 | ||||
| -rw-r--r-- | src/editfns.c | 6 | ||||
| -rw-r--r-- | src/eval.c | 31 | ||||
| -rw-r--r-- | src/fringe.c | 16 | ||||
| -rw-r--r-- | src/keyboard.c | 2 | ||||
| -rw-r--r-- | src/lisp.h | 3 | ||||
| -rw-r--r-- | src/lread.c | 3 | ||||
| -rw-r--r-- | src/m/gould.h | 2 | ||||
| -rw-r--r-- | src/macfns.c | 3 | ||||
| -rw-r--r-- | src/puresize.h | 2 | ||||
| -rw-r--r-- | src/sheap.c | 8 | ||||
| -rw-r--r-- | src/syntax.c | 4 | ||||
| -rw-r--r-- | src/unexelf.c | 27 | ||||
| -rw-r--r-- | src/window.c | 128 | ||||
| -rw-r--r-- | src/xdisp.c | 111 | ||||
| -rw-r--r-- | src/xfns.c | 2 |
20 files changed, 513 insertions, 183 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 61a10be80dd..e2798ad1268 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,7 +1,145 @@ | |||
| 1 | 2005-11-04 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * window.c (Fget_lru_window, Fget_largest_window, window_loop): | ||
| 4 | Don't abuse the `mini' arg. Use the `obj' arg instead. | ||
| 5 | |||
| 6 | 2005-11-04 Kim F. Storm <storm@cua.dk> | ||
| 7 | |||
| 8 | * xdisp.c (show_mouse_face): Clear mouse face to eol. | ||
| 9 | |||
| 10 | 2005-11-03 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 11 | |||
| 12 | * Makefile.in (lisp, shortlisp): Add emacs-lisp/syntax.elc, | ||
| 13 | font-lock.elc and jit-lock.elc. | ||
| 14 | |||
| 15 | 2005-11-03 Richard M. Stallman <rms@gnu.org> | ||
| 16 | |||
| 17 | * window.c (Fenlarge_window): Rename SIDE to HORIZONTAL. | ||
| 18 | (enlarge_window): Rename WIDTHFLAG to HORIZ_FLAG. | ||
| 19 | (CURBEG, CURSIZE): Use HORIZ_FLAG instead of WIDTHFLAG. | ||
| 20 | |||
| 21 | * sheap.c (STATIC_HEAP_SIZE): Increment both definitions. | ||
| 22 | |||
| 23 | * alloc.c (refill_memory_reserve): Move decl out of conditionals. | ||
| 24 | |||
| 25 | 2005-11-03 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 26 | |||
| 27 | * window.c (Fdisplay_buffer): Fix last change to not use | ||
| 28 | a dedicated window. | ||
| 29 | |||
| 30 | 2005-11-01 Kim F. Storm <storm@cua.dk> | ||
| 31 | |||
| 32 | * fringe.c (update_window_fringes): Undo 2005-10-27 change. | ||
| 33 | Instead, rotate the bottom angle bitmap 180 degrees to indicate | ||
| 34 | that the bottom row does not end in a newline. | ||
| 35 | |||
| 36 | 2005-11-01 Andreas Schwab <schwab@suse.de> | ||
| 37 | |||
| 38 | * unexelf.c (unexec): Handle .plt section in BSS segment. | ||
| 39 | |||
| 40 | 2005-11-01 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 41 | |||
| 42 | * lread.c (readevalloop): Yet another int/Lisp_Object mixup (YAILOM). | ||
| 43 | |||
| 44 | * window.c (window_loop): For LRU and LARGEST, let the `mini' argument | ||
| 45 | determine whether to consider dedicated windows as well. | ||
| 46 | (Fget_lru_window, Fget_largest_window): Add `dedicated' argument. | ||
| 47 | (Fdisplay_buffer): Do consider dedicated windows in those cases where | ||
| 48 | we will split the window rather than reuse it. | ||
| 49 | Don't try to use windows on other displays. | ||
| 50 | |||
| 51 | 2005-10-31 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 52 | |||
| 53 | * puresize.h (BASE_PURESIZE): Increment to 1170000. | ||
| 54 | |||
| 55 | 2005-10-31 Romain Francoise <romain@orebokech.com> | ||
| 56 | |||
| 57 | * macfns.c: Update copyright year. | ||
| 58 | * m/gould.h: Likewise. | ||
| 59 | |||
| 60 | 2005-10-30 Kim F. Storm <storm@cua.dk> | ||
| 61 | |||
| 62 | * xdisp.c (display_line): Restore it->current_x and call | ||
| 63 | extend_face_to_end_of_line when last glyph doesn't fit on line. | ||
| 64 | (set_glyph_string_background_width): Remove specific tests here | ||
| 65 | to see if face background should extend to end of line. Simplify. | ||
| 66 | |||
| 67 | 2005-10-30 Richard M. Stallman <rms@gnu.org> | ||
| 68 | |||
| 69 | * alloc.c (BYTES_USED): Use uordblks, not arena. | ||
| 70 | (bytes_used_when_reconsidered): New variable. | ||
| 71 | (emacs_blocked_free): Set that. | ||
| 72 | |||
| 73 | 2005-10-29 Chong Yidong <cyd@stupidchicken.com> | ||
| 74 | |||
| 75 | * alloc.c (emacs_blocked_free): Fix typo. | ||
| 76 | |||
| 77 | 2005-10-29 Richard M. Stallman <rms@gnu.org> | ||
| 78 | |||
| 79 | * data.c (Fmake_variable_frame_local): Doc fix. | ||
| 80 | |||
| 81 | * xdisp.c (handle_fontified_prop): Do nothing if memory full. | ||
| 82 | (format_mode_line_unwind_data): New arg SAVE_PROPTRANS | ||
| 83 | controls whether to save and restore mode_line_proptrans_alist. | ||
| 84 | Callers changed. | ||
| 85 | (unwind_format_mode_line): Work with that feature. | ||
| 86 | (redisplay_internal): Don't call prepare_menu_bars if memory full. | ||
| 87 | (move_elt_to_front): New function. | ||
| 88 | (display_mode_element): Use move_elt_to_front. | ||
| 89 | Don't bother munging text props on a null string. | ||
| 90 | Delete obsolete elts from mode_line_proptrans_alist. | ||
| 91 | (decode_mode_spec): Test Vmemory_full, not spare_memory. | ||
| 92 | (Fformat_mode_line): Clear mode_line_proptrans_alist after saving. | ||
| 93 | |||
| 94 | * lisp.h (memory_full_cons_threshold): Declare. | ||
| 95 | (internal_lisp_condition_case): Declare. | ||
| 96 | |||
| 97 | * alloc.c (syms_of_alloc) <memory-full>: Doc fix. | ||
| 98 | (Fmemory_full_p): Function deleted. | ||
| 99 | (syms_of_alloc): Don't defsubr it. | ||
| 100 | (memory_full_cons_threshold): New variable. | ||
| 101 | (spare_memory): Now a vector of 7 elts. | ||
| 102 | (buffer_memory_full): Don't set Vmemory_full here. | ||
| 103 | (xfree): Don't try to refill here. | ||
| 104 | (emacs_blocked_free): Record BYTES_USED in local var. | ||
| 105 | (memory_full): Now free all the slots in spare_memory. | ||
| 106 | (refill_memory_reserve): Allocate each slot in spare_memory. | ||
| 107 | (init_alloc_once): Call refill_memory_reserve. | ||
| 108 | |||
| 109 | * keyboard.c (command_loop_1): Don't set Vmemory_full here. | ||
| 110 | |||
| 111 | * eval.c (internal_lisp_condition_case): New function. | ||
| 112 | (Fcondition_case): Use internal_lisp_condition_case. | ||
| 113 | (Feval): Test Vmemory_full and memory_full_cons_threshold. | ||
| 114 | (Ffuncall): Likewise. | ||
| 115 | |||
| 116 | * bytecode.c (Fbyte_code): Use internal_lisp_condition_case. | ||
| 117 | |||
| 118 | 2005-10-29 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 119 | |||
| 120 | * syntax.c (Fparse_partial_sexp): Fix docstring. | ||
| 121 | |||
| 122 | 2005-10-28 Romain Francoise <romain@orebokech.com> | ||
| 123 | |||
| 124 | * puresize.h (BASE_PURESIZE): Increment to 1130000. | ||
| 125 | |||
| 126 | 2005-10-28 Richard M. Stallman <rms@gnu.org> | ||
| 127 | |||
| 128 | * xfns.c (syms_of_xfns): Provide `x' as feature. | ||
| 129 | |||
| 130 | * xdisp.c (decode_mode_spec): Define %e to indicate memory full. | ||
| 131 | |||
| 132 | * editfns.c (Fformat): Don't include string padding | ||
| 133 | between info[n].start and info[n].end. | ||
| 134 | |||
| 135 | * alloc.c (spare_memory): No longer static. | ||
| 136 | (xfree) [!SYSTEM_MALLOC]: Call refill_memory_reserve. | ||
| 137 | |||
| 138 | * puresize.h (BASE_PURESIZE): Increment to 1120000. | ||
| 139 | |||
| 1 | 2005-10-27 Chong Yidong <cyd@stupidchicken.com> | 140 | 2005-10-27 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 141 | ||
| 3 | * data.c (Fmake_variable_frame_local): Add clarification to | 142 | * data.c (Fmake_variable_frame_local): Add clarification to docstring. |
| 4 | docstring. | ||
| 5 | 143 | ||
| 6 | * fringe.c (update_window_fringes): Handle case where buffer ends | 144 | * fringe.c (update_window_fringes): Handle case where buffer ends |
| 7 | with a newline. | 145 | with a newline. |
| @@ -118,8 +256,7 @@ | |||
| 118 | 256 | ||
| 119 | 2005-10-20 Aubrey Jaffer <agj@alum.mit.edu> (tiny change) | 257 | 2005-10-20 Aubrey Jaffer <agj@alum.mit.edu> (tiny change) |
| 120 | 258 | ||
| 121 | * unexelf.c (unexec): Fix calls to `fatal' with less than 3 | 259 | * unexelf.c (unexec): Fix calls to `fatal' with less than 3 arguments. |
| 122 | arguments. | ||
| 123 | 260 | ||
| 124 | 2005-10-20 Olli Savia <ops@iki.fi> (tiny change) | 261 | 2005-10-20 Olli Savia <ops@iki.fi> (tiny change) |
| 125 | 262 | ||
| @@ -165,7 +302,7 @@ | |||
| 165 | 2005-10-16 Masatake YAMATO <jet@gyve.org> | 302 | 2005-10-16 Masatake YAMATO <jet@gyve.org> |
| 166 | 303 | ||
| 167 | * minibuf.c (Fdisplay_completion_list): Add new optional | 304 | * minibuf.c (Fdisplay_completion_list): Add new optional |
| 168 | argument COMMON_SUBSTRING. Bind `completion-common-substring' | 305 | argument COMMON_SUBSTRING. Bind `completion-common-substring' |
| 169 | to the optional argument during running `completion-setup-hook'. | 306 | to the optional argument during running `completion-setup-hook'. |
| 170 | 307 | ||
| 171 | 2005-10-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 308 | 2005-10-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
diff --git a/src/Makefile.in b/src/Makefile.in index e386db3a0e8..30dc5ab030d 100644 --- a/src/Makefile.in +++ b/src/Makefile.in | |||
| @@ -777,6 +777,9 @@ lisp= \ | |||
| 777 | ${lispsource}subr.elc \ | 777 | ${lispsource}subr.elc \ |
| 778 | ${lispsource}term/tty-colors.elc \ | 778 | ${lispsource}term/tty-colors.elc \ |
| 779 | ${lispsource}font-core.elc \ | 779 | ${lispsource}font-core.elc \ |
| 780 | ${lispsource}emacs-lisp/syntax.elc \ | ||
| 781 | ${lispsource}font-lock.elc \ | ||
| 782 | ${lispsource}jit-lock.elc \ | ||
| 780 | ${lispsource}textmodes/fill.elc \ | 783 | ${lispsource}textmodes/fill.elc \ |
| 781 | ${lispsource}textmodes/page.elc \ | 784 | ${lispsource}textmodes/page.elc \ |
| 782 | ${lispsource}textmodes/paragraphs.elc \ | 785 | ${lispsource}textmodes/paragraphs.elc \ |
| @@ -871,6 +874,9 @@ shortlisp= \ | |||
| 871 | ../lisp/subr.elc \ | 874 | ../lisp/subr.elc \ |
| 872 | ../lisp/term/tty-colors.elc \ | 875 | ../lisp/term/tty-colors.elc \ |
| 873 | ../lisp/font-core.elc \ | 876 | ../lisp/font-core.elc \ |
| 877 | ../lisp/emacs-lisp/syntax.elc \ | ||
| 878 | ../lisp/font-lock.elc \ | ||
| 879 | ../lisp/jit-lock.elc \ | ||
| 874 | ../lisp/textmodes/fill.elc \ | 880 | ../lisp/textmodes/fill.elc \ |
| 875 | ../lisp/textmodes/page.elc \ | 881 | ../lisp/textmodes/page.elc \ |
| 876 | ../lisp/textmodes/paragraphs.elc \ | 882 | ../lisp/textmodes/paragraphs.elc \ |
diff --git a/src/alloc.c b/src/alloc.c index ff0c3d46d44..1e95447549b 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -138,6 +138,8 @@ static pthread_mutex_t alloc_mutex; | |||
| 138 | 138 | ||
| 139 | static __malloc_size_t bytes_used_when_full; | 139 | static __malloc_size_t bytes_used_when_full; |
| 140 | 140 | ||
| 141 | static __malloc_size_t bytes_used_when_reconsidered; | ||
| 142 | |||
| 141 | /* Mark, unmark, query mark bit of a Lisp string. S must be a pointer | 143 | /* Mark, unmark, query mark bit of a Lisp string. S must be a pointer |
| 142 | to a struct Lisp_String. */ | 144 | to a struct Lisp_String. */ |
| 143 | 145 | ||
| @@ -182,6 +184,11 @@ EMACS_INT gc_relative_threshold; | |||
| 182 | 184 | ||
| 183 | static Lisp_Object Vgc_cons_percentage; | 185 | static Lisp_Object Vgc_cons_percentage; |
| 184 | 186 | ||
| 187 | /* Minimum number of bytes of consing since GC before next GC, | ||
| 188 | when memory is full. */ | ||
| 189 | |||
| 190 | EMACS_INT memory_full_cons_threshold; | ||
| 191 | |||
| 185 | /* Nonzero during GC. */ | 192 | /* Nonzero during GC. */ |
| 186 | 193 | ||
| 187 | int gc_in_progress; | 194 | int gc_in_progress; |
| @@ -213,11 +220,12 @@ static int total_free_conses, total_free_markers, total_free_symbols; | |||
| 213 | static int total_free_floats, total_floats; | 220 | static int total_free_floats, total_floats; |
| 214 | 221 | ||
| 215 | /* Points to memory space allocated as "spare", to be freed if we run | 222 | /* Points to memory space allocated as "spare", to be freed if we run |
| 216 | out of memory. */ | 223 | out of memory. We keep one large block, four cons-blocks, and |
| 224 | two string blocks. */ | ||
| 217 | 225 | ||
| 218 | static char *spare_memory; | 226 | char *spare_memory[7]; |
| 219 | 227 | ||
| 220 | /* Amount of spare memory to keep in reserve. */ | 228 | /* Amount of spare memory to keep in large reserve block. */ |
| 221 | 229 | ||
| 222 | #define SPARE_MEMORY (1 << 14) | 230 | #define SPARE_MEMORY (1 << 14) |
| 223 | 231 | ||
| @@ -351,6 +359,11 @@ enum mem_type | |||
| 351 | MEM_TYPE_WINDOW | 359 | MEM_TYPE_WINDOW |
| 352 | }; | 360 | }; |
| 353 | 361 | ||
| 362 | static POINTER_TYPE *lisp_align_malloc P_ ((size_t, enum mem_type)); | ||
| 363 | static POINTER_TYPE *lisp_malloc P_ ((size_t, enum mem_type)); | ||
| 364 | void refill_memory_reserve (); | ||
| 365 | |||
| 366 | |||
| 354 | #if GC_MARK_STACK || defined GC_MALLOC_CHECK | 367 | #if GC_MARK_STACK || defined GC_MALLOC_CHECK |
| 355 | 368 | ||
| 356 | #if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES | 369 | #if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES |
| @@ -451,6 +464,7 @@ static void mem_delete P_ ((struct mem_node *)); | |||
| 451 | static void mem_delete_fixup P_ ((struct mem_node *)); | 464 | static void mem_delete_fixup P_ ((struct mem_node *)); |
| 452 | static INLINE struct mem_node *mem_find P_ ((void *)); | 465 | static INLINE struct mem_node *mem_find P_ ((void *)); |
| 453 | 466 | ||
| 467 | |||
| 454 | #if GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS | 468 | #if GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS |
| 455 | static void check_gcpros P_ ((void)); | 469 | static void check_gcpros P_ ((void)); |
| 456 | #endif | 470 | #endif |
| @@ -511,57 +525,10 @@ display_malloc_warning () | |||
| 511 | 525 | ||
| 512 | 526 | ||
| 513 | #ifdef DOUG_LEA_MALLOC | 527 | #ifdef DOUG_LEA_MALLOC |
| 514 | # define BYTES_USED (mallinfo ().arena) | 528 | # define BYTES_USED (mallinfo ().uordblks) |
| 515 | #else | 529 | #else |
| 516 | # define BYTES_USED _bytes_used | 530 | # define BYTES_USED _bytes_used |
| 517 | #endif | 531 | #endif |
| 518 | |||
| 519 | |||
| 520 | /* Called if malloc returns zero. */ | ||
| 521 | |||
| 522 | void | ||
| 523 | memory_full () | ||
| 524 | { | ||
| 525 | Vmemory_full = Qt; | ||
| 526 | |||
| 527 | #ifndef SYSTEM_MALLOC | ||
| 528 | bytes_used_when_full = BYTES_USED; | ||
| 529 | #endif | ||
| 530 | |||
| 531 | /* The first time we get here, free the spare memory. */ | ||
| 532 | if (spare_memory) | ||
| 533 | { | ||
| 534 | free (spare_memory); | ||
| 535 | spare_memory = 0; | ||
| 536 | } | ||
| 537 | |||
| 538 | /* This used to call error, but if we've run out of memory, we could | ||
| 539 | get infinite recursion trying to build the string. */ | ||
| 540 | while (1) | ||
| 541 | Fsignal (Qnil, Vmemory_signal_data); | ||
| 542 | } | ||
| 543 | |||
| 544 | DEFUN ("memory-full-p", Fmemory_full_p, Smemory_full_p, 0, 0, 0, | ||
| 545 | doc: /* t if memory is nearly full, nil otherwise. */) | ||
| 546 | () | ||
| 547 | { | ||
| 548 | return (spare_memory ? Qnil : Qt); | ||
| 549 | } | ||
| 550 | |||
| 551 | /* If we released our reserve (due to running out of memory), | ||
| 552 | and we have a fair amount free once again, | ||
| 553 | try to set aside another reserve in case we run out once more. | ||
| 554 | |||
| 555 | This is called when a relocatable block is freed in ralloc.c. */ | ||
| 556 | |||
| 557 | void | ||
| 558 | refill_memory_reserve () | ||
| 559 | { | ||
| 560 | #ifndef SYSTEM_MALLOC | ||
| 561 | if (spare_memory == 0) | ||
| 562 | spare_memory = (char *) malloc ((size_t) SPARE_MEMORY); | ||
| 563 | #endif | ||
| 564 | } | ||
| 565 | 532 | ||
| 566 | /* Called if we can't allocate relocatable space for a buffer. */ | 533 | /* Called if we can't allocate relocatable space for a buffer. */ |
| 567 | 534 | ||
| @@ -579,8 +546,6 @@ buffer_memory_full () | |||
| 579 | memory_full (); | 546 | memory_full (); |
| 580 | #endif | 547 | #endif |
| 581 | 548 | ||
| 582 | Vmemory_full = Qt; | ||
| 583 | |||
| 584 | /* This used to call error, but if we've run out of memory, we could | 549 | /* This used to call error, but if we've run out of memory, we could |
| 585 | get infinite recursion trying to build the string. */ | 550 | get infinite recursion trying to build the string. */ |
| 586 | while (1) | 551 | while (1) |
| @@ -806,6 +771,9 @@ xfree (block) | |||
| 806 | BLOCK_INPUT; | 771 | BLOCK_INPUT; |
| 807 | free (block); | 772 | free (block); |
| 808 | UNBLOCK_INPUT; | 773 | UNBLOCK_INPUT; |
| 774 | /* We don't call refill_memory_reserve here | ||
| 775 | because that duplicates doing so in emacs_blocked_free | ||
| 776 | and the criterion should go there. */ | ||
| 809 | } | 777 | } |
| 810 | 778 | ||
| 811 | 779 | ||
| @@ -1179,6 +1147,8 @@ emacs_blocked_free (ptr, ptr2) | |||
| 1179 | void *ptr; | 1147 | void *ptr; |
| 1180 | const void *ptr2; | 1148 | const void *ptr2; |
| 1181 | { | 1149 | { |
| 1150 | EMACS_INT bytes_used_now; | ||
| 1151 | |||
| 1182 | BLOCK_INPUT_ALLOC; | 1152 | BLOCK_INPUT_ALLOC; |
| 1183 | 1153 | ||
| 1184 | #ifdef GC_MALLOC_CHECK | 1154 | #ifdef GC_MALLOC_CHECK |
| @@ -1207,14 +1177,15 @@ emacs_blocked_free (ptr, ptr2) | |||
| 1207 | /* If we released our reserve (due to running out of memory), | 1177 | /* If we released our reserve (due to running out of memory), |
| 1208 | and we have a fair amount free once again, | 1178 | and we have a fair amount free once again, |
| 1209 | try to set aside another reserve in case we run out once more. */ | 1179 | try to set aside another reserve in case we run out once more. */ |
| 1210 | if (spare_memory == 0 | 1180 | if (! NILP (Vmemory_full) |
| 1211 | /* Verify there is enough space that even with the malloc | 1181 | /* Verify there is enough space that even with the malloc |
| 1212 | hysteresis this call won't run out again. | 1182 | hysteresis this call won't run out again. |
| 1213 | The code here is correct as long as SPARE_MEMORY | 1183 | The code here is correct as long as SPARE_MEMORY |
| 1214 | is substantially larger than the block size malloc uses. */ | 1184 | is substantially larger than the block size malloc uses. */ |
| 1215 | && (bytes_used_when_full | 1185 | && (bytes_used_when_full |
| 1216 | > BYTES_USED + max (malloc_hysteresis, 4) * SPARE_MEMORY)) | 1186 | > ((bytes_used_when_reconsidered = BYTES_USED) |
| 1217 | spare_memory = (char *) malloc ((size_t) SPARE_MEMORY); | 1187 | + max (malloc_hysteresis, 4) * SPARE_MEMORY))) |
| 1188 | refill_memory_reserve (); | ||
| 1218 | 1189 | ||
| 1219 | __free_hook = emacs_blocked_free; | 1190 | __free_hook = emacs_blocked_free; |
| 1220 | UNBLOCK_INPUT_ALLOC; | 1191 | UNBLOCK_INPUT_ALLOC; |
| @@ -3381,6 +3352,83 @@ make_event_array (nargs, args) | |||
| 3381 | 3352 | ||
| 3382 | 3353 | ||
| 3383 | /************************************************************************ | 3354 | /************************************************************************ |
| 3355 | Memory Full Handling | ||
| 3356 | ************************************************************************/ | ||
| 3357 | |||
| 3358 | |||
| 3359 | /* Called if malloc returns zero. */ | ||
| 3360 | |||
| 3361 | void | ||
| 3362 | memory_full () | ||
| 3363 | { | ||
| 3364 | int i; | ||
| 3365 | |||
| 3366 | Vmemory_full = Qt; | ||
| 3367 | |||
| 3368 | memory_full_cons_threshold = sizeof (struct cons_block); | ||
| 3369 | |||
| 3370 | /* The first time we get here, free the spare memory. */ | ||
| 3371 | for (i = 0; i < sizeof (spare_memory) / sizeof (char *); i++) | ||
| 3372 | if (spare_memory[i]) | ||
| 3373 | { | ||
| 3374 | if (i == 0) | ||
| 3375 | free (spare_memory[i]); | ||
| 3376 | else if (i >= 1 && i <= 4) | ||
| 3377 | lisp_align_free (spare_memory[i]); | ||
| 3378 | else | ||
| 3379 | lisp_free (spare_memory[i]); | ||
| 3380 | spare_memory[i] = 0; | ||
| 3381 | } | ||
| 3382 | |||
| 3383 | /* Record the space now used. When it decreases substantially, | ||
| 3384 | we can refill the memory reserve. */ | ||
| 3385 | #ifndef SYSTEM_MALLOC | ||
| 3386 | bytes_used_when_full = BYTES_USED; | ||
| 3387 | #endif | ||
| 3388 | |||
| 3389 | /* This used to call error, but if we've run out of memory, we could | ||
| 3390 | get infinite recursion trying to build the string. */ | ||
| 3391 | while (1) | ||
| 3392 | Fsignal (Qnil, Vmemory_signal_data); | ||
| 3393 | } | ||
| 3394 | |||
| 3395 | /* If we released our reserve (due to running out of memory), | ||
| 3396 | and we have a fair amount free once again, | ||
| 3397 | try to set aside another reserve in case we run out once more. | ||
| 3398 | |||
| 3399 | This is called when a relocatable block is freed in ralloc.c, | ||
| 3400 | and also directly from this file, in case we're not using ralloc.c. */ | ||
| 3401 | |||
| 3402 | void | ||
| 3403 | refill_memory_reserve () | ||
| 3404 | { | ||
| 3405 | #ifndef SYSTEM_MALLOC | ||
| 3406 | if (spare_memory[0] == 0) | ||
| 3407 | spare_memory[0] = (char *) malloc ((size_t) SPARE_MEMORY); | ||
| 3408 | if (spare_memory[1] == 0) | ||
| 3409 | spare_memory[1] = (char *) lisp_align_malloc (sizeof (struct cons_block), | ||
| 3410 | MEM_TYPE_CONS); | ||
| 3411 | if (spare_memory[2] == 0) | ||
| 3412 | spare_memory[2] = (char *) lisp_align_malloc (sizeof (struct cons_block), | ||
| 3413 | MEM_TYPE_CONS); | ||
| 3414 | if (spare_memory[3] == 0) | ||
| 3415 | spare_memory[3] = (char *) lisp_align_malloc (sizeof (struct cons_block), | ||
| 3416 | MEM_TYPE_CONS); | ||
| 3417 | if (spare_memory[4] == 0) | ||
| 3418 | spare_memory[4] = (char *) lisp_align_malloc (sizeof (struct cons_block), | ||
| 3419 | MEM_TYPE_CONS); | ||
| 3420 | if (spare_memory[5] == 0) | ||
| 3421 | spare_memory[5] = (char *) lisp_malloc (sizeof (struct string_block), | ||
| 3422 | MEM_TYPE_STRING); | ||
| 3423 | if (spare_memory[6] == 0) | ||
| 3424 | spare_memory[6] = (char *) lisp_malloc (sizeof (struct string_block), | ||
| 3425 | MEM_TYPE_STRING); | ||
| 3426 | if (spare_memory[0] && spare_memory[1] && spare_memory[5]) | ||
| 3427 | Vmemory_full = Qnil; | ||
| 3428 | #endif | ||
| 3429 | } | ||
| 3430 | |||
| 3431 | /************************************************************************ | ||
| 3384 | C Stack Marking | 3432 | C Stack Marking |
| 3385 | ************************************************************************/ | 3433 | ************************************************************************/ |
| 3386 | 3434 | ||
| @@ -6008,7 +6056,7 @@ init_alloc_once () | |||
| 6008 | malloc_hysteresis = 0; | 6056 | malloc_hysteresis = 0; |
| 6009 | #endif | 6057 | #endif |
| 6010 | 6058 | ||
| 6011 | spare_memory = (char *) malloc (SPARE_MEMORY); | 6059 | refill_memory_reserve (); |
| 6012 | 6060 | ||
| 6013 | ignore_warnings = 0; | 6061 | ignore_warnings = 0; |
| 6014 | gcprolist = 0; | 6062 | gcprolist = 0; |
| @@ -6109,7 +6157,7 @@ This means that certain objects should be allocated in shared (pure) space. */) | |||
| 6109 | build_string ("Memory exhausted--use M-x save-some-buffers then exit and restart Emacs")); | 6157 | build_string ("Memory exhausted--use M-x save-some-buffers then exit and restart Emacs")); |
| 6110 | 6158 | ||
| 6111 | DEFVAR_LISP ("memory-full", &Vmemory_full, | 6159 | DEFVAR_LISP ("memory-full", &Vmemory_full, |
| 6112 | doc: /* Non-nil means we are handling a memory-full error. */); | 6160 | doc: /* Non-nil means Emacs cannot get much more Lisp memory. */); |
| 6113 | Vmemory_full = Qnil; | 6161 | Vmemory_full = Qnil; |
| 6114 | 6162 | ||
| 6115 | staticpro (&Qgc_cons_threshold); | 6163 | staticpro (&Qgc_cons_threshold); |
| @@ -6124,7 +6172,6 @@ The time is in seconds as a floating point value. */); | |||
| 6124 | DEFVAR_INT ("gcs-done", &gcs_done, | 6172 | DEFVAR_INT ("gcs-done", &gcs_done, |
| 6125 | doc: /* Accumulated number of garbage collections done. */); | 6173 | doc: /* Accumulated number of garbage collections done. */); |
| 6126 | 6174 | ||
| 6127 | defsubr (&Smemory_full_p); | ||
| 6128 | defsubr (&Scons); | 6175 | defsubr (&Scons); |
| 6129 | defsubr (&Slist); | 6176 | defsubr (&Slist); |
| 6130 | defsubr (&Svector); | 6177 | defsubr (&Svector); |
diff --git a/src/bytecode.c b/src/bytecode.c index e5a3e7b2a7c..e23d835cf10 100644 --- a/src/bytecode.c +++ b/src/bytecode.c | |||
| @@ -861,11 +861,11 @@ If the third argument is incorrect, Emacs may crash. */) | |||
| 861 | 861 | ||
| 862 | case Bcondition_case: | 862 | case Bcondition_case: |
| 863 | { | 863 | { |
| 864 | Lisp_Object v1; | 864 | Lisp_Object handlers, body; |
| 865 | v1 = POP; | 865 | handlers = POP; |
| 866 | v1 = Fcons (POP, v1); | 866 | body = POP; |
| 867 | BEFORE_POTENTIAL_GC (); | 867 | BEFORE_POTENTIAL_GC (); |
| 868 | TOP = Fcondition_case (Fcons (TOP, v1)); | 868 | TOP = internal_lisp_condition_case (TOP, body, handlers); |
| 869 | AFTER_POTENTIAL_GC (); | 869 | AFTER_POTENTIAL_GC (); |
| 870 | break; | 870 | break; |
| 871 | } | 871 | } |
diff --git a/src/data.c b/src/data.c index 9bb90ad2d6e..bd08368c2fb 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -1721,14 +1721,20 @@ From now on the default value will apply in this buffer. Return VARIABLE. */) | |||
| 1721 | DEFUN ("make-variable-frame-local", Fmake_variable_frame_local, Smake_variable_frame_local, | 1721 | DEFUN ("make-variable-frame-local", Fmake_variable_frame_local, Smake_variable_frame_local, |
| 1722 | 1, 1, "vMake Variable Frame Local: ", | 1722 | 1, 1, "vMake Variable Frame Local: ", |
| 1723 | doc: /* Enable VARIABLE to have frame-local bindings. | 1723 | doc: /* Enable VARIABLE to have frame-local bindings. |
| 1724 | When a frame-local binding exists in the current frame, | 1724 | This does not create any frame-local bindings for VARIABLE, |
| 1725 | it is in effect whenever the current buffer has no buffer-local binding. | 1725 | it just makes them possible. |
| 1726 | A frame-local binding is actually a frame parameter value; | 1726 | |
| 1727 | thus, any given frame has a local binding for VARIABLE if it has | 1727 | A frame-local binding is actually a frame parameter value. |
| 1728 | a value for the frame parameter named VARIABLE. Return VARIABLE. | 1728 | If a frame F has a value for the frame parameter named VARIABLE, |
| 1729 | 1729 | that also acts as a frame-local binding for VARIABLE in F-- | |
| 1730 | This function does not in itself create any frame-local bindings for | 1730 | provided this function has been called to enable VARIABLE |
| 1731 | VARIABLE. See `modify-frame-parameters' for how to set frame parameters. */) | 1731 | to have frame-local bindings at all. |
| 1732 | |||
| 1733 | The only way to create a frame-local binding for VARIABLE in a frame | ||
| 1734 | is to set the VARIABLE frame parameter of that frame. See | ||
| 1735 | `modify-frame-parameters' for how to set frame parameters. | ||
| 1736 | |||
| 1737 | Buffer-local bindings take precedence over frame-local bindings. */) | ||
| 1732 | (variable) | 1738 | (variable) |
| 1733 | register Lisp_Object variable; | 1739 | register Lisp_Object variable; |
| 1734 | { | 1740 | { |
diff --git a/src/editfns.c b/src/editfns.c index e7b152726e3..5605a25bdd2 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -3662,7 +3662,7 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 3662 | ++nchars; | 3662 | ++nchars; |
| 3663 | } | 3663 | } |
| 3664 | 3664 | ||
| 3665 | start = nchars; | 3665 | info[n].start = start = nchars; |
| 3666 | nchars += nchars_string; | 3666 | nchars += nchars_string; |
| 3667 | end = nchars; | 3667 | end = nchars; |
| 3668 | 3668 | ||
| @@ -3677,6 +3677,8 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 3677 | nbytes, | 3677 | nbytes, |
| 3678 | STRING_MULTIBYTE (args[n]), multibyte); | 3678 | STRING_MULTIBYTE (args[n]), multibyte); |
| 3679 | 3679 | ||
| 3680 | info[n].end = nchars; | ||
| 3681 | |||
| 3680 | if (negative) | 3682 | if (negative) |
| 3681 | while (padding-- > 0) | 3683 | while (padding-- > 0) |
| 3682 | { | 3684 | { |
| @@ -3713,9 +3715,9 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 3713 | else | 3715 | else |
| 3714 | p += this_nchars; | 3716 | p += this_nchars; |
| 3715 | nchars += this_nchars; | 3717 | nchars += this_nchars; |
| 3718 | info[n].end = nchars; | ||
| 3716 | } | 3719 | } |
| 3717 | 3720 | ||
| 3718 | info[n].end = nchars; | ||
| 3719 | } | 3721 | } |
| 3720 | else if (STRING_MULTIBYTE (args[0])) | 3722 | else if (STRING_MULTIBYTE (args[0])) |
| 3721 | { | 3723 | { |
diff --git a/src/eval.c b/src/eval.c index a867d00150e..86859e4ddae 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -1343,15 +1343,28 @@ usage: (condition-case VAR BODYFORM &rest HANDLERS) */) | |||
| 1343 | (args) | 1343 | (args) |
| 1344 | Lisp_Object args; | 1344 | Lisp_Object args; |
| 1345 | { | 1345 | { |
| 1346 | Lisp_Object val; | ||
| 1347 | struct catchtag c; | ||
| 1348 | struct handler h; | ||
| 1349 | register Lisp_Object bodyform, handlers; | 1346 | register Lisp_Object bodyform, handlers; |
| 1350 | volatile Lisp_Object var; | 1347 | volatile Lisp_Object var; |
| 1351 | 1348 | ||
| 1352 | var = Fcar (args); | 1349 | var = Fcar (args); |
| 1353 | bodyform = Fcar (Fcdr (args)); | 1350 | bodyform = Fcar (Fcdr (args)); |
| 1354 | handlers = Fcdr (Fcdr (args)); | 1351 | handlers = Fcdr (Fcdr (args)); |
| 1352 | |||
| 1353 | return internal_lisp_condition_case (var, bodyform, handlers); | ||
| 1354 | } | ||
| 1355 | |||
| 1356 | /* Like Fcondition_case, but the args are separate | ||
| 1357 | rather than passed in a list. Used by Fbyte_code. */ | ||
| 1358 | |||
| 1359 | Lisp_Object | ||
| 1360 | internal_lisp_condition_case (var, bodyform, handlers) | ||
| 1361 | volatile Lisp_Object var; | ||
| 1362 | Lisp_Object bodyform, handlers; | ||
| 1363 | { | ||
| 1364 | Lisp_Object val; | ||
| 1365 | struct catchtag c; | ||
| 1366 | struct handler h; | ||
| 1367 | |||
| 1355 | CHECK_SYMBOL (var); | 1368 | CHECK_SYMBOL (var); |
| 1356 | 1369 | ||
| 1357 | for (val = handlers; CONSP (val); val = XCDR (val)) | 1370 | for (val = handlers; CONSP (val); val = XCDR (val)) |
| @@ -2094,8 +2107,10 @@ DEFUN ("eval", Feval, Seval, 1, 1, 0, | |||
| 2094 | return form; | 2107 | return form; |
| 2095 | 2108 | ||
| 2096 | QUIT; | 2109 | QUIT; |
| 2097 | if (consing_since_gc > gc_cons_threshold | 2110 | if ((consing_since_gc > gc_cons_threshold |
| 2098 | && consing_since_gc > gc_relative_threshold) | 2111 | && consing_since_gc > gc_relative_threshold) |
| 2112 | || | ||
| 2113 | (!NILP (Vmemory_full) && consing_since_gc > memory_full_cons_threshold)) | ||
| 2099 | { | 2114 | { |
| 2100 | GCPRO1 (form); | 2115 | GCPRO1 (form); |
| 2101 | Fgarbage_collect (); | 2116 | Fgarbage_collect (); |
| @@ -2795,8 +2810,10 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */) | |||
| 2795 | register int i; | 2810 | register int i; |
| 2796 | 2811 | ||
| 2797 | QUIT; | 2812 | QUIT; |
| 2798 | if (consing_since_gc > gc_cons_threshold | 2813 | if ((consing_since_gc > gc_cons_threshold |
| 2799 | && consing_since_gc > gc_relative_threshold) | 2814 | && consing_since_gc > gc_relative_threshold) |
| 2815 | || | ||
| 2816 | (!NILP (Vmemory_full) && consing_since_gc > memory_full_cons_threshold)) | ||
| 2800 | Fgarbage_collect (); | 2817 | Fgarbage_collect (); |
| 2801 | 2818 | ||
| 2802 | if (++lisp_eval_depth > max_lisp_eval_depth) | 2819 | if (++lisp_eval_depth > max_lisp_eval_depth) |
diff --git a/src/fringe.c b/src/fringe.c index 34c58db3674..8c6d47cbade 100644 --- a/src/fringe.c +++ b/src/fringe.c | |||
| @@ -861,7 +861,7 @@ update_window_fringes (w, keep_current_p) | |||
| 861 | 861 | ||
| 862 | if (!done_bot) | 862 | if (!done_bot) |
| 863 | { | 863 | { |
| 864 | if (row->ends_at_zv_p | 864 | if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->buffer)) |
| 865 | && !MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P (w, row)) | 865 | && !MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P (w, row)) |
| 866 | row->indicate_eob_p = !NILP (boundary_bot), done_bot = 1; | 866 | row->indicate_eob_p = !NILP (boundary_bot), done_bot = 1; |
| 867 | else if (y + row->height >= yb) | 867 | else if (y + row->height >= yb) |
| @@ -907,9 +907,12 @@ update_window_fringes (w, keep_current_p) | |||
| 907 | left = LEFT_TRUNCATION_BITMAP; | 907 | left = LEFT_TRUNCATION_BITMAP; |
| 908 | else if (row->indicate_bob_p && EQ (boundary_top, Qleft)) | 908 | else if (row->indicate_bob_p && EQ (boundary_top, Qleft)) |
| 909 | left = ((row->indicate_eob_p && EQ (boundary_bot, Qleft)) | 909 | left = ((row->indicate_eob_p && EQ (boundary_bot, Qleft)) |
| 910 | ? LEFT_BRACKET_BITMAP : TOP_LEFT_ANGLE_BITMAP); | 910 | ? (row->ends_at_zv_p |
| 911 | ? TOP_RIGHT_ANGLE_BITMAP : LEFT_BRACKET_BITMAP) | ||
| 912 | : TOP_LEFT_ANGLE_BITMAP); | ||
| 911 | else if (row->indicate_eob_p && EQ (boundary_bot, Qleft)) | 913 | else if (row->indicate_eob_p && EQ (boundary_bot, Qleft)) |
| 912 | left = BOTTOM_LEFT_ANGLE_BITMAP; | 914 | left = (row->ends_at_zv_p |
| 915 | ? TOP_RIGHT_ANGLE_BITMAP : BOTTOM_LEFT_ANGLE_BITMAP); | ||
| 913 | else if (MATRIX_ROW_CONTINUATION_LINE_P (row)) | 916 | else if (MATRIX_ROW_CONTINUATION_LINE_P (row)) |
| 914 | left = CONTINUATION_LINE_BITMAP; | 917 | left = CONTINUATION_LINE_BITMAP; |
| 915 | else if (row->indicate_empty_line_p && EQ (empty_pos, Qleft)) | 918 | else if (row->indicate_empty_line_p && EQ (empty_pos, Qleft)) |
| @@ -933,9 +936,12 @@ update_window_fringes (w, keep_current_p) | |||
| 933 | right = RIGHT_TRUNCATION_BITMAP; | 936 | right = RIGHT_TRUNCATION_BITMAP; |
| 934 | else if (row->indicate_bob_p && EQ (boundary_top, Qright)) | 937 | else if (row->indicate_bob_p && EQ (boundary_top, Qright)) |
| 935 | right = ((row->indicate_eob_p && EQ (boundary_bot, Qright)) | 938 | right = ((row->indicate_eob_p && EQ (boundary_bot, Qright)) |
| 936 | ? RIGHT_BRACKET_BITMAP : TOP_RIGHT_ANGLE_BITMAP); | 939 | ? (row->ends_at_zv_p |
| 940 | ? TOP_LEFT_ANGLE_BITMAP : RIGHT_BRACKET_BITMAP) | ||
| 941 | : TOP_RIGHT_ANGLE_BITMAP); | ||
| 937 | else if (row->indicate_eob_p && EQ (boundary_bot, Qright)) | 942 | else if (row->indicate_eob_p && EQ (boundary_bot, Qright)) |
| 938 | right = BOTTOM_RIGHT_ANGLE_BITMAP; | 943 | right = (row->ends_at_zv_p |
| 944 | ? TOP_LEFT_ANGLE_BITMAP : BOTTOM_RIGHT_ANGLE_BITMAP); | ||
| 939 | else if (row->continued_p) | 945 | else if (row->continued_p) |
| 940 | right = CONTINUED_LINE_BITMAP; | 946 | right = CONTINUED_LINE_BITMAP; |
| 941 | else if (row->indicate_top_line_p && EQ (arrow_top, Qright)) | 947 | else if (row->indicate_top_line_p && EQ (arrow_top, Qright)) |
diff --git a/src/keyboard.c b/src/keyboard.c index f6a65560268..7a918608dd7 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -1480,8 +1480,6 @@ command_loop_1 () | |||
| 1480 | safe_run_hooks (Qdeferred_action_function); | 1480 | safe_run_hooks (Qdeferred_action_function); |
| 1481 | } | 1481 | } |
| 1482 | 1482 | ||
| 1483 | Vmemory_full = Qnil; | ||
| 1484 | |||
| 1485 | /* Do this after running Vpost_command_hook, for consistency. */ | 1483 | /* Do this after running Vpost_command_hook, for consistency. */ |
| 1486 | current_kboard->Vlast_command = Vthis_command; | 1484 | current_kboard->Vlast_command = Vthis_command; |
| 1487 | current_kboard->Vreal_last_command = real_this_command; | 1485 | current_kboard->Vreal_last_command = real_this_command; |
diff --git a/src/lisp.h b/src/lisp.h index cba8bd31801..adf53035e98 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -1882,6 +1882,8 @@ extern EMACS_INT gc_cons_threshold; | |||
| 1882 | 1882 | ||
| 1883 | extern EMACS_INT gc_relative_threshold; | 1883 | extern EMACS_INT gc_relative_threshold; |
| 1884 | 1884 | ||
| 1885 | extern EMACS_INT memory_full_cons_threshold; | ||
| 1886 | |||
| 1885 | /* Structure for recording stack slots that need marking. */ | 1887 | /* Structure for recording stack slots that need marking. */ |
| 1886 | 1888 | ||
| 1887 | /* This is a chain of structures, each of which points at a Lisp_Object variable | 1889 | /* This is a chain of structures, each of which points at a Lisp_Object variable |
| @@ -2664,6 +2666,7 @@ extern Lisp_Object call6 P_ ((Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object | |||
| 2664 | EXFUN (Fdo_auto_save, 2); | 2666 | EXFUN (Fdo_auto_save, 2); |
| 2665 | extern Lisp_Object apply_lambda P_ ((Lisp_Object, Lisp_Object, int)); | 2667 | extern Lisp_Object apply_lambda P_ ((Lisp_Object, Lisp_Object, int)); |
| 2666 | extern Lisp_Object internal_catch P_ ((Lisp_Object, Lisp_Object (*) (Lisp_Object), Lisp_Object)); | 2668 | extern Lisp_Object internal_catch P_ ((Lisp_Object, Lisp_Object (*) (Lisp_Object), Lisp_Object)); |
| 2669 | extern Lisp_Object internal_lisp_condition_case P_ ((Lisp_Object, Lisp_Object, Lisp_Object)); | ||
| 2667 | extern Lisp_Object internal_condition_case P_ ((Lisp_Object (*) (void), Lisp_Object, Lisp_Object (*) (Lisp_Object))); | 2670 | extern Lisp_Object internal_condition_case P_ ((Lisp_Object (*) (void), Lisp_Object, Lisp_Object (*) (Lisp_Object))); |
| 2668 | extern Lisp_Object internal_condition_case_1 P_ ((Lisp_Object (*) (Lisp_Object), Lisp_Object, Lisp_Object, Lisp_Object (*) (Lisp_Object))); | 2671 | extern Lisp_Object internal_condition_case_1 P_ ((Lisp_Object (*) (Lisp_Object), Lisp_Object, Lisp_Object, Lisp_Object (*) (Lisp_Object))); |
| 2669 | extern Lisp_Object internal_condition_case_2 P_ ((Lisp_Object (*) (int, Lisp_Object *), int, Lisp_Object *, Lisp_Object, Lisp_Object (*) (Lisp_Object))); | 2672 | extern Lisp_Object internal_condition_case_2 P_ ((Lisp_Object (*) (int, Lisp_Object *), int, Lisp_Object *, Lisp_Object, Lisp_Object (*) (Lisp_Object))); |
diff --git a/src/lread.c b/src/lread.c index d51e6443288..1bae0ea7ddd 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -1417,7 +1417,8 @@ readevalloop (readcharfun, stream, sourcename, evalfun, | |||
| 1417 | } | 1417 | } |
| 1418 | 1418 | ||
| 1419 | build_load_history (sourcename, | 1419 | build_load_history (sourcename, |
| 1420 | stream || (start == BEG && end == Z)); | 1420 | stream || (INTEGERP (start) && INTEGERP (end) |
| 1421 | && XINT (start) == BEG && XINT (end) == Z)); | ||
| 1421 | 1422 | ||
| 1422 | UNGCPRO; | 1423 | UNGCPRO; |
| 1423 | 1424 | ||
diff --git a/src/m/gould.h b/src/m/gould.h index 3a382ca0c1b..a9168009d47 100644 --- a/src/m/gould.h +++ b/src/m/gould.h | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | * RELEASE2_1 in config.h. This may also be necessary with un-updated | 5 | * RELEASE2_1 in config.h. This may also be necessary with un-updated |
| 6 | * official releases of 2.1 | 6 | * official releases of 2.1 |
| 7 | 7 | ||
| 8 | Copyright (C) 1986, 2002 Free Software Foundation, Inc. | 8 | Copyright (C) 1986, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. |
| 9 | 9 | ||
| 10 | This file is part of GNU Emacs. | 10 | This file is part of GNU Emacs. |
| 11 | 11 | ||
diff --git a/src/macfns.c b/src/macfns.c index 64e20af4a47..9d23f47b5ed 100644 --- a/src/macfns.c +++ b/src/macfns.c | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | /* Graphical user interface functions for Mac OS. | 1 | /* Graphical user interface functions for Mac OS. |
| 2 | Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. | 2 | Copyright (C) 2000, 2001, 2002, 2003, 2004, |
| 3 | 2005 Free Software Foundation, Inc. | ||
| 3 | 4 | ||
| 4 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 5 | 6 | ||
diff --git a/src/puresize.h b/src/puresize.h index 7951f7ecbf2..b9942a90753 100644 --- a/src/puresize.h +++ b/src/puresize.h | |||
| @@ -42,7 +42,7 @@ Boston, MA 02110-1301, USA. */ | |||
| 42 | #endif | 42 | #endif |
| 43 | 43 | ||
| 44 | #ifndef BASE_PURESIZE | 44 | #ifndef BASE_PURESIZE |
| 45 | #define BASE_PURESIZE (1200000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA) | 45 | #define BASE_PURESIZE (1170000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA) |
| 46 | #endif | 46 | #endif |
| 47 | 47 | ||
| 48 | /* Increase BASE_PURESIZE by a ratio depending on the machine's word size. */ | 48 | /* Increase BASE_PURESIZE by a ratio depending on the machine's word size. */ |
diff --git a/src/sheap.c b/src/sheap.c index 635c3dc0144..cc740173a24 100644 --- a/src/sheap.c +++ b/src/sheap.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* simulate sbrk() with an array in .bss, for unexec() support for Cygwin; | 1 | /* simulate `sbrk' with an array in .bss, for `unexec' support for Cygwin; |
| 2 | complete rewrite of xemacs Cygwin unexec() code | 2 | complete rewrite of xemacs Cygwin `unexec' code |
| 3 | 3 | ||
| 4 | Copyright (C) 2004, 2005 Free Software Foundation, Inc. | 4 | Copyright (C) 2004, 2005 Free Software Foundation, Inc. |
| 5 | 5 | ||
| @@ -27,9 +27,9 @@ Boston, MA 02110-1301, USA. */ | |||
| 27 | #include <unistd.h> | 27 | #include <unistd.h> |
| 28 | 28 | ||
| 29 | #ifdef HAVE_X_WINDOWS | 29 | #ifdef HAVE_X_WINDOWS |
| 30 | #define STATIC_HEAP_SIZE (7 * 1024 * 1024) | 30 | #define STATIC_HEAP_SIZE (8 * 1024 * 1024) |
| 31 | #else | 31 | #else |
| 32 | #define STATIC_HEAP_SIZE (7 * 1024 * 1024) | 32 | #define STATIC_HEAP_SIZE (8 * 1024 * 1024) |
| 33 | #endif | 33 | #endif |
| 34 | 34 | ||
| 35 | int debug_sheap = 0; | 35 | int debug_sheap = 0; |
diff --git a/src/syntax.c b/src/syntax.c index 2043cff63d6..251cc553cdf 100644 --- a/src/syntax.c +++ b/src/syntax.c | |||
| @@ -3020,7 +3020,7 @@ Parsing stops at TO or when certain criteria are met; | |||
| 3020 | point is set to where parsing stops. | 3020 | point is set to where parsing stops. |
| 3021 | If fifth arg OLDSTATE is omitted or nil, | 3021 | If fifth arg OLDSTATE is omitted or nil, |
| 3022 | parsing assumes that FROM is the beginning of a function. | 3022 | parsing assumes that FROM is the beginning of a function. |
| 3023 | Value is a list of ten elements describing final state of parsing: | 3023 | Value is a list of elements describing final state of parsing: |
| 3024 | 0. depth in parens. | 3024 | 0. depth in parens. |
| 3025 | 1. character address of start of innermost containing list; nil if none. | 3025 | 1. character address of start of innermost containing list; nil if none. |
| 3026 | 2. character address of start of last complete sexp terminated. | 3026 | 2. character address of start of last complete sexp terminated. |
| @@ -3039,7 +3039,7 @@ If third arg TARGETDEPTH is non-nil, parsing stops if the depth | |||
| 3039 | in parentheses becomes equal to TARGETDEPTH. | 3039 | in parentheses becomes equal to TARGETDEPTH. |
| 3040 | Fourth arg STOPBEFORE non-nil means stop when come to | 3040 | Fourth arg STOPBEFORE non-nil means stop when come to |
| 3041 | any character that starts a sexp. | 3041 | any character that starts a sexp. |
| 3042 | Fifth arg OLDSTATE is a nine-element list like what this function returns. | 3042 | Fifth arg OLDSTATE is a list like what this function returns. |
| 3043 | It is used to initialize the state of the parse. Elements number 1, 2, 6 | 3043 | It is used to initialize the state of the parse. Elements number 1, 2, 6 |
| 3044 | and 8 are ignored; you can leave off element 8 (the last) entirely. | 3044 | and 8 are ignored; you can leave off element 8 (the last) entirely. |
| 3045 | Sixth arg COMMENTSTOP non-nil means stop at the start of a comment. | 3045 | Sixth arg COMMENTSTOP non-nil means stop at the start of a comment. |
diff --git a/src/unexelf.c b/src/unexelf.c index f50e849fdcf..c53974be9f2 100644 --- a/src/unexelf.c +++ b/src/unexelf.c | |||
| @@ -682,7 +682,7 @@ unexec (new_name, old_name, data_start, bss_start, entry_address) | |||
| 682 | ElfW(Addr) new_data2_addr; | 682 | ElfW(Addr) new_data2_addr; |
| 683 | 683 | ||
| 684 | int n, nn; | 684 | int n, nn; |
| 685 | int old_bss_index, old_sbss_index; | 685 | int old_bss_index, old_sbss_index, old_plt_index; |
| 686 | int old_data_index, new_data2_index; | 686 | int old_data_index, new_data2_index; |
| 687 | int old_mdebug_index; | 687 | int old_mdebug_index; |
| 688 | struct stat stat_buf; | 688 | struct stat stat_buf; |
| @@ -740,15 +740,34 @@ unexec (new_name, old_name, data_start, bss_start, entry_address) | |||
| 740 | old_sbss_index = find_section (".sbss", old_section_names, | 740 | old_sbss_index = find_section (".sbss", old_section_names, |
| 741 | old_name, old_file_h, old_section_h, 1); | 741 | old_name, old_file_h, old_section_h, 1); |
| 742 | if (old_sbss_index != -1) | 742 | if (old_sbss_index != -1) |
| 743 | if (OLD_SECTION_H (old_sbss_index).sh_type == SHT_PROGBITS) | 743 | if (OLD_SECTION_H (old_sbss_index).sh_type != SHT_NOBITS) |
| 744 | old_sbss_index = -1; | 744 | old_sbss_index = -1; |
| 745 | 745 | ||
| 746 | if (old_sbss_index == -1) | 746 | /* PowerPC64 has .plt in the BSS section. */ |
| 747 | old_plt_index = find_section (".plt", old_section_names, | ||
| 748 | old_name, old_file_h, old_section_h, 1); | ||
| 749 | if (old_plt_index != -1) | ||
| 750 | if (OLD_SECTION_H (old_plt_index).sh_type != SHT_NOBITS) | ||
| 751 | old_plt_index = -1; | ||
| 752 | |||
| 753 | if (old_sbss_index == -1 && old_plt_index == -1) | ||
| 747 | { | 754 | { |
| 748 | old_bss_addr = OLD_SECTION_H (old_bss_index).sh_addr; | 755 | old_bss_addr = OLD_SECTION_H (old_bss_index).sh_addr; |
| 749 | old_bss_size = OLD_SECTION_H (old_bss_index).sh_size; | 756 | old_bss_size = OLD_SECTION_H (old_bss_index).sh_size; |
| 750 | new_data2_index = old_bss_index; | 757 | new_data2_index = old_bss_index; |
| 751 | } | 758 | } |
| 759 | else if (old_plt_index != -1 | ||
| 760 | && (old_sbss_index == -1 | ||
| 761 | || (OLD_SECTION_H (old_sbss_index).sh_addr | ||
| 762 | > OLD_SECTION_H (old_plt_index).sh_addr))) | ||
| 763 | { | ||
| 764 | old_bss_addr = OLD_SECTION_H (old_plt_index).sh_addr; | ||
| 765 | old_bss_size = OLD_SECTION_H (old_bss_index).sh_size | ||
| 766 | + OLD_SECTION_H (old_plt_index).sh_size; | ||
| 767 | if (old_sbss_index != -1) | ||
| 768 | old_bss_size += OLD_SECTION_H (old_sbss_index).sh_size; | ||
| 769 | new_data2_index = old_plt_index; | ||
| 770 | } | ||
| 752 | else | 771 | else |
| 753 | { | 772 | { |
| 754 | old_bss_addr = OLD_SECTION_H (old_sbss_index).sh_addr; | 773 | old_bss_addr = OLD_SECTION_H (old_sbss_index).sh_addr; |
| @@ -934,7 +953,7 @@ unexec (new_name, old_name, data_start, bss_start, entry_address) | |||
| 934 | if (n == old_bss_index | 953 | if (n == old_bss_index |
| 935 | /* The new bss and sbss section's size is zero, and its file offset | 954 | /* The new bss and sbss section's size is zero, and its file offset |
| 936 | and virtual address should be off by NEW_DATA2_SIZE. */ | 955 | and virtual address should be off by NEW_DATA2_SIZE. */ |
| 937 | || n == old_sbss_index | 956 | || n == old_sbss_index || n == old_plt_index |
| 938 | ) | 957 | ) |
| 939 | { | 958 | { |
| 940 | /* NN should be `old_s?bss_index + 1' at this point. */ | 959 | /* NN should be `old_s?bss_index + 1' at this point. */ |
diff --git a/src/window.c b/src/window.c index 520d5ae8eaa..69cee518ca4 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -1998,11 +1998,13 @@ window_loop (type, obj, mini, frames) | |||
| 1998 | break; | 1998 | break; |
| 1999 | 1999 | ||
| 2000 | case GET_LRU_WINDOW: | 2000 | case GET_LRU_WINDOW: |
| 2001 | /* t as arg means consider only full-width windows */ | 2001 | /* `obj' is an integer encoding a bitvector. |
| 2002 | if (!NILP (obj) && !WINDOW_FULL_WIDTH_P (w)) | 2002 | `obj & 1' means consider only full-width windows. |
| 2003 | break; | 2003 | `obj & 2' means consider also dedicated windows. */ |
| 2004 | /* Ignore dedicated windows and minibuffers. */ | 2004 | if (((XINT (obj) & 1) && !WINDOW_FULL_WIDTH_P (w)) |
| 2005 | if (MINI_WINDOW_P (w) || EQ (w->dedicated, Qt)) | 2005 | || (!(XINT (obj) & 2) && EQ (w->dedicated, Qt)) |
| 2006 | /* Minibuffer windows are always ignored. */ | ||
| 2007 | || MINI_WINDOW_P (w)) | ||
| 2006 | break; | 2008 | break; |
| 2007 | if (NILP (best_window) | 2009 | if (NILP (best_window) |
| 2008 | || (XFASTINT (XWINDOW (best_window)->use_time) | 2010 | || (XFASTINT (XWINDOW (best_window)->use_time) |
| @@ -2053,9 +2055,9 @@ window_loop (type, obj, mini, frames) | |||
| 2053 | break; | 2055 | break; |
| 2054 | 2056 | ||
| 2055 | case GET_LARGEST_WINDOW: | 2057 | case GET_LARGEST_WINDOW: |
| 2056 | { | 2058 | { /* nil `obj' means to ignore dedicated windows. */ |
| 2057 | /* Ignore dedicated windows and minibuffers. */ | 2059 | /* Ignore dedicated windows and minibuffers. */ |
| 2058 | if (MINI_WINDOW_P (w) || EQ (w->dedicated, Qt)) | 2060 | if (MINI_WINDOW_P (w) || (NILP (obj) && EQ (w->dedicated, Qt))) |
| 2059 | break; | 2061 | break; |
| 2060 | 2062 | ||
| 2061 | if (NILP (best_window)) | 2063 | if (NILP (best_window)) |
| @@ -2149,43 +2151,47 @@ check_all_windows () | |||
| 2149 | window_loop (CHECK_ALL_WINDOWS, Qnil, 1, Qt); | 2151 | window_loop (CHECK_ALL_WINDOWS, Qnil, 1, Qt); |
| 2150 | } | 2152 | } |
| 2151 | 2153 | ||
| 2152 | DEFUN ("get-lru-window", Fget_lru_window, Sget_lru_window, 0, 1, 0, | 2154 | DEFUN ("get-lru-window", Fget_lru_window, Sget_lru_window, 0, 2, 0, |
| 2153 | doc: /* Return the window least recently selected or used for display. | 2155 | doc: /* Return the window least recently selected or used for display. |
| 2154 | Return a full-width window if possible. | 2156 | Return a full-width window if possible. |
| 2155 | A minibuffer window is never a candidate. | 2157 | A minibuffer window is never a candidate. |
| 2156 | A dedicated window is never a candidate, so if all windows are dedicated, | 2158 | A dedicated window is never a candidate, unless DEDICATED is non-nil, |
| 2157 | the value is nil. | 2159 | so if all windows are dedicated, the value is nil. |
| 2158 | If optional argument FRAME is `visible', search all visible frames. | 2160 | If optional argument FRAME is `visible', search all visible frames. |
| 2159 | If FRAME is 0, search all visible and iconified frames. | 2161 | If FRAME is 0, search all visible and iconified frames. |
| 2160 | If FRAME is t, search all frames. | 2162 | If FRAME is t, search all frames. |
| 2161 | If FRAME is nil, search only the selected frame. | 2163 | If FRAME is nil, search only the selected frame. |
| 2162 | If FRAME is a frame, search only that frame. */) | 2164 | If FRAME is a frame, search only that frame. */) |
| 2163 | (frame) | 2165 | (frame, dedicated) |
| 2164 | Lisp_Object frame; | 2166 | Lisp_Object frame, dedicated; |
| 2165 | { | 2167 | { |
| 2166 | register Lisp_Object w; | 2168 | register Lisp_Object w; |
| 2167 | /* First try for a window that is full-width */ | 2169 | /* First try for a window that is full-width */ |
| 2168 | w = window_loop (GET_LRU_WINDOW, Qt, 0, frame); | 2170 | w = window_loop (GET_LRU_WINDOW, |
| 2171 | NILP (dedicated) ? make_number (1) : make_number (3), | ||
| 2172 | 0, frame); | ||
| 2169 | if (!NILP (w) && !EQ (w, selected_window)) | 2173 | if (!NILP (w) && !EQ (w, selected_window)) |
| 2170 | return w; | 2174 | return w; |
| 2171 | /* If none of them, try the rest */ | 2175 | /* If none of them, try the rest */ |
| 2172 | return window_loop (GET_LRU_WINDOW, Qnil, 0, frame); | 2176 | return window_loop (GET_LRU_WINDOW, |
| 2177 | NILP (dedicated) ? make_number (0) : make_number (2), | ||
| 2178 | 0, frame); | ||
| 2173 | } | 2179 | } |
| 2174 | 2180 | ||
| 2175 | DEFUN ("get-largest-window", Fget_largest_window, Sget_largest_window, 0, 1, 0, | 2181 | DEFUN ("get-largest-window", Fget_largest_window, Sget_largest_window, 0, 2, 0, |
| 2176 | doc: /* Return the largest window in area. | 2182 | doc: /* Return the largest window in area. |
| 2177 | A minibuffer window is never a candidate. | 2183 | A minibuffer window is never a candidate. |
| 2178 | A dedicated window is never a candidate, so if all windows are dedicated, | 2184 | A dedicated window is never a candidate unless DEDICATED is non-nil, |
| 2179 | the value is nil. | 2185 | so if all windows are dedicated, the value is nil. |
| 2180 | If optional argument FRAME is `visible', search all visible frames. | 2186 | If optional argument FRAME is `visible', search all visible frames. |
| 2181 | If FRAME is 0, search all visible and iconified frames. | 2187 | If FRAME is 0, search all visible and iconified frames. |
| 2182 | If FRAME is t, search all frames. | 2188 | If FRAME is t, search all frames. |
| 2183 | If FRAME is nil, search only the selected frame. | 2189 | If FRAME is nil, search only the selected frame. |
| 2184 | If FRAME is a frame, search only that frame. */) | 2190 | If FRAME is a frame, search only that frame. */) |
| 2185 | (frame) | 2191 | (frame, dedicated) |
| 2186 | Lisp_Object frame; | 2192 | Lisp_Object frame, dedicated; |
| 2187 | { | 2193 | { |
| 2188 | return window_loop (GET_LARGEST_WINDOW, Qnil, 0, | 2194 | return window_loop (GET_LARGEST_WINDOW, dedicated, 0, |
| 2189 | frame); | 2195 | frame); |
| 2190 | } | 2196 | } |
| 2191 | 2197 | ||
| @@ -3505,15 +3511,17 @@ displayed. */) | |||
| 3505 | if (FRAME_NO_SPLIT_P (NILP (frames) ? f : last_nonminibuf_frame)) | 3511 | if (FRAME_NO_SPLIT_P (NILP (frames) ? f : last_nonminibuf_frame)) |
| 3506 | { | 3512 | { |
| 3507 | /* Try visible frames first. */ | 3513 | /* Try visible frames first. */ |
| 3508 | window = Fget_largest_window (Qvisible); | 3514 | window = Fget_largest_window (Qvisible, Qt); |
| 3509 | /* If that didn't work, try iconified frames. */ | 3515 | /* If that didn't work, try iconified frames. */ |
| 3510 | if (NILP (window)) | 3516 | if (NILP (window)) |
| 3511 | window = Fget_largest_window (make_number (0)); | 3517 | window = Fget_largest_window (make_number (0), Qt); |
| 3518 | #if 0 /* Don't try windows on other displays. */ | ||
| 3512 | if (NILP (window)) | 3519 | if (NILP (window)) |
| 3513 | window = Fget_largest_window (Qt); | 3520 | window = Fget_largest_window (Qt, Qt); |
| 3521 | #endif | ||
| 3514 | } | 3522 | } |
| 3515 | else | 3523 | else |
| 3516 | window = Fget_largest_window (frames); | 3524 | window = Fget_largest_window (frames, Qt); |
| 3517 | 3525 | ||
| 3518 | /* If we got a tall enough full-width window that can be split, | 3526 | /* If we got a tall enough full-width window that can be split, |
| 3519 | split it. */ | 3527 | split it. */ |
| @@ -3526,7 +3534,7 @@ displayed. */) | |||
| 3526 | { | 3534 | { |
| 3527 | Lisp_Object upper, lower, other; | 3535 | Lisp_Object upper, lower, other; |
| 3528 | 3536 | ||
| 3529 | window = Fget_lru_window (frames); | 3537 | window = Fget_lru_window (frames, Qt); |
| 3530 | /* If the LRU window is selected, and big enough, | 3538 | /* If the LRU window is selected, and big enough, |
| 3531 | and can be split, split it. */ | 3539 | and can be split, split it. */ |
| 3532 | if (!NILP (window) | 3540 | if (!NILP (window) |
| @@ -3535,23 +3543,27 @@ displayed. */) | |||
| 3535 | || EQ (XWINDOW (window)->parent, Qnil)) | 3543 | || EQ (XWINDOW (window)->parent, Qnil)) |
| 3536 | && window_height (window) >= window_min_height << 1) | 3544 | && window_height (window) >= window_min_height << 1) |
| 3537 | window = Fsplit_window (window, Qnil, Qnil); | 3545 | window = Fsplit_window (window, Qnil, Qnil); |
| 3546 | else | ||
| 3547 | window = Fget_lru_window (frames, Qnil); | ||
| 3538 | /* If Fget_lru_window returned nil, try other approaches. */ | 3548 | /* If Fget_lru_window returned nil, try other approaches. */ |
| 3539 | 3549 | ||
| 3540 | /* Try visible frames first. */ | 3550 | /* Try visible frames first. */ |
| 3541 | if (NILP (window)) | 3551 | if (NILP (window)) |
| 3542 | window = Fget_buffer_window (buffer, Qvisible); | 3552 | window = Fget_buffer_window (buffer, Qvisible); |
| 3543 | if (NILP (window)) | 3553 | if (NILP (window)) |
| 3544 | window = Fget_largest_window (Qvisible); | 3554 | window = Fget_largest_window (Qvisible, Qnil); |
| 3545 | /* If that didn't work, try iconified frames. */ | 3555 | /* If that didn't work, try iconified frames. */ |
| 3546 | if (NILP (window)) | 3556 | if (NILP (window)) |
| 3547 | window = Fget_buffer_window (buffer, make_number (0)); | 3557 | window = Fget_buffer_window (buffer, make_number (0)); |
| 3548 | if (NILP (window)) | 3558 | if (NILP (window)) |
| 3549 | window = Fget_largest_window (make_number (0)); | 3559 | window = Fget_largest_window (make_number (0), Qnil); |
| 3550 | /* Try invisible frames. */ | 3560 | |
| 3561 | #if 0 /* Don't try frames on other displays. */ | ||
| 3551 | if (NILP (window)) | 3562 | if (NILP (window)) |
| 3552 | window = Fget_buffer_window (buffer, Qt); | 3563 | window = Fget_buffer_window (buffer, Qt); |
| 3553 | if (NILP (window)) | 3564 | if (NILP (window)) |
| 3554 | window = Fget_largest_window (Qt); | 3565 | window = Fget_largest_window (Qt, Qnil); |
| 3566 | #endif | ||
| 3555 | /* As a last resort, make a new frame. */ | 3567 | /* As a last resort, make a new frame. */ |
| 3556 | if (NILP (window)) | 3568 | if (NILP (window)) |
| 3557 | window = Fframe_selected_window (call0 (Vpop_up_frame_function)); | 3569 | window = Fframe_selected_window (call0 (Vpop_up_frame_function)); |
| @@ -3578,7 +3590,7 @@ displayed. */) | |||
| 3578 | } | 3590 | } |
| 3579 | } | 3591 | } |
| 3580 | else | 3592 | else |
| 3581 | window = Fget_lru_window (Qnil); | 3593 | window = Fget_lru_window (Qnil, Qnil); |
| 3582 | 3594 | ||
| 3583 | Fset_window_buffer (window, buffer, Qnil); | 3595 | Fset_window_buffer (window, buffer, Qnil); |
| 3584 | return display_buffer_1 (window); | 3596 | return display_buffer_1 (window); |
| @@ -3868,15 +3880,16 @@ DEFUN ("enlarge-window", Fenlarge_window, Senlarge_window, 1, 3, "p", | |||
| 3868 | doc: /* Make current window ARG lines bigger. | 3880 | doc: /* Make current window ARG lines bigger. |
| 3869 | From program, optional second arg non-nil means grow sideways ARG columns. | 3881 | From program, optional second arg non-nil means grow sideways ARG columns. |
| 3870 | Interactively, if an argument is not given, make the window one line bigger. | 3882 | Interactively, if an argument is not given, make the window one line bigger. |
| 3883 | If HORIZONTAL is non-nil, enlarge horizontally instead of vertically. | ||
| 3871 | 3884 | ||
| 3872 | Optional third arg PRESERVE-BEFORE, if non-nil, means do not change the size | 3885 | Optional third arg PRESERVE-BEFORE, if non-nil, means do not change the size |
| 3873 | of the siblings above or to the left of the selected window. Only | 3886 | of the siblings above or to the left of the selected window. Only |
| 3874 | siblings to the right or below are changed. */) | 3887 | siblings to the right or below are changed. */) |
| 3875 | (arg, side, preserve_before) | 3888 | (arg, horizontal, preserve_before) |
| 3876 | register Lisp_Object arg, side, preserve_before; | 3889 | register Lisp_Object arg, horizontal, preserve_before; |
| 3877 | { | 3890 | { |
| 3878 | CHECK_NUMBER (arg); | 3891 | CHECK_NUMBER (arg); |
| 3879 | enlarge_window (selected_window, XINT (arg), !NILP (side), | 3892 | enlarge_window (selected_window, XINT (arg), !NILP (horizontal), |
| 3880 | !NILP (preserve_before)); | 3893 | !NILP (preserve_before)); |
| 3881 | 3894 | ||
| 3882 | if (! NILP (Vwindow_configuration_change_hook)) | 3895 | if (! NILP (Vwindow_configuration_change_hook)) |
| @@ -3924,40 +3937,43 @@ window_width (window) | |||
| 3924 | 3937 | ||
| 3925 | 3938 | ||
| 3926 | #define CURBEG(w) \ | 3939 | #define CURBEG(w) \ |
| 3927 | *(widthflag ? &(XWINDOW (w)->left_col) : &(XWINDOW (w)->top_line)) | 3940 | *(horiz_flag ? &(XWINDOW (w)->left_col) : &(XWINDOW (w)->top_line)) |
| 3928 | 3941 | ||
| 3929 | #define CURSIZE(w) \ | 3942 | #define CURSIZE(w) \ |
| 3930 | *(widthflag ? &(XWINDOW (w)->total_cols) : &(XWINDOW (w)->total_lines)) | 3943 | *(horiz_flag ? &(XWINDOW (w)->total_cols) : &(XWINDOW (w)->total_lines)) |
| 3944 | |||
| 3931 | 3945 | ||
| 3946 | /* Enlarge WINDOW by DELTA. | ||
| 3947 | HORIZ_FLAG nonzero means enlarge it horizontally; | ||
| 3948 | zero means do it vertically. | ||
| 3932 | 3949 | ||
| 3933 | /* Enlarge WINDOW by DELTA. WIDTHFLAG non-zero means | 3950 | Siblings of the selected window are resized to fulfill the size |
| 3934 | increase its width. Siblings of the selected window are resized to | 3951 | request. If they become too small in the process, they will be |
| 3935 | fulfill the size request. If they become too small in the process, | 3952 | deleted. |
| 3936 | they will be deleted. | ||
| 3937 | 3953 | ||
| 3938 | If PRESERVE_BEFORE is nonzero, that means don't alter | 3954 | If PRESERVE_BEFORE is nonzero, that means don't alter |
| 3939 | the siblings to the left or above WINDOW. */ | 3955 | the siblings to the left or above WINDOW. */ |
| 3940 | 3956 | ||
| 3941 | static void | 3957 | static void |
| 3942 | enlarge_window (window, delta, widthflag, preserve_before) | 3958 | enlarge_window (window, delta, horiz_flag, preserve_before) |
| 3943 | Lisp_Object window; | 3959 | Lisp_Object window; |
| 3944 | int delta, widthflag, preserve_before; | 3960 | int delta, horiz_flag, preserve_before; |
| 3945 | { | 3961 | { |
| 3946 | Lisp_Object parent, next, prev; | 3962 | Lisp_Object parent, next, prev; |
| 3947 | struct window *p; | 3963 | struct window *p; |
| 3948 | Lisp_Object *sizep; | 3964 | Lisp_Object *sizep; |
| 3949 | int maximum; | 3965 | int maximum; |
| 3950 | int (*sizefun) P_ ((Lisp_Object)) | 3966 | int (*sizefun) P_ ((Lisp_Object)) |
| 3951 | = widthflag ? window_width : window_height; | 3967 | = horiz_flag ? window_width : window_height; |
| 3952 | void (*setsizefun) P_ ((Lisp_Object, int, int)) | 3968 | void (*setsizefun) P_ ((Lisp_Object, int, int)) |
| 3953 | = (widthflag ? set_window_width : set_window_height); | 3969 | = (horiz_flag ? set_window_width : set_window_height); |
| 3954 | 3970 | ||
| 3955 | /* Check values of window_min_width and window_min_height for | 3971 | /* Check values of window_min_width and window_min_height for |
| 3956 | validity. */ | 3972 | validity. */ |
| 3957 | check_min_window_sizes (); | 3973 | check_min_window_sizes (); |
| 3958 | 3974 | ||
| 3959 | /* Give up if this window cannot be resized. */ | 3975 | /* Give up if this window cannot be resized. */ |
| 3960 | if (window_fixed_size_p (XWINDOW (window), widthflag, 1)) | 3976 | if (window_fixed_size_p (XWINDOW (window), horiz_flag, 1)) |
| 3961 | error ("Window is not resizable"); | 3977 | error ("Window is not resizable"); |
| 3962 | 3978 | ||
| 3963 | /* Find the parent of the selected window. */ | 3979 | /* Find the parent of the selected window. */ |
| @@ -3968,12 +3984,12 @@ enlarge_window (window, delta, widthflag, preserve_before) | |||
| 3968 | 3984 | ||
| 3969 | if (NILP (parent)) | 3985 | if (NILP (parent)) |
| 3970 | { | 3986 | { |
| 3971 | if (widthflag) | 3987 | if (horiz_flag) |
| 3972 | error ("No other window to side of this one"); | 3988 | error ("No other window to side of this one"); |
| 3973 | break; | 3989 | break; |
| 3974 | } | 3990 | } |
| 3975 | 3991 | ||
| 3976 | if (widthflag | 3992 | if (horiz_flag |
| 3977 | ? !NILP (XWINDOW (parent)->hchild) | 3993 | ? !NILP (XWINDOW (parent)->hchild) |
| 3978 | : !NILP (XWINDOW (parent)->vchild)) | 3994 | : !NILP (XWINDOW (parent)->vchild)) |
| 3979 | break; | 3995 | break; |
| @@ -3999,7 +4015,7 @@ enlarge_window (window, delta, widthflag, preserve_before) | |||
| 3999 | else | 4015 | else |
| 4000 | maxdelta = (!NILP (p->next) ? ((*sizefun) (p->next) | 4016 | maxdelta = (!NILP (p->next) ? ((*sizefun) (p->next) |
| 4001 | - window_min_size (XWINDOW (p->next), | 4017 | - window_min_size (XWINDOW (p->next), |
| 4002 | widthflag, 0, 0)) | 4018 | horiz_flag, 0, 0)) |
| 4003 | : (delta = 0)); | 4019 | : (delta = 0)); |
| 4004 | } | 4020 | } |
| 4005 | else | 4021 | else |
| @@ -4007,11 +4023,11 @@ enlarge_window (window, delta, widthflag, preserve_before) | |||
| 4007 | /* This is a main window followed by a minibuffer. */ | 4023 | /* This is a main window followed by a minibuffer. */ |
| 4008 | : !NILP (p->next) ? ((*sizefun) (p->next) | 4024 | : !NILP (p->next) ? ((*sizefun) (p->next) |
| 4009 | - window_min_size (XWINDOW (p->next), | 4025 | - window_min_size (XWINDOW (p->next), |
| 4010 | widthflag, 0, 0)) | 4026 | horiz_flag, 0, 0)) |
| 4011 | /* This is a minibuffer following a main window. */ | 4027 | /* This is a minibuffer following a main window. */ |
| 4012 | : !NILP (p->prev) ? ((*sizefun) (p->prev) | 4028 | : !NILP (p->prev) ? ((*sizefun) (p->prev) |
| 4013 | - window_min_size (XWINDOW (p->prev), | 4029 | - window_min_size (XWINDOW (p->prev), |
| 4014 | widthflag, 0, 0)) | 4030 | horiz_flag, 0, 0)) |
| 4015 | /* This is a frame with only one window, a minibuffer-only | 4031 | /* This is a frame with only one window, a minibuffer-only |
| 4016 | or a minibufferless frame. */ | 4032 | or a minibufferless frame. */ |
| 4017 | : (delta = 0)); | 4033 | : (delta = 0)); |
| @@ -4023,7 +4039,7 @@ enlarge_window (window, delta, widthflag, preserve_before) | |||
| 4023 | delta = maxdelta; | 4039 | delta = maxdelta; |
| 4024 | } | 4040 | } |
| 4025 | 4041 | ||
| 4026 | if (XINT (*sizep) + delta < window_min_size (XWINDOW (window), widthflag, 0, 0)) | 4042 | if (XINT (*sizep) + delta < window_min_size (XWINDOW (window), horiz_flag, 0, 0)) |
| 4027 | { | 4043 | { |
| 4028 | delete_window (window); | 4044 | delete_window (window); |
| 4029 | return; | 4045 | return; |
| @@ -4036,11 +4052,11 @@ enlarge_window (window, delta, widthflag, preserve_before) | |||
| 4036 | maximum = 0; | 4052 | maximum = 0; |
| 4037 | for (next = p->next; ! NILP (next); next = XWINDOW (next)->next) | 4053 | for (next = p->next; ! NILP (next); next = XWINDOW (next)->next) |
| 4038 | maximum += (*sizefun) (next) - window_min_size (XWINDOW (next), | 4054 | maximum += (*sizefun) (next) - window_min_size (XWINDOW (next), |
| 4039 | widthflag, 0, 0); | 4055 | horiz_flag, 0, 0); |
| 4040 | if (! preserve_before) | 4056 | if (! preserve_before) |
| 4041 | for (prev = p->prev; ! NILP (prev); prev = XWINDOW (prev)->prev) | 4057 | for (prev = p->prev; ! NILP (prev); prev = XWINDOW (prev)->prev) |
| 4042 | maximum += (*sizefun) (prev) - window_min_size (XWINDOW (prev), | 4058 | maximum += (*sizefun) (prev) - window_min_size (XWINDOW (prev), |
| 4043 | widthflag, 0, 0); | 4059 | horiz_flag, 0, 0); |
| 4044 | 4060 | ||
| 4045 | /* If we can get it all from them without deleting them, do so. */ | 4061 | /* If we can get it all from them without deleting them, do so. */ |
| 4046 | if (delta <= maximum) | 4062 | if (delta <= maximum) |
| @@ -4062,7 +4078,7 @@ enlarge_window (window, delta, widthflag, preserve_before) | |||
| 4062 | { | 4078 | { |
| 4063 | int this_one = ((*sizefun) (next) | 4079 | int this_one = ((*sizefun) (next) |
| 4064 | - window_min_size (XWINDOW (next), | 4080 | - window_min_size (XWINDOW (next), |
| 4065 | widthflag, 0, &fixed_p)); | 4081 | horiz_flag, 0, &fixed_p)); |
| 4066 | if (!fixed_p) | 4082 | if (!fixed_p) |
| 4067 | { | 4083 | { |
| 4068 | if (this_one > delta) | 4084 | if (this_one > delta) |
| @@ -4084,7 +4100,7 @@ enlarge_window (window, delta, widthflag, preserve_before) | |||
| 4084 | { | 4100 | { |
| 4085 | int this_one = ((*sizefun) (prev) | 4101 | int this_one = ((*sizefun) (prev) |
| 4086 | - window_min_size (XWINDOW (prev), | 4102 | - window_min_size (XWINDOW (prev), |
| 4087 | widthflag, 0, &fixed_p)); | 4103 | horiz_flag, 0, &fixed_p)); |
| 4088 | if (!fixed_p) | 4104 | if (!fixed_p) |
| 4089 | { | 4105 | { |
| 4090 | if (this_one > delta) | 4106 | if (this_one > delta) |
| @@ -4187,10 +4203,10 @@ enlarge_window (window, delta, widthflag, preserve_before) | |||
| 4187 | int n = 1; | 4203 | int n = 1; |
| 4188 | 4204 | ||
| 4189 | for (s = w->next; !NILP (s); s = XWINDOW (s)->next) | 4205 | for (s = w->next; !NILP (s); s = XWINDOW (s)->next) |
| 4190 | if (!window_fixed_size_p (XWINDOW (s), widthflag, 0)) | 4206 | if (!window_fixed_size_p (XWINDOW (s), horiz_flag, 0)) |
| 4191 | ++n; | 4207 | ++n; |
| 4192 | for (s = w->prev; !NILP (s); s = XWINDOW (s)->prev) | 4208 | for (s = w->prev; !NILP (s); s = XWINDOW (s)->prev) |
| 4193 | if (!window_fixed_size_p (XWINDOW (s), widthflag, 0)) | 4209 | if (!window_fixed_size_p (XWINDOW (s), horiz_flag, 0)) |
| 4194 | ++n; | 4210 | ++n; |
| 4195 | 4211 | ||
| 4196 | delta1 = n * delta; | 4212 | delta1 = n * delta; |
diff --git a/src/xdisp.c b/src/xdisp.c index ff3d9f2ca0c..4db562c2283 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -3163,6 +3163,9 @@ handle_fontified_prop (it) | |||
| 3163 | Lisp_Object prop, pos; | 3163 | Lisp_Object prop, pos; |
| 3164 | enum prop_handled handled = HANDLED_NORMALLY; | 3164 | enum prop_handled handled = HANDLED_NORMALLY; |
| 3165 | 3165 | ||
| 3166 | if (!NILP (Vmemory_full)) | ||
| 3167 | return handled; | ||
| 3168 | |||
| 3166 | /* Get the value of the `fontified' property at IT's current buffer | 3169 | /* Get the value of the `fontified' property at IT's current buffer |
| 3167 | position. (The `fontified' property doesn't have a special | 3170 | position. (The `fontified' property doesn't have a special |
| 3168 | meaning in strings.) If the value is nil, call functions from | 3171 | meaning in strings.) If the value is nil, call functions from |
| @@ -8618,7 +8621,7 @@ static Lisp_Object mode_line_string_face_prop; | |||
| 8618 | static Lisp_Object Vmode_line_unwind_vector; | 8621 | static Lisp_Object Vmode_line_unwind_vector; |
| 8619 | 8622 | ||
| 8620 | static Lisp_Object | 8623 | static Lisp_Object |
| 8621 | format_mode_line_unwind_data (obuf) | 8624 | format_mode_line_unwind_data (obuf, save_proptrans) |
| 8622 | struct buffer *obuf; | 8625 | struct buffer *obuf; |
| 8623 | { | 8626 | { |
| 8624 | Lisp_Object vector; | 8627 | Lisp_Object vector; |
| @@ -8634,7 +8637,7 @@ format_mode_line_unwind_data (obuf) | |||
| 8634 | AREF (vector, 0) = make_number (mode_line_target); | 8637 | AREF (vector, 0) = make_number (mode_line_target); |
| 8635 | AREF (vector, 1) = make_number (MODE_LINE_NOPROP_LEN (0)); | 8638 | AREF (vector, 1) = make_number (MODE_LINE_NOPROP_LEN (0)); |
| 8636 | AREF (vector, 2) = mode_line_string_list; | 8639 | AREF (vector, 2) = mode_line_string_list; |
| 8637 | AREF (vector, 3) = mode_line_proptrans_alist; | 8640 | AREF (vector, 3) = (save_proptrans ? mode_line_proptrans_alist : Qt); |
| 8638 | AREF (vector, 4) = mode_line_string_face; | 8641 | AREF (vector, 4) = mode_line_string_face; |
| 8639 | AREF (vector, 5) = mode_line_string_face_prop; | 8642 | AREF (vector, 5) = mode_line_string_face_prop; |
| 8640 | 8643 | ||
| @@ -8653,7 +8656,8 @@ unwind_format_mode_line (vector) | |||
| 8653 | mode_line_target = XINT (AREF (vector, 0)); | 8656 | mode_line_target = XINT (AREF (vector, 0)); |
| 8654 | mode_line_noprop_ptr = mode_line_noprop_buf + XINT (AREF (vector, 1)); | 8657 | mode_line_noprop_ptr = mode_line_noprop_buf + XINT (AREF (vector, 1)); |
| 8655 | mode_line_string_list = AREF (vector, 2); | 8658 | mode_line_string_list = AREF (vector, 2); |
| 8656 | mode_line_proptrans_alist = AREF (vector, 3); | 8659 | if (! EQ (AREF (vector, 3), Qt)) |
| 8660 | mode_line_proptrans_alist = AREF (vector, 3); | ||
| 8657 | mode_line_string_face = AREF (vector, 4); | 8661 | mode_line_string_face = AREF (vector, 4); |
| 8658 | mode_line_string_face_prop = AREF (vector, 5); | 8662 | mode_line_string_face_prop = AREF (vector, 5); |
| 8659 | 8663 | ||
| @@ -8776,7 +8780,7 @@ x_consider_frame_title (frame) | |||
| 8776 | mode_line_target so that display_mode_element will output into | 8780 | mode_line_target so that display_mode_element will output into |
| 8777 | mode_line_noprop_buf; then display the title. */ | 8781 | mode_line_noprop_buf; then display the title. */ |
| 8778 | record_unwind_protect (unwind_format_mode_line, | 8782 | record_unwind_protect (unwind_format_mode_line, |
| 8779 | format_mode_line_unwind_data (current_buffer)); | 8783 | format_mode_line_unwind_data (current_buffer, 0)); |
| 8780 | 8784 | ||
| 8781 | set_buffer_internal_1 (XBUFFER (XWINDOW (f->selected_window)->buffer)); | 8785 | set_buffer_internal_1 (XBUFFER (XWINDOW (f->selected_window)->buffer)); |
| 8782 | fmt = FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format; | 8786 | fmt = FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format; |
| @@ -10575,7 +10579,8 @@ redisplay_internal (preserve_echo_area) | |||
| 10575 | clear_garbaged_frames (); | 10579 | clear_garbaged_frames (); |
| 10576 | 10580 | ||
| 10577 | /* Build menubar and tool-bar items. */ | 10581 | /* Build menubar and tool-bar items. */ |
| 10578 | prepare_menu_bars (); | 10582 | if (NILP (Vmemory_full)) |
| 10583 | prepare_menu_bars (); | ||
| 10579 | 10584 | ||
| 10580 | if (windows_or_buffers_changed) | 10585 | if (windows_or_buffers_changed) |
| 10581 | update_mode_lines++; | 10586 | update_mode_lines++; |
| @@ -15686,7 +15691,9 @@ display_line (it) | |||
| 15686 | produce_special_glyphs (it, IT_CONTINUATION); | 15691 | produce_special_glyphs (it, IT_CONTINUATION); |
| 15687 | row->continued_p = 1; | 15692 | row->continued_p = 1; |
| 15688 | 15693 | ||
| 15694 | it->current_x = x_before; | ||
| 15689 | it->continuation_lines_width += x; | 15695 | it->continuation_lines_width += x; |
| 15696 | extend_face_to_end_of_line (it); | ||
| 15690 | 15697 | ||
| 15691 | if (nglyphs > 1 && i > 0) | 15698 | if (nglyphs > 1 && i > 0) |
| 15692 | { | 15699 | { |
| @@ -16171,7 +16178,7 @@ display_mode_line (w, face_id, format) | |||
| 16171 | it.base_face_id = it.face_id = DEFAULT_FACE_ID; | 16178 | it.base_face_id = it.face_id = DEFAULT_FACE_ID; |
| 16172 | 16179 | ||
| 16173 | record_unwind_protect (unwind_format_mode_line, | 16180 | record_unwind_protect (unwind_format_mode_line, |
| 16174 | format_mode_line_unwind_data (NULL)); | 16181 | format_mode_line_unwind_data (NULL, 0)); |
| 16175 | 16182 | ||
| 16176 | mode_line_target = MODE_LINE_DISPLAY; | 16183 | mode_line_target = MODE_LINE_DISPLAY; |
| 16177 | 16184 | ||
| @@ -16206,6 +16213,44 @@ display_mode_line (w, face_id, format) | |||
| 16206 | return it.glyph_row->height; | 16213 | return it.glyph_row->height; |
| 16207 | } | 16214 | } |
| 16208 | 16215 | ||
| 16216 | /* Move element ELT in LIST to the front of LIST. | ||
| 16217 | Return the updated list. */ | ||
| 16218 | |||
| 16219 | static Lisp_Object | ||
| 16220 | move_elt_to_front (elt, list) | ||
| 16221 | Lisp_Object elt, list; | ||
| 16222 | { | ||
| 16223 | register Lisp_Object tail, prev; | ||
| 16224 | register Lisp_Object tem; | ||
| 16225 | |||
| 16226 | tail = list; | ||
| 16227 | prev = Qnil; | ||
| 16228 | while (CONSP (tail)) | ||
| 16229 | { | ||
| 16230 | tem = XCAR (tail); | ||
| 16231 | |||
| 16232 | if (EQ (elt, tem)) | ||
| 16233 | { | ||
| 16234 | /* Splice out the link TAIL. */ | ||
| 16235 | if (NILP (prev)) | ||
| 16236 | list = XCDR (tail); | ||
| 16237 | else | ||
| 16238 | Fsetcdr (prev, XCDR (tail)); | ||
| 16239 | |||
| 16240 | /* Now make it the first. */ | ||
| 16241 | Fsetcdr (tail, list); | ||
| 16242 | return tail; | ||
| 16243 | } | ||
| 16244 | else | ||
| 16245 | prev = tail; | ||
| 16246 | tail = XCDR (tail); | ||
| 16247 | QUIT; | ||
| 16248 | } | ||
| 16249 | |||
| 16250 | /* Not found--return unchanged LIST. */ | ||
| 16251 | return list; | ||
| 16252 | } | ||
| 16253 | |||
| 16209 | /* Contribute ELT to the mode line for window IT->w. How it | 16254 | /* Contribute ELT to the mode line for window IT->w. How it |
| 16210 | translates into text depends on its data type. | 16255 | translates into text depends on its data type. |
| 16211 | 16256 | ||
| @@ -16255,7 +16300,8 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) | |||
| 16255 | unsigned char c; | 16300 | unsigned char c; |
| 16256 | int offset = 0; | 16301 | int offset = 0; |
| 16257 | 16302 | ||
| 16258 | if (!NILP (props) || risky) | 16303 | if (SCHARS (elt) > 0 |
| 16304 | && (!NILP (props) || risky)) | ||
| 16259 | { | 16305 | { |
| 16260 | Lisp_Object oprops, aelt; | 16306 | Lisp_Object oprops, aelt; |
| 16261 | oprops = Ftext_properties_at (make_number (0), elt); | 16307 | oprops = Ftext_properties_at (make_number (0), elt); |
| @@ -16286,14 +16332,22 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) | |||
| 16286 | aelt = Fassoc (elt, mode_line_proptrans_alist); | 16332 | aelt = Fassoc (elt, mode_line_proptrans_alist); |
| 16287 | if (! NILP (aelt) && !NILP (Fequal (props, XCDR (aelt)))) | 16333 | if (! NILP (aelt) && !NILP (Fequal (props, XCDR (aelt)))) |
| 16288 | { | 16334 | { |
| 16289 | mode_line_proptrans_alist | 16335 | /* AELT is what we want. Move it to the front |
| 16290 | = Fcons (aelt, Fdelq (aelt, mode_line_proptrans_alist)); | 16336 | without consing. */ |
| 16291 | elt = XCAR (aelt); | 16337 | elt = XCAR (aelt); |
| 16338 | mode_line_proptrans_alist | ||
| 16339 | = move_elt_to_front (aelt, mode_line_proptrans_alist); | ||
| 16292 | } | 16340 | } |
| 16293 | else | 16341 | else |
| 16294 | { | 16342 | { |
| 16295 | Lisp_Object tem; | 16343 | Lisp_Object tem; |
| 16296 | 16344 | ||
| 16345 | /* If AELT has the wrong props, it is useless. | ||
| 16346 | so get rid of it. */ | ||
| 16347 | if (! NILP (aelt)) | ||
| 16348 | mode_line_proptrans_alist | ||
| 16349 | = Fdelq (aelt, mode_line_proptrans_alist); | ||
| 16350 | |||
| 16297 | elt = Fcopy_sequence (elt); | 16351 | elt = Fcopy_sequence (elt); |
| 16298 | Fset_text_properties (make_number (0), Flength (elt), | 16352 | Fset_text_properties (make_number (0), Flength (elt), |
| 16299 | props, elt); | 16353 | props, elt); |
| @@ -16818,8 +16872,11 @@ are the selected window and the window's buffer). */) | |||
| 16818 | if (XBUFFER (buffer) != current_buffer) | 16872 | if (XBUFFER (buffer) != current_buffer) |
| 16819 | old_buffer = current_buffer; | 16873 | old_buffer = current_buffer; |
| 16820 | 16874 | ||
| 16875 | /* Save things including mode_line_proptrans_alist, | ||
| 16876 | and set that to nil so that we don't alter the outer value. */ | ||
| 16821 | record_unwind_protect (unwind_format_mode_line, | 16877 | record_unwind_protect (unwind_format_mode_line, |
| 16822 | format_mode_line_unwind_data (old_buffer)); | 16878 | format_mode_line_unwind_data (old_buffer, 1)); |
| 16879 | mode_line_proptrans_alist = Qnil; | ||
| 16823 | 16880 | ||
| 16824 | if (old_buffer) | 16881 | if (old_buffer) |
| 16825 | set_buffer_internal_1 (XBUFFER (buffer)); | 16882 | set_buffer_internal_1 (XBUFFER (buffer)); |
| @@ -17204,6 +17261,18 @@ decode_mode_spec (w, c, field_width, precision, multibyte) | |||
| 17204 | return decode_mode_spec_buf; | 17261 | return decode_mode_spec_buf; |
| 17205 | } | 17262 | } |
| 17206 | 17263 | ||
| 17264 | case 'e': | ||
| 17265 | #ifndef SYSTEM_MALLOC | ||
| 17266 | { | ||
| 17267 | if (NILP (Vmemory_full)) | ||
| 17268 | return ""; | ||
| 17269 | else | ||
| 17270 | return "!MEM FULL! "; | ||
| 17271 | } | ||
| 17272 | #else | ||
| 17273 | return ""; | ||
| 17274 | #endif | ||
| 17275 | |||
| 17207 | case 'F': | 17276 | case 'F': |
| 17208 | /* %F displays the frame name. */ | 17277 | /* %F displays the frame name. */ |
| 17209 | if (!NILP (f->title)) | 17278 | if (!NILP (f->title)) |
| @@ -18723,19 +18792,15 @@ set_glyph_string_background_width (s, start, last_x) | |||
| 18723 | { | 18792 | { |
| 18724 | /* If the face of this glyph string has to be drawn to the end of | 18793 | /* If the face of this glyph string has to be drawn to the end of |
| 18725 | the drawing area, set S->extends_to_end_of_line_p. */ | 18794 | the drawing area, set S->extends_to_end_of_line_p. */ |
| 18726 | struct face *default_face = FACE_FROM_ID (s->f, DEFAULT_FACE_ID); | ||
| 18727 | 18795 | ||
| 18728 | if (start == s->row->used[s->area] | 18796 | if (start == s->row->used[s->area] |
| 18729 | && s->area == TEXT_AREA | 18797 | && s->area == TEXT_AREA |
| 18730 | && ((s->hl == DRAW_NORMAL_TEXT | 18798 | && ((s->row->fill_line_p |
| 18731 | && (s->row->fill_line_p | 18799 | && (s->hl == DRAW_NORMAL_TEXT |
| 18732 | || s->face->background != default_face->background | 18800 | || s->hl == DRAW_IMAGE_RAISED |
| 18733 | || s->face->stipple != default_face->stipple | 18801 | || s->hl == DRAW_IMAGE_SUNKEN)) |
| 18734 | || s->row->mouse_face_p)) | 18802 | || s->hl == DRAW_MOUSE_FACE)) |
| 18735 | || s->hl == DRAW_MOUSE_FACE | 18803 | s->extends_to_end_of_line_p = 1; |
| 18736 | || ((s->hl == DRAW_IMAGE_RAISED || s->hl == DRAW_IMAGE_SUNKEN) | ||
| 18737 | && s->row->fill_line_p))) | ||
| 18738 | s->extends_to_end_of_line_p = 1; | ||
| 18739 | 18804 | ||
| 18740 | /* If S extends its face to the end of the line, set its | 18805 | /* If S extends its face to the end of the line, set its |
| 18741 | background_width to the distance to the right edge of the drawing | 18806 | background_width to the distance to the right edge of the drawing |
| @@ -21279,7 +21344,11 @@ show_mouse_face (dpyinfo, draw) | |||
| 21279 | if (row == last) | 21344 | if (row == last) |
| 21280 | end_hpos = dpyinfo->mouse_face_end_col; | 21345 | end_hpos = dpyinfo->mouse_face_end_col; |
| 21281 | else | 21346 | else |
| 21282 | end_hpos = row->used[TEXT_AREA]; | 21347 | { |
| 21348 | end_hpos = row->used[TEXT_AREA]; | ||
| 21349 | if (draw == DRAW_NORMAL_TEXT) | ||
| 21350 | row->fill_line_p = 1; /* Clear to end of line */ | ||
| 21351 | } | ||
| 21283 | 21352 | ||
| 21284 | if (end_hpos > start_hpos) | 21353 | if (end_hpos > start_hpos) |
| 21285 | { | 21354 | { |
diff --git a/src/xfns.c b/src/xfns.c index 47c146237a7..d39616429ad 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -5743,6 +5743,8 @@ chooser is used instead. To turn off all file dialogs set the | |||
| 5743 | variable `use-file-dialog'. */); | 5743 | variable `use-file-dialog'. */); |
| 5744 | x_use_old_gtk_file_dialog = 0; | 5744 | x_use_old_gtk_file_dialog = 0; |
| 5745 | 5745 | ||
| 5746 | Fprovide (intern ("x"), Qnil); | ||
| 5747 | |||
| 5746 | #ifdef USE_X_TOOLKIT | 5748 | #ifdef USE_X_TOOLKIT |
| 5747 | Fprovide (intern ("x-toolkit"), Qnil); | 5749 | Fprovide (intern ("x-toolkit"), Qnil); |
| 5748 | #ifdef USE_MOTIF | 5750 | #ifdef USE_MOTIF |