Now on revision 108665. ------------------------------------------------------------ revno: 108665 committer: Michael Albinus branch nick: trunk timestamp: Wed 2012-06-20 08:51:53 +0200 message: * net/ange-ftp.el (ange-ftp-get-passwd): Bind `enable-recursive-minibuffers'. (ange-ftp-get-process): Throw if `non-essential' is non-nil. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-06-19 18:17:14 +0000 +++ lisp/ChangeLog 2012-06-20 06:51:53 +0000 @@ -1,3 +1,9 @@ +2012-06-20 Michael Albinus + + * net/ange-ftp.el (ange-ftp-get-passwd): Bind + `enable-recursive-minibuffers'. + (ange-ftp-get-process): Throw if `non-essential' is non-nil. + 2012-06-19 David Röthlisberger (tiny change) * ido.el (ido-find-file): Mention C-d binding in docstring (bug#11244). === modified file 'lisp/net/ange-ftp.el' --- lisp/net/ange-ftp.el 2012-06-17 18:54:39 +0000 +++ lisp/net/ange-ftp.el 2012-06-20 06:51:53 +0000 @@ -1230,7 +1230,8 @@ ;; see if same user has logged in to other hosts; if so then prompt ;; with the password that was used there. (t - (let* ((other (ange-ftp-get-host-with-passwd user)) + (let* ((enable-recursive-minibuffers t) + (other (ange-ftp-get-host-with-passwd user)) (passwd (if other ;; found another machine with the same user. @@ -2131,6 +2132,11 @@ (proc (get-process name))) (if (and proc (memq (process-status proc) '(run open))) proc + ;; If `non-essential' is non-nil, don't reopen a new connection. It + ;; will be catched in Tramp. + (when non-essential + (throw 'non-essential 'non-essential)) + ;; Must delete dead process so that new process can reuse the name. (if proc (delete-process proc)) (let ((pass (ange-ftp-quote-string ------------------------------------------------------------ revno: 108664 committer: Paul Eggert branch nick: trunk timestamp: Tue 2012-06-19 11:57:39 -0700 message: Fix misspelling of Dmitry's last name in ChangeLog. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-06-19 17:05:41 +0000 +++ src/ChangeLog 2012-06-19 18:57:39 +0000 @@ -31,7 +31,7 @@ Port byte-code-meter to modern targets. * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with - CHECK_LISP_OBJECT_TYPE reported by Dmitry Andropov in + CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in . (METER_1, METER_2): Simplify. ------------------------------------------------------------ revno: 108663 fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11244 author: David Röthlisberger committer: Stefan Monnier branch nick: trunk timestamp: Tue 2012-06-19 14:17:14 -0400 message: * lisp/ido.el (ido-find-file): Mention C-d binding in docstring. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-06-19 16:04:47 +0000 +++ lisp/ChangeLog 2012-06-19 18:17:14 +0000 @@ -1,3 +1,7 @@ +2012-06-19 David Röthlisberger (tiny change) + + * ido.el (ido-find-file): Mention C-d binding in docstring (bug#11244). + 2012-06-19 Glenn Morris * progmodes/python.el (python-mode): Derive from prog-mode. === modified file 'lisp/ido.el' --- lisp/ido.el 2012-06-08 16:39:49 +0000 +++ lisp/ido.el 2012-06-19 18:17:14 +0000 @@ -4142,6 +4142,7 @@ matches all files. If there is only one match, select that file. If there is no common suffix, show a list of all matching files in a separate window. +\\[ido-magic-delete-char] Open the specified directory in Dired mode. \\[ido-edit-input] Edit input string (including directory). \\[ido-prev-work-directory] or \\[ido-next-work-directory] go to previous/next directory in work directory history. \\[ido-merge-work-directories] search for file in the work directory history. ------------------------------------------------------------ revno: 108662 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2012-06-19 13:05:41 -0400 message: * src/minibuf.c (Fread_string): Bind minibuffer-completion-table. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-06-19 16:56:28 +0000 +++ src/ChangeLog 2012-06-19 17:05:41 +0000 @@ -1,3 +1,7 @@ +2012-06-19 Stefan Monnier + + * minibuf.c (Fread_string): Bind minibuffer-completion-table. + 2012-06-19 Dmitry Antipov * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c: === modified file 'src/minibuf.c' --- src/minibuf.c 2012-06-19 16:56:28 +0000 +++ src/minibuf.c 2012-06-19 17:05:41 +0000 @@ -1035,12 +1035,20 @@ (Lisp_Object prompt, Lisp_Object initial_input, Lisp_Object history, Lisp_Object default_value, Lisp_Object inherit_input_method) { Lisp_Object val; + ptrdiff_t count = SPECPDL_INDEX (); + + /* Just in case we're in a recursive minibuffer, make it clear that the + previous minibuffer's completion table does not apply to the new + minibuffer. + FIXME: `minibuffer-completion-table' should be buffer-local instead. */ + specbind (Qminibuffer_completion_table, Qnil); + val = Fread_from_minibuffer (prompt, initial_input, Qnil, Qnil, history, default_value, inherit_input_method); if (STRINGP (val) && SCHARS (val) == 0 && ! NILP (default_value)) val = CONSP (default_value) ? XCAR (default_value) : default_value; - return val; + return unbind_to (count, val); } DEFUN ("read-no-blanks-input", Fread_no_blanks_input, Sread_no_blanks_input, 1, 3, 0, ------------------------------------------------------------ revno: 108661 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2012-06-19 20:56:28 +0400 message: * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c: * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c: * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct access to `contents' member of Lisp_Vector objects with AREF and ASET where appropriate. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-06-19 06:49:50 +0000 +++ src/ChangeLog 2012-06-19 16:56:28 +0000 @@ -1,3 +1,11 @@ +2012-06-19 Dmitry Antipov + + * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c: + * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c: + * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct + access to `contents' member of Lisp_Vector objects with AREF and ASET + where appropriate. + 2012-06-19 Chong Yidong * frame.c (delete_frame): When selecting a frame on a different === modified file 'src/alloc.c' --- src/alloc.c 2012-06-16 12:24:15 +0000 +++ src/alloc.c 2012-06-19 16:56:28 +0000 @@ -5294,7 +5294,7 @@ size &= PSEUDOVECTOR_SIZE_MASK; vec = XVECTOR (make_pure_vector (size)); for (i = 0; i < size; i++) - vec->contents[i] = Fpurecopy (XVECTOR (obj)->contents[i]); + vec->contents[i] = Fpurecopy (AREF (obj, i)); if (COMPILEDP (obj)) { XSETPVECTYPE (vec, PVEC_COMPILED); === modified file 'src/bytecode.c' --- src/bytecode.c 2012-06-18 22:53:53 +0000 +++ src/bytecode.c 2012-06-19 16:56:28 +0000 @@ -1867,8 +1867,8 @@ { int i = 256; while (i--) - XVECTOR (Vbyte_code_meter)->contents[i] = - Fmake_vector (make_number (256), make_number (0)); + ASET (Vbyte_code_meter, i, + Fmake_vector (make_number (256), make_number (0))); } #endif } === modified file 'src/ccl.c' --- src/ccl.c 2012-02-10 18:58:48 +0000 +++ src/ccl.c 2012-06-19 16:56:28 +0000 @@ -61,7 +61,7 @@ /* Return a hash table of id number ID. */ #define GET_HASH_TABLE(id) \ - (XHASH_TABLE (XCDR (XVECTOR (Vtranslation_hash_table_vector)->contents[(id)]))) + (XHASH_TABLE (XCDR (AREF (Vtranslation_hash_table_vector, (id))))) /* CCL (Code Conversion Language) is a simple language which has operations on one input buffer, one output buffer, and 7 registers. === modified file 'src/coding.c' --- src/coding.c 2012-06-17 07:57:28 +0000 +++ src/coding.c 2012-06-19 16:56:28 +0000 @@ -3189,7 +3189,7 @@ break; check_extra_latin: if (! VECTORP (Vlatin_extra_code_table) - || NILP (XVECTOR (Vlatin_extra_code_table)->contents[c])) + || NILP (AREF (Vlatin_extra_code_table, c))) { rejected = CATEGORY_MASK_ISO; break; @@ -5464,7 +5464,7 @@ if (c < 0xA0 && check_latin_extra && (!VECTORP (Vlatin_extra_code_table) - || NILP (XVECTOR (Vlatin_extra_code_table)->contents[c]))) + || NILP (AREF (Vlatin_extra_code_table, c)))) break; found = CATEGORY_MASK_CHARSET; } @@ -10560,7 +10560,7 @@ Vcoding_category_list = Qnil; for (i = coding_category_max - 1; i >= 0; i--) Vcoding_category_list - = Fcons (XVECTOR (Vcoding_category_table)->contents[i], + = Fcons (AREF (Vcoding_category_table, i), Vcoding_category_list); } === modified file 'src/composite.c' --- src/composite.c 2012-06-16 12:24:15 +0000 +++ src/composite.c 2012-06-19 16:56:28 +0000 @@ -240,13 +240,13 @@ for (i = 0; i < nchars; i++) { FETCH_STRING_CHAR_ADVANCE (ch, string, charpos, bytepos); - XVECTOR (key)->contents[i] = make_number (ch); + ASET (key, i, make_number (ch)); } else for (i = 0; i < nchars; i++) { FETCH_CHAR_ADVANCE (ch, charpos, bytepos); - XVECTOR (key)->contents[i] = make_number (ch); + ASET (key, i, make_number (ch)); } } else === modified file 'src/data.c' --- src/data.c 2012-06-18 15:57:41 +0000 +++ src/data.c 2012-06-19 16:56:28 +0000 @@ -2134,7 +2134,7 @@ { if (idxval < 0 || idxval >= ASIZE (array)) args_out_of_range (array, idx); - XVECTOR (array)->contents[idxval] = newelt; + ASET (array, idxval, newelt); } else if (BOOL_VECTOR_P (array)) { === modified file 'src/dosfns.c' --- src/dosfns.c 2012-06-16 12:24:15 +0000 +++ src/dosfns.c 2012-06-19 16:56:28 +0000 @@ -65,27 +65,27 @@ if (no < 0 || no > 0xff || ASIZE (registers) != 8) return Qnil; for (i = 0; i < 8; i++) - CHECK_NUMBER (XVECTOR (registers)->contents[i]); + CHECK_NUMBER (AREF (registers, i)); - inregs.x.ax = (unsigned long) XFASTINT (XVECTOR (registers)->contents[0]); - inregs.x.bx = (unsigned long) XFASTINT (XVECTOR (registers)->contents[1]); - inregs.x.cx = (unsigned long) XFASTINT (XVECTOR (registers)->contents[2]); - inregs.x.dx = (unsigned long) XFASTINT (XVECTOR (registers)->contents[3]); - inregs.x.si = (unsigned long) XFASTINT (XVECTOR (registers)->contents[4]); - inregs.x.di = (unsigned long) XFASTINT (XVECTOR (registers)->contents[5]); - inregs.x.cflag = (unsigned long) XFASTINT (XVECTOR (registers)->contents[6]); - inregs.x.flags = (unsigned long) XFASTINT (XVECTOR (registers)->contents[7]); + inregs.x.ax = (unsigned long) XFASTINT (AREF (registers, 0)); + inregs.x.bx = (unsigned long) XFASTINT (AREF (registers, 1)); + inregs.x.cx = (unsigned long) XFASTINT (AREF (registers, 2)); + inregs.x.dx = (unsigned long) XFASTINT (AREF (registers, 3)); + inregs.x.si = (unsigned long) XFASTINT (AREF (registers, 4)); + inregs.x.di = (unsigned long) XFASTINT (AREF (registers, 5)); + inregs.x.cflag = (unsigned long) XFASTINT (AREF (registers, 6)); + inregs.x.flags = (unsigned long) XFASTINT (AREF (registers, 7)); int86 (no, &inregs, &outregs); - XVECTOR (registers)->contents[0] = make_number (outregs.x.ax); - XVECTOR (registers)->contents[1] = make_number (outregs.x.bx); - XVECTOR (registers)->contents[2] = make_number (outregs.x.cx); - XVECTOR (registers)->contents[3] = make_number (outregs.x.dx); - XVECTOR (registers)->contents[4] = make_number (outregs.x.si); - XVECTOR (registers)->contents[5] = make_number (outregs.x.di); - XVECTOR (registers)->contents[6] = make_number (outregs.x.cflag); - XVECTOR (registers)->contents[7] = make_number (outregs.x.flags); + ASET (registers, 0, make_number (outregs.x.ax)); + ASET (registers, 1, make_number (outregs.x.bx)); + ASET (registers, 2, make_number (outregs.x.cx)); + ASET (registers, 3, make_number (outregs.x.dx)); + ASET (registers, 4, make_number (outregs.x.si)); + ASET (registers, 5, make_number (outregs.x.di)); + ASET (registers, 6, make_number (outregs.x.cflag)); + ASET (registers, 7, make_number (outregs.x.flags)); return registers; } @@ -109,7 +109,7 @@ dosmemget (offs, len, buf); for (i = 0; i < len; i++) - XVECTOR (vector)->contents[i] = make_number (buf[i]); + ASET (vector, i, make_number (buf[i])); return vector; } @@ -132,8 +132,8 @@ for (i = 0; i < len; i++) { - CHECK_NUMBER (XVECTOR (vector)->contents[i]); - buf[i] = (unsigned char) XFASTINT (XVECTOR (vector)->contents[i]) & 0xFF; + CHECK_NUMBER (AREF (vector, i)); + buf[i] = (unsigned char) XFASTINT (AREF (vector, i)) & 0xFF; } dosmemput (buf, len, offs); === modified file 'src/font.c' --- src/font.c 2012-06-16 12:24:15 +0000 +++ src/font.c 2012-06-19 16:56:28 +0000 @@ -4877,13 +4877,13 @@ font = XFONT_OBJECT (font_object); info = Fmake_vector (make_number (7), Qnil); - XVECTOR (info)->contents[0] = AREF (font_object, FONT_NAME_INDEX); - XVECTOR (info)->contents[1] = AREF (font_object, FONT_FULLNAME_INDEX); - XVECTOR (info)->contents[2] = make_number (font->pixel_size); - XVECTOR (info)->contents[3] = make_number (font->height); - XVECTOR (info)->contents[4] = make_number (font->baseline_offset); - XVECTOR (info)->contents[5] = make_number (font->relative_compose); - XVECTOR (info)->contents[6] = make_number (font->default_ascent); + ASET (info, 0, AREF (font_object, FONT_NAME_INDEX)); + ASET (info, 1, AREF (font_object, FONT_FULLNAME_INDEX)); + ASET (info, 2, make_number (font->pixel_size)); + ASET (info, 3, make_number (font->height)); + ASET (info, 4, make_number (font->baseline_offset)); + ASET (info, 5, make_number (font->relative_compose)); + ASET (info, 6, make_number (font->default_ascent)); #if 0 /* As font_object is still in FONT_OBJLIST of the entity, we can't === modified file 'src/image.c' --- src/image.c 2012-06-12 10:08:39 +0000 +++ src/image.c 2012-06-19 16:56:28 +0000 @@ -2366,7 +2366,7 @@ for one line of the image. */ for (i = 0; i < height; ++i) { - Lisp_Object elt = XVECTOR (data)->contents[i]; + Lisp_Object elt = AREF (data, i); if (STRINGP (elt)) { @@ -2939,7 +2939,7 @@ p = bits = (char *) alloca (nbytes * img->height); for (i = 0; i < img->height; ++i, p += nbytes) { - Lisp_Object line = XVECTOR (data)->contents[i]; + Lisp_Object line = AREF (data, i); if (STRINGP (line)) memcpy (p, SDATA (line), nbytes); else @@ -3749,7 +3749,7 @@ int chars_len, Lisp_Object color) { - XVECTOR (color_table)->contents[*chars_start] = color; + ASET (color_table, *chars_start, color); } static Lisp_Object @@ -3757,7 +3757,7 @@ const unsigned char *chars_start, int chars_len) { - return XVECTOR (color_table)->contents[*chars_start]; + return AREF (color_table, *chars_start); } static Lisp_Object @@ -8503,7 +8503,7 @@ if (ASIZE (tem) != 4) return 0; for (i = 0; i < 4; ++i) - if (!INTEGERP (XVECTOR (tem)->contents[i])) + if (!INTEGERP (AREF (tem, i))) return 0; } else === modified file 'src/keyboard.c' --- src/keyboard.c 2012-06-16 12:24:15 +0000 +++ src/keyboard.c 2012-06-19 16:56:28 +0000 @@ -625,7 +625,7 @@ if (i == this_single_command_key_start) before_command_echo_length = echo_length (); - c = XVECTOR (this_command_keys)->contents[i]; + c = AREF (this_command_keys, i); if (! (EVENT_HAS_PARAMETERS (c) && EQ (EVENT_HEAD_KIND (EVENT_HEAD (c)), Qmouse_movement))) echo_char (c); @@ -4269,7 +4269,7 @@ if (!VECTORP (timer) || ASIZE (timer) != 8) continue; - XVECTOR (timer)->contents[0] = Qnil; + ASET (timer, 0, Qnil); } } @@ -6272,7 +6272,7 @@ modifier_list = Qnil; for (i = 0; (1<contents[i], + modifier_list = Fcons (AREF (modifier_symbols, i), modifier_list); return modifier_list; @@ -6503,7 +6503,7 @@ *symbol_table = Fmake_vector (size, Qnil); } - value = XVECTOR (*symbol_table)->contents[symbol_num]; + value = AREF (*symbol_table, symbol_num); } /* Have we already used this symbol before? */ @@ -6546,7 +6546,7 @@ if (CONSP (*symbol_table)) *symbol_table = Fcons (Fcons (symbol_int, value), *symbol_table); else - XVECTOR (*symbol_table)->contents[symbol_num] = value; + ASET (*symbol_table, symbol_num, value); /* Fill in the cache entries for this symbol; this also builds the Qevent_symbol_elements property, which the user @@ -7553,23 +7553,23 @@ int end = menu_bar_items_index; for (i = 0; i < end; i += 4) - if (EQ (XCAR (tail), XVECTOR (menu_bar_items_vector)->contents[i])) + if (EQ (XCAR (tail), AREF (menu_bar_items_vector, i))) { Lisp_Object tem0, tem1, tem2, tem3; /* Move the item at index I to the end, shifting all the others forward. */ - tem0 = XVECTOR (menu_bar_items_vector)->contents[i + 0]; - tem1 = XVECTOR (menu_bar_items_vector)->contents[i + 1]; - tem2 = XVECTOR (menu_bar_items_vector)->contents[i + 2]; - tem3 = XVECTOR (menu_bar_items_vector)->contents[i + 3]; + tem0 = AREF (menu_bar_items_vector, i + 0); + tem1 = AREF (menu_bar_items_vector, i + 1); + tem2 = AREF (menu_bar_items_vector, i + 2); + tem3 = AREF (menu_bar_items_vector, i + 3); if (end > i + 4) - memmove (&XVECTOR (menu_bar_items_vector)->contents[i], - &XVECTOR (menu_bar_items_vector)->contents[i + 4], + memmove (&AREF (menu_bar_items_vector, i), + &AREF (menu_bar_items_vector, i + 4), (end - i - 4) * sizeof (Lisp_Object)); - XVECTOR (menu_bar_items_vector)->contents[end - 4] = tem0; - XVECTOR (menu_bar_items_vector)->contents[end - 3] = tem1; - XVECTOR (menu_bar_items_vector)->contents[end - 2] = tem2; - XVECTOR (menu_bar_items_vector)->contents[end - 1] = tem3; + ASET (menu_bar_items_vector, end - 4, tem0); + ASET (menu_bar_items_vector, end - 3, tem1); + ASET (menu_bar_items_vector, end - 2, tem2); + ASET (menu_bar_items_vector, end - 1, tem3); break; } } @@ -7581,10 +7581,10 @@ menu_bar_items_vector = larger_vector (menu_bar_items_vector, 4, -1); /* Add this item. */ - XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil; - XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil; - XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil; - XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil; + ASET (menu_bar_items_vector, i, Qnil), i++; + ASET (menu_bar_items_vector, i, Qnil), i++; + ASET (menu_bar_items_vector, i, Qnil), i++; + ASET (menu_bar_items_vector, i, Qnil), i++; menu_bar_items_index = i; } @@ -7610,11 +7610,11 @@ discard any previously made menu bar item. */ for (i = 0; i < menu_bar_items_index; i += 4) - if (EQ (key, XVECTOR (menu_bar_items_vector)->contents[i])) + if (EQ (key, AREF (menu_bar_items_vector, i))) { if (menu_bar_items_index > i + 4) - memmove (&XVECTOR (menu_bar_items_vector)->contents[i], - &XVECTOR (menu_bar_items_vector)->contents[i + 4], + memmove (&AREF (menu_bar_items_vector, i), + &AREF (menu_bar_items_vector, i + 4), (menu_bar_items_index - i - 4) * sizeof (Lisp_Object)); menu_bar_items_index -= 4; } @@ -7638,11 +7638,11 @@ if (!i) return; - item = XVECTOR (item_properties)->contents[ITEM_PROPERTY_DEF]; + item = AREF (item_properties, ITEM_PROPERTY_DEF); /* Find any existing item for this KEY. */ for (i = 0; i < menu_bar_items_index; i += 4) - if (EQ (key, XVECTOR (menu_bar_items_vector)->contents[i])) + if (EQ (key, AREF (menu_bar_items_vector, i))) break; /* If we did not find this KEY, add it at the end. */ @@ -7652,22 +7652,22 @@ if (i + 4 > ASIZE (menu_bar_items_vector)) menu_bar_items_vector = larger_vector (menu_bar_items_vector, 4, -1); /* Add this item. */ - XVECTOR (menu_bar_items_vector)->contents[i++] = key; - XVECTOR (menu_bar_items_vector)->contents[i++] - = XVECTOR (item_properties)->contents[ITEM_PROPERTY_NAME]; - XVECTOR (menu_bar_items_vector)->contents[i++] = Fcons (item, Qnil); - XVECTOR (menu_bar_items_vector)->contents[i++] = make_number (0); + ASET (menu_bar_items_vector, i, key), i++; + ASET (menu_bar_items_vector, i, + AREF (item_properties, ITEM_PROPERTY_NAME)), i++; + ASET (menu_bar_items_vector, i, Fcons (item, Qnil)), i++; + ASET (menu_bar_items_vector, i, make_number (0)), i++; menu_bar_items_index = i; } /* We did find an item for this KEY. Add ITEM to its list of maps. */ else { Lisp_Object old; - old = XVECTOR (menu_bar_items_vector)->contents[i + 2]; + old = AREF (menu_bar_items_vector, i + 2); /* If the new and the old items are not both keymaps, the lookup will only find `item'. */ item = Fcons (item, KEYMAPP (item) && KEYMAPP (XCAR (old)) ? old : Qnil); - XVECTOR (menu_bar_items_vector)->contents[i + 2] = item; + ASET (menu_bar_items_vector, i + 2, item); } } @@ -8184,7 +8184,7 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item) { /* Access slot with index IDX of vector tool_bar_item_properties. */ -#define PROP(IDX) XVECTOR (tool_bar_item_properties)->contents[IDX] +#define PROP(IDX) AREF (tool_bar_item_properties, (IDX)) Lisp_Object filter = Qnil; Lisp_Object caption; @@ -8629,7 +8629,7 @@ /* Look at the next element of the map. */ if (idx >= 0) - elt = XVECTOR (vector)->contents[idx]; + elt = AREF (vector, idx); else elt = Fcar_safe (rest); @@ -8664,7 +8664,7 @@ Lisp_Object upcased_event, downcased_event; Lisp_Object desc = Qnil; Lisp_Object s - = XVECTOR (item_properties)->contents[ITEM_PROPERTY_NAME]; + = AREF (item_properties, ITEM_PROPERTY_NAME); upcased_event = Fupcase (event); downcased_event = Fdowncase (event); @@ -8682,12 +8682,12 @@ s = concat2 (s, tem); #endif tem - = XVECTOR (item_properties)->contents[ITEM_PROPERTY_TYPE]; + = AREF (item_properties, ITEM_PROPERTY_TYPE); if (EQ (tem, QCradio) || EQ (tem, QCtoggle)) { /* Insert button prefix. */ Lisp_Object selected - = XVECTOR (item_properties)->contents[ITEM_PROPERTY_SELECTED]; + = AREF (item_properties, ITEM_PROPERTY_SELECTED); if (EQ (tem, QCradio)) tem = build_string (NILP (selected) ? "(*) " : "( ) "); else @@ -9457,7 +9457,7 @@ && current_buffer != starting_buffer) { GROW_RAW_KEYBUF; - XVECTOR (raw_keybuf)->contents[raw_keybuf_count++] = key; + ASET (raw_keybuf, raw_keybuf_count, key), raw_keybuf_count++; keybuf[t++] = key; mock_input = t; Vquit_flag = Qnil; @@ -9535,7 +9535,7 @@ && BUFFERP (XWINDOW (window)->buffer) && XBUFFER (XWINDOW (window)->buffer) != current_buffer) { - XVECTOR (raw_keybuf)->contents[raw_keybuf_count++] = key; + ASET (raw_keybuf, raw_keybuf_count, key), raw_keybuf_count++; keybuf[t] = key; mock_input = t + 1; @@ -10566,7 +10566,7 @@ if (NILP (keep_record)) { for (i = 0; i < ASIZE (recent_keys); ++i) - XVECTOR (recent_keys)->contents[i] = Qnil; + ASET (recent_keys, i, Qnil); total_keys = 0; recent_keys_index = 0; } @@ -11585,7 +11585,7 @@ modifier_symbols = Fmake_vector (make_number (len), Qnil); for (i = 0; i < len; i++) if (modifier_names[i]) - XVECTOR (modifier_symbols)->contents[i] = intern_c_string (modifier_names[i]); + ASET (modifier_symbols, i, intern_c_string (modifier_names[i])); staticpro (&modifier_symbols); } === modified file 'src/lread.c' --- src/lread.c 2012-06-16 12:24:15 +0000 +++ src/lread.c 2012-06-19 16:56:28 +0000 @@ -3748,7 +3748,7 @@ SET_SYMBOL_VAL (XSYMBOL (sym), sym); } - ptr = &XVECTOR (obarray)->contents[XINT (tem)]; + ptr = &AREF (obarray, XINT(tem)); if (SYMBOLP (*ptr)) XSYMBOL (sym)->next = XSYMBOL (*ptr); else @@ -3827,18 +3827,18 @@ hash = oblookup_last_bucket_number; - if (EQ (XVECTOR (obarray)->contents[hash], tem)) + if (EQ (AREF (obarray, hash), tem)) { if (XSYMBOL (tem)->next) - XSETSYMBOL (XVECTOR (obarray)->contents[hash], XSYMBOL (tem)->next); + XSETSYMBOL (AREF (obarray, hash), XSYMBOL (tem)->next); else - XSETINT (XVECTOR (obarray)->contents[hash], 0); + XSETINT (AREF (obarray, hash), 0); } else { Lisp_Object tail, following; - for (tail = XVECTOR (obarray)->contents[hash]; + for (tail = AREF (obarray, hash); XSYMBOL (tail)->next; tail = following) { @@ -3877,7 +3877,7 @@ /* This is sometimes needed in the middle of GC. */ obsize &= ~ARRAY_MARK_FLAG; hash = hash_string (ptr, size_byte) % obsize; - bucket = XVECTOR (obarray)->contents[hash]; + bucket = AREF (obarray, hash); oblookup_last_bucket_number = hash; if (EQ (bucket, make_number (0))) ; @@ -3905,7 +3905,7 @@ CHECK_VECTOR (obarray); for (i = ASIZE (obarray) - 1; i >= 0; i--) { - tail = XVECTOR (obarray)->contents[i]; + tail = AREF (obarray, i); if (SYMBOLP (tail)) while (1) { === modified file 'src/menu.c' --- src/menu.c 2012-02-10 18:58:48 +0000 +++ src/menu.c 2012-06-19 16:56:28 +0000 @@ -197,7 +197,7 @@ push_submenu_start (void) { ensure_menu_items (1); - XVECTOR (menu_items)->contents[menu_items_used++] = Qnil; + ASET (menu_items, menu_items_used, Qnil), menu_items_used++; menu_items_submenu_depth++; } @@ -207,7 +207,7 @@ push_submenu_end (void) { ensure_menu_items (1); - XVECTOR (menu_items)->contents[menu_items_used++] = Qlambda; + ASET (menu_items, menu_items_used, Qlambda), menu_items_used++; menu_items_submenu_depth--; } @@ -219,7 +219,7 @@ push_left_right_boundary (void) { ensure_menu_items (1); - XVECTOR (menu_items)->contents[menu_items_used++] = Qquote; + ASET (menu_items, menu_items_used, Qquote), menu_items_used++; } /* Start a new menu pane in menu_items. @@ -231,9 +231,9 @@ ensure_menu_items (MENU_ITEMS_PANE_LENGTH); if (menu_items_submenu_depth == 0) menu_items_n_panes++; - XVECTOR (menu_items)->contents[menu_items_used++] = Qt; - XVECTOR (menu_items)->contents[menu_items_used++] = name; - XVECTOR (menu_items)->contents[menu_items_used++] = prefix_vec; + ASET (menu_items, menu_items_used, Qt), menu_items_used++; + ASET (menu_items, menu_items_used, name), menu_items_used++; + ASET (menu_items, menu_items_used, prefix_vec), menu_items_used++; } /* Push one menu item into the current pane. NAME is the string to @@ -343,10 +343,10 @@ if (!res) return; /* Not a menu item. */ - map = XVECTOR (item_properties)->contents[ITEM_PROPERTY_MAP]; + map = AREF (item_properties, ITEM_PROPERTY_MAP); - enabled = XVECTOR (item_properties)->contents[ITEM_PROPERTY_ENABLE]; - item_string = XVECTOR (item_properties)->contents[ITEM_PROPERTY_NAME]; + enabled = AREF (item_properties, ITEM_PROPERTY_ENABLE); + item_string = AREF (item_properties, ITEM_PROPERTY_NAME); if (!NILP (map) && SREF (item_string, 0) == '@') { @@ -363,11 +363,11 @@ front of them. */ { Lisp_Object prefix = Qnil; - Lisp_Object type = XVECTOR (item_properties)->contents[ITEM_PROPERTY_TYPE]; + Lisp_Object type = AREF (item_properties, ITEM_PROPERTY_TYPE); if (!NILP (type)) { Lisp_Object selected - = XVECTOR (item_properties)->contents[ITEM_PROPERTY_SELECTED]; + = AREF (item_properties, ITEM_PROPERTY_SELECTED); if (skp->notbuttons) /* The first button. Line up previous items in this menu. */ @@ -378,7 +378,7 @@ while (idx < menu_items_used) { tem - = XVECTOR (menu_items)->contents[idx + MENU_ITEMS_ITEM_NAME]; + = AREF (menu_items, idx + MENU_ITEMS_ITEM_NAME); if (NILP (tem)) { idx++; @@ -397,8 +397,8 @@ { if (!submenu && SREF (tem, 0) != '\0' && SREF (tem, 0) != '-') - XVECTOR (menu_items)->contents[idx + MENU_ITEMS_ITEM_NAME] - = concat2 (build_string (" "), tem); + ASET (menu_items, idx + MENU_ITEMS_ITEM_NAME, + concat2 (build_string (" "), tem)); idx += MENU_ITEMS_ITEM_LENGTH; } } @@ -430,11 +430,11 @@ #endif /* HAVE_X_WINDOWS || MSDOS */ push_menu_item (item_string, enabled, key, - XVECTOR (item_properties)->contents[ITEM_PROPERTY_DEF], - XVECTOR (item_properties)->contents[ITEM_PROPERTY_KEYEQ], - XVECTOR (item_properties)->contents[ITEM_PROPERTY_TYPE], - XVECTOR (item_properties)->contents[ITEM_PROPERTY_SELECTED], - XVECTOR (item_properties)->contents[ITEM_PROPERTY_HELP]); + AREF (item_properties, ITEM_PROPERTY_DEF), + AREF (item_properties, ITEM_PROPERTY_KEYEQ), + AREF (item_properties, ITEM_PROPERTY_TYPE), + AREF (item_properties, ITEM_PROPERTY_SELECTED), + AREF (item_properties, ITEM_PROPERTY_HELP)); #if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NS) || defined (HAVE_NTGUI) /* Display a submenu using the toolkit. */ @@ -645,27 +645,27 @@ i = start; while (i < end) { - if (EQ (XVECTOR (menu_items)->contents[i], Qnil)) + if (EQ (AREF (menu_items, i), Qnil)) { submenu_stack[submenu_depth++] = save_wv; save_wv = prev_wv; prev_wv = 0; i++; } - else if (EQ (XVECTOR (menu_items)->contents[i], Qlambda)) + else if (EQ (AREF (menu_items, i), Qlambda)) { prev_wv = save_wv; save_wv = submenu_stack[--submenu_depth]; i++; } - else if (EQ (XVECTOR (menu_items)->contents[i], Qt) + else if (EQ (AREF (menu_items, i), Qt) && submenu_depth != 0) i += MENU_ITEMS_PANE_LENGTH; /* Ignore a nil in the item list. It's meaningful only for dialog boxes. */ - else if (EQ (XVECTOR (menu_items)->contents[i], Qquote)) + else if (EQ (AREF (menu_items, i), Qquote)) i += 1; - else if (EQ (XVECTOR (menu_items)->contents[i], Qt)) + else if (EQ (AREF (menu_items, i), Qt)) { /* Create a new pane. */ Lisp_Object pane_name; @@ -673,7 +673,7 @@ panes_seen++; - pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME]; + pane_name = AREF (menu_items, i + MENU_ITEMS_PANE_NAME); #ifdef HAVE_NTGUI if (STRINGP (pane_name)) @@ -893,25 +893,25 @@ while (i < menu_bar_items_used) { - if (EQ (XVECTOR (vector)->contents[i], Qnil)) + if (EQ (AREF (vector, i), Qnil)) { subprefix_stack[submenu_depth++] = prefix; prefix = entry; i++; } - else if (EQ (XVECTOR (vector)->contents[i], Qlambda)) + else if (EQ (AREF (vector, i), Qlambda)) { prefix = subprefix_stack[--submenu_depth]; i++; } - else if (EQ (XVECTOR (vector)->contents[i], Qt)) + else if (EQ (AREF (vector, i), Qt)) { - prefix = XVECTOR (vector)->contents[i + MENU_ITEMS_PANE_PREFIX]; + prefix = AREF (vector, i + MENU_ITEMS_PANE_PREFIX); i += MENU_ITEMS_PANE_LENGTH; } else { - entry = XVECTOR (vector)->contents[i + MENU_ITEMS_ITEM_VALUE]; + entry = AREF (vector, i + MENU_ITEMS_ITEM_VALUE); /* Treat the pointer as an integer. There's no problem as long as pointers have enough bits to hold small integers. */ if ((intptr_t) client_data == i) @@ -976,32 +976,32 @@ while (i < menu_items_used) { - if (EQ (XVECTOR (menu_items)->contents[i], Qnil)) + if (EQ (AREF (menu_items, i), Qnil)) { subprefix_stack[submenu_depth++] = prefix; prefix = entry; i++; } - else if (EQ (XVECTOR (menu_items)->contents[i], Qlambda)) + else if (EQ (AREF (menu_items, i), Qlambda)) { prefix = subprefix_stack[--submenu_depth]; i++; } - else if (EQ (XVECTOR (menu_items)->contents[i], Qt)) + else if (EQ (AREF (menu_items, i), Qt)) { prefix - = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX]; + = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX); i += MENU_ITEMS_PANE_LENGTH; } /* Ignore a nil in the item list. It's meaningful only for dialog boxes. */ - else if (EQ (XVECTOR (menu_items)->contents[i], Qquote)) + else if (EQ (AREF (menu_items, i), Qquote)) i += 1; else { entry - = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_VALUE]; - if (&XVECTOR (menu_items)->contents[i] == client_data) + = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE); + if (&AREF (menu_items, i) == client_data) { if (keymaps != 0) { === modified file 'src/minibuf.c' --- src/minibuf.c 2012-06-16 12:24:15 +0000 +++ src/minibuf.c 2012-06-19 16:56:28 +0000 @@ -1266,7 +1266,7 @@ { collection = check_obarray (collection); obsize = ASIZE (collection); - bucket = XVECTOR (collection)->contents[idx]; + bucket = AREF (collection, idx); } while (1) @@ -1301,7 +1301,7 @@ break; else { - bucket = XVECTOR (collection)->contents[idx]; + bucket = AREF (collection, idx); continue; } } @@ -1529,7 +1529,7 @@ { collection = check_obarray (collection); obsize = ASIZE (collection); - bucket = XVECTOR (collection)->contents[idx]; + bucket = AREF (collection, idx); } while (1) @@ -1564,7 +1564,7 @@ break; else { - bucket = XVECTOR (collection)->contents[idx]; + bucket = AREF (collection, idx); continue; } } @@ -1772,7 +1772,7 @@ { for (i = ASIZE (collection) - 1; i >= 0; i--) { - tail = XVECTOR (collection)->contents[i]; + tail = AREF (collection, i); if (SYMBOLP (tail)) while (1) { === modified file 'src/msdos.c' --- src/msdos.c 2012-05-27 01:06:44 +0000 +++ src/msdos.c 2012-06-19 16:56:28 +0000 @@ -2466,12 +2466,10 @@ sc = regs.h.ah; total_doskeys += 2; - XVECTOR (recent_doskeys)->contents[recent_doskeys_index++] - = make_number (c); + ASET (recent_doskeys, recent_doskeys_index, make_number (c)), recent_doskeys_index++; if (recent_doskeys_index == NUM_RECENT_DOSKEYS) recent_doskeys_index = 0; - XVECTOR (recent_doskeys)->contents[recent_doskeys_index++] - = make_number (sc); + ASET (recent_doskeys, recent_doskeys_index, make_number (sc)), recent_doskeys_index++; if (recent_doskeys_index == NUM_RECENT_DOSKEYS) recent_doskeys_index = 0; === modified file 'src/print.c' --- src/print.c 2012-06-16 12:24:15 +0000 +++ src/print.c 2012-06-19 16:56:28 +0000 @@ -1208,7 +1208,7 @@ if (size & PSEUDOVECTOR_FLAG) size &= PSEUDOVECTOR_SIZE_MASK; for (i = 0; i < size; i++) - print_preprocess (XVECTOR (obj)->contents[i]); + print_preprocess (AREF (obj, i)); if (HASH_TABLE_P (obj)) { /* For hash tables, the key_and_value slot is past `size' because it needs to be marked specially in case @@ -1960,7 +1960,7 @@ for (i = 0; i < size; i++) { if (i) PRINTCHAR (' '); - tem = XVECTOR (obj)->contents[i]; + tem = AREF (obj, i); print_object (tem, printcharfun, escapeflag); } if (size < real_size) === modified file 'src/syntax.c' --- src/syntax.c 2012-06-16 12:24:15 +0000 +++ src/syntax.c 2012-06-19 16:56:28 +0000 @@ -988,7 +988,7 @@ } if (val < ASIZE (Vsyntax_code_object) && NILP (match)) - return XVECTOR (Vsyntax_code_object)->contents[val]; + return AREF (Vsyntax_code_object, val); else /* Since we can't use a shared object, let's make a new one. */ return Fcons (make_number (val), match); @@ -3386,32 +3386,31 @@ /* Create objects which can be shared among syntax tables. */ Vsyntax_code_object = Fmake_vector (make_number (Smax), Qnil); for (i = 0; i < ASIZE (Vsyntax_code_object); i++) - XVECTOR (Vsyntax_code_object)->contents[i] - = Fcons (make_number (i), Qnil); + ASET (Vsyntax_code_object, i, Fcons (make_number (i), Qnil)); /* Now we are ready to set up this property, so we can create syntax tables. */ Fput (Qsyntax_table, Qchar_table_extra_slots, make_number (0)); - temp = XVECTOR (Vsyntax_code_object)->contents[(int) Swhitespace]; + temp = AREF (Vsyntax_code_object, (int) Swhitespace); Vstandard_syntax_table = Fmake_char_table (Qsyntax_table, temp); /* Control characters should not be whitespace. */ - temp = XVECTOR (Vsyntax_code_object)->contents[(int) Spunct]; + temp = AREF (Vsyntax_code_object, (int) Spunct); for (i = 0; i <= ' ' - 1; i++) SET_RAW_SYNTAX_ENTRY (Vstandard_syntax_table, i, temp); SET_RAW_SYNTAX_ENTRY (Vstandard_syntax_table, 0177, temp); /* Except that a few really are whitespace. */ - temp = XVECTOR (Vsyntax_code_object)->contents[(int) Swhitespace]; + temp = AREF (Vsyntax_code_object, (int) Swhitespace); SET_RAW_SYNTAX_ENTRY (Vstandard_syntax_table, ' ', temp); SET_RAW_SYNTAX_ENTRY (Vstandard_syntax_table, '\t', temp); SET_RAW_SYNTAX_ENTRY (Vstandard_syntax_table, '\n', temp); SET_RAW_SYNTAX_ENTRY (Vstandard_syntax_table, 015, temp); SET_RAW_SYNTAX_ENTRY (Vstandard_syntax_table, 014, temp); - temp = XVECTOR (Vsyntax_code_object)->contents[(int) Sword]; + temp = AREF (Vsyntax_code_object, (int) Sword); for (i = 'a'; i <= 'z'; i++) SET_RAW_SYNTAX_ENTRY (Vstandard_syntax_table, i, temp); for (i = 'A'; i <= 'Z'; i++) @@ -3439,14 +3438,14 @@ SET_RAW_SYNTAX_ENTRY (Vstandard_syntax_table, '\\', Fcons (make_number ((int) Sescape), Qnil)); - temp = XVECTOR (Vsyntax_code_object)->contents[(int) Ssymbol]; + temp = AREF (Vsyntax_code_object, (int) Ssymbol); for (i = 0; i < 10; i++) { c = "_-+*/&|<>="[i]; SET_RAW_SYNTAX_ENTRY (Vstandard_syntax_table, c, temp); } - temp = XVECTOR (Vsyntax_code_object)->contents[(int) Spunct]; + temp = AREF (Vsyntax_code_object, (int) Spunct); for (i = 0; i < 12; i++) { c = ".,;:?!#@~^'`"[i]; @@ -3454,7 +3453,7 @@ } /* All multibyte characters have syntax `word' by default. */ - temp = XVECTOR (Vsyntax_code_object)->contents[(int) Sword]; + temp = AREF (Vsyntax_code_object, (int) Sword); char_table_set_range (Vstandard_syntax_table, 0x80, MAX_CHAR, temp); } === modified file 'src/window.c' --- src/window.c 2012-06-16 12:24:15 +0000 +++ src/window.c 2012-06-19 16:56:28 +0000 @@ -6036,8 +6036,8 @@ tem = Fmake_vector (make_number (n_windows), Qnil); data->saved_windows = tem; for (i = 0; i < n_windows; i++) - XVECTOR (tem)->contents[i] - = Fmake_vector (make_number (VECSIZE (struct saved_window)), Qnil); + ASET (tem, i, + Fmake_vector (make_number (VECSIZE (struct saved_window)), Qnil)); save_window_save (FRAME_ROOT_WINDOW (f), XVECTOR (tem), 0); XSETWINDOW_CONFIGURATION (tem, data); return (tem); === modified file 'src/xmenu.c' --- src/xmenu.c 2012-06-16 12:24:15 +0000 +++ src/xmenu.c 2012-06-19 16:56:28 +0000 @@ -1040,9 +1040,9 @@ { Lisp_Object key, string, maps; - key = XVECTOR (items)->contents[4 * i]; - string = XVECTOR (items)->contents[4 * i + 1]; - maps = XVECTOR (items)->contents[4 * i + 2]; + key = AREF (items, 4 * i); + string = AREF (items, 4 * i + 1); + maps = AREF (items, 4 * i + 2); if (NILP (string)) break; @@ -1093,7 +1093,7 @@ /* Compare the new menu items with the ones computed last time. */ for (i = 0; i < previous_menu_items_used; i++) if (menu_items_used == i - || (!EQ (previous_items[i], XVECTOR (menu_items)->contents[i]))) + || (!EQ (previous_items[i], AREF (menu_items, i)))) break; if (i == menu_items_used && i == previous_menu_items_used && i != 0) { @@ -1118,7 +1118,7 @@ for (i = 0; i < ASIZE (items); i += 4) { Lisp_Object string; - string = XVECTOR (items)->contents[i + 1]; + string = AREF (items, i + 1); if (NILP (string)) break; wv->name = SSDATA (string); @@ -1145,7 +1145,7 @@ { Lisp_Object string; - string = XVECTOR (items)->contents[i + 1]; + string = AREF (items, i + 1); if (NILP (string)) break; @@ -1677,7 +1677,7 @@ i = 0; while (i < menu_items_used) { - if (EQ (XVECTOR (menu_items)->contents[i], Qnil)) + if (EQ (AREF (menu_items, i), Qnil)) { submenu_stack[submenu_depth++] = save_wv; save_wv = prev_wv; @@ -1685,21 +1685,21 @@ first_pane = 1; i++; } - else if (EQ (XVECTOR (menu_items)->contents[i], Qlambda)) + else if (EQ (AREF (menu_items, i), Qlambda)) { prev_wv = save_wv; save_wv = submenu_stack[--submenu_depth]; first_pane = 0; i++; } - else if (EQ (XVECTOR (menu_items)->contents[i], Qt) + else if (EQ (AREF (menu_items, i), Qt) && submenu_depth != 0) i += MENU_ITEMS_PANE_LENGTH; /* Ignore a nil in the item list. It's meaningful only for dialog boxes. */ - else if (EQ (XVECTOR (menu_items)->contents[i], Qquote)) + else if (EQ (AREF (menu_items, i), Qquote)) i += 1; - else if (EQ (XVECTOR (menu_items)->contents[i], Qt)) + else if (EQ (AREF (menu_items, i), Qt)) { /* Create a new pane. */ Lisp_Object pane_name, prefix; @@ -1789,7 +1789,7 @@ make the call_data null so that it won't display a box when the mouse is on it. */ wv->call_data - = (!NILP (def) ? (void *) &XVECTOR (menu_items)->contents[i] : 0); + = (!NILP (def) ? (void *) &AREF (menu_items, i) : 0); wv->enabled = !NILP (enable); if (NILP (type)) @@ -1865,32 +1865,32 @@ i = 0; while (i < menu_items_used) { - if (EQ (XVECTOR (menu_items)->contents[i], Qnil)) + if (EQ (AREF (menu_items, i), Qnil)) { subprefix_stack[submenu_depth++] = prefix; prefix = entry; i++; } - else if (EQ (XVECTOR (menu_items)->contents[i], Qlambda)) + else if (EQ (AREF (menu_items, i), Qlambda)) { prefix = subprefix_stack[--submenu_depth]; i++; } - else if (EQ (XVECTOR (menu_items)->contents[i], Qt)) + else if (EQ (AREF (menu_items, i), Qt)) { prefix - = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX]; + = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX); i += MENU_ITEMS_PANE_LENGTH; } /* Ignore a nil in the item list. It's meaningful only for dialog boxes. */ - else if (EQ (XVECTOR (menu_items)->contents[i], Qquote)) + else if (EQ (AREF (menu_items, i), Qquote)) i += 1; else { entry - = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_VALUE]; - if (menu_item_selection == &XVECTOR (menu_items)->contents[i]) + = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE); + if (menu_item_selection == &AREF (menu_items, i)) { if (keymaps != 0) { @@ -2058,8 +2058,8 @@ { Lisp_Object pane_name, prefix; const char *pane_string; - pane_name = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_NAME]; - prefix = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_PREFIX]; + pane_name = AREF (menu_items, MENU_ITEMS_PANE_NAME); + prefix = AREF (menu_items, MENU_ITEMS_PANE_PREFIX); pane_string = (NILP (pane_name) ? "" : SSDATA (pane_name)); prev_wv = xmalloc_widget_value (); @@ -2078,10 +2078,10 @@ /* Create a new item within current pane. */ Lisp_Object item_name, enable, descrip; - item_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_NAME]; - enable = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_ENABLE]; + item_name = AREF (menu_items, i + MENU_ITEMS_ITEM_NAME); + enable = AREF (menu_items, i + MENU_ITEMS_ITEM_ENABLE); descrip - = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_EQUIV_KEY]; + = AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY); if (NILP (item_name)) { @@ -2110,7 +2110,7 @@ if (!NILP (descrip)) wv->key = SSDATA (descrip); wv->value = SSDATA (item_name); - wv->call_data = (void *) &XVECTOR (menu_items)->contents[i]; + wv->call_data = (void *) &AREF (menu_items, i); wv->enabled = !NILP (enable); wv->help = Qnil; prev_wv = wv; @@ -2177,13 +2177,13 @@ { Lisp_Object entry; - if (EQ (XVECTOR (menu_items)->contents[i], Qt)) + if (EQ (AREF (menu_items, i), Qt)) { prefix - = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX]; + = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX); i += MENU_ITEMS_PANE_LENGTH; } - else if (EQ (XVECTOR (menu_items)->contents[i], Qquote)) + else if (EQ (AREF (menu_items, i), Qquote)) { /* This is the boundary between left-side elts and right-side elts. */ @@ -2192,8 +2192,8 @@ else { entry - = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_VALUE]; - if (menu_item_selection == &XVECTOR (menu_items)->contents[i]) + = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE); + if (menu_item_selection == &AREF (menu_items, i)) { if (keymaps != 0) { @@ -2353,7 +2353,7 @@ lpane = XM_FAILURE; while (i < menu_items_used) { - if (EQ (XVECTOR (menu_items)->contents[i], Qt)) + if (EQ (AREF (menu_items, i), Qt)) { /* Create a new pane. */ Lisp_Object pane_name, prefix; @@ -2361,8 +2361,8 @@ maxlines = max (maxlines, lines); lines = 0; - pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME]; - prefix = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX]; + pane_name = AREF (menu_items, i + MENU_ITEMS_PANE_NAME); + prefix = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX); pane_string = (NILP (pane_name) ? "" : SSDATA (pane_name)); if (keymaps && !NILP (prefix)) @@ -2382,7 +2382,7 @@ while (j < menu_items_used) { Lisp_Object item; - item = XVECTOR (menu_items)->contents[j]; + item = AREF (menu_items, j); if (EQ (item, Qt)) break; if (NILP (item)) @@ -2399,7 +2399,7 @@ } /* Ignore a nil in the item list. It's meaningful only for dialog boxes. */ - else if (EQ (XVECTOR (menu_items)->contents[i], Qquote)) + else if (EQ (AREF (menu_items, i), Qquote)) i += 1; else { @@ -2408,11 +2408,11 @@ char *item_data; char const *help_string; - item_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_NAME]; - enable = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_ENABLE]; + item_name = AREF (menu_items, i + MENU_ITEMS_ITEM_NAME); + enable = AREF (menu_items, i + MENU_ITEMS_ITEM_ENABLE); descrip - = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_EQUIV_KEY]; - help = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_HELP]; + = AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY); + help = AREF (menu_items, i + MENU_ITEMS_ITEM_HELP); help_string = STRINGP (help) ? SSDATA (help) : NULL; if (!NILP (descrip)) @@ -2526,11 +2526,11 @@ i = 0; while (i < menu_items_used) { - if (EQ (XVECTOR (menu_items)->contents[i], Qt)) + if (EQ (AREF (menu_items, i), Qt)) { if (pane == 0) pane_prefix - = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX]; + = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX); pane--; i += MENU_ITEMS_PANE_LENGTH; } @@ -2541,7 +2541,7 @@ if (selidx == 0) { entry - = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_VALUE]; + = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE); if (keymaps != 0) { entry = Fcons (entry, Qnil); === modified file 'src/xselect.c' --- src/xselect.c 2012-06-16 12:24:15 +0000 +++ src/xselect.c 2012-06-19 16:56:28 +0000 @@ -1816,12 +1816,12 @@ ptrdiff_t i; ptrdiff_t size = ASIZE (obj); - if (SYMBOLP (XVECTOR (obj)->contents [0])) + if (SYMBOLP (AREF (obj, 0))) /* This vector is an ATOM set */ { if (NILP (type)) type = QATOM; for (i = 0; i < size; i++) - if (!SYMBOLP (XVECTOR (obj)->contents [i])) + if (!SYMBOLP (AREF (obj, i))) signal_error ("All elements of selection vector must have same type", obj); *data_ret = xnmalloc (size, sizeof (Atom)); @@ -1829,7 +1829,7 @@ *size_ret = size; for (i = 0; i < size; i++) (*(Atom **) data_ret) [i] - = symbol_to_x_atom (dpyinfo, XVECTOR (obj)->contents [i]); + = symbol_to_x_atom (dpyinfo, AREF (obj, i)); } else /* This vector is an INTEGER set, or something like it */ @@ -1839,7 +1839,7 @@ if (NILP (type)) type = QINTEGER; for (i = 0; i < size; i++) { - if (! RANGED_INTEGERP (X_SHRT_MIN, XVECTOR (obj)->contents[i], + if (! RANGED_INTEGERP (X_SHRT_MIN, AREF (obj, i), X_SHRT_MAX)) { /* Use sizeof (long) even if it is more than 32 bits. @@ -1857,10 +1857,10 @@ { if (format == 32) (*((unsigned long **) data_ret)) [i] = - cons_to_x_long (XVECTOR (obj)->contents[i]); + cons_to_x_long (AREF (obj, i)); else (*((short **) data_ret)) [i] = - XINT (XVECTOR (obj)->contents[i]); + XINT (AREF (obj, i)); } } } @@ -1895,11 +1895,10 @@ ptrdiff_t size = ASIZE (obj); Lisp_Object copy; if (size == 1) - return clean_local_selection_data (XVECTOR (obj)->contents [0]); + return clean_local_selection_data (AREF (obj, 0)); copy = Fmake_vector (make_number (size), Qnil); for (i = 0; i < size; i++) - XVECTOR (copy)->contents [i] - = clean_local_selection_data (XVECTOR (obj)->contents [i]); + ASET (copy, i, clean_local_selection_data (AREF (obj, i))); return copy; } return obj; ------------------------------------------------------------ revno: 108660 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-06-19 09:04:47 -0700 message: * lisp/progmodes/python.el (python-mode): Derive from prog-mode. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-06-19 07:05:44 +0000 +++ lisp/ChangeLog 2012-06-19 16:04:47 +0000 @@ -1,3 +1,7 @@ +2012-06-19 Glenn Morris + + * progmodes/python.el (python-mode): Derive from prog-mode. + 2012-06-19 Kevin Gallagher * emulation/edt.el (edt-default-menu-bar-update-buffers) === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2012-06-18 20:41:23 +0000 +++ lisp/progmodes/python.el 2012-06-19 16:04:47 +0000 @@ -2802,7 +2802,7 @@ ;;;###autoload -(define-derived-mode python-mode fundamental-mode "Python" +(define-derived-mode python-mode prog-mode "Python" "Major mode for editing Python files. \\{python-mode-map} ------------------------------------------------------------ revno: 108659 author: Kevin Gallagher committer: Chong Yidong branch nick: trunk timestamp: Tue 2012-06-19 15:05:44 +0800 message: In EDT emulator, allow updating of menu-bar Buffers menu. * lisp/emulation/edt.el (edt-default-menu-bar-update-buffers) (edt-user-menu-bar-update-buffers): New functions. (edt-default-emulation-setup, edt-user-emulation-setup): Use them. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-06-19 06:49:50 +0000 +++ lisp/ChangeLog 2012-06-19 07:05:44 +0000 @@ -1,3 +1,9 @@ +2012-06-19 Kevin Gallagher + + * emulation/edt.el (edt-default-menu-bar-update-buffers) + (edt-user-menu-bar-update-buffers): New functions. + (edt-default-emulation-setup, edt-user-emulation-setup): Use them. + 2012-06-19 Chong Yidong * subr.el (with-selected-window): Preserve the selected window's === modified file 'lisp/emulation/edt.el' --- lisp/emulation/edt.el 2012-01-19 07:21:25 +0000 +++ lisp/emulation/edt.el 2012-06-19 07:05:44 +0000 @@ -2071,6 +2071,20 @@ (setq transient-mark-mode edt-orig-transient-mark-mode)) (message "Original key bindings restored; EDT Emulation disabled")) +(defun edt-default-menu-bar-update-buffers () + ;; Update edt-default-global-map with latest copy of + ;; `global-buffers-menu-map' each time `menu-bar-update-buffers' + ;; updates global-map. + (define-key edt-default-global-map [menu-bar buffer] + (cons "Buffers" global-buffers-menu-map))) + +(defun edt-user-menu-bar-update-buffers () + ;; We need to update edt-user-global-map with latest copy of + ;; `global-buffers-menu-map' each time `menu-bar-update-buffers' + ;; updates global-map. + (define-key edt-user-global-map [menu-bar buffer] + (cons "Buffers" global-buffers-menu-map))) + (defun edt-default-emulation-setup (&optional user-setup) "Setup emulation of DEC's EDT editor. Optional argument USER-SETUP non-nil means called from function @@ -2110,10 +2124,8 @@ (progn (fset 'edt-emulation-on (symbol-function 'edt-select-default-global-map)) (edt-select-default-global-map))) - ;; We need to share `global-buffers-menu-map' with the saved global - ;; keymap, because `menu-bar-update-buffers' directly changes it. - (define-key (current-global-map) [menu-bar buffer] - (cons "Buffers" global-buffers-menu-map))) + ;; Keep the menu bar Buffers menu up-to-date in edt-default-global-map. + (add-hook 'menu-bar-update-hook 'edt-default-menu-bar-update-buffers)) (defun edt-user-emulation-setup () "Setup user custom emulation of DEC's EDT editor." @@ -2134,7 +2146,9 @@ ;; See Info node `edt' for more details, and sample edt-user.el file. (if (fboundp 'edt-setup-user-bindings) (edt-setup-user-bindings)) - (edt-select-user-global-map)) + (edt-select-user-global-map) + ;; Keep the menu bar Buffers menu up-to-date in edt-user-global-map. + (add-hook 'menu-bar-update-hook 'edt-user-menu-bar-update-buffers)) (defun edt-select-default-global-map() "Select default EDT emulation key bindings." ------------------------------------------------------------ revno: 108658 fixes bug(s): http://debbugs.gnu.org/4702 committer: Chong Yidong branch nick: trunk timestamp: Tue 2012-06-19 14:49:50 +0800 message: Preserve tty top-frames under various window-changing operations. * subr.el (with-selected-window): Preserve the selected window's terminal's top-frame. * window.el (save-selected-window): Likewise. * frame.c (delete_frame): When selecting a frame on a different text terminal, do not alter the terminal's top-frame. * term.c (Ftty_top_frame): New function. * xdisp.c (format_mode_line_unwind_data): Record the target frame's selected window and its terminal's top-frame. (unwind_format_mode_line): Restore them. (x_consider_frame_title, display_mode_line, Fformat_mode_line): Callers changed. (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM, since tty frames can be explicitly named. (prepare_menu_bars): Likewise. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-06-18 15:57:41 +0000 +++ etc/NEWS 2012-06-19 06:49:50 +0000 @@ -473,6 +473,8 @@ Emacs now supports mouse highlight, help-echo (in the echo area), and mouse-autoselect-window. +** New function `tty-top-frame' returns the topmost frame of a text terminal. + * Installation Changes in Emacs 24.1 === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-06-18 20:41:23 +0000 +++ lisp/ChangeLog 2012-06-19 06:49:50 +0000 @@ -1,3 +1,10 @@ +2012-06-19 Chong Yidong + + * subr.el (with-selected-window): Preserve the selected window's + terminal's top-frame (Bug#4702). + + * window.el (save-selected-window): Likewise. + 2012-06-18 Stefan Monnier * progmodes/python.el (python-rx-constituents): Move backquote. === modified file 'lisp/subr.el' --- lisp/subr.el 2012-06-07 16:20:28 +0000 +++ lisp/subr.el 2012-06-19 06:49:50 +0000 @@ -3011,24 +3011,29 @@ (declare (indent 1) (debug t)) ;; Most of this code is a copy of save-selected-window. `(let* ((save-selected-window-destination ,window) + (save-selected-window-frame + (window-frame save-selected-window-destination)) (save-selected-window-window (selected-window)) - ;; Selecting a window on another frame changes not only the - ;; selected-window but also the frame-selected-window of the - ;; destination frame. So we need to save&restore it. + ;; Selecting a window on another frame also changes that + ;; frame's frame-selected-window. We must save&restore it. (save-selected-window-other-frame - (unless (eq (selected-frame) - (window-frame save-selected-window-destination)) - (frame-selected-window - (window-frame save-selected-window-destination))))) + (unless (eq (selected-frame) save-selected-window-frame) + (frame-selected-window save-selected-window-frame))) + (save-selected-window-top-frame + (unless (eq (selected-frame) save-selected-window-frame) + (tty-top-frame save-selected-window-frame)))) (save-current-buffer (unwind-protect (progn (select-window save-selected-window-destination 'norecord) ,@body) ;; First reset frame-selected-window. - (if (window-live-p save-selected-window-other-frame) - ;; We don't use set-frame-selected-window because it does not - ;; pass the `norecord' argument to Fselect_window. - (select-window save-selected-window-other-frame 'norecord)) + (when (window-live-p save-selected-window-other-frame) + ;; We don't use set-frame-selected-window because it does not + ;; pass the `norecord' argument to Fselect_window. + (select-window save-selected-window-other-frame 'norecord) + (and (frame-live-p save-selected-window-top-frame) + (not (eq (tty-top-frame) save-selected-window-top-frame)) + (select-frame save-selected-window-top-frame 'norecord))) ;; Then reset the actual selected-window. (when (window-live-p save-selected-window-window) (select-window save-selected-window-window 'norecord)))))) === modified file 'lisp/window.el' --- lisp/window.el 2012-06-18 06:22:22 +0000 +++ lisp/window.el 2012-06-19 06:49:50 +0000 @@ -47,12 +47,24 @@ are not altered by this macro (unless they are altered in BODY)." (declare (indent 0) (debug t)) `(let ((save-selected-window-window (selected-window)) - ;; It is necessary to save all of these, because calling - ;; select-window changes frame-selected-window for whatever - ;; frame that window is in. + ;; We save and restore all frames' selected windows, because + ;; `select-window' can change the frame-selected-window of + ;; whatever frame that window is in. Each text terminal's + ;; top-frame is preserved by putting it last in the list. (save-selected-window-alist - (mapcar (lambda (frame) (cons frame (frame-selected-window frame))) - (frame-list)))) + (apply 'append + (mapcar (lambda (terminal) + (let ((frames (frames-on-display-list terminal)) + (top-frame (tty-top-frame terminal)) + alist) + (if top-frame + (setq frames + (cons top-frame + (delq top-frame frames)))) + (dolist (f frames) + (push (cons f (frame-selected-window f)) + alist)))) + (terminal-list))))) (save-current-buffer (unwind-protect (progn ,@body) === modified file 'src/ChangeLog' --- src/ChangeLog 2012-06-18 22:53:53 +0000 +++ src/ChangeLog 2012-06-19 06:49:50 +0000 @@ -1,3 +1,19 @@ +2012-06-19 Chong Yidong + + * frame.c (delete_frame): When selecting a frame on a different + text terminal, do not alter the terminal's top-frame. + + * xdisp.c (format_mode_line_unwind_data): Record the target + frame's selected window and its terminal's top-frame. + (unwind_format_mode_line): Restore them. + (x_consider_frame_title, display_mode_line, Fformat_mode_line): + Callers changed. + (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM, + since tty frames can be explicitly named. + (prepare_menu_bars): Likewise. + + * term.c (Ftty_top_frame): New function. + 2012-06-18 Paul Eggert Port byte-code-meter to modern targets. === modified file 'src/frame.c' --- src/frame.c 2012-06-13 13:40:48 +0000 +++ src/frame.c 2012-06-19 06:49:50 +0000 @@ -630,8 +630,8 @@ doc: /* Create an additional terminal frame, possibly on another terminal. This function takes one argument, an alist specifying frame parameters. -You can create multiple frames on a single text-only terminal, but -only one of them (the selected terminal frame) is actually displayed. +You can create multiple frames on a single text terminal, but only one +of them (the selected terminal frame) is actually displayed. In practice, generally you don't need to specify any parameters, except when you want to create a new frame on another terminal. @@ -865,8 +865,8 @@ this function is called. If you are using a window system, the previously selected frame may be restored as the selected frame when returning to the command loop, because it still may have -the window system's input focus. On a text-only terminal, the -next redisplay will display FRAME. +the window system's input focus. On a text terminal, the next +redisplay will display FRAME. This function returns FRAME, or nil if FRAME has been deleted. */) (Lisp_Object frame, Lisp_Object norecord) @@ -1254,7 +1254,17 @@ FOR_EACH_FRAME (tail, frame1) { if (! EQ (frame, frame1) && FRAME_LIVE_P (XFRAME (frame1))) - break; + { + /* Do not change a text terminal's top-frame. */ + struct frame *f1 = XFRAME (frame1); + if (FRAME_TERMCAP_P (f1) || FRAME_MSDOS_P (f1)) + { + Lisp_Object top_frame = FRAME_TTY (f1)->top_frame; + if (!EQ (top_frame, frame)) + frame1 = top_frame; + } + break; + } } } #ifdef NS_IMPL_COCOA @@ -1730,8 +1740,8 @@ Normally you may not make FRAME invisible if all other frames are invisible, but if the second optional argument FORCE is non-nil, you may do so. -This function has no effect on text-only terminal frames. Such frames -are always considered visible, whether or not they are currently being +This function has no effect on text terminal frames. Such frames are +always considered visible, whether or not they are currently being displayed in the terminal. */) (Lisp_Object frame, Lisp_Object force) { @@ -1743,12 +1753,6 @@ if (NILP (force) && !other_visible_frames (XFRAME (frame))) error ("Attempt to make invisible the sole visible or iconified frame"); -#if 0 /* This isn't logically necessary, and it can do GC. */ - /* Don't let the frame remain selected. */ - if (EQ (frame, selected_frame)) - do_switch_frame (next_frame (frame, Qt), 0, 0, Qnil) -#endif - /* Don't allow minibuf_window to remain on a deleted frame. */ if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window)) { @@ -1816,7 +1820,7 @@ On graphical displays, invisible frames are not updated and are usually not displayed at all, even in a window system's \"taskbar\". -If FRAME is a text-only terminal frame, this always returns t. +If FRAME is a text terminal frame, this always returns t. Such frames are always considered visible, whether or not they are currently being displayed on the terminal. */) (Lisp_Object frame) @@ -1872,7 +1876,7 @@ f = XFRAME (frame); if (FRAME_TERMCAP_P (f)) - /* On a text-only terminal select FRAME. */ + /* On a text terminal select FRAME. */ Fselect_frame (frame, Qnil); else /* Do like the documentation says. */ @@ -2493,7 +2497,7 @@ In a graphical version with no toolkit, it includes both the tool bar and menu bar. -For a text-only terminal, it includes the menu bar. In this case, the +For a text terminal, it includes the menu bar. In this case, the result is really in characters rather than pixels (i.e., is identical to `frame-height'). */) (Lisp_Object frame) === modified file 'src/term.c' --- src/term.c 2012-06-16 12:24:15 +0000 +++ src/term.c 2012-06-19 06:49:50 +0000 @@ -2132,7 +2132,7 @@ TERMINAL can be a terminal object, a frame, or nil (meaning the selected frame's terminal). This function always returns nil if -TERMINAL does not refer to a text-only terminal. */) +TERMINAL does not refer to a text terminal. */) (Lisp_Object terminal) { struct terminal *t = get_tty_terminal (terminal, 0); @@ -2149,7 +2149,7 @@ TERMINAL can be a terminal object, a frame, or nil (meaning the selected frame's terminal). This function always returns 0 if -TERMINAL does not refer to a text-only terminal. */) +TERMINAL does not refer to a text terminal. */) (Lisp_Object terminal) { struct terminal *t = get_tty_terminal (terminal, 0); @@ -2371,7 +2371,7 @@ TERMINAL can be a terminal object, a frame or nil (meaning the selected frame's terminal). This function always returns nil if -TERMINAL does not refer to a text-only terminal. */) +TERMINAL does not refer to a text terminal. */) (Lisp_Object terminal) { struct terminal *t = get_terminal (terminal, 1); @@ -2381,6 +2381,21 @@ return Qnil; } +DEFUN ("tty-top-frame", Ftty_top_frame, Stty_top_frame, 0, 1, 0, + doc: /* Return the topmost terminal frame on TERMINAL. +TERMINAL can be a terminal object, a frame or nil (meaning the +selected frame's terminal). This function returns nil if TERMINAL +does not refer to a text terminal. Otherwise, it returns the +top-most frame on the text terminal. */) + (Lisp_Object terminal) +{ + struct terminal *t = get_terminal (terminal, 1); + + if (t->type == output_termcap) + return t->display_info.tty->top_frame; + return Qnil; +} + DEFUN ("suspend-tty", Fsuspend_tty, Ssuspend_tty, 0, 1, 0, @@ -3638,6 +3653,7 @@ defsubr (&Stty_no_underline); defsubr (&Stty_type); defsubr (&Scontrolling_tty_p); + defsubr (&Stty_top_frame); defsubr (&Ssuspend_tty); defsubr (&Sresume_tty); #ifdef HAVE_GPM === modified file 'src/xdisp.c' --- src/xdisp.c 2012-06-17 10:11:39 +0000 +++ src/xdisp.c 2012-06-19 06:49:50 +0000 @@ -8356,9 +8356,9 @@ /* On graphical terminals, newlines may "overflow" into the fringe if overflow-newline-into-fringe is non-nil. - On text-only terminals, newlines may - overflow into the last glyph on the - display line.*/ + On text terminals, newlines may overflow + into the last glyph on the display + line.*/ if (!FRAME_WINDOW_P (it->f) || IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)) { @@ -10821,7 +10821,8 @@ static Lisp_Object Vmode_line_unwind_vector; static Lisp_Object -format_mode_line_unwind_data (struct buffer *obuf, +format_mode_line_unwind_data (struct frame *target_frame, + struct buffer *obuf, Lisp_Object owin, int save_proptrans) { @@ -10833,7 +10834,7 @@ Vmode_line_unwind_vector = Qnil; if (NILP (vector)) - vector = Fmake_vector (make_number (8), Qnil); + vector = Fmake_vector (make_number (10), Qnil); ASET (vector, 0, make_number (mode_line_target)); ASET (vector, 1, make_number (MODE_LINE_NOPROP_LEN (0))); @@ -10848,6 +10849,15 @@ tmp = Qnil; ASET (vector, 6, tmp); ASET (vector, 7, owin); + if (target_frame) + { + /* Similarly to `with-selected-window', if the operation selects + a window on another frame, we must restore that frame's + selected window, and (for a tty) the top-frame. */ + ASET (vector, 8, target_frame->selected_window); + if (FRAME_TERMCAP_P (target_frame)) + ASET (vector, 9, FRAME_TTY (target_frame)->top_frame); + } return vector; } @@ -10855,6 +10865,10 @@ static Lisp_Object unwind_format_mode_line (Lisp_Object vector) { + Lisp_Object old_window = AREF (vector, 7); + Lisp_Object target_frame_window = AREF (vector, 8); + Lisp_Object old_top_frame = AREF (vector, 9); + mode_line_target = XINT (AREF (vector, 0)); mode_line_noprop_ptr = mode_line_noprop_buf + XINT (AREF (vector, 1)); mode_line_string_list = AREF (vector, 2); @@ -10863,9 +10877,26 @@ mode_line_string_face = AREF (vector, 4); mode_line_string_face_prop = AREF (vector, 5); - if (!NILP (AREF (vector, 7))) - /* Select window before buffer, since it may change the buffer. */ - Fselect_window (AREF (vector, 7), Qt); + /* Select window before buffer, since it may change the buffer. */ + if (!NILP (old_window)) + { + /* If the operation that we are unwinding had selected a window + on a different frame, reset its frame-selected-window. For a + text terminal, reset its top-frame if necessary. */ + if (!NILP (target_frame_window)) + { + Lisp_Object frame + = WINDOW_FRAME (XWINDOW (target_frame_window)); + + if (!EQ (frame, WINDOW_FRAME (XWINDOW (old_window)))) + Fselect_window (target_frame_window, Qt); + + if (!NILP (old_top_frame) && !EQ (old_top_frame, frame)) + Fselect_frame (old_top_frame, Qt); + } + + Fselect_window (old_window, Qt); + } if (!NILP (AREF (vector, 6))) { @@ -10936,8 +10967,6 @@ Frame Titles ***********************************************************************/ -#ifdef HAVE_WINDOW_SYSTEM - /* Set the title of FRAME, if it has changed. The title format is Vicon_title_format if FRAME is iconified, otherwise it is frame_title_format. */ @@ -10981,7 +11010,7 @@ mode_line_noprop_buf; then display the title. */ record_unwind_protect (unwind_format_mode_line, format_mode_line_unwind_data - (current_buffer, selected_window, 0)); + (f, current_buffer, selected_window, 0)); Fselect_window (f->selected_window, Qt); set_buffer_internal_1 (XBUFFER (XWINDOW (f->selected_window)->buffer)); @@ -11008,10 +11037,6 @@ } } -#endif /* not HAVE_WINDOW_SYSTEM */ - - - /*********************************************************************** Menu Bars @@ -11038,7 +11063,6 @@ /* Update all frame titles based on their buffer names, etc. We do this before the menu bars so that the buffer-menu will show the up-to-date frame titles. */ -#ifdef HAVE_WINDOW_SYSTEM if (windows_or_buffers_changed || update_mode_lines) { Lisp_Object tail, frame; @@ -11051,7 +11075,6 @@ x_consider_frame_title (frame); } } -#endif /* HAVE_WINDOW_SYSTEM */ /* Update the menu bar item lists, if appropriate. This has to be done before any actual redisplay or generation of display lines. */ @@ -20125,7 +20148,7 @@ it.paragraph_embedding = L2R; record_unwind_protect (unwind_format_mode_line, - format_mode_line_unwind_data (NULL, Qnil, 0)); + format_mode_line_unwind_data (NULL, NULL, Qnil, 0)); mode_line_target = MODE_LINE_DISPLAY; @@ -20826,7 +20849,8 @@ and set that to nil so that we don't alter the outer value. */ record_unwind_protect (unwind_format_mode_line, format_mode_line_unwind_data - (old_buffer, selected_window, 1)); + (XFRAME (WINDOW_FRAME (XWINDOW (window))), + old_buffer, selected_window, 1)); mode_line_proptrans_alist = Qnil; Fselect_window (window, Qt);