diff options
| author | Karoly Lorentey | 2004-05-30 21:11:48 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2004-05-30 21:11:48 +0000 |
| commit | a596810c6c3c3c2fd450717f5083a5ff5207d243 (patch) | |
| tree | e84b4a480f6b5bdfb232a384c4c77472950be2a8 /src | |
| parent | 3de8a2533978f2e296b418a1ab0ae41deb00fa40 (diff) | |
| parent | 9dd5e8d7c1e0cb26cc75f8cdf91eeaa170b48a6a (diff) | |
| download | emacs-a596810c6c3c3c2fd450717f5083a5ff5207d243.tar.gz emacs-a596810c6c3c3c2fd450717f5083a5ff5207d243.zip | |
Merged in changes from CVS trunk.
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-344
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-345
Tweak source regexps so that building in place won't cause problems
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-346
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-347
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-348
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-349
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-350
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-351
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-352
Update from CVS: lisp/flymake.el: New file.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-182
Diffstat (limited to 'src')
| -rw-r--r-- | src/.arch-inventory | 3 | ||||
| -rw-r--r-- | src/ChangeLog | 38 | ||||
| -rw-r--r-- | src/alloc.c | 148 | ||||
| -rw-r--r-- | src/eval.c | 19 | ||||
| -rw-r--r-- | src/minibuf.c | 26 | ||||
| -rw-r--r-- | src/process.c | 13 | ||||
| -rw-r--r-- | src/regex.c | 5 |
7 files changed, 125 insertions, 127 deletions
diff --git a/src/.arch-inventory b/src/.arch-inventory new file mode 100644 index 00000000000..9f6d601a788 --- /dev/null +++ b/src/.arch-inventory | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | precious ^(config\.stamp|config\.h|epaths\.h)$ | ||
| 2 | |||
| 3 | # arch-tag: 277cc7ae-b3f5-44af-abf1-84c073164543 | ||
diff --git a/src/ChangeLog b/src/ChangeLog index f15b1e582d9..df10f95e500 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,35 @@ | |||
| 1 | 2004-05-28 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * alloc.c: Undo Kim's recent changes and fix the same bug differently. | ||
| 4 | (marker_blocks_pending_free): Remove. | ||
| 5 | (Fgarbage_collect): Sweep after cleaning up undo-lists. | ||
| 6 | Mark the undo lists after claning them up. | ||
| 7 | Don't free block in marker_blocks_pending_free. | ||
| 8 | (mark_buffer): Don't mark undo_list. | ||
| 9 | (gc_sweep): Sweep hash-tables and strings first. | ||
| 10 | Do free marker blocks that are empty. | ||
| 11 | |||
| 12 | 2004-05-28 Jim Blandy <jimb@redhat.com> | ||
| 13 | |||
| 14 | * regex.c (print_partial_compiled_pattern): Add missing 'break' | ||
| 15 | after 'case wordend'. For symbeg and symend, print to stderr, | ||
| 16 | like the other cases. | ||
| 17 | |||
| 18 | 2004-05-28 Noah Friedman <friedman@splode.com> | ||
| 19 | |||
| 20 | * process.c (Fdelete_process): Do not call remove_process. | ||
| 21 | |||
| 22 | 2004-05-28 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 23 | |||
| 24 | * alloc.c (struct backtrace): Remove. | ||
| 25 | (Fgarbage_collect): Use the new mark_backtrace. | ||
| 26 | |||
| 27 | * eval.c (mark_backtrace): New function. | ||
| 28 | |||
| 29 | * minibuf.c (run_exit_minibuf_hook): New function. | ||
| 30 | (read_minibuf_unwind): Don't run exit-minibuffer-hook any more. | ||
| 31 | (read_minibuf): Use separate unwind handler to run exit-minibuf-hook. | ||
| 32 | |||
| 1 | 2004-05-27 Kim F. Storm <storm@cua.dk> | 33 | 2004-05-27 Kim F. Storm <storm@cua.dk> |
| 2 | 34 | ||
| 3 | * xdisp.c (back_to_previous_visible_line_start): Skip backwards | 35 | * xdisp.c (back_to_previous_visible_line_start): Skip backwards |
| @@ -15,8 +47,8 @@ | |||
| 15 | 47 | ||
| 16 | 2004-05-23 K,Ba(Broly L,Bu(Brentey <lorentey@elte.hu> (tiny change) | 48 | 2004-05-23 K,Ba(Broly L,Bu(Brentey <lorentey@elte.hu> (tiny change) |
| 17 | 49 | ||
| 18 | * coding.c (Fset_safe_terminal_coding_system_internal): Set | 50 | * coding.c (Fset_safe_terminal_coding_system_internal): |
| 19 | suppress_error in safe_terminal_coding, not terminal_coding. | 51 | Set suppress_error in safe_terminal_coding, not terminal_coding. |
| 20 | 52 | ||
| 21 | 2004-05-22 Richard M. Stallman <rms@gnu.org> | 53 | 2004-05-22 Richard M. Stallman <rms@gnu.org> |
| 22 | 54 | ||
| @@ -71,7 +103,7 @@ | |||
| 71 | (re_opcode_t): New opcodes `symbeg' and `symend'. | 103 | (re_opcode_t): New opcodes `symbeg' and `symend'. |
| 72 | (print_partial_compiled_pattern): Print the new opcodes properly. | 104 | (print_partial_compiled_pattern): Print the new opcodes properly. |
| 73 | (regex_compile): Parse the new operators. | 105 | (regex_compile): Parse the new operators. |
| 74 | (analyse_first): Skip symbeg and symend (they match only the empty string). | 106 | (analyse_first): Skip sym(beg|end) (they match only the empty string). |
| 75 | (mutually_exclusive_p): `symend' is mutually exclusive with \s_ and | 107 | (mutually_exclusive_p): `symend' is mutually exclusive with \s_ and |
| 76 | \sw; `symbeg' is mutually exclusive with \S_ and \Sw. | 108 | \sw; `symbeg' is mutually exclusive with \S_ and \Sw. |
| 77 | (re_match_2_internal): Match symbeg and symend. | 109 | (re_match_2_internal): Match symbeg and symend. |
diff --git a/src/alloc.c b/src/alloc.c index 1d50f19e921..adedb414aad 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -257,6 +257,7 @@ EMACS_INT gcs_done; /* accumulated GCs */ | |||
| 257 | static void mark_buffer P_ ((Lisp_Object)); | 257 | static void mark_buffer P_ ((Lisp_Object)); |
| 258 | extern void mark_kboards P_ ((void)); | 258 | extern void mark_kboards P_ ((void)); |
| 259 | extern void mark_ttys P_ ((void)); | 259 | extern void mark_ttys P_ ((void)); |
| 260 | extern void mark_backtrace P_ ((void)); | ||
| 260 | static void gc_sweep P_ ((void)); | 261 | static void gc_sweep P_ ((void)); |
| 261 | static void mark_glyph_matrix P_ ((struct glyph_matrix *)); | 262 | static void mark_glyph_matrix P_ ((struct glyph_matrix *)); |
| 262 | static void mark_face_cache P_ ((struct face_cache *)); | 263 | static void mark_face_cache P_ ((struct face_cache *)); |
| @@ -2866,10 +2867,6 @@ int marker_block_index; | |||
| 2866 | 2867 | ||
| 2867 | union Lisp_Misc *marker_free_list; | 2868 | union Lisp_Misc *marker_free_list; |
| 2868 | 2869 | ||
| 2869 | /* Marker blocks which should be freed at end of GC. */ | ||
| 2870 | |||
| 2871 | struct marker_block *marker_blocks_pending_free; | ||
| 2872 | |||
| 2873 | /* Total number of marker blocks now in use. */ | 2870 | /* Total number of marker blocks now in use. */ |
| 2874 | 2871 | ||
| 2875 | int n_marker_blocks; | 2872 | int n_marker_blocks; |
| @@ -2880,7 +2877,6 @@ init_marker () | |||
| 2880 | marker_block = NULL; | 2877 | marker_block = NULL; |
| 2881 | marker_block_index = MARKER_BLOCK_SIZE; | 2878 | marker_block_index = MARKER_BLOCK_SIZE; |
| 2882 | marker_free_list = 0; | 2879 | marker_free_list = 0; |
| 2883 | marker_blocks_pending_free = 0; | ||
| 2884 | n_marker_blocks = 0; | 2880 | n_marker_blocks = 0; |
| 2885 | } | 2881 | } |
| 2886 | 2882 | ||
| @@ -4283,20 +4279,6 @@ struct catchtag | |||
| 4283 | struct catchtag *next; | 4279 | struct catchtag *next; |
| 4284 | }; | 4280 | }; |
| 4285 | 4281 | ||
| 4286 | struct backtrace | ||
| 4287 | { | ||
| 4288 | struct backtrace *next; | ||
| 4289 | Lisp_Object *function; | ||
| 4290 | Lisp_Object *args; /* Points to vector of args. */ | ||
| 4291 | int nargs; /* Length of vector. */ | ||
| 4292 | /* If nargs is UNEVALLED, args points to slot holding list of | ||
| 4293 | unevalled args. */ | ||
| 4294 | char evalargs; | ||
| 4295 | /* Nonzero means call value of debugger when done with this operation. */ | ||
| 4296 | char debug_on_exit; | ||
| 4297 | }; | ||
| 4298 | |||
| 4299 | |||
| 4300 | 4282 | ||
| 4301 | /*********************************************************************** | 4283 | /*********************************************************************** |
| 4302 | Protection from GC | 4284 | Protection from GC |
| @@ -4331,7 +4313,6 @@ returns nil, because real GC can't be done. */) | |||
| 4331 | register struct specbinding *bind; | 4313 | register struct specbinding *bind; |
| 4332 | struct catchtag *catch; | 4314 | struct catchtag *catch; |
| 4333 | struct handler *handler; | 4315 | struct handler *handler; |
| 4334 | register struct backtrace *backlist; | ||
| 4335 | char stack_top_variable; | 4316 | char stack_top_variable; |
| 4336 | register int i; | 4317 | register int i; |
| 4337 | int message_p; | 4318 | int message_p; |
| @@ -4460,17 +4441,7 @@ returns nil, because real GC can't be done. */) | |||
| 4460 | mark_object (handler->handler); | 4441 | mark_object (handler->handler); |
| 4461 | mark_object (handler->var); | 4442 | mark_object (handler->var); |
| 4462 | } | 4443 | } |
| 4463 | for (backlist = backtrace_list; backlist; backlist = backlist->next) | 4444 | mark_backtrace (); |
| 4464 | { | ||
| 4465 | mark_object (*backlist->function); | ||
| 4466 | |||
| 4467 | if (backlist->nargs == UNEVALLED || backlist->nargs == MANY) | ||
| 4468 | i = 0; | ||
| 4469 | else | ||
| 4470 | i = backlist->nargs - 1; | ||
| 4471 | for (; i >= 0; i--) | ||
| 4472 | mark_object (backlist->args[i]); | ||
| 4473 | } | ||
| 4474 | mark_kboards (); | 4445 | mark_kboards (); |
| 4475 | mark_ttys (); | 4446 | mark_ttys (); |
| 4476 | 4447 | ||
| @@ -4485,42 +4456,36 @@ returns nil, because real GC can't be done. */) | |||
| 4485 | } | 4456 | } |
| 4486 | #endif | 4457 | #endif |
| 4487 | 4458 | ||
| 4488 | gc_sweep (); | 4459 | /* Everything is now marked, except for the things that require special |
| 4489 | 4460 | finalization, i.e. the undo_list. | |
| 4490 | /* Look thru every buffer's undo list for elements that used to | 4461 | Look thru every buffer's undo list |
| 4491 | contain update markers that were changed to Lisp_Misc_Free | 4462 | for elements that update markers that were not marked, |
| 4492 | objects and delete them. This may leave a few cons cells | 4463 | and delete them. */ |
| 4493 | unchained, but we will get those on the next sweep. */ | ||
| 4494 | { | 4464 | { |
| 4495 | register struct buffer *nextb = all_buffers; | 4465 | register struct buffer *nextb = all_buffers; |
| 4496 | 4466 | ||
| 4497 | while (nextb) | 4467 | while (nextb) |
| 4498 | { | 4468 | { |
| 4499 | /* If a buffer's undo list is Qt, that means that undo is | 4469 | /* If a buffer's undo list is Qt, that means that undo is |
| 4500 | turned off in that buffer. */ | 4470 | turned off in that buffer. Calling truncate_undo_list on |
| 4471 | Qt tends to return NULL, which effectively turns undo back on. | ||
| 4472 | So don't call truncate_undo_list if undo_list is Qt. */ | ||
| 4501 | if (! EQ (nextb->undo_list, Qt)) | 4473 | if (! EQ (nextb->undo_list, Qt)) |
| 4502 | { | 4474 | { |
| 4503 | Lisp_Object tail, prev, elt, car; | 4475 | Lisp_Object tail, prev; |
| 4504 | tail = nextb->undo_list; | 4476 | tail = nextb->undo_list; |
| 4505 | prev = Qnil; | 4477 | prev = Qnil; |
| 4506 | while (CONSP (tail)) | 4478 | while (CONSP (tail)) |
| 4507 | { | 4479 | { |
| 4508 | if ((elt = XCAR (tail), GC_CONSP (elt)) | 4480 | if (GC_CONSP (XCAR (tail)) |
| 4509 | && (car = XCAR (elt), GC_MISCP (car)) | 4481 | && GC_MARKERP (XCAR (XCAR (tail))) |
| 4510 | && XMISCTYPE (car) == Lisp_Misc_Free) | 4482 | && !XMARKER (XCAR (XCAR (tail)))->gcmarkbit) |
| 4511 | { | 4483 | { |
| 4512 | Lisp_Object cdr = XCDR (tail); | ||
| 4513 | /* Do not use free_cons here, as we don't know if | ||
| 4514 | anybody else has a pointer to these conses. */ | ||
| 4515 | XSETCAR (elt, Qnil); | ||
| 4516 | XSETCDR (elt, Qnil); | ||
| 4517 | XSETCAR (tail, Qnil); | ||
| 4518 | XSETCDR (tail, Qnil); | ||
| 4519 | if (NILP (prev)) | 4484 | if (NILP (prev)) |
| 4520 | nextb->undo_list = tail = cdr; | 4485 | nextb->undo_list = tail = XCDR (tail); |
| 4521 | else | 4486 | else |
| 4522 | { | 4487 | { |
| 4523 | tail = cdr; | 4488 | tail = XCDR (tail); |
| 4524 | XSETCDR (prev, tail); | 4489 | XSETCDR (prev, tail); |
| 4525 | } | 4490 | } |
| 4526 | } | 4491 | } |
| @@ -4531,22 +4496,15 @@ returns nil, because real GC can't be done. */) | |||
| 4531 | } | 4496 | } |
| 4532 | } | 4497 | } |
| 4533 | } | 4498 | } |
| 4499 | /* Now that we have stripped the elements that need not be in the | ||
| 4500 | undo_list any more, we can finally mark the list. */ | ||
| 4501 | mark_object (nextb->undo_list); | ||
| 4534 | 4502 | ||
| 4535 | nextb = nextb->next; | 4503 | nextb = nextb->next; |
| 4536 | } | 4504 | } |
| 4537 | } | 4505 | } |
| 4538 | 4506 | ||
| 4539 | /* Undo lists have been cleaned up, so we can free marker blocks now. */ | 4507 | gc_sweep (); |
| 4540 | |||
| 4541 | { | ||
| 4542 | struct marker_block *mblk; | ||
| 4543 | |||
| 4544 | while ((mblk = marker_blocks_pending_free) != 0) | ||
| 4545 | { | ||
| 4546 | marker_blocks_pending_free = mblk->next; | ||
| 4547 | lisp_free (mblk); | ||
| 4548 | } | ||
| 4549 | } | ||
| 4550 | 4508 | ||
| 4551 | /* Clear the mark bits that we set in certain root slots. */ | 4509 | /* Clear the mark bits that we set in certain root slots. */ |
| 4552 | 4510 | ||
| @@ -5114,41 +5072,9 @@ mark_buffer (buf) | |||
| 5114 | 5072 | ||
| 5115 | MARK_INTERVAL_TREE (BUF_INTERVALS (buffer)); | 5073 | MARK_INTERVAL_TREE (BUF_INTERVALS (buffer)); |
| 5116 | 5074 | ||
| 5117 | if (CONSP (buffer->undo_list)) | 5075 | /* For now, we just don't mark the undo_list. It's done later in |
| 5118 | { | 5076 | a special way just before the sweep phase, and after stripping |
| 5119 | Lisp_Object tail; | 5077 | some of its elements that are not needed any more. */ |
| 5120 | tail = buffer->undo_list; | ||
| 5121 | |||
| 5122 | /* We mark the undo list specially because | ||
| 5123 | its pointers to markers should be weak. */ | ||
| 5124 | |||
| 5125 | while (CONSP (tail)) | ||
| 5126 | { | ||
| 5127 | register struct Lisp_Cons *ptr = XCONS (tail); | ||
| 5128 | |||
| 5129 | if (CONS_MARKED_P (ptr)) | ||
| 5130 | break; | ||
| 5131 | CONS_MARK (ptr); | ||
| 5132 | if (GC_CONSP (ptr->car) | ||
| 5133 | && !CONS_MARKED_P (XCONS (ptr->car)) | ||
| 5134 | && GC_MARKERP (XCAR (ptr->car))) | ||
| 5135 | { | ||
| 5136 | CONS_MARK (XCONS (ptr->car)); | ||
| 5137 | mark_object (XCDR (ptr->car)); | ||
| 5138 | } | ||
| 5139 | else | ||
| 5140 | mark_object (ptr->car); | ||
| 5141 | |||
| 5142 | if (CONSP (ptr->cdr)) | ||
| 5143 | tail = ptr->cdr; | ||
| 5144 | else | ||
| 5145 | break; | ||
| 5146 | } | ||
| 5147 | |||
| 5148 | mark_object (XCDR (tail)); | ||
| 5149 | } | ||
| 5150 | else | ||
| 5151 | mark_object (buffer->undo_list); | ||
| 5152 | 5078 | ||
| 5153 | if (buffer->overlays_before) | 5079 | if (buffer->overlays_before) |
| 5154 | { | 5080 | { |
| @@ -5228,6 +5154,16 @@ survives_gc_p (obj) | |||
| 5228 | static void | 5154 | static void |
| 5229 | gc_sweep () | 5155 | gc_sweep () |
| 5230 | { | 5156 | { |
| 5157 | /* Remove or mark entries in weak hash tables. | ||
| 5158 | This must be done before any object is unmarked. */ | ||
| 5159 | sweep_weak_hash_tables (); | ||
| 5160 | |||
| 5161 | sweep_strings (); | ||
| 5162 | #ifdef GC_CHECK_STRING_BYTES | ||
| 5163 | if (!noninteractive) | ||
| 5164 | check_string_bytes (1); | ||
| 5165 | #endif | ||
| 5166 | |||
| 5231 | /* Put all unmarked conses on free list */ | 5167 | /* Put all unmarked conses on free list */ |
| 5232 | { | 5168 | { |
| 5233 | register struct cons_block *cblk; | 5169 | register struct cons_block *cblk; |
| @@ -5278,16 +5214,6 @@ gc_sweep () | |||
| 5278 | total_free_conses = num_free; | 5214 | total_free_conses = num_free; |
| 5279 | } | 5215 | } |
| 5280 | 5216 | ||
| 5281 | /* Remove or mark entries in weak hash tables. | ||
| 5282 | This must be done before any object is unmarked. */ | ||
| 5283 | sweep_weak_hash_tables (); | ||
| 5284 | |||
| 5285 | sweep_strings (); | ||
| 5286 | #ifdef GC_CHECK_STRING_BYTES | ||
| 5287 | if (!noninteractive) | ||
| 5288 | check_string_bytes (1); | ||
| 5289 | #endif | ||
| 5290 | |||
| 5291 | /* Put all unmarked floats on free list */ | 5217 | /* Put all unmarked floats on free list */ |
| 5292 | { | 5218 | { |
| 5293 | register struct float_block *fblk; | 5219 | register struct float_block *fblk; |
| @@ -5456,7 +5382,6 @@ gc_sweep () | |||
| 5456 | register int num_free = 0, num_used = 0; | 5382 | register int num_free = 0, num_used = 0; |
| 5457 | 5383 | ||
| 5458 | marker_free_list = 0; | 5384 | marker_free_list = 0; |
| 5459 | marker_blocks_pending_free = 0; | ||
| 5460 | 5385 | ||
| 5461 | for (mblk = marker_block; mblk; mblk = *mprev) | 5386 | for (mblk = marker_block; mblk; mblk = *mprev) |
| 5462 | { | 5387 | { |
| @@ -5492,13 +5417,8 @@ gc_sweep () | |||
| 5492 | *mprev = mblk->next; | 5417 | *mprev = mblk->next; |
| 5493 | /* Unhook from the free list. */ | 5418 | /* Unhook from the free list. */ |
| 5494 | marker_free_list = mblk->markers[0].u_free.chain; | 5419 | marker_free_list = mblk->markers[0].u_free.chain; |
| 5420 | lisp_free (mblk); | ||
| 5495 | n_marker_blocks--; | 5421 | n_marker_blocks--; |
| 5496 | |||
| 5497 | /* It is not safe to free the marker block at this stage, | ||
| 5498 | since there may still be pointers to these markers from | ||
| 5499 | a buffer's undo list. KFS 2004-05-25. */ | ||
| 5500 | mblk->next = marker_blocks_pending_free; | ||
| 5501 | marker_blocks_pending_free = mblk; | ||
| 5502 | } | 5422 | } |
| 5503 | else | 5423 | else |
| 5504 | { | 5424 | { |
diff --git a/src/eval.c b/src/eval.c index 0326a828a81..921a7533a60 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -3243,6 +3243,25 @@ If NFRAMES is more than the number of frames, the value is nil. */) | |||
| 3243 | 3243 | ||
| 3244 | 3244 | ||
| 3245 | void | 3245 | void |
| 3246 | mark_backtrace () | ||
| 3247 | { | ||
| 3248 | register struct backtrace *backlist; | ||
| 3249 | register int i; | ||
| 3250 | |||
| 3251 | for (backlist = backtrace_list; backlist; backlist = backlist->next) | ||
| 3252 | { | ||
| 3253 | mark_object (*backlist->function); | ||
| 3254 | |||
| 3255 | if (backlist->nargs == UNEVALLED || backlist->nargs == MANY) | ||
| 3256 | i = 0; | ||
| 3257 | else | ||
| 3258 | i = backlist->nargs - 1; | ||
| 3259 | for (; i >= 0; i--) | ||
| 3260 | mark_object (backlist->args[i]); | ||
| 3261 | } | ||
| 3262 | } | ||
| 3263 | |||
| 3264 | void | ||
| 3246 | syms_of_eval () | 3265 | syms_of_eval () |
| 3247 | { | 3266 | { |
| 3248 | DEFVAR_INT ("max-specpdl-size", &max_specpdl_size, | 3267 | DEFVAR_INT ("max-specpdl-size", &max_specpdl_size, |
diff --git a/src/minibuf.c b/src/minibuf.c index 1f5a114540d..8ed19516080 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Minibuffer input and completion. | 1 | /* Minibuffer input and completion. |
| 2 | Copyright (C) 1985,86,93,94,95,96,97,98,99,2000,01,03 | 2 | Copyright (C) 1985,86,93,94,95,96,97,98,99,2000,01,03,04 |
| 3 | Free Software Foundation, Inc. | 3 | Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| @@ -210,6 +210,7 @@ without invoking the usual minibuffer commands. */) | |||
| 210 | /* Actual minibuffer invocation. */ | 210 | /* Actual minibuffer invocation. */ |
| 211 | 211 | ||
| 212 | static Lisp_Object read_minibuf_unwind P_ ((Lisp_Object)); | 212 | static Lisp_Object read_minibuf_unwind P_ ((Lisp_Object)); |
| 213 | static Lisp_Object run_exit_minibuf_hook P_ ((Lisp_Object)); | ||
| 213 | static Lisp_Object read_minibuf P_ ((Lisp_Object, Lisp_Object, | 214 | static Lisp_Object read_minibuf P_ ((Lisp_Object, Lisp_Object, |
| 214 | Lisp_Object, Lisp_Object, | 215 | Lisp_Object, Lisp_Object, |
| 215 | int, Lisp_Object, | 216 | int, Lisp_Object, |
| @@ -564,6 +565,12 @@ read_minibuf (map, initial, prompt, backup_n, expflag, | |||
| 564 | 565 | ||
| 565 | record_unwind_protect (read_minibuf_unwind, Qnil); | 566 | record_unwind_protect (read_minibuf_unwind, Qnil); |
| 566 | minibuf_level++; | 567 | minibuf_level++; |
| 568 | /* We are exiting the minibuffer one way or the other, so run the hook. | ||
| 569 | It should be run before unwinding the minibuf settings. Do it | ||
| 570 | separately from read_minibuf_unwind because we need to make sure that | ||
| 571 | read_minibuf_unwind is fully executed even if exit-minibuffer-hook | ||
| 572 | signals an error. --Stef */ | ||
| 573 | record_unwind_protect (run_exit_minibuf_hook, Qnil); | ||
| 567 | 574 | ||
| 568 | /* Now that we can restore all those variables, start changing them. */ | 575 | /* Now that we can restore all those variables, start changing them. */ |
| 569 | 576 | ||
| @@ -827,6 +834,17 @@ get_minibuffer (depth) | |||
| 827 | return buf; | 834 | return buf; |
| 828 | } | 835 | } |
| 829 | 836 | ||
| 837 | static Lisp_Object | ||
| 838 | run_exit_minibuf_hook (data) | ||
| 839 | Lisp_Object data; | ||
| 840 | { | ||
| 841 | if (!NILP (Vminibuffer_exit_hook) && !EQ (Vminibuffer_exit_hook, Qunbound) | ||
| 842 | && !NILP (Vrun_hooks)) | ||
| 843 | safe_run_hooks (Qminibuffer_exit_hook); | ||
| 844 | |||
| 845 | return Qnil; | ||
| 846 | } | ||
| 847 | |||
| 830 | /* This function is called on exiting minibuffer, whether normally or | 848 | /* This function is called on exiting minibuffer, whether normally or |
| 831 | not, and it restores the current window, buffer, etc. */ | 849 | not, and it restores the current window, buffer, etc. */ |
| 832 | 850 | ||
| @@ -837,12 +855,6 @@ read_minibuf_unwind (data) | |||
| 837 | Lisp_Object old_deactivate_mark; | 855 | Lisp_Object old_deactivate_mark; |
| 838 | Lisp_Object window; | 856 | Lisp_Object window; |
| 839 | 857 | ||
| 840 | /* We are exiting the minibuffer one way or the other, | ||
| 841 | so run the hook. */ | ||
| 842 | if (!NILP (Vminibuffer_exit_hook) && !EQ (Vminibuffer_exit_hook, Qunbound) | ||
| 843 | && !NILP (Vrun_hooks)) | ||
| 844 | safe_run_hooks (Qminibuffer_exit_hook); | ||
| 845 | |||
| 846 | /* If this was a recursive minibuffer, | 858 | /* If this was a recursive minibuffer, |
| 847 | tie the minibuffer window back to the outer level minibuffer buffer. */ | 859 | tie the minibuffer window back to the outer level minibuffer buffer. */ |
| 848 | minibuf_level--; | 860 | minibuf_level--; |
diff --git a/src/process.c b/src/process.c index 9d76b5bd1f9..c05bcbf88d5 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -774,7 +774,18 @@ nil, indicating the current buffer's process. */) | |||
| 774 | XSETINT (XPROCESS (process)->tick, ++process_tick); | 774 | XSETINT (XPROCESS (process)->tick, ++process_tick); |
| 775 | status_notify (); | 775 | status_notify (); |
| 776 | } | 776 | } |
| 777 | remove_process (process); | 777 | /* Do not call remove_process here; either status_notify has already done |
| 778 | it, or will do so the next time emacs polls for input. Thus network | ||
| 779 | processes are not immediately removed, and their sentinel will be | ||
| 780 | called. | ||
| 781 | |||
| 782 | Since Fdelete_process is called by kill_buffer_processes, this also | ||
| 783 | means that a network process sentinel will run after the buffer is | ||
| 784 | dead, which would not be the case if status_notify() were called | ||
| 785 | unconditionally here. This way process sentinels observe consistent | ||
| 786 | behavior with regard to buffer-live-p. | ||
| 787 | */ | ||
| 788 | /* remove_process (process); */ | ||
| 778 | return Qnil; | 789 | return Qnil; |
| 779 | } | 790 | } |
| 780 | 791 | ||
diff --git a/src/regex.c b/src/regex.c index 0c1343bf584..db69275c312 100644 --- a/src/regex.c +++ b/src/regex.c | |||
| @@ -1096,13 +1096,14 @@ print_partial_compiled_pattern (start, end) | |||
| 1096 | 1096 | ||
| 1097 | case wordend: | 1097 | case wordend: |
| 1098 | fprintf (stderr, "/wordend"); | 1098 | fprintf (stderr, "/wordend"); |
| 1099 | break; | ||
| 1099 | 1100 | ||
| 1100 | case symbeg: | 1101 | case symbeg: |
| 1101 | printf ("/symbeg"); | 1102 | fprintf (stderr, "/symbeg"); |
| 1102 | break; | 1103 | break; |
| 1103 | 1104 | ||
| 1104 | case symend: | 1105 | case symend: |
| 1105 | printf ("/symend"); | 1106 | fprintf (stderr, "/symend"); |
| 1106 | break; | 1107 | break; |
| 1107 | 1108 | ||
| 1108 | case syntaxspec: | 1109 | case syntaxspec: |