Now on revision 109989. ------------------------------------------------------------ revno: 109989 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2012-09-11 20:14:50 -0400 message: * src/eval.c: Add `inhibit-debugger'. (Qinhibit_debugger): New symbol. (call_debugger): Bind it instead of Qdebug_on_error. (maybe_call_debugger): Test Vinhibit_debugger. (syms_of_eval): Define inhibit-debugger. * src/xdisp.c (set_message): Don't bind Qinhibit_debug_on_message. (syms_of_xdisp): Remove inhibit-debug-on-message. * lisp/emacs-lisp/debug.el (debug): Don't bind debug-on-error since inhibit-debugger is bound instead. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-09-11 02:28:27 +0000 +++ etc/NEWS 2012-09-12 00:14:50 +0000 @@ -675,7 +675,15 @@ ** New error type and new function `user-error'. Doesn't trigger the debugger. -** New option `debugger-bury-or-kill'. +** Debugger +*** New option `debugger-bury-or-kill'. + +*** Set `debug-on-message' to enter the debugger when a certain +message is displayed in the echo area. This can be useful when trying +to work out which code is doing something. + +*** New var `inhibit-debugger', automatically set to prevent accidental +recursive invocations. +++ ** New utility function `buffer-narrowed-p'. @@ -1977,10 +1985,6 @@ *** Set `debug-on-event' to enter the debugger on events like SIGUSR1. This can be useful when `inhibit-quit' is set. -*** Set `debug-on-message' to enter the debugger when a certain -message is displayed in the echo area. This can be useful when trying -to work out which code is doing something. - ** The new function `server-eval-at' allows evaluation of Lisp forms on named Emacs server instances. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-11 16:45:31 +0000 +++ lisp/ChangeLog 2012-09-12 00:14:50 +0000 @@ -1,3 +1,8 @@ +2012-09-12 Stefan Monnier + + * emacs-lisp/debug.el (debug): Don't bind debug-on-error since + inhibit-debugger is bound instead. + 2012-09-11 Bastien Guerry * subr.el (set-temporary-overlay-map): Add a docstring. @@ -24,8 +29,8 @@ 2012-09-10 Dan Nicolaescu - * vc/diff-mode.el (diff-mode-menu): Bind - diff-remove-trailing-whitespace. + * vc/diff-mode.el (diff-mode-menu): + Bind diff-remove-trailing-whitespace. 2012-09-10 Stefan Monnier === modified file 'lisp/emacs-lisp/debug.el' --- lisp/emacs-lisp/debug.el 2012-09-08 13:28:11 +0000 +++ lisp/emacs-lisp/debug.el 2012-09-12 00:14:50 +0000 @@ -162,8 +162,6 @@ (unless noninteractive (message "Entering debugger...")) (let (debugger-value - (debug-on-error nil) - (debug-on-quit nil) (debugger-previous-state (if (get-buffer "*Backtrace*") (with-current-buffer (get-buffer "*Backtrace*") === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-11 23:50:28 +0000 +++ src/ChangeLog 2012-09-12 00:14:50 +0000 @@ -1,3 +1,13 @@ +2012-09-12 Stefan Monnier + + * eval.c: Add `inhibit-debugger'. + (Qinhibit_debugger): New symbol. + (call_debugger): Bind it instead of Qdebug_on_error. + (maybe_call_debugger): Test Vinhibit_debugger. + (syms_of_eval): Define inhibit-debugger. + * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message. + (syms_of_xdisp): Remove inhibit-debug-on-message. + 2012-09-11 Paul Eggert Avoid _setjmp/_longjmp problems with local nonvolatile variables. === modified file 'src/composite.h' --- src/composite.h 2012-08-27 17:23:48 +0000 +++ src/composite.h 2012-09-12 00:14:50 +0000 @@ -113,7 +113,7 @@ && (end - start) == COMPOSITION_LENGTH (prop)) /* Return the Nth glyph of composition specified by CMP. CMP is a - pointer to `struct composition'. */ + pointer to `struct composition'. */ #define COMPOSITION_GLYPH(cmp, n) \ XINT (XVECTOR (XVECTOR (XHASH_TABLE (composition_hash_table) \ ->key_and_value) \ === modified file 'src/eval.c' --- src/eval.c 2012-09-04 21:21:00 +0000 +++ src/eval.c 2012-09-12 00:14:50 +0000 @@ -69,7 +69,7 @@ Lisp_Object Qinhibit_quit; Lisp_Object Qand_rest; static Lisp_Object Qand_optional; -static Lisp_Object Qdebug_on_error; +static Lisp_Object Qinhibit_debugger; static Lisp_Object Qdeclare; Lisp_Object Qinternal_interpreter_environment, Qclosure; @@ -229,7 +229,7 @@ specbind (intern ("debugger-may-continue"), debug_while_redisplaying ? Qnil : Qt); specbind (Qinhibit_redisplay, Qnil); - specbind (Qdebug_on_error, Qnil); + specbind (Qinhibit_debugger, Qt); #if 0 /* Binding this prevents execution of Lisp code during redisplay, which necessarily leads to display problems. */ @@ -1725,6 +1725,7 @@ /* Don't try to run the debugger with interrupts blocked. The editing loop would return anyway. */ ! INPUT_BLOCKED_P + && NILP (Vinhibit_debugger) /* Does user want to enter debugger for this kind of error? */ && (EQ (sig, Qquit) ? debug_on_quit @@ -3467,7 +3468,7 @@ DEFSYM (Qinhibit_quit, "inhibit-quit"); DEFSYM (Qautoload, "autoload"); - DEFSYM (Qdebug_on_error, "debug-on-error"); + DEFSYM (Qinhibit_debugger, "inhibit-debugger"); DEFSYM (Qmacro, "macro"); DEFSYM (Qdeclare, "declare"); @@ -3482,6 +3483,12 @@ DEFSYM (Qclosure, "closure"); DEFSYM (Qdebug, "debug"); + DEFVAR_LISP ("inhibit-debugger", Vinhibit_debugger, + doc: /* Non-nil means never enter the debugger. +Normally set while the debugger is already active, to avoid recursive +invocations. */); + Vinhibit_debugger = Qnil; + DEFVAR_LISP ("debug-on-error", Vdebug_on_error, doc: /* Non-nil means enter debugger if an error is signaled. Does not apply to errors handled by `condition-case' or those @@ -3491,7 +3498,7 @@ When you evaluate an expression interactively, this variable is temporarily non-nil if `eval-expression-debug-on-error' is non-nil. The command `toggle-debug-on-error' toggles this. -See also the variable `debug-on-quit'. */); +See also the variable `debug-on-quit' and `inhibit-debugger'. */); Vdebug_on_error = Qnil; DEFVAR_LISP ("debug-ignored-errors", Vdebug_ignored_errors, === modified file 'src/keyboard.c' --- src/keyboard.c 2012-09-11 22:59:50 +0000 +++ src/keyboard.c 2012-09-12 00:14:50 +0000 @@ -4133,7 +4133,7 @@ *used_mouse_menu = 1; #endif #ifdef HAVE_NS - /* certain system events are non-key events */ + /* Certain system events are non-key events. */ if (used_mouse_menu && event->kind == NS_NONKEY_EVENT) *used_mouse_menu = 1; @@ -4161,7 +4161,7 @@ so x remains nil. */ x = Qnil; - /* XXX Can f or mouse_position_hook be NULL here? */ + /* XXX Can f or mouse_position_hook be NULL here? */ if (f && FRAME_TERMINAL (f)->mouse_position_hook) (*FRAME_TERMINAL (f)->mouse_position_hook) (&f, 0, &bar_window, &part, &x, &y, &t); === modified file 'src/xdisp.c' --- src/xdisp.c 2012-09-11 04:22:03 +0000 +++ src/xdisp.c 2012-09-12 00:14:50 +0000 @@ -364,7 +364,6 @@ Lisp_Object Qcenter; static Lisp_Object Qmargin, Qpointer; static Lisp_Object Qline_height; -static Lisp_Object Qinhibit_debug_on_message; /* These setters are used only in this file, so they can be private. */ static inline void @@ -10590,8 +10589,6 @@ set_message (const char *s, Lisp_Object string, ptrdiff_t nbytes, int multibyte_p) { - ptrdiff_t count = SPECPDL_INDEX (); - message_enable_multibyte = ((s && multibyte_p) || (STRINGP (string) && STRING_MULTIBYTE (string))); @@ -10601,14 +10598,9 @@ message_buf_print = 0; help_echo_showing_p = 0; - if (NILP (Vinhibit_debug_on_message) && STRINGP (Vdebug_on_message) + if (STRINGP (Vdebug_on_message) && fast_string_match (Vdebug_on_message, string) >= 0) - { - specbind (Qinhibit_debug_on_message, Qt); - call_debugger (list2 (Qerror, string)); - } - - unbind_to (count, Qnil); + call_debugger (list2 (Qerror, string)); } @@ -12800,7 +12792,7 @@ return make_number (fringe_bitmap); } #endif - return make_number (-1); /* Use default arrow bitmap */ + return make_number (-1); /* Use default arrow bitmap. */ } return overlay_arrow_string_or_property (var); } @@ -29316,11 +29308,6 @@ DEFVAR_LISP ("debug-on-message", Vdebug_on_message, doc: /* If non-nil, debug if a message matching this regexp is displayed. */); Vdebug_on_message = Qnil; - - DEFVAR_LISP ("inhibit-debug-on-message", Vinhibit_debug_on_message, - doc: /* If non-nil, inhibit `debug-on-message' from entering the debugger. */); - Vinhibit_debug_on_message = Qnil; - DEFSYM(Qinhibit_debug_on_message, "inhibit-debug-on-message"); } ------------------------------------------------------------ revno: 109988 committer: Paul Eggert branch nick: trunk timestamp: Tue 2012-09-11 16:50:28 -0700 message: Avoid _setjmp/_longjmp problems with local nonvolatile variables. If a nonvolatile local variable is written before a _longjmp to the frame containing the variable, and is read after the _longjmp, the value read is indeterminate. Some local variables of type 'struct handler' and 'struct catchtag' are used in this way, so mark each of their slots as volatile if the slot can be set before _longjmp and read afterwards. * lisp.h (struct handler): var and chosen_clause are now volatile. (struct catchtag): val, next, and pdlcount are now volatile. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-11 22:59:50 +0000 +++ src/ChangeLog 2012-09-11 23:50:28 +0000 @@ -1,5 +1,15 @@ 2012-09-11 Paul Eggert + Avoid _setjmp/_longjmp problems with local nonvolatile variables. + If a nonvolatile local variable is written before a _longjmp to + the frame containing the variable, and is read after the _longjmp, + the value read is indeterminate. Some local variables of type + 'struct handler' and 'struct catchtag' are used in this way, so + mark each of their slots as volatile if the slot can be set before + _longjmp and read afterwards. + * lisp.h (struct handler): var and chosen_clause are now volatile. + (struct catchtag): val, next, and pdlcount are now volatile. + * bidi.c (bidi_push_it, bidi_pop_it): * fns.c (copy_hash_table): * image.c (define_image_type): === modified file 'src/lisp.h' --- src/lisp.h 2012-09-11 02:28:27 +0000 +++ src/lisp.h 2012-09-11 23:50:28 +0000 @@ -2001,7 +2001,10 @@ #define SPECPDL_INDEX() (specpdl_ptr - specpdl) -/* Everything needed to describe an active condition case. */ +/* Everything needed to describe an active condition case. + + Members are volatile if their values need to survive _longjmp when + a 'struct handler' is a local variable. */ struct handler { /* The handler clauses and variable from the condition-case form. */ @@ -2012,10 +2015,12 @@ error: handle all conditions, and errors can run the debugger or display a backtrace. */ Lisp_Object handler; - Lisp_Object var; + + Lisp_Object volatile var; + /* Fsignal stores here the condition-case clause that applies, and Fcondition_case thus knows which clause to run. */ - Lisp_Object chosen_clause; + Lisp_Object volatile chosen_clause; /* Used to effect the longjump out to the handler. */ struct catchtag *tag; @@ -2041,19 +2046,21 @@ of the catch form. All the other members are concerned with restoring the interpreter - state. */ + state. + Members are volatile if their values need to survive _longjmp when + a 'struct catchtag' is a local variable. */ struct catchtag { Lisp_Object tag; - Lisp_Object val; - struct catchtag *next; + Lisp_Object volatile val; + struct catchtag *volatile next; struct gcpro *gcpro; jmp_buf jmp; struct backtrace *backlist; struct handler *handlerlist; EMACS_INT lisp_eval_depth; - ptrdiff_t pdlcount; + ptrdiff_t volatile pdlcount; int poll_suppress_count; int interrupt_input_blocked; struct byte_stack *byte_stack; ------------------------------------------------------------ revno: 109987 committer: Paul Eggert branch nick: trunk timestamp: Tue 2012-09-11 15:59:50 -0700 message: Prefer assignment to memcpy when either will do. * lib-src/pop.c (socket_connection) [HAVE_GETADDRINFO]: * src/bidi.c (bidi_push_it, bidi_pop_it): * src/fns.c (copy_hash_table): * src/image.c (define_image_type): * src/keyboard.c (kbd_buffer_store_event_hold): * src/process.c (Fprocess_send_eof): * src/xfaces.c (x_create_gc) [HAVE_NS]: * src/xgselect.c (xg_select): Use assignment, not memcpy, as either will do here, and assignment is more likely to catch type errors. diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2012-08-31 16:53:48 +0000 +++ lib-src/ChangeLog 2012-09-11 22:59:50 +0000 @@ -1,3 +1,8 @@ +2012-09-11 Paul Eggert + + * pop.c (socket_connection) [HAVE_GETADDRINFO]: + Prefer assignment to memcpy when either will do. + 2012-08-31 Andreas Schwab * etags.c (consider_token): Always zero-terminate token buffer. === modified file 'lib-src/pop.c' --- lib-src/pop.c 2012-07-10 21:48:34 +0000 +++ lib-src/pop.c 2012-09-11 22:59:50 +0000 @@ -1083,7 +1083,7 @@ if (it->ai_addrlen == sizeof (addr)) { struct sockaddr_in *in_a = (struct sockaddr_in *) it->ai_addr; - memcpy (&addr.sin_addr, &in_a->sin_addr, sizeof (addr.sin_addr)); + addr.sin_addr = in_a->sin_addr; if (! connect (sock, (struct sockaddr *) &addr, sizeof (addr))) break; } === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-11 20:35:23 +0000 +++ src/ChangeLog 2012-09-11 22:59:50 +0000 @@ -1,5 +1,14 @@ 2012-09-11 Paul Eggert + * bidi.c (bidi_push_it, bidi_pop_it): + * fns.c (copy_hash_table): + * image.c (define_image_type): + * keyboard.c (kbd_buffer_store_event_hold): + * process.c (Fprocess_send_eof): + * xfaces.c (x_create_gc) [HAVE_NS]: + * xgselect.c (xg_select): + Prefer assignment to memcpy when either will do. + * alloc.c (discard_killed_buffers): Tune and simplify a bit. Use pointer-to-a-pointer to simplify and avoid a NILP check each time an item is removed. No need to mark this function 'inline'; === modified file 'src/bidi.c' --- src/bidi.c 2012-09-04 17:34:54 +0000 +++ src/bidi.c 2012-09-11 22:59:50 +0000 @@ -612,7 +612,7 @@ /* Save the current iterator state in its entirety after the last used cache slot. */ bidi_cache_ensure_space (bidi_cache_idx); - memcpy (&bidi_cache[bidi_cache_idx++], bidi_it, sizeof (struct bidi_it)); + bidi_cache[bidi_cache_idx++] = *bidi_it; /* Push the current cache start onto the stack. */ eassert (bidi_cache_sp < IT_STACK_SIZE); @@ -636,7 +636,7 @@ bidi_cache_idx = bidi_cache_start - 1; /* Restore the bidi iterator state saved in the cache. */ - memcpy (bidi_it, &bidi_cache[bidi_cache_idx], sizeof (struct bidi_it)); + *bidi_it = bidi_cache[bidi_cache_idx]; /* Pop the previous cache start from the stack. */ if (bidi_cache_sp <= 0) === modified file 'src/fns.c' --- src/fns.c 2012-09-10 03:25:10 +0000 +++ src/fns.c 2012-09-11 22:59:50 +0000 @@ -3680,7 +3680,7 @@ h2 = allocate_hash_table (); next = h2->header.next.vector; - memcpy (h2, h1, sizeof *h2); + *h2 = *h1; h2->header.next.vector = next; h2->key_and_value = Fcopy_sequence (h1->key_and_value); h2->hash = Fcopy_sequence (h1->hash); === modified file 'src/image.c' --- src/image.c 2012-09-09 16:06:33 +0000 +++ src/image.c 2012-09-11 22:59:50 +0000 @@ -593,7 +593,7 @@ /* Make a copy of TYPE to avoid a bus error in a dumped Emacs. The initialized data segment is read-only. */ struct image_type *p = xmalloc (sizeof *p); - memcpy (p, type, sizeof *p); + *p = *type; p->next = image_types; image_types = p; success = Qt; === modified file 'src/keyboard.c' --- src/keyboard.c 2012-09-07 01:27:44 +0000 +++ src/keyboard.c 2012-09-11 22:59:50 +0000 @@ -3602,7 +3602,7 @@ if (hold_quit) { - memcpy (hold_quit, event, sizeof (*event)); + *hold_quit = *event; return; } === modified file 'src/process.c' --- src/process.c 2012-09-11 04:22:03 +0000 +++ src/process.c 2012-09-11 22:59:50 +0000 @@ -6367,9 +6367,8 @@ if (!proc_encode_coding_system[new_outfd]) proc_encode_coding_system[new_outfd] = xmalloc (sizeof (struct coding_system)); - memcpy (proc_encode_coding_system[new_outfd], - proc_encode_coding_system[old_outfd], - sizeof (struct coding_system)); + *proc_encode_coding_system[new_outfd] + = *proc_encode_coding_system[old_outfd]; memset (proc_encode_coding_system[old_outfd], 0, sizeof (struct coding_system)); === modified file 'src/xfaces.c' --- src/xfaces.c 2012-09-04 17:34:54 +0000 +++ src/xfaces.c 2012-09-11 22:59:50 +0000 @@ -661,7 +661,7 @@ XGCValues *xgcv) { GC gc = xmalloc (sizeof *gc); - memcpy (gc, xgcv, sizeof (XGCValues)); + *gc = *xgcv; return gc; } === modified file 'src/xgselect.c' --- src/xgselect.c 2012-08-25 20:31:04 +0000 +++ src/xgselect.c 2012-09-11 22:59:50 +0000 @@ -49,9 +49,9 @@ && g_main_context_pending (context = g_main_context_default ()))) return pselect (fds_lim, rfds, wfds, efds, timeout, sigmask); - if (rfds) memcpy (&all_rfds, rfds, sizeof (all_rfds)); + if (rfds) all_rfds = *rfds; else FD_ZERO (&all_rfds); - if (wfds) memcpy (&all_wfds, wfds, sizeof (all_rfds)); + if (wfds) all_wfds = *wfds; else FD_ZERO (&all_wfds); n_gfds = g_main_context_query (context, G_PRIORITY_LOW, &tmo_in_millisec, ------------------------------------------------------------ revno: 109986 committer: Paul Eggert branch nick: trunk timestamp: Tue 2012-09-11 13:35:23 -0700 message: * alloc.c (discard_killed_buffers): Tune and simplify a bit. Use pointer-to-a-pointer to simplify and avoid a NILP check each time an item is removed. No need to mark this function 'inline'; the compiler knows better than we do. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-11 17:08:02 +0000 +++ src/ChangeLog 2012-09-11 20:35:23 +0000 @@ -1,3 +1,10 @@ +2012-09-11 Paul Eggert + + * alloc.c (discard_killed_buffers): Tune and simplify a bit. + Use pointer-to-a-pointer to simplify and avoid a NILP check each + time an item is removed. No need to mark this function 'inline'; + the compiler knows better than we do. + 2012-09-11 Jan Djärv * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize. === modified file 'src/alloc.c' --- src/alloc.c 2012-09-11 15:42:50 +0000 +++ src/alloc.c 2012-09-11 20:35:23 +0000 @@ -5868,25 +5868,21 @@ /* Remove killed buffers or items whose car is a killed buffer from LIST and return changed LIST. Called during GC. */ -static inline Lisp_Object +static Lisp_Object discard_killed_buffers (Lisp_Object list) { - Lisp_Object tail, prev, tem; + Lisp_Object *prev = &list; + Lisp_Object tail; - for (tail = list, prev = Qnil; CONSP (tail); tail = XCDR (tail)) + for (tail = list; CONSP (tail); tail = XCDR (tail)) { - tem = XCAR (tail); + Lisp_Object tem = XCAR (tail); if (CONSP (tem)) tem = XCAR (tem); if (BUFFERP (tem) && !BUFFER_LIVE_P (XBUFFER (tem))) - { - if (NILP (prev)) - list = XCDR (tail); - else - XSETCDR (prev, XCDR (tail)); - } + *prev = XCDR (tail); else - prev = tail; + prev = &XCDR_AS_LVALUE (tail); } return list; } @@ -6045,7 +6041,7 @@ { struct window *w = (struct window *) ptr; bool leaf = NILP (w->hchild) && NILP (w->vchild); - + /* For live windows, Lisp code filters out killed buffers from both buffer lists. For dead windows, we do it here in attempt to help GC to reclaim killed buffers faster. */ ------------------------------------------------------------ revno: 109985 committer: Bastien Guerry branch nick: trunk timestamp: Tue 2012-09-11 19:43:21 +0200 message: Fix revno 109981. diff: === modified file 'lisp/minibuffer.el' --- lisp/minibuffer.el 2012-09-11 14:06:33 +0000 +++ lisp/minibuffer.el 2012-09-11 17:43:21 +0000 @@ -213,8 +213,8 @@ (defun completion-table-subvert (table s1 s2) "Return a completion table from TABLE with S1 replaced by S2. The result is a completion table which completes strings of the -form (concat S2 S) in the same way as TABLE completes strings of -the form (concat S1 S)." +form (concat S1 S) in the same way as TABLE completes strings of +the form (concat S2 S)." (lambda (string pred action) (let* ((str (if (eq t (compare-strings string 0 (length s1) s1 nil nil completion-ignore-case)) ------------------------------------------------------------ revno: 109984 fixes bug: http://debbugs.gnu.org/12388 committer: Jan D. branch nick: trunk timestamp: Tue 2012-09-11 19:08:02 +0200 message: * nsterm.h: Add delay parameter to updateFrameSize. * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize. (updateFrameSize:): Add delay parameter to updateFrameSize, send it to change_frame_size. (windowDidResize:): Pass YES to updateFrameSize. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-11 15:42:50 +0000 +++ src/ChangeLog 2012-09-11 17:08:02 +0000 @@ -1,3 +1,12 @@ +2012-09-11 Jan Djärv + + * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize. + (updateFrameSize:): Add delay parameter to updateFrameSize, send it + to change_frame_size (Bug#12388). + (windowDidResize:): Pass YES to updateFrameSize. + + * nsterm.h: Add delay parameter to updateFrameSize. + 2012-09-11 Dmitry Antipov Discard killed buffers from deleted window and frame objects. === modified file 'src/nsterm.h' --- src/nsterm.h 2012-09-08 12:48:33 +0000 +++ src/nsterm.h 2012-09-11 17:08:02 +0000 @@ -103,7 +103,7 @@ - (void) setWindowClosing: (BOOL)closing; - (EmacsToolbar *) toolbar; - (void) deleteWorkingText; -- (void) updateFrameSize; +- (void) updateFrameSize: (BOOL) delay; #ifdef NS_IMPL_GNUSTEP /* Not declared, but useful. */ === modified file 'src/nsterm.m' --- src/nsterm.m 2012-09-10 21:01:45 +0000 +++ src/nsterm.m 2012-09-11 17:08:02 +0000 @@ -3727,7 +3727,7 @@ } if (removed) - [eview updateFrameSize]; + [eview updateFrameSize: NO]; } @@ -5362,7 +5362,7 @@ return NO; } -- (void) updateFrameSize +- (void) updateFrameSize: (BOOL) delay; { NSWindow *window = [self window]; NSRect wr = [window frame]; @@ -5400,7 +5400,7 @@ NSView *view = FRAME_NS_VIEW (emacsframe); FRAME_PIXEL_WIDTH (emacsframe) = neww; FRAME_PIXEL_HEIGHT (emacsframe) = newh; - change_frame_size (emacsframe, rows, cols, 0, 0, 1); + change_frame_size (emacsframe, rows, cols, 0, delay, 0); SET_FRAME_GARBAGED (emacsframe); cancel_mouse_face (emacsframe); [view setFrame: NSMakeRect (0, 0, neww, newh)]; @@ -5503,7 +5503,7 @@ x_set_window_size (emacsframe, 0, cols, rows); else { - [self updateFrameSize]; + [self updateFrameSize: YES]; } } #endif ------------------------------------------------------------ revno: 109983 committer: Bastien Guerry branch nick: trunk timestamp: Tue 2012-09-11 18:45:31 +0200 message: * subr.el (set-temporary-overlay-map): Add a docstring. (bug#12346) Bug #12346 is not closed as this commit does not document `set-temporary-overlay-map' in the manual. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-11 14:06:33 +0000 +++ lisp/ChangeLog 2012-09-11 16:45:31 +0000 @@ -1,5 +1,10 @@ 2012-09-11 Bastien Guerry + * subr.el (set-temporary-overlay-map): Add a docstring. + (bug#12346) + +2012-09-11 Bastien Guerry + * minibuffer.el (completion-table-subvert): Fix docstring. (bug#12347) === modified file 'lisp/subr.el' --- lisp/subr.el 2012-09-09 06:43:47 +0000 +++ lisp/subr.el 2012-09-11 16:45:31 +0000 @@ -3911,6 +3911,11 @@ (put symbol 'hookvar (or hookvar 'mail-send-hook))) (defun set-temporary-overlay-map (map &optional keep-pred) + "Set MAP as a temporary overlay map. +When KEEP-PRED is `t', using a key from the temporary keymap +leaves this keymap activated. KEEP-PRED can also be a function, +which will have the same effect when it returns `t'. +When KEEP-PRED is nil, the temporary keymap is used only once." (let* ((clearfunsym (make-symbol "clear-temporary-overlay-map")) (overlaysym (make-symbol "t")) (alist (list (cons overlaysym map))) ------------------------------------------------------------ revno: 109982 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2012-09-11 19:42:50 +0400 message: Discard killed buffers from deleted window and frame objects. This reduces an amount of references to killed buffers and helps GC to reclaim them faster. * alloc.c (discard_killed_buffers): New function. (mark_object): Use it for deleted windows and frames. (mark_object): If symbol's value is set up for a killed buffer or deleted frame, restore it's global binding. * data.c (swap_in_global_binding): Add GC notice. (swap_in_symval_forwarding): Use convenient set_blv_where. * window.c (wset_next_buffers, wset_prev_buffers): Move ... * window.h: ... to here. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-11 04:22:03 +0000 +++ src/ChangeLog 2012-09-11 15:42:50 +0000 @@ -1,5 +1,19 @@ 2012-09-11 Dmitry Antipov + Discard killed buffers from deleted window and frame objects. + This reduces an amount of references to killed buffers and + helps GC to reclaim them faster. + * alloc.c (discard_killed_buffers): New function. + (mark_object): Use it for deleted windows and frames. + (mark_object): If symbol's value is set up for a killed buffer + or deleted frame, restore it's global binding. + * data.c (swap_in_global_binding): Add GC notice. + (swap_in_symval_forwarding): Use convenient set_blv_where. + * window.c (wset_next_buffers, wset_prev_buffers): Move ... + * window.h: ... to here. + +2012-09-11 Dmitry Antipov + Convenient macro to check whether the buffer is live. * buffer.h (BUFFER_LIVE_P): New macro. * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c: === modified file 'src/alloc.c' --- src/alloc.c 2012-09-11 04:22:03 +0000 +++ src/alloc.c 2012-09-11 15:42:50 +0000 @@ -5865,6 +5865,32 @@ mark_buffer (buffer->base_buffer); } +/* Remove killed buffers or items whose car is a killed buffer + from LIST and return changed LIST. Called during GC. */ + +static inline Lisp_Object +discard_killed_buffers (Lisp_Object list) +{ + Lisp_Object tail, prev, tem; + + for (tail = list, prev = Qnil; CONSP (tail); tail = XCDR (tail)) + { + tem = XCAR (tail); + if (CONSP (tem)) + tem = XCAR (tem); + if (BUFFERP (tem) && !BUFFER_LIVE_P (XBUFFER (tem))) + { + if (NILP (prev)) + list = XCDR (tail); + else + XSETCDR (prev, XCDR (tail)); + } + else + prev = tail; + } + return list; +} + /* Determine type of generic Lisp_Object and mark it accordingly. */ void @@ -6001,20 +6027,41 @@ break; case PVEC_FRAME: - mark_vectorlike (ptr); - mark_face_cache (((struct frame *) ptr)->face_cache); + { + struct frame *f = (struct frame *) ptr; + + /* For live frames, killed buffers are filtered out by + store_frame_param. For dead frames, we do it here in + attempt to help GC to reclaim killed buffers faster. */ + if (!FRAME_LIVE_P (f)) + fset_buffer_list (f, discard_killed_buffers (f->buffer_list)); + + mark_vectorlike (ptr); + mark_face_cache (f->face_cache); + } break; case PVEC_WINDOW: { struct window *w = (struct window *) ptr; + bool leaf = NILP (w->hchild) && NILP (w->vchild); + + /* For live windows, Lisp code filters out killed buffers + from both buffer lists. For dead windows, we do it here + in attempt to help GC to reclaim killed buffers faster. */ + if (leaf && NILP (w->buffer)) + { + wset_prev_buffers + (w, discard_killed_buffers (w->prev_buffers)); + wset_next_buffers + (w, discard_killed_buffers (w->next_buffers)); + } mark_vectorlike (ptr); /* Mark glyphs for leaf windows. Marking window matrices is sufficient because frame matrices use the same glyph memory. */ - if (NILP (w->hchild) && NILP (w->vchild) - && w->current_matrix) + if (leaf && w->current_matrix) { mark_glyph_matrix (w->current_matrix); mark_glyph_matrix (w->desired_matrix); @@ -6081,10 +6128,14 @@ case SYMBOL_LOCALIZED: { struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (ptr); - /* If the value is forwarded to a buffer or keyboard field, - these are marked when we see the corresponding object. - And if it's forwarded to a C variable, either it's not - a Lisp_Object var, or it's staticpro'd already. */ + Lisp_Object where = blv->where; + /* If the value is set up for a killed buffer or deleted + frame, restore it's global binding. If the value is + forwarded to a C variable, either it's not a Lisp_Object + var, or it's staticpro'd already. */ + if ((BUFFERP (where) && !BUFFER_LIVE_P (XBUFFER (where))) + || (FRAMEP (where) && !FRAME_LIVE_P (XFRAME (where)))) + swap_in_global_binding (ptr); mark_object (blv->where); mark_object (blv->valcell); mark_object (blv->defcell); === modified file 'src/data.c' --- src/data.c 2012-09-11 02:28:27 +0000 +++ src/data.c 2012-09-11 15:42:50 +0000 @@ -948,8 +948,10 @@ } } -/* Set up SYMBOL to refer to its global binding. - This makes it safe to alter the status of other bindings. */ +/* Set up SYMBOL to refer to its global binding. This makes it safe + to alter the status of other bindings. BEWARE: this may be called + during the mark phase of GC, where we assume that Lisp_Object slots + of BLV are marked after this function has changed them. */ void swap_in_global_binding (struct Lisp_Symbol *symbol) @@ -1008,7 +1010,7 @@ else { tem1 = assq_no_quit (var, BVAR (current_buffer, local_var_alist)); - XSETBUFFER (blv->where, current_buffer); + set_blv_where (blv, Fcurrent_buffer ()); } } if (!(blv->found = !NILP (tem1))) === modified file 'src/window.c' --- src/window.c 2012-09-11 04:22:03 +0000 +++ src/window.c 2012-09-11 15:42:50 +0000 @@ -176,11 +176,6 @@ w->new_total = val; } static inline void -wset_next_buffers (struct window *w, Lisp_Object val) -{ - w->next_buffers = val; -} -static inline void wset_normal_cols (struct window *w, Lisp_Object val) { w->normal_cols = val; @@ -201,11 +196,6 @@ w->pointm = val; } static inline void -wset_prev_buffers (struct window *w, Lisp_Object val) -{ - w->prev_buffers = val; -} -static inline void wset_right_fringe_width (struct window *w, Lisp_Object val) { w->right_fringe_width = val; === modified file 'src/window.h' --- src/window.h 2012-09-05 17:05:32 +0000 +++ src/window.h 2012-09-11 15:42:50 +0000 @@ -414,7 +414,16 @@ { w->window_end_vpos = val; } - +WINDOW_INLINE void +wset_prev_buffers (struct window *w, Lisp_Object val) +{ + w->prev_buffers = val; +} +WINDOW_INLINE void +wset_next_buffers (struct window *w, Lisp_Object val) +{ + w->next_buffers = val; +} /* 1 if W is a minibuffer window. */ ------------------------------------------------------------ revno: 109981 committer: Bastien Guerry branch nick: trunk timestamp: Tue 2012-09-11 16:06:33 +0200 message: * minibuffer.el (completion-table-subvert): Fix docstring. (bug#12347) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-11 13:43:06 +0000 +++ lisp/ChangeLog 2012-09-11 14:06:33 +0000 @@ -1,6 +1,11 @@ 2012-09-11 Bastien Guerry - * help-fns.el (describe-variable): Fix typo. + * minibuffer.el (completion-table-subvert): Fix docstring. + (bug#12347) + +2012-09-11 Bastien Guerry + + * help-fns.el (describe-variable): Fix typo. (bug#12346) 2012-09-10 Michael R. Mauger === modified file 'lisp/minibuffer.el' --- lisp/minibuffer.el 2012-09-01 04:28:24 +0000 +++ lisp/minibuffer.el 2012-09-11 14:06:33 +0000 @@ -211,10 +211,10 @@ (complete-with-action action table string pred)))) (defun completion-table-subvert (table s1 s2) - "Completion table that replaces the prefix S1 with S2 in STRING. + "Return a completion table from TABLE with S1 replaced by S2. The result is a completion table which completes strings of the -form (concat S1 S) in the same way as TABLE completes strings of -the form (concat S2 S)." +form (concat S2 S) in the same way as TABLE completes strings of +the form (concat S1 S)." (lambda (string pred action) (let* ((str (if (eq t (compare-strings string 0 (length s1) s1 nil nil completion-ignore-case)) ------------------------------------------------------------ revno: 109980 committer: Bastien Guerry branch nick: trunk timestamp: Tue 2012-09-11 15:43:06 +0200 message: * help-fns.el (describe-variable): Fix typo. (bug#12346) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-10 19:22:53 +0000 +++ lisp/ChangeLog 2012-09-11 13:43:06 +0000 @@ -1,3 +1,7 @@ +2012-09-11 Bastien Guerry + + * help-fns.el (describe-variable): Fix typo. + 2012-09-10 Michael R. Mauger * progmodes/sql.el: Version 3.1 === modified file 'lisp/help-fns.el' --- lisp/help-fns.el 2012-08-22 07:02:15 +0000 +++ lisp/help-fns.el 2012-09-11 13:43:06 +0000 @@ -936,7 +936,7 @@ (princ " This variable is safe as a file local variable ") (princ "if its value\n satisfies the predicate ") (princ (if (byte-code-function-p safe-var) - "which is byte-compiled expression.\n" + "which is a byte-compiled expression.\n" (format "`%s'.\n" safe-var)))) (if extra-line (terpri)) ------------------------------------------------------------ revno: 109979 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-09-11 06:17:36 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/config.in' --- autogen/config.in 2012-09-10 10:18:11 +0000 +++ autogen/config.in 2012-09-11 10:17:36 +0000 @@ -246,9 +246,6 @@ /* Define to 1 if strtold conforms to C99. */ #undef HAVE_C99_STRTOLD -/* Define to 1 if you have the `cbrt' function. */ -#undef HAVE_CBRT - /* Define to 1 if you have the `cfmakeraw' function. */ #undef HAVE_CFMAKERAW @@ -638,9 +635,6 @@ /* Define to 1 if you have the `localtime_r' function. */ #undef HAVE_LOCALTIME_R -/* Define to 1 if you have the `logb' function. */ -#undef HAVE_LOGB - /* Define to 1 if you support file names longer than 14 characters. */ #undef HAVE_LONG_FILE_NAMES === modified file 'autogen/configure' --- autogen/configure 2012-09-10 10:18:11 +0000 +++ autogen/configure 2012-09-11 10:17:36 +0000 @@ -12926,8 +12926,8 @@ fi -# fmod, logb, and frexp are found in -lm on most systems. -# On HPUX 9.01, -lm does not contain logb, so check for sqrt. +# sqrt and other floating-point functions such as fmod and frexp +# are found in -lm on most systems. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5 $as_echo_n "checking for sqrt in -lm... " >&6; } if test "${ac_cv_lib_m_sqrt+set}" = set; then : @@ -13177,7 +13177,7 @@ for ac_func in gethostname \ closedir getrusage get_current_dir_name \ -lrand48 logb cbrt setsid \ +lrand48 setsid \ fpathconf select euidaccess getpagesize setlocale \ utimes getrlimit setrlimit setpgid getcwd shutdown getaddrinfo \ __fpending strsignal setitimer \ ------------------------------------------------------------ revno: 109978 author: Julien Danjou committer: Katsumi Yamaoka branch nick: trunk timestamp: Tue 2012-09-11 10:08:59 +0000 message: gnus-notifications.el: add nil checks diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2012-09-10 01:16:13 +0000 +++ lisp/gnus/ChangeLog 2012-09-11 10:08:59 +0000 @@ -1,3 +1,8 @@ +2012-09-11 Julien Danjou + + * gnus-notifications.el (gnus-notifications): Check for nil values in + ignored addresses check. + 2012-09-10 Stefan Monnier * qp.el (quoted-printable-decode-region): Inline+CSE+strength-reduction. === modified file 'lisp/gnus/gnus-notifications.el' --- lisp/gnus/gnus-notifications.el 2012-09-03 22:12:02 +0000 +++ lisp/gnus/gnus-notifications.el 2012-09-11 10:08:59 +0000 @@ -166,8 +166,10 @@ (or (mail-fetch-field "From") ""))) (address (cadr address-components))) ;; Ignore mails from ourselves - (unless (gnus-string-match-p gnus-ignored-from-addresses - address) + (unless (and gnus-ignored-from-addresses + address + (gnus-string-match-p gnus-ignored-from-addresses + address)) (let* ((photo-file (gnus-notifications-get-photo-file address)) (notification-id (gnus-notifications-notify (or (car address-components) address) ------------------------------------------------------------ revno: 109977 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-09-11 00:45:38 -0700 message: Be more explicit about some Makefile dependencies * Makefile.in (install-arch-dep, install-arch-indep, install-doc): Be more explicit about dependencies, for parallel `make install'. It is not so unreasonable to run `make -j# install' from a clean state for a self-contained NS build, where the "installation" happens within the build tree. diff: === modified file 'ChangeLog' --- ChangeLog 2012-09-11 02:28:27 +0000 +++ ChangeLog 2012-09-11 07:45:38 +0000 @@ -1,3 +1,8 @@ +2012-09-11 Glenn Morris + + * Makefile.in (install-arch-dep, install-arch-indep, install-doc): + Be more explicit about dependencies, for parallel `make install'. + 2012-09-11 Paul Eggert Simplify, document, and port floating-point (Bug#12381). === modified file 'Makefile.in' --- Makefile.in 2012-09-10 01:03:27 +0000 +++ Makefile.in 2012-09-11 07:45:38 +0000 @@ -433,7 +433,7 @@ ### Install the executables that were compiled specifically for this machine. ### We do install-arch-indep first because the executable needs the ### Lisp files and DOC file to work properly. -install-arch-dep: install-arch-indep install-doc +install-arch-dep: src install-arch-indep install-doc umask 022; ${MKDIR_P} $(DESTDIR)${bindir} cd lib-src && \ $(MAKE) install $(MFLAGS) prefix=${prefix} \ @@ -502,7 +502,7 @@ ## work correctly, and therefore no idea when tar can be replaced. ## See also these comments from 2004 about cp -r working fine: ## http://lists.gnu.org/archive/html/autoconf-patches/2004-11/msg00005.html -install-arch-indep: install-info install-man ${INSTALL_ARCH_INDEP_EXTRA} +install-arch-indep: lisp leim install-info install-man ${INSTALL_ARCH_INDEP_EXTRA} umask 022 ; \ locallisppath='${locallisppath}'; \ IFS=:; \ @@ -573,7 +573,7 @@ ## Note that install-arch-indep deletes and recreates the entire ## installed etc/ directory, so we need it to run before this does. -install-doc: install-arch-indep +install-doc: src install-arch-indep -unset CDPATH; \ umask 022; ${MKDIR_P} $(DESTDIR)${docdir} ; \ if [ `cd ./etc; /bin/pwd` != `cd $(DESTDIR)${docdir}; /bin/pwd` ]; \ ------------------------------------------------------------ revno: 109976 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2012-09-11 08:22:03 +0400 message: Convenient macro to check whether the buffer is live. * buffer.h (BUFFER_LIVE_P): New macro. * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c: * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-11 03:32:41 +0000 +++ src/ChangeLog 2012-09-11 04:22:03 +0000 @@ -1,3 +1,10 @@ +2012-09-11 Dmitry Antipov + + Convenient macro to check whether the buffer is live. + * buffer.h (BUFFER_LIVE_P): New macro. + * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c: + * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it. + 2012-09-11 YAMAMOTO Mitsuharu * xdisp.c (right_overwritten, right_overwriting): Also handle gstring === modified file 'src/alloc.c' --- src/alloc.c 2012-09-07 07:24:08 +0000 +++ src/alloc.c 2012-09-11 04:22:03 +0000 @@ -3682,7 +3682,7 @@ struct Lisp_Marker *m; /* No dead buffers here. */ - eassert (!NILP (BVAR (buf, name))); + eassert (BUFFER_LIVE_P (buf)); /* Every character is at least one byte. */ eassert (charpos <= bytepos); === modified file 'src/buffer.c' --- src/buffer.c 2012-09-09 21:11:14 +0000 +++ src/buffer.c 2012-09-11 04:22:03 +0000 @@ -388,7 +388,7 @@ Value is nil if OBJECT is not a buffer or if it has been killed. */) (Lisp_Object object) { - return ((BUFFERP (object) && ! NILP (BVAR (XBUFFER (object), name))) + return ((BUFFERP (object) && BUFFER_LIVE_P (XBUFFER (object))) ? Qt : Qnil); } @@ -776,7 +776,7 @@ base_buffer = Fget_buffer (base_buffer); if (NILP (base_buffer)) error ("No such buffer: `%s'", SDATA (tem)); - if (NILP (BVAR (XBUFFER (base_buffer), name))) + if (!BUFFER_LIVE_P (XBUFFER (base_buffer))) error ("Base buffer has been killed"); if (SCHARS (name) == 0) @@ -1553,7 +1553,7 @@ { buf = XCAR (tail); if (BUFFERP (buf) && !EQ (buf, buffer) - && !NILP (BVAR (XBUFFER (buf), name)) + && BUFFER_LIVE_P (XBUFFER (buf)) && (SREF (BVAR (XBUFFER (buf), name), 0) != ' ') /* If the frame has a buffer_predicate, disregard buffers that don't fit the predicate. */ @@ -1573,7 +1573,7 @@ { buf = Fcdr (XCAR (tail)); if (BUFFERP (buf) && !EQ (buf, buffer) - && !NILP (BVAR (XBUFFER (buf), name)) + && BUFFER_LIVE_P (XBUFFER (buf)) && (SREF (BVAR (XBUFFER (buf), name), 0) != ' ') /* If the frame has a buffer_predicate, disregard buffers that don't fit the predicate. */ @@ -1615,7 +1615,7 @@ { buf = Fcdr (XCAR (tail)); if (BUFFERP (buf) && !EQ (buf, buffer) - && !NILP (BVAR (XBUFFER (buf), name)) + && BUFFER_LIVE_P (XBUFFER (buf)) && (SREF (BVAR (XBUFFER (buf), name), 0) != ' ')) return buf; } @@ -1734,7 +1734,7 @@ b = XBUFFER (buffer); /* Avoid trouble for buffer already dead. */ - if (NILP (BVAR (b, name))) + if (!BUFFER_LIVE_P (b)) return Qnil; /* Query if the buffer is still modified. */ @@ -1770,7 +1770,7 @@ } /* If the hooks have killed the buffer, exit now. */ - if (NILP (BVAR (b, name))) + if (!BUFFER_LIVE_P (b)) return Qt; /* We have no more questions to ask. Verify that it is valid @@ -1802,7 +1802,7 @@ UNGCPRO; /* Exit if we now have killed the base buffer (Bug#11665). */ - if (NILP (BVAR (b, name))) + if (!BUFFER_LIVE_P (b)) return Qt; } @@ -1813,7 +1813,7 @@ replace_buffer_in_windows (buffer); /* Exit if replacing the buffer in windows has killed our buffer. */ - if (NILP (BVAR (b, name))) + if (!BUFFER_LIVE_P (b)) return Qt; /* Make this buffer not be current. Exit if it is the sole visible @@ -1846,7 +1846,7 @@ /* Killing buffer processes may run sentinels which may have killed our buffer. */ - if (NILP (BVAR (b, name))) + if (!BUFFER_LIVE_P (b)) return Qt; /* These may run Lisp code and into infinite loops (if someone @@ -1878,7 +1878,7 @@ } /* Deleting an auto-save file could have killed our buffer. */ - if (NILP (BVAR (b, name))) + if (!BUFFER_LIVE_P (b)) return Qt; if (b->base_buffer) @@ -2047,7 +2047,7 @@ CHECK_BUFFER (buffer); - if (NILP (BVAR (XBUFFER (buffer), name))) + if (!BUFFER_LIVE_P (XBUFFER (buffer))) error ("Attempt to set major mode for a dead buffer"); if (strcmp (SSDATA (BVAR (XBUFFER (buffer), name)), "*scratch*") == 0) @@ -2183,7 +2183,7 @@ buffer = Fget_buffer (buffer_or_name); if (NILP (buffer)) nsberror (buffer_or_name); - if (NILP (BVAR (XBUFFER (buffer), name))) + if (!BUFFER_LIVE_P (XBUFFER (buffer))) error ("Selecting deleted buffer"); set_buffer_internal (XBUFFER (buffer)); return buffer; @@ -2194,7 +2194,7 @@ Lisp_Object set_buffer_if_live (Lisp_Object buffer) { - if (! NILP (BVAR (XBUFFER (buffer), name))) + if (BUFFER_LIVE_P (XBUFFER (buffer))) set_buffer_internal (XBUFFER (buffer)); return Qnil; } @@ -2289,7 +2289,7 @@ CHECK_BUFFER (buffer); other_buffer = XBUFFER (buffer); - if (NILP (BVAR (other_buffer, name))) + if (!BUFFER_LIVE_P (other_buffer)) error ("Cannot swap a dead buffer's text"); /* Actually, it probably works just fine. @@ -2685,7 +2685,7 @@ /* Copy this buffer's new multibyte status into all of its indirect buffers. */ FOR_EACH_BUFFER (other) - if (other->base_buffer == current_buffer && !NILP (BVAR (other, name))) + if (other->base_buffer == current_buffer && BUFFER_LIVE_P (other)) { BVAR (other, enable_multibyte_characters) = BVAR (current_buffer, enable_multibyte_characters); === modified file 'src/buffer.h' --- src/buffer.h 2012-09-04 17:34:54 +0000 +++ src/buffer.h 2012-09-11 04:22:03 +0000 @@ -959,7 +959,10 @@ b->INTERNAL_FIELD (width_table) = val; } - +/* Convenient check whether buffer B is live. */ + +#define BUFFER_LIVE_P(b) (!NILP (BVAR (b, name))) + /* Chain of all buffers, including killed ones. */ extern struct buffer *all_buffers; === modified file 'src/editfns.c' --- src/editfns.c 2012-09-05 17:05:32 +0000 +++ src/editfns.c 2012-09-11 04:22:03 +0000 @@ -2613,7 +2613,7 @@ if (NILP (buf)) nsberror (buffer); bp = XBUFFER (buf); - if (NILP (BVAR (bp, name))) + if (!BUFFER_LIVE_P (bp)) error ("Selecting deleted buffer"); if (NILP (start)) @@ -2677,7 +2677,7 @@ if (NILP (buf1)) nsberror (buffer1); bp1 = XBUFFER (buf1); - if (NILP (BVAR (bp1, name))) + if (!BUFFER_LIVE_P (bp1)) error ("Selecting deleted buffer"); } @@ -2715,7 +2715,7 @@ if (NILP (buf2)) nsberror (buffer2); bp2 = XBUFFER (buf2); - if (NILP (BVAR (bp2, name))) + if (!BUFFER_LIVE_P (bp2)) error ("Selecting deleted buffer"); } === modified file 'src/insdel.c' --- src/insdel.c 2012-09-04 17:34:54 +0000 +++ src/insdel.c 2012-09-11 04:22:03 +0000 @@ -2107,7 +2107,7 @@ non-nil, and insertion calls a file handler (e.g. through lock_file) which scribbles into a temp file -- cyd */ if (!BUFFERP (combine_after_change_buffer) - || NILP (BVAR (XBUFFER (combine_after_change_buffer), name))) + || !BUFFER_LIVE_P (XBUFFER (combine_after_change_buffer))) { combine_after_change_list = Qnil; return Qnil; === modified file 'src/lread.c' --- src/lread.c 2012-09-09 16:06:33 +0000 +++ src/lread.c 2012-09-11 04:22:03 +0000 @@ -1734,7 +1734,7 @@ { ptrdiff_t count1 = SPECPDL_INDEX (); - if (b != 0 && NILP (BVAR (b, name))) + if (b != 0 && !BUFFER_LIVE_P (b)) error ("Reading from killed buffer"); if (!NILP (start)) === modified file 'src/marker.c' --- src/marker.c 2012-09-04 17:34:54 +0000 +++ src/marker.c 2012-09-11 04:22:03 +0000 @@ -407,7 +407,7 @@ does not preserve the buffer from being GC'd (it's weak), so markers have to be unlinked from their buffer as soon as the buffer is killed. */ - eassert (!NILP (BVAR (XBUFFER (buf), name))); + eassert (BUFFER_LIVE_P (XBUFFER (buf))); return buf; } return Qnil; @@ -462,13 +462,13 @@ if (NILP (buffer)) { b = current_buffer; - eassert (!NILP (BVAR (b, name))); + eassert (BUFFER_LIVE_P (b)); } else { CHECK_BUFFER (buffer); b = XBUFFER (buffer); - if (NILP (BVAR (b, name))) + if (!BUFFER_LIVE_P (b)) b = NULL; } return b; @@ -595,7 +595,7 @@ register struct Lisp_Marker *tail, **prev; /* No dead buffers here. */ - eassert (!NILP (BVAR (b, name))); + eassert (BUFFER_LIVE_P (b)); marker->buffer = NULL; prev = &BUF_MARKERS (b); === modified file 'src/minibuf.c' --- src/minibuf.c 2012-09-04 17:34:54 +0000 +++ src/minibuf.c 2012-09-11 04:22:03 +0000 @@ -798,7 +798,7 @@ Vminibuffer_list = nconc2 (Vminibuffer_list, tail); } buf = Fcar (tail); - if (NILP (buf) || NILP (BVAR (XBUFFER (buf), name))) + if (NILP (buf) || !BUFFER_LIVE_P (XBUFFER (buf))) { buf = Fget_buffer_create (make_formatted_string (name, " *Minibuf-%"pI"d*", depth)); === modified file 'src/print.c' --- src/print.c 2012-09-09 16:06:33 +0000 +++ src/print.c 2012-09-11 04:22:03 +0000 @@ -1873,7 +1873,7 @@ } else if (BUFFERP (obj)) { - if (NILP (BVAR (XBUFFER (obj), name))) + if (!BUFFER_LIVE_P (XBUFFER (obj))) strout ("#", -1, -1, printcharfun); else if (escapeflag) { === modified file 'src/process.c' --- src/process.c 2012-09-07 01:27:44 +0000 +++ src/process.c 2012-09-11 04:22:03 +0000 @@ -5298,7 +5298,7 @@ } /* If no filter, write into buffer if it isn't dead. */ - else if (!NILP (p->buffer) && !NILP (BVAR (XBUFFER (p->buffer), name))) + else if (!NILP (p->buffer) && BUFFER_LIVE_P (XBUFFER (p->buffer))) { Lisp_Object old_read_only; ptrdiff_t old_begv, old_zv; @@ -6722,7 +6722,7 @@ /* Avoid error if buffer is deleted (probably that's why the process is dead, too) */ - if (NILP (BVAR (XBUFFER (buffer), name))) + if (!BUFFER_LIVE_P (XBUFFER (buffer))) continue; Fset_buffer (buffer); === modified file 'src/window.c' --- src/window.c 2012-09-05 07:18:46 +0000 +++ src/window.c 2012-09-11 04:22:03 +0000 @@ -2668,7 +2668,7 @@ /* Check for a window that has a killed buffer. */ case CHECK_ALL_WINDOWS: if (! NILP (w->buffer) - && NILP (BVAR (XBUFFER (w->buffer), name))) + && !BUFFER_LIVE_P (XBUFFER (w->buffer))) emacs_abort (); break; @@ -3273,7 +3273,7 @@ XSETWINDOW (window, w); buffer = Fget_buffer (buffer_or_name); CHECK_BUFFER (buffer); - if (NILP (BVAR (XBUFFER (buffer), name))) + if (!BUFFER_LIVE_P (XBUFFER (buffer))) error ("Attempt to display deleted buffer"); tem = w->buffer; @@ -3338,7 +3338,7 @@ if (STRINGP (object)) object = Fget_buffer (object); - if (BUFFERP (object) && !NILP (BVAR (XBUFFER (object), name))) + if (BUFFERP (object) && BUFFER_LIVE_P (XBUFFER (object))) { /* Walk all windows looking for buffer, and force update of each of those windows. */ @@ -5549,7 +5549,7 @@ saved_windows = XVECTOR (data->saved_windows); new_current_buffer = data->current_buffer; - if (NILP (BVAR (XBUFFER (new_current_buffer), name))) + if (!BUFFER_LIVE_P (XBUFFER (new_current_buffer))) new_current_buffer = Qnil; else { @@ -5624,7 +5624,7 @@ w = XWINDOW (window); if (!NILP (w->buffer) && !EQ (w->buffer, p->buffer) - && !NILP (BVAR (XBUFFER (p->buffer), name))) + && BUFFER_LIVE_P (XBUFFER (p->buffer))) /* If a window we restore gets another buffer, record the window's old buffer. */ call1 (Qrecord_window_buffer, window); @@ -5774,7 +5774,7 @@ if (NILP (p->buffer)) /* An internal window. */ wset_buffer (w, p->buffer); - else if (!NILP (BVAR (XBUFFER (p->buffer), name))) + else if (BUFFER_LIVE_P (XBUFFER (p->buffer))) /* If saved buffer is alive, install it. */ { wset_buffer (w, p->buffer); @@ -5793,7 +5793,7 @@ Fgoto_char (w->pointm); } else if (!NILP (w->buffer) - && !NILP (BVAR (XBUFFER (w->buffer), name))) + && BUFFER_LIVE_P (XBUFFER (w->buffer))) /* Keep window's old buffer; make sure the markers are real. */ { === modified file 'src/xdisp.c' --- src/xdisp.c 2012-09-11 03:32:41 +0000 +++ src/xdisp.c 2012-09-11 04:22:03 +0000 @@ -3667,7 +3667,7 @@ } /* There isn't much we can reasonably do to protect against misbehaving fontification, but here's a fig leaf. */ - else if (!NILP (BVAR (obuf, name))) + else if (BUFFER_LIVE_P (obuf)) set_buffer_internal_1 (obuf); /* The fontification code may have added/removed text. @@ -9910,7 +9910,7 @@ for (i = 0; i < 2; ++i) if (!BUFFERP (echo_buffer[i]) - || NILP (BVAR (XBUFFER (echo_buffer[i]), name))) + || !BUFFER_LIVE_P (XBUFFER (echo_buffer[i]))) { char name[30]; Lisp_Object old_buffer;