Now on revision 109355. ------------------------------------------------------------ revno: 109355 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2012-08-01 10:23:24 +0400 message: Use INTERNAL_FIELD for processes. * src/process.h (PVAR): New macro. Adjust style. (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD. * src/print.c, src/process.c, src/sysdep.c, src/w32.c: * src/xdisp.c: Users changed. * admin/coccinelle/process.cocci: Semantic patch to replace direct access to Lisp_Object members of struct Lisp_Process to PVAR. diff: === modified file 'admin/ChangeLog' --- admin/ChangeLog 2012-08-01 05:11:36 +0000 +++ admin/ChangeLog 2012-08-01 06:23:24 +0000 @@ -1,5 +1,10 @@ 2012-08-01 Dmitry Antipov + * coccinelle/process.cocci: Semantic patch to replace direct + access to Lisp_Object members of struct Lisp_Process to PVAR. + +2012-08-01 Dmitry Antipov + * coccinelle/window.cocci: Semantic patch to replace direct access to Lisp_Object members of struct window to WVAR. === added file 'admin/coccinelle/process.cocci' --- admin/coccinelle/process.cocci 1970-01-01 00:00:00 +0000 +++ admin/coccinelle/process.cocci 2012-08-01 06:23:24 +0000 @@ -0,0 +1,110 @@ +// Change direct access to Lisp_Object fields of struct Lisp_Process to PVAR. +@@ +struct Lisp_Process *P; +Lisp_Object O; +@@ +( +- P->tty_name ++ PVAR (P, tty_name) +| +- P->name ++ PVAR (P, name) +| +- P->command ++ PVAR (P, command) +| +- P->filter ++ PVAR (P, filter) +| +- P->sentinel ++ PVAR (P, sentinel) +| +- P->log ++ PVAR (P, log) +| +- P->buffer ++ PVAR (P, buffer) +| +- P->childp ++ PVAR (P, childp) +| +- P->plist ++ PVAR (P, plist) +| +- P->type ++ PVAR (P, type) +| +- P->mark ++ PVAR (P, mark) +| +- P->status ++ PVAR (P, status) +| +- P->decode_coding_system ++ PVAR (P, decode_coding_system) +| +- P->decoding_buf ++ PVAR (P, decoding_buf) +| +- P->encode_coding_system ++ PVAR (P, encode_coding_system) +| +- P->encoding_buf ++ PVAR (P, encoding_buf) +| +- P->write_queue ++ PVAR (P, write_queue) + +| + +- XPROCESS (O)->tty_name ++ PVAR (XPROCESS (O), tty_name) +| +- XPROCESS (O)->name ++ PVAR (XPROCESS (O), name) +| +- XPROCESS (O)->command ++ PVAR (XPROCESS (O), command) +| +- XPROCESS (O)->filter ++ PVAR (XPROCESS (O), filter) +| +- XPROCESS (O)->sentinel ++ PVAR (XPROCESS (O), sentinel) +| +- XPROCESS (O)->log ++ PVAR (XPROCESS (O), log) +| +- XPROCESS (O)->buffer ++ PVAR (XPROCESS (O), buffer) +| +- XPROCESS (O)->childp ++ PVAR (XPROCESS (O), childp) +| +- XPROCESS (O)->plist ++ PVAR (XPROCESS (O), plist) +| +- XPROCESS (O)->type ++ PVAR (XPROCESS (O), type) +| +- XPROCESS (O)->mark ++ PVAR (XPROCESS (O), mark) +| +- XPROCESS (O)->status ++ PVAR (XPROCESS (O), status) +| +- XPROCESS (O)->decode_coding_system ++ PVAR (XPROCESS (O), decode_coding_system) +| +- XPROCESS (O)->decoding_buf ++ PVAR (XPROCESS (O), decoding_buf) +| +- XPROCESS (O)->encode_coding_system ++ PVAR (XPROCESS (O), encode_coding_system) +| +- XPROCESS (O)->encoding_buf ++ PVAR (XPROCESS (O), encoding_buf) +| +- XPROCESS (O)->write_queue ++ PVAR (XPROCESS (O), write_queue) +) === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-01 05:11:36 +0000 +++ src/ChangeLog 2012-08-01 06:23:24 +0000 @@ -1,5 +1,12 @@ 2012-08-01 Dmitry Antipov + Use INTERNAL_FIELD for processes. + * process.h (PVAR): New macro. Adjust style. + (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD. + * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed. + +2012-08-01 Dmitry Antipov + Use INTERNAL_FIELD for windows. * window.h (WVAR): New macro. (struct window): Change Lisp_Object members to INTERNAL_FIELD. === modified file 'src/print.c' --- src/print.c 2012-08-01 05:11:36 +0000 +++ src/print.c 2012-08-01 06:23:24 +0000 @@ -1699,11 +1699,11 @@ if (escapeflag) { strout ("#name, printcharfun); + print_string (PVAR (XPROCESS (obj), name), printcharfun); PRINTCHAR ('>'); } else - print_string (XPROCESS (obj)->name, printcharfun); + print_string (PVAR (XPROCESS (obj), name), printcharfun); } else if (BOOL_VECTOR_P (obj)) { === modified file 'src/process.c' --- src/process.c 2012-07-20 07:29:04 +0000 +++ src/process.c 2012-08-01 06:23:24 +0000 @@ -172,10 +172,10 @@ /* QCfilter is defined in keyboard.c. */ extern Lisp_Object QCfilter; -#define NETCONN_P(p) (EQ (XPROCESS (p)->type, Qnetwork)) -#define NETCONN1_P(p) (EQ ((p)->type, Qnetwork)) -#define SERIALCONN_P(p) (EQ (XPROCESS (p)->type, Qserial)) -#define SERIALCONN1_P(p) (EQ ((p)->type, Qserial)) +#define NETCONN_P(p) (EQ (PVAR (XPROCESS (p), type), Qnetwork)) +#define NETCONN1_P(p) (EQ (PVAR (p, type), Qnetwork)) +#define SERIALCONN_P(p) (EQ (PVAR (XPROCESS (p), type), Qserial)) +#define SERIALCONN1_P(p) (EQ (PVAR (p, type), Qserial)) #ifndef HAVE_H_ERRNO extern int h_errno; @@ -428,7 +428,7 @@ update_status (struct Lisp_Process *p) { eassert (p->raw_status_new); - p->status = status_convert (p->raw_status); + PVAR (p, status) = status_convert (p->raw_status); p->raw_status_new = 0; } @@ -479,7 +479,7 @@ static Lisp_Object status_message (struct Lisp_Process *p) { - Lisp_Object status = p->status; + Lisp_Object status = PVAR (p, status); Lisp_Object symbol; int code, coredump; Lisp_Object string, string2; @@ -626,8 +626,8 @@ p = allocate_process (); /* Initialize Lisp data. Note that allocate_process initializes all Lisp data to nil, so do it only for slots which should not be nil. */ - p->status = Qrun; - p->mark = Fmake_marker (); + PVAR (p, status) = Qrun; + PVAR (p, mark) = Fmake_marker (); /* Initialize non-Lisp data. Note that allocate_process zeroes out all non-Lisp data, so do it only for slots which should not be zero. */ @@ -648,7 +648,7 @@ name1 = concat2 (name, make_formatted_string (suffix, "<%"pMd">", i)); } name = name1; - p->name = name; + PVAR (p, name) = name; XSETPROCESS (val, p); Vprocess_alist = Fcons (Fcons (name, val), Vprocess_alist); return val; @@ -745,7 +745,7 @@ p->raw_status_new = 0; if (NETCONN1_P (p) || SERIALCONN1_P (p)) { - p->status = Fcons (Qexit, Fcons (make_number (0), Qnil)); + PVAR (p, status) = Fcons (Qexit, Fcons (make_number (0), Qnil)); p->tick = ++process_tick; status_notify (p); redisplay_preserve_echo_area (13); @@ -763,9 +763,9 @@ /* If the process has already signaled, remove it from the list. */ if (p->raw_status_new) update_status (p); - symbol = p->status; - if (CONSP (p->status)) - symbol = XCAR (p->status); + symbol = PVAR (p, status); + if (CONSP (PVAR (p, status))) + symbol = XCAR (PVAR (p, status)); if (EQ (symbol, Qsignal) || EQ (symbol, Qexit)) deleted_pid_list = Fdelete (make_fixnum_or_float (pid), deleted_pid_list); @@ -774,7 +774,7 @@ { Fkill_process (process, Qnil); /* Do this now, since remove_process will make sigchld_handler do nothing. */ - p->status + PVAR (p, status) = Fcons (Qsignal, Fcons (make_number (SIGKILL), Qnil)); p->tick = ++process_tick; status_notify (p); @@ -816,14 +816,14 @@ p = XPROCESS (process); if (p->raw_status_new) update_status (p); - status = p->status; + status = PVAR (p, status); if (CONSP (status)) status = XCAR (status); if (NETCONN1_P (p) || SERIALCONN1_P (p)) { if (EQ (status, Qexit)) status = Qclosed; - else if (EQ (p->command, Qt)) + else if (EQ (PVAR (p, command), Qt)) status = Qstop; else if (EQ (status, Qrun)) status = Qopen; @@ -840,8 +840,8 @@ CHECK_PROCESS (process); if (XPROCESS (process)->raw_status_new) update_status (XPROCESS (process)); - if (CONSP (XPROCESS (process)->status)) - return XCAR (XCDR (XPROCESS (process)->status)); + if (CONSP (PVAR (XPROCESS (process), status))) + return XCAR (XCDR (PVAR (XPROCESS (process), status))); return make_number (0); } @@ -865,7 +865,7 @@ (register Lisp_Object process) { CHECK_PROCESS (process); - return XPROCESS (process)->name; + return PVAR (XPROCESS (process), name); } DEFUN ("process-command", Fprocess_command, Sprocess_command, 1, 1, 0, @@ -877,7 +877,7 @@ (register Lisp_Object process) { CHECK_PROCESS (process); - return XPROCESS (process)->command; + return PVAR (XPROCESS (process), command); } DEFUN ("process-tty-name", Fprocess_tty_name, Sprocess_tty_name, 1, 1, 0, @@ -887,7 +887,7 @@ (register Lisp_Object process) { CHECK_PROCESS (process); - return XPROCESS (process)->tty_name; + return PVAR (XPROCESS (process), tty_name); } DEFUN ("set-process-buffer", Fset_process_buffer, Sset_process_buffer, @@ -902,9 +902,9 @@ if (!NILP (buffer)) CHECK_BUFFER (buffer); p = XPROCESS (process); - p->buffer = buffer; + PVAR (p, buffer) = buffer; if (NETCONN1_P (p) || SERIALCONN1_P (p)) - p->childp = Fplist_put (p->childp, QCbuffer, buffer); + PVAR (p, childp) = Fplist_put (PVAR (p, childp), QCbuffer, buffer); setup_process_coding_systems (process); return buffer; } @@ -916,7 +916,7 @@ (register Lisp_Object process) { CHECK_PROCESS (process); - return XPROCESS (process)->buffer; + return PVAR (XPROCESS (process), buffer); } DEFUN ("process-mark", Fprocess_mark, Sprocess_mark, @@ -925,7 +925,7 @@ (register Lisp_Object process) { CHECK_PROCESS (process); - return XPROCESS (process)->mark; + return PVAR (XPROCESS (process), mark); } DEFUN ("set-process-filter", Fset_process_filter, Sset_process_filter, @@ -961,23 +961,23 @@ if (p->infd >= 0) { - if (EQ (filter, Qt) && !EQ (p->status, Qlisten)) + if (EQ (filter, Qt) && !EQ (PVAR (p, status), Qlisten)) { FD_CLR (p->infd, &input_wait_mask); FD_CLR (p->infd, &non_keyboard_wait_mask); } - else if (EQ (p->filter, Qt) + else if (EQ (PVAR (p, filter), Qt) /* Network or serial process not stopped: */ - && !EQ (p->command, Qt)) + && !EQ (PVAR (p, command), Qt)) { FD_SET (p->infd, &input_wait_mask); FD_SET (p->infd, &non_keyboard_wait_mask); } } - p->filter = filter; + PVAR (p, filter) = filter; if (NETCONN1_P (p) || SERIALCONN1_P (p)) - p->childp = Fplist_put (p->childp, QCfilter, filter); + PVAR (p, childp) = Fplist_put (PVAR (p, childp), QCfilter, filter); setup_process_coding_systems (process); return filter; } @@ -989,7 +989,7 @@ (register Lisp_Object process) { CHECK_PROCESS (process); - return XPROCESS (process)->filter; + return PVAR (XPROCESS (process), filter); } DEFUN ("set-process-sentinel", Fset_process_sentinel, Sset_process_sentinel, @@ -1004,9 +1004,9 @@ CHECK_PROCESS (process); p = XPROCESS (process); - p->sentinel = sentinel; + PVAR (p, sentinel) = sentinel; if (NETCONN1_P (p) || SERIALCONN1_P (p)) - p->childp = Fplist_put (p->childp, QCsentinel, sentinel); + PVAR (p, childp) = Fplist_put (PVAR (p, childp), QCsentinel, sentinel); return sentinel; } @@ -1017,7 +1017,7 @@ (register Lisp_Object process) { CHECK_PROCESS (process); - return XPROCESS (process)->sentinel; + return PVAR (XPROCESS (process), sentinel); } DEFUN ("set-process-window-size", Fset_process_window_size, @@ -1102,7 +1102,7 @@ Lisp_Object contact; CHECK_PROCESS (process); - contact = XPROCESS (process)->childp; + contact = PVAR (XPROCESS (process), childp); #ifdef DATAGRAM_SOCKETS if (DATAGRAM_CONN_P (process) @@ -1128,7 +1128,7 @@ (register Lisp_Object process) { CHECK_PROCESS (process); - return XPROCESS (process)->plist; + return PVAR (XPROCESS (process), plist); } DEFUN ("set-process-plist", Fset_process_plist, Sset_process_plist, @@ -1139,7 +1139,7 @@ CHECK_PROCESS (process); CHECK_LIST (plist); - XPROCESS (process)->plist = plist; + PVAR (XPROCESS (process), plist) = plist; return plist; } @@ -1151,7 +1151,7 @@ a socket connection. */) (Lisp_Object process) { - return XPROCESS (process)->type; + return PVAR (XPROCESS (process), type); } #endif @@ -1164,7 +1164,7 @@ { Lisp_Object proc; proc = get_process (process); - return XPROCESS (proc)->type; + return PVAR (XPROCESS (proc), type); } DEFUN ("format-network-address", Fformat_network_address, Sformat_network_address, @@ -1325,13 +1325,13 @@ itself; it's all taken care of here. */ record_unwind_protect (start_process_unwind, proc); - XPROCESS (proc)->childp = Qt; - XPROCESS (proc)->plist = Qnil; - XPROCESS (proc)->type = Qreal; - XPROCESS (proc)->buffer = buffer; - XPROCESS (proc)->sentinel = Qnil; - XPROCESS (proc)->filter = Qnil; - XPROCESS (proc)->command = Flist (nargs - 2, args + 2); + PVAR (XPROCESS (proc), childp) = Qt; + PVAR (XPROCESS (proc), plist) = Qnil; + PVAR (XPROCESS (proc), type) = Qreal; + PVAR (XPROCESS (proc), buffer) = buffer; + PVAR (XPROCESS (proc), sentinel) = Qnil; + PVAR (XPROCESS (proc), filter) = Qnil; + PVAR (XPROCESS (proc), command) = Flist (nargs - 2, args + 2); #ifdef HAVE_GNUTLS /* AKA GNUTLS_INITSTAGE(proc). */ @@ -1347,7 +1347,7 @@ /* Make the process marker point into the process buffer (if any). */ if (BUFFERP (buffer)) - set_marker_both (XPROCESS (proc)->mark, buffer, + set_marker_both (PVAR (XPROCESS (proc), mark), buffer, BUF_ZV (XBUFFER (buffer)), BUF_ZV_BYTE (XBUFFER (buffer))); @@ -1376,7 +1376,7 @@ else if (CONSP (Vdefault_process_coding_system)) val = XCAR (Vdefault_process_coding_system); } - XPROCESS (proc)->decode_coding_system = val; + PVAR (XPROCESS (proc), decode_coding_system) = val; val = Vcoding_system_for_write; if (NILP (val)) @@ -1396,7 +1396,7 @@ else if (CONSP (Vdefault_process_coding_system)) val = XCDR (Vdefault_process_coding_system); } - XPROCESS (proc)->encode_coding_system = val; + PVAR (XPROCESS (proc), encode_coding_system) = val; /* Note: At this moment, the above coding system may leave text-conversion or eol-conversion unspecified. They will be decided after we read output from the process and decode it by @@ -1405,9 +1405,9 @@ } - XPROCESS (proc)->decoding_buf = empty_unibyte_string; + PVAR (XPROCESS (proc), decoding_buf) = empty_unibyte_string; XPROCESS (proc)->decoding_carryover = 0; - XPROCESS (proc)->encoding_buf = empty_unibyte_string; + PVAR (XPROCESS (proc), encoding_buf) = empty_unibyte_string; XPROCESS (proc)->inherit_coding_system_flag = !(NILP (buffer) || !inherit_process_coding_system); @@ -1465,7 +1465,7 @@ { if (NILP (arg_encoding)) arg_encoding = (complement_process_encoding_system - (XPROCESS (proc)->encode_coding_system)); + (PVAR (XPROCESS (proc), encode_coding_system))); XSETCAR (tem, code_convert_string_norecord (XCAR (tem), arg_encoding, 1)); @@ -1629,7 +1629,7 @@ more portable (see USG_SUBTTY_WORKS above). */ XPROCESS (process)->pty_flag = pty_flag; - XPROCESS (process)->status = Qrun; + PVAR (XPROCESS (process), status) = Qrun; /* Delay interrupts until we have a chance to store the new fork's pid in its process structure */ @@ -1868,10 +1868,10 @@ #ifdef HAVE_PTYS if (pty_flag) - XPROCESS (process)->tty_name = build_string (pty_name); + PVAR (XPROCESS (process), tty_name) = build_string (pty_name); else #endif - XPROCESS (process)->tty_name = Qnil; + PVAR (XPROCESS (process), tty_name) = Qnil; #if !defined (WINDOWSNT) && defined (FD_CLOEXEC) /* Wait for child_setup to complete in case that vfork is @@ -1966,7 +1966,7 @@ more portable (see USG_SUBTTY_WORKS above). */ XPROCESS (process)->pty_flag = pty_flag; - XPROCESS (process)->status = Qrun; + PVAR (XPROCESS (process), status) = Qrun; setup_process_coding_systems (process); FD_SET (inchannel, &input_wait_mask); @@ -1977,10 +1977,10 @@ XPROCESS (process)->pid = -2; #ifdef HAVE_PTYS if (pty_flag) - XPROCESS (process)->tty_name = build_string (pty_name); + PVAR (XPROCESS (process), tty_name) = build_string (pty_name); else #endif - XPROCESS (process)->tty_name = Qnil; + PVAR (XPROCESS (process), tty_name) = Qnil; } @@ -2369,7 +2369,7 @@ if (set_socket_option (s, option, value)) { - p->childp = Fplist_put (p->childp, option, value); + PVAR (p, childp) = Fplist_put (PVAR (p, childp), option, value); return Qt; } @@ -2458,10 +2458,10 @@ proc = Fplist_get (contact, QCport); proc = get_process (proc); p = XPROCESS (proc); - if (!EQ (p->type, Qserial)) + if (!EQ (PVAR (p, type), Qserial)) error ("Not a serial process"); - if (NILP (Fplist_get (p->childp, QCspeed))) + if (NILP (Fplist_get (PVAR (p, childp), QCspeed))) { UNGCPRO; return Qnil; @@ -2602,21 +2602,21 @@ if (NILP (buffer)) buffer = name; buffer = Fget_buffer_create (buffer); - p->buffer = buffer; + PVAR (p, buffer) = buffer; - p->childp = contact; - p->plist = Fcopy_sequence (Fplist_get (contact, QCplist)); - p->type = Qserial; - p->sentinel = Fplist_get (contact, QCsentinel); - p->filter = Fplist_get (contact, QCfilter); - p->log = Qnil; + PVAR (p, childp) = contact; + PVAR (p, plist) = Fcopy_sequence (Fplist_get (contact, QCplist)); + PVAR (p, type) = Qserial; + PVAR (p, sentinel) = Fplist_get (contact, QCsentinel); + PVAR (p, filter) = Fplist_get (contact, QCfilter); + PVAR (p, log) = Qnil; if (tem = Fplist_get (contact, QCnoquery), !NILP (tem)) p->kill_without_query = 1; if (tem = Fplist_get (contact, QCstop), !NILP (tem)) - p->command = Qt; + PVAR (p, command) = Qt; p->pty_flag = 0; - if (!EQ (p->command, Qt)) + if (!EQ (PVAR (p, command), Qt)) { FD_SET (fd, &input_wait_mask); FD_SET (fd, &non_keyboard_wait_mask); @@ -2624,7 +2624,7 @@ if (BUFFERP (buffer)) { - set_marker_both (p->mark, buffer, + set_marker_both (PVAR (p, mark), buffer, BUF_ZV (XBUFFER (buffer)), BUF_ZV_BYTE (XBUFFER (buffer))); } @@ -2645,7 +2645,7 @@ else if ((!NILP (buffer) && NILP (BVAR (XBUFFER (buffer), enable_multibyte_characters))) || (NILP (buffer) && NILP (BVAR (&buffer_defaults, enable_multibyte_characters)))) val = Qnil; - p->decode_coding_system = val; + PVAR (p, decode_coding_system) = val; val = Qnil; if (!NILP (tem)) @@ -2659,12 +2659,12 @@ else if ((!NILP (buffer) && NILP (BVAR (XBUFFER (buffer), enable_multibyte_characters))) || (NILP (buffer) && NILP (BVAR (&buffer_defaults, enable_multibyte_characters)))) val = Qnil; - p->encode_coding_system = val; + PVAR (p, encode_coding_system) = val; setup_process_coding_systems (proc); - p->decoding_buf = empty_unibyte_string; + PVAR (p, decoding_buf) = empty_unibyte_string; p->decoding_carryover = 0; - p->encoding_buf = empty_unibyte_string; + PVAR (p, encoding_buf) = empty_unibyte_string; p->inherit_coding_system_flag = !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system); @@ -3401,27 +3401,27 @@ p = XPROCESS (proc); - p->childp = contact; - p->plist = Fcopy_sequence (Fplist_get (contact, QCplist)); - p->type = Qnetwork; + PVAR (p, childp) = contact; + PVAR (p, plist) = Fcopy_sequence (Fplist_get (contact, QCplist)); + PVAR (p, type) = Qnetwork; - p->buffer = buffer; - p->sentinel = sentinel; - p->filter = filter; - p->log = Fplist_get (contact, QClog); + PVAR (p, buffer) = buffer; + PVAR (p, sentinel) = sentinel; + PVAR (p, filter) = filter; + PVAR (p, log) = Fplist_get (contact, QClog); if (tem = Fplist_get (contact, QCnoquery), !NILP (tem)) p->kill_without_query = 1; if ((tem = Fplist_get (contact, QCstop), !NILP (tem))) - p->command = Qt; + PVAR (p, command) = Qt; p->pid = 0; p->infd = inch; p->outfd = outch; if (is_server && socktype != SOCK_DGRAM) - p->status = Qlisten; + PVAR (p, status) = Qlisten; /* Make the process marker point into the process buffer (if any). */ if (BUFFERP (buffer)) - set_marker_both (p->mark, buffer, + set_marker_both (PVAR (p, mark), buffer, BUF_ZV (XBUFFER (buffer)), BUF_ZV_BYTE (XBUFFER (buffer))); @@ -3431,7 +3431,7 @@ /* We may get here if connect did succeed immediately. However, in that case, we still need to signal this like a non-blocking connection. */ - p->status = Qconnect; + PVAR (p, status) = Qconnect; if (!FD_ISSET (inch, &connect_wait_mask)) { FD_SET (inch, &connect_wait_mask); @@ -3443,8 +3443,8 @@ #endif /* A server may have a client filter setting of Qt, but it must still listen for incoming connects unless it is stopped. */ - if ((!EQ (p->filter, Qt) && !EQ (p->command, Qt)) - || (EQ (p->status, Qlisten) && NILP (p->command))) + if ((!EQ (PVAR (p, filter), Qt) && !EQ (PVAR (p, command), Qt)) + || (EQ (PVAR (p, status), Qlisten) && NILP (PVAR (p, command)))) { FD_SET (inch, &input_wait_mask); FD_SET (inch, &non_keyboard_wait_mask); @@ -3498,7 +3498,7 @@ else val = Qnil; } - p->decode_coding_system = val; + PVAR (p, decode_coding_system) = val; if (!NILP (tem)) { @@ -3532,13 +3532,13 @@ else val = Qnil; } - p->encode_coding_system = val; + PVAR (p, encode_coding_system) = val; } setup_process_coding_systems (proc); - p->decoding_buf = empty_unibyte_string; + PVAR (p, decoding_buf) = empty_unibyte_string; p->decoding_carryover = 0; - p->encoding_buf = empty_unibyte_string; + PVAR (p, encoding_buf) = empty_unibyte_string; p->inherit_coding_system_flag = !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system); @@ -4031,8 +4031,8 @@ return; #endif - if (!NILP (ps->log)) - call3 (ps->log, server, Qnil, + if (!NILP (PVAR (ps, log))) + call3 (PVAR (ps, log), server, Qnil, concat3 (build_string ("accept failed with code"), Fnumber_to_string (make_number (code)), build_string ("\n"))); @@ -4102,15 +4102,15 @@ process name of the server process concatenated with the caller identification. */ - if (!NILP (ps->filter) && !EQ (ps->filter, Qt)) + if (!NILP (PVAR (ps, filter)) && !EQ (PVAR (ps, filter), Qt)) buffer = Qnil; else { - buffer = ps->buffer; + buffer = PVAR (ps, buffer); if (!NILP (buffer)) buffer = Fbuffer_name (buffer); else - buffer = ps->name; + buffer = PVAR (ps, name); if (!NILP (buffer)) { buffer = concat2 (buffer, caller); @@ -4121,7 +4121,7 @@ /* Generate a unique name for the new server process. Combine the server process name with the caller identification. */ - name = concat2 (ps->name, caller); + name = concat2 (PVAR (ps, name), caller); proc = make_process (name); chan_process[s] = proc; @@ -4137,7 +4137,7 @@ p = XPROCESS (proc); /* Build new contact information for this setup. */ - contact = Fcopy_sequence (ps->childp); + contact = Fcopy_sequence (PVAR (ps, childp)); contact = Fplist_put (contact, QCserver, Qnil); contact = Fplist_put (contact, QChost, host); if (!NILP (service)) @@ -4151,21 +4151,21 @@ conv_sockaddr_to_lisp (&saddr.sa, len)); #endif - p->childp = contact; - p->plist = Fcopy_sequence (ps->plist); - p->type = Qnetwork; + PVAR (p, childp) = contact; + PVAR (p, plist) = Fcopy_sequence (PVAR (ps, plist)); + PVAR (p, type) = Qnetwork; - p->buffer = buffer; - p->sentinel = ps->sentinel; - p->filter = ps->filter; - p->command = Qnil; + PVAR (p, buffer) = buffer; + PVAR (p, sentinel) = PVAR (ps, sentinel); + PVAR (p, filter) = PVAR (ps, filter); + PVAR (p, command) = Qnil; p->pid = 0; p->infd = s; p->outfd = s; - p->status = Qrun; + PVAR (p, status) = Qrun; /* Client processes for accepted connections are not stopped initially. */ - if (!EQ (p->filter, Qt)) + if (!EQ (PVAR (p, filter), Qt)) { FD_SET (s, &input_wait_mask); FD_SET (s, &non_keyboard_wait_mask); @@ -4179,24 +4179,24 @@ of the new process should reflect the settings at the time the server socket was opened; not the current settings. */ - p->decode_coding_system = ps->decode_coding_system; - p->encode_coding_system = ps->encode_coding_system; + PVAR (p, decode_coding_system) = PVAR (ps, decode_coding_system); + PVAR (p, encode_coding_system) = PVAR (ps, encode_coding_system); setup_process_coding_systems (proc); - p->decoding_buf = empty_unibyte_string; + PVAR (p, decoding_buf) = empty_unibyte_string; p->decoding_carryover = 0; - p->encoding_buf = empty_unibyte_string; + PVAR (p, encoding_buf) = empty_unibyte_string; p->inherit_coding_system_flag = (NILP (buffer) ? 0 : ps->inherit_coding_system_flag); - if (!NILP (ps->log)) - call3 (ps->log, server, proc, + if (!NILP (PVAR (ps, log))) + call3 (PVAR (ps, log), server, proc, concat3 (build_string ("accept from "), (STRINGP (host) ? host : build_string ("-")), build_string ("\n"))); - if (!NILP (p->sentinel)) + if (!NILP (PVAR (p, sentinel))) exec_sentinel (proc, concat3 (build_string ("open from "), (STRINGP (host) ? host : build_string ("-")), @@ -4287,7 +4287,8 @@ FD_ZERO (&Writeok); if (time_limit == 0 && nsecs == 0 && wait_proc && !NILP (Vinhibit_quit) - && !(CONSP (wait_proc->status) && EQ (XCAR (wait_proc->status), Qexit))) + && !(CONSP (PVAR (wait_proc, status)) + && EQ (XCAR (PVAR (wait_proc, status)), Qexit))) message ("Blocking call to accept-process-output with quit inhibited!!"); /* If wait_proc is a process to watch, set wait_channel accordingly. */ @@ -4460,8 +4461,8 @@ if (wait_proc && wait_proc->raw_status_new) update_status (wait_proc); if (wait_proc - && ! EQ (wait_proc->status, Qrun) - && ! EQ (wait_proc->status, Qconnect)) + && ! EQ (PVAR (wait_proc, status), Qrun) + && ! EQ (PVAR (wait_proc, status), Qconnect)) { int nread, total_nread = 0; @@ -4820,7 +4821,7 @@ continue; /* If this is a server stream socket, accept connection. */ - if (EQ (XPROCESS (proc)->status, Qlisten)) + if (EQ (PVAR (XPROCESS (proc), status), Qlisten)) { server_accept_connection (proc, channel); continue; @@ -4889,7 +4890,7 @@ wait3() will not find the process object to delete. Do it here. */ p->tick = ++process_tick; - p->status = Qfailed; + PVAR (p, status) = Qfailed; } else kill (getpid (), SIGCHLD); @@ -4908,8 +4909,8 @@ deactivate_process (proc); if (XPROCESS (proc)->raw_status_new) update_status (XPROCESS (proc)); - if (EQ (XPROCESS (proc)->status, Qrun)) - XPROCESS (proc)->status + if (EQ (PVAR (XPROCESS (proc), status), Qrun)) + PVAR (XPROCESS (proc), status) = Fcons (Qexit, Fcons (make_number (256), Qnil)); } } @@ -4958,17 +4959,18 @@ if (xerrno) { p->tick = ++process_tick; - p->status = Fcons (Qfailed, Fcons (make_number (xerrno), Qnil)); + PVAR (p, status) + = Fcons (Qfailed, Fcons (make_number (xerrno), Qnil)); deactivate_process (proc); } else { - p->status = Qrun; + PVAR (p, status) = Qrun; /* Execute the sentinel here. If we had relied on status_notify to do it later, it will read input from the process before calling the sentinel. */ exec_sentinel (proc, build_string ("open\n")); - if (!EQ (p->filter, Qt) && !EQ (p->command, Qt)) + if (!EQ (PVAR (p, filter), Qt) && !EQ (PVAR (p, command), Qt)) { FD_SET (p->infd, &input_wait_mask); FD_SET (p->infd, &non_keyboard_wait_mask); @@ -5040,7 +5042,7 @@ chars = alloca (carryover + readmax); if (carryover) /* See the comment above. */ - memcpy (chars, SDATA (p->decoding_buf), carryover); + memcpy (chars, SDATA (PVAR (p, decoding_buf)), carryover); #ifdef DATAGRAM_SOCKETS /* We have a working select, so proc_buffered_char is always -1. */ @@ -5119,7 +5121,7 @@ record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); /* Read and dispose of the process output. */ - outstream = p->filter; + outstream = PVAR (p, filter); if (!NILP (outstream)) { Lisp_Object text; @@ -5161,9 +5163,9 @@ text = coding->dst_object; Vlast_coding_system_used = CODING_ID_NAME (coding->id); /* A new coding system might be found. */ - if (!EQ (p->decode_coding_system, Vlast_coding_system_used)) + if (!EQ (PVAR (p, decode_coding_system), Vlast_coding_system_used)) { - p->decode_coding_system = Vlast_coding_system_used; + PVAR (p, decode_coding_system) = Vlast_coding_system_used; /* Don't call setup_coding_system for proc_decode_coding_system[channel] here. It is done in @@ -5176,21 +5178,21 @@ proc_encode_coding_system[p->outfd] surely points to a valid memory because p->outfd will be changed once EOF is sent to the process. */ - if (NILP (p->encode_coding_system) + if (NILP (PVAR (p, encode_coding_system)) && proc_encode_coding_system[p->outfd]) { - p->encode_coding_system + PVAR (p, encode_coding_system) = coding_inherit_eol_type (Vlast_coding_system_used, Qnil); - setup_coding_system (p->encode_coding_system, + setup_coding_system (PVAR (p, encode_coding_system), proc_encode_coding_system[p->outfd]); } } if (coding->carryover_bytes > 0) { - if (SCHARS (p->decoding_buf) < coding->carryover_bytes) - p->decoding_buf = make_uninit_string (coding->carryover_bytes); - memcpy (SDATA (p->decoding_buf), coding->carryover, + if (SCHARS (PVAR (p, decoding_buf)) < coding->carryover_bytes) + PVAR (p, decoding_buf) = make_uninit_string (coding->carryover_bytes); + memcpy (SDATA (PVAR (p, decoding_buf)), coding->carryover, coding->carryover_bytes); p->decoding_carryover = coding->carryover_bytes; } @@ -5226,7 +5228,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 (PVAR (p, buffer)) && !NILP (BVAR (XBUFFER (PVAR (p, buffer)), name))) { Lisp_Object old_read_only; ptrdiff_t old_begv, old_zv; @@ -5236,7 +5238,7 @@ Lisp_Object text; struct buffer *b; - Fset_buffer (p->buffer); + Fset_buffer (PVAR (p, buffer)); opoint = PT; opoint_byte = PT_BYTE; old_read_only = BVAR (current_buffer, read_only); @@ -5250,9 +5252,11 @@ /* Insert new output into buffer at the current end-of-output marker, thus preserving logical ordering of input and output. */ - if (XMARKER (p->mark)->buffer) - SET_PT_BOTH (clip_to_bounds (BEGV, marker_position (p->mark), ZV), - clip_to_bounds (BEGV_BYTE, marker_byte_position (p->mark), + if (XMARKER (PVAR (p, mark))->buffer) + SET_PT_BOTH (clip_to_bounds (BEGV, + marker_position (PVAR (p, mark)), ZV), + clip_to_bounds (BEGV_BYTE, + marker_byte_position (PVAR (p, mark)), ZV_BYTE)); else SET_PT_BOTH (ZV, ZV_BYTE); @@ -5269,23 +5273,23 @@ Vlast_coding_system_used = CODING_ID_NAME (coding->id); /* A new coding system might be found. See the comment in the similar code in the previous `if' block. */ - if (!EQ (p->decode_coding_system, Vlast_coding_system_used)) + if (!EQ (PVAR (p, decode_coding_system), Vlast_coding_system_used)) { - p->decode_coding_system = Vlast_coding_system_used; - if (NILP (p->encode_coding_system) + PVAR (p, decode_coding_system) = Vlast_coding_system_used; + if (NILP (PVAR (p, encode_coding_system)) && proc_encode_coding_system[p->outfd]) { - p->encode_coding_system + PVAR (p, encode_coding_system) = coding_inherit_eol_type (Vlast_coding_system_used, Qnil); - setup_coding_system (p->encode_coding_system, + setup_coding_system (PVAR (p, encode_coding_system), proc_encode_coding_system[p->outfd]); } } if (coding->carryover_bytes > 0) { - if (SCHARS (p->decoding_buf) < coding->carryover_bytes) - p->decoding_buf = make_uninit_string (coding->carryover_bytes); - memcpy (SDATA (p->decoding_buf), coding->carryover, + if (SCHARS (PVAR (p, decoding_buf)) < coding->carryover_bytes) + PVAR (p, decoding_buf) = make_uninit_string (coding->carryover_bytes); + memcpy (SDATA (PVAR (p, decoding_buf)), coding->carryover, coding->carryover_bytes); p->decoding_carryover = coding->carryover_bytes; } @@ -5303,11 +5307,11 @@ /* Make sure the process marker's position is valid when the process buffer is changed in the signal_after_change above. W3 is known to do that. */ - if (BUFFERP (p->buffer) - && (b = XBUFFER (p->buffer), b != current_buffer)) - set_marker_both (p->mark, p->buffer, BUF_PT (b), BUF_PT_BYTE (b)); + if (BUFFERP (PVAR (p, buffer)) + && (b = XBUFFER (PVAR (p, buffer)), b != current_buffer)) + set_marker_both (PVAR (p, mark), PVAR (p, buffer), BUF_PT (b), BUF_PT_BYTE (b)); else - set_marker_both (p->mark, p->buffer, PT, PT_BYTE); + set_marker_both (PVAR (p, mark), PVAR (p, buffer), PT, PT_BYTE); update_mode_lines++; @@ -5401,9 +5405,9 @@ entry = Fcons (obj, Fcons (make_number (offset), make_number (len))); if (front) - p->write_queue = Fcons (entry, p->write_queue); + PVAR (p, write_queue) = Fcons (entry, PVAR (p, write_queue)); else - p->write_queue = nconc2 (p->write_queue, Fcons (entry, Qnil)); + PVAR (p, write_queue) = nconc2 (PVAR (p, write_queue), Fcons (entry, Qnil)); } /* Remove the first element in the write_queue of process P, put its @@ -5417,11 +5421,11 @@ Lisp_Object entry, offset_length; ptrdiff_t offset; - if (NILP (p->write_queue)) + if (NILP (PVAR (p, write_queue))) return 0; - entry = XCAR (p->write_queue); - p->write_queue = XCDR (p->write_queue); + entry = XCAR (PVAR (p, write_queue)); + PVAR (p, write_queue) = XCDR (PVAR (p, write_queue)); *obj = XCAR (entry); offset_length = XCDR (entry); @@ -5455,10 +5459,10 @@ if (p->raw_status_new) update_status (p); - if (! EQ (p->status, Qrun)) - error ("Process %s not running", SDATA (p->name)); + if (! EQ (PVAR (p, status), Qrun)) + error ("Process %s not running", SDATA (PVAR (p, name))); if (p->outfd < 0) - error ("Output file descriptor of %s is closed", SDATA (p->name)); + error ("Output file descriptor of %s is closed", SDATA (PVAR (p, name))); coding = proc_encode_coding_system[p->outfd]; Vlast_coding_system_used = CODING_ID_NAME (coding->id); @@ -5468,9 +5472,9 @@ && !NILP (BVAR (XBUFFER (object), enable_multibyte_characters))) || EQ (object, Qt)) { - p->encode_coding_system - = complement_process_encoding_system (p->encode_coding_system); - if (!EQ (Vlast_coding_system_used, p->encode_coding_system)) + PVAR (p, encode_coding_system) + = complement_process_encoding_system (PVAR (p, encode_coding_system)); + if (!EQ (Vlast_coding_system_used, PVAR (p, encode_coding_system))) { /* The coding system for encoding was changed to raw-text because we sent a unibyte text previously. Now we are @@ -5480,8 +5484,8 @@ Another reason we come here is that the coding system was just complemented and a new one was returned by complement_process_encoding_system. */ - setup_coding_system (p->encode_coding_system, coding); - Vlast_coding_system_used = p->encode_coding_system; + setup_coding_system (PVAR (p, encode_coding_system), coding); + Vlast_coding_system_used = PVAR (p, encode_coding_system); } coding->src_multibyte = 1; } @@ -5568,7 +5572,7 @@ /* If there is already data in the write_queue, put the new data in the back of queue. Otherwise, ignore it. */ - if (!NILP (p->write_queue)) + if (!NILP (PVAR (p, write_queue))) write_queue_push (p, object, buf, len, 0); do /* while !NILP (p->write_queue) */ @@ -5682,7 +5686,7 @@ cur_len -= written; } } - while (!NILP (p->write_queue)); + while (!NILP (PVAR (p, write_queue))); } else { @@ -5690,10 +5694,10 @@ proc = process_sent_to; p = XPROCESS (proc); p->raw_status_new = 0; - p->status = Fcons (Qexit, Fcons (make_number (256), Qnil)); + PVAR (p, status) = Fcons (Qexit, Fcons (make_number (256), Qnil)); p->tick = ++process_tick; deactivate_process (proc); - error ("SIGPIPE raised on process %s; closed it", SDATA (p->name)); + error ("SIGPIPE raised on process %s; closed it", SDATA (PVAR (p, name))); } } @@ -5751,12 +5755,12 @@ pid_t gid = -1; #ifdef TIOCGPGRP - if (ioctl (p->infd, TIOCGPGRP, &gid) == -1 && ! NILP (p->tty_name)) + if (ioctl (p->infd, TIOCGPGRP, &gid) == -1 && ! NILP (PVAR (p, tty_name))) { int fd; /* Some OS:es (Solaris 8/9) does not allow TIOCGPGRP from the master side. Try the slave side. */ - fd = emacs_open (SSDATA (p->tty_name), O_RDONLY, 0); + fd = emacs_open (SSDATA (PVAR (p, tty_name)), O_RDONLY, 0); if (fd != -1) { @@ -5785,12 +5789,12 @@ proc = get_process (process); p = XPROCESS (proc); - if (!EQ (p->type, Qreal)) + if (!EQ (PVAR (p, type), Qreal)) error ("Process %s is not a subprocess", - SDATA (p->name)); + SDATA (PVAR (p, name))); if (p->infd < 0) error ("Process %s is not active", - SDATA (p->name)); + SDATA (PVAR (p, name))); gid = emacs_get_tty_pgrp (p); @@ -5825,12 +5829,12 @@ proc = get_process (process); p = XPROCESS (proc); - if (!EQ (p->type, Qreal)) + if (!EQ (PVAR (p, type), Qreal)) error ("Process %s is not a subprocess", - SDATA (p->name)); + SDATA (PVAR (p, name))); if (p->infd < 0) error ("Process %s is not active", - SDATA (p->name)); + SDATA (PVAR (p, name))); if (!p->pty_flag) current_group = Qnil; @@ -5919,7 +5923,7 @@ #ifdef SIGCONT case SIGCONT: p->raw_status_new = 0; - p->status = Qrun; + PVAR (p, status) = Qrun; p->tick = ++process_tick; if (!nomsg) { @@ -6009,13 +6013,13 @@ struct Lisp_Process *p; p = XPROCESS (process); - if (NILP (p->command) + if (NILP (PVAR (p, command)) && p->infd >= 0) { FD_CLR (p->infd, &input_wait_mask); FD_CLR (p->infd, &non_keyboard_wait_mask); } - p->command = Qt; + PVAR (p, command) = Qt; return process; } #ifndef SIGTSTP @@ -6038,9 +6042,9 @@ struct Lisp_Process *p; p = XPROCESS (process); - if (EQ (p->command, Qt) + if (EQ (PVAR (p, command), Qt) && p->infd >= 0 - && (!EQ (p->filter, Qt) || EQ (p->status, Qlisten))) + && (!EQ (PVAR (p, filter), Qt) || EQ (PVAR (p, status), Qlisten))) { FD_SET (p->infd, &input_wait_mask); FD_SET (p->infd, &non_keyboard_wait_mask); @@ -6051,7 +6055,7 @@ tcflush (p->infd, TCIFLUSH); #endif /* not WINDOWSNT */ } - p->command = Qnil; + PVAR (p, command) = Qnil; return process; } #ifdef SIGCONT @@ -6098,7 +6102,8 @@ CHECK_PROCESS (process); pid = XPROCESS (process)->pid; if (pid <= 0) - error ("Cannot signal process %s", SDATA (XPROCESS (process)->name)); + error ("Cannot signal process %s", + SDATA (PVAR (XPROCESS (process), name))); } #define parse_signal(NAME, VALUE) \ @@ -6242,8 +6247,8 @@ /* Make sure the process is really alive. */ if (XPROCESS (proc)->raw_status_new) update_status (XPROCESS (proc)); - if (! EQ (XPROCESS (proc)->status, Qrun)) - error ("Process %s not running", SDATA (XPROCESS (proc)->name)); + if (! EQ (PVAR (XPROCESS (proc), status), Qrun)) + error ("Process %s not running", SDATA (PVAR (XPROCESS (proc), name))); if (CODING_REQUIRE_FLUSHING (coding)) { @@ -6253,7 +6258,7 @@ if (XPROCESS (proc)->pty_flag) send_process (proc, "\004", 1, Qnil); - else if (EQ (XPROCESS (proc)->type, Qserial)) + else if (EQ (PVAR (XPROCESS (proc), type), Qserial)) { #ifndef WINDOWSNT if (tcdrain (XPROCESS (proc)->outfd) != 0) @@ -6270,7 +6275,7 @@ for communication with the subprocess, call shutdown to cause EOF. (In some old system, shutdown to socketpair doesn't work. Then we just can't win.) */ - if (EQ (XPROCESS (proc)->type, Qnetwork) + if (EQ (PVAR (XPROCESS (proc), type), Qnetwork) || XPROCESS (proc)->outfd == XPROCESS (proc)->infd) shutdown (XPROCESS (proc)->outfd, 1); /* In case of socketpair, outfd == infd, so don't close it. */ @@ -6383,7 +6388,7 @@ { proc = XCDR (XCAR (tail)); p = XPROCESS (proc); - if (EQ (p->type, Qreal) && p->pid == pid) + if (EQ (PVAR (p, type), Qreal) && p->pid == pid) break; p = 0; } @@ -6467,7 +6472,7 @@ static Lisp_Object exec_sentinel_unwind (Lisp_Object data) { - XPROCESS (XCAR (data))->sentinel = XCDR (data); + PVAR (XPROCESS (XCAR (data)), sentinel) = XCDR (data); return Qnil; } @@ -6507,13 +6512,13 @@ friends don't expect current-buffer to be changed from under them. */ record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); - sentinel = p->sentinel; + sentinel = PVAR (p, sentinel); if (NILP (sentinel)) return; /* Zilch the sentinel while it's running, to avoid recursive invocations; assure that it gets restored no matter how the sentinel exits. */ - p->sentinel = Qnil; + PVAR (p, sentinel) = Qnil; record_unwind_protect (exec_sentinel_unwind, Fcons (proc, sentinel)); /* Inhibit quit so that random quits don't screw up a running filter. */ specbind (Qinhibit_quit, Qt); @@ -6601,16 +6606,16 @@ p->update_tick = p->tick; /* If process is still active, read any output that remains. */ - while (! EQ (p->filter, Qt) - && ! EQ (p->status, Qconnect) - && ! EQ (p->status, Qlisten) + while (! EQ (PVAR (p, filter), Qt) + && ! EQ (PVAR (p, status), Qconnect) + && ! EQ (PVAR (p, status), Qlisten) /* Network or serial process not stopped: */ - && ! EQ (p->command, Qt) + && ! EQ (PVAR (p, command), Qt) && p->infd >= 0 && p != deleting_process && read_process_output (proc, p->infd) > 0); - buffer = p->buffer; + buffer = PVAR (p, buffer); /* Get the text to use for the message. */ if (p->raw_status_new) @@ -6618,9 +6623,9 @@ msg = status_message (p); /* If process is terminated, deactivate it or delete it. */ - symbol = p->status; - if (CONSP (p->status)) - symbol = XCAR (p->status); + symbol = PVAR (p, status); + if (CONSP (PVAR (p, status))) + symbol = XCAR (PVAR (p, status)); if (EQ (symbol, Qsignal) || EQ (symbol, Qexit) || EQ (symbol, Qclosed)) @@ -6637,7 +6642,7 @@ this code to be run again. */ p->update_tick = p->tick; /* Now output the message suitably. */ - if (!NILP (p->sentinel)) + if (!NILP (PVAR (p, sentinel))) exec_sentinel (proc, msg); /* Don't bother with a message in the buffer when a process becomes runnable. */ @@ -6659,8 +6664,8 @@ /* Insert new output into buffer at the current end-of-output marker, thus preserving logical ordering of input and output. */ - if (XMARKER (p->mark)->buffer) - Fgoto_char (p->mark); + if (XMARKER (PVAR (p, mark))->buffer) + Fgoto_char (PVAR (p, mark)); else SET_PT_BOTH (ZV, ZV_BYTE); @@ -6670,11 +6675,11 @@ tem = BVAR (current_buffer, read_only); BVAR (current_buffer, read_only) = Qnil; insert_string ("\nProcess "); - Finsert (1, &p->name); + Finsert (1, &PVAR (p, name)); insert_string (" "); Finsert (1, &msg); BVAR (current_buffer, read_only) = tem; - set_marker_both (p->mark, p->buffer, PT, PT_BYTE); + set_marker_both (PVAR (p, mark), PVAR (p, buffer), PT, PT_BYTE); if (opoint >= before) SET_PT_BOTH (opoint + (PT - before), @@ -6704,14 +6709,14 @@ CHECK_PROCESS (process); p = XPROCESS (process); if (p->infd < 0) - error ("Input file descriptor of %s closed", SDATA (p->name)); + error ("Input file descriptor of %s closed", SDATA (PVAR (p, name))); if (p->outfd < 0) - error ("Output file descriptor of %s closed", SDATA (p->name)); + error ("Output file descriptor of %s closed", SDATA (PVAR (p, name))); Fcheck_coding_system (decoding); Fcheck_coding_system (encoding); encoding = coding_inherit_eol_type (encoding, Qnil); - p->decode_coding_system = decoding; - p->encode_coding_system = encoding; + PVAR (p, decode_coding_system) = decoding; + PVAR (p, encode_coding_system) = encoding; setup_process_coding_systems (process); return Qnil; @@ -6723,8 +6728,8 @@ (register Lisp_Object process) { CHECK_PROCESS (process); - return Fcons (XPROCESS (process)->decode_coding_system, - XPROCESS (process)->encode_coding_system); + return Fcons (PVAR (XPROCESS (process), decode_coding_system), + PVAR (XPROCESS (process), encode_coding_system)); } DEFUN ("set-process-filter-multibyte", Fset_process_filter_multibyte, @@ -6741,7 +6746,8 @@ CHECK_PROCESS (process); p = XPROCESS (process); if (NILP (flag)) - p->decode_coding_system = raw_text_coding_system (p->decode_coding_system); + PVAR (p, decode_coding_system) + = raw_text_coding_system (PVAR (p, decode_coding_system)); setup_process_coding_systems (process); return Qnil; @@ -7079,19 +7085,19 @@ if (!proc_decode_coding_system[inch]) proc_decode_coding_system[inch] = xmalloc (sizeof (struct coding_system)); - coding_system = p->decode_coding_system; - if (! NILP (p->filter)) + coding_system = PVAR (p, decode_coding_system); + if (! NILP (PVAR (p, filter))) ; - else if (BUFFERP (p->buffer)) + else if (BUFFERP (PVAR (p, buffer))) { - if (NILP (BVAR (XBUFFER (p->buffer), enable_multibyte_characters))) + if (NILP (BVAR (XBUFFER (PVAR (p, buffer)), enable_multibyte_characters))) coding_system = raw_text_coding_system (coding_system); } setup_coding_system (coding_system, proc_decode_coding_system[inch]); if (!proc_encode_coding_system[outch]) proc_encode_coding_system[outch] = xmalloc (sizeof (struct coding_system)); - setup_coding_system (p->encode_coding_system, + setup_coding_system (PVAR (p, encode_coding_system), proc_encode_coding_system[outch]); #endif } @@ -7137,7 +7143,7 @@ for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail)) { proc = Fcdr (XCAR (tail)); - if (PROCESSP (proc) && EQ (XPROCESS (proc)->buffer, buf)) + if (PROCESSP (proc) && EQ (PVAR (XPROCESS (proc), buffer), buf)) return proc; } #endif /* subprocesses */ @@ -7176,7 +7182,7 @@ { proc = XCDR (XCAR (tail)); if (PROCESSP (proc) - && (NILP (buffer) || EQ (XPROCESS (proc)->buffer, buffer))) + && (NILP (buffer) || EQ (PVAR (XPROCESS (proc), buffer), buffer))) { if (NETCONN_P (proc) || SERIALCONN_P (proc)) Fdelete_process (proc); === modified file 'src/process.h' --- src/process.h 2012-07-31 22:24:49 +0000 +++ src/process.h 2012-08-01 06:23:24 +0000 @@ -26,59 +26,78 @@ #include "gnutls.h" #endif +/* Most code should use this macro to access + Lisp fields in struct Lisp_Process. */ + +#define PVAR(w, field) ((w)->INTERNAL_FIELD (field)) + /* This structure records information about a subprocess - or network connection. - - Every field in this structure except for the header - must be a Lisp_Object, for GC's sake. */ + or network connection. */ struct Lisp_Process { struct vectorlike_header header; /* Name of subprocess terminal. */ - Lisp_Object tty_name; + Lisp_Object INTERNAL_FIELD (tty_name); + /* Name of this process */ - Lisp_Object name; + Lisp_Object INTERNAL_FIELD (name); + /* List of command arguments that this process was run with. Is set to t for a stopped network process; nil otherwise. */ - Lisp_Object command; + Lisp_Object INTERNAL_FIELD (command); + /* (funcall FILTER PROC STRING) (if FILTER is non-nil) to dispose of a bunch of chars from the process all at once */ - Lisp_Object filter; + Lisp_Object INTERNAL_FIELD (filter); + /* (funcall SENTINEL PROCESS) when process state changes */ - Lisp_Object sentinel; + Lisp_Object INTERNAL_FIELD (sentinel); + /* (funcall LOG SERVER CLIENT MESSAGE) when a server process accepts a connection from a client. */ - Lisp_Object log; + Lisp_Object INTERNAL_FIELD (log); + /* Buffer that output is going to */ - Lisp_Object buffer; + Lisp_Object INTERNAL_FIELD (buffer); + /* t if this is a real child process. For a network or serial connection, it is a plist based on the arguments to make-network-process or make-serial-process. */ - Lisp_Object childp; + + Lisp_Object INTERNAL_FIELD (childp); + /* Plist for programs to keep per-process state information, parameters, etc. */ - Lisp_Object plist; + Lisp_Object INTERNAL_FIELD (plist); + /* Symbol indicating the type of process: real, network, serial */ - Lisp_Object type; + Lisp_Object INTERNAL_FIELD (type); + /* Marker set to end of last buffer-inserted output from this process */ - Lisp_Object mark; + Lisp_Object INTERNAL_FIELD (mark); + /* Symbol indicating status of process. This may be a symbol: run, open, or closed. Or it may be a list, whose car is stop, exit or signal and whose cdr is a pair (EXIT_CODE . COREDUMP_FLAG) or (SIGNAL_NUMBER . COREDUMP_FLAG). */ - Lisp_Object status; + Lisp_Object INTERNAL_FIELD (status); + /* Coding-system for decoding the input from this process. */ - Lisp_Object decode_coding_system; + Lisp_Object INTERNAL_FIELD (decode_coding_system); + /* Working buffer for decoding. */ - Lisp_Object decoding_buf; + Lisp_Object INTERNAL_FIELD (decoding_buf); + /* Coding-system for encoding the output to this process. */ - Lisp_Object encode_coding_system; + Lisp_Object INTERNAL_FIELD (encode_coding_system); + /* Working buffer for encoding. */ - Lisp_Object encoding_buf; + Lisp_Object INTERNAL_FIELD (encoding_buf); + /* Queue for storing waiting writes */ - Lisp_Object write_queue; + Lisp_Object INTERNAL_FIELD (write_queue); #ifdef HAVE_GNUTLS Lisp_Object gnutls_cred_type; === modified file 'src/sysdep.c' --- src/sysdep.c 2012-07-20 07:29:04 +0000 +++ src/sysdep.c 2012-08-01 06:23:24 +0000 @@ -2156,7 +2156,7 @@ int err = -1; char summary[4] = "???"; /* This usually becomes "8N1". */ - childp2 = Fcopy_sequence (p->childp); + childp2 = Fcopy_sequence (PVAR (p, childp)); /* Read port attributes and prepare default configuration. */ err = tcgetattr (p->outfd, &attr); @@ -2174,7 +2174,7 @@ if (!NILP (Fplist_member (contact, QCspeed))) tem = Fplist_get (contact, QCspeed); else - tem = Fplist_get (p->childp, QCspeed); + tem = Fplist_get (PVAR (p, childp), QCspeed); CHECK_NUMBER (tem); err = cfsetspeed (&attr, XINT (tem)); if (err != 0) @@ -2186,7 +2186,7 @@ if (!NILP (Fplist_member (contact, QCbytesize))) tem = Fplist_get (contact, QCbytesize); else - tem = Fplist_get (p->childp, QCbytesize); + tem = Fplist_get (PVAR (p, childp), QCbytesize); if (NILP (tem)) tem = make_number (8); CHECK_NUMBER (tem); @@ -2207,7 +2207,7 @@ if (!NILP (Fplist_member (contact, QCparity))) tem = Fplist_get (contact, QCparity); else - tem = Fplist_get (p->childp, QCparity); + tem = Fplist_get (PVAR (p, childp), QCparity); if (!NILP (tem) && !EQ (tem, Qeven) && !EQ (tem, Qodd)) error (":parity must be nil (no parity), `even', or `odd'"); #if defined (PARENB) && defined (PARODD) && defined (IGNPAR) && defined (INPCK) @@ -2240,7 +2240,7 @@ if (!NILP (Fplist_member (contact, QCstopbits))) tem = Fplist_get (contact, QCstopbits); else - tem = Fplist_get (p->childp, QCstopbits); + tem = Fplist_get (PVAR (p, childp), QCstopbits); if (NILP (tem)) tem = make_number (1); CHECK_NUMBER (tem); @@ -2262,7 +2262,7 @@ if (!NILP (Fplist_member (contact, QCflowcontrol))) tem = Fplist_get (contact, QCflowcontrol); else - tem = Fplist_get (p->childp, QCflowcontrol); + tem = Fplist_get (PVAR (p, childp), QCflowcontrol); if (!NILP (tem) && !EQ (tem, Qhw) && !EQ (tem, Qsw)) error (":flowcontrol must be nil (no flowcontrol), `hw', or `sw'"); #if defined (CRTSCTS) @@ -2304,7 +2304,7 @@ error ("tcsetattr() failed: %s", emacs_strerror (errno)); childp2 = Fplist_put (childp2, QCsummary, build_string (summary)); - p->childp = childp2; + PVAR (p, childp) = childp2; } #endif /* not DOS_NT */ === modified file 'src/w32.c' --- src/w32.c 2012-07-29 16:22:27 +0000 +++ src/w32.c 2012-08-01 06:23:24 +0000 @@ -6144,7 +6144,7 @@ error ("Not a serial process"); hnd = fd_info[ p->outfd ].hnd; - childp2 = Fcopy_sequence (p->childp); + childp2 = Fcopy_sequence (PVAR (p, childp)); /* Initialize timeouts for blocking read and blocking write. */ if (!GetCommTimeouts (hnd, &ct)) @@ -6173,7 +6173,7 @@ if (!NILP (Fplist_member (contact, QCspeed))) tem = Fplist_get (contact, QCspeed); else - tem = Fplist_get (p->childp, QCspeed); + tem = Fplist_get (PVAR (p, childp), QCspeed); CHECK_NUMBER (tem); dcb.BaudRate = XINT (tem); childp2 = Fplist_put (childp2, QCspeed, tem); @@ -6182,7 +6182,7 @@ if (!NILP (Fplist_member (contact, QCbytesize))) tem = Fplist_get (contact, QCbytesize); else - tem = Fplist_get (p->childp, QCbytesize); + tem = Fplist_get (PVAR (p, childp), QCbytesize); if (NILP (tem)) tem = make_number (8); CHECK_NUMBER (tem); @@ -6196,7 +6196,7 @@ if (!NILP (Fplist_member (contact, QCparity))) tem = Fplist_get (contact, QCparity); else - tem = Fplist_get (p->childp, QCparity); + tem = Fplist_get (PVAR (p, childp), QCparity); if (!NILP (tem) && !EQ (tem, Qeven) && !EQ (tem, Qodd)) error (":parity must be nil (no parity), `even', or `odd'"); dcb.fParity = FALSE; @@ -6226,7 +6226,7 @@ if (!NILP (Fplist_member (contact, QCstopbits))) tem = Fplist_get (contact, QCstopbits); else - tem = Fplist_get (p->childp, QCstopbits); + tem = Fplist_get (PVAR (p, childp), QCstopbits); if (NILP (tem)) tem = make_number (1); CHECK_NUMBER (tem); @@ -6243,7 +6243,7 @@ if (!NILP (Fplist_member (contact, QCflowcontrol))) tem = Fplist_get (contact, QCflowcontrol); else - tem = Fplist_get (p->childp, QCflowcontrol); + tem = Fplist_get (PVAR (p, childp), QCflowcontrol); if (!NILP (tem) && !EQ (tem, Qhw) && !EQ (tem, Qsw)) error (":flowcontrol must be nil (no flowcontrol), `hw', or `sw'"); dcb.fOutxCtsFlow = FALSE; @@ -6277,7 +6277,7 @@ error ("SetCommState() failed"); childp2 = Fplist_put (childp2, QCsummary, build_string (summary)); - p->childp = childp2; + PVAR (p, childp) = childp2; } #ifdef HAVE_GNUTLS === modified file 'src/xdisp.c' --- src/xdisp.c 2012-08-01 05:11:36 +0000 +++ src/xdisp.c 2012-08-01 06:23:24 +0000 @@ -21678,10 +21678,10 @@ obj = Fget_buffer_process (Fcurrent_buffer ()); if (PROCESSP (obj)) { - p = decode_mode_spec_coding (XPROCESS (obj)->decode_coding_system, - p, eol_flag); - p = decode_mode_spec_coding (XPROCESS (obj)->encode_coding_system, - p, eol_flag); + p = decode_mode_spec_coding + (PVAR (XPROCESS (obj), decode_coding_system), p, eol_flag); + p = decode_mode_spec_coding + (PVAR (XPROCESS (obj), encode_coding_system), p, eol_flag); } #endif /* subprocesses */ #endif /* 0 */ ------------------------------------------------------------ revno: 109354 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2012-08-01 09:11:36 +0400 message: Use INTERNAL_FIELD for windows. * src/window.h (WVAR): New macro. (struct window): Change Lisp_Object members to INTERNAL_FIELD. * src/alloc.c, src/buffer.c, src/composite.c, src/dispextern.h: * src/dispnew.c, src/editfns.c, src/fileio.c, src/font.c, src/fontset.c: * src/frame.c, src/frame.h, src/fringe.c, src/indent.c, src/insdel.c: * src/keyboard.c, src/keymap.c, src/lisp.h, src/minibuf.c, src/nsterm.m: * src/print.c, src/textprop.c, src/w32fns.c, src/w32menu.c, src/w32term.c: * src/window.c, src/xdisp.c, src/xfaces.c, src/xfns.c, src/xmenu.c: * src/xterm.c: Users changed. * admin/coccinelle/window.cocci: Semantic patch to replace direct access to Lisp_Object members of struct window to WVAR. diff: === modified file 'admin/ChangeLog' --- admin/ChangeLog 2012-07-31 12:36:19 +0000 +++ admin/ChangeLog 2012-08-01 05:11:36 +0000 @@ -1,3 +1,8 @@ +2012-08-01 Dmitry Antipov + + * coccinelle/window.cocci: Semantic patch to replace direct + access to Lisp_Object members of struct window to WVAR. + 2012-07-31 Dmitry Antipov * coccinelle/frame.cocci: Semantic patch to replace direct === added file 'admin/coccinelle/window.cocci' --- admin/coccinelle/window.cocci 1970-01-01 00:00:00 +0000 +++ admin/coccinelle/window.cocci 2012-08-01 05:11:36 +0000 @@ -0,0 +1,242 @@ +// Change direct access to Lisp_Object fields of struct window to WVAR. +@@ +struct window *W; +Lisp_Object O; +@@ +( +- W->frame ++ WVAR (W, frame) +| +- W->next ++ WVAR (W, next) +| +- W->prev ++ WVAR (W, prev) +| +- W->hchild ++ WVAR (W, hchild) +| +- W->vchild ++ WVAR (W, vchild) +| +- W->parent ++ WVAR (W, parent) +| +- W->left_col ++ WVAR (W, left_col) +| +- W->top_line ++ WVAR (W, top_line) +| +- W->total_lines ++ WVAR (W, total_lines) +| +- W->total_cols ++ WVAR (W, total_cols) +| +- W->normal_lines ++ WVAR (W, normal_lines) +| +- W->normal_cols ++ WVAR (W, normal_cols) +| +- W->new_total ++ WVAR (W, new_total) +| +- W->new_normal ++ WVAR (W, new_normal) +| +- W->buffer ++ WVAR (W, buffer) +| +- W->start ++ WVAR (W, start) +| +- W->pointm ++ WVAR (W, pointm) +| +- W->temslot ++ WVAR (W, temslot) +| +- W->vertical_scroll_bar ++ WVAR (W, vertical_scroll_bar) +| +- W->left_margin_cols ++ WVAR (W, left_margin_cols) +| +- W->right_margin_cols ++ WVAR (W, right_margin_cols) +| +- W->left_fringe_width ++ WVAR (W, left_fringe_width) +| +- W->right_fringe_width ++ WVAR (W, right_fringe_width) +| +- W->scroll_bar_width ++ WVAR (W, scroll_bar_width) +| +- W->vertical_scroll_bar_type ++ WVAR (W, vertical_scroll_bar_type) +| +- W->window_end_pos ++ WVAR (W, window_end_pos) +| +- W->window_end_vpos ++ WVAR (W, window_end_vpos) +| +- W->window_end_valid ++ WVAR (W, window_end_valid) +| +- W->display_table ++ WVAR (W, display_table) +| +- W->dedicated ++ WVAR (W, dedicated) +| +- W->base_line_number ++ WVAR (W, base_line_number) +| +- W->base_line_pos ++ WVAR (W, base_line_pos) +| +- W->region_showing ++ WVAR (W, region_showing) +| +- W->column_number_displayed ++ WVAR (W, column_number_displayed) +| +- W->redisplay_end_trigger ++ WVAR (W, redisplay_end_trigger) +| +- W->combination_limit ++ WVAR (W, combination_limit) +| +- W->prev_buffers ++ WVAR (W, prev_buffers) +| +- W->next_buffers ++ WVAR (W, next_buffers) +| +- W->window_parameters ++ WVAR (W, window_parameters) + +| + +- XWINDOW (O)->frame ++ WVAR (XWINDOW (O), frame) +| +- XWINDOW (O)->next ++ WVAR (XWINDOW (O), next) +| +- XWINDOW (O)->prev ++ WVAR (XWINDOW (O), prev) +| +- XWINDOW (O)->hchild ++ WVAR (XWINDOW (O), hchild) +| +- XWINDOW (O)->vchild ++ WVAR (XWINDOW (O), vchild) +| +- XWINDOW (O)->parent ++ WVAR (XWINDOW (O), parent) +| +- XWINDOW (O)->left_col ++ WVAR (XWINDOW (O), left_col) +| +- XWINDOW (O)->top_line ++ WVAR (XWINDOW (O), top_line) +| +- XWINDOW (O)->total_lines ++ WVAR (XWINDOW (O), total_lines) +| +- XWINDOW (O)->total_cols ++ WVAR (XWINDOW (O), total_cols) +| +- XWINDOW (O)->normal_lines ++ WVAR (XWINDOW (O), normal_lines) +| +- XWINDOW (O)->normal_cols ++ WVAR (XWINDOW (O), normal_cols) +| +- XWINDOW (O)->new_total ++ WVAR (XWINDOW (O), new_total) +| +- XWINDOW (O)->new_normal ++ WVAR (XWINDOW (O), new_normal) +| +- XWINDOW (O)->buffer ++ WVAR (XWINDOW (O), buffer) +| +- XWINDOW (O)->start ++ WVAR (XWINDOW (O), start) +| +- XWINDOW (O)->pointm ++ WVAR (XWINDOW (O), pointm) +| +- XWINDOW (O)->temslot ++ WVAR (XWINDOW (O), temslot) +| +- XWINDOW (O)->vertical_scroll_bar ++ WVAR (XWINDOW (O), vertical_scroll_bar) +| +- XWINDOW (O)->left_margin_cols ++ WVAR (XWINDOW (O), left_margin_cols) +| +- XWINDOW (O)->right_margin_cols ++ WVAR (XWINDOW (O), right_margin_cols) +| +- XWINDOW (O)->left_fringe_width ++ WVAR (XWINDOW (O), left_fringe_width) +| +- XWINDOW (O)->right_fringe_width ++ WVAR (XWINDOW (O), right_fringe_width) +| +- XWINDOW (O)->scroll_bar_width ++ WVAR (XWINDOW (O), scroll_bar_width) +| +- XWINDOW (O)->vertical_scroll_bar_type ++ WVAR (XWINDOW (O), vertical_scroll_bar_type) +| +- XWINDOW (O)->window_end_pos ++ WVAR (XWINDOW (O), window_end_pos) +| +- XWINDOW (O)->window_end_vpos ++ WVAR (XWINDOW (O), window_end_vpos) +| +- XWINDOW (O)->window_end_valid ++ WVAR (XWINDOW (O), window_end_valid) +| +- XWINDOW (O)->display_table ++ WVAR (XWINDOW (O), display_table) +| +- XWINDOW (O)->dedicated ++ WVAR (XWINDOW (O), dedicated) +| +- XWINDOW (O)->base_line_number ++ WVAR (XWINDOW (O), base_line_number) +| +- XWINDOW (O)->base_line_pos ++ WVAR (XWINDOW (O), base_line_pos) +| +- XWINDOW (O)->region_showing ++ WVAR (XWINDOW (O), region_showing) +| +- XWINDOW (O)->column_number_displayed ++ WVAR (XWINDOW (O), column_number_displayed) +| +- XWINDOW (O)->redisplay_end_trigger ++ WVAR (XWINDOW (O), redisplay_end_trigger) +| +- XWINDOW (O)->combination_limit ++ WVAR (XWINDOW (O), combination_limit) +| +- XWINDOW (O)->prev_buffers ++ WVAR (XWINDOW (O), prev_buffers) +| +- XWINDOW (O)->next_buffers ++ WVAR (XWINDOW (O), next_buffers) +| +- XWINDOW (O)->window_parameters ++ WVAR (XWINDOW (O), window_parameters) +) === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-01 03:51:44 +0000 +++ src/ChangeLog 2012-08-01 05:11:36 +0000 @@ -1,3 +1,14 @@ +2012-08-01 Dmitry Antipov + + Use INTERNAL_FIELD for windows. + * window.h (WVAR): New macro. + (struct window): Change Lisp_Object members to INTERNAL_FIELD. + * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c: + * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c: + * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c: + * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c: + * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed. + 2012-08-01 Paul Eggert * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work. @@ -63,9 +74,9 @@ (KVAR): Change to use INTERNAL_FIELD. * frame.h (FVAR): New macro. (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields. - * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c - * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c - * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h, + * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c: + * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c: + * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h: * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed. 2012-07-31 Dmitry Antipov === modified file 'src/alloc.c' --- src/alloc.c 2012-07-31 12:36:19 +0000 +++ src/alloc.c 2012-08-01 05:11:36 +0000 @@ -6020,7 +6020,8 @@ /* 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 (NILP (WVAR (w, hchild)) && NILP (WVAR (w, vchild)) + && w->current_matrix) { mark_glyph_matrix (w->current_matrix); mark_glyph_matrix (w->desired_matrix); === modified file 'src/buffer.c' --- src/buffer.c 2012-07-31 12:36:19 +0000 +++ src/buffer.c 2012-08-01 05:11:36 +0000 @@ -1557,7 +1557,7 @@ since anything can happen within do_yes_or_no_p. */ /* Don't kill the minibuffer now current. */ - if (EQ (buffer, XWINDOW (minibuf_window)->buffer)) + if (EQ (buffer, WVAR (XWINDOW (minibuf_window), buffer))) return Qnil; /* When we kill an ordinary buffer which shares it's buffer text @@ -1608,7 +1608,7 @@ /* If the buffer now current is shown in the minibuffer and our buffer is the sole other buffer give up. */ XSETBUFFER (tem, current_buffer); - if (EQ (tem, XWINDOW (minibuf_window)->buffer) + if (EQ (tem, WVAR (XWINDOW (minibuf_window), buffer)) && EQ (buffer, Fother_buffer (buffer, Qnil, Qnil))) return Qnil; @@ -2190,12 +2190,13 @@ while (NILP (Fmemq (w, ws))) { ws = Fcons (w, ws); - if (MARKERP (XWINDOW (w)->pointm) - && (EQ (XWINDOW (w)->buffer, buf1) - || EQ (XWINDOW (w)->buffer, buf2))) - Fset_marker (XWINDOW (w)->pointm, - make_number (BUF_BEGV (XBUFFER (XWINDOW (w)->buffer))), - XWINDOW (w)->buffer); + if (MARKERP (WVAR (XWINDOW (w), pointm)) + && (EQ (WVAR (XWINDOW (w), buffer), buf1) + || EQ (WVAR (XWINDOW (w), buffer), buf2))) + Fset_marker (WVAR (XWINDOW (w), pointm), + make_number + (BUF_BEGV (XBUFFER (WVAR (XWINDOW (w), buffer)))), + WVAR (XWINDOW (w), buffer)); w = Fnext_window (w, Qt, Qt); } } @@ -3671,7 +3672,7 @@ /* If this is a buffer not in the selected window, we must do other windows. */ - if (buf != XBUFFER (XWINDOW (selected_window)->buffer)) + if (buf != XBUFFER (WVAR (XWINDOW (selected_window), buffer))) windows_or_buffers_changed = 1; /* If multiple windows show this buffer, we must do other windows. */ else if (buffer_shared > 1) === modified file 'src/composite.c' --- src/composite.c 2012-07-30 06:43:46 +0000 +++ src/composite.c 2012-08-01 05:11:36 +0000 @@ -906,7 +906,7 @@ autocmp_chars (Lisp_Object rule, ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t limit, struct window *win, struct face *face, Lisp_Object string) { ptrdiff_t count = SPECPDL_INDEX (); - FRAME_PTR f = XFRAME (win->frame); + FRAME_PTR f = XFRAME (WVAR (win, frame)); Lisp_Object pos = make_number (charpos); ptrdiff_t to; ptrdiff_t pt = PT, pt_byte = PT_BYTE; @@ -942,7 +942,7 @@ } else #endif /* not HAVE_WINDOW_SYSTEM */ - font_object = win->frame; + font_object = WVAR (win, frame); lgstring = Fcomposition_get_gstring (pos, make_number (to), font_object, string); if (NILP (LGSTRING_ID (lgstring))) === modified file 'src/dispextern.h' --- src/dispextern.h 2012-07-13 03:50:58 +0000 +++ src/dispextern.h 2012-08-01 05:11:36 +0000 @@ -1374,7 +1374,7 @@ ? current_mode_line_height \ : (MATRIX_MODE_LINE_HEIGHT ((W)->current_matrix) \ ? MATRIX_MODE_LINE_HEIGHT ((W)->current_matrix) \ - : estimate_mode_line_height (XFRAME ((W)->frame), \ + : estimate_mode_line_height (XFRAME (WVAR (W, frame)), \ CURRENT_MODE_LINE_FACE_ID (W)))) /* Return the current height of the header line of window W. If not @@ -1387,7 +1387,7 @@ ? current_header_line_height \ : (MATRIX_HEADER_LINE_HEIGHT ((W)->current_matrix) \ ? MATRIX_HEADER_LINE_HEIGHT ((W)->current_matrix) \ - : estimate_mode_line_height (XFRAME ((W)->frame), \ + : estimate_mode_line_height (XFRAME (WVAR (W, frame)),\ HEADER_LINE_FACE_ID))) /* Return the height of the desired mode line of window W. */ @@ -1406,8 +1406,8 @@ (!MINI_WINDOW_P ((W)) \ && !(W)->pseudo_window_p \ && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \ - && BUFFERP ((W)->buffer) \ - && !NILP (BVAR (XBUFFER ((W)->buffer), mode_line_format)) \ + && BUFFERP (WVAR (W, buffer)) \ + && !NILP (BVAR (XBUFFER (WVAR (W, buffer)), mode_line_format)) \ && WINDOW_TOTAL_LINES (W) > 1) /* Value is non-zero if window W wants a header line. */ @@ -1416,9 +1416,10 @@ (!MINI_WINDOW_P ((W)) \ && !(W)->pseudo_window_p \ && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \ - && BUFFERP ((W)->buffer) \ - && !NILP (BVAR (XBUFFER ((W)->buffer), header_line_format)) \ - && WINDOW_TOTAL_LINES (W) > 1 + !NILP (BVAR (XBUFFER ((W)->buffer), mode_line_format))) + && BUFFERP (WVAR (W, buffer)) \ + && !NILP (BVAR (XBUFFER (WVAR (W, buffer)), header_line_format)) \ + && WINDOW_TOTAL_LINES (W) > 1 \ + + !NILP (BVAR (XBUFFER (WVAR (W, buffer)), mode_line_format))) /* Return proper value to be used as baseline offset of font that has === modified file 'src/dispnew.c' --- src/dispnew.c 2012-07-31 12:36:19 +0000 +++ src/dispnew.c 2012-08-01 05:11:36 +0000 @@ -265,9 +265,9 @@ "%"pMu": window %p (`%s')%s\n%s", history_tick++, w, - ((BUFFERP (w->buffer) - && STRINGP (BVAR (XBUFFER (w->buffer), name))) - ? SSDATA (BVAR (XBUFFER (w->buffer), name)) + ((BUFFERP (WVAR (w, buffer)) + && STRINGP (BVAR (XBUFFER (WVAR (w, buffer)), name))) + ? SSDATA (BVAR (XBUFFER (WVAR (w, buffer)), name)) : "???"), paused_p ? " ***paused***" : "", msg); @@ -405,7 +405,7 @@ if (NUMBERP (margin)) { - int width = XFASTINT (w->total_cols); + int width = XFASTINT (WVAR (w, total_cols)); double d = max (0, XFLOATINT (margin)); d = min (width / 2 - 1, d); n = (int) ((double) total_glyphs / width * d); @@ -475,8 +475,8 @@ the matrix means preventing redisplay. */ if (matrix->pool == NULL) { - left = margin_glyphs_to_reserve (w, dim.width, w->left_margin_cols); - right = margin_glyphs_to_reserve (w, dim.width, w->right_margin_cols); + left = margin_glyphs_to_reserve (w, dim.width, WVAR (w, left_margin_cols)); + right = margin_glyphs_to_reserve (w, dim.width, WVAR (w, right_margin_cols)); eassert (left >= 0 && right >= 0); marginal_areas_changed_p = (left != matrix->left_margin_glyphs || right != matrix->right_margin_glyphs); @@ -515,9 +515,9 @@ if (w) { left = margin_glyphs_to_reserve (w, dim.width, - w->left_margin_cols); + WVAR (w, left_margin_cols)); right = margin_glyphs_to_reserve (w, dim.width, - w->right_margin_cols); + WVAR (w, right_margin_cols)); } else left = right = 0; @@ -640,9 +640,9 @@ /* Window end is invalid, if inside of the rows that are invalidated below. */ - if (INTEGERP (w->window_end_vpos) - && XFASTINT (w->window_end_vpos) >= i) - w->window_end_valid = Qnil; + if (INTEGERP (WVAR (w, window_end_vpos)) + && XFASTINT (WVAR (w, window_end_vpos)) >= i) + WVAR (w, window_end_valid) = Qnil; while (i < matrix->nrows) matrix->rows[i++].enabled_p = 0; @@ -882,15 +882,15 @@ { while (w) { - if (!NILP (w->hchild)) + if (!NILP (WVAR (w, hchild))) { - eassert (WINDOWP (w->hchild)); - clear_window_matrices (XWINDOW (w->hchild), desired_p); + eassert (WINDOWP (WVAR (w, hchild))); + clear_window_matrices (XWINDOW (WVAR (w, hchild)), desired_p); } - else if (!NILP (w->vchild)) + else if (!NILP (WVAR (w, vchild))) { - eassert (WINDOWP (w->vchild)); - clear_window_matrices (XWINDOW (w->vchild), desired_p); + eassert (WINDOWP (WVAR (w, vchild))); + clear_window_matrices (XWINDOW (WVAR (w, vchild)), desired_p); } else { @@ -899,11 +899,11 @@ else { clear_glyph_matrix (w->current_matrix); - w->window_end_valid = Qnil; + WVAR (w, window_end_valid) = Qnil; } } - w = NILP (w->next) ? 0 : XWINDOW (w->next); + w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); } } @@ -967,7 +967,7 @@ clear_glyph_row (row); row->y = y; row->ascent = row->phys_ascent = 0; - row->height = row->phys_height = FRAME_LINE_HEIGHT (XFRAME (w->frame)); + row->height = row->phys_height = FRAME_LINE_HEIGHT (XFRAME (WVAR (w, frame))); row->visible_height = row->height; if (row->y < min_y) @@ -1513,7 +1513,7 @@ struct glyph_row *row = matrix->rows; struct glyph_row *last_text_row = NULL; struct buffer *saved = current_buffer; - struct buffer *buffer = XBUFFER (w->buffer); + struct buffer *buffer = XBUFFER (WVAR (w, buffer)); int c; /* This can sometimes happen for a fresh window. */ @@ -1676,8 +1676,8 @@ points to the mini-buffer window, if any, which is arranged vertically below other windows. */ in_horz_combination_p - = (!NILP (XWINDOW (window)->parent) - && !NILP (XWINDOW (XWINDOW (window)->parent)->hchild)); + = (!NILP (WVAR (XWINDOW (window), parent)) + && !NILP (WVAR (XWINDOW (WVAR (XWINDOW (window), parent)), hchild))); /* For WINDOW and all windows on the same level. */ do @@ -1686,12 +1686,12 @@ /* Get the dimension of the window sub-matrix for W, depending on whether this is a combination or a leaf window. */ - if (!NILP (w->hchild)) - dim = allocate_matrices_for_frame_redisplay (w->hchild, x, y, + if (!NILP (WVAR (w, hchild))) + dim = allocate_matrices_for_frame_redisplay (WVAR (w, hchild), x, y, dim_only_p, window_change_flags); - else if (!NILP (w->vchild)) - dim = allocate_matrices_for_frame_redisplay (w->vchild, x, y, + else if (!NILP (WVAR (w, vchild))) + dim = allocate_matrices_for_frame_redisplay (WVAR (w, vchild), x, y, dim_only_p, window_change_flags); else @@ -1715,10 +1715,10 @@ || dim.width != w->desired_matrix->matrix_w || dim.height != w->desired_matrix->matrix_h || (margin_glyphs_to_reserve (w, dim.width, - w->left_margin_cols) + WVAR (w, left_margin_cols)) != w->desired_matrix->left_margin_glyphs) || (margin_glyphs_to_reserve (w, dim.width, - w->right_margin_cols) + WVAR (w, right_margin_cols)) != w->desired_matrix->right_margin_glyphs)) *window_change_flags |= CHANGED_LEAF_MATRIX; @@ -1747,7 +1747,7 @@ hmax = max (hmax, dim.height); /* Next window on same level. */ - window = w->next; + window = WVAR (w, next); } while (!NILP (window)); @@ -1778,7 +1778,7 @@ required_matrix_height (struct window *w) { #ifdef HAVE_WINDOW_SYSTEM - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); if (FRAME_WINDOW_P (f)) { @@ -1804,7 +1804,7 @@ required_matrix_width (struct window *w) { #ifdef HAVE_WINDOW_SYSTEM - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); if (FRAME_WINDOW_P (f)) { int ch_width = FRAME_SMALLEST_CHAR_WIDTH (f); @@ -1821,7 +1821,7 @@ } #endif /* HAVE_WINDOW_SYSTEM */ - return XINT (w->total_cols); + return XINT (WVAR (w, total_cols)); } @@ -1833,10 +1833,10 @@ { while (w) { - if (!NILP (w->vchild)) - allocate_matrices_for_window_redisplay (XWINDOW (w->vchild)); - else if (!NILP (w->hchild)) - allocate_matrices_for_window_redisplay (XWINDOW (w->hchild)); + if (!NILP (WVAR (w, vchild))) + allocate_matrices_for_window_redisplay (XWINDOW (WVAR (w, vchild))); + else if (!NILP (WVAR (w, hchild))) + allocate_matrices_for_window_redisplay (XWINDOW (WVAR (w, hchild))); else { /* W is a leaf window. */ @@ -1855,7 +1855,7 @@ adjust_glyph_matrix (w, w->current_matrix, 0, 0, dim); } - w = NILP (w->next) ? NULL : XWINDOW (w->next); + w = NILP (WVAR (w, next)) ? NULL : XWINDOW (WVAR (w, next)); } } @@ -1902,20 +1902,20 @@ { struct frame *sf = SELECTED_FRAME (); struct window *root = XWINDOW (FVAR (sf, root_window)); - struct window *mini = XWINDOW (root->next); + struct window *mini = XWINDOW (WVAR (root, next)); int frame_lines = FRAME_LINES (sf); int frame_cols = FRAME_COLS (sf); int top_margin = FRAME_TOP_MARGIN (sf); /* Do it for the root window. */ - XSETFASTINT (root->top_line, top_margin); - XSETFASTINT (root->total_lines, frame_lines - 1 - top_margin); - XSETFASTINT (root->total_cols, frame_cols); + XSETFASTINT (WVAR (root, top_line), top_margin); + XSETFASTINT (WVAR (root, total_lines), frame_lines - 1 - top_margin); + XSETFASTINT (WVAR (root, total_cols), frame_cols); /* Do it for the mini-buffer window. */ - XSETFASTINT (mini->top_line, frame_lines - 1); - XSETFASTINT (mini->total_lines, 1); - XSETFASTINT (mini->total_cols, frame_cols); + XSETFASTINT (WVAR (mini, top_line), frame_lines - 1); + XSETFASTINT (WVAR (mini, total_lines), 1); + XSETFASTINT (WVAR (mini, total_cols), frame_cols); adjust_frame_glyphs (sf); glyphs_initialized_initially_p = 1; @@ -1947,21 +1947,21 @@ { while (w) { - if (!NILP (w->hchild)) - { - if (showing_window_margins_p (XWINDOW (w->hchild))) - return 1; - } - else if (!NILP (w->vchild)) - { - if (showing_window_margins_p (XWINDOW (w->vchild))) - return 1; - } - else if (!NILP (w->left_margin_cols) - || !NILP (w->right_margin_cols)) + if (!NILP (WVAR (w, hchild))) + { + if (showing_window_margins_p (XWINDOW (WVAR (w, hchild)))) + return 1; + } + else if (!NILP (WVAR (w, vchild))) + { + if (showing_window_margins_p (XWINDOW (WVAR (w, vchild)))) + return 1; + } + else if (!NILP (WVAR (w, left_margin_cols)) + || !NILP (WVAR (w, right_margin_cols))) return 1; - w = NILP (w->next) ? 0 : XWINDOW (w->next); + w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); } return 0; } @@ -1975,18 +1975,18 @@ { struct window *w; - for (; !NILP (window); window = w->next) + for (; !NILP (window); window = WVAR (w, next)) { w = XWINDOW (window); - if (!NILP (w->hchild)) - fake_current_matrices (w->hchild); - else if (!NILP (w->vchild)) - fake_current_matrices (w->vchild); + if (!NILP (WVAR (w, hchild))) + fake_current_matrices (WVAR (w, hchild)); + else if (!NILP (WVAR (w, vchild))) + fake_current_matrices (WVAR (w, vchild)); else { int i; - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); struct glyph_matrix *m = w->current_matrix; struct glyph_matrix *fm = f->current_matrix; @@ -2188,7 +2188,7 @@ { FVAR (f, menu_bar_window) = make_window (); w = XWINDOW (FVAR (f, menu_bar_window)); - XSETFRAME (w->frame, f); + XSETFRAME (WVAR (w, frame), f); w->pseudo_window_p = 1; } else @@ -2196,10 +2196,10 @@ /* Set window dimensions to frame dimensions and allocate or adjust glyph matrices of W. */ - XSETFASTINT (w->top_line, 0); - XSETFASTINT (w->left_col, 0); - XSETFASTINT (w->total_lines, FRAME_MENU_BAR_LINES (f)); - XSETFASTINT (w->total_cols, FRAME_TOTAL_COLS (f)); + XSETFASTINT (WVAR (w, top_line), 0); + XSETFASTINT (WVAR (w, left_col), 0); + XSETFASTINT (WVAR (w, total_lines), FRAME_MENU_BAR_LINES (f)); + XSETFASTINT (WVAR (w, total_cols), FRAME_TOTAL_COLS (f)); allocate_matrices_for_window_redisplay (w); } #endif /* not USE_X_TOOLKIT && not USE_GTK */ @@ -2214,16 +2214,16 @@ { FVAR (f, tool_bar_window) = make_window (); w = XWINDOW (FVAR (f, tool_bar_window)); - XSETFRAME (w->frame, f); + XSETFRAME (WVAR (w, frame), f); w->pseudo_window_p = 1; } else w = XWINDOW (FVAR (f, tool_bar_window)); - XSETFASTINT (w->top_line, FRAME_MENU_BAR_LINES (f)); - XSETFASTINT (w->left_col, 0); - XSETFASTINT (w->total_lines, FRAME_TOOL_BAR_LINES (f)); - XSETFASTINT (w->total_cols, FRAME_TOTAL_COLS (f)); + XSETFASTINT (WVAR (w, top_line), FRAME_MENU_BAR_LINES (f)); + XSETFASTINT (WVAR (w, left_col), 0); + XSETFASTINT (WVAR (w, total_lines), FRAME_TOOL_BAR_LINES (f)); + XSETFASTINT (WVAR (w, total_cols), FRAME_TOTAL_COLS (f)); allocate_matrices_for_window_redisplay (w); } #endif @@ -2333,10 +2333,10 @@ { while (w) { - if (!NILP (w->hchild)) - free_window_matrices (XWINDOW (w->hchild)); - else if (!NILP (w->vchild)) - free_window_matrices (XWINDOW (w->vchild)); + if (!NILP (WVAR (w, hchild))) + free_window_matrices (XWINDOW (WVAR (w, hchild))); + else if (!NILP (WVAR (w, vchild))) + free_window_matrices (XWINDOW (WVAR (w, vchild))); else { /* This is a leaf window. Free its memory and reset fields @@ -2348,7 +2348,7 @@ } /* Next window on same level. */ - w = NILP (w->next) ? 0 : XWINDOW (w->next); + w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); } } @@ -2469,14 +2469,14 @@ { while (w) { - if (!NILP (w->hchild)) - build_frame_matrix_from_window_tree (matrix, XWINDOW (w->hchild)); - else if (!NILP (w->vchild)) - build_frame_matrix_from_window_tree (matrix, XWINDOW (w->vchild)); + if (!NILP (WVAR (w, hchild))) + build_frame_matrix_from_window_tree (matrix, XWINDOW (WVAR (w, hchild))); + else if (!NILP (WVAR (w, vchild))) + build_frame_matrix_from_window_tree (matrix, XWINDOW (WVAR (w, vchild))); else build_frame_matrix_from_leaf_window (matrix, w); - w = NILP (w->next) ? 0 : XWINDOW (w->next); + w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); } } @@ -2615,7 +2615,7 @@ /* Convert the glyph's specified face to a realized (cache) face. */ if (lface_id > 0) { - int face_id = merge_faces (XFRAME (w->frame), + int face_id = merge_faces (XFRAME (WVAR (w, frame)), Qt, lface_id, DEFAULT_FACE_ID); SET_GLYPH_FACE (*glyph, face_id); } @@ -2736,10 +2736,10 @@ { while (w) { - if (!NILP (w->hchild)) - mirror_make_current (XWINDOW (w->hchild), frame_row); - else if (!NILP (w->vchild)) - mirror_make_current (XWINDOW (w->vchild), frame_row); + if (!NILP (WVAR (w, hchild))) + mirror_make_current (XWINDOW (WVAR (w, hchild)), frame_row); + else if (!NILP (WVAR (w, vchild))) + mirror_make_current (XWINDOW (WVAR (w, vchild)), frame_row); else { /* Row relative to window W. Don't use FRAME_TO_WINDOW_VPOS @@ -2772,7 +2772,7 @@ } } - w = NILP (w->next) ? 0 : XWINDOW (w->next); + w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); } } @@ -2831,16 +2831,16 @@ static void sync_window_with_frame_matrix_rows (struct window *w) { - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); struct glyph_row *window_row, *window_row_end, *frame_row; int left, right, x, width; /* Preconditions: W must be a leaf window on a tty frame. */ - eassert (NILP (w->hchild) && NILP (w->vchild)); + eassert (NILP (WVAR (w, hchild)) && NILP (WVAR (w, vchild))); eassert (!FRAME_WINDOW_P (f)); - left = margin_glyphs_to_reserve (w, 1, w->left_margin_cols); - right = margin_glyphs_to_reserve (w, 1, w->right_margin_cols); + left = margin_glyphs_to_reserve (w, 1, WVAR (w, left_margin_cols)); + right = margin_glyphs_to_reserve (w, 1, WVAR (w, right_margin_cols)); x = w->current_matrix->matrix_x; width = w->current_matrix->matrix_w; @@ -2872,15 +2872,15 @@ while (w && !found) { - if (!NILP (w->hchild)) - found = frame_row_to_window (XWINDOW (w->hchild), row); - else if (!NILP (w->vchild)) - found = frame_row_to_window (XWINDOW (w->vchild), row); + if (!NILP (WVAR (w, hchild))) + found = frame_row_to_window (XWINDOW (WVAR (w, hchild)), row); + else if (!NILP (WVAR (w, vchild))) + found = frame_row_to_window (XWINDOW (WVAR (w, vchild)), row); else if (row >= WINDOW_TOP_EDGE_LINE (w) && row < WINDOW_BOTTOM_EDGE_LINE (w)) found = w; - w = NILP (w->next) ? 0 : XWINDOW (w->next); + w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); } return found; @@ -2903,11 +2903,11 @@ { while (w) { - if (!NILP (w->hchild)) - mirror_line_dance (XWINDOW (w->hchild), unchanged_at_top, + if (!NILP (WVAR (w, hchild))) + mirror_line_dance (XWINDOW (WVAR (w, hchild)), unchanged_at_top, nlines, copy_from, retained_p); - else if (!NILP (w->vchild)) - mirror_line_dance (XWINDOW (w->vchild), unchanged_at_top, + else if (!NILP (WVAR (w, vchild))) + mirror_line_dance (XWINDOW (WVAR (w, vchild)), unchanged_at_top, nlines, copy_from, retained_p); else { @@ -2963,7 +2963,7 @@ { /* A copy between windows. This is an infrequent case not worth optimizing. */ - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); struct window *root = XWINDOW (FRAME_ROOT_WINDOW (f)); struct window *w2; struct glyph_matrix *m2; @@ -3000,7 +3000,7 @@ } /* Next window on same level. */ - w = NILP (w->next) ? 0 : XWINDOW (w->next); + w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); } } @@ -3018,18 +3018,18 @@ { while (w) { - if (!NILP (w->hchild)) - check_window_matrix_pointers (XWINDOW (w->hchild)); - else if (!NILP (w->vchild)) - check_window_matrix_pointers (XWINDOW (w->vchild)); + if (!NILP (WVAR (w, hchild))) + check_window_matrix_pointers (XWINDOW (WVAR (w, hchild))); + else if (!NILP (WVAR (w, vchild))) + check_window_matrix_pointers (XWINDOW (WVAR (w, vchild))); else { - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); check_matrix_pointers (w->desired_matrix, f->desired_matrix); check_matrix_pointers (w->current_matrix, f->current_matrix); } - w = NILP (w->next) ? 0 : XWINDOW (w->next); + w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); } } @@ -3077,10 +3077,10 @@ static int window_to_frame_vpos (struct window *w, int vpos) { - eassert (!FRAME_WINDOW_P (XFRAME (w->frame))); + eassert (!FRAME_WINDOW_P (XFRAME (WVAR (w, frame)))); eassert (vpos >= 0 && vpos <= w->desired_matrix->nrows); vpos += WINDOW_TOP_EDGE_LINE (w); - eassert (vpos >= 0 && vpos <= FRAME_LINES (XFRAME (w->frame))); + eassert (vpos >= 0 && vpos <= FRAME_LINES (XFRAME (WVAR (w, frame)))); return vpos; } @@ -3091,7 +3091,7 @@ static int window_to_frame_hpos (struct window *w, int hpos) { - eassert (!FRAME_WINDOW_P (XFRAME (w->frame))); + eassert (!FRAME_WINDOW_P (XFRAME (WVAR (w, frame)))); hpos += WINDOW_LEFT_EDGE_COL (w); return hpos; } @@ -3311,14 +3311,14 @@ while (w && !paused_p) { - if (!NILP (w->hchild)) - paused_p |= update_window_tree (XWINDOW (w->hchild), force_p); - else if (!NILP (w->vchild)) - paused_p |= update_window_tree (XWINDOW (w->vchild), force_p); + if (!NILP (WVAR (w, hchild))) + paused_p |= update_window_tree (XWINDOW (WVAR (w, hchild)), force_p); + else if (!NILP (WVAR (w, vchild))) + paused_p |= update_window_tree (XWINDOW (WVAR (w, vchild)), force_p); else if (w->must_be_updated_p) paused_p |= update_window (w, force_p); - w = NILP (w->next) ? 0 : XWINDOW (w->next); + w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); } return paused_p; @@ -3806,7 +3806,7 @@ struct glyph *glyph = ¤t_row->glyphs[TEXT_AREA][i - 1]; int left, right; - rif->get_glyph_overhangs (glyph, XFRAME (w->frame), + rif->get_glyph_overhangs (glyph, XFRAME (WVAR (w, frame)), &left, &right); can_skip_p = (right == 0 && !abort_skipping); } @@ -3838,7 +3838,8 @@ { int left, right; - rif->get_glyph_overhangs (current_glyph, XFRAME (w->frame), + rif->get_glyph_overhangs (current_glyph, + XFRAME (WVAR (w, frame)), &left, &right); while (left > 0 && i > 0) { @@ -3981,7 +3982,7 @@ /* Update display of the left margin area, if there is one. */ if (!desired_row->full_width_p - && !NILP (w->left_margin_cols)) + && !NILP (WVAR (w, left_margin_cols))) { changed_p = 1; update_marginal_area (w, LEFT_MARGIN_AREA, vpos); @@ -3997,7 +3998,7 @@ /* Update display of the right margin area, if there is one. */ if (!desired_row->full_width_p - && !NILP (w->right_margin_cols)) + && !NILP (WVAR (w, right_margin_cols))) { changed_p = 1; update_marginal_area (w, RIGHT_MARGIN_AREA, vpos); @@ -4030,7 +4031,7 @@ static void set_window_cursor_after_update (struct window *w) { - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); struct redisplay_interface *rif = FRAME_RIF (f); int cx, cy, vpos, hpos; @@ -4116,14 +4117,14 @@ { while (w) { - if (!NILP (w->hchild)) - set_window_update_flags (XWINDOW (w->hchild), on_p); - else if (!NILP (w->vchild)) - set_window_update_flags (XWINDOW (w->vchild), on_p); + if (!NILP (WVAR (w, hchild))) + set_window_update_flags (XWINDOW (WVAR (w, hchild)), on_p); + else if (!NILP (WVAR (w, vchild))) + set_window_update_flags (XWINDOW (WVAR (w, vchild)), on_p); else w->must_be_updated_p = on_p; - w = NILP (w->next) ? 0 : XWINDOW (w->next); + w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); } } @@ -4806,8 +4807,8 @@ int x = WINDOW_TO_FRAME_HPOS (w, w->cursor.hpos); int y = WINDOW_TO_FRAME_VPOS (w, w->cursor.vpos); - if (INTEGERP (w->left_margin_cols)) - x += XFASTINT (w->left_margin_cols); + if (INTEGERP (WVAR (w, left_margin_cols))) + x += XFASTINT (WVAR (w, left_margin_cols)); /* x = max (min (x, FRAME_TOTAL_COLS (f) - 1), 0); */ cursor_to (f, y, x); @@ -5297,9 +5298,9 @@ /* We used to set current_buffer directly here, but that does the wrong thing with `face-remapping-alist' (bug#2044). */ - Fset_buffer (w->buffer); + Fset_buffer (WVAR (w, buffer)); itdata = bidi_shelve_cache (); - SET_TEXT_POS_FROM_MARKER (startp, w->start); + SET_TEXT_POS_FROM_MARKER (startp, WVAR (w, start)); CHARPOS (startp) = min (ZV, max (BEGV, CHARPOS (startp))); BYTEPOS (startp) = min (ZV_BYTE, max (BEGV_BYTE, BYTEPOS (startp))); start_display (&it, w, startp); @@ -5343,7 +5344,7 @@ *dx = x0 + it.first_visible_x - it.current_x; *dy = *y - it.current_y; - string = w->buffer; + string = WVAR (w, buffer); if (STRINGP (it.string)) string = it.string; *pos = it.current; @@ -5361,7 +5362,7 @@ if (STRINGP (it.string)) BYTEPOS (pos->pos) = string_char_to_byte (string, CHARPOS (pos->pos)); else - BYTEPOS (pos->pos) = buf_charpos_to_bytepos (XBUFFER (w->buffer), + BYTEPOS (pos->pos) = buf_charpos_to_bytepos (XBUFFER (WVAR (w, buffer)), CHARPOS (pos->pos)); } @@ -5761,7 +5762,7 @@ FrameCols (FRAME_TTY (f)) = newwidth; if (WINDOWP (FVAR (f, tool_bar_window))) - XSETFASTINT (XWINDOW (FVAR (f, tool_bar_window))->total_cols, newwidth); + XSETFASTINT (WVAR (XWINDOW (FVAR (f, tool_bar_window)), total_cols), newwidth); } FRAME_LINES (f) = newheight; === modified file 'src/editfns.c' --- src/editfns.c 2012-07-31 22:24:49 +0000 +++ src/editfns.c 2012-08-01 05:11:36 +0000 @@ -366,7 +366,7 @@ if (NILP (object)) XSETBUFFER (object, current_buffer); else if (WINDOWP (object)) - object = XWINDOW (object)->buffer; + object = WVAR (XWINDOW (object), buffer); if (!BUFFERP (object)) /* pos-property only makes sense in buffers right now, since strings @@ -821,7 +821,7 @@ Lisp_Object save_excursion_save (void) { - int visible = (XBUFFER (XWINDOW (selected_window)->buffer) + int visible = (XBUFFER (WVAR (XWINDOW (selected_window), buffer)) == current_buffer); return Fcons (Fpoint_marker (), @@ -874,7 +874,7 @@ and cleaner never to alter the window/buffer connections. */ tem1 = Fcar (tem); if (!NILP (tem1) - && current_buffer != XBUFFER (XWINDOW (selected_window)->buffer)) + && current_buffer != XBUFFER (WVAR (XWINDOW (selected_window), buffer))) Fswitch_to_buffer (Fcurrent_buffer (), Qnil); #endif /* 0 */ @@ -907,7 +907,7 @@ tem = XCDR (info); if (visible_p && !EQ (tem, selected_window) - && (tem1 = XWINDOW (tem)->buffer, + && (tem1 = WVAR (XWINDOW (tem), buffer), (/* Window is live... */ BUFFERP (tem1) /* ...and it shows the current buffer. */ === modified file 'src/fileio.c' --- src/fileio.c 2012-07-20 07:29:04 +0000 +++ src/fileio.c 2012-08-01 05:11:36 +0000 @@ -3731,7 +3731,7 @@ /* If display currently starts at beginning of line, keep it that way. */ - if (XBUFFER (XWINDOW (selected_window)->buffer) == current_buffer) + if (XBUFFER (WVAR (XWINDOW (selected_window), buffer)) == current_buffer) XWINDOW (selected_window)->start_at_line_beg = !NILP (Fbolp ()); replace_handled = 1; @@ -3888,7 +3888,7 @@ /* If display currently starts at beginning of line, keep it that way. */ - if (XBUFFER (XWINDOW (selected_window)->buffer) == current_buffer) + if (XBUFFER (WVAR (XWINDOW (selected_window), buffer)) == current_buffer) XWINDOW (selected_window)->start_at_line_beg = !NILP (Fbolp ()); /* Replace the chars that we need to replace, === modified file 'src/font.c' --- src/font.c 2012-07-20 07:29:04 +0000 +++ src/font.c 2012-08-01 05:11:36 +0000 @@ -3665,7 +3665,7 @@ } } - f = XFRAME (w->frame); + f = XFRAME (WVAR (w, frame)); if (! FRAME_WINDOW_P (f)) return Qnil; if (! face) @@ -3723,7 +3723,7 @@ face_id = face_at_buffer_position (w, pos, 0, 0, &ignore, *limit, 0, -1); - face = FACE_FROM_ID (XFRAME (w->frame), face_id); + face = FACE_FROM_ID (XFRAME (WVAR (w, frame)), face_id); } } else === modified file 'src/fontset.c' --- src/fontset.c 2012-07-31 16:59:55 +0000 +++ src/fontset.c 2012-08-01 05:11:36 +0000 @@ -1841,7 +1841,7 @@ if (NILP (window)) return Qnil; w = XWINDOW (window); - f = XFRAME (w->frame); + f = XFRAME (WVAR (w, frame)); face_id = face_at_buffer_position (w, pos, -1, -1, &dummy, pos + 100, 0, -1); } === modified file 'src/frame.c' --- src/frame.c 2012-07-31 12:36:19 +0000 +++ src/frame.c 2012-08-01 05:11:36 +0000 @@ -132,15 +132,15 @@ struct window *w = XWINDOW (window); w->last_modified = 0; - XSETFASTINT (w->top_line, XFASTINT (w->top_line) + n); - XSETFASTINT (w->total_lines, XFASTINT (w->total_lines) - n); + XSETFASTINT (WVAR (w, top_line), XFASTINT (WVAR (w, top_line)) + n); + XSETFASTINT (WVAR (w, total_lines), XFASTINT (WVAR (w, total_lines)) - n); /* Handle just the top child in a vertical split. */ - if (!NILP (w->vchild)) - set_menu_bar_lines_1 (w->vchild, n); + if (!NILP (WVAR (w, vchild))) + set_menu_bar_lines_1 (WVAR (w, vchild), n); /* Adjust all children in a horizontal split. */ - for (window = w->hchild; !NILP (window); window = w->next) + for (window = WVAR (w, hchild); !NILP (window); window = WVAR (w, next)) { w = XWINDOW (window); set_menu_bar_lines_1 (window, n); @@ -289,20 +289,20 @@ if (mini_p) { mini_window = make_window (); - XWINDOW (root_window)->next = mini_window; - XWINDOW (mini_window)->prev = root_window; + WVAR (XWINDOW (root_window), next) = mini_window; + WVAR (XWINDOW (mini_window), prev) = root_window; XWINDOW (mini_window)->mini = 1; - XWINDOW (mini_window)->frame = frame; + WVAR (XWINDOW (mini_window), frame) = frame; FVAR (f, minibuffer_window) = mini_window; } else { mini_window = Qnil; - XWINDOW (root_window)->next = Qnil; + WVAR (XWINDOW (root_window), next) = Qnil; FVAR (f, minibuffer_window) = Qnil; } - XWINDOW (root_window)->frame = frame; + WVAR (XWINDOW (root_window), frame) = frame; /* 10 is arbitrary, just so that there is "something there." @@ -311,21 +311,21 @@ SET_FRAME_COLS (f, 10); FRAME_LINES (f) = 10; - XSETFASTINT (XWINDOW (root_window)->total_cols, 10); - XSETFASTINT (XWINDOW (root_window)->total_lines, (mini_p ? 9 : 10)); + XSETFASTINT (WVAR (XWINDOW (root_window), total_cols), 10); + XSETFASTINT (WVAR (XWINDOW (root_window), total_lines), (mini_p ? 9 : 10)); if (mini_p) { - XSETFASTINT (XWINDOW (mini_window)->total_cols, 10); - XSETFASTINT (XWINDOW (mini_window)->top_line, 9); - XSETFASTINT (XWINDOW (mini_window)->total_lines, 1); + XSETFASTINT (WVAR (XWINDOW (mini_window), total_cols), 10); + XSETFASTINT (WVAR (XWINDOW (mini_window), top_line), 9); + XSETFASTINT (WVAR (XWINDOW (mini_window), total_lines), 1); } /* Choose a buffer for the frame's root window. */ { Lisp_Object buf; - XWINDOW (root_window)->buffer = Qt; + WVAR (XWINDOW (root_window), buffer) = Qt; buf = Fcurrent_buffer (); /* If buf is a 'hidden' buffer (i.e. one whose name starts with a space), try to find another one. */ @@ -344,7 +344,7 @@ if (mini_p) { - XWINDOW (mini_window)->buffer = Qt; + WVAR (XWINDOW (mini_window), buffer) = Qt; set_window_buffer (mini_window, (NILP (Vminibuffer_list) ? get_minibuffer (0) @@ -376,7 +376,7 @@ CHECK_LIVE_WINDOW (mini_window); if (!NILP (mini_window) - && FRAME_KBOARD (XFRAME (XWINDOW (mini_window)->frame)) != kb) + && FRAME_KBOARD (XFRAME (WVAR (XWINDOW (mini_window), frame))) != kb) error ("Frame and minibuffer must be on the same terminal"); /* Make a frame containing just a root window. */ @@ -406,7 +406,7 @@ /* Make the chosen minibuffer window display the proper minibuffer, unless it is already showing a minibuffer. */ - if (NILP (Fmemq (XWINDOW (mini_window)->buffer, Vminibuffer_list))) + if (NILP (Fmemq (WVAR (XWINDOW (mini_window), buffer), Vminibuffer_list))) Fset_window_buffer (mini_window, (NILP (Vminibuffer_list) ? get_minibuffer (0) @@ -439,9 +439,9 @@ mini_window = FVAR (f, minibuffer_window) = FVAR (f, root_window); XWINDOW (mini_window)->mini = 1; - XWINDOW (mini_window)->next = Qnil; - XWINDOW (mini_window)->prev = Qnil; - XWINDOW (mini_window)->frame = frame; + WVAR (XWINDOW (mini_window), next) = Qnil; + WVAR (XWINDOW (mini_window), prev) = Qnil; + WVAR (XWINDOW (mini_window), frame) = frame; /* Put the proper buffer in that window. */ @@ -1241,7 +1241,7 @@ if (EQ (FVAR (f, minibuffer_window), minibuf_window)) { Fset_window_buffer (FVAR (sf, minibuffer_window), - XWINDOW (minibuf_window)->buffer, Qnil); + WVAR (XWINDOW (minibuf_window), buffer), Qnil); minibuf_window = FVAR (sf, minibuffer_window); /* If the dying minibuffer window was selected, @@ -1672,17 +1672,17 @@ { struct window *w; - for (;!NILP (window); window = w->next) + for (;!NILP (window); window = WVAR (w, next)) { w = XWINDOW (window); - if (!NILP (w->buffer)) - BVAR (XBUFFER (w->buffer), display_time) = Fcurrent_time (); + if (!NILP (WVAR (w, buffer))) + BVAR (XBUFFER (WVAR (w, buffer)), display_time) = Fcurrent_time (); - if (!NILP (w->vchild)) - make_frame_visible_1 (w->vchild); - if (!NILP (w->hchild)) - make_frame_visible_1 (w->hchild); + if (!NILP (WVAR (w, vchild))) + make_frame_visible_1 (WVAR (w, vchild)); + if (!NILP (WVAR (w, hchild))) + make_frame_visible_1 (WVAR (w, hchild)); } } @@ -1714,7 +1714,7 @@ { struct frame *sf = XFRAME (selected_frame); Fset_window_buffer (FVAR (sf, minibuffer_window), - XWINDOW (minibuf_window)->buffer, Qnil); + WVAR (XWINDOW (minibuf_window), buffer), Qnil); minibuf_window = FVAR (sf, minibuffer_window); } @@ -1752,7 +1752,7 @@ { struct frame *sf = XFRAME (selected_frame); Fset_window_buffer (FVAR (sf, minibuffer_window), - XWINDOW (minibuf_window)->buffer, Qnil); + WVAR (XWINDOW (minibuf_window), buffer), Qnil); minibuf_window = FVAR (sf, minibuffer_window); } === modified file 'src/frame.h' --- src/frame.h 2012-07-31 12:36:19 +0000 +++ src/frame.h 2012-08-01 05:11:36 +0000 @@ -511,7 +511,7 @@ #define XSETFRAME(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_FRAME)) /* Given a window, return its frame as a Lisp_Object. */ -#define WINDOW_FRAME(w) (w)->frame +#define WINDOW_FRAME(w) WVAR (w, frame) /* Test a frame for particular kinds of display methods. */ #define FRAME_INITIAL_P(f) ((f)->output_method == output_initial) === modified file 'src/fringe.c' --- src/fringe.c 2012-07-31 12:36:19 +0000 +++ src/fringe.c 2012-08-01 05:11:36 +0000 @@ -692,7 +692,7 @@ { Lisp_Object cmap, bm = Qnil; - if ((cmap = BVAR (XBUFFER (w->buffer), fringe_cursor_alist)), !NILP (cmap)) + if ((cmap = BVAR (XBUFFER (WVAR (w, buffer)), fringe_cursor_alist)), !NILP (cmap)) { bm = Fassq (cursor, cmap); if (CONSP (bm)) @@ -729,7 +729,7 @@ If partial, lookup partial bitmap in default value if not found here. If not partial, or no partial spec is present, use non-partial bitmap. */ - if ((cmap = BVAR (XBUFFER (w->buffer), fringe_indicator_alist)), !NILP (cmap)) + if ((cmap = BVAR (XBUFFER (WVAR (w, buffer)), fringe_indicator_alist)), !NILP (cmap)) { bm1 = Fassq (bitmap, cmap); if (CONSP (bm1)) @@ -956,7 +956,7 @@ return 0; if (!MINI_WINDOW_P (w) - && (ind = BVAR (XBUFFER (w->buffer), indicate_buffer_boundaries), !NILP (ind))) + && (ind = BVAR (XBUFFER (WVAR (w, buffer)), indicate_buffer_boundaries), !NILP (ind))) { if (EQ (ind, Qleft) || EQ (ind, Qright)) boundary_top = boundary_bot = arrow_top = arrow_bot = ind; @@ -997,7 +997,7 @@ { if (top_ind_rn < 0 && row->visible_height > 0) { - if (MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (w->buffer)) + if (MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (WVAR (w, buffer))) && !MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P (w, row)) row->indicate_bob_p = !NILP (boundary_top); else @@ -1007,7 +1007,7 @@ if (bot_ind_rn < 0) { - if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->buffer)) + if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (WVAR (w, buffer))) && !MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P (w, row)) row->indicate_eob_p = !NILP (boundary_bot), bot_ind_rn = rn; else if (y + row->height >= yb) @@ -1017,7 +1017,7 @@ } } - empty_pos = BVAR (XBUFFER (w->buffer), indicate_empty_lines); + empty_pos = BVAR (XBUFFER (WVAR (w, buffer)), indicate_empty_lines); if (!NILP (empty_pos) && !EQ (empty_pos, Qright)) empty_pos = WINDOW_LEFT_FRINGE_WIDTH (w) == 0 ? Qright : Qleft; @@ -1740,7 +1740,7 @@ else if (w == XWINDOW (selected_window)) textpos = PT; else - textpos = XMARKER (w->pointm)->charpos; + textpos = XMARKER (WVAR (w, pointm))->charpos; row = MATRIX_FIRST_TEXT_ROW (w->current_matrix); row = row_containing_pos (w, textpos, row, NULL, 0); === modified file 'src/indent.c' --- src/indent.c 2012-07-31 05:07:03 +0000 +++ src/indent.c 2012-08-01 05:11:36 +0000 @@ -258,7 +258,7 @@ the next property change */ prop = Fget_char_property (position, Qinvisible, (!NILP (window) - && EQ (XWINDOW (window)->buffer, buffer)) + && EQ (WVAR (XWINDOW (window), buffer), buffer)) ? window : buffer); inv_p = TEXT_PROP_MEANS_INVISIBLE (prop); /* When counting columns (window == nil), don't skip over ellipsis text. */ @@ -1173,14 +1173,14 @@ width = window_body_cols (win); /* We must make room for continuation marks if we don't have fringes. */ #ifdef HAVE_WINDOW_SYSTEM - if (!FRAME_WINDOW_P (XFRAME (win->frame))) + if (!FRAME_WINDOW_P (XFRAME (WVAR (win, frame)))) #endif width -= 1; } continuation_glyph_width = 1; #ifdef HAVE_WINDOW_SYSTEM - if (FRAME_WINDOW_P (XFRAME (win->frame))) + if (FRAME_WINDOW_P (XFRAME (WVAR (win, frame)))) continuation_glyph_width = 0; /* In the fringe. */ #endif @@ -1787,7 +1787,7 @@ ? (window_body_cols (w) - ( #ifdef HAVE_WINDOW_SYSTEM - FRAME_WINDOW_P (XFRAME (w->frame)) ? 0 : + FRAME_WINDOW_P (XFRAME (WVAR (w, frame))) ? 0 : #endif 1)) : XINT (XCAR (topos))), @@ -1837,7 +1837,7 @@ /* If the window contains this buffer, use it for getting text properties. Otherwise use the current buffer as arg for doing that. */ - if (EQ (w->buffer, Fcurrent_buffer ())) + if (EQ (WVAR (w, buffer), Fcurrent_buffer ())) text_prop_object = window; else text_prop_object = Fcurrent_buffer (); @@ -1998,15 +1998,15 @@ old_buffer = Qnil; GCPRO3 (old_buffer, old_charpos, old_bytepos); - if (XBUFFER (w->buffer) != current_buffer) + if (XBUFFER (WVAR (w, buffer)) != current_buffer) { /* Set the window's buffer temporarily to the current buffer. */ - old_buffer = w->buffer; - old_charpos = XMARKER (w->pointm)->charpos; - old_bytepos = XMARKER (w->pointm)->bytepos; - XSETBUFFER (w->buffer, current_buffer); - set_marker_both - (w->pointm, w->buffer, BUF_PT (current_buffer), BUF_PT_BYTE (current_buffer)); + old_buffer = WVAR (w, buffer); + old_charpos = XMARKER (WVAR (w, pointm))->charpos; + old_bytepos = XMARKER (WVAR (w, pointm))->bytepos; + XSETBUFFER (WVAR (w, buffer), current_buffer); + set_marker_both (WVAR (w, pointm), WVAR (w, buffer), + BUF_PT (current_buffer), BUF_PT_BYTE (current_buffer)); } if (noninteractive) @@ -2137,7 +2137,7 @@ } move_it_in_display_line (&it, ZV, - (int)(cols * FRAME_COLUMN_WIDTH (XFRAME (w->frame)) + 0.5), + (int)(cols * FRAME_COLUMN_WIDTH (XFRAME (WVAR (w, frame))) + 0.5), MOVE_TO_X); } @@ -2147,8 +2147,9 @@ if (BUFFERP (old_buffer)) { - w->buffer = old_buffer; - set_marker_both (w->pointm, w->buffer, old_charpos, old_bytepos); + WVAR (w, buffer) = old_buffer; + set_marker_both (WVAR (w, pointm), WVAR (w, buffer), + old_charpos, old_bytepos); } RETURN_UNGCPRO (make_number (it.vpos)); === modified file 'src/insdel.c' --- src/insdel.c 2012-07-29 11:20:43 +0000 +++ src/insdel.c 2012-08-01 05:11:36 +0000 @@ -1820,7 +1820,7 @@ /* Let redisplay consider other windows than selected_window if modifying another buffer. */ - if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer) + if (XBUFFER (WVAR (XWINDOW (selected_window), buffer)) != current_buffer) ++windows_or_buffers_changed; if (BUF_INTERVALS (current_buffer) != 0) === modified file 'src/keyboard.c' --- src/keyboard.c 2012-07-30 18:56:42 +0000 +++ src/keyboard.c 2012-08-01 05:11:36 +0000 @@ -800,7 +800,7 @@ update_mode_lines = 1; if (command_loop_level - && current_buffer != XBUFFER (XWINDOW (selected_window)->buffer)) + && current_buffer != XBUFFER (WVAR (XWINDOW (selected_window), buffer))) buffer = Fcurrent_buffer (); else buffer = Qnil; @@ -1382,8 +1382,8 @@ Fkill_emacs (Qnil); /* Make sure the current window's buffer is selected. */ - if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer) - set_buffer_internal (XBUFFER (XWINDOW (selected_window)->buffer)); + if (XBUFFER (WVAR (XWINDOW (selected_window), buffer)) != current_buffer) + set_buffer_internal (XBUFFER (WVAR (XWINDOW (selected_window), buffer))); /* Display any malloc warning that just came out. Use while because displaying one warning can cause another. */ @@ -1452,8 +1452,8 @@ /* A filter may have run while we were reading the input. */ if (! FRAME_LIVE_P (XFRAME (selected_frame))) Fkill_emacs (Qnil); - if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer) - set_buffer_internal (XBUFFER (XWINDOW (selected_window)->buffer)); + if (XBUFFER (WVAR (XWINDOW (selected_window), buffer)) != current_buffer) + set_buffer_internal (XBUFFER (WVAR (XWINDOW (selected_window), buffer))); ++num_input_keys; @@ -1484,7 +1484,7 @@ { struct buffer *b; XWINDOW (selected_window)->force_start = 0; - b = XBUFFER (XWINDOW (selected_window)->buffer); + b = XBUFFER (WVAR (XWINDOW (selected_window), buffer)); BUF_BEG_UNCHANGED (b) = BUF_END_UNCHANGED (b) = 0; } @@ -5174,8 +5174,8 @@ if (STRINGP (string)) string_info = Fcons (string, make_number (charpos)); textpos = (w == XWINDOW (selected_window) - && current_buffer == XBUFFER (w->buffer)) - ? PT : XMARKER (w->pointm)->charpos; + && current_buffer == XBUFFER (WVAR (w, buffer))) + ? PT : XMARKER (WVAR (w, pointm))->charpos; xret = wx; yret = wy; @@ -5563,7 +5563,7 @@ int fuzz; if (WINDOWP (event->frame_or_window)) - f = XFRAME (XWINDOW (event->frame_or_window)->frame); + f = XFRAME (WVAR (XWINDOW (event->frame_or_window), frame)); else if (FRAMEP (event->frame_or_window)) f = XFRAME (event->frame_or_window); else @@ -5731,7 +5731,7 @@ int is_double; if (WINDOWP (event->frame_or_window)) - fr = XFRAME (XWINDOW (event->frame_or_window)->frame); + fr = XFRAME (WVAR (XWINDOW (event->frame_or_window), frame)); else if (FRAMEP (event->frame_or_window)) fr = XFRAME (event->frame_or_window); else @@ -9395,8 +9395,8 @@ { if (! FRAME_LIVE_P (XFRAME (selected_frame))) Fkill_emacs (Qnil); - if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer) - Fset_buffer (XWINDOW (selected_window)->buffer); + if (XBUFFER (WVAR (XWINDOW (selected_window), buffer)) != current_buffer) + Fset_buffer (WVAR (XWINDOW (selected_window), buffer)); } orig_local_map = get_local_map (PT, current_buffer, Qlocal_map); @@ -9488,8 +9488,8 @@ not the current buffer. If we're at the beginning of a key sequence, switch buffers. */ if (WINDOWP (window) - && BUFFERP (XWINDOW (window)->buffer) - && XBUFFER (XWINDOW (window)->buffer) != current_buffer) + && BUFFERP (WVAR (XWINDOW (window), buffer)) + && XBUFFER (WVAR (XWINDOW (window), buffer)) != current_buffer) { ASET (raw_keybuf, raw_keybuf_count, key); raw_keybuf_count++; @@ -9510,7 +9510,7 @@ if (! FRAME_LIVE_P (XFRAME (selected_frame))) Fkill_emacs (Qnil); - set_buffer_internal (XBUFFER (XWINDOW (window)->buffer)); + set_buffer_internal (XBUFFER (WVAR (XWINDOW (window), buffer))); orig_local_map = get_local_map (PT, current_buffer, Qlocal_map); orig_keymap = get_local_map (PT, current_buffer, @@ -11194,7 +11194,7 @@ ? window_box_left_offset (w, TEXT_AREA) : 0))); XSETINT (y, WINDOW_TO_FRAME_PIXEL_Y (w, XINT (y))); - frame_or_window = w->frame; + frame_or_window = WVAR (w, frame); } CHECK_LIVE_FRAME (frame_or_window); === modified file 'src/keymap.c' --- src/keymap.c 2012-07-30 07:45:58 +0000 +++ src/keymap.c 2012-08-01 05:11:36 +0000 @@ -1560,8 +1560,8 @@ window = POSN_WINDOW (position); if (WINDOWP (window) - && BUFFERP (XWINDOW (window)->buffer) - && XBUFFER (XWINDOW (window)->buffer) != current_buffer) + && BUFFERP (WVAR (XWINDOW (window), buffer)) + && XBUFFER (WVAR (XWINDOW (window), buffer)) != current_buffer) { /* Arrange to go back to the original buffer once we're done processing the key sequence. We don't use @@ -1573,7 +1573,7 @@ record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); - set_buffer_internal (XBUFFER (XWINDOW (window)->buffer)); + set_buffer_internal (XBUFFER (WVAR (XWINDOW (window), buffer))); } } === modified file 'src/lisp.h' --- src/lisp.h 2012-08-01 01:43:08 +0000 +++ src/lisp.h 2012-08-01 05:11:36 +0000 @@ -1748,7 +1748,8 @@ vchild, and hchild members are all nil. */ #define CHECK_LIVE_WINDOW(x) \ - CHECK_TYPE (WINDOWP (x) && !NILP (XWINDOW (x)->buffer), Qwindow_live_p, x) + CHECK_TYPE (WINDOWP (x) && !NILP (WVAR (XWINDOW (x), buffer)), \ + Qwindow_live_p, x) #define CHECK_PROCESS(x) \ CHECK_TYPE (PROCESSP (x), Qprocessp, x) === modified file 'src/minibuf.c' --- src/minibuf.c 2012-07-31 12:36:19 +0000 +++ src/minibuf.c 2012-08-01 05:11:36 +0000 @@ -115,7 +115,7 @@ /* Under X, we come here with minibuf_window being the minibuffer window of the unused termcap window created in init_window_once. That window doesn't have a buffer. */ - buffer = XWINDOW (minibuf_window)->buffer; + buffer = WVAR (XWINDOW (minibuf_window), buffer); if (BUFFERP (buffer)) Fset_window_buffer (FVAR (sf, minibuffer_window), buffer, Qnil); minibuf_window = FVAR (sf, minibuffer_window); @@ -612,7 +612,7 @@ FOR_EACH_FRAME (dummy, frame) { Lisp_Object root_window = Fframe_root_window (frame); - Lisp_Object mini_window = XWINDOW (root_window)->next; + Lisp_Object mini_window = WVAR (XWINDOW (root_window), next); if (! NILP (mini_window) && ! EQ (mini_window, minibuf_window) && !NILP (Fwindow_minibuffer_p (mini_window))) @@ -687,7 +687,7 @@ XWINDOW (minibuf_window)->must_be_updated_p = 1; update_frame (XFRAME (selected_frame), 1, 1); { - struct frame *f = XFRAME (XWINDOW (minibuf_window)->frame); + struct frame *f = XFRAME (WVAR (XWINDOW (minibuf_window), frame)); struct redisplay_interface *rif = FRAME_RIF (f); if (rif && rif->flush_display) rif->flush_display (f); @@ -844,7 +844,7 @@ window = minibuf_window; /* To keep things predictable, in case it matters, let's be in the minibuffer when we reset the relevant variables. */ - Fset_buffer (XWINDOW (window)->buffer); + Fset_buffer (WVAR (XWINDOW (window), buffer)); /* Restore prompt, etc, from outer minibuffer level. */ minibuf_prompt = Fcar (minibuf_save_list); === modified file 'src/nsterm.m' --- src/nsterm.m 2012-07-31 16:19:03 +0000 +++ src/nsterm.m 2012-08-01 05:11:36 +0000 @@ -669,7 +669,7 @@ external (RIF) call; for one window called before update_end -------------------------------------------------------------------------- */ { - Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WVAR (w, frame))); /* note: this fn is nearly identical in all terms */ if (!w->pseudo_window_p) @@ -2037,7 +2037,7 @@ External (RIF): Insert or delete n lines at line vpos -------------------------------------------------------------------------- */ { - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); int x, y, width, height, from_y, to_y, bottom_y; NSTRACE (ns_scroll_run); @@ -2116,7 +2116,7 @@ full-width rows stays visible in the internal border. Under NS this is drawn inside the fringes. */ if (windows_or_buffers_changed - && (f = XFRAME (w->frame), + && (f = XFRAME (WVAR (w, frame)), width = FRAME_INTERNAL_BORDER_WIDTH (f), width != 0) && (height = desired_row->visible_height, === modified file 'src/print.c' --- src/print.c 2012-07-31 12:36:19 +0000 +++ src/print.c 2012-08-01 05:11:36 +0000 @@ -1775,10 +1775,11 @@ strout ("#sequence_number); strout (buf, len, len, printcharfun); - if (!NILP (XWINDOW (obj)->buffer)) + if (!NILP (WVAR (XWINDOW (obj), buffer))) { strout (" on ", -1, -1, printcharfun); - print_string (BVAR (XBUFFER (XWINDOW (obj)->buffer), name), printcharfun); + print_string (BVAR (XBUFFER (WVAR (XWINDOW (obj), buffer)), name), + printcharfun); } PRINTCHAR ('>'); } === modified file 'src/textprop.c' --- src/textprop.c 2012-07-17 09:12:24 +0000 +++ src/textprop.c 2012-08-01 05:11:36 +0000 @@ -587,7 +587,7 @@ if (WINDOWP (object)) { w = XWINDOW (object); - object = w->buffer; + object = WVAR (w, buffer); } if (BUFFERP (object)) { === modified file 'src/w32fns.c' --- src/w32fns.c 2012-07-31 12:36:19 +0000 +++ src/w32fns.c 2012-08-01 05:11:36 +0000 @@ -5617,7 +5617,7 @@ /* Set up the frame's root window. */ w = XWINDOW (FRAME_ROOT_WINDOW (f)); - w->left_col = w->top_line = make_number (0); + WVAR (w, left_col) = WVAR (w, top_line) = make_number (0); if (CONSP (Vx_max_tooltip_size) && INTEGERP (XCAR (Vx_max_tooltip_size)) @@ -5625,22 +5625,22 @@ && INTEGERP (XCDR (Vx_max_tooltip_size)) && XINT (XCDR (Vx_max_tooltip_size)) > 0) { - w->total_cols = XCAR (Vx_max_tooltip_size); - w->total_lines = XCDR (Vx_max_tooltip_size); + WVAR (w, total_cols) = XCAR (Vx_max_tooltip_size); + WVAR (w, total_lines) = XCDR (Vx_max_tooltip_size); } else { - w->total_cols = make_number (80); - w->total_lines = make_number (40); + WVAR (w, total_cols) = make_number (80); + WVAR (w, total_lines) = make_number (40); } - FRAME_TOTAL_COLS (f) = XINT (w->total_cols); + FRAME_TOTAL_COLS (f) = XINT (WVAR (w, total_cols)); adjust_glyphs (f); w->pseudo_window_p = 1; /* Display the tooltip text in a temporary buffer. */ old_buffer = current_buffer; - set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer)); + set_buffer_internal_1 (XBUFFER (WVAR (XWINDOW (FRAME_ROOT_WINDOW (f)), buffer))); BVAR (current_buffer, truncate_lines) = Qnil; clear_glyph_matrix (w->desired_matrix); clear_glyph_matrix (w->current_matrix); @@ -5702,7 +5702,7 @@ /* w->total_cols and FRAME_TOTAL_COLS want the width in columns, not in pixels. */ width /= WINDOW_FRAME_COLUMN_WIDTH (w); - w->total_cols = make_number (width); + WVAR (w, total_cols) = make_number (width); FRAME_TOTAL_COLS (f) = width; adjust_glyphs (f); w->pseudo_window_p = 1; === modified file 'src/w32menu.c' --- src/w32menu.c 2012-07-31 16:59:55 +0000 +++ src/w32menu.c 2012-08-01 05:11:36 +0000 @@ -394,7 +394,7 @@ if (! menubar_widget) previous_menu_items_used = 0; - buffer = XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer; + buffer = WVAR (XWINDOW (FRAME_SELECTED_WINDOW (f)), buffer); specbind (Qinhibit_quit, Qt); /* Don't let the debugger step into this code because it is not reentrant. */ === modified file 'src/w32term.c' --- src/w32term.c 2012-07-31 12:36:19 +0000 +++ src/w32term.c 2012-08-01 05:11:36 +0000 @@ -649,7 +649,7 @@ x_update_window_end (struct window *w, int cursor_on_p, int mouse_face_overwritten_p) { - Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WVAR (w, frame))); if (!w->pseudo_window_p) { @@ -754,7 +754,7 @@ overhead is very small. */ if (windows_or_buffers_changed && desired_row->full_width_p - && (f = XFRAME (w->frame), + && (f = XFRAME (WVAR (w, frame)), width = FRAME_INTERNAL_BORDER_WIDTH (f), width != 0) && (height = desired_row->visible_height, @@ -2718,7 +2718,7 @@ static void x_scroll_run (struct window *w, struct run *run) { - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); int x, y, width, height, from_y, to_y, bottom_y; HWND hwnd = FRAME_W32_WINDOW (f); HRGN expect_dirty; @@ -3668,7 +3668,7 @@ my_destroy_window (f, SCROLL_BAR_W32_WINDOW (bar)); /* Dissociate this scroll bar from its window. */ - XWINDOW (bar->window)->vertical_scroll_bar = Qnil; + WVAR (XWINDOW (bar->window), vertical_scroll_bar) = Qnil; UNBLOCK_INPUT; } @@ -3681,7 +3681,7 @@ w32_set_vertical_scroll_bar (struct window *w, int portion, int whole, int position) { - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); struct scroll_bar *bar; int top, height, left, sb_left, width, sb_width; int window_y, window_height; @@ -3721,7 +3721,7 @@ || WINDOW_RIGHT_MARGIN_COLS (w) == 0)); /* Does the scroll bar exist yet? */ - if (NILP (w->vertical_scroll_bar)) + if (NILP (WVAR (w, vertical_scroll_bar))) { HDC hdc; BLOCK_INPUT; @@ -3743,7 +3743,7 @@ /* It may just need to be moved and resized. */ HWND hwnd; - bar = XSCROLL_BAR (w->vertical_scroll_bar); + bar = XSCROLL_BAR (WVAR (w, vertical_scroll_bar)); hwnd = SCROLL_BAR_W32_WINDOW (bar); /* If already correctly positioned, do nothing. */ @@ -3805,7 +3805,7 @@ w32_set_scroll_bar_thumb (bar, portion, position, whole); - XSETVECTOR (w->vertical_scroll_bar, bar); + XSETVECTOR (WVAR (w, vertical_scroll_bar), bar); } @@ -3849,10 +3849,10 @@ struct frame *f; /* We can't redeem this window's scroll bar if it doesn't have one. */ - if (NILP (window->vertical_scroll_bar)) + if (NILP (WVAR (window, vertical_scroll_bar))) abort (); - bar = XSCROLL_BAR (window->vertical_scroll_bar); + bar = XSCROLL_BAR (WVAR (window, vertical_scroll_bar)); /* Unlink it from the condemned list. */ f = XFRAME (WINDOW_FRAME (window)); @@ -3860,11 +3860,11 @@ { /* If the prev pointer is nil, it must be the first in one of the lists. */ - if (EQ (FRAME_SCROLL_BARS (f), window->vertical_scroll_bar)) + if (EQ (FRAME_SCROLL_BARS (f), WVAR (window, vertical_scroll_bar))) /* It's not condemned. Everything's fine. */ return; else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f), - window->vertical_scroll_bar)) + WVAR (window, vertical_scroll_bar))) FRAME_CONDEMNED_SCROLL_BARS (f) = bar->next; else /* If its prev pointer is nil, it must be at the front of @@ -4422,8 +4422,8 @@ create event iff we don't leave the selected frame. */ && (focus_follows_mouse - || (EQ (XWINDOW (window)->frame, - XWINDOW (selected_window)->frame)))) + || (EQ (WVAR (XWINDOW (window), frame), + WVAR (XWINDOW (selected_window), frame))))) { inev.kind = SELECT_WINDOW_EVENT; inev.frame_or_window = window; @@ -5038,7 +5038,7 @@ x_draw_bar_cursor (struct window *w, struct glyph_row *row, int width, enum text_cursor_kinds kind) { - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); struct glyph *cursor_glyph; /* If cursor is out of bounds, don't draw garbage. This can happen === modified file 'src/window.c' --- src/window.c 2012-07-31 12:36:19 +0000 +++ src/window.c 2012-08-01 05:11:36 +0000 @@ -178,7 +178,7 @@ If WINDOW is omitted or nil, it defaults to the selected window. */) (Lisp_Object window) { - return decode_any_window (window)->frame; + return WVAR (decode_any_window (window), frame); } DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0, @@ -244,12 +244,12 @@ window = FVAR (XFRAME (frame_or_window), root_window); } - while (NILP (XWINDOW (window)->buffer)) + while (NILP (WVAR (XWINDOW (window), buffer))) { - if (! NILP (XWINDOW (window)->hchild)) - window = XWINDOW (window)->hchild; - else if (! NILP (XWINDOW (window)->vchild)) - window = XWINDOW (window)->vchild; + if (! NILP (WVAR (XWINDOW (window), hchild))) + window = WVAR (XWINDOW (window), hchild); + else if (! NILP (WVAR (XWINDOW (window), vchild))) + window = WVAR (XWINDOW (window), vchild); else abort (); } @@ -338,7 +338,7 @@ if (NILP (norecord)) { w->use_time = ++window_select_count; - record_buffer (w->buffer); + record_buffer (WVAR (w, buffer)); } if (EQ (window, selected_window) && !inhibit_point_swap) @@ -366,17 +366,17 @@ if (!inhibit_point_swap) { ow = XWINDOW (selected_window); - if (! NILP (ow->buffer)) - set_marker_both (ow->pointm, ow->buffer, - BUF_PT (XBUFFER (ow->buffer)), - BUF_PT_BYTE (XBUFFER (ow->buffer))); + if (! NILP (WVAR (ow, buffer))) + set_marker_both (WVAR (ow, pointm), WVAR (ow, buffer), + BUF_PT (XBUFFER (WVAR (ow, buffer))), + BUF_PT_BYTE (XBUFFER (WVAR (ow, buffer)))); } selected_window = window; - Fset_buffer (w->buffer); + Fset_buffer (WVAR (w, buffer)); - BVAR (XBUFFER (w->buffer), last_selected_window) = window; + BVAR (XBUFFER (WVAR (w, buffer)), last_selected_window) = window; /* Go to the point recorded in the window. This is important when the buffer is in more @@ -384,7 +384,7 @@ redisplay_window has altered point after scrolling, because it makes the change only in the window. */ { - register ptrdiff_t new_point = marker_position (w->pointm); + register ptrdiff_t new_point = marker_position (WVAR (w, pointm)); if (new_point < BEGV) SET_PT (BEGV); else if (new_point > ZV) @@ -419,7 +419,7 @@ Return nil for an internal window or a deleted window. */) (Lisp_Object window) { - return decode_any_window (window)->buffer; + return WVAR (decode_any_window (window), buffer); } DEFUN ("window-parent", Fwindow_parent, Swindow_parent, 0, 1, 0, @@ -428,7 +428,7 @@ Return nil for a window with no parent (e.g. a root window). */) (Lisp_Object window) { - return decode_any_window (window)->parent; + return WVAR (decode_any_window (window), parent); } DEFUN ("window-top-child", Fwindow_top_child, Swindow_top_child, 1, 1, 0, @@ -439,7 +439,7 @@ (Lisp_Object window) { CHECK_WINDOW (window); - return decode_any_window (window)->vchild; + return WVAR (decode_any_window (window), vchild); } DEFUN ("window-left-child", Fwindow_left_child, Swindow_left_child, 1, 1, 0, @@ -450,7 +450,7 @@ (Lisp_Object window) { CHECK_WINDOW (window); - return decode_any_window (window)->hchild; + return WVAR (decode_any_window (window), hchild); } DEFUN ("window-next-sibling", Fwindow_next_sibling, Swindow_next_sibling, 0, 1, 0, @@ -459,7 +459,7 @@ Return nil if WINDOW has no next sibling. */) (Lisp_Object window) { - return decode_any_window (window)->next; + return WVAR (decode_any_window (window), next); } DEFUN ("window-prev-sibling", Fwindow_prev_sibling, Swindow_prev_sibling, 0, 1, 0, @@ -468,7 +468,7 @@ Return nil if WINDOW has no previous sibling. */) (Lisp_Object window) { - return decode_any_window (window)->prev; + return WVAR (decode_any_window (window), prev); } DEFUN ("window-combination-limit", Fwindow_combination_limit, Swindow_combination_limit, 1, 1, 0, @@ -478,7 +478,7 @@ WINDOW are never \(re-)combined with WINDOW's siblings. */) (Lisp_Object window) { - return decode_any_window (window)->combination_limit; + return WVAR (decode_any_window (window), combination_limit); } DEFUN ("set-window-combination-limit", Fset_window_combination_limit, Sset_window_combination_limit, 2, 2, 0, @@ -490,8 +490,8 @@ (Lisp_Object window, Lisp_Object limit) { register struct window *w = decode_any_window (window); - w->combination_limit = limit; - return w->combination_limit; + WVAR (w, combination_limit) = limit; + return WVAR (w, combination_limit); } DEFUN ("window-use-time", Fwindow_use_time, Swindow_use_time, 0, 1, 0, @@ -517,7 +517,7 @@ integer multiple of the default character height. */) (Lisp_Object window) { - return decode_any_window (window)->total_lines; + return WVAR (decode_any_window (window), total_lines); } DEFUN ("window-total-width", Fwindow_total_width, Swindow_total_width, 0, 1, 0, @@ -532,7 +532,7 @@ integer multiple of the default character width. */) (Lisp_Object window) { - return decode_any_window (window)->total_cols; + return WVAR (decode_any_window (window), total_cols); } DEFUN ("window-new-total", Fwindow_new_total, Swindow_new_total, 0, 1, 0, @@ -540,7 +540,7 @@ If WINDOW is omitted or nil, it defaults to the selected window. */) (Lisp_Object window) { - return decode_any_window (window)->new_total; + return WVAR (decode_any_window (window), new_total); } DEFUN ("window-normal-size", Fwindow_normal_size, Swindow_normal_size, 0, 2, 0, @@ -550,9 +550,9 @@ (Lisp_Object window, Lisp_Object horizontal) { if (NILP (horizontal)) - return decode_any_window (window)->normal_lines; + return WVAR (decode_any_window (window), normal_lines); else - return decode_any_window (window)->normal_cols; + return WVAR (decode_any_window (window), normal_cols); } DEFUN ("window-new-normal", Fwindow_new_normal, Swindow_new_normal, 0, 1, 0, @@ -560,7 +560,7 @@ If WINDOW is omitted or nil, it defaults to the selected window. */) (Lisp_Object window) { - return decode_any_window (window)->new_normal; + return WVAR (decode_any_window (window), new_normal); } DEFUN ("window-left-column", Fwindow_left_column, Swindow_left_column, 0, 1, 0, @@ -572,7 +572,7 @@ If WINDOW is omitted or nil, it defaults to the selected window. */) (Lisp_Object window) { - return decode_any_window (window)->left_col; + return WVAR (decode_any_window (window), left_col); } DEFUN ("window-top-line", Fwindow_top_line, Swindow_top_line, 0, 1, 0, @@ -584,7 +584,7 @@ If WINDOW is omitted or nil, it defaults to the selected window. */) (Lisp_Object window) { - return decode_any_window (window)->top_line; + return WVAR (decode_any_window (window), top_line); } /* Return the number of lines of W's body. Don't count any mode or @@ -593,7 +593,7 @@ static int window_body_lines (struct window *w) { - int height = XFASTINT (w->total_lines); + int height = XFASTINT (WVAR (w, total_lines)); if (!MINI_WINDOW_P (w)) { @@ -615,7 +615,7 @@ window_body_cols (struct window *w) { struct frame *f = XFRAME (WINDOW_FRAME (w)); - int width = XINT (w->total_cols); + int width = XINT (WVAR (w, total_cols)); if (WINDOW_HAS_VERTICAL_SCROLL_BAR (w)) /* Scroll bars occupy a few columns. */ @@ -690,7 +690,7 @@ /* Prevent redisplay shortcuts when changing the hscroll. */ if (w->hscroll != new_hscroll) - XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; + XBUFFER (WVAR (w, buffer))->prevent_redisplay_optimizations_p = 1; w->hscroll = new_hscroll; return make_number (new_hscroll); @@ -719,7 +719,7 @@ See `set-window-redisplay-end-trigger' for more information. */) (Lisp_Object window) { - return decode_window (window)->redisplay_end_trigger; + return WVAR (decode_window (window), redisplay_end_trigger); } DEFUN ("set-window-redisplay-end-trigger", Fset_window_redisplay_end_trigger, @@ -735,7 +735,7 @@ register struct window *w; w = decode_window (window); - w->redisplay_end_trigger = value; + WVAR (w, redisplay_end_trigger) = value; return value; } @@ -785,7 +785,7 @@ static void calc_absolute_offset (struct window *w, int *add_x, int *add_y) { - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); *add_y = f->top_pos; #ifdef FRAME_MENUBAR_HEIGHT *add_y += FRAME_MENUBAR_HEIGHT (f); @@ -1095,7 +1095,7 @@ CHECK_LIVE_WINDOW (window); w = XWINDOW (window); - f = XFRAME (w->frame); + f = XFRAME (WVAR (w, frame)); CHECK_CONS (coordinates); lx = Fcar (coordinates); ly = Fcdr (coordinates); @@ -1275,9 +1275,9 @@ register struct window *w = decode_window (window); if (w == XWINDOW (selected_window) - && current_buffer == XBUFFER (w->buffer)) + && current_buffer == XBUFFER (WVAR (w, buffer))) return Fpoint (); - return Fmarker_position (w->pointm); + return Fmarker_position (WVAR (w, pointm)); } DEFUN ("window-start", Fwindow_start, Swindow_start, 0, 1, 0, @@ -1286,7 +1286,7 @@ This is updated by redisplay or by calling `set-window-start'. */) (Lisp_Object window) { - return Fmarker_position (decode_window (window)->start); + return Fmarker_position (WVAR (decode_window (window), start)); } /* This is text temporarily removed from the doc string below. @@ -1317,7 +1317,7 @@ Lisp_Object buf; struct buffer *b; - buf = w->buffer; + buf = WVAR (w, buffer); CHECK_BUFFER (buf); b = XBUFFER (buf); @@ -1326,12 +1326,12 @@ The user can compute it with vertical-motion if he wants to. It would be nicer to do it automatically, but that's so slow that it would probably bother people. */ - if (NILP (w->window_end_valid)) + if (NILP (WVAR (w, window_end_valid))) return Qnil; #endif if (! NILP (update) - && ! (! NILP (w->window_end_valid) + && ! (! NILP (WVAR (w, window_end_valid)) && w->last_modified >= BUF_MODIFF (b) && w->last_overlay_modified >= BUF_OVERLAY_MODIFF (b)) && !noninteractive) @@ -1354,12 +1354,12 @@ `-l' containing a call to `rmail' with subsequent other commands. At the end, W->start happened to be BEG, while rmail had already narrowed the buffer. */ - if (XMARKER (w->start)->charpos < BEGV) + if (XMARKER (WVAR (w, start))->charpos < BEGV) SET_TEXT_POS (startp, BEGV, BEGV_BYTE); - else if (XMARKER (w->start)->charpos > ZV) + else if (XMARKER (WVAR (w, start))->charpos > ZV) SET_TEXT_POS (startp, ZV, ZV_BYTE); else - SET_TEXT_POS_FROM_MARKER (startp, w->start); + SET_TEXT_POS_FROM_MARKER (startp, WVAR (w, start)); itdata = bidi_shelve_cache (); start_display (&it, w, startp); @@ -1373,7 +1373,7 @@ set_buffer_internal (old_buffer); } else - XSETINT (value, BUF_Z (b) - XFASTINT (w->window_end_pos)); + XSETINT (value, BUF_Z (b) - XFASTINT (WVAR (w, window_end_pos))); return value; } @@ -1387,10 +1387,10 @@ CHECK_NUMBER_COERCE_MARKER (pos); if (w == XWINDOW (selected_window) - && XBUFFER (w->buffer) == current_buffer) + && XBUFFER (WVAR (w, buffer)) == current_buffer) Fgoto_char (pos); else - set_marker_restricted (w->pointm, pos, w->buffer); + set_marker_restricted (WVAR (w, pointm), pos, WVAR (w, buffer)); /* We have to make sure that redisplay updates the window to show the new value of point. */ @@ -1410,7 +1410,7 @@ register struct window *w = decode_window (window); CHECK_NUMBER_COERCE_MARKER (pos); - set_marker_restricted (w->start, pos, w->buffer); + set_marker_restricted (WVAR (w, start), pos, WVAR (w, buffer)); /* this is not right, but much easier than doing what is right. */ w->start_at_line_beg = 0; if (NILP (noforce)) @@ -1452,8 +1452,8 @@ int x, y; w = decode_window (window); - buf = XBUFFER (w->buffer); - SET_TEXT_POS_FROM_MARKER (top, w->start); + buf = XBUFFER (WVAR (w, buffer)); + SET_TEXT_POS_FROM_MARKER (top, WVAR (w, start)); if (EQ (pos, Qt)) posint = -1; @@ -1465,7 +1465,7 @@ else if (w == XWINDOW (selected_window)) posint = PT; else - posint = XMARKER (w->pointm)->charpos; + posint = XMARKER (WVAR (w, pointm))->charpos; /* If position is above window start or outside buffer boundaries, or if window start is out of range, position is not visible. */ @@ -1522,11 +1522,11 @@ if (noninteractive || w->pseudo_window_p) return Qnil; - CHECK_BUFFER (w->buffer); - b = XBUFFER (w->buffer); + CHECK_BUFFER (WVAR (w, buffer)); + b = XBUFFER (WVAR (w, buffer)); /* Fail if current matrix is not up-to-date. */ - if (NILP (w->window_end_valid) + if (NILP (WVAR (w, window_end_valid)) || current_buffer->clip_changed || current_buffer->prevent_redisplay_optimizations_p || w->last_modified < BUF_MODIFF (b) @@ -1619,7 +1619,7 @@ is the value returned by `window-dedicated-p' is t. */) (Lisp_Object window) { - return decode_window (window)->dedicated; + return WVAR (decode_window (window), dedicated); } DEFUN ("set-window-dedicated-p", Fset_window_dedicated_p, @@ -1645,8 +1645,8 @@ { register struct window *w = decode_window (window); - w->dedicated = flag; - return w->dedicated; + WVAR (w, dedicated) = flag; + return WVAR (w, dedicated); } DEFUN ("window-prev-buffers", Fwindow_prev_buffers, Swindow_prev_buffers, @@ -1659,7 +1659,7 @@ window for that buffer, and POS is a window-specific point value. */) (Lisp_Object window) { - return decode_window (window)->prev_buffers; + return WVAR (decode_window (window), prev_buffers); } DEFUN ("set-window-prev-buffers", Fset_window_prev_buffers, @@ -1672,7 +1672,7 @@ window for that buffer, and POS is a window-specific point value. */) (Lisp_Object window, Lisp_Object prev_buffers) { - return decode_window (window)->prev_buffers = prev_buffers; + return WVAR (decode_window (window), prev_buffers) = prev_buffers; } DEFUN ("window-next-buffers", Fwindow_next_buffers, Swindow_next_buffers, @@ -1681,7 +1681,7 @@ WINDOW must be a live window and defaults to the selected one. */) (Lisp_Object window) { - return decode_window (window)->next_buffers; + return WVAR (decode_window (window), next_buffers); } DEFUN ("set-window-next-buffers", Fset_window_next_buffers, @@ -1691,7 +1691,7 @@ NEXT-BUFFERS should be a list of buffers. */) (Lisp_Object window, Lisp_Object next_buffers) { - return decode_window (window)->next_buffers = next_buffers; + return WVAR (decode_window (window), next_buffers) = next_buffers; } DEFUN ("window-parameters", Fwindow_parameters, Swindow_parameters, @@ -1701,7 +1701,7 @@ elements of the form (PARAMETER . VALUE). */) (Lisp_Object window) { - return Fcopy_alist (decode_any_window (window)->window_parameters); + return Fcopy_alist (WVAR (decode_any_window (window), window_parameters)); } DEFUN ("window-parameter", Fwindow_parameter, Swindow_parameter, @@ -1712,7 +1712,8 @@ { Lisp_Object result; - result = Fassq (parameter, decode_any_window (window)->window_parameters); + result = Fassq (parameter, WVAR (decode_any_window (window), + window_parameters)); return CDR_SAFE (result); } @@ -1725,9 +1726,10 @@ register struct window *w = decode_any_window (window); Lisp_Object old_alist_elt; - old_alist_elt = Fassq (parameter, w->window_parameters); + old_alist_elt = Fassq (parameter, WVAR (w, window_parameters)); if (NILP (old_alist_elt)) - w->window_parameters = Fcons (Fcons (parameter, value), w->window_parameters); + WVAR (w, window_parameters) + = Fcons (Fcons (parameter, value), WVAR (w, window_parameters)); else Fsetcdr (old_alist_elt, value); return value; @@ -1739,7 +1741,7 @@ WINDOW defaults to the selected window. */) (Lisp_Object window) { - return decode_window (window)->display_table; + return WVAR (decode_window (window), display_table); } /* Get the display table for use on window W. This is either W's @@ -1752,11 +1754,11 @@ { struct Lisp_Char_Table *dp = NULL; - if (DISP_TABLE_P (w->display_table)) - dp = XCHAR_TABLE (w->display_table); - else if (BUFFERP (w->buffer)) + if (DISP_TABLE_P (WVAR (w, display_table))) + dp = XCHAR_TABLE (WVAR (w, display_table)); + else if (BUFFERP (WVAR (w, buffer))) { - struct buffer *b = XBUFFER (w->buffer); + struct buffer *b = XBUFFER (WVAR (w, buffer)); if (DISP_TABLE_P (BVAR (b, display_table))) dp = XCHAR_TABLE (BVAR (b, display_table)); @@ -1774,7 +1776,7 @@ register struct window *w; w = decode_window (window); - w->display_table = table; + WVAR (w, display_table) = table; return table; } @@ -1786,14 +1788,14 @@ Lisp_Object buf; struct buffer *b; - buf = w->buffer; + buf = WVAR (w, buffer); b = XBUFFER (buf); - if (b != XMARKER (w->pointm)->buffer) + if (b != XMARKER (WVAR (w, pointm))->buffer) abort (); #if 0 if (w == XWINDOW (selected_window) - || ! EQ (buf, XWINDOW (selected_window)->buffer)) + || ! EQ (buf, WVAR (XWINDOW (selected_window), buffer))) /* Do this except when the selected window's buffer is being removed from some other window. */ #endif @@ -1804,22 +1806,22 @@ selected window, while last_window_start reflects another window which was recently showing the same buffer. Some people might say that might be a good thing. Let's see. */ - b->last_window_start = marker_position (w->start); + b->last_window_start = marker_position (WVAR (w, start)); /* Point in the selected window's buffer is actually stored in that buffer, and the window's pointm isn't used. So don't clobber point in that buffer. */ - if (! EQ (buf, XWINDOW (selected_window)->buffer) + if (! EQ (buf, WVAR (XWINDOW (selected_window), buffer)) /* This line helps to fix Horsley's testbug.el bug. */ && !(WINDOWP (BVAR (b, last_selected_window)) && w != XWINDOW (BVAR (b, last_selected_window)) - && EQ (buf, XWINDOW (BVAR (b, last_selected_window))->buffer))) + && EQ (buf, WVAR (XWINDOW (BVAR (b, last_selected_window)), buffer)))) temp_set_point_both (b, clip_to_bounds (BUF_BEGV (b), - XMARKER (w->pointm)->charpos, + XMARKER (WVAR (w, pointm))->charpos, BUF_ZV (b)), clip_to_bounds (BUF_BEGV_BYTE (b), - marker_byte_position (w->pointm), + marker_byte_position (WVAR (w, pointm)), BUF_ZV_BYTE (b))); if (WINDOWP (BVAR (b, last_selected_window)) @@ -1838,19 +1840,19 @@ /* If OLD is its frame's root window, then NEW is the new root window for that frame. */ - if (EQ (old, FRAME_ROOT_WINDOW (XFRAME (o->frame)))) - FRAME_ROOT_WINDOW (XFRAME (o->frame)) = new; + if (EQ (old, FRAME_ROOT_WINDOW (XFRAME (WVAR (o, frame))))) + FRAME_ROOT_WINDOW (XFRAME (WVAR (o, frame))) = new; if (setflag) { - n->left_col = o->left_col; - n->top_line = o->top_line; - n->total_cols = o->total_cols; - n->total_lines = o->total_lines; - n->normal_cols = o->normal_cols; - o->normal_cols = make_float (1.0); - n->normal_lines = o->normal_lines; - o->normal_lines = make_float (1.0); + WVAR (n, left_col) = WVAR (o, left_col); + WVAR (n, top_line) = WVAR (o, top_line); + WVAR (n, total_cols) = WVAR (o, total_cols); + WVAR (n, total_lines) = WVAR (o, total_lines); + WVAR (n, normal_cols) = WVAR (o, normal_cols); + WVAR (o, normal_cols) = make_float (1.0); + WVAR (n, normal_lines) = WVAR (o, normal_lines); + WVAR (o, normal_lines) = make_float (1.0); n->desired_matrix = n->current_matrix = 0; n->vscroll = 0; memset (&n->cursor, 0, sizeof (n->cursor)); @@ -1860,27 +1862,27 @@ n->phys_cursor_width = -1; n->must_be_updated_p = 0; n->pseudo_window_p = 0; - XSETFASTINT (n->window_end_vpos, 0); - XSETFASTINT (n->window_end_pos, 0); - n->window_end_valid = Qnil; + XSETFASTINT (WVAR (n, window_end_vpos), 0); + XSETFASTINT (WVAR (n, window_end_pos), 0); + WVAR (n, window_end_valid) = Qnil; n->frozen_window_start_p = 0; } - n->next = tem = o->next; - if (!NILP (tem)) - XWINDOW (tem)->prev = new; - - n->prev = tem = o->prev; - if (!NILP (tem)) - XWINDOW (tem)->next = new; - - n->parent = tem = o->parent; + WVAR (n, next) = tem = WVAR (o, next); + if (!NILP (tem)) + WVAR (XWINDOW (tem), prev) = new; + + WVAR (n, prev) = tem = WVAR (o, prev); + if (!NILP (tem)) + WVAR (XWINDOW (tem), next) = new; + + WVAR (n, parent) = tem = WVAR (o, parent); if (!NILP (tem)) { - if (EQ (XWINDOW (tem)->vchild, old)) - XWINDOW (tem)->vchild = new; - if (EQ (XWINDOW (tem)->hchild, old)) - XWINDOW (tem)->hchild = new; + if (EQ (WVAR (XWINDOW (tem), vchild), old)) + WVAR (XWINDOW (tem), vchild) = new; + if (EQ (WVAR (XWINDOW (tem), hchild), old)) + WVAR (XWINDOW (tem), hchild) = new; } } @@ -1896,64 +1898,64 @@ int horflag; w = XWINDOW (window); - parent = w->parent; - if (!NILP (parent) && NILP (w->combination_limit)) + parent = WVAR (w, parent); + if (!NILP (parent) && NILP (WVAR (w, combination_limit))) { p = XWINDOW (parent); - if (((!NILP (p->vchild) && !NILP (w->vchild)) - || (!NILP (p->hchild) && !NILP (w->hchild)))) + if (((!NILP (WVAR (p, vchild)) && !NILP (WVAR (w, vchild))) + || (!NILP (WVAR (p, hchild)) && !NILP (WVAR (w, hchild))))) /* WINDOW and PARENT are both either a vertical or a horizontal combination. */ { - horflag = NILP (w->vchild); - child = horflag ? w->hchild : w->vchild; + horflag = NILP (WVAR (w, vchild)); + child = horflag ? WVAR (w, hchild) : WVAR (w, vchild); c = XWINDOW (child); /* Splice WINDOW's children into its parent's children and assign new normal sizes. */ - if (NILP (w->prev)) + if (NILP (WVAR (w, prev))) if (horflag) - p->hchild = child; + WVAR (p, hchild) = child; else - p->vchild = child; + WVAR (p, vchild) = child; else { - c->prev = w->prev; - XWINDOW (w->prev)->next = child; + WVAR (c, prev) = WVAR (w, prev); + WVAR (XWINDOW (WVAR (w, prev)), next) = child; } while (c) { - c->parent = parent; + WVAR (c, parent) = parent; if (horflag) - c->normal_cols - = make_float (XFLOATINT (c->total_cols) - / XFLOATINT (p->total_cols)); + WVAR (c, normal_cols) + = make_float (XFLOATINT (WVAR (c, total_cols)) + / XFLOATINT (WVAR (p, total_cols))); else - c->normal_lines - = make_float (XFLOATINT (c->total_lines) - / XFLOATINT (p->total_lines)); + WVAR (c, normal_lines) + = make_float (XFLOATINT (WVAR (c, total_lines)) + / XFLOATINT (WVAR (p, total_lines))); - if (NILP (c->next)) + if (NILP (WVAR (c, next))) { - if (!NILP (w->next)) + if (!NILP (WVAR (w, next))) { - c->next = w->next; - XWINDOW (c->next)->prev = child; + WVAR (c, next) = WVAR (w, next); + WVAR (XWINDOW (WVAR (c, next)), prev) = child; } c = 0; } else { - child = c->next; + child = WVAR (c, next); c = XWINDOW (child); } } /* WINDOW can be deleted now. */ - w->vchild = w->hchild = Qnil; + WVAR (w, vchild) = WVAR (w, hchild) = Qnil; } } } @@ -2036,10 +2038,10 @@ candidate_window_p (Lisp_Object window, Lisp_Object owindow, Lisp_Object minibuf, Lisp_Object all_frames) { struct window *w = XWINDOW (window); - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); int candidate_p = 1; - if (!BUFFERP (w->buffer)) + if (!BUFFERP (WVAR (w, buffer))) candidate_p = 0; else if (MINI_WINDOW_P (w) && (EQ (minibuf, Qlambda) @@ -2054,13 +2056,13 @@ else if (NILP (all_frames)) { eassert (WINDOWP (owindow)); - candidate_p = EQ (w->frame, XWINDOW (owindow)->frame); + candidate_p = EQ (WVAR (w, frame), WVAR (XWINDOW (owindow), frame)); } else if (EQ (all_frames, Qvisible)) { FRAME_SAMPLE_VISIBILITY (f); candidate_p = FRAME_VISIBLE_P (f) - && (FRAME_TERMINAL (XFRAME (w->frame)) + && (FRAME_TERMINAL (XFRAME (WVAR (w, frame))) == FRAME_TERMINAL (XFRAME (selected_frame))); } @@ -2079,15 +2081,15 @@ && !f->output_data.x->has_been_visible) #endif ) - && (FRAME_TERMINAL (XFRAME (w->frame)) + && (FRAME_TERMINAL (XFRAME (WVAR (w, frame))) == FRAME_TERMINAL (XFRAME (selected_frame))); } else if (WINDOWP (all_frames)) candidate_p = (EQ (FRAME_MINIBUF_WINDOW (f), all_frames) - || EQ (XWINDOW (all_frames)->frame, w->frame) - || EQ (XWINDOW (all_frames)->frame, FRAME_FOCUS_FRAME (f))); + || EQ (WVAR (XWINDOW (all_frames), frame), WVAR (w, frame)) + || EQ (WVAR (XWINDOW (all_frames), frame), FRAME_FOCUS_FRAME (f))); else if (FRAMEP (all_frames)) - candidate_p = EQ (all_frames, w->frame); + candidate_p = EQ (all_frames, WVAR (w, frame)); return candidate_p; } @@ -2118,9 +2120,10 @@ /* ALL_FRAMES nil doesn't specify which frames to include. */ if (NILP (*all_frames)) - *all_frames = (!EQ (*minibuf, Qlambda) - ? FRAME_MINIBUF_WINDOW (XFRAME (XWINDOW (*window)->frame)) - : Qnil); + *all_frames + = (!EQ (*minibuf, Qlambda) + ? FRAME_MINIBUF_WINDOW (XFRAME (WVAR (XWINDOW (*window), frame))) + : Qnil); else if (EQ (*all_frames, Qvisible)) ; else if (EQ (*all_frames, make_number (0))) @@ -2145,7 +2148,7 @@ /* If ALL_FRAMES is a frame, and WINDOW isn't on that frame, just return the first window on the frame. */ if (FRAMEP (all_frames) - && !EQ (all_frames, XWINDOW (window)->frame)) + && !EQ (all_frames, WVAR (XWINDOW (window), frame))) return Fframe_first_window (all_frames); if (next_p) @@ -2325,7 +2328,7 @@ if (NILP (frame)) frame = selected_frame; - if (!EQ (frame, XWINDOW (window)->frame)) + if (!EQ (frame, WVAR (XWINDOW (window), frame))) error ("Window is on a different frame"); return window_list_1 (window, minibuf, frame); @@ -2446,7 +2449,7 @@ switch (type) { case GET_BUFFER_WINDOW: - if (EQ (w->buffer, obj) + if (EQ (WVAR (w, buffer), obj) /* Don't find any minibuffer window except the one that is currently in use. */ && (MINI_WINDOW_P (w) ? EQ (window, minibuf_window) : 1)) @@ -2454,7 +2457,7 @@ if (EQ (window, selected_window)) /* Preferably return the selected window. */ RETURN_UNGCPRO (window); - else if (EQ (XWINDOW (window)->frame, selected_frame) + else if (EQ (WVAR (XWINDOW (window), frame), selected_frame) && !frame_best_window_flag) /* Prefer windows on the current frame (but don't choose another one if we have one already). */ @@ -2470,25 +2473,25 @@ case REPLACE_BUFFER_IN_WINDOWS_SAFELY: /* We could simply check whether the buffer shown by window is live, and show another buffer in case it isn't. */ - if (EQ (w->buffer, obj)) + if (EQ (WVAR (w, buffer), obj)) { /* Undedicate WINDOW. */ - w->dedicated = Qnil; + WVAR (w, dedicated) = Qnil; /* Make WINDOW show the buffer returned by other_buffer_safely, don't run any hooks. */ set_window_buffer - (window, other_buffer_safely (w->buffer), 0, 0); + (window, other_buffer_safely (WVAR (w, buffer)), 0, 0); /* If WINDOW is the selected window, make its buffer current. But do so only if the window shows the current buffer (Bug#6454). */ if (EQ (window, selected_window) - && XBUFFER (w->buffer) == current_buffer) - Fset_buffer (w->buffer); + && XBUFFER (WVAR (w, buffer)) == current_buffer) + Fset_buffer (WVAR (w, buffer)); } break; case REDISPLAY_BUFFER_WINDOWS: - if (EQ (w->buffer, obj)) + if (EQ (WVAR (w, buffer), obj)) { mark_window_display_accurate (window, 0); w->update_mode_line = 1; @@ -2500,8 +2503,8 @@ /* Check for a window that has a killed buffer. */ case CHECK_ALL_WINDOWS: - if (! NILP (w->buffer) - && NILP (BVAR (XBUFFER (w->buffer), name))) + if (! NILP (WVAR (w, buffer)) + && NILP (BVAR (XBUFFER (WVAR (w, buffer)), name))) abort (); break; @@ -2588,7 +2591,7 @@ w = decode_any_window (window); XSETWINDOW (window, w); - f = XFRAME (w->frame); + f = XFRAME (WVAR (w, frame)); if (NILP (root)) /* ROOT is the frame's root window. */ @@ -2600,12 +2603,12 @@ /* ROOT must be an ancestor of WINDOW. */ { r = decode_any_window (root); - pwindow = XWINDOW (window)->parent; + pwindow = WVAR (XWINDOW (window), parent); while (!NILP (pwindow)) if (EQ (pwindow, root)) break; else - pwindow = XWINDOW (pwindow)->parent; + pwindow = WVAR (XWINDOW (pwindow), parent); if (!EQ (pwindow, root)) error ("Specified root is not an ancestor of specified window"); } @@ -2619,15 +2622,15 @@ else if (MINI_WINDOW_P (w)) /* && top > 0) */ error ("Can't expand minibuffer to full frame"); - if (!NILP (w->buffer)) + if (!NILP (WVAR (w, buffer))) { - startpos = marker_position (w->start); + startpos = marker_position (WVAR (w, start)); top = WINDOW_TOP_EDGE_LINE (w) - FRAME_TOP_MARGIN (XFRAME (WINDOW_FRAME (w))); /* Make sure WINDOW is the frame's selected window. */ if (!EQ (window, FRAME_SELECTED_WINDOW (f))) { - if (EQ (selected_frame, w->frame)) + if (EQ (selected_frame, WVAR (w, frame))) Fselect_window (window, Qnil); else FRAME_SELECTED_WINDOW (f) = window; @@ -2644,7 +2647,7 @@ { pwindow = swindow; while (!NILP (pwindow) && !EQ (window, pwindow)) - pwindow = XWINDOW (pwindow)->parent; + pwindow = WVAR (XWINDOW (pwindow), parent); if (EQ (window, pwindow)) /* If WINDOW is an ancestor of SWINDOW, then SWINDOW is ok @@ -2657,7 +2660,7 @@ if (!EQ (swindow, FRAME_SELECTED_WINDOW (f))) { - if (EQ (selected_frame, w->frame)) + if (EQ (selected_frame, WVAR (w, frame))) Fselect_window (swindow, Qnil); else FRAME_SELECTED_WINDOW (f) = swindow; @@ -2690,11 +2693,12 @@ FRAME_WINDOW_SIZES_CHANGED (f) = 1; resize_failed = 0; - if (NILP (w->buffer)) + if (NILP (WVAR (w, buffer))) { /* Resize child windows vertically. */ - XSETINT (delta, XINT (r->total_lines) - XINT (w->total_lines)); - w->top_line = r->top_line; + XSETINT (delta, XINT (WVAR (r, total_lines)) + - XINT (WVAR (w, total_lines))); + WVAR (w, top_line) = WVAR (r, top_line); resize_root_window (window, delta, Qnil, Qnil); if (window_resize_check (w, 0)) window_resize_apply (w, 0); @@ -2710,9 +2714,10 @@ /* Resize child windows horizontally. */ if (!resize_failed) { - w->left_col = r->left_col; - XSETINT (delta, XINT (r->total_cols) - XINT (w->total_cols)); - w->left_col = r->left_col; + WVAR (w, left_col) = WVAR (r, left_col); + XSETINT (delta, XINT (WVAR (r, total_cols)) + - XINT (WVAR (w, total_cols))); + WVAR (w, left_col) = WVAR (r, left_col); resize_root_window (window, delta, Qt, Qnil); if (window_resize_check (w, 1)) window_resize_apply (w, 1); @@ -2735,43 +2740,43 @@ } /* Cleanly unlink WINDOW from window-tree. */ - if (!NILP (w->prev)) + if (!NILP (WVAR (w, prev))) /* Get SIBLING above (on the left of) WINDOW. */ { - sibling = w->prev; + sibling = WVAR (w, prev); s = XWINDOW (sibling); - s->next = w->next; - if (!NILP (s->next)) - XWINDOW (s->next)->prev = sibling; + WVAR (s, next) = WVAR (w, next); + if (!NILP (WVAR (s, next))) + WVAR (XWINDOW (WVAR (s, next)), prev) = sibling; } else /* Get SIBLING below (on the right of) WINDOW. */ { - sibling = w->next; + sibling = WVAR (w, next); s = XWINDOW (sibling); - s->prev = Qnil; - if (!NILP (XWINDOW (w->parent)->vchild)) - XWINDOW (w->parent)->vchild = sibling; + WVAR (s, prev) = Qnil; + if (!NILP (WVAR (XWINDOW (WVAR (w, parent)), vchild))) + WVAR (XWINDOW (WVAR (w, parent)), vchild) = sibling; else - XWINDOW (w->parent)->hchild = sibling; + WVAR (XWINDOW (WVAR (w, parent)), hchild) = sibling; } /* Delete ROOT and all child windows of ROOT. */ - if (!NILP (r->vchild)) + if (!NILP (WVAR (r, vchild))) { - delete_all_child_windows (r->vchild); - r->vchild = Qnil; + delete_all_child_windows (WVAR (r, vchild)); + WVAR (r, vchild) = Qnil; } - else if (!NILP (r->hchild)) + else if (!NILP (WVAR (r, hchild))) { - delete_all_child_windows (r->hchild); - r->hchild = Qnil; + delete_all_child_windows (WVAR (r, hchild)); + WVAR (r, hchild) = Qnil; } replace_window (root, window, 1); /* This must become SWINDOW anyway ....... */ - if (!NILP (w->buffer) && !resize_failed) + if (!NILP (WVAR (w, buffer)) && !resize_failed) { /* Try to minimize scrolling, by setting the window start to the point will cause the text at the old window start to be at the @@ -2780,19 +2785,19 @@ when the display is not current, due to typeahead). */ new_top = WINDOW_TOP_EDGE_LINE (w) - FRAME_TOP_MARGIN (XFRAME (WINDOW_FRAME (w))); if (new_top != top - && startpos >= BUF_BEGV (XBUFFER (w->buffer)) - && startpos <= BUF_ZV (XBUFFER (w->buffer))) + && startpos >= BUF_BEGV (XBUFFER (WVAR (w, buffer))) + && startpos <= BUF_ZV (XBUFFER (WVAR (w, buffer)))) { struct position pos; struct buffer *obuf = current_buffer; - Fset_buffer (w->buffer); + Fset_buffer (WVAR (w, buffer)); /* This computation used to temporarily move point, but that can have unwanted side effects due to text properties. */ pos = *vmotion (startpos, -top, w); - set_marker_both (w->start, w->buffer, pos.bufpos, pos.bytepos); - w->window_end_valid = Qnil; + set_marker_both (WVAR (w, start), WVAR (w, buffer), pos.bufpos, pos.bytepos); + WVAR (w, window_end_valid) = Qnil; w->start_at_line_beg = (pos.bytepos == BEGV_BYTE || FETCH_BYTE (pos.bytepos - 1) == '\n'); /* We need to do this, so that the window-scroll-functions @@ -2882,13 +2887,13 @@ if (WINDOW_RIGHT_MARGIN_COLS (w) > 0) { if (WINDOW_LEFT_MARGIN_COLS (w) > 0) - w->left_margin_cols = w->right_margin_cols + WVAR (w, left_margin_cols) = WVAR (w, right_margin_cols) = make_number (margin_cols/2); else - w->right_margin_cols = make_number (margin_cols); + WVAR (w, right_margin_cols) = make_number (margin_cols); } else - w->left_margin_cols = make_number (margin_cols); + WVAR (w, left_margin_cols) = make_number (margin_cols); return 1; } @@ -2986,9 +2991,9 @@ struct window *w = XWINDOW (window); struct buffer *b = XBUFFER (buffer); ptrdiff_t count = SPECPDL_INDEX (); - int samebuf = EQ (buffer, w->buffer); + int samebuf = EQ (buffer, WVAR (w, buffer)); - w->buffer = buffer; + WVAR (w, buffer) = buffer; if (EQ (window, selected_window)) BVAR (b, last_selected_window) = window; @@ -3001,10 +3006,10 @@ XSETINT (BVAR (b, display_count), XINT (BVAR (b, display_count)) + 1); BVAR (b, display_time) = Fcurrent_time (); - XSETFASTINT (w->window_end_pos, 0); - XSETFASTINT (w->window_end_vpos, 0); + XSETFASTINT (WVAR (w, window_end_pos), 0); + XSETFASTINT (WVAR (w, window_end_vpos), 0); memset (&w->last_cursor, 0, sizeof w->last_cursor); - w->window_end_valid = Qnil; + WVAR (w, window_end_valid) = Qnil; if (!(keep_margins_p && samebuf)) { /* If we're not actually changing the buffer, don't reset hscroll and vscroll. This case happens for example when called from @@ -3016,8 +3021,8 @@ whenever we resize the frame. */ w->hscroll = w->min_hscroll = 0; w->vscroll = 0; - set_marker_both (w->pointm, buffer, BUF_PT (b), BUF_PT_BYTE (b)); - set_marker_restricted (w->start, + set_marker_both (WVAR (w, pointm), buffer, BUF_PT (b), BUF_PT_BYTE (b)); + set_marker_restricted (WVAR (w, start), make_number (b->last_window_start), buffer); w->start_at_line_beg = 0; @@ -3038,7 +3043,7 @@ Fset_buffer (buffer); } - XMARKER (w->pointm)->insertion_type = !NILP (Vwindow_point_insertion_type); + XMARKER (WVAR (w, pointm))->insertion_type = !NILP (Vwindow_point_insertion_type); if (!keep_margins_p) { @@ -3046,10 +3051,10 @@ /* This may call adjust_window_margins three times, so temporarily disable window margins. */ - Lisp_Object save_left = w->left_margin_cols; - Lisp_Object save_right = w->right_margin_cols; + Lisp_Object save_left = WVAR (w, left_margin_cols); + Lisp_Object save_right = WVAR (w, right_margin_cols); - w->left_margin_cols = w->right_margin_cols = Qnil; + WVAR (w, left_margin_cols) = WVAR (w, right_margin_cols) = Qnil; Fset_window_fringes (window, BVAR (b, left_fringe_width), BVAR (b, right_fringe_width), @@ -3059,8 +3064,8 @@ BVAR (b, scroll_bar_width), BVAR (b, vertical_scroll_bar_type), Qnil); - w->left_margin_cols = save_left; - w->right_margin_cols = save_right; + WVAR (w, left_margin_cols) = save_left; + WVAR (w, right_margin_cols) = save_right; Fset_window_margins (window, BVAR (b, left_margin_cols), BVAR (b, right_margin_cols)); @@ -3070,7 +3075,7 @@ { if (! NILP (Vwindow_scroll_functions)) run_hook_with_args_2 (Qwindow_scroll_functions, window, - Fmarker_position (w->start)); + Fmarker_position (WVAR (w, start))); run_window_configuration_change_hook (XFRAME (WINDOW_FRAME (w))); } @@ -3104,7 +3109,7 @@ if (NILP (BVAR (XBUFFER (buffer), name))) error ("Attempt to display deleted buffer"); - tem = w->buffer; + tem = WVAR (w, buffer); if (NILP (tem)) error ("Window is deleted"); else if (!EQ (tem, Qt)) @@ -3112,14 +3117,14 @@ { if (!EQ (tem, buffer)) { - if (EQ (w->dedicated, Qt)) + if (EQ (WVAR (w, dedicated), Qt)) /* WINDOW is strongly dedicated to its buffer, signal an error. */ error ("Window is dedicated to `%s'", SDATA (BVAR (XBUFFER (tem), name))); else /* WINDOW is weakly dedicated to its buffer, reset dedication. */ - w->dedicated = Qnil; + WVAR (w, dedicated) = Qnil; call1 (Qrecord_window_buffer, window); } @@ -3158,8 +3163,8 @@ struct window *w = XWINDOW (object); mark_window_display_accurate (object, 0); w->update_mode_line = 1; - if (BUFFERP (w->buffer)) - XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; + if (BUFFERP (WVAR (w, buffer))) + XBUFFER (WVAR (w, buffer))->prevent_redisplay_optimizations_p = 1; ++update_mode_lines; return Qt; } @@ -3204,14 +3209,14 @@ { window = display_buffer (buf, Qnil, Qnil); - if (!EQ (XWINDOW (window)->frame, selected_frame)) + if (!EQ (WVAR (XWINDOW (window), frame), selected_frame)) Fmake_frame_visible (WINDOW_FRAME (XWINDOW (window))); Vminibuf_scroll_window = window; w = XWINDOW (window); w->hscroll = 0; w->min_hscroll = 0; - set_marker_restricted_both (w->start, buf, BEG, BEG); - set_marker_restricted_both (w->pointm, buf, BEG, BEG); + set_marker_restricted_both (WVAR (w, start), buf, BEG, BEG); + set_marker_restricted_both (WVAR (w, pointm), buf, BEG, BEG); /* Run temp-buffer-show-hook, with the chosen window selected and its buffer current. */ @@ -3228,7 +3233,7 @@ record_unwind_protect (Fset_buffer, prev_buffer); record_unwind_protect (select_window_norecord, prev_window); Fselect_window (window, Qt); - Fset_buffer (w->buffer); + Fset_buffer (WVAR (w, buffer)); Frun_hooks (1, &Qtemp_buffer_show_hook); unbind_to (count, Qnil); } @@ -3265,17 +3270,17 @@ replace_window (window, parent, 1); - o->next = Qnil; - o->prev = Qnil; - o->parent = parent; + WVAR (o, next) = Qnil; + WVAR (o, prev) = Qnil; + WVAR (o, parent) = parent; - p->hchild = horflag ? window : Qnil; - p->vchild = horflag ? Qnil : window; - p->start = Qnil; - p->pointm = Qnil; - p->buffer = Qnil; - p->combination_limit = Qnil; - p->window_parameters = Qnil; + WVAR (p, hchild) = horflag ? window : Qnil; + WVAR (p, vchild) = horflag ? Qnil : window; + WVAR (p, start) = Qnil; + WVAR (p, pointm) = Qnil; + WVAR (p, buffer) = Qnil; + WVAR (p, combination_limit) = Qnil; + WVAR (p, window_parameters) = Qnil; } /* Make new window from scratch. */ @@ -3288,19 +3293,19 @@ w = allocate_window (); /* Initialize Lisp data. Note that allocate_window initializes all Lisp data to nil, so do it only for slots which should not be nil. */ - XSETFASTINT (w->left_col, 0); - XSETFASTINT (w->top_line, 0); - XSETFASTINT (w->total_lines, 0); - XSETFASTINT (w->total_cols, 0); - w->normal_lines = make_float (1.0); - w->normal_cols = make_float (1.0); - XSETFASTINT (w->new_total, 0); - XSETFASTINT (w->new_normal, 0); - w->start = Fmake_marker (); - w->pointm = Fmake_marker (); - w->vertical_scroll_bar_type = Qt; - XSETFASTINT (w->window_end_pos, 0); - XSETFASTINT (w->window_end_vpos, 0); + XSETFASTINT (WVAR (w, left_col), 0); + XSETFASTINT (WVAR (w, top_line), 0); + XSETFASTINT (WVAR (w, total_lines), 0); + XSETFASTINT (WVAR (w, total_cols), 0); + WVAR (w, normal_lines) = make_float (1.0); + WVAR (w, normal_cols) = make_float (1.0); + XSETFASTINT (WVAR (w, new_total), 0); + XSETFASTINT (WVAR (w, new_normal), 0); + WVAR (w, start) = Fmake_marker (); + WVAR (w, pointm) = Fmake_marker (); + WVAR (w, vertical_scroll_bar_type) = Qt; + XSETFASTINT (WVAR (w, window_end_pos), 0); + XSETFASTINT (WVAR (w, window_end_vpos), 0); /* Initialize non-Lisp data. Note that allocate_window zeroes out all non-Lisp data, so do it only for slots which should not be zero. */ @@ -3330,11 +3335,11 @@ CHECK_NUMBER (size); if (NILP (add)) - XSETINT (w->new_total, XINT (size)); + XSETINT (WVAR (w, new_total), XINT (size)); else - XSETINT (w->new_total, XINT (w->new_total) + XINT (size)); + XSETINT (WVAR (w, new_total), XINT (WVAR (w, new_total)) + XINT (size)); - return w->new_total; + return WVAR (w, new_total); } DEFUN ("set-window-new-normal", Fset_window_new_normal, Sset_window_new_normal, 1, 2, 0, @@ -3346,8 +3351,8 @@ { struct window *w = decode_any_window (window); - w->new_normal = size; - return w->new_normal; + WVAR (w, new_normal) = size; + return WVAR (w, new_normal); } /* Return 1 if setting w->total_lines (w->total_cols if HORFLAG is @@ -3362,19 +3367,19 @@ { struct window *c; - if (!NILP (w->vchild)) + if (!NILP (WVAR (w, vchild))) /* W is a vertical combination. */ { - c = XWINDOW (w->vchild); + c = XWINDOW (WVAR (w, vchild)); if (horflag) /* All child windows of W must have the same width as W. */ { while (c) { - if ((XINT (c->new_total) != XINT (w->new_total)) + if ((XINT (WVAR (c, new_total)) != XINT (WVAR (w, new_total))) || !window_resize_check (c, horflag)) return 0; - c = NILP (c->next) ? 0 : XWINDOW (c->next); + c = NILP (WVAR (c, next)) ? 0 : XWINDOW (WVAR (c, next)); } return 1; } @@ -3387,16 +3392,16 @@ { if (!window_resize_check (c, horflag)) return 0; - sum_of_sizes = sum_of_sizes + XINT (c->new_total); - c = NILP (c->next) ? 0 : XWINDOW (c->next); + sum_of_sizes = sum_of_sizes + XINT (WVAR (c, new_total)); + c = NILP (WVAR (c, next)) ? 0 : XWINDOW (WVAR (c, next)); } - return (sum_of_sizes == XINT (w->new_total)); + return (sum_of_sizes == XINT (WVAR (w, new_total))); } } - else if (!NILP (w->hchild)) + else if (!NILP (WVAR (w, hchild))) /* W is a horizontal combination. */ { - c = XWINDOW (w->hchild); + c = XWINDOW (WVAR (w, hchild)); if (horflag) /* The sum of the widths of the child windows of W must equal W's width. */ @@ -3406,20 +3411,20 @@ { if (!window_resize_check (c, horflag)) return 0; - sum_of_sizes = sum_of_sizes + XINT (c->new_total); - c = NILP (c->next) ? 0 : XWINDOW (c->next); + sum_of_sizes = sum_of_sizes + XINT (WVAR (c, new_total)); + c = NILP (WVAR (c, next)) ? 0 : XWINDOW (WVAR (c, next)); } - return (sum_of_sizes == XINT (w->new_total)); + return (sum_of_sizes == XINT (WVAR (w, new_total))); } else /* All child windows of W must have the same height as W. */ { while (c) { - if ((XINT (c->new_total) != XINT (w->new_total)) + if ((XINT (WVAR (c, new_total)) != XINT (WVAR (w, new_total))) || !window_resize_check (c, horflag)) return 0; - c = NILP (c->next) ? 0 : XWINDOW (c->next); + c = NILP (WVAR (c, next)) ? 0 : XWINDOW (WVAR (c, next)); } return 1; } @@ -3428,7 +3433,7 @@ /* A leaf window. Make sure it's not too small. The following hardcodes the values of `window-safe-min-width' (2) and `window-safe-min-height' (1) which are defined in window.el. */ - return XINT (w->new_total) >= (horflag ? 2 : 1); + return XINT (WVAR (w, new_total)) >= (horflag ? 2 : 1); } /* Set w->total_lines (w->total_cols if HORIZONTAL is non-zero) to @@ -3448,51 +3453,51 @@ parent window has been set *before*. */ if (horflag) { - w->total_cols = w->new_total; - if (NUMBERP (w->new_normal)) - w->normal_cols = w->new_normal; + WVAR (w, total_cols) = WVAR (w, new_total); + if (NUMBERP (WVAR (w, new_normal))) + WVAR (w, normal_cols) = WVAR (w, new_normal); - pos = XINT (w->left_col); + pos = XINT (WVAR (w, left_col)); } else { - w->total_lines = w->new_total; - if (NUMBERP (w->new_normal)) - w->normal_lines = w->new_normal; + WVAR (w, total_lines) = WVAR (w, new_total); + if (NUMBERP (WVAR (w, new_normal))) + WVAR (w, normal_lines) = WVAR (w, new_normal); - pos = XINT (w->top_line); + pos = XINT (WVAR (w, top_line)); } - if (!NILP (w->vchild)) + if (!NILP (WVAR (w, vchild))) /* W is a vertical combination. */ { - c = XWINDOW (w->vchild); + c = XWINDOW (WVAR (w, vchild)); while (c) { if (horflag) - XSETFASTINT (c->left_col, pos); + XSETFASTINT (WVAR (c, left_col), pos); else - XSETFASTINT (c->top_line, pos); + XSETFASTINT (WVAR (c, top_line), pos); window_resize_apply (c, horflag); if (!horflag) - pos = pos + XINT (c->total_lines); - c = NILP (c->next) ? 0 : XWINDOW (c->next); + pos = pos + XINT (WVAR (c, total_lines)); + c = NILP (WVAR (c, next)) ? 0 : XWINDOW (WVAR (c, next)); } } - else if (!NILP (w->hchild)) + else if (!NILP (WVAR (w, hchild))) /* W is a horizontal combination. */ { - c = XWINDOW (w->hchild); + c = XWINDOW (WVAR (w, hchild)); while (c) { if (horflag) - XSETFASTINT (c->left_col, pos); + XSETFASTINT (WVAR (c, left_col), pos); else - XSETFASTINT (c->top_line, pos); + XSETFASTINT (WVAR (c, top_line), pos); window_resize_apply (c, horflag); if (horflag) - pos = pos + XINT (c->total_cols); - c = NILP (c->next) ? 0 : XWINDOW (c->next); + pos = pos + XINT (WVAR (c, total_cols)); + c = NILP (WVAR (c, next)) ? 0 : XWINDOW (WVAR (c, next)); } } @@ -3528,7 +3533,8 @@ r = XWINDOW (FRAME_ROOT_WINDOW (f)); if (!window_resize_check (r, horflag) - || ! EQ (r->new_total, (horflag ? r->total_cols : r->total_lines))) + || ! EQ (WVAR (r, new_total), + (horflag ? WVAR (r, total_cols) : WVAR (r, total_lines)))) return Qnil; BLOCK_INPUT; @@ -3568,37 +3574,39 @@ - ((FRAME_HAS_MINIBUF_P (f) && !FRAME_MINIBUF_ONLY_P (f)) ? 1 : 0))); - XSETFASTINT (r->top_line, FRAME_TOP_MARGIN (f)); - if (NILP (r->vchild) && NILP (r->hchild)) + XSETFASTINT (WVAR (r, top_line), FRAME_TOP_MARGIN (f)); + if (NILP (WVAR (r, vchild)) && NILP (WVAR (r, hchild))) /* For a leaf root window just set the size. */ if (horflag) - XSETFASTINT (r->total_cols, new_size); + XSETFASTINT (WVAR (r, total_cols), new_size); else - XSETFASTINT (r->total_lines, new_size); + XSETFASTINT (WVAR (r, total_lines), new_size); else { /* old_size is the old size of the frame's root window. */ - int old_size = XFASTINT (horflag ? r->total_cols : r->total_lines); + int old_size = XFASTINT (horflag ? WVAR (r, total_cols) + : WVAR (r, total_lines)); Lisp_Object delta; XSETINT (delta, new_size - old_size); /* Try a "normal" resize first. */ resize_root_window (root, delta, horflag ? Qt : Qnil, Qnil); - if (window_resize_check (r, horflag) && new_size == XINT (r->new_total)) + if (window_resize_check (r, horflag) + && new_size == XINT (WVAR (r, new_total))) window_resize_apply (r, horflag); else { /* Try with "reasonable" minimum sizes next. */ resize_root_window (root, delta, horflag ? Qt : Qnil, Qt); if (window_resize_check (r, horflag) - && new_size == XINT (r->new_total)) + && new_size == XINT (WVAR (r, new_total))) window_resize_apply (r, horflag); else { /* Finally, try with "safe" minimum sizes. */ resize_root_window (root, delta, horflag ? Qt : Qnil, Qsafe); if (window_resize_check (r, horflag) - && new_size == XINT (r->new_total)) + && new_size == XINT (WVAR (r, new_total))) window_resize_apply (r, horflag); else { @@ -3607,9 +3615,9 @@ root = FVAR (f, selected_window); Fdelete_other_windows_internal (root, Qnil); if (horflag) - XSETFASTINT (XWINDOW (root)->total_cols, new_size); + XSETFASTINT (WVAR (XWINDOW (root), total_cols), new_size); else - XSETFASTINT (XWINDOW (root)->total_lines, new_size); + XSETFASTINT (WVAR (XWINDOW (root), total_lines), new_size); } } } @@ -3619,12 +3627,13 @@ { m = XWINDOW (mini); if (horflag) - XSETFASTINT (m->total_cols, size); + XSETFASTINT (WVAR (m, total_cols), size); else { /* Are we sure we always want 1 line here? */ - XSETFASTINT (m->total_lines, 1); - XSETFASTINT (m->top_line, XINT (r->top_line) + XINT (r->total_lines)); + XSETFASTINT (WVAR (m, total_lines), 1); + XSETFASTINT (WVAR (m, top_line), XINT (WVAR (r, top_line)) + + XINT (WVAR (r, total_lines))); } } } @@ -3680,10 +3689,10 @@ parent, or OLD is ortho-combined. */ combination_limit = !NILP (Vwindow_combination_limit) - || NILP (o->parent) + || NILP (WVAR (o, parent)) || NILP (horflag - ? (XWINDOW (o->parent)->hchild) - : (XWINDOW (o->parent)->vchild)); + ? (WVAR (XWINDOW (WVAR (o, parent)), hchild)) + : (WVAR (XWINDOW (WVAR (o, parent)), vchild))); /* We need a live reference window to initialize some parameters. */ if (WINDOW_LIVE_P (old)) @@ -3703,23 +3712,24 @@ /* `window-combination-resize' non-nil means try to resize OLD's siblings proportionally. */ { - p = XWINDOW (o->parent); + p = XWINDOW (WVAR (o, parent)); /* Temporarily pretend we split the parent window. */ - XSETINT (p->new_total, - XINT (horflag ? p->total_cols : p->total_lines) + XSETINT (WVAR (p, new_total), + XINT (horflag ? WVAR (p, total_cols) : WVAR (p, total_lines)) - XINT (total_size)); if (!window_resize_check (p, horflag)) error ("Window sizes don't fit"); else /* Undo the temporary pretension. */ - p->new_total = horflag ? p->total_cols : p->total_lines; + WVAR (p, new_total) + = horflag ? WVAR (p, total_cols) : WVAR (p, total_lines); } else { if (!window_resize_check (o, horflag)) error ("Resizing old window failed"); - else if (XINT (total_size) + XINT (o->new_total) - != XINT (horflag ? o->total_cols : o->total_lines)) + else if (XINT (total_size) + XINT (WVAR (o, new_total)) + != XINT (horflag ? WVAR (o, total_cols) : WVAR (o, total_lines))) error ("Sum of sizes of old and new window don't fit"); } @@ -3729,93 +3739,95 @@ /* Save the old value of o->normal_cols/lines. It gets corrupted by make_parent_window and we need it below for assigning it to p->new_normal. */ - Lisp_Object new_normal = horflag ? o->normal_cols : o->normal_lines; + Lisp_Object new_normal + = horflag ? WVAR (o, normal_cols) : WVAR (o, normal_lines); make_parent_window (old, horflag); - p = XWINDOW (o->parent); + p = XWINDOW (WVAR (o, parent)); /* Store value of `window-combination-limit' in new parent's combination_limit slot. */ - p->combination_limit = Vwindow_combination_limit; + WVAR (p, combination_limit) = Vwindow_combination_limit; /* These get applied below. */ - p->new_total = horflag ? o->total_cols : o->total_lines; - p->new_normal = new_normal; + WVAR (p, new_total) + = horflag ? WVAR (o, total_cols) : WVAR (o, total_lines); + WVAR (p, new_normal) = new_normal; } else - p = XWINDOW (o->parent); + p = XWINDOW (WVAR (o, parent)); windows_or_buffers_changed++; FRAME_WINDOW_SIZES_CHANGED (f) = 1; new = make_window (); n = XWINDOW (new); - n->frame = frame; - n->parent = o->parent; - n->vchild = n->hchild = Qnil; + WVAR (n, frame) = frame; + WVAR (n, parent) = WVAR (o, parent); + WVAR (n, vchild) = WVAR (n, hchild) = Qnil; if (EQ (side, Qabove) || EQ (side, Qleft)) { - n->prev = o->prev; - if (NILP (n->prev)) + WVAR (n, prev) = WVAR (o, prev); + if (NILP (WVAR (n, prev))) if (horflag) - p->hchild = new; + WVAR (p, hchild) = new; else - p->vchild = new; + WVAR (p, vchild) = new; else - XWINDOW (n->prev)->next = new; - n->next = old; - o->prev = new; + WVAR (XWINDOW (WVAR (n, prev)), next) = new; + WVAR (n, next) = old; + WVAR (o, prev) = new; } else { - n->next = o->next; - if (!NILP (n->next)) - XWINDOW (n->next)->prev = new; - n->prev = old; - o->next = new; + WVAR (n, next) = WVAR (o, next); + if (!NILP (WVAR (n, next))) + WVAR (XWINDOW (WVAR (n, next)), prev) = new; + WVAR (n, prev) = old; + WVAR (o, next) = new; } - n->buffer = Qt; - n->window_end_valid = Qnil; + WVAR (n, buffer) = Qt; + WVAR (n, window_end_valid) = Qnil; memset (&n->last_cursor, 0, sizeof n->last_cursor); /* Get special geometry settings from reference window. */ - n->left_margin_cols = r->left_margin_cols; - n->right_margin_cols = r->right_margin_cols; - n->left_fringe_width = r->left_fringe_width; - n->right_fringe_width = r->right_fringe_width; + WVAR (n, left_margin_cols) = WVAR (r, left_margin_cols); + WVAR (n, right_margin_cols) = WVAR (r, right_margin_cols); + WVAR (n, left_fringe_width) = WVAR (r, left_fringe_width); + WVAR (n, right_fringe_width) = WVAR (r, right_fringe_width); n->fringes_outside_margins = r->fringes_outside_margins; - n->scroll_bar_width = r->scroll_bar_width; - n->vertical_scroll_bar_type = r->vertical_scroll_bar_type; + WVAR (n, scroll_bar_width) = WVAR (r, scroll_bar_width); + WVAR (n, vertical_scroll_bar_type) = WVAR (r, vertical_scroll_bar_type); /* Directly assign orthogonal coordinates and sizes. */ if (horflag) { - n->top_line = o->top_line; - n->total_lines = o->total_lines; + WVAR (n, top_line) = WVAR (o, top_line); + WVAR (n, total_lines) = WVAR (o, total_lines); } else { - n->left_col = o->left_col; - n->total_cols = o->total_cols; + WVAR (n, left_col) = WVAR (o, left_col); + WVAR (n, total_cols) = WVAR (o, total_cols); } /* Iso-coordinates and sizes are assigned by window_resize_apply, get them ready here. */ - n->new_total = total_size; - n->new_normal = normal_size; + WVAR (n, new_total) = total_size; + WVAR (n, new_normal) = normal_size; BLOCK_INPUT; window_resize_apply (p, horflag); adjust_glyphs (f); /* Set buffer of NEW to buffer of reference window. Don't run any hooks. */ - set_window_buffer (new, r->buffer, 0, 1); + set_window_buffer (new, WVAR (r, buffer), 0, 1); UNBLOCK_INPUT; /* Maybe we should run the scroll functions in Elisp (which already runs the configuration change hook). */ if (! NILP (Vwindow_scroll_functions)) run_hook_with_args_2 (Qwindow_scroll_functions, new, - Fmarker_position (n->start)); + Fmarker_position (WVAR (n, start))); /* Return NEW. */ return new; } @@ -3835,21 +3847,22 @@ w = decode_any_window (window); XSETWINDOW (window, w); - if (NILP (w->buffer) && NILP (w->hchild) && NILP (w->vchild)) + if (NILP (WVAR (w, buffer)) + && NILP (WVAR (w, hchild)) && NILP (WVAR (w, vchild))) /* It's a no-op to delete an already deleted window. */ return Qnil; - parent = w->parent; + parent = WVAR (w, parent); if (NILP (parent)) /* Never delete a minibuffer or frame root window. */ error ("Attempt to delete minibuffer or sole ordinary window"); - else if (NILP (w->prev) && NILP (w->next)) + else if (NILP (WVAR (w, prev)) && NILP (WVAR (w, next))) /* Rather bow out here, this case should be handled on the Elisp level. */ error ("Attempt to delete sole window of parent"); p = XWINDOW (parent); - horflag = NILP (p->vchild); + horflag = NILP (WVAR (p, vchild)); frame = WINDOW_FRAME (w); f = XFRAME (frame); @@ -3858,32 +3871,33 @@ r = XWINDOW (root); /* Unlink WINDOW from window tree. */ - if (NILP (w->prev)) + if (NILP (WVAR (w, prev))) /* Get SIBLING below (on the right of) WINDOW. */ { /* before_sibling 1 means WINDOW is the first child of its parent and thus before the sibling. */ before_sibling = 1; - sibling = w->next; + sibling = WVAR (w, next); s = XWINDOW (sibling); - s->prev = Qnil; + WVAR (s, prev) = Qnil; if (horflag) - p->hchild = sibling; + WVAR (p, hchild) = sibling; else - p->vchild = sibling; + WVAR (p, vchild) = sibling; } else /* Get SIBLING above (on the left of) WINDOW. */ { - sibling = w->prev; + sibling = WVAR (w, prev); s = XWINDOW (sibling); - s->next = w->next; - if (!NILP (s->next)) - XWINDOW (s->next)->prev = sibling; + WVAR (s, next) = WVAR (w, next); + if (!NILP (WVAR (s, next))) + WVAR (XWINDOW (WVAR (s, next)), prev) = sibling; } if (window_resize_check (r, horflag) - && EQ (r->new_total, (horflag ? r->total_cols : r->total_lines))) + && EQ (WVAR (r, new_total), + (horflag ? WVAR (r, total_cols) : WVAR (r, total_lines)))) /* We can delete WINDOW now. */ { @@ -3905,28 +3919,28 @@ Vwindow_list = Qnil; FRAME_WINDOW_SIZES_CHANGED (f) = 1; - w->next = Qnil; /* Don't delete w->next too. */ + WVAR (w, next) = Qnil; /* Don't delete w->next too. */ free_window_matrices (w); - if (!NILP (w->vchild)) - { - delete_all_child_windows (w->vchild); - w->vchild = Qnil; - } - else if (!NILP (w->hchild)) - { - delete_all_child_windows (w->hchild); - w->hchild = Qnil; - } - else if (!NILP (w->buffer)) + if (!NILP (WVAR (w, vchild))) + { + delete_all_child_windows (WVAR (w, vchild)); + WVAR (w, vchild) = Qnil; + } + else if (!NILP (WVAR (w, hchild))) + { + delete_all_child_windows (WVAR (w, hchild)); + WVAR (w, hchild) = Qnil; + } + else if (!NILP (WVAR (w, buffer))) { unshow_buffer (w); - unchain_marker (XMARKER (w->pointm)); - unchain_marker (XMARKER (w->start)); - w->buffer = Qnil; + unchain_marker (XMARKER (WVAR (w, pointm))); + unchain_marker (XMARKER (WVAR (w, start))); + WVAR (w, buffer) = Qnil; } - if (NILP (s->prev) && NILP (s->next)) + if (NILP (WVAR (s, prev)) && NILP (WVAR (s, next))) /* A matrjoshka where SIBLING has become the only child of PARENT. */ { @@ -3934,10 +3948,10 @@ replace_window (parent, sibling, 0); /* Have SIBLING inherit the following three slot values from PARENT (the combination_limit slot is not inherited). */ - s->normal_cols = p->normal_cols; - s->normal_lines = p->normal_lines; + WVAR (s, normal_cols) = WVAR (p, normal_cols); + WVAR (s, normal_lines) = WVAR (p, normal_lines); /* Mark PARENT as deleted. */ - p->vchild = p->hchild = Qnil; + WVAR (p, vchild) = WVAR (p, hchild) = Qnil; /* Try to merge SIBLING into its new parent. */ recombine_windows (sibling); } @@ -3964,7 +3978,7 @@ /* Now look whether `get-mru-window' gets us something. */ mru_window = call1 (Qget_mru_window, frame); if (WINDOW_LIVE_P (mru_window) - && EQ (XWINDOW (mru_window)->frame, frame)) + && EQ (WVAR (XWINDOW (mru_window), frame), frame)) new_selected_window = mru_window; /* If all ended up well, we now promote the mru window. */ @@ -3984,17 +3998,17 @@ { if (before_sibling) { - s->prev = window; + WVAR (s, prev) = window; if (horflag) - p->hchild = window; + WVAR (p, hchild) = window; else - p->vchild = window; + WVAR (p, vchild) = window; } else { - s->next = window; - if (!NILP (w->next)) - XWINDOW (w->next)->prev = window; + WVAR (s, next) = window; + if (!NILP (WVAR (w, next))) + WVAR (XWINDOW (WVAR (w, next)), prev) = window; } error ("Deletion failed"); } @@ -4011,7 +4025,7 @@ void grow_mini_window (struct window *w, int delta) { - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); struct window *r; Lisp_Object root, value; @@ -4028,8 +4042,9 @@ window_resize_apply (r, 0); /* Grow the mini-window. */ - XSETFASTINT (w->top_line, XFASTINT (r->top_line) + XFASTINT (r->total_lines)); - XSETFASTINT (w->total_lines, XFASTINT (w->total_lines) - XINT (value)); + XSETFASTINT (WVAR (w, top_line), + XFASTINT (WVAR (r, top_line)) + XFASTINT (WVAR (r, total_lines))); + XSETFASTINT (WVAR (w, total_lines), XFASTINT (WVAR (w, total_lines)) - XINT (value)); w->last_modified = 0; w->last_overlay_modified = 0; @@ -4043,14 +4058,14 @@ void shrink_mini_window (struct window *w) { - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); struct window *r; Lisp_Object root, value; EMACS_INT size; eassert (MINI_WINDOW_P (w)); - size = XINT (w->total_lines); + size = XINT (WVAR (w, total_lines)); if (size > 1) { root = FRAME_ROOT_WINDOW (f); @@ -4063,8 +4078,9 @@ window_resize_apply (r, 0); /* Shrink the mini-window. */ - XSETFASTINT (w->top_line, XFASTINT (r->top_line) + XFASTINT (r->total_lines)); - XSETFASTINT (w->total_lines, 1); + XSETFASTINT (WVAR (w, top_line), XFASTINT (WVAR (r, top_line)) + + XFASTINT (WVAR (r, total_lines))); + XSETFASTINT (WVAR (w, total_lines), 1); w->last_modified = 0; w->last_overlay_modified = 0; @@ -4089,24 +4105,25 @@ int height; CHECK_WINDOW (window); - f = XFRAME (w->frame); + f = XFRAME (WVAR (w, frame)); - if (!EQ (FRAME_MINIBUF_WINDOW (XFRAME (w->frame)), window)) + if (!EQ (FRAME_MINIBUF_WINDOW (XFRAME (WVAR (w, frame))), window)) error ("Not a valid minibuffer window"); else if (FRAME_MINIBUF_ONLY_P (f)) error ("Cannot resize a minibuffer-only frame"); r = XWINDOW (FRAME_ROOT_WINDOW (f)); - height = XINT (r->total_lines) + XINT (w->total_lines); + height = XINT (WVAR (r, total_lines)) + XINT (WVAR (w, total_lines)); if (window_resize_check (r, 0) - && XINT (w->new_total) > 0 - && height == XINT (r->new_total) + XINT (w->new_total)) + && XINT (WVAR (w, new_total)) > 0 + && height == XINT (WVAR (r, new_total)) + XINT (WVAR (w, new_total))) { BLOCK_INPUT; window_resize_apply (r, 0); - w->total_lines = w->new_total; - XSETFASTINT (w->top_line, XINT (r->top_line) + XINT (r->total_lines)); + WVAR (w, total_lines) = WVAR (w, new_total); + XSETFASTINT (WVAR (w, top_line), + XINT (WVAR (r, top_line)) + XINT (WVAR (r, total_lines))); windows_or_buffers_changed++; FRAME_WINDOW_SIZES_CHANGED (f) = 1; @@ -4129,14 +4146,14 @@ { while (w) { - if (!NILP (w->hchild)) - mark_window_cursors_off (XWINDOW (w->hchild)); - else if (!NILP (w->vchild)) - mark_window_cursors_off (XWINDOW (w->vchild)); + if (!NILP (WVAR (w, hchild))) + mark_window_cursors_off (XWINDOW (WVAR (w, hchild))); + else if (!NILP (WVAR (w, vchild))) + mark_window_cursors_off (XWINDOW (WVAR (w, vchild))); else w->phys_cursor_on_p = 0; - w = NILP (w->next) ? 0 : XWINDOW (w->next); + w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); } } @@ -4146,15 +4163,15 @@ int window_internal_height (struct window *w) { - int ht = XFASTINT (w->total_lines); + int ht = XFASTINT (WVAR (w, total_lines)); if (!MINI_WINDOW_P (w)) { - if (!NILP (w->parent) - || !NILP (w->vchild) - || !NILP (w->hchild) - || !NILP (w->next) - || !NILP (w->prev) + if (!NILP (WVAR (w, parent)) + || !NILP (WVAR (w, vchild)) + || !NILP (WVAR (w, hchild)) + || !NILP (WVAR (w, next)) + || !NILP (WVAR (w, prev)) || WINDOW_WANTS_MODELINE_P (w)) --ht; @@ -4184,7 +4201,7 @@ /* If we must, use the pixel-based version which is much slower than the line-based one but can handle varying line heights. */ - if (FRAME_WINDOW_P (XFRAME (XWINDOW (window)->frame))) + if (FRAME_WINDOW_P (XFRAME (WVAR (XWINDOW (window), frame)))) window_scroll_pixel_based (window, n, whole, noerror); else window_scroll_line_based (window, n, whole, noerror); @@ -4209,7 +4226,7 @@ int x, y, rtop, rbot, rowh, vpos; void *itdata = NULL; - SET_TEXT_POS_FROM_MARKER (start, w->start); + SET_TEXT_POS_FROM_MARKER (start, WVAR (w, start)); /* Scrolling a minibuffer window via scroll bar when the echo area shows long text sometimes resets the minibuffer contents behind our backs. */ @@ -4290,8 +4307,8 @@ spos = XINT (Fline_beginning_position (Qnil)); else spos = min (XINT (Fline_end_position (Qnil)) + 1, ZV); - set_marker_restricted (w->start, make_number (spos), - w->buffer); + set_marker_restricted (WVAR (w, start), make_number (spos), + WVAR (w, buffer)); w->start_at_line_beg = 1; w->update_mode_line = 1; w->last_modified = 0; @@ -4415,7 +4432,7 @@ /* If control gets here, then we vscrolled. */ - XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; + XBUFFER (WVAR (w, buffer))->prevent_redisplay_optimizations_p = 1; /* Don't try to change the window start below. */ vscrolled = 1; @@ -4435,9 +4452,9 @@ } /* Set the window start, and set up the window for redisplay. */ - set_marker_restricted (w->start, make_number (pos), - w->buffer); - bytepos = XMARKER (w->start)->bytepos; + set_marker_restricted (WVAR (w, start), make_number (pos), + WVAR (w, buffer)); + bytepos = XMARKER (WVAR (w, start))->bytepos; w->start_at_line_beg = (pos == BEGV || FETCH_BYTE (bytepos - 1) == '\n'); w->update_mode_line = 1; w->last_modified = 0; @@ -4455,7 +4472,8 @@ This code wants current_y to be zero at the window start position even if there is a header line. */ this_scroll_margin = max (0, scroll_margin); - this_scroll_margin = min (this_scroll_margin, XFASTINT (w->total_lines) / 4); + this_scroll_margin + = min (this_scroll_margin, XFASTINT (WVAR (w, total_lines)) / 4); this_scroll_margin *= FRAME_LINE_HEIGHT (it.f); if (n > 0) @@ -4529,7 +4547,7 @@ ; else if (window_scroll_pixel_based_preserve_y >= 0) { - SET_TEXT_POS_FROM_MARKER (start, w->start); + SET_TEXT_POS_FROM_MARKER (start, WVAR (w, start)); start_display (&it, w, start); /* It would be wrong to subtract CURRENT_HEADER_LINE_HEIGHT here because we called start_display again and did not @@ -4583,7 +4601,7 @@ if (whole) n *= max (1, ht - next_screen_context_lines); - startpos = marker_position (w->start); + startpos = marker_position (WVAR (w, start)); if (!NILP (Vscroll_preserve_screen_position)) { @@ -4634,9 +4652,9 @@ { /* Don't use a scroll margin that is negative or too large. */ int this_scroll_margin = - max (0, min (scroll_margin, XINT (w->total_lines) / 4)); + max (0, min (scroll_margin, XINT (WVAR (w, total_lines)) / 4)); - set_marker_restricted_both (w->start, w->buffer, pos, pos_byte); + set_marker_restricted_both (WVAR (w, start), WVAR (w, buffer), pos, pos_byte); w->start_at_line_beg = !NILP (bolp); w->update_mode_line = 1; w->last_modified = 0; @@ -4730,10 +4748,10 @@ /* If selected window's buffer isn't current, make it current for the moment. But don't screw up if window_scroll gets an error. */ - if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer) + if (XBUFFER (WVAR (XWINDOW (selected_window), buffer)) != current_buffer) { record_unwind_protect (save_excursion_restore, save_excursion_save ()); - Fset_buffer (XWINDOW (selected_window)->buffer); + Fset_buffer (WVAR (XWINDOW (selected_window), buffer)); /* Make redisplay consider other windows than just selected_window. */ ++windows_or_buffers_changed; @@ -4848,8 +4866,8 @@ record_unwind_protect (save_excursion_restore, save_excursion_save ()); ++windows_or_buffers_changed; - Fset_buffer (w->buffer); - SET_PT (marker_position (w->pointm)); + Fset_buffer (WVAR (w, buffer)); + SET_PT (marker_position (WVAR (w, pointm))); if (NILP (arg)) window_scroll (window, 1, 1, 1); @@ -4863,7 +4881,7 @@ window_scroll (window, XINT (arg), 0, 1); } - set_marker_both (w->pointm, Qnil, PT, PT_BYTE); + set_marker_both (WVAR (w, pointm), Qnil, PT, PT_BYTE); unbind_to (count, Qnil); return Qnil; @@ -4941,10 +4959,10 @@ int bottom_y; void *itdata = NULL; - if (XBUFFER (w->buffer) != current_buffer) + if (XBUFFER (WVAR (w, buffer)) != current_buffer) { old_buffer = current_buffer; - set_buffer_internal (XBUFFER (w->buffer)); + set_buffer_internal (XBUFFER (WVAR (w, buffer))); } else old_buffer = NULL; @@ -4952,12 +4970,12 @@ /* In case W->start is out of the accessible range, do something reasonable. This happens in Info mode when Info-scroll-down calls (recenter -1) while W->start is 1. */ - if (XMARKER (w->start)->charpos < BEGV) + if (XMARKER (WVAR (w, start))->charpos < BEGV) SET_TEXT_POS (start, BEGV, BEGV_BYTE); - else if (XMARKER (w->start)->charpos > ZV) + else if (XMARKER (WVAR (w, start))->charpos > ZV) SET_TEXT_POS (start, ZV, ZV_BYTE); else - SET_TEXT_POS_FROM_MARKER (start, w->start); + SET_TEXT_POS_FROM_MARKER (start, WVAR (w, start)); itdata = bidi_shelve_cache (); start_display (&it, w, start); @@ -4971,7 +4989,7 @@ This kludge fixes a bug whereby (move-to-window-line -1) when ZV is on the last screen line moves to the previous screen line instead of the last one. */ - if (! FRAME_WINDOW_P (XFRAME (w->frame))) + if (! FRAME_WINDOW_P (XFRAME (WVAR (w, frame)))) height++; /* Add in empty lines at the bottom of the window. */ @@ -5006,7 +5024,7 @@ (register Lisp_Object arg) { struct window *w = XWINDOW (selected_window); - struct buffer *buf = XBUFFER (w->buffer); + struct buffer *buf = XBUFFER (WVAR (w, buffer)); struct buffer *obuf = current_buffer; int center_p = 0; ptrdiff_t charpos, bytepos; @@ -5050,12 +5068,12 @@ /* Do this after making BUF current in case scroll_margin is buffer-local. */ this_scroll_margin = - max (0, min (scroll_margin, XFASTINT (w->total_lines) / 4)); + max (0, min (scroll_margin, XFASTINT (WVAR (w, total_lines)) / 4)); /* Handle centering on a graphical frame specially. Such frames can have variable-height lines and centering point on the basis of line counts would lead to strange effects. */ - if (FRAME_WINDOW_P (XFRAME (w->frame))) + if (FRAME_WINDOW_P (XFRAME (WVAR (w, frame)))) { if (center_p) { @@ -5172,8 +5190,8 @@ } /* Set the new window start. */ - set_marker_both (w->start, w->buffer, charpos, bytepos); - w->window_end_valid = Qnil; + set_marker_both (WVAR (w, start), WVAR (w, buffer), charpos, bytepos); + WVAR (w, window_end_valid) = Qnil; w->optional_new_start = 1; @@ -5195,7 +5213,7 @@ { struct window *w = decode_window (window); int pixel_height = window_box_height (w); - int line_height = pixel_height / FRAME_LINE_HEIGHT (XFRAME (w->frame)); + int line_height = pixel_height / FRAME_LINE_HEIGHT (XFRAME (WVAR (w, frame))); return make_number (line_height); } @@ -5216,24 +5234,24 @@ int this_scroll_margin; #endif - if (!(BUFFERP (w->buffer) - && XBUFFER (w->buffer) == current_buffer)) + if (!(BUFFERP (WVAR (w, buffer)) + && XBUFFER (WVAR (w, buffer)) == current_buffer)) /* This test is needed to make sure PT/PT_BYTE make sense in w->buffer when passed below to set_marker_both. */ error ("move-to-window-line called from unrelated buffer"); window = selected_window; - start = marker_position (w->start); + start = marker_position (WVAR (w, start)); if (start < BEGV || start > ZV) { int height = window_internal_height (w); Fvertical_motion (make_number (- (height / 2)), window); - set_marker_both (w->start, w->buffer, PT, PT_BYTE); + set_marker_both (WVAR (w, start), WVAR (w, buffer), PT, PT_BYTE); w->start_at_line_beg = !NILP (Fbolp ()); w->force_start = 1; } else - Fgoto_char (w->start); + Fgoto_char (WVAR (w, start)); lines = displayed_window_lines (w); @@ -5337,7 +5355,7 @@ data = (struct save_window_data *) XVECTOR (config); saved_windows = XVECTOR (data->saved_windows); - return XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame; + return WVAR (XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window), frame); } DEFUN ("set-window-configuration", Fset_window_configuration, @@ -5379,11 +5397,11 @@ window-point of the final-selected-window to the window-point of the current-selected-window. So we have to be careful which point of the current-buffer we copy into old_point. */ - if (EQ (XWINDOW (data->current_window)->buffer, new_current_buffer) + if (EQ (WVAR (XWINDOW (data->current_window), buffer), new_current_buffer) && WINDOWP (selected_window) - && EQ (XWINDOW (selected_window)->buffer, new_current_buffer) + && EQ (WVAR (XWINDOW (selected_window), buffer), new_current_buffer) && !EQ (selected_window, data->current_window)) - old_point = XMARKER (XWINDOW (data->current_window)->pointm)->charpos; + old_point = XMARKER (WVAR (XWINDOW (data->current_window), pointm))->charpos; else old_point = PT; else @@ -5395,15 +5413,15 @@ So if possible we want this arbitrary choice of "which point" to be the one from the to-be-selected-window so as to prevent this window's cursor from being copied from another window. */ - if (EQ (XWINDOW (data->current_window)->buffer, new_current_buffer) + if (EQ (WVAR (XWINDOW (data->current_window), buffer), new_current_buffer) /* If current_window = selected_window, its point is in BUF_PT. */ && !EQ (selected_window, data->current_window)) - old_point = XMARKER (XWINDOW (data->current_window)->pointm)->charpos; + old_point = XMARKER (WVAR (XWINDOW (data->current_window), pointm))->charpos; else old_point = BUF_PT (XBUFFER (new_current_buffer)); } - frame = XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame; + frame = WVAR (XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window), frame); f = XFRAME (frame); /* If f is a dead frame, don't bother rebuilding its window tree. @@ -5456,13 +5474,13 @@ window holds garbage.) We do this now, before restoring the window contents, and prevent it from being done later on when we select a new window. */ - if (! NILP (XWINDOW (selected_window)->buffer)) + if (! NILP (WVAR (XWINDOW (selected_window), buffer))) { w = XWINDOW (selected_window); - set_marker_both (w->pointm, - w->buffer, - BUF_PT (XBUFFER (w->buffer)), - BUF_PT_BYTE (XBUFFER (w->buffer))); + set_marker_both (WVAR (w, pointm), + WVAR (w, buffer), + BUF_PT (XBUFFER (WVAR (w, buffer))), + BUF_PT_BYTE (XBUFFER (WVAR (w, buffer)))); } windows_or_buffers_changed++; @@ -5491,60 +5509,60 @@ p = SAVED_WINDOW_N (saved_windows, k); window = p->window; w = XWINDOW (window); - w->next = Qnil; + WVAR (w, next) = Qnil; if (!NILP (p->parent)) - w->parent = SAVED_WINDOW_N (saved_windows, - XFASTINT (p->parent))->window; + WVAR (w, parent) = SAVED_WINDOW_N (saved_windows, + XFASTINT (p->parent))->window; else - w->parent = Qnil; + WVAR (w, parent) = Qnil; if (!NILP (p->prev)) { - w->prev = SAVED_WINDOW_N (saved_windows, - XFASTINT (p->prev))->window; - XWINDOW (w->prev)->next = p->window; + WVAR (w, prev) = SAVED_WINDOW_N (saved_windows, + XFASTINT (p->prev))->window; + WVAR (XWINDOW (WVAR (w, prev)), next) = p->window; } else { - w->prev = Qnil; - if (!NILP (w->parent)) + WVAR (w, prev) = Qnil; + if (!NILP (WVAR (w, parent))) { - if (EQ (p->total_cols, XWINDOW (w->parent)->total_cols)) + if (EQ (p->total_cols, WVAR (XWINDOW (WVAR (w, parent)), total_cols))) { - XWINDOW (w->parent)->vchild = p->window; - XWINDOW (w->parent)->hchild = Qnil; + WVAR (XWINDOW (WVAR (w, parent)), vchild) = p->window; + WVAR (XWINDOW (WVAR (w, parent)), hchild) = Qnil; } else { - XWINDOW (w->parent)->hchild = p->window; - XWINDOW (w->parent)->vchild = Qnil; + WVAR (XWINDOW (WVAR (w, parent)), hchild) = p->window; + WVAR (XWINDOW (WVAR (w, parent)), vchild) = Qnil; } } } /* If we squirreled away the buffer in the window's height, restore it now. */ - if (BUFFERP (w->total_lines)) - w->buffer = w->total_lines; - w->left_col = p->left_col; - w->top_line = p->top_line; - w->total_cols = p->total_cols; - w->total_lines = p->total_lines; - w->normal_cols = p->normal_cols; - w->normal_lines = p->normal_lines; + if (BUFFERP (WVAR (w, total_lines))) + WVAR (w, buffer) = WVAR (w, total_lines); + WVAR (w, left_col) = p->left_col; + WVAR (w, top_line) = p->top_line; + WVAR (w, total_cols) = p->total_cols; + WVAR (w, total_lines) = p->total_lines; + WVAR (w, normal_cols) = p->normal_cols; + WVAR (w, normal_lines) = p->normal_lines; w->hscroll = XFASTINT (p->hscroll); w->min_hscroll = XFASTINT (p->min_hscroll); - w->display_table = p->display_table; - w->left_margin_cols = p->left_margin_cols; - w->right_margin_cols = p->right_margin_cols; - w->left_fringe_width = p->left_fringe_width; - w->right_fringe_width = p->right_fringe_width; + WVAR (w, display_table) = p->display_table; + WVAR (w, left_margin_cols) = p->left_margin_cols; + WVAR (w, right_margin_cols) = p->right_margin_cols; + WVAR (w, left_fringe_width) = p->left_fringe_width; + WVAR (w, right_fringe_width) = p->right_fringe_width; w->fringes_outside_margins = !NILP (p->fringes_outside_margins); - w->scroll_bar_width = p->scroll_bar_width; - w->vertical_scroll_bar_type = p->vertical_scroll_bar_type; - w->dedicated = p->dedicated; - w->combination_limit = p->combination_limit; + WVAR (w, scroll_bar_width) = p->scroll_bar_width; + WVAR (w, vertical_scroll_bar_type) = p->vertical_scroll_bar_type; + WVAR (w, dedicated) = p->dedicated; + WVAR (w, combination_limit) = p->combination_limit; /* Restore any window parameters that have been saved. Parameters that have not been saved are left alone. */ for (tem = p->window_parameters; CONSP (tem); tem = XCDR (tem)) @@ -5554,7 +5572,7 @@ { if (NILP (XCDR (pers))) { - par = Fassq (XCAR (pers), w->window_parameters); + par = Fassq (XCAR (pers), WVAR (w, window_parameters)); if (CONSP (par) && !NILP (XCDR (par))) /* Reset a parameter to nil if and only if it has a non-nil association. Don't make new @@ -5573,45 +5591,50 @@ /* Reinstall the saved buffer and pointers into it. */ if (NILP (p->buffer)) /* An internal window. */ - w->buffer = p->buffer; + WVAR (w, buffer) = p->buffer; else if (!NILP (BVAR (XBUFFER (p->buffer), name))) /* If saved buffer is alive, install it. */ { - w->buffer = p->buffer; + WVAR (w, buffer) = p->buffer; w->start_at_line_beg = !NILP (p->start_at_line_beg); - set_marker_restricted (w->start, p->start, w->buffer); - set_marker_restricted (w->pointm, p->pointm, w->buffer); - Fset_marker (BVAR (XBUFFER (w->buffer), mark), - p->mark, w->buffer); + set_marker_restricted (WVAR (w, start), p->start, WVAR (w, buffer)); + set_marker_restricted (WVAR (w, pointm), p->pointm, + WVAR (w, buffer)); + Fset_marker (BVAR (XBUFFER (WVAR (w, buffer)), mark), + p->mark, WVAR (w, buffer)); /* As documented in Fcurrent_window_configuration, don't restore the location of point in the buffer which was current when the window configuration was recorded. */ if (!EQ (p->buffer, new_current_buffer) && XBUFFER (p->buffer) == current_buffer) - Fgoto_char (w->pointm); + Fgoto_char (WVAR (w, pointm)); } - else if (!NILP (w->buffer) && !NILP (BVAR (XBUFFER (w->buffer), name))) + else if (!NILP (WVAR (w, buffer)) + && !NILP (BVAR (XBUFFER (WVAR (w, buffer)), name))) /* Keep window's old buffer; make sure the markers are real. */ { /* Set window markers at start of visible range. */ - if (XMARKER (w->start)->buffer == 0) - set_marker_restricted (w->start, make_number (0), - w->buffer); - if (XMARKER (w->pointm)->buffer == 0) - set_marker_restricted_both (w->pointm, w->buffer, - BUF_PT (XBUFFER (w->buffer)), - BUF_PT_BYTE (XBUFFER (w->buffer))); + if (XMARKER (WVAR (w, start))->buffer == 0) + set_marker_restricted (WVAR (w, start), make_number (0), + WVAR (w, buffer)); + if (XMARKER (WVAR (w, pointm))->buffer == 0) + set_marker_restricted_both + (WVAR (w, pointm), WVAR (w, buffer), + BUF_PT (XBUFFER (WVAR (w, buffer))), + BUF_PT_BYTE (XBUFFER (WVAR (w, buffer)))); w->start_at_line_beg = 1; } else if (STRINGP (auto_buffer_name = Fwindow_parameter (window, Qauto_buffer_name)) && SCHARS (auto_buffer_name) != 0 - && !NILP (w->buffer = Fget_buffer_create (auto_buffer_name))) + && !NILP (WVAR (w, buffer) = Fget_buffer_create (auto_buffer_name))) { - set_marker_restricted (w->start, make_number (0), w->buffer); - set_marker_restricted (w->pointm, make_number (0), w->buffer); + set_marker_restricted (WVAR (w, start), + make_number (0), WVAR (w, buffer)); + set_marker_restricted (WVAR (w, pointm), + make_number (0), WVAR (w, buffer)); w->start_at_line_beg = 1; } else @@ -5621,34 +5644,36 @@ avoid showing an unimportant buffer and, if necessary, to recreate *scratch* in the course (part of Juanma's bs-show scenario from March 2011). */ - w->buffer = other_buffer_safely (Fcurrent_buffer ()); + WVAR (w, buffer) = other_buffer_safely (Fcurrent_buffer ()); /* This will set the markers to beginning of visible range. */ - set_marker_restricted (w->start, make_number (0), w->buffer); - set_marker_restricted (w->pointm, make_number (0), w->buffer); + set_marker_restricted (WVAR (w, start), + make_number (0), WVAR (w, buffer)); + set_marker_restricted (WVAR (w, pointm), + make_number (0), WVAR (w, buffer)); w->start_at_line_beg = 1; - if (!NILP (w->dedicated)) + if (!NILP (WVAR (w, dedicated))) /* Record this window as dead. */ dead_windows = Fcons (window, dead_windows); /* Make sure window is no more dedicated. */ - w->dedicated = Qnil; + WVAR (w, dedicated) = Qnil; } } FRAME_ROOT_WINDOW (f) = data->root_window; /* Arrange *not* to restore point in the buffer that was current when the window configuration was saved. */ - if (EQ (XWINDOW (data->current_window)->buffer, new_current_buffer)) - set_marker_restricted (XWINDOW (data->current_window)->pointm, + if (EQ (WVAR (XWINDOW (data->current_window), buffer), new_current_buffer)) + set_marker_restricted (WVAR (XWINDOW (data->current_window), pointm), make_number (old_point), - XWINDOW (data->current_window)->buffer); + WVAR (XWINDOW (data->current_window), buffer)); /* In the following call to `select-window', prevent "swapping out point" in the old selected window using the buffer that has been restored into it. We already swapped out that point from that window's old buffer. */ select_window (data->current_window, Qnil, 1); - BVAR (XBUFFER (XWINDOW (selected_window)->buffer), last_selected_window) + BVAR (XBUFFER (WVAR (XWINDOW (selected_window), buffer)), last_selected_window) = selected_window; if (NILP (data->focus_frame) @@ -5675,14 +5700,14 @@ /* Now, free glyph matrices in windows that were not reused. */ for (i = n = 0; i < n_leaf_windows; ++i) { - if (NILP (leaf_windows[i]->buffer)) + if (NILP (WVAR (leaf_windows[i], buffer))) { /* Assert it's not reused as a combination. */ - eassert (NILP (leaf_windows[i]->hchild) - && NILP (leaf_windows[i]->vchild)); + eassert (NILP (WVAR (leaf_windows[i], hchild)) + && NILP (WVAR (leaf_windows[i], vchild))); free_window_matrices (leaf_windows[i]); } - else if (EQ (leaf_windows[i]->buffer, new_current_buffer)) + else if (EQ (WVAR (leaf_windows[i], buffer), new_current_buffer)) ++n; } @@ -5727,28 +5752,28 @@ w = XWINDOW (window); - if (!NILP (w->next)) + if (!NILP (WVAR (w, next))) /* Delete WINDOW's siblings (we traverse postorderly). */ - delete_all_child_windows (w->next); - - w->total_lines = w->buffer; /* See Fset_window_configuration for excuse. */ - - if (!NILP (w->vchild)) - { - delete_all_child_windows (w->vchild); - w->vchild = Qnil; - } - else if (!NILP (w->hchild)) - { - delete_all_child_windows (w->hchild); - w->hchild = Qnil; - } - else if (!NILP (w->buffer)) + delete_all_child_windows (WVAR (w, next)); + + WVAR (w, total_lines) = WVAR (w, buffer); /* See Fset_window_configuration for excuse. */ + + if (!NILP (WVAR (w, vchild))) + { + delete_all_child_windows (WVAR (w, vchild)); + WVAR (w, vchild) = Qnil; + } + else if (!NILP (WVAR (w, hchild))) + { + delete_all_child_windows (WVAR (w, hchild)); + WVAR (w, hchild) = Qnil; + } + else if (!NILP (WVAR (w, buffer))) { unshow_buffer (w); - unchain_marker (XMARKER (w->pointm)); - unchain_marker (XMARKER (w->start)); - w->buffer = Qnil; + unchain_marker (XMARKER (WVAR (w, pointm))); + unchain_marker (XMARKER (WVAR (w, start))); + WVAR (w, buffer) = Qnil; } Vwindow_list = Qnil; @@ -5758,12 +5783,12 @@ count_windows (register struct window *window) { register int count = 1; - if (!NILP (window->next)) - count += count_windows (XWINDOW (window->next)); - if (!NILP (window->vchild)) - count += count_windows (XWINDOW (window->vchild)); - if (!NILP (window->hchild)) - count += count_windows (XWINDOW (window->hchild)); + if (!NILP (WVAR (window, next))) + count += count_windows (XWINDOW (WVAR (window, next))); + if (!NILP (WVAR (window, vchild))) + count += count_windows (XWINDOW (WVAR (window, vchild))); + if (!NILP (WVAR (window, hchild))) + count += count_windows (XWINDOW (WVAR (window, hchild))); return count; } @@ -5775,14 +5800,14 @@ { while (w) { - if (!NILP (w->hchild)) - i = get_leaf_windows (XWINDOW (w->hchild), flat, i); - else if (!NILP (w->vchild)) - i = get_leaf_windows (XWINDOW (w->vchild), flat, i); + if (!NILP (WVAR (w, hchild))) + i = get_leaf_windows (XWINDOW (WVAR (w, hchild)), flat, i); + else if (!NILP (WVAR (w, vchild))) + i = get_leaf_windows (XWINDOW (WVAR (w, vchild)), flat, i); else flat[i++] = w; - w = NILP (w->next) ? 0 : XWINDOW (w->next); + w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); } return i; @@ -5835,32 +5860,32 @@ register struct window *w; register Lisp_Object tem, pers, par; - for (;!NILP (window); window = w->next) + for (;!NILP (window); window = WVAR (w, next)) { p = SAVED_WINDOW_N (vector, i); w = XWINDOW (window); - XSETFASTINT (w->temslot, i); i++; + XSETFASTINT (WVAR (w, temslot), i); i++; p->window = window; - p->buffer = w->buffer; - p->left_col = w->left_col; - p->top_line = w->top_line; - p->total_cols = w->total_cols; - p->total_lines = w->total_lines; - p->normal_cols = w->normal_cols; - p->normal_lines = w->normal_lines; + p->buffer = WVAR (w, buffer); + p->left_col = WVAR (w, left_col); + p->top_line = WVAR (w, top_line); + p->total_cols = WVAR (w, total_cols); + p->total_lines = WVAR (w, total_lines); + p->normal_cols = WVAR (w, normal_cols); + p->normal_lines = WVAR (w, normal_lines); XSETFASTINT (p->hscroll, w->hscroll); XSETFASTINT (p->min_hscroll, w->min_hscroll); - p->display_table = w->display_table; - p->left_margin_cols = w->left_margin_cols; - p->right_margin_cols = w->right_margin_cols; - p->left_fringe_width = w->left_fringe_width; - p->right_fringe_width = w->right_fringe_width; + p->display_table = WVAR (w, display_table); + p->left_margin_cols = WVAR (w, left_margin_cols); + p->right_margin_cols = WVAR (w, right_margin_cols); + p->left_fringe_width = WVAR (w, left_fringe_width); + p->right_fringe_width = WVAR (w, right_fringe_width); p->fringes_outside_margins = w->fringes_outside_margins ? Qt : Qnil; - p->scroll_bar_width = w->scroll_bar_width; - p->vertical_scroll_bar_type = w->vertical_scroll_bar_type; - p->dedicated = w->dedicated; - p->combination_limit = w->combination_limit; + p->scroll_bar_width = WVAR (w, scroll_bar_width); + p->vertical_scroll_bar_type = WVAR (w, vertical_scroll_bar_type); + p->dedicated = WVAR (w, dedicated); + p->combination_limit = WVAR (w, combination_limit); p->window_parameters = Qnil; if (!NILP (Vwindow_persistent_parameters)) @@ -5893,7 +5918,7 @@ /* Save values for persistent window parameters. */ if (CONSP (pers) && !NILP (XCDR (pers))) { - par = Fassq (XCAR (pers), w->window_parameters); + par = Fassq (XCAR (pers), WVAR (w, window_parameters)); if (NILP (par)) /* If the window has no value for the parameter, make one. */ @@ -5909,24 +5934,24 @@ } } - if (!NILP (w->buffer)) + if (!NILP (WVAR (w, buffer))) { /* Save w's value of point in the window configuration. If w is the selected window, then get the value of point from the buffer; pointm is garbage in the selected window. */ if (EQ (window, selected_window)) - p->pointm = build_marker (XBUFFER (w->buffer), - BUF_PT (XBUFFER (w->buffer)), - BUF_PT_BYTE (XBUFFER (w->buffer))); + p->pointm = build_marker (XBUFFER (WVAR (w, buffer)), + BUF_PT (XBUFFER (WVAR (w, buffer))), + BUF_PT_BYTE (XBUFFER (WVAR (w, buffer)))); else - p->pointm = Fcopy_marker (w->pointm, Qnil); + p->pointm = Fcopy_marker (WVAR (w, pointm), Qnil); XMARKER (p->pointm)->insertion_type = !NILP (Vwindow_point_insertion_type); - p->start = Fcopy_marker (w->start, Qnil); + p->start = Fcopy_marker (WVAR (w, start), Qnil); p->start_at_line_beg = w->start_at_line_beg ? Qt : Qnil; - tem = BVAR (XBUFFER (w->buffer), mark); + tem = BVAR (XBUFFER (WVAR (w, buffer)), mark); p->mark = Fcopy_marker (tem, Qnil); } else @@ -5937,20 +5962,20 @@ p->start_at_line_beg = Qnil; } - if (NILP (w->parent)) + if (NILP (WVAR (w, parent))) p->parent = Qnil; else - p->parent = XWINDOW (w->parent)->temslot; + p->parent = WVAR (XWINDOW (WVAR (w, parent)), temslot); - if (NILP (w->prev)) + if (NILP (WVAR (w, prev))) p->prev = Qnil; else - p->prev = XWINDOW (w->prev)->temslot; + p->prev = WVAR (XWINDOW (WVAR (w, prev)), temslot); - if (!NILP (w->vchild)) - i = save_window_save (w->vchild, vector, i); - if (!NILP (w->hchild)) - i = save_window_save (w->hchild, vector, i); + if (!NILP (WVAR (w, vchild))) + i = save_window_save (WVAR (w, vchild), vector, i); + if (!NILP (WVAR (w, hchild))) + i = save_window_save (WVAR (w, hchild), vector, i); } return i; @@ -6039,11 +6064,11 @@ right_width = Qnil; } - if (!EQ (w->left_margin_cols, left_width) - || !EQ (w->right_margin_cols, right_width)) + if (!EQ (WVAR (w, left_margin_cols), left_width) + || !EQ (WVAR (w, right_margin_cols), right_width)) { - w->left_margin_cols = left_width; - w->right_margin_cols = right_width; + WVAR (w, left_margin_cols) = left_width; + WVAR (w, right_margin_cols) = right_width; adjust_window_margins (w); @@ -6065,7 +6090,7 @@ (Lisp_Object window) { struct window *w = decode_window (window); - return Fcons (w->left_margin_cols, w->right_margin_cols); + return Fcons (WVAR (w, left_margin_cols), WVAR (w, right_margin_cols)); } @@ -6099,18 +6124,18 @@ /* Do nothing on a tty. */ if (FRAME_WINDOW_P (WINDOW_XFRAME (w)) - && (!EQ (w->left_fringe_width, left_width) - || !EQ (w->right_fringe_width, right_width) + && (!EQ (WVAR (w, left_fringe_width), left_width) + || !EQ (WVAR (w, right_fringe_width), right_width) || w->fringes_outside_margins != outside)) { - w->left_fringe_width = left_width; - w->right_fringe_width = right_width; + WVAR (w, left_fringe_width) = left_width; + WVAR (w, right_fringe_width) = right_width; w->fringes_outside_margins = outside; adjust_window_margins (w); clear_glyph_matrix (w->current_matrix); - w->window_end_valid = Qnil; + WVAR (w, window_end_valid) = Qnil; ++windows_or_buffers_changed; adjust_glyphs (XFRAME (WINDOW_FRAME (w))); @@ -6170,16 +6195,16 @@ || EQ (vertical_type, Qt))) error ("Invalid type of vertical scroll bar"); - if (!EQ (w->scroll_bar_width, width) - || !EQ (w->vertical_scroll_bar_type, vertical_type)) + if (!EQ (WVAR (w, scroll_bar_width), width) + || !EQ (WVAR (w, vertical_scroll_bar_type), vertical_type)) { - w->scroll_bar_width = width; - w->vertical_scroll_bar_type = vertical_type; + WVAR (w, scroll_bar_width) = width; + WVAR (w, vertical_scroll_bar_type) = vertical_type; adjust_window_margins (w); clear_glyph_matrix (w->current_matrix); - w->window_end_valid = Qnil; + WVAR (w, window_end_valid) = Qnil; ++windows_or_buffers_changed; adjust_glyphs (XFRAME (WINDOW_FRAME (w))); @@ -6203,7 +6228,7 @@ ? WINDOW_CONFIG_SCROLL_BAR_WIDTH (w) : WINDOW_SCROLL_BAR_AREA_WIDTH (w))), Fcons (make_number (WINDOW_SCROLL_BAR_COLS (w)), - Fcons (w->vertical_scroll_bar_type, + Fcons (WVAR (w, vertical_scroll_bar_type), Fcons (Qnil, Qnil)))); } @@ -6229,7 +6254,7 @@ else CHECK_WINDOW (window); w = XWINDOW (window); - f = XFRAME (w->frame); + f = XFRAME (WVAR (w, frame)); if (FRAME_WINDOW_P (f)) result = (NILP (pixels_p) @@ -6263,7 +6288,7 @@ CHECK_NUMBER_OR_FLOAT (vscroll); w = XWINDOW (window); - f = XFRAME (w->frame); + f = XFRAME (WVAR (w, frame)); if (FRAME_WINDOW_P (f)) { @@ -6282,7 +6307,7 @@ adjust_glyphs (f); /* Prevent redisplay shortcuts. */ - XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; + XBUFFER (WVAR (w, buffer))->prevent_redisplay_optimizations_p = 1; } } @@ -6316,14 +6341,14 @@ for (cont = 1; w && cont;) { - if (!NILP (w->hchild)) - cont = foreach_window_1 (XWINDOW (w->hchild), fn, user_data); - else if (!NILP (w->vchild)) - cont = foreach_window_1 (XWINDOW (w->vchild), fn, user_data); + if (!NILP (WVAR (w, hchild))) + cont = foreach_window_1 (XWINDOW (WVAR (w, hchild)), fn, user_data); + else if (!NILP (WVAR (w, vchild))) + cont = foreach_window_1 (XWINDOW (WVAR (w, vchild)), fn, user_data); else cont = fn (w, user_data); - w = NILP (w->next) ? 0 : XWINDOW (w->next); + w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); } return cont; === modified file 'src/window.h' --- src/window.h 2012-07-31 12:36:19 +0000 +++ src/window.h 2012-08-01 05:11:36 +0000 @@ -86,142 +86,150 @@ int hpos, vpos; }; +/* Most code should use this macro to access Lisp fields in struct window. */ + +#define WVAR(w, field) ((w)->INTERNAL_FIELD (field)) + struct window { /* This is for Lisp; the terminal code does not refer to it. */ struct vectorlike_header header; /* The frame this window is on. */ - Lisp_Object frame; + Lisp_Object INTERNAL_FIELD (frame); /* Following (to right or down) and preceding (to left or up) child at same level of tree. */ - Lisp_Object next, prev; + Lisp_Object INTERNAL_FIELD (next); + Lisp_Object INTERNAL_FIELD (prev); /* First child of this window: vchild is used if this is a vertical combination, hchild if this is a horizontal combination. Of the fields vchild, hchild and buffer, one and only one is non-nil unless the window is dead. */ - Lisp_Object hchild, vchild; + Lisp_Object INTERNAL_FIELD (hchild); + Lisp_Object INTERNAL_FIELD (vchild); /* The window this one is a child of. */ - Lisp_Object parent; + Lisp_Object INTERNAL_FIELD (parent); /* The upper left corner coordinates of this window, as integers relative to upper left corner of frame = 0, 0. */ - Lisp_Object left_col; - Lisp_Object top_line; + Lisp_Object INTERNAL_FIELD (left_col); + Lisp_Object INTERNAL_FIELD (top_line); /* The size of the window. */ - Lisp_Object total_lines; - Lisp_Object total_cols; + Lisp_Object INTERNAL_FIELD (total_lines); + Lisp_Object INTERNAL_FIELD (total_cols); /* The normal size of the window. */ - Lisp_Object normal_lines; - Lisp_Object normal_cols; + Lisp_Object INTERNAL_FIELD (normal_lines); + Lisp_Object INTERNAL_FIELD (normal_cols); /* New sizes of the window. */ - Lisp_Object new_total; - Lisp_Object new_normal; + Lisp_Object INTERNAL_FIELD (new_total); + Lisp_Object INTERNAL_FIELD (new_normal); /* The buffer displayed in this window. Of the fields vchild, hchild and buffer, one and only one is non-nil unless the window is dead. */ - Lisp_Object buffer; + Lisp_Object INTERNAL_FIELD (buffer); /* A marker pointing to where in the text to start displaying. BIDI Note: This is the _logical-order_ start, i.e. the smallest buffer position visible in the window, not necessarily the character displayed in the top left corner of the window. */ - Lisp_Object start; + Lisp_Object INTERNAL_FIELD (start); /* A marker pointing to where in the text point is in this window, used only when the window is not selected. This exists so that when multiple windows show one buffer each one can have its own value of point. */ - Lisp_Object pointm; + Lisp_Object INTERNAL_FIELD (pointm); /* No permanent meaning; used by save-window-excursion's bookkeeping. */ - Lisp_Object temslot; + Lisp_Object INTERNAL_FIELD (temslot); /* This window's vertical scroll bar. This field is only for use by the window-system-dependent code which implements the scroll bars; it can store anything it likes here. If this window is newly created and we haven't displayed a scroll bar in it yet, or if the frame doesn't have any scroll bars, this is nil. */ - Lisp_Object vertical_scroll_bar; + Lisp_Object INTERNAL_FIELD (vertical_scroll_bar); /* Width of left and right marginal areas. A value of nil means no margin. */ - Lisp_Object left_margin_cols, right_margin_cols; + Lisp_Object INTERNAL_FIELD (left_margin_cols); + Lisp_Object INTERNAL_FIELD (right_margin_cols); /* Width of left and right fringes. A value of nil or t means use frame values. */ - Lisp_Object left_fringe_width, right_fringe_width; + Lisp_Object INTERNAL_FIELD (left_fringe_width); + Lisp_Object INTERNAL_FIELD (right_fringe_width); /* Pixel width of scroll bars. A value of nil or t means use frame values. */ - Lisp_Object scroll_bar_width; + Lisp_Object INTERNAL_FIELD (scroll_bar_width); /* Type of vertical scroll bar. A value of nil means no scroll bar. A value of t means use frame value. */ - Lisp_Object vertical_scroll_bar_type; + Lisp_Object INTERNAL_FIELD (vertical_scroll_bar_type); /* Z - the buffer position of the last glyph in the current matrix of W. Only valid if WINDOW_END_VALID is not nil. */ - Lisp_Object window_end_pos; + Lisp_Object INTERNAL_FIELD (window_end_pos); /* Glyph matrix row of the last glyph in the current matrix of W. Only valid if WINDOW_END_VALID is not nil. */ - Lisp_Object window_end_vpos; + Lisp_Object INTERNAL_FIELD (window_end_vpos); /* t if window_end_pos is truly valid. This is nil if nontrivial redisplay is preempted since in that case the frame image that window_end_pos did not get onto the frame. */ - Lisp_Object window_end_valid; + Lisp_Object INTERNAL_FIELD (window_end_valid); /* Display-table to use for displaying chars in this window. Nil means use the buffer's own display-table. */ - Lisp_Object display_table; + Lisp_Object INTERNAL_FIELD (display_table); /* Non-nil usually means window is marked as dedicated. Note Lisp code may set this to something beyond Qnil and Qt, so bitfield can't be used here. */ - Lisp_Object dedicated; + Lisp_Object INTERNAL_FIELD (dedicated); /* Line number and position of a line somewhere above the top of the screen. If this field is nil, it means we don't have a base line. */ - Lisp_Object base_line_number; + Lisp_Object INTERNAL_FIELD (base_line_number); /* If this field is nil, it means we don't have a base line. If it is a buffer, it means don't display the line number as long as the window shows that buffer. */ - Lisp_Object base_line_pos; + Lisp_Object INTERNAL_FIELD (base_line_pos); /* If we have highlighted the region (or any part of it), this is the mark position that we used, as an integer. */ - Lisp_Object region_showing; + Lisp_Object INTERNAL_FIELD (region_showing); /* The column number currently displayed in this window's mode line, or nil if column numbers are not being displayed. */ - Lisp_Object column_number_displayed; + Lisp_Object INTERNAL_FIELD (column_number_displayed); /* If redisplay in this window goes beyond this buffer position, must run the redisplay-end-trigger-hook. */ - Lisp_Object redisplay_end_trigger; + Lisp_Object INTERNAL_FIELD (redisplay_end_trigger); /* t means this window's child windows are not (re-)combined. */ - Lisp_Object combination_limit; + Lisp_Object INTERNAL_FIELD (combination_limit); /* Alist of triples listing buffers previously shown in this window. */ - Lisp_Object prev_buffers; + Lisp_Object INTERNAL_FIELD (prev_buffers); /* List of buffers re-shown in this window. */ - Lisp_Object next_buffers; + Lisp_Object INTERNAL_FIELD (next_buffers); /* An alist with parameters. */ - Lisp_Object window_parameters; + Lisp_Object INTERNAL_FIELD (window_parameters); /* No Lisp data may follow below this point without changing mark_object in alloc.c. The member current_matrix must be the @@ -388,13 +396,13 @@ This includes scroll bars and fringes. */ #define WINDOW_TOTAL_COLS(W) \ - (XFASTINT ((W)->total_cols)) + (XFASTINT (WVAR (W, total_cols))) /* Return the height of window W in canonical line units. This includes header and mode lines, if any. */ #define WINDOW_TOTAL_LINES(W) \ - (XFASTINT ((W)->total_lines)) + (XFASTINT (WVAR (W, total_lines))) /* Return the total pixel width of window W. */ @@ -422,7 +430,7 @@ This includes a left-hand scroll bar, if any. */ #define WINDOW_LEFT_EDGE_COL(W) \ - (XFASTINT ((W)->left_col)) + (XFASTINT (WVAR (W, left_col))) /* Return the canonical frame column before which window W ends. This includes a right-hand scroll bar, if any. */ @@ -434,7 +442,7 @@ This includes a header line, if any. */ #define WINDOW_TOP_EDGE_LINE(W) \ - (XFASTINT ((W)->top_line)) + (XFASTINT (WVAR (W, top_line))) /* Return the canonical frame line before which window W ends. This includes a mode line, if any. */ @@ -539,31 +547,31 @@ /* Width of left margin area in columns. */ #define WINDOW_LEFT_MARGIN_COLS(W) \ - (NILP ((W)->left_margin_cols) \ + (NILP (WVAR (W, left_margin_cols)) \ ? 0 \ - : XINT ((W)->left_margin_cols)) + : XINT (WVAR (W, left_margin_cols))) /* Width of right marginal area in columns. */ #define WINDOW_RIGHT_MARGIN_COLS(W) \ - (NILP ((W)->right_margin_cols) \ + (NILP (WVAR (W, right_margin_cols)) \ ? 0 \ - : XINT ((W)->right_margin_cols)) + : XINT (WVAR (W, right_margin_cols))) /* Width of left margin area in pixels. */ #define WINDOW_LEFT_MARGIN_WIDTH(W) \ - (NILP ((W)->left_margin_cols) \ + (NILP (WVAR (W, left_margin_cols)) \ ? 0 \ - : (XINT ((W)->left_margin_cols) \ + : (XINT (WVAR (W, left_margin_cols)) \ * WINDOW_FRAME_COLUMN_WIDTH (W))) /* Width of right marginal area in pixels. */ #define WINDOW_RIGHT_MARGIN_WIDTH(W) \ - (NILP ((W)->right_margin_cols) \ + (NILP (WVAR (W, right_margin_cols)) \ ? 0 \ - : (XINT ((W)->right_margin_cols) \ + : (XINT (WVAR (W, right_margin_cols)) \ * WINDOW_FRAME_COLUMN_WIDTH (W))) /* Total width of fringes reserved for drawing truncation bitmaps, @@ -573,8 +581,8 @@ able to split windows horizontally nicely. */ #define WINDOW_FRINGE_COLS(W) \ - ((INTEGERP ((W)->left_fringe_width) \ - || INTEGERP ((W)->right_fringe_width)) \ + ((INTEGERP (WVAR (W, left_fringe_width)) \ + || INTEGERP (WVAR (W, right_fringe_width))) \ ? ((WINDOW_LEFT_FRINGE_WIDTH (W) \ + WINDOW_RIGHT_FRINGE_WIDTH (W) \ + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \ @@ -596,13 +604,13 @@ /* Pixel-width of the left and right fringe. */ #define WINDOW_LEFT_FRINGE_WIDTH(W) \ - (INTEGERP ((W)->left_fringe_width) \ - ? XFASTINT ((W)->left_fringe_width) \ + (INTEGERP (WVAR (W, left_fringe_width)) \ + ? XFASTINT (WVAR (W, left_fringe_width)) \ : FRAME_LEFT_FRINGE_WIDTH (WINDOW_XFRAME (W))) #define WINDOW_RIGHT_FRINGE_WIDTH(W) \ - (INTEGERP ((W)->right_fringe_width) \ - ? XFASTINT ((W)->right_fringe_width) \ + (INTEGERP (WVAR (W, right_fringe_width)) \ + ? XFASTINT (WVAR (W, right_fringe_width)) \ : FRAME_RIGHT_FRINGE_WIDTH (WINDOW_XFRAME (W))) /* Total width of fringes in pixels. */ @@ -619,36 +627,36 @@ and which side they are on. */ #define WINDOW_VERTICAL_SCROLL_BAR_TYPE(w) \ - (EQ ((w)->vertical_scroll_bar_type, Qt) \ + (EQ (WVAR (w, vertical_scroll_bar_type), Qt) \ ? FRAME_VERTICAL_SCROLL_BAR_TYPE (WINDOW_XFRAME (w)) \ - : EQ ((w)->vertical_scroll_bar_type, Qleft) \ + : EQ (WVAR (w, vertical_scroll_bar_type), Qleft) \ ? vertical_scroll_bar_left \ - : EQ ((w)->vertical_scroll_bar_type, Qright) \ + : EQ (WVAR (w, vertical_scroll_bar_type), Qright) \ ? vertical_scroll_bar_right \ : vertical_scroll_bar_none) \ #define WINDOW_HAS_VERTICAL_SCROLL_BAR(w) \ - (EQ ((w)->vertical_scroll_bar_type, Qt) \ + (EQ (WVAR (w, vertical_scroll_bar_type), Qt) \ ? FRAME_HAS_VERTICAL_SCROLL_BARS (WINDOW_XFRAME (w)) \ - : !NILP ((w)->vertical_scroll_bar_type)) + : !NILP (WVAR (w, vertical_scroll_bar_type))) #define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT(w) \ - (EQ ((w)->vertical_scroll_bar_type, Qt) \ + (EQ (WVAR (w, vertical_scroll_bar_type), Qt) \ ? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (WINDOW_XFRAME (w)) \ - : EQ ((w)->vertical_scroll_bar_type, Qleft)) + : EQ (WVAR (w, vertical_scroll_bar_type), Qleft)) #define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT(w) \ - (EQ ((w)->vertical_scroll_bar_type, Qt) \ + (EQ (WVAR (w, vertical_scroll_bar_type), Qt) \ ? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (WINDOW_XFRAME (w))\ - : EQ ((w)->vertical_scroll_bar_type, Qright)) + : EQ (WVAR (w, vertical_scroll_bar_type), Qright)) /* Width that a scroll bar in window W should have, if there is one. Measured in pixels. If scroll bars are turned off, this is still nonzero. */ #define WINDOW_CONFIG_SCROLL_BAR_WIDTH(w) \ - (INTEGERP ((w)->scroll_bar_width) \ - ? XFASTINT ((w)->scroll_bar_width) \ + (INTEGERP (WVAR (w, scroll_bar_width)) \ + ? XFASTINT (WVAR (w, scroll_bar_width)) \ : FRAME_CONFIG_SCROLL_BAR_WIDTH (WINDOW_XFRAME (w))) /* Width that a scroll bar in window W should have, if there is one. @@ -656,8 +664,8 @@ this is still nonzero. */ #define WINDOW_CONFIG_SCROLL_BAR_COLS(w) \ - (INTEGERP ((w)->scroll_bar_width) \ - ? ((XFASTINT ((w)->scroll_bar_width) \ + (INTEGERP (WVAR (w, scroll_bar_width)) \ + ? ((XFASTINT (WVAR (w, scroll_bar_width)) \ + WINDOW_FRAME_COLUMN_WIDTH (w) - 1) \ / WINDOW_FRAME_COLUMN_WIDTH (w)) \ : FRAME_CONFIG_SCROLL_BAR_COLS (WINDOW_XFRAME (w))) @@ -880,7 +888,7 @@ /* Value is non-zero if WINDOW is a live window. */ #define WINDOW_LIVE_P(WINDOW) \ - (WINDOWP ((WINDOW)) && !NILP (XWINDOW ((WINDOW))->buffer)) + (WINDOWP ((WINDOW)) && !NILP (WVAR (XWINDOW ((WINDOW)), buffer))) /* These used to be in lisp.h. */ === modified file 'src/xdisp.c' --- src/xdisp.c 2012-07-31 12:36:19 +0000 +++ src/xdisp.c 2012-08-01 05:11:36 +0000 @@ -984,7 +984,7 @@ int window_box_width (struct window *w, int area) { - int cols = XFASTINT (w->total_cols); + int cols = XFASTINT (WVAR (w, total_cols)); int pixels = 0; if (!w->pseudo_window_p) @@ -993,22 +993,22 @@ if (area == TEXT_AREA) { - if (INTEGERP (w->left_margin_cols)) - cols -= XFASTINT (w->left_margin_cols); - if (INTEGERP (w->right_margin_cols)) - cols -= XFASTINT (w->right_margin_cols); + if (INTEGERP (WVAR (w, left_margin_cols))) + cols -= XFASTINT (WVAR (w, left_margin_cols)); + if (INTEGERP (WVAR (w, right_margin_cols))) + cols -= XFASTINT (WVAR (w, right_margin_cols)); pixels = -WINDOW_TOTAL_FRINGE_WIDTH (w); } else if (area == LEFT_MARGIN_AREA) { - cols = (INTEGERP (w->left_margin_cols) - ? XFASTINT (w->left_margin_cols) : 0); + cols = (INTEGERP (WVAR (w, left_margin_cols)) + ? XFASTINT (WVAR (w, left_margin_cols)) : 0); pixels = 0; } else if (area == RIGHT_MARGIN_AREA) { - cols = (INTEGERP (w->right_margin_cols) - ? XFASTINT (w->right_margin_cols) : 0); + cols = (INTEGERP (WVAR (w, right_margin_cols)) + ? XFASTINT (WVAR (w, right_margin_cols)) : 0); pixels = 0; } } @@ -1023,7 +1023,7 @@ int window_box_height (struct window *w) { - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); int height = WINDOW_TOTAL_HEIGHT (w); eassert (height >= 0); @@ -1112,7 +1112,7 @@ int window_box_left (struct window *w, int area) { - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); int x; if (w->pseudo_window_p) @@ -1288,13 +1288,13 @@ if (FRAME_INITIAL_P (XFRAME (WINDOW_FRAME (w)))) return visible_p; - if (XBUFFER (w->buffer) != current_buffer) + if (XBUFFER (WVAR (w, buffer)) != current_buffer) { old_buffer = current_buffer; - set_buffer_internal_1 (XBUFFER (w->buffer)); + set_buffer_internal_1 (XBUFFER (WVAR (w, buffer))); } - SET_TEXT_POS_FROM_MARKER (top, w->start); + SET_TEXT_POS_FROM_MARKER (top, WVAR (w, start)); /* Scrolling a minibuffer window via scroll bar when the echo area shows long text sometimes resets the minibuffer contents behind our backs. */ @@ -1310,7 +1310,7 @@ if (WINDOW_WANTS_HEADER_LINE_P (w)) current_header_line_height = display_mode_line (w, HEADER_LINE_FACE_ID, - BVAR (current_buffer, header_line_format)); + BVAR (current_buffer, header_line_format)); start_display (&it, w, top); move_it_to (&it, charpos, -1, it.last_visible_y-1, -1, @@ -1913,7 +1913,7 @@ { /* A pseudo-window is always full-width, and starts at the left edge of the frame, plus a frame border. */ - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); *x -= FRAME_INTERNAL_BORDER_WIDTH (f); *y = FRAME_TO_WINDOW_PIXEL_Y (w, *y); } @@ -2522,11 +2522,11 @@ check_window_end (struct window *w) { if (!MINI_WINDOW_P (w) - && !NILP (w->window_end_valid)) + && !NILP (WVAR (w, window_end_valid))) { struct glyph_row *row; eassert ((row = MATRIX_ROW (w->current_matrix, - XFASTINT (w->window_end_vpos)), + XFASTINT (WVAR (w, window_end_vpos))), !row->enabled_p || MATRIX_ROW_DISPLAYS_TEXT_P (row) || MATRIX_ROW_VPOS (row, w->current_matrix) == 0)); @@ -2591,7 +2591,8 @@ /* Perhaps remap BASE_FACE_ID to a user-specified alternative. */ if (! NILP (Vface_remapping_alist)) - remapped_base_face_id = lookup_basic_face (XFRAME (w->frame), base_face_id); + remapped_base_face_id + = lookup_basic_face (XFRAME (WVAR (w, frame)), base_face_id); /* Use one of the mode line rows of W's desired matrix if appropriate. */ @@ -2619,7 +2620,7 @@ /* The window in which we iterate over current_buffer: */ XSETWINDOW (it->window, w); it->w = w; - it->f = XFRAME (w->frame); + it->f = XFRAME (WVAR (w, frame)); it->cmp_it.id = -1; @@ -2659,9 +2660,9 @@ is invisible. >0 means lines indented more than this value are invisible. */ it->selective = (INTEGERP (BVAR (current_buffer, selective_display)) - ? clip_to_bounds (-1, XINT (BVAR (current_buffer, - selective_display)), - PTRDIFF_MAX) + ? clip_to_bounds + (-1, XINT (BVAR (current_buffer, selective_display)), + PTRDIFF_MAX) : (!NILP (BVAR (current_buffer, selective_display)) ? -1 : 0)); it->selective_display_ellipsis_p @@ -2703,13 +2704,13 @@ /* Get the position at which the redisplay_end_trigger hook should be run, if it is to be run at all. */ - if (MARKERP (w->redisplay_end_trigger) - && XMARKER (w->redisplay_end_trigger)->buffer != 0) + if (MARKERP (WVAR (w, redisplay_end_trigger)) + && XMARKER (WVAR (w, redisplay_end_trigger))->buffer != 0) it->redisplay_end_trigger_charpos - = marker_position (w->redisplay_end_trigger); - else if (INTEGERP (w->redisplay_end_trigger)) + = marker_position (WVAR (w, redisplay_end_trigger)); + else if (INTEGERP (WVAR (w, redisplay_end_trigger))) it->redisplay_end_trigger_charpos = - clip_to_bounds (PTRDIFF_MIN, XINT (w->redisplay_end_trigger), PTRDIFF_MAX); + clip_to_bounds (PTRDIFF_MIN, XINT (WVAR (w, redisplay_end_trigger)), PTRDIFF_MAX); it->tab_width = SANE_TAB_WIDTH (current_buffer); @@ -4407,7 +4408,7 @@ if it was a text property. */ if (!STRINGP (it->string)) - object = it->w->buffer; + object = WVAR (it->w, buffer); display_replaced_p = handle_display_spec (it, propval, object, overlay, position, bufpos, @@ -4815,7 +4816,7 @@ it->what = IT_IMAGE; it->image_id = -1; /* no image */ it->position = start_pos; - it->object = NILP (object) ? it->w->buffer : object; + it->object = NILP (object) ? WVAR (it->w, buffer) : object; it->method = GET_FROM_IMAGE; it->from_overlay = Qnil; it->face_id = face_id; @@ -4961,7 +4962,7 @@ it->what = IT_IMAGE; it->image_id = lookup_image (it->f, value); it->position = start_pos; - it->object = NILP (object) ? it->w->buffer : object; + it->object = NILP (object) ? WVAR (it->w, buffer) : object; it->method = GET_FROM_IMAGE; /* Say that we haven't consumed the characters with @@ -5784,7 +5785,7 @@ it->object = p->u.stretch.object; break; case GET_FROM_BUFFER: - it->object = it->w->buffer; + it->object = WVAR (it->w, buffer); break; case GET_FROM_STRING: it->object = it->string; @@ -5797,7 +5798,7 @@ else { it->method = GET_FROM_BUFFER; - it->object = it->w->buffer; + it->object = WVAR (it->w, buffer); } } it->end_charpos = p->end_charpos; @@ -6235,7 +6236,7 @@ IT_STRING_BYTEPOS (*it) = -1; it->string = Qnil; it->method = GET_FROM_BUFFER; - it->object = it->w->buffer; + it->object = WVAR (it->w, buffer); it->area = TEXT_AREA; it->multibyte_p = !NILP (BVAR (current_buffer, enable_multibyte_characters)); it->sp = 0; @@ -7084,7 +7085,7 @@ else { it->method = GET_FROM_BUFFER; - it->object = it->w->buffer; + it->object = WVAR (it->w, buffer); } it->dpvec = NULL; @@ -7659,7 +7660,7 @@ setting face_before_selective_p. */ it->saved_face_id = it->face_id; it->method = GET_FROM_BUFFER; - it->object = it->w->buffer; + it->object = WVAR (it->w, buffer); reseat_at_next_visible_line_start (it, 1); it->face_before_selective_p = 1; } @@ -7923,7 +7924,7 @@ /* Record what we have and where it came from. */ it->what = IT_CHARACTER; - it->object = it->w->buffer; + it->object = WVAR (it->w, buffer); it->position = it->current.pos; /* Normally we return the character found above, except when we @@ -7980,7 +7981,7 @@ /* Since we are *trying* to run these functions, don't try to run them again, even if they get an error. */ - it->w->redisplay_end_trigger = Qnil; + WVAR (it->w, redisplay_end_trigger) = Qnil; Frun_hook_with_args (3, args); /* Notice if it changed the face of the character we are on. */ @@ -8029,7 +8030,7 @@ return 0; } it->position = it->current.pos; - it->object = it->w->buffer; + it->object = WVAR (it->w, buffer); it->c = composition_update_it (&it->cmp_it, IT_CHARPOS (*it), IT_BYTEPOS (*it), Qnil); } @@ -8890,7 +8891,7 @@ && it->current_x == it->last_visible_x - 1 && it->c != '\n' && it->c != '\t' - && it->vpos < XFASTINT (it->w->window_end_vpos)) + && it->vpos < XFASTINT (WVAR (it->w, window_end_vpos))) { it->continuation_lines_width += it->current_x; it->current_x = it->hpos = it->max_ascent = it->max_descent = 0; @@ -9644,7 +9645,7 @@ /* Get the frame containing the mini-buffer that the selected frame is using. */ mini_window = FRAME_MINIBUF_WINDOW (sf); - frame = XWINDOW (mini_window)->frame; + frame = WVAR (XWINDOW (mini_window), frame); f = XFRAME (frame); FRAME_SAMPLE_VISIBILITY (f); @@ -9970,8 +9971,8 @@ set_buffer_internal_1 (XBUFFER (buffer)); if (w) { - w->buffer = buffer; - set_marker_both (w->pointm, buffer, BEG, BEG_BYTE); + WVAR (w, buffer) = buffer; + set_marker_both (WVAR (w, pointm), buffer, BEG, BEG_BYTE); } BVAR (current_buffer, undo_list) = Qt; @@ -10019,9 +10020,9 @@ if (w) { XSETWINDOW (tmp, w); ASET (vector, i, tmp); ++i; - ASET (vector, i, w->buffer); ++i; - ASET (vector, i, make_number (XMARKER (w->pointm)->charpos)); ++i; - ASET (vector, i, make_number (XMARKER (w->pointm)->bytepos)); ++i; + ASET (vector, i, WVAR (w, buffer)); ++i; + ASET (vector, i, make_number (XMARKER (WVAR (w, pointm))->charpos)); ++i; + ASET (vector, i, make_number (XMARKER (WVAR (w, pointm))->bytepos)); ++i; } else { @@ -10055,8 +10056,8 @@ charpos = AREF (vector, 5); bytepos = AREF (vector, 6); - w->buffer = buffer; - set_marker_both (w->pointm, buffer, + WVAR (w, buffer) = buffer; + set_marker_both (WVAR (w, pointm), buffer, XFASTINT (charpos), XFASTINT (bytepos)); } @@ -10195,7 +10196,7 @@ window_height_changed_p = resize_mini_window (w, 0); /* Use the starting position chosen by resize_mini_window. */ - SET_TEXT_POS_FROM_MARKER (start, w->start); + SET_TEXT_POS_FROM_MARKER (start, WVAR (w, start)); /* Display. */ clear_glyph_matrix (w->desired_matrix); @@ -10266,15 +10267,15 @@ int resize_mini_window (struct window *w, int exact_p) { - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); int window_height_changed_p = 0; eassert (MINI_WINDOW_P (w)); /* By default, start display at the beginning. */ - set_marker_both (w->start, w->buffer, - BUF_BEGV (XBUFFER (w->buffer)), - BUF_BEGV_BYTE (XBUFFER (w->buffer))); + set_marker_both (WVAR (w, start), WVAR (w, buffer), + BUF_BEGV (XBUFFER (WVAR (w, buffer))), + BUF_BEGV_BYTE (XBUFFER (WVAR (w, buffer)))); /* Don't resize windows while redisplaying a window; it would confuse redisplay functions when the size of the window they are @@ -10301,10 +10302,10 @@ struct text_pos start; struct buffer *old_current_buffer = NULL; - if (current_buffer != XBUFFER (w->buffer)) + if (current_buffer != XBUFFER (WVAR (w, buffer))) { old_current_buffer = current_buffer; - set_buffer_internal (XBUFFER (w->buffer)); + set_buffer_internal (XBUFFER (WVAR (w, buffer))); } init_iterator (&it, w, BEGV, BEGV_BYTE, NULL, DEFAULT_FACE_ID); @@ -10346,7 +10347,7 @@ } else SET_TEXT_POS (start, BEGV, BEGV_BYTE); - SET_MARKER_FROM_TEXT_POS (w->start, start); + SET_MARKER_FROM_TEXT_POS (WVAR (w, start), start); if (EQ (Vresize_mini_windows, Qgrow_only)) { @@ -11053,7 +11054,8 @@ (f, current_buffer, selected_window, 0)); Fselect_window (FVAR (f, selected_window), Qt); - set_buffer_internal_1 (XBUFFER (XWINDOW (FVAR (f, selected_window))->buffer)); + set_buffer_internal_1 + (XBUFFER (WVAR (XWINDOW (FVAR (f, selected_window)), buffer))); fmt = FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format; mode_line_target = MODE_LINE_TITLE; @@ -11171,8 +11173,9 @@ #ifdef HAVE_NS if (windows_or_buffers_changed && FRAME_NS_P (f)) - ns_set_doc_edited (f, Fbuffer_modified_p - (XWINDOW (FVAR (f, selected_window))->buffer)); + ns_set_doc_edited + (f, Fbuffer_modified_p + (WVAR (XWINDOW (FVAR (f, selected_window)), buffer))); #endif UNGCPRO; } @@ -11237,19 +11240,19 @@ /* This used to test w->update_mode_line, but we believe there is no need to recompute the menu in that case. */ || update_mode_lines - || ((BUF_SAVE_MODIFF (XBUFFER (w->buffer)) - < BUF_MODIFF (XBUFFER (w->buffer))) + || ((BUF_SAVE_MODIFF (XBUFFER (WVAR (w, buffer))) + < BUF_MODIFF (XBUFFER (WVAR (w, buffer)))) != w->last_had_star) || ((!NILP (Vtransient_mark_mode) - && !NILP (BVAR (XBUFFER (w->buffer), mark_active))) - != !NILP (w->region_showing))) + && !NILP (BVAR (XBUFFER (WVAR (w, buffer)), mark_active))) + != !NILP (WVAR (w, region_showing)))) { struct buffer *prev = current_buffer; ptrdiff_t count = SPECPDL_INDEX (); specbind (Qinhibit_menubar_update, Qt); - set_buffer_internal_1 (XBUFFER (w->buffer)); + set_buffer_internal_1 (XBUFFER (WVAR (w, buffer))); if (save_match_data) record_unwind_save_match_data (); if (NILP (Voverriding_local_map_menu_flag)) @@ -11435,12 +11438,12 @@ if (windows_or_buffers_changed || w->update_mode_line || update_mode_lines - || ((BUF_SAVE_MODIFF (XBUFFER (w->buffer)) - < BUF_MODIFF (XBUFFER (w->buffer))) + || ((BUF_SAVE_MODIFF (XBUFFER (WVAR (w, buffer))) + < BUF_MODIFF (XBUFFER (WVAR (w, buffer)))) != w->last_had_star) || ((!NILP (Vtransient_mark_mode) - && !NILP (BVAR (XBUFFER (w->buffer), mark_active))) - != !NILP (w->region_showing))) + && !NILP (BVAR (XBUFFER (WVAR (w, buffer)), mark_active))) + != !NILP (WVAR (w, region_showing)))) { struct buffer *prev = current_buffer; ptrdiff_t count = SPECPDL_INDEX (); @@ -11451,7 +11454,7 @@ /* Set current_buffer to the buffer of the selected window of the frame, so that we get the right local keymaps. */ - set_buffer_internal_1 (XBUFFER (w->buffer)); + set_buffer_internal_1 (XBUFFER (WVAR (w, buffer))); /* Save match data, if we must. */ if (save_match_data) @@ -12321,10 +12324,10 @@ { struct window *w = XWINDOW (window); - if (WINDOWP (w->hchild)) - hscrolled_p |= hscroll_window_tree (w->hchild); - else if (WINDOWP (w->vchild)) - hscrolled_p |= hscroll_window_tree (w->vchild); + if (WINDOWP (WVAR (w, hchild))) + hscrolled_p |= hscroll_window_tree (WVAR (w, hchild)); + else if (WINDOWP (WVAR (w, vchild))) + hscrolled_p |= hscroll_window_tree (WVAR (w, vchild)); else if (w->cursor.vpos >= 0) { int h_margin; @@ -12344,7 +12347,7 @@ /* Scroll when cursor is inside this scroll margin. */ h_margin = hscroll_margin * WINDOW_FRAME_COLUMN_WIDTH (w); - if (!NILP (Fbuffer_local_value (Qauto_hscroll_mode, w->buffer)) + if (!NILP (Fbuffer_local_value (Qauto_hscroll_mode, WVAR (w, buffer))) /* For left-to-right rows, hscroll when cursor is either (i) inside the right hscroll margin, or (ii) if it is inside the left margin and the window is already @@ -12379,13 +12382,13 @@ /* Find point in a display of infinite width. */ saved_current_buffer = current_buffer; - current_buffer = XBUFFER (w->buffer); + current_buffer = XBUFFER (WVAR (w, buffer)); if (w == XWINDOW (selected_window)) pt = PT; else { - pt = marker_position (w->pointm); + pt = marker_position (WVAR (w, pointm)); pt = max (BEGV, pt); pt = min (ZV, pt); } @@ -12436,14 +12439,14 @@ redisplay. */ if (w->hscroll != hscroll) { - XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; + XBUFFER (WVAR (w, buffer))->prevent_redisplay_optimizations_p = 1; w->hscroll = hscroll; hscrolled_p = 1; } } } - window = w->next; + window = WVAR (w, next); } /* Value is non-zero if hscroll of any leaf window has been changed. */ @@ -12525,9 +12528,9 @@ if (trace_redisplay_p) fprintf (stderr, "%p (%s): %s\n", w, - ((BUFFERP (w->buffer) - && STRINGP (BVAR (XBUFFER (w->buffer), name))) - ? SSDATA (BVAR (XBUFFER (w->buffer), name)) + ((BUFFERP (WVAR (w, buffer)) + && STRINGP (BVAR (XBUFFER (WVAR (w, buffer)), name))) + ? SSDATA (BVAR (XBUFFER (WVAR (w, buffer)), name)) : "no buffer"), method + len); } @@ -12592,8 +12595,8 @@ require to redisplay the whole paragraph. It might be worthwhile to find the paragraph limits and widen the range of redisplayed lines to that, but for now just give up this optimization. */ - if (!NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering)) - && NILP (BVAR (XBUFFER (w->buffer), bidi_paragraph_direction))) + if (!NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_display_reordering)) + && NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_paragraph_direction))) unchanged_p = 0; } @@ -12805,7 +12808,7 @@ reconsider_clip_changes (struct window *w, struct buffer *b) { if (b->clip_changed - && !NILP (w->window_end_valid) + && !NILP (WVAR (w, window_end_valid)) && w->current_matrix->buffer == b && w->current_matrix->zv == BUF_ZV (b) && w->current_matrix->begv == BUF_BEGV (b)) @@ -12817,20 +12820,20 @@ b->clip_changed has already been set to 1, we can skip this check. */ if (!b->clip_changed - && BUFFERP (w->buffer) && !NILP (w->window_end_valid)) + && BUFFERP (WVAR (w, buffer)) && !NILP (WVAR (w, window_end_valid))) { ptrdiff_t pt; if (w == XWINDOW (selected_window)) pt = PT; else - pt = marker_position (w->pointm); + pt = marker_position (WVAR (w, pointm)); - if ((w->current_matrix->buffer != XBUFFER (w->buffer) + if ((w->current_matrix->buffer != XBUFFER (WVAR (w, buffer)) || pt != w->last_point) && check_point_in_composition (w->current_matrix->buffer, w->last_point, - XBUFFER (w->buffer), pt)) + XBUFFER (WVAR (w, buffer)), pt)) b->clip_changed = 1; } } @@ -12913,7 +12916,7 @@ /* Don't examine these until after testing Vinhibit_redisplay. When Emacs is shutting down, perhaps because its connection to X has dropped, we should not look at them at all. */ - fr = XFRAME (w->frame); + fr = XFRAME (WVAR (w, frame)); sf = SELECTED_FRAME (); if (!fr->glyphs_initialized_p) @@ -13049,18 +13052,18 @@ specbind (Qinhibit_point_motion_hooks, Qt); /* If %c is in the mode line, update it if needed. */ - if (!NILP (w->column_number_displayed) + if (!NILP (WVAR (w, column_number_displayed)) /* This alternative quickly identifies a common case where no change is needed. */ && !(PT == w->last_point && w->last_modified >= MODIFF && w->last_overlay_modified >= OVERLAY_MODIFF) - && (XFASTINT (w->column_number_displayed) != current_column ())) + && (XFASTINT (WVAR (w, column_number_displayed)) != current_column ())) w->update_mode_line = 1; unbind_to (count1, Qnil); - FRAME_SCROLL_BOTTOM_VPOS (XFRAME (w->frame)) = -1; + FRAME_SCROLL_BOTTOM_VPOS (XFRAME (WVAR (w, frame))) = -1; /* The variable buffer_shared is set in redisplay_window and indicates that we redisplay a buffer in different windows. See @@ -13144,11 +13147,11 @@ the whole window. The assignment to this_line_start_pos prevents the optimization directly below this if-statement. */ if (((!NILP (Vtransient_mark_mode) - && !NILP (BVAR (XBUFFER (w->buffer), mark_active))) - != !NILP (w->region_showing)) - || (!NILP (w->region_showing) - && !EQ (w->region_showing, - Fmarker_position (BVAR (XBUFFER (w->buffer), mark))))) + && !NILP (BVAR (XBUFFER (WVAR (w, buffer)), mark_active))) + != !NILP (WVAR (w, region_showing))) + || (!NILP (WVAR (w, region_showing)) + && !EQ (WVAR (w, region_showing), + Fmarker_position (BVAR (XBUFFER (WVAR (w, buffer)), mark))))) CHARPOS (this_line_start_pos) = 0; /* Optimize the case that only the line containing the cursor in the @@ -13162,11 +13165,11 @@ && !w->update_mode_line && !current_buffer->clip_changed && !current_buffer->prevent_redisplay_optimizations_p - && FRAME_VISIBLE_P (XFRAME (w->frame)) - && !FRAME_OBSCURED_P (XFRAME (w->frame)) + && FRAME_VISIBLE_P (XFRAME (WVAR (w, frame))) + && !FRAME_OBSCURED_P (XFRAME (WVAR (w, frame))) /* Make sure recorded data applies to current buffer, etc. */ && this_line_buffer == current_buffer - && current_buffer == XBUFFER (w->buffer) + && current_buffer == XBUFFER (WVAR (w, buffer)) && !w->force_start && !w->optional_new_start /* Point must be on the line that we have info recorded about. */ @@ -13264,13 +13267,13 @@ adjusted. */ if ((it.glyph_row - 1)->displays_text_p) { - if (XFASTINT (w->window_end_vpos) < this_line_vpos) - XSETINT (w->window_end_vpos, this_line_vpos); + if (XFASTINT (WVAR (w, window_end_vpos)) < this_line_vpos) + XSETINT (WVAR (w, window_end_vpos), this_line_vpos); } - else if (XFASTINT (w->window_end_vpos) == this_line_vpos + else if (XFASTINT (WVAR (w, window_end_vpos)) == this_line_vpos && this_line_vpos > 0) - XSETINT (w->window_end_vpos, this_line_vpos - 1); - w->window_end_valid = Qnil; + XSETINT (WVAR (w, window_end_vpos), this_line_vpos - 1); + WVAR (w, window_end_valid) = Qnil; /* Update hint: No need to try to scroll in update_window. */ w->desired_matrix->no_scrolling_p = 1; @@ -13316,7 +13319,7 @@ && (EQ (selected_window, BVAR (current_buffer, last_selected_window)) || highlight_nonselected_windows) - && NILP (w->region_showing) + && NILP (WVAR (w, region_showing)) && NILP (Vshow_trailing_whitespace) && !cursor_in_echo_area) { @@ -13477,7 +13480,7 @@ Lisp_Object mini_window = FRAME_MINIBUF_WINDOW (sf); struct frame *mini_frame; - displayed_buffer = XBUFFER (XWINDOW (selected_window)->buffer); + displayed_buffer = XBUFFER (WVAR (XWINDOW (selected_window), buffer)); /* Use list_of_error, not Qerror, so that we catch only errors and don't run the debugger. */ internal_condition_case_1 (redisplay_window_1, selected_window, @@ -13543,7 +13546,7 @@ /* If we pause after scrolling, some rows in the current matrices of some windows are not valid. */ if (!WINDOW_FULL_WIDTH_P (w) - && !FRAME_WINDOW_P (XFRAME (w->frame))) + && !FRAME_WINDOW_P (XFRAME (WVAR (w, frame)))) update_mode_lines = 1; } else @@ -13701,9 +13704,9 @@ static void mark_window_display_accurate_1 (struct window *w, int accurate_p) { - if (BUFFERP (w->buffer)) + if (BUFFERP (WVAR (w, buffer))) { - struct buffer *b = XBUFFER (w->buffer); + struct buffer *b = XBUFFER (WVAR (w, buffer)); w->last_modified = accurate_p ? BUF_MODIFF(b) : 0; w->last_overlay_modified = accurate_p ? BUF_OVERLAY_MODIFF(b) : 0; @@ -13730,13 +13733,13 @@ if (w == XWINDOW (selected_window)) w->last_point = BUF_PT (b); else - w->last_point = XMARKER (w->pointm)->charpos; + w->last_point = XMARKER (WVAR (w, pointm))->charpos; } } if (accurate_p) { - w->window_end_valid = w->buffer; + WVAR (w, window_end_valid) = WVAR (w, buffer); w->update_mode_line = 0; } } @@ -13752,15 +13755,15 @@ { struct window *w; - for (; !NILP (window); window = w->next) + for (; !NILP (window); window = WVAR (w, next)) { w = XWINDOW (window); mark_window_display_accurate_1 (w, accurate_p); - if (!NILP (w->vchild)) - mark_window_display_accurate (w->vchild, accurate_p); - if (!NILP (w->hchild)) - mark_window_display_accurate (w->hchild, accurate_p); + if (!NILP (WVAR (w, vchild))) + mark_window_display_accurate (WVAR (w, vchild), accurate_p); + if (!NILP (WVAR (w, hchild))) + mark_window_display_accurate (WVAR (w, hchild), accurate_p); } if (accurate_p) @@ -13820,13 +13823,13 @@ { struct window *w = XWINDOW (window); - if (!NILP (w->hchild)) - redisplay_windows (w->hchild); - else if (!NILP (w->vchild)) - redisplay_windows (w->vchild); - else if (!NILP (w->buffer)) + if (!NILP (WVAR (w, hchild))) + redisplay_windows (WVAR (w, hchild)); + else if (!NILP (WVAR (w, vchild))) + redisplay_windows (WVAR (w, vchild)); + else if (!NILP (WVAR (w, buffer))) { - displayed_buffer = XBUFFER (w->buffer); + displayed_buffer = XBUFFER (WVAR (w, buffer)); /* Use list_of_error, not Qerror, so that we catch only errors and don't run the debugger. */ internal_condition_case_1 (redisplay_window_0, window, @@ -13834,7 +13837,7 @@ redisplay_window_error); } - window = w->next; + window = WVAR (w, next); } } @@ -14468,7 +14471,7 @@ && !MATRIX_ROW_CONTINUATION_LINE_P (row) && row->x == 0) { - this_line_buffer = XBUFFER (w->buffer); + this_line_buffer = XBUFFER (WVAR (w, buffer)); CHARPOS (this_line_start_pos) = MATRIX_ROW_START_CHARPOS (row) + delta; @@ -14502,19 +14505,19 @@ run_window_scroll_functions (Lisp_Object window, struct text_pos startp) { struct window *w = XWINDOW (window); - SET_MARKER_FROM_TEXT_POS (w->start, startp); + SET_MARKER_FROM_TEXT_POS (WVAR (w, start), startp); - if (current_buffer != XBUFFER (w->buffer)) + if (current_buffer != XBUFFER (WVAR (w, buffer))) abort (); if (!NILP (Vwindow_scroll_functions)) { run_hook_with_args_2 (Qwindow_scroll_functions, window, make_number (CHARPOS (startp))); - SET_TEXT_POS_FROM_MARKER (startp, w->start); + SET_TEXT_POS_FROM_MARKER (startp, WVAR (w, start)); /* In case the hook functions switch buffers. */ - if (current_buffer != XBUFFER (w->buffer)) - set_buffer_internal_1 (XBUFFER (w->buffer)); + if (current_buffer != XBUFFER (WVAR (w, buffer))) + set_buffer_internal_1 (XBUFFER (WVAR (w, buffer))); } return startp; @@ -14604,7 +14607,7 @@ int temp_scroll_step, int last_line_misfit) { struct window *w = XWINDOW (window); - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); struct text_pos pos, startp; struct it it; int this_scroll_margin, scroll_max, rc, height; @@ -14618,7 +14621,7 @@ debug_method_add (w, "try_scrolling"); #endif - SET_TEXT_POS_FROM_MARKER (startp, w->start); + SET_TEXT_POS_FROM_MARKER (startp, WVAR (w, start)); /* Compute scroll margin height in pixels. We scroll when point is within this distance from the top or bottom of the window. */ @@ -14844,7 +14847,7 @@ if (!just_this_one_p || current_buffer->clip_changed || BEG_UNCHANGED < CHARPOS (startp)) - w->base_line_number = Qnil; + WVAR (w, base_line_number) = Qnil; /* If cursor ends up on a partially visible line, treat that as being off the bottom of the screen. */ @@ -14879,7 +14882,7 @@ struct text_pos pos, start_pos; int window_start_changed_p = 0; - SET_TEXT_POS_FROM_MARKER (start_pos, w->start); + SET_TEXT_POS_FROM_MARKER (start_pos, WVAR (w, start)); /* If window start is on a continuation line... Window start may be < BEGV in case there's invisible text at the start of the @@ -14927,7 +14930,7 @@ } /* Set the window start there. */ - SET_MARKER_FROM_TEXT_POS (w->start, pos); + SET_MARKER_FROM_TEXT_POS (WVAR (w, start), pos); window_start_changed_p = 1; } } @@ -14963,7 +14966,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_step) { struct window *w = XWINDOW (window); - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); int rc = CURSOR_MOVEMENT_CANNOT_BE_USED; #ifdef GLYPH_DEBUG @@ -14994,7 +14997,7 @@ set the cursor. */ && !(!NILP (Vtransient_mark_mode) && !NILP (BVAR (current_buffer, mark_active))) - && NILP (w->region_showing) + && NILP (WVAR (w, region_showing)) && NILP (Vshow_trailing_whitespace) /* This code is not used for mini-buffer for the sake of the case of redisplaying to replace an echo area message; since in @@ -15008,8 +15011,8 @@ larger than the window. This should really be fixed in window.c. I don't have this on my list, now, so we do approximately the same as the old redisplay code. --gerd. */ - && INTEGERP (w->window_end_vpos) - && XFASTINT (w->window_end_vpos) < w->current_matrix->nrows + && INTEGERP (WVAR (w, window_end_vpos)) + && XFASTINT (WVAR (w, window_end_vpos)) < w->current_matrix->nrows && (FRAME_WINDOW_P (f) || !overlay_arrow_in_current_buffer_p ())) { @@ -15146,7 +15149,7 @@ must_scroll = 1; } else if (rc != CURSOR_MOVEMENT_SUCCESS - && !NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering))) + && !NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_display_reordering))) { struct glyph_row *row1; @@ -15209,7 +15212,7 @@ else if (scroll_p) rc = CURSOR_MOVEMENT_MUST_SCROLL; else if (rc != CURSOR_MOVEMENT_SUCCESS - && !NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering))) + && !NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_display_reordering))) { /* With bidi-reordered rows, there could be more than one candidate row whose start and end positions @@ -15316,12 +15319,12 @@ || (w == XWINDOW (minibuf_window) && NILP (echo_area_buffer[0]))) { - struct buffer *buf = XBUFFER (w->buffer); + struct buffer *buf = XBUFFER (WVAR (w, buffer)); whole = BUF_ZV (buf) - BUF_BEGV (buf); - start = marker_position (w->start) - BUF_BEGV (buf); + start = marker_position (WVAR (w, start)) - BUF_BEGV (buf); /* I don't think this is guaranteed to be right. For the moment, we'll pretend it is. */ - end = BUF_Z (buf) - XFASTINT (w->window_end_pos) - BUF_BEGV (buf); + end = BUF_Z (buf) - XFASTINT (WVAR (w, window_end_pos)) - BUF_BEGV (buf); if (end < start) end = start; @@ -15332,8 +15335,8 @@ start = end = whole = 0; /* Indicate what this scroll bar ought to be displaying now. */ - if (FRAME_TERMINAL (XFRAME (w->frame))->set_vertical_scroll_bar_hook) - (*FRAME_TERMINAL (XFRAME (w->frame))->set_vertical_scroll_bar_hook) + if (FRAME_TERMINAL (XFRAME (WVAR (w, frame)))->set_vertical_scroll_bar_hook) + (*FRAME_TERMINAL (XFRAME (WVAR (w, frame)))->set_vertical_scroll_bar_hook) (w, end - start, whole, start); } @@ -15349,8 +15352,8 @@ redisplay_window (Lisp_Object window, int just_this_one_p) { struct window *w = XWINDOW (window); - struct frame *f = XFRAME (w->frame); - struct buffer *buffer = XBUFFER (w->buffer); + struct frame *f = XFRAME (WVAR (w, frame)); + struct buffer *buffer = XBUFFER (WVAR (w, buffer)); struct buffer *old = current_buffer; struct text_pos lpoint, opoint, startp; int update_mode_line; @@ -15373,7 +15376,7 @@ opoint = lpoint; /* W must be a leaf window here. */ - eassert (!NILP (w->buffer)); + eassert (!NILP (WVAR (w, buffer))); #ifdef GLYPH_DEBUG *w->desired_matrix->method = 0; #endif @@ -15403,10 +15406,10 @@ else if ((w != XWINDOW (minibuf_window) || minibuf_level == 0) /* When buffer is nonempty, redisplay window normally. */ - && BUF_Z (XBUFFER (w->buffer)) == BUF_BEG (XBUFFER (w->buffer)) + && BUF_Z (XBUFFER (WVAR (w, buffer))) == BUF_BEG (XBUFFER (WVAR (w, buffer))) /* Quail displays non-mini buffers in minibuffer window. In that case, redisplay the window normally. */ - && !NILP (Fmemq (w->buffer, Vminibuffer_list))) + && !NILP (Fmemq (WVAR (w, buffer), Vminibuffer_list))) { /* W is a mini-buffer window, but it's not active, so clear it. */ @@ -15428,10 +15431,10 @@ value. */ /* Really select the buffer, for the sake of buffer-local variables. */ - set_buffer_internal_1 (XBUFFER (w->buffer)); + set_buffer_internal_1 (XBUFFER (WVAR (w, buffer))); current_matrix_up_to_date_p - = (!NILP (w->window_end_valid) + = (!NILP (WVAR (w, window_end_valid)) && !current_buffer->clip_changed && !current_buffer->prevent_redisplay_optimizations_p && w->last_modified >= MODIFF @@ -15455,7 +15458,7 @@ specbind (Qinhibit_point_motion_hooks, Qt); buffer_unchanged_p - = (!NILP (w->window_end_valid) + = (!NILP (WVAR (w, window_end_valid)) && !current_buffer->clip_changed && w->last_modified >= MODIFF && w->last_overlay_modified >= OVERLAY_MODIFF); @@ -15466,10 +15469,10 @@ { /* If window starts on a continuation line, maybe adjust the window start in case the window's width changed. */ - if (XMARKER (w->start)->buffer == current_buffer) + if (XMARKER (WVAR (w, start))->buffer == current_buffer) compute_window_start_on_continuation_line (w); - w->window_end_valid = Qnil; + WVAR (w, window_end_valid) = Qnil; } /* Some sanity checks. */ @@ -15480,13 +15483,13 @@ abort (); /* If %c is in mode line, update it if needed. */ - if (!NILP (w->column_number_displayed) + if (!NILP (WVAR (w, column_number_displayed)) /* This alternative quickly identifies a common case where no change is needed. */ && !(PT == w->last_point && w->last_modified >= MODIFF && w->last_overlay_modified >= OVERLAY_MODIFF) - && (XFASTINT (w->column_number_displayed) != current_column ())) + && (XFASTINT (WVAR (w, column_number_displayed)) != current_column ())) update_mode_line = 1; /* Count number of windows showing the selected buffer. An indirect @@ -15495,7 +15498,7 @@ { struct buffer *current_base, *window_base; current_base = current_buffer; - window_base = XBUFFER (XWINDOW (selected_window)->buffer); + window_base = XBUFFER (WVAR (XWINDOW (selected_window), buffer)); if (current_base->base_buffer) current_base = current_base->base_buffer; if (window_base->base_buffer) @@ -15508,19 +15511,19 @@ window, set up appropriate value. */ if (!EQ (window, selected_window)) { - ptrdiff_t new_pt = XMARKER (w->pointm)->charpos; - ptrdiff_t new_pt_byte = marker_byte_position (w->pointm); + ptrdiff_t new_pt = XMARKER (WVAR (w, pointm))->charpos; + ptrdiff_t new_pt_byte = marker_byte_position (WVAR (w, pointm)); if (new_pt < BEGV) { new_pt = BEGV; new_pt_byte = BEGV_BYTE; - set_marker_both (w->pointm, Qnil, BEGV, BEGV_BYTE); + set_marker_both (WVAR (w, pointm), Qnil, BEGV, BEGV_BYTE); } else if (new_pt > (ZV - 1)) { new_pt = ZV; new_pt_byte = ZV_BYTE; - set_marker_both (w->pointm, Qnil, ZV, ZV_BYTE); + set_marker_both (WVAR (w, pointm), Qnil, ZV, ZV_BYTE); } /* We don't use SET_PT so that the point-motion hooks don't run. */ @@ -15536,8 +15539,8 @@ { struct Lisp_Char_Table *disptab = buffer_display_table (); - if (! disptab_matches_widthtab (disptab, - XVECTOR (BVAR (current_buffer, width_table)))) + if (! disptab_matches_widthtab + (disptab, XVECTOR (BVAR (current_buffer, width_table)))) { invalidate_region_cache (current_buffer, current_buffer->width_run_cache, @@ -15547,10 +15550,10 @@ } /* If window-start is screwed up, choose a new one. */ - if (XMARKER (w->start)->buffer != current_buffer) + if (XMARKER (WVAR (w, start))->buffer != current_buffer) goto recenter; - SET_TEXT_POS_FROM_MARKER (startp, w->start); + SET_TEXT_POS_FROM_MARKER (startp, WVAR (w, start)); /* If someone specified a new starting point but did not insist, check whether it can be used. */ @@ -15580,11 +15583,11 @@ w->force_start = 0; w->vscroll = 0; - w->window_end_valid = Qnil; + WVAR (w, window_end_valid) = Qnil; /* Forget any recorded base line for line number display. */ if (!buffer_unchanged_p) - w->base_line_number = Qnil; + WVAR (w, base_line_number) = Qnil; /* Redisplay the mode line. Select the buffer properly for that. Also, run the hook window-scroll-functions @@ -15649,7 +15652,7 @@ MATRIX_ROW_START_BYTEPOS (row)); if (w != XWINDOW (selected_window)) - set_marker_both (w->pointm, Qnil, PT, PT_BYTE); + set_marker_both (WVAR (w, pointm), Qnil, PT, PT_BYTE); else if (current_buffer == old) SET_TEXT_POS (lpoint, PT, PT_BYTE); @@ -15751,7 +15754,7 @@ sets it. So, we need to check the return value of compute_window_start_on_continuation_line. (See also bug#197). */ - && XMARKER (w->start)->buffer == current_buffer + && XMARKER (WVAR (w, start))->buffer == current_buffer && compute_window_start_on_continuation_line (w) /* It doesn't make sense to force the window start like we do at label force_start if it is already known that point @@ -15762,7 +15765,7 @@ && pos_visible_p (w, PT, &d1, &d2, &d3, &d4, &d5, &d6)) { w->force_start = 1; - SET_TEXT_POS_FROM_MARKER (startp, w->start); + SET_TEXT_POS_FROM_MARKER (startp, WVAR (w, start)); goto force_start; } @@ -15798,7 +15801,7 @@ || current_buffer->clip_changed || BEG_UNCHANGED < CHARPOS (startp)) /* Forget any recorded base line for line number display. */ - w->base_line_number = Qnil; + WVAR (w, base_line_number) = Qnil; if (!cursor_row_fully_visible_p (w, 1, 0)) { @@ -15869,7 +15872,7 @@ /* Forget any previously recorded base line for line number display. */ if (!buffer_unchanged_p) - w->base_line_number = Qnil; + WVAR (w, base_line_number) = Qnil; /* Determine the window start relative to point. */ init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID); @@ -15972,7 +15975,7 @@ /* Set the window start position here explicitly, to avoid an infinite loop in case the functions in window-scroll-functions get errors. */ - set_marker_both (w->start, Qnil, IT_CHARPOS (it), IT_BYTEPOS (it)); + set_marker_both (WVAR (w, start), Qnil, IT_CHARPOS (it), IT_BYTEPOS (it)); /* Run scroll hooks. */ startp = run_window_scroll_functions (window, it.current.pos); @@ -16003,8 +16006,8 @@ line.) */ if (w->cursor.vpos < 0) { - if (!NILP (w->window_end_valid) - && PT >= Z - XFASTINT (w->window_end_pos)) + if (!NILP (WVAR (w, window_end_valid)) + && PT >= Z - XFASTINT (WVAR (w, window_end_pos))) { clear_glyph_matrix (w->desired_matrix); move_it_by_lines (&it, 1); @@ -16076,7 +16079,7 @@ done: - SET_TEXT_POS_FROM_MARKER (startp, w->start); + SET_TEXT_POS_FROM_MARKER (startp, WVAR (w, start)); w->start_at_line_beg = (CHARPOS (startp) == BEGV || FETCH_BYTE (BYTEPOS (startp) - 1) == '\n'); @@ -16090,10 +16093,10 @@ && !FRAME_WINDOW_P (f) && !WINDOW_FULL_WIDTH_P (w)) /* Line number to display. */ - || INTEGERP (w->base_line_pos) + || INTEGERP (WVAR (w, base_line_pos)) /* Column number is displayed and different from the one displayed. */ - || (!NILP (w->column_number_displayed) - && (XFASTINT (w->column_number_displayed) != current_column ()))) + || (!NILP (WVAR (w, column_number_displayed)) + && (XFASTINT (WVAR (w, column_number_displayed)) != current_column ()))) /* This means that the window has a mode line. */ && (WINDOW_WANTS_MODELINE_P (w) || WINDOW_WANTS_HEADER_LINE_P (w))) @@ -16125,10 +16128,10 @@ } if (!line_number_displayed - && !BUFFERP (w->base_line_pos)) + && !BUFFERP (WVAR (w, base_line_pos))) { - w->base_line_pos = Qnil; - w->base_line_number = Qnil; + WVAR (w, base_line_pos) = Qnil; + WVAR (w, base_line_number) = Qnil; } finish_menu_bars: @@ -16241,10 +16244,10 @@ struct window *w = XWINDOW (window); struct it it; struct glyph_row *last_text_row = NULL; - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); /* Make POS the new window start. */ - set_marker_both (w->start, Qnil, CHARPOS (pos), BYTEPOS (pos)); + set_marker_both (WVAR (w, start), Qnil, CHARPOS (pos), BYTEPOS (pos)); /* Mark cursor position as unknown. No overlay arrow seen. */ w->cursor.vpos = -1; @@ -16293,7 +16296,7 @@ } /* If bottom moved off end of frame, change mode line percentage. */ - if (XFASTINT (w->window_end_pos) <= 0 + if (XFASTINT (WVAR (w, window_end_pos)) <= 0 && Z != IT_CHARPOS (it)) w->update_mode_line = 1; @@ -16305,22 +16308,23 @@ eassert (MATRIX_ROW_DISPLAYS_TEXT_P (last_text_row)); w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row); - w->window_end_pos + WVAR (w, window_end_pos) = make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)); - w->window_end_vpos + WVAR (w, window_end_vpos) = make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix)); - eassert (MATRIX_ROW (w->desired_matrix, XFASTINT (w->window_end_vpos)) - ->displays_text_p); + eassert + (MATRIX_ROW (w->desired_matrix, + XFASTINT (WVAR (w, window_end_vpos)))->displays_text_p); } else { w->window_end_bytepos = Z_BYTE - ZV_BYTE; - w->window_end_pos = make_number (Z - ZV); - w->window_end_vpos = make_number (0); + WVAR (w, window_end_pos) = make_number (Z - ZV); + WVAR (w, window_end_vpos) = make_number (0); } /* But that is not valid info until redisplay finishes. */ - w->window_end_valid = Qnil; + WVAR (w, window_end_valid) = Qnil; return 1; } @@ -16338,7 +16342,7 @@ static int try_window_reusing_current_matrix (struct window *w) { - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); struct glyph_row *bottom_row; struct it it; struct run run; @@ -16365,7 +16369,7 @@ /* Can't do this if region may have changed. */ if ((!NILP (Vtransient_mark_mode) && !NILP (BVAR (current_buffer, mark_active))) - || !NILP (w->region_showing) + || !NILP (WVAR (w, region_showing)) || !NILP (Vshow_trailing_whitespace)) return 0; @@ -16382,7 +16386,7 @@ /* The variable new_start now holds the new window start. The old start `start' can be determined from the current matrix. */ - SET_TEXT_POS_FROM_MARKER (new_start, w->start); + SET_TEXT_POS_FROM_MARKER (new_start, WVAR (w, start)); start = start_row->minpos; start_vpos = MATRIX_ROW_VPOS (start_row, w->current_matrix); @@ -16544,9 +16548,9 @@ { w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_reused_text_row); - w->window_end_pos + WVAR (w, window_end_pos) = make_number (Z - MATRIX_ROW_END_CHARPOS (last_reused_text_row)); - w->window_end_vpos + WVAR (w, window_end_vpos) = make_number (MATRIX_ROW_VPOS (last_reused_text_row, w->current_matrix)); } @@ -16554,19 +16558,19 @@ { w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row); - w->window_end_pos + WVAR (w, window_end_pos) = make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)); - w->window_end_vpos + WVAR (w, window_end_vpos) = make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix)); } else { /* This window must be completely empty. */ w->window_end_bytepos = Z_BYTE - ZV_BYTE; - w->window_end_pos = make_number (Z - ZV); - w->window_end_vpos = make_number (0); + WVAR (w, window_end_pos) = make_number (Z - ZV); + WVAR (w, window_end_vpos) = make_number (0); } - w->window_end_valid = Qnil; + WVAR (w, window_end_valid) = Qnil; /* Update hint: don't try scrolling again in update_window. */ w->desired_matrix->no_scrolling_p = 1; @@ -16720,7 +16724,7 @@ /* Can't use this optimization with bidi-reordered glyph rows, unless cursor is already at point. */ - if (!NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering))) + if (!NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_display_reordering))) { if (!(w->cursor.hpos >= 0 && w->cursor.hpos < row->used[TEXT_AREA] @@ -16747,18 +16751,18 @@ { w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row); - w->window_end_pos + WVAR (w, window_end_pos) = make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)); - w->window_end_vpos + WVAR (w, window_end_vpos) = make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix)); } else { - w->window_end_vpos - = make_number (XFASTINT (w->window_end_vpos) - nrows_scrolled); + WVAR (w, window_end_vpos) + = make_number (XFASTINT (WVAR (w, window_end_vpos)) - nrows_scrolled); } - w->window_end_valid = Qnil; + WVAR (w, window_end_valid) = Qnil; w->desired_matrix->no_scrolling_p = 1; #ifdef GLYPH_DEBUG @@ -16891,16 +16895,16 @@ /* Display must not have been paused, otherwise the current matrix is not up to date. */ - eassert (!NILP (w->window_end_valid)); + eassert (!NILP (WVAR (w, window_end_valid))); /* A value of window_end_pos >= END_UNCHANGED means that the window end is in the range of changed text. If so, there is no unchanged row at the end of W's current matrix. */ - if (XFASTINT (w->window_end_pos) >= END_UNCHANGED) + if (XFASTINT (WVAR (w, window_end_pos)) >= END_UNCHANGED) return NULL; /* Set row to the last row in W's current matrix displaying text. */ - row = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); + row = MATRIX_ROW (w->current_matrix, XFASTINT (WVAR (w, window_end_vpos))); /* If matrix is entirely empty, no unchanged row exists. */ if (MATRIX_ROW_DISPLAYS_TEXT_P (row)) @@ -16911,7 +16915,7 @@ buffer positions in the current matrix to current buffer positions for characters not in changed text. */ ptrdiff_t Z_old = - MATRIX_ROW_END_CHARPOS (row) + XFASTINT (w->window_end_pos); + MATRIX_ROW_END_CHARPOS (row) + XFASTINT (WVAR (w, window_end_pos)); ptrdiff_t Z_BYTE_old = MATRIX_ROW_END_BYTEPOS (row) + w->window_end_bytepos; ptrdiff_t last_unchanged_pos, last_unchanged_pos_old; @@ -16959,12 +16963,12 @@ static void sync_frame_with_window_matrix_rows (struct window *w) { - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); struct glyph_row *window_row, *window_row_end, *frame_row; /* Preconditions: W must be a leaf window and full-width. Its frame must have a frame matrix. */ - eassert (NILP (w->hchild) && NILP (w->vchild)); + eassert (NILP (WVAR (w, hchild)) && NILP (WVAR (w, vchild))); eassert (WINDOW_FULL_WIDTH_P (w)); eassert (!FRAME_WINDOW_P (f)); @@ -17006,7 +17010,7 @@ { struct glyph_row *row = start; struct glyph_row *best_row = NULL; - ptrdiff_t mindif = BUF_ZV (XBUFFER (w->buffer)) + 1; + ptrdiff_t mindif = BUF_ZV (XBUFFER (WVAR (w, buffer))) + 1; int last_y; /* If we happen to start on a header-line, skip that. */ @@ -17042,7 +17046,7 @@ { struct glyph *g; - if (NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering)) + if (NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_display_reordering)) || (!best_row && !row->continued_p)) return row; /* In bidi-reordered rows, there could be several rows @@ -17111,7 +17115,7 @@ static int try_window_id (struct window *w) { - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); struct glyph_matrix *current_matrix = w->current_matrix; struct glyph_matrix *desired_matrix = w->desired_matrix; struct glyph_row *last_unchanged_at_beg_row; @@ -17145,7 +17149,7 @@ #define GIVE_UP(X) return 0 #endif - SET_TEXT_POS_FROM_MARKER (start, w->start); + SET_TEXT_POS_FROM_MARKER (start, WVAR (w, start)); /* Don't use this for mini-windows because these can show messages and mini-buffers, and we don't handle that here. */ @@ -17183,7 +17187,7 @@ GIVE_UP (7); /* Verify that display wasn't paused. */ - if (NILP (w->window_end_valid)) + if (NILP (WVAR (w, window_end_valid))) GIVE_UP (8); /* Can't use this if highlighting a region because a cursor movement @@ -17197,7 +17201,7 @@ GIVE_UP (11); /* Likewise if showing a region. */ - if (!NILP (w->region_showing)) + if (!NILP (WVAR (w, region_showing))) GIVE_UP (10); /* Can't use this if overlay arrow position and/or string have @@ -17209,7 +17213,7 @@ wrapped line can change the wrap position, altering the line above it. It might be worthwhile to handle this more intelligently, but for now just redisplay from scratch. */ - if (!NILP (BVAR (XBUFFER (w->buffer), word_wrap))) + if (!NILP (BVAR (XBUFFER (WVAR (w, buffer)), word_wrap))) GIVE_UP (21); /* Under bidi reordering, adding or deleting a character in the @@ -17220,8 +17224,8 @@ to find the paragraph limits and widen the range of redisplayed lines to that, but for now just give up this optimization and redisplay from scratch. */ - if (!NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering)) - && NILP (BVAR (XBUFFER (w->buffer), bidi_paragraph_direction))) + if (!NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_display_reordering)) + && NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_paragraph_direction))) GIVE_UP (22); /* Make sure beg_unchanged and end_unchanged are up to date. Do it @@ -17247,7 +17251,7 @@ This case happens with stealth-fontification. Note that although the display is unchanged, glyph positions in the matrix have to be adjusted, of course. */ - row = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); + row = MATRIX_ROW (w->current_matrix, XFASTINT (WVAR (w, window_end_vpos))); if (MATRIX_ROW_DISPLAYS_TEXT_P (row) && ((last_changed_charpos < CHARPOS (start) && CHARPOS (start) == BEGV) @@ -17259,7 +17263,7 @@ /* Compute how many chars/bytes have been added to or removed from the buffer. */ - Z_old = MATRIX_ROW_END_CHARPOS (row) + XFASTINT (w->window_end_pos); + Z_old = MATRIX_ROW_END_CHARPOS (row) + XFASTINT (WVAR (w, window_end_pos)); Z_BYTE_old = MATRIX_ROW_END_BYTEPOS (row) + w->window_end_bytepos; Z_delta = Z - Z_old; Z_delta_bytes = Z_BYTE - Z_BYTE_old; @@ -17330,7 +17334,7 @@ { /* We have to compute the window end anew since text could have been added/removed after it. */ - w->window_end_pos + WVAR (w, window_end_pos) = make_number (Z - MATRIX_ROW_END_CHARPOS (row)); w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row); @@ -17366,7 +17370,7 @@ /* Give up if the window ends in strings. Overlay strings at the end are difficult to handle, so don't try. */ - row = MATRIX_ROW (current_matrix, XFASTINT (w->window_end_vpos)); + row = MATRIX_ROW (current_matrix, XFASTINT (WVAR (w, window_end_vpos))); if (MATRIX_ROW_START_CHARPOS (row) == MATRIX_ROW_END_CHARPOS (row)) GIVE_UP (20); @@ -17709,7 +17713,7 @@ /* Set last_row to the glyph row in the current matrix where the window end line is found. It has been moved up or down in the matrix by dvpos. */ - int last_vpos = XFASTINT (w->window_end_vpos) + dvpos; + int last_vpos = XFASTINT (WVAR (w, window_end_vpos)) + dvpos; struct glyph_row *last_row = MATRIX_ROW (current_matrix, last_vpos); /* If last_row is the window end line, it should display text. */ @@ -17765,20 +17769,20 @@ first_unchanged_at_end_row); eassert (row && MATRIX_ROW_DISPLAYS_TEXT_P (row)); - w->window_end_pos = make_number (Z - MATRIX_ROW_END_CHARPOS (row)); + WVAR (w, window_end_pos) = make_number (Z - MATRIX_ROW_END_CHARPOS (row)); w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row); - w->window_end_vpos + WVAR (w, window_end_vpos) = make_number (MATRIX_ROW_VPOS (row, w->current_matrix)); eassert (w->window_end_bytepos >= 0); IF_DEBUG (debug_method_add (w, "A")); } else if (last_text_row_at_end) { - w->window_end_pos + WVAR (w, window_end_pos) = make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row_at_end)); w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row_at_end); - w->window_end_vpos + WVAR (w, window_end_vpos) = make_number (MATRIX_ROW_VPOS (last_text_row_at_end, desired_matrix)); eassert (w->window_end_bytepos >= 0); IF_DEBUG (debug_method_add (w, "B")); @@ -17788,11 +17792,11 @@ /* We have displayed either to the end of the window or at the end of the window, i.e. the last row with text is to be found in the desired matrix. */ - w->window_end_pos + WVAR (w, window_end_pos) = make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)); w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row); - w->window_end_vpos + WVAR (w, window_end_vpos) = make_number (MATRIX_ROW_VPOS (last_text_row, desired_matrix)); eassert (w->window_end_bytepos >= 0); } @@ -17803,7 +17807,7 @@ /* Displayed to end of window, but no line containing text was displayed. Lines were deleted at the end of the window. */ int first_vpos = WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0; - int vpos = XFASTINT (w->window_end_vpos); + int vpos = XFASTINT (WVAR (w, window_end_vpos)); struct glyph_row *current_row = current_matrix->rows + vpos; struct glyph_row *desired_row = desired_matrix->rows + vpos; @@ -17821,8 +17825,8 @@ } eassert (row != NULL); - w->window_end_vpos = make_number (vpos + 1); - w->window_end_pos = make_number (Z - MATRIX_ROW_END_CHARPOS (row)); + WVAR (w, window_end_vpos) = make_number (vpos + 1); + WVAR (w, window_end_pos) = make_number (Z - MATRIX_ROW_END_CHARPOS (row)); w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row); eassert (w->window_end_bytepos >= 0); IF_DEBUG (debug_method_add (w, "C")); @@ -17834,7 +17838,7 @@ debug_end_vpos = XFASTINT (w->window_end_vpos)); /* Record that display has not been completed. */ - w->window_end_valid = Qnil; + WVAR (w, window_end_valid) = Qnil; w->desired_matrix->no_scrolling_p = 1; return 3; @@ -18064,7 +18068,7 @@ (Lisp_Object glyphs) { struct window *w = XWINDOW (selected_window); - struct buffer *buffer = XBUFFER (w->buffer); + struct buffer *buffer = XBUFFER (WVAR (w, buffer)); fprintf (stderr, "PT = %"pI"d, BEGV = %"pI"d. ZV = %"pI"d\n", BUF_PT (buffer), BUF_BEGV (buffer), BUF_ZV (buffer)); @@ -18170,7 +18174,7 @@ get_overlay_arrow_glyph_row (struct window *w, Lisp_Object overlay_arrow_string) { struct frame *f = XFRAME (WINDOW_FRAME (w)); - struct buffer *buffer = XBUFFER (w->buffer); + struct buffer *buffer = XBUFFER (WVAR (w, buffer)); struct buffer *old = current_buffer; const unsigned char *arrow_string = SDATA (overlay_arrow_string); int arrow_len = SCHARS (overlay_arrow_string); @@ -19247,7 +19251,7 @@ } /* Is IT->w showing the region? */ - it->w->region_showing = it->region_beg_charpos > 0 ? Qt : Qnil; + WVAR (it->w, region_showing) = it->region_beg_charpos > 0 ? Qt : Qnil; /* Clear the result glyph row and enable it. */ prepare_desired_row (row); @@ -19362,7 +19366,7 @@ row->glyphs[TEXT_AREA]->charpos = -1; row->displays_text_p = 0; - if (!NILP (BVAR (XBUFFER (it->w->buffer), indicate_empty_lines)) + if (!NILP (BVAR (XBUFFER (WVAR (it->w, buffer)), indicate_empty_lines)) && (!MINI_WINDOW_P (it->w) || (minibuf_level && EQ (it->window, minibuf_window)))) row->indicate_empty_line_p = 1; @@ -20185,12 +20189,12 @@ { struct window *w = XWINDOW (window); - if (WINDOWP (w->hchild)) - nwindows += redisplay_mode_lines (w->hchild, force); - else if (WINDOWP (w->vchild)) - nwindows += redisplay_mode_lines (w->vchild, force); + if (WINDOWP (WVAR (w, hchild))) + nwindows += redisplay_mode_lines (WVAR (w, hchild), force); + else if (WINDOWP (WVAR (w, vchild))) + nwindows += redisplay_mode_lines (WVAR (w, vchild), force); else if (force - || FRAME_GARBAGED_P (XFRAME (w->frame)) + || FRAME_GARBAGED_P (XFRAME (WVAR (w, frame))) || !MATRIX_MODE_LINE_ROW (w->current_matrix)->enabled_p) { struct text_pos lpoint; @@ -20198,7 +20202,7 @@ /* Set the window's buffer for the mode line display. */ SET_TEXT_POS (lpoint, PT, PT_BYTE); - set_buffer_internal_1 (XBUFFER (w->buffer)); + set_buffer_internal_1 (XBUFFER (WVAR (w, buffer))); /* Point refers normally to the selected window. For any other window, set up appropriate value. */ @@ -20206,7 +20210,7 @@ { struct text_pos pt; - SET_TEXT_POS_FROM_MARKER (pt, w->pointm); + SET_TEXT_POS_FROM_MARKER (pt, WVAR (w, pointm)); if (CHARPOS (pt) < BEGV) TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE); else if (CHARPOS (pt) > (ZV - 1)) @@ -20228,7 +20232,7 @@ TEMP_SET_PT_BOTH (CHARPOS (lpoint), BYTEPOS (lpoint)); } - window = w->next; + window = WVAR (w, next); } return nwindows; @@ -20245,13 +20249,13 @@ int n = 0; old_selected_frame = selected_frame; - selected_frame = w->frame; + selected_frame = WVAR (w, frame); old_selected_window = selected_window; XSETWINDOW (selected_window, w); /* These will be set while the mode line specs are processed. */ line_number_displayed = 0; - w->column_number_displayed = Qnil; + WVAR (w, column_number_displayed) = Qnil; if (WINDOW_WANTS_MODELINE_P (w)) { @@ -20981,7 +20985,7 @@ w = XWINDOW (window); if (NILP (buffer)) - buffer = w->buffer; + buffer = WVAR (w, buffer); CHECK_BUFFER (buffer); /* Make formatting the modeline a non-op when noninteractive, otherwise @@ -21387,7 +21391,7 @@ else { ptrdiff_t col = current_column (); - w->column_number_displayed = make_number (col); + WVAR (w, column_number_displayed) = make_number (col); pint2str (decode_mode_spec_buf, field_width, col); return decode_mode_spec_buf; } @@ -21440,33 +21444,33 @@ if (mode_line_target == MODE_LINE_TITLE) return ""; - startpos = XMARKER (w->start)->charpos; - startpos_byte = marker_byte_position (w->start); + startpos = XMARKER (WVAR (w, start))->charpos; + startpos_byte = marker_byte_position (WVAR (w, start)); height = WINDOW_TOTAL_LINES (w); /* If we decided that this buffer isn't suitable for line numbers, don't forget that too fast. */ - if (EQ (w->base_line_pos, w->buffer)) + if (EQ (WVAR (w, base_line_pos), WVAR (w, buffer))) goto no_value; /* But do forget it, if the window shows a different buffer now. */ - else if (BUFFERP (w->base_line_pos)) - w->base_line_pos = Qnil; + else if (BUFFERP (WVAR (w, base_line_pos))) + WVAR (w, base_line_pos) = Qnil; /* If the buffer is very big, don't waste time. */ if (INTEGERP (Vline_number_display_limit) && BUF_ZV (b) - BUF_BEGV (b) > XINT (Vline_number_display_limit)) { - w->base_line_pos = Qnil; - w->base_line_number = Qnil; + WVAR (w, base_line_pos) = Qnil; + WVAR (w, base_line_number) = Qnil; goto no_value; } - if (INTEGERP (w->base_line_number) - && INTEGERP (w->base_line_pos) - && XFASTINT (w->base_line_pos) <= startpos) + if (INTEGERP (WVAR (w, base_line_number)) + && INTEGERP (WVAR (w, base_line_pos)) + && XFASTINT (WVAR (w, base_line_pos)) <= startpos) { - line = XFASTINT (w->base_line_number); - linepos = XFASTINT (w->base_line_pos); + line = XFASTINT (WVAR (w, base_line_number)); + linepos = XFASTINT (WVAR (w, base_line_pos)); linepos_byte = buf_charpos_to_bytepos (b, linepos); } else @@ -21489,8 +21493,8 @@ go back past it. */ if (startpos == BUF_BEGV (b)) { - w->base_line_number = make_number (topline); - w->base_line_pos = make_number (BUF_BEGV (b)); + WVAR (w, base_line_number) = make_number (topline); + WVAR (w, base_line_pos) = make_number (BUF_BEGV (b)); } else if (nlines < height + 25 || nlines > height * 3 + 50 || linepos == BUF_BEGV (b)) @@ -21516,13 +21520,13 @@ give up on line numbers for this window. */ if (position == limit_byte && limit == startpos - distance) { - w->base_line_pos = w->buffer; - w->base_line_number = Qnil; + WVAR (w, base_line_pos) = WVAR (w, buffer); + WVAR (w, base_line_number) = Qnil; goto no_value; } - w->base_line_number = make_number (topline - nlines); - w->base_line_pos = make_number (BYTE_TO_CHAR (position)); + WVAR (w, base_line_number) = make_number (topline - nlines); + WVAR (w, base_line_pos) = make_number (BYTE_TO_CHAR (position)); } /* Now count lines from the start pos to point. */ @@ -21560,10 +21564,10 @@ case 'p': { - ptrdiff_t pos = marker_position (w->start); + ptrdiff_t pos = marker_position (WVAR (w, start)); ptrdiff_t total = BUF_ZV (b) - BUF_BEGV (b); - if (XFASTINT (w->window_end_pos) <= BUF_Z (b) - BUF_ZV (b)) + if (XFASTINT (WVAR (w, window_end_pos)) <= BUF_Z (b) - BUF_ZV (b)) { if (pos <= BUF_BEGV (b)) return "All"; @@ -21591,8 +21595,8 @@ /* Display percentage of size above the bottom of the screen. */ case 'P': { - ptrdiff_t toppos = marker_position (w->start); - ptrdiff_t botpos = BUF_Z (b) - XFASTINT (w->window_end_pos); + ptrdiff_t toppos = marker_position (WVAR (w, start)); + ptrdiff_t botpos = BUF_Z (b) - XFASTINT (WVAR (w, window_end_pos)); ptrdiff_t total = BUF_ZV (b) - BUF_BEGV (b); if (botpos >= BUF_ZV (b)) @@ -22299,7 +22303,7 @@ return OK_PIXELS (WINDOW_SCROLL_BAR_AREA_WIDTH (it->w)); } - prop = buffer_local_value_1 (prop, it->w->buffer); + prop = buffer_local_value_1 (prop, WVAR (it->w, buffer)); if (EQ (prop, Qunbound)) prop = Qnil; } @@ -22351,7 +22355,7 @@ return OK_PIXELS (pixels); } - car = buffer_local_value_1 (car, it->w->buffer); + car = buffer_local_value_1 (car, WVAR (it->w, buffer)); if (EQ (car, Qunbound)) car = Qnil; } @@ -22432,7 +22436,7 @@ { memset (s, 0, sizeof *s); s->w = w; - s->f = XFRAME (w->frame); + s->f = XFRAME (WVAR (w, frame)); #ifdef HAVE_NTGUI s->hdc = hdc; #endif @@ -22764,7 +22768,7 @@ int voffset; int glyph_not_available_p; - eassert (s->f == XFRAME (s->w->frame)); + eassert (s->f == XFRAME (WVAR (s->w, frame))); eassert (s->nchars == 0); eassert (start >= 0 && end > start); @@ -24159,7 +24163,7 @@ int n = width; if (!STRINGP (object)) - object = it->w->buffer; + object = WVAR (it->w, buffer); #ifdef HAVE_WINDOW_SYSTEM if (FRAME_WINDOW_P (it->f)) append_stretch_glyph (it, object, width, height, ascent); @@ -25386,7 +25390,7 @@ int from_x, from_y, to_y; eassert (updated_window && updated_row); - f = XFRAME (w->frame); + f = XFRAME (WVAR (w, frame)); if (updated_row->full_width_p) max_x = WINDOW_TOTAL_WIDTH (w); @@ -25544,8 +25548,8 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width, int *active_cursor) { - struct frame *f = XFRAME (w->frame); - struct buffer *b = XBUFFER (w->buffer); + struct frame *f = XFRAME (WVAR (w, frame)); + struct buffer *b = XBUFFER (WVAR (w, buffer)); int cursor_type = DEFAULT_CURSOR; Lisp_Object alt_cursor; int non_selected = 0; @@ -25856,7 +25860,7 @@ void erase_phys_cursor (struct window *w) { - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); int hpos = w->phys_cursor.hpos; int vpos = w->phys_cursor.vpos; @@ -25975,7 +25979,7 @@ display_and_set_cursor (struct window *w, int on, int hpos, int vpos, int x, int y) { - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); int new_cursor_type; int new_cursor_width; int active_cursor; @@ -26096,14 +26100,14 @@ { while (w) { - if (!NILP (w->hchild)) - update_cursor_in_window_tree (XWINDOW (w->hchild), on_p); - else if (!NILP (w->vchild)) - update_cursor_in_window_tree (XWINDOW (w->vchild), on_p); + if (!NILP (WVAR (w, hchild))) + update_cursor_in_window_tree (XWINDOW (WVAR (w, hchild)), on_p); + else if (!NILP (WVAR (w, vchild))) + update_cursor_in_window_tree (XWINDOW (WVAR (w, vchild)), on_p); else update_window_cursor (w, on_p); - w = NILP (w->next) ? 0 : XWINDOW (w->next); + w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); } } @@ -26127,7 +26131,7 @@ void x_clear_cursor (struct window *w) { - if (FRAME_VISIBLE_P (XFRAME (w->frame)) && w->phys_cursor_on_p) + if (FRAME_VISIBLE_P (XFRAME (WVAR (w, frame))) && w->phys_cursor_on_p) update_window_cursor (w, 0); } @@ -26141,7 +26145,7 @@ enum draw_glyphs_face draw) { #ifdef HAVE_WINDOW_SYSTEM - if (FRAME_WINDOW_P (XFRAME (w->frame))) + if (FRAME_WINDOW_P (XFRAME (WVAR (w, frame)))) { draw_glyphs (w, start_x, row, TEXT_AREA, start_hpos, end_hpos, draw, 0); return; @@ -26312,7 +26316,7 @@ static int coords_in_mouse_face_p (struct window *w, int hpos, int vpos) { - Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WVAR (w, frame))); /* Quickly resolve the easy cases. */ if (!(WINDOWP (hlinfo->mouse_face_window) @@ -26564,7 +26568,7 @@ /* Find the rows corresponding to START_CHARPOS and END_CHARPOS. */ rows_from_pos_range (w, start_charpos, end_charpos, disp_string, &r1, &r2); if (r1 == NULL) - r1 = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); + r1 = MATRIX_ROW (w->current_matrix, XFASTINT (WVAR (w, window_end_vpos))); /* If the before-string or display-string contains newlines, rows_from_pos_range skips to its last row. Move back. */ if (!NILP (before_string) || !NILP (disp_string)) @@ -26586,7 +26590,7 @@ } if (r2 == NULL) { - r2 = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); + r2 = MATRIX_ROW (w->current_matrix, XFASTINT (WVAR (w, window_end_vpos))); hlinfo->mouse_face_past_end = 1; } else if (!NILP (after_string)) @@ -26594,7 +26598,7 @@ /* If the after-string has newlines, advance to its last row. */ struct glyph_row *next; struct glyph_row *last - = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); + = MATRIX_ROW (w->current_matrix, XFASTINT (WVAR (w, window_end_vpos))); for (next = r2 + 1; next <= last @@ -27259,7 +27263,7 @@ enum window_part area) { struct window *w = XWINDOW (window); - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); #ifdef HAVE_WINDOW_SYSTEM Display_Info *dpyinfo; @@ -27343,7 +27347,7 @@ { help_echo_string = help; XSETWINDOW (help_echo_window, w); - help_echo_object = w->buffer; + help_echo_object = WVAR (w, buffer); help_echo_pos = charpos; } } @@ -27379,7 +27383,7 @@ { Lisp_Object default_help = buffer_local_value_1 (Qmode_line_default_help_echo, - w->buffer); + WVAR (w, buffer)); if (STRINGP (default_help)) { @@ -27660,9 +27664,9 @@ /* Are we in a window whose display is up to date? And verify the buffer's text has not changed. */ - b = XBUFFER (w->buffer); + b = XBUFFER (WVAR (w, buffer)); if (part == ON_TEXT - && EQ (w->window_end_valid, w->buffer) + && EQ (WVAR (w, window_end_valid), WVAR (w, buffer)) && w->last_modified == BUF_MODIFF (b) && w->last_overlay_modified == BUF_OVERLAY_MODIFF (b)) { @@ -27869,8 +27873,8 @@ if (pos > 0) { mouse_face = get_char_property_and_overlay - (make_number (pos), Qmouse_face, w->buffer, &overlay); - buffer = w->buffer; + (make_number (pos), Qmouse_face, WVAR (w, buffer), &overlay); + buffer = WVAR (w, buffer); disp_string = object; } } @@ -27896,12 +27900,12 @@ is the smallest. */ Lisp_Object lim1 = NILP (BVAR (XBUFFER (buffer), bidi_display_reordering)) - ? Fmarker_position (w->start) + ? Fmarker_position (WVAR (w, start)) : Qnil; Lisp_Object lim2 = NILP (BVAR (XBUFFER (buffer), bidi_display_reordering)) ? make_number (BUF_Z (XBUFFER (buffer)) - - XFASTINT (w->window_end_pos)) + - XFASTINT (WVAR (w, window_end_pos))) : Qnil; if (NILP (overlay)) @@ -27983,11 +27987,11 @@ if (p > 0) { help = Fget_char_property (make_number (p), - Qhelp_echo, w->buffer); + Qhelp_echo, WVAR (w, buffer)); if (!NILP (help)) { charpos = p; - obj = w->buffer; + obj = WVAR (w, buffer); } } } @@ -28038,7 +28042,7 @@ ptrdiff_t p = string_buffer_position (obj, start); if (p > 0) pointer = Fget_char_property (make_number (p), - Qpointer, w->buffer); + Qpointer, WVAR (w, buffer)); } } else if (BUFFERP (obj) @@ -28076,7 +28080,7 @@ void x_clear_window_mouse_face (struct window *w) { - Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WVAR (w, frame))); Lisp_Object window; BLOCK_INPUT; @@ -28098,7 +28102,7 @@ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); window = hlinfo->mouse_face_window; - if (! NILP (window) && XFRAME (XWINDOW (window)->frame) == f) + if (! NILP (window) && XFRAME (WVAR (XWINDOW (window), frame)) == f) { hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; @@ -28292,7 +28296,7 @@ do it for frames with vertical scroll bars because either the right scroll bar of a window, or the left scroll bar of its neighbor will suffice as a border. */ - if (FRAME_HAS_VERTICAL_SCROLL_BARS (XFRAME (w->frame))) + if (FRAME_HAS_VERTICAL_SCROLL_BARS (XFRAME (WVAR (w, frame)))) return; if (!WINDOW_RIGHTMOST_P (w) @@ -28332,7 +28336,7 @@ static int expose_window (struct window *w, XRectangle *fr) { - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); XRectangle wr, r; int mouse_face_overwritten_p = 0; @@ -28473,21 +28477,21 @@ static int expose_window_tree (struct window *w, XRectangle *r) { - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); int mouse_face_overwritten_p = 0; while (w && !FRAME_GARBAGED_P (f)) { - if (!NILP (w->hchild)) - mouse_face_overwritten_p - |= expose_window_tree (XWINDOW (w->hchild), r); - else if (!NILP (w->vchild)) - mouse_face_overwritten_p - |= expose_window_tree (XWINDOW (w->vchild), r); + if (!NILP (WVAR (w, hchild))) + mouse_face_overwritten_p + |= expose_window_tree (XWINDOW (WVAR (w, hchild)), r); + else if (!NILP (WVAR (w, vchild))) + mouse_face_overwritten_p + |= expose_window_tree (XWINDOW (WVAR (w, vchild)), r); else mouse_face_overwritten_p |= expose_window (w, r); - w = NILP (w->next) ? NULL : XWINDOW (w->next); + w = NILP (WVAR (w, next)) ? NULL : XWINDOW (WVAR (w, next)); } return mouse_face_overwritten_p; @@ -29279,7 +29283,7 @@ if (!noninteractive) { struct window *m = XWINDOW (minibuf_window); - Lisp_Object frame = m->frame; + Lisp_Object frame = WVAR (m, frame); struct frame *f = XFRAME (frame); Lisp_Object root = FRAME_ROOT_WINDOW (f); struct window *r = XWINDOW (root); @@ -29287,12 +29291,12 @@ echo_area_window = minibuf_window; - XSETFASTINT (r->top_line, FRAME_TOP_MARGIN (f)); - XSETFASTINT (r->total_lines, FRAME_LINES (f) - 1 - FRAME_TOP_MARGIN (f)); - XSETFASTINT (r->total_cols, FRAME_COLS (f)); - XSETFASTINT (m->top_line, FRAME_LINES (f) - 1); - XSETFASTINT (m->total_lines, 1); - XSETFASTINT (m->total_cols, FRAME_COLS (f)); + XSETFASTINT (WVAR (r, top_line), FRAME_TOP_MARGIN (f)); + XSETFASTINT (WVAR (r, total_lines), FRAME_LINES (f) - 1 - FRAME_TOP_MARGIN (f)); + XSETFASTINT (WVAR (r, total_cols), FRAME_COLS (f)); + XSETFASTINT (WVAR (m, top_line), FRAME_LINES (f) - 1); + XSETFASTINT (WVAR (m, total_lines), 1); + XSETFASTINT (WVAR (m, total_cols), FRAME_COLS (f)); scratch_glyph_row.glyphs[TEXT_AREA] = scratch_glyphs; scratch_glyph_row.glyphs[TEXT_AREA + 1] === modified file 'src/xfaces.c' --- src/xfaces.c 2012-07-31 12:36:19 +0000 +++ src/xfaces.c 2012-08-01 05:11:36 +0000 @@ -6031,7 +6031,7 @@ ptrdiff_t *endptr, ptrdiff_t limit, int mouse, int base_face_id) { - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); Lisp_Object attrs[LFACE_VECTOR_SIZE]; Lisp_Object prop, position; ptrdiff_t i, noverlays; @@ -6055,9 +6055,9 @@ /* Get the `face' or `mouse_face' text property at POS, and determine the next position at which the property changes. */ - prop = Fget_text_property (position, propname, w->buffer); + prop = Fget_text_property (position, propname, WVAR (w, buffer)); XSETFASTINT (limit1, (limit < endpos ? limit : endpos)); - end = Fnext_single_property_change (position, propname, w->buffer, limit1); + end = Fnext_single_property_change (position, propname, WVAR (w, buffer), limit1); if (INTEGERP (end)) endpos = XINT (end); @@ -6143,7 +6143,7 @@ ptrdiff_t *endptr, ptrdiff_t limit, int mouse, Lisp_Object overlay) { - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); Lisp_Object attrs[LFACE_VECTOR_SIZE]; Lisp_Object prop, position; Lisp_Object frame; @@ -6165,9 +6165,9 @@ /* Get the `face' or `mouse_face' text property at POS, and determine the next position at which the property changes. */ - prop = Fget_text_property (position, propname, w->buffer); + prop = Fget_text_property (position, propname, WVAR (w, buffer)); XSETFASTINT (limit1, (limit < endpos ? limit : endpos)); - end = Fnext_single_property_change (position, propname, w->buffer, limit1); + end = Fnext_single_property_change (position, propname, WVAR (w, buffer), limit1); if (INTEGERP (end)) endpos = XINT (end); === modified file 'src/xfns.c' --- src/xfns.c 2012-07-31 12:36:19 +0000 +++ src/xfns.c 2012-08-01 05:11:36 +0000 @@ -2260,7 +2260,7 @@ void xic_set_preeditarea (struct window *w, int x, int y) { - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); XVaNestedList attr; XPoint spot; @@ -5069,28 +5069,28 @@ /* Set up the frame's root window. */ w = XWINDOW (FRAME_ROOT_WINDOW (f)); - w->left_col = w->top_line = make_number (0); + WVAR (w, left_col) = WVAR (w, top_line) = make_number (0); if (CONSP (Vx_max_tooltip_size) && RANGED_INTEGERP (1, XCAR (Vx_max_tooltip_size), INT_MAX) && RANGED_INTEGERP (1, XCDR (Vx_max_tooltip_size), INT_MAX)) { - w->total_cols = XCAR (Vx_max_tooltip_size); - w->total_lines = XCDR (Vx_max_tooltip_size); + WVAR (w, total_cols) = XCAR (Vx_max_tooltip_size); + WVAR (w, total_lines) = XCDR (Vx_max_tooltip_size); } else { - w->total_cols = make_number (80); - w->total_lines = make_number (40); + WVAR (w, total_cols) = make_number (80); + WVAR (w, total_lines) = make_number (40); } - FRAME_TOTAL_COLS (f) = XINT (w->total_cols); + FRAME_TOTAL_COLS (f) = XINT (WVAR (w, total_cols)); adjust_glyphs (f); w->pseudo_window_p = 1; /* Display the tooltip text in a temporary buffer. */ old_buffer = current_buffer; - set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer)); + set_buffer_internal_1 (XBUFFER (WVAR (XWINDOW (FRAME_ROOT_WINDOW (f)), buffer))); BVAR (current_buffer, truncate_lines) = Qnil; clear_glyph_matrix (w->desired_matrix); clear_glyph_matrix (w->current_matrix); @@ -5151,7 +5151,7 @@ /* w->total_cols and FRAME_TOTAL_COLS want the width in columns, not in pixels. */ width /= WINDOW_FRAME_COLUMN_WIDTH (w); - w->total_cols = make_number (width); + WVAR (w, total_cols) = make_number (width); FRAME_TOTAL_COLS (f) = width; adjust_glyphs (f); clear_glyph_matrix (w->desired_matrix); === modified file 'src/xmenu.c' --- src/xmenu.c 2012-07-31 12:36:19 +0000 +++ src/xmenu.c 2012-08-01 05:11:36 +0000 @@ -985,7 +985,7 @@ if (! menubar_widget) previous_menu_items_used = 0; - buffer = XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer; + buffer = WVAR (XWINDOW (FRAME_SELECTED_WINDOW (f)), buffer); specbind (Qinhibit_quit, Qt); /* Don't let the debugger step into this code because it is not reentrant. */ === modified file 'src/xterm.c' --- src/xterm.c 2012-07-31 12:36:19 +0000 +++ src/xterm.c 2012-08-01 05:11:36 +0000 @@ -628,7 +628,7 @@ static void x_update_window_end (struct window *w, int cursor_on_p, int mouse_face_overwritten_p) { - Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WVAR (w, frame))); if (!w->pseudo_window_p) { @@ -728,7 +728,7 @@ overhead is very small. */ if (windows_or_buffers_changed && desired_row->full_width_p - && (f = XFRAME (w->frame), + && (f = XFRAME (WVAR (w, frame)), width = FRAME_INTERNAL_BORDER_WIDTH (f), width != 0) && (height = desired_row->visible_height, @@ -3295,7 +3295,7 @@ static void x_scroll_run (struct window *w, struct run *run) { - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); int x, y, width, height, from_y, to_y, bottom_y; /* Get frame-relative bounding box of the text display area of W, @@ -4244,9 +4244,9 @@ scroll_bar_end_scroll, 0, 0); w = XWINDOW (window_being_scrolled); - if (!NILP (XSCROLL_BAR (w->vertical_scroll_bar)->dragging)) + if (!NILP (XSCROLL_BAR (WVAR (w, vertical_scroll_bar))->dragging)) { - XSCROLL_BAR (w->vertical_scroll_bar)->dragging = Qnil; + XSCROLL_BAR (WVAR (w, vertical_scroll_bar))->dragging = Qnil; /* The thumb size is incorrect while dragging: fix it. */ set_vertical_scroll_bar (w); } @@ -4277,7 +4277,7 @@ XEvent event; XClientMessageEvent *ev = (XClientMessageEvent *) &event; struct window *w = XWINDOW (window); - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); ptrdiff_t i; BLOCK_INPUT; @@ -4353,7 +4353,7 @@ ievent->timestamp = CurrentTime; #else ievent->timestamp = - XtLastTimestampProcessed (FRAME_X_DISPLAY (XFRAME (w->frame))); + XtLastTimestampProcessed (FRAME_X_DISPLAY (XFRAME (WVAR (w, frame)))); #endif ievent->part = ev->data.l[1]; ievent->code = ev->data.l[2]; @@ -4954,7 +4954,7 @@ static struct scroll_bar * x_scroll_bar_create (struct window *w, int top, int left, int width, int height) { - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); struct scroll_bar *bar = ALLOCATE_PSEUDOVECTOR (struct scroll_bar, x_window, PVEC_OTHER); @@ -5180,7 +5180,7 @@ #endif /* Dissociate this scroll bar from its window. */ - XWINDOW (bar->window)->vertical_scroll_bar = Qnil; + WVAR (XWINDOW (bar->window), vertical_scroll_bar) = Qnil; UNBLOCK_INPUT; } @@ -5194,7 +5194,7 @@ static void XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int position) { - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); struct scroll_bar *bar; int top, height, left, sb_left, width, sb_width; int window_y, window_height; @@ -5245,7 +5245,7 @@ #endif /* Does the scroll bar exist yet? */ - if (NILP (w->vertical_scroll_bar)) + if (NILP (WVAR (w, vertical_scroll_bar))) { if (width > 0 && height > 0) { @@ -5268,7 +5268,7 @@ /* It may just need to be moved and resized. */ unsigned int mask = 0; - bar = XSCROLL_BAR (w->vertical_scroll_bar); + bar = XSCROLL_BAR (WVAR (w, vertical_scroll_bar)); BLOCK_INPUT; @@ -5392,7 +5392,7 @@ } #endif /* not USE_TOOLKIT_SCROLL_BARS */ - XSETVECTOR (w->vertical_scroll_bar, bar); + XSETVECTOR (WVAR (w, vertical_scroll_bar), bar); } @@ -5436,10 +5436,10 @@ struct frame *f; /* We can't redeem this window's scroll bar if it doesn't have one. */ - if (NILP (window->vertical_scroll_bar)) + if (NILP (WVAR (window, vertical_scroll_bar))) abort (); - bar = XSCROLL_BAR (window->vertical_scroll_bar); + bar = XSCROLL_BAR (WVAR (window, vertical_scroll_bar)); /* Unlink it from the condemned list. */ f = XFRAME (WINDOW_FRAME (window)); @@ -5447,11 +5447,11 @@ { /* If the prev pointer is nil, it must be the first in one of the lists. */ - if (EQ (FRAME_SCROLL_BARS (f), window->vertical_scroll_bar)) + if (EQ (FRAME_SCROLL_BARS (f), WVAR (window, vertical_scroll_bar))) /* It's not condemned. Everything's fine. */ return; else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f), - window->vertical_scroll_bar)) + WVAR (window, vertical_scroll_bar))) FRAME_CONDEMNED_SCROLL_BARS (f) = bar->next; else /* If its prev pointer is nil, it must be at the front of @@ -5610,7 +5610,7 @@ static void x_scroll_bar_note_movement (struct scroll_bar *bar, XEvent *event) { - FRAME_PTR f = XFRAME (XWINDOW (bar->window)->frame); + FRAME_PTR f = XFRAME (WVAR (XWINDOW (bar->window), frame)); last_mouse_movement_time = event->xmotion.time; @@ -6784,8 +6784,8 @@ create event iff we don't leave the selected frame. */ && (focus_follows_mouse - || (EQ (XWINDOW (window)->frame, - XWINDOW (selected_window)->frame)))) + || (EQ (WVAR (XWINDOW (window), frame), + WVAR (XWINDOW (selected_window), frame))))) { inev.ie.kind = SELECT_WINDOW_EVENT; inev.ie.frame_or_window = window; @@ -7334,7 +7334,7 @@ static void x_draw_bar_cursor (struct window *w, struct glyph_row *row, int width, enum text_cursor_kinds kind) { - struct frame *f = XFRAME (w->frame); + struct frame *f = XFRAME (WVAR (w, frame)); struct glyph *cursor_glyph; /* If cursor is out of bounds, don't draw garbage. This can happen ------------------------------------------------------------ revno: 109353 committer: Paul Eggert branch nick: trunk timestamp: Tue 2012-07-31 20:51:44 -0700 message: * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-01 02:14:20 +0000 +++ src/ChangeLog 2012-08-01 03:51:44 +0000 @@ -1,3 +1,7 @@ +2012-08-01 Paul Eggert + + * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work. + 2012-08-01 Glenn Morris * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP): === modified file 'src/coding.h' --- src/coding.h 2012-02-10 18:58:48 +0000 +++ src/coding.h 2012-08-01 03:51:44 +0000 @@ -177,7 +177,6 @@ #define CODING_ATTR_PRE_WRITE(attrs) AREF (attrs, coding_attr_pre_write) #define CODING_ATTR_DEFAULT_CHAR(attrs) AREF (attrs, coding_attr_default_char) #define CODING_ATTR_FOR_UNIBYTE(attrs) AREF (attrs, coding_attr_for_unibyte) -#define CODING_ATTR_FLUSHING(attrs) AREF (attrs, coding_attr_flushing) #define CODING_ATTR_PLIST(attrs) AREF (attrs, coding_attr_plist) #define CODING_ATTR_CATEGORY(attrs) AREF (attrs, coding_attr_category) #define CODING_ATTR_SAFE_CHARSETS(attrs)AREF (attrs, coding_attr_safe_charsets) ------------------------------------------------------------ revno: 109352 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-07-31 22:14:20 -0400 message: ChangeLog fixes diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-07-28 07:47:58 +0000 +++ doc/lispref/ChangeLog 2012-08-01 02:14:20 +0000 @@ -125,7 +125,7 @@ 2012-06-08 Dmitry Antipov - * internals.text (Garbage Collection): Document new + * internals.texi (Garbage Collection): Document new vector management code and vectorlike_header structure. 2012-06-03 Chong Yidong === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-31 23:43:31 +0000 +++ lisp/ChangeLog 2012-08-01 02:14:20 +0000 @@ -75,7 +75,7 @@ * calc/calc-ext.el (calc-init-extensions): Remove binding for `calc-alg-simplify-mode'. Add binding for `calc-lim-simplify-mode'. - * calc/calc-help (calc-m-prefix-help): Change messages to + * calc/calc-help.el (calc-m-prefix-help): Change messages to indicate new simplification modes. * calc/README: Mention new default simplification mode. === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-01 01:43:08 +0000 +++ src/ChangeLog 2012-08-01 02:14:20 +0000 @@ -47,7 +47,7 @@ instead of compositeToPoint. (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel. - * nsfns.m, nsmenu.m, msterm.m: Adopt to struct frame/FVAR changes. + * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes. 2012-07-31 Dmitry Antipov @@ -1077,7 +1077,7 @@ 2012-07-13 Glenn Morris - * s/bsd-common, s/cygwin.h: Remove empty files. + * s/bsd-common.h, s/cygwin.h: Remove empty files. * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h. * s/usg5-4-common.h (USG, USG5): ------------------------------------------------------------ revno: 109351 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-07-31 22:02:47 -0400 message: * configure.ac (INTERNAL_TERMINAL): New. diff: === modified file 'ChangeLog' --- ChangeLog 2012-08-01 01:53:04 +0000 +++ ChangeLog 2012-08-01 02:02:47 +0000 @@ -1,6 +1,7 @@ 2012-08-01 Glenn Morris - * configure.ac (FLOAT_CHECK_DOMAIN, HAVE_INVERSE_HYPERBOLIC): New. + * configure.ac (FLOAT_CHECK_DOMAIN, HAVE_INVERSE_HYPERBOLIC) + (INTERNAL_TERMINAL): New. * configure.ac (DEVICE_SEP, IS_DEVICE_SEP, IS_DIRECTORY_SEP) (IS_ANY_SEP): Move here from src/lisp.h. === modified file 'configure.ac' --- configure.ac 2012-08-01 01:53:04 +0000 +++ configure.ac 2012-08-01 02:02:47 +0000 @@ -3153,6 +3153,8 @@ AC_DEFINE(HAVE_SOCKETS, 1, [Define if the system supports 4.2-compatible sockets.]) +AH_TEMPLATE(INTERNAL_TERMINAL, [This is substituted when $TERM is "internal".]) + AC_DEFINE(NULL_DEVICE, ["/dev/null"], [Name of the file to open to get a null file, or a data sink.]) ------------------------------------------------------------ revno: 109350 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-07-31 21:53:04 -0400 message: * configure.ac (FLOAT_CHECK_DOMAIN, HAVE_INVERSE_HYPERBOLIC): New. diff: === modified file 'ChangeLog' --- ChangeLog 2012-08-01 01:43:08 +0000 +++ ChangeLog 2012-08-01 01:53:04 +0000 @@ -1,5 +1,7 @@ 2012-08-01 Glenn Morris + * configure.ac (FLOAT_CHECK_DOMAIN, HAVE_INVERSE_HYPERBOLIC): New. + * configure.ac (DEVICE_SEP, IS_DEVICE_SEP, IS_DIRECTORY_SEP) (IS_ANY_SEP): Move here from src/lisp.h. === modified file 'configure.ac' --- configure.ac 2012-08-01 01:43:08 +0000 +++ configure.ac 2012-08-01 01:53:04 +0000 @@ -3136,6 +3136,12 @@ so that Emacs can tell instantly when you try to modify a file that someone else has modified in his/her Emacs.]) +AH_TEMPLATE(FLOAT_CHECK_DOMAIN, [Define if the float library doesn't + handle errors by either setting errno, or signaling SIGFPE/SIGILL.]) + +AH_TEMPLATE(HAVE_INVERSE_HYPERBOLIC, [Define if you have the functions + acosh, asinh, and atanh.]) + dnl Everybody supports this, except MS. dnl Seems like the kind of thing we should be testing for, though. ## Note: PTYs are broken on darwin <6. Use at your own risk. ------------------------------------------------------------ revno: 109349 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-07-31 21:43:08 -0400 message: Move definitions of directory and device separators to configure * configure.ac (DEVICE_SEP, IS_DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP): Move here from src/lisp.h. * src/lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP): Move to configure.ac. diff: === modified file 'ChangeLog' --- ChangeLog 2012-08-01 00:29:59 +0000 +++ ChangeLog 2012-08-01 01:43:08 +0000 @@ -1,3 +1,8 @@ +2012-08-01 Glenn Morris + + * configure.ac (DEVICE_SEP, IS_DEVICE_SEP, IS_DIRECTORY_SEP) + (IS_ANY_SEP): Move here from src/lisp.h. + 2012-08-01 Juanma Barranquero * lib/makefile.w32-in (CONFIG_H): Update dependencies. === modified file 'configure.ac' --- configure.ac 2012-07-31 23:20:25 +0000 +++ configure.ac 2012-08-01 01:43:08 +0000 @@ -3158,6 +3158,20 @@ AC_DEFINE(USER_FULL_NAME, [pw->pw_gecos], [How to get a user's full name.]) +dnl Only used on MS platforms. +AH_TEMPLATE(DEVICE_SEP, [Character that separates a device in a file name.]) + +AC_DEFINE(IS_DEVICE_SEP(_c_), 0, + [Returns true if character is a device separator.]) + +AC_DEFINE(IS_DIRECTORY_SEP(_c_), [((_c_) == DIRECTORY_SEP)], + [Returns true if character is a directory separator.]) + +dnl On MS, this also accepts IS_DEVICE_SEP. +AC_DEFINE(IS_ANY_SEP(_c_), [(IS_DIRECTORY_SEP (_c_))], + [Returns true if character is any form of separator.]) + + AH_TEMPLATE(NO_EDITRES, [Define if XEditRes should not be used.]) case $opsys in === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-01 00:29:59 +0000 +++ src/ChangeLog 2012-08-01 01:43:08 +0000 @@ -1,3 +1,8 @@ +2012-08-01 Glenn Morris + + * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP): + Move to configure.ac. + 2012-08-01 Juanma Barranquero * makefile.w32-in (CONFIG_H): Update dependencies. === modified file 'src/lisp.h' --- src/lisp.h 2012-07-31 12:36:19 +0000 +++ src/lisp.h 2012-08-01 01:43:08 +0000 @@ -3305,24 +3305,7 @@ /* Set up the name of the machine we're running on. */ extern void init_system_name (void); -/* Some systems (e.g., NT) use a different path separator than Unix, - in addition to a device separator. Set the path separator - to '/', and don't test for a device separator in IS_ANY_SEP. */ - static char const DIRECTORY_SEP = '/'; -#ifndef IS_DIRECTORY_SEP -#define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP) -#endif -#ifndef IS_DEVICE_SEP -#ifndef DEVICE_SEP -#define IS_DEVICE_SEP(_c_) 0 -#else -#define IS_DEVICE_SEP(_c_) ((_c_) == DEVICE_SEP) -#endif -#endif -#ifndef IS_ANY_SEP -#define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_)) -#endif /* Use this to suppress gcc's warnings. */ #ifdef lint ------------------------------------------------------------ revno: 109348 committer: Juanma Barranquero branch nick: trunk timestamp: Wed 2012-08-01 02:29:59 +0200 message: Adapt Windows port to recent changes in autogen/config.in. * lib-src/makefile.w32-in (CONFIG_H): Update dependencies. (CONF_POST_H): New macro. * lib/makefile.w32-in (CONFIG_H): Update dependencies. (CONF_POST_H): New macro. * nt/config.nt: Sync with autogen/config.in. Remove code moved to conf_post.h and include (NULL_DEVICE, SEPCHAR, SIGNAL_H_AHB, TIOCSIGSEND, USER_FULL_NAME) (USG5_4, WRETCODE, _longjmp, _setjmp, wait3): New macros. * src/makefile.w32-in (CONFIG_H): Update dependencies. (CONF_POST_H): New macro. * src/s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt. diff: === modified file 'ChangeLog' --- ChangeLog 2012-07-31 23:20:25 +0000 +++ ChangeLog 2012-08-01 00:29:59 +0000 @@ -1,3 +1,8 @@ +2012-08-01 Juanma Barranquero + + * lib/makefile.w32-in (CONFIG_H): Update dependencies. + (CONF_POST_H): New macro. + 2012-07-31 Glenn Morris * configure.ac (S_FILE): Remove output variable. === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2012-07-30 16:20:35 +0000 +++ lib-src/ChangeLog 2012-08-01 00:29:59 +0000 @@ -1,3 +1,8 @@ +2012-08-01 Juanma Barranquero + + * makefile.w32-in (CONFIG_H): Update dependencies. + (CONF_POST_H): New macro. + 2012-07-30 Paul Eggert Update .PHONY listings in makefiles. === modified file 'lib-src/makefile.w32-in' --- lib-src/makefile.w32-in 2012-07-29 15:53:31 +0000 +++ lib-src/makefile.w32-in 2012-08-01 00:29:59 +0000 @@ -362,8 +362,10 @@ MS_W32_H = $(SRC)/s/ms-w32.h \ $(NT_INC)/sys/stat.h +CONF_POST_H = $(SRC)/conf_post.h \ + $(MS_W32_H) CONFIG_H = $(SRC)/config.h \ - $(MS_W32_H) + $(CONF_POST_H) INTTYPES_H = $(NT_INC)/inttypes.h \ $(NT_INC)/stdint.h NTLIB_H = $(LIB_SRC)/ntlib.h \ === modified file 'lib/makefile.w32-in' --- lib/makefile.w32-in 2012-07-29 08:18:29 +0000 +++ lib/makefile.w32-in 2012-08-01 00:29:59 +0000 @@ -73,8 +73,10 @@ $(NT_INC)/stdbool.h MS_W32_H = $(SRC)/s/ms-w32.h \ $(NT_INC)/sys/stat.h +CONF_POST_H = $(SRC)/conf_post.h \ + $(MS_W32_H) CONFIG_H = $(SRC)/config.h \ - $(MS_W32_H) + $(CONF_POST_H) FILEMODE_H = $(GNU_LIB)/filemode.h \ $(NT_INC)/sys/stat.h FTOASTR_H = $(GNU_LIB)/ftoastr.h \ === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-07-29 16:56:18 +0000 +++ nt/ChangeLog 2012-08-01 00:29:59 +0000 @@ -1,3 +1,10 @@ +2012-08-01 Juanma Barranquero + + * config.nt: Sync with autogen/config.in. + Remove code moved to conf_post.h and include + (NULL_DEVICE, SEPCHAR, SIGNAL_H_AHB, TIOCSIGSEND, USER_FULL_NAME) + (USG5_4, WRETCODE, _longjmp, _setjmp, wait3): New macros. + 2012-07-29 Juanma Barranquero * config.nt: Sync with autogen/config.in. === modified file 'nt/config.nt' --- nt/config.nt 2012-07-29 16:56:18 +0000 +++ nt/config.nt 2012-08-01 00:29:59 +0000 @@ -36,6 +36,10 @@ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD +/* Define to use the convention that & in the full name stands for the login + id. */ +#undef AMPERSAND_FULL_NAME + /* Define to the number of bits in type 'ptrdiff_t'. */ #undef BITSIZEOF_PTRDIFF_T @@ -1166,6 +1170,9 @@ /* Define to 1 if you are using NS windowing under GNUstep. */ #undef NS_IMPL_GNUSTEP +/* Name of the file to open to get a null file, or a data sink. */ +#define NULL_DEVICE "NUL:" + /* Define to 1 if the nlist n_name member is a pointer */ #undef N_NAME_POINTER @@ -1248,6 +1255,9 @@ /* Define if emacs.c needs to call run_time_remap; for HPUX. */ #undef RUN_TIME_REMAP +/* Character that separates PATH elements. */ +#define SEPCHAR ';' + /* Define if process.c:child_setup should not call setpgrp. */ #undef SETPGRP_RELEASES_CTTY @@ -1257,6 +1267,9 @@ /* Make process_send_signal work by "typing" a signal character on the pty. */ #undef SIGNALS_VIA_CHARACTERS +/* Define if AH_BOTTOM should include signal.h. */ +#undef SIGNAL_H_AHB + /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type 'sig_atomic_t'. */ #undef SIG_ATOMIC_T_SUFFIX @@ -1306,6 +1319,9 @@ /* Define to 1 if you can safely include both and . */ #define TIME_WITH_SYS_TIME 1 +/* Some platforms redefine this. */ +#undef TIOCSIGSEND + /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME @@ -1326,6 +1342,9 @@ /* Define if the system has Unix98 PTYs. */ #undef UNIX98_PTYS +/* How to get a user's full name. */ +#define USER_FULL_NAME pw->pw_gecos + /* Define to 1 if using GTK. */ #undef USE_GTK @@ -1353,6 +1372,9 @@ /* Define if the system is compatible with System V. */ #undef USG5 +/* Define if the system is compatible with System V Release 4. */ +#undef USG5_4 + /* Define for USG systems where it works to open a pty's tty in the parent process, then close and reopen it in the child. */ #undef USG_SUBTTY_WORKS @@ -1383,6 +1405,9 @@ # endif #endif +/* Some platforms redefine this. */ +#undef WRETCODE + /* Define this to check for malloc buffer overrun. */ #undef XMALLOC_OVERRUN_CHECK @@ -1483,6 +1508,12 @@ declarations. Define as empty for no equivalent. */ #undef __restrict_arr +/* Some platforms redefine this. */ +#undef _longjmp + +/* Some platforms redefine this. */ +#undef _setjmp + /* Define to the used os dependent file. */ #define config_opsysfile "s/ms-w32.h" @@ -1549,6 +1580,9 @@ /* Define as a signed type of the same size as size_t. */ #undef ssize_t +/* Define to enable asynchronous subprocesses. */ +#define subprocesses + /* Define to any substitute for sys_siglist. */ #undef sys_siglist @@ -1585,104 +1619,10 @@ /* Define as `fork' if `vfork' does not work. */ #undef vfork - -/* Not valid on Windows. */ -#if 0 -/* On AIX 3 this must be included before any other include file. */ -#include -#if ! HAVE_ALLOCA -# error "alloca not available on this machine" -#endif -#endif - -/* This silences a few compilation warnings on FreeBSD. */ -#ifdef BSD_SYSTEM_AHB -#undef BSD_SYSTEM_AHB -#undef BSD_SYSTEM -#if __FreeBSD__ == 1 -#define BSD_SYSTEM 199103 -#elif __FreeBSD__ == 2 -#define BSD_SYSTEM 199306 -#elif __FreeBSD__ >= 3 -#define BSD_SYSTEM 199506 -#endif -#endif - -/* Define AMPERSAND_FULL_NAME if you use the convention - that & in the full name stands for the login id. */ -#undef AMPERSAND_FULL_NAME - -/* `subprocesses' should be defined if you want to - have code for asynchronous subprocesses - (as used in M-x compile and M-x shell). - Only MSDOS does not support this (it overrides - this in its config_opsysfile below). */ - -#define subprocesses - -/* Include the os dependent file. */ -#ifdef config_opsysfile -# include config_opsysfile -#endif - -/* Mac OS X / GNUstep need a bit more pure memory. Of the existing knobs, - SYSTEM_PURESIZE_EXTRA seems like the least likely to cause problems. */ -#ifdef HAVE_NS -#if defined NS_IMPL_GNUSTEP -# define SYSTEM_PURESIZE_EXTRA 30000 -#elif defined DARWIN_OS -# define SYSTEM_PURESIZE_EXTRA 200000 -#endif -#endif - -#ifdef emacs /* Don't do this for lib-src. */ -/* Tell regex.c to use a type compatible with Emacs. */ -#define RE_TRANSLATE_TYPE Lisp_Object -#define RE_TRANSLATE(TBL, C) CHAR_TABLE_TRANSLATE (TBL, C) -#ifdef make_number -/* If make_number is a macro, use it. */ -#define RE_TRANSLATE_P(TBL) (!EQ (TBL, make_number (0))) -#else -/* If make_number is a function, avoid it. */ -#define RE_TRANSLATE_P(TBL) (!(INTEGERP (TBL) && XINT (TBL) == 0)) -#endif -#endif - -#include -#include - -#if __GNUC__ >= 3 /* On GCC 3.0 we might get a warning. */ -#define NO_INLINE __attribute__((noinline)) -#else -#define NO_INLINE -#endif - -#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) -#define EXTERNALLY_VISIBLE __attribute__((externally_visible)) -#else -#define EXTERNALLY_VISIBLE -#endif - -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) -# define ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) -#else -# define ATTRIBUTE_FORMAT(spec) /* empty */ -#endif - -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) -# define ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \ - ATTRIBUTE_FORMAT ((__gnu_printf__, formatstring_parameter, first_argument)) -#else -# define ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \ - ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument)) -#endif - -#define ATTRIBUTE_CONST _GL_ATTRIBUTE_CONST - -/* Some versions of GNU/Linux define noinline in their headers. */ -#ifdef noinline -#undef noinline -#endif +/* Some platforms redefine this. */ +#undef wait3 + +#include #endif /* EMACS_CONFIG_H */ === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-31 23:20:25 +0000 +++ src/ChangeLog 2012-08-01 00:29:59 +0000 @@ -1,3 +1,10 @@ +2012-08-01 Juanma Barranquero + + * makefile.w32-in (CONFIG_H): Update dependencies. + (CONF_POST_H): New macro. + + * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt. + 2012-07-31 Glenn Morris * Makefile.in (S_FILE): No longer set by configure. === modified file 'src/makefile.w32-in' --- src/makefile.w32-in 2012-07-30 21:20:43 +0000 +++ src/makefile.w32-in 2012-08-01 00:29:59 +0000 @@ -405,9 +405,10 @@ $(SRC)/composite.h MS_W32_H = $(SRC)/s/ms-w32.h \ $(NT_INC)/sys/stat.h +CONF_POST_H = $(SRC)/conf_post.h \ + $(MS_W32_H) CONFIG_H = $(SRC)/config.h \ - $(SRC)/conf_post.h \ - $(MS_W32_H) + $(CONF_POST_H) DIR_H = $(NT_INC)/sys/dir.h \ $(SRC)/ndir.h W32GUI_H = $(SRC)/w32gui.h \ === modified file 'src/s/ms-w32.h' --- src/s/ms-w32.h 2012-07-25 22:47:42 +0000 +++ src/s/ms-w32.h 2012-08-01 00:29:59 +0000 @@ -52,10 +52,6 @@ #define MAIL_USE_SYSTEM_LOCK 1 -/* If the character used to separate elements of the executable path - is not ':', #define this to be the appropriate character constant. */ -#define SEPCHAR ';' - /* Define to 1 if GCC-style __attribute__ ((__aligned__ (expr))) works. */ #ifdef __GNUC__ #define HAVE_ATTRIBUTE_ALIGNED 1 @@ -141,9 +137,6 @@ #define SIG_SETMASK 2 #define SIG_UNBLOCK 3 -/* The null device on Windows NT. */ -#define NULL_DEVICE "NUL:" - #ifndef MAXPATHLEN #define MAXPATHLEN _MAX_PATH #endif ------------------------------------------------------------ revno: 109347 committer: Fabián Ezequiel Gallina branch nick: trunk timestamp: Tue 2012-07-31 20:43:31 -0300 message: Shell processes: enhancements to startup and CEDET compatibility. * progmodes/python.el (python-shell-send-setup-max-wait): Delete var. (python-shell-make-comint): accept-process-output at startup. (run-python-internal): Set inferior-python-mode-hook to nil. (python-shell-internal-get-or-create-process): call sit-for. (python-preoutput-result): Add obsolete alias. (python-shell-internal-send-string): Use it. (python-shell-send-setup-code): Remove call to accept-process-output. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-31 22:34:36 +0000 +++ lisp/ChangeLog 2012-07-31 23:43:31 +0000 @@ -1,3 +1,15 @@ +2012-07-31 Fabián Ezequiel Gallina + + Shell processes: enhancements to startup and CEDET compatibility. + * progmodes/python.el (python-shell-send-setup-max-wait): Delete var. + (python-shell-make-comint): accept-process-output at startup. + (run-python-internal): Set inferior-python-mode-hook to nil. + (python-shell-internal-get-or-create-process): call sit-for. + (python-preoutput-result): Add obsolete alias. + (python-shell-internal-send-string): Use it. + (python-shell-send-setup-code): Remove call to + accept-process-output. + 2012-07-31 Andreas Schwab * buff-menu.el (list-buffers-noselect): Use prefix-numeric-value. === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2012-07-31 03:31:10 +0000 +++ lisp/progmodes/python.el 2012-07-31 23:43:31 +0000 @@ -1354,14 +1354,6 @@ :group 'python :safe 'booleanp) -(defcustom python-shell-send-setup-max-wait 5 - "Seconds to wait for process output before code setup. -If output is received before the specified time then control is -returned in that moment and not after waiting." - :type 'integer - :group 'python - :safe 'integerp) - (defcustom python-shell-process-environment nil "List of environment variables for Python shell. This variable follows the same rules as `process-environment' @@ -1571,7 +1563,8 @@ (current-buffer (current-buffer))) (with-current-buffer buffer (inferior-python-mode) - (python-util-clone-local-variables current-buffer)))) + (python-util-clone-local-variables current-buffer)) + (accept-process-output (get-buffer-process buffer)))) (and pop (pop-to-buffer proc-buffer-name t)) proc-buffer-name))) @@ -1605,17 +1598,19 @@ "Run an inferior Internal Python process. Input and output via buffer named after `python-shell-internal-buffer-name' and what -`python-shell-internal-get-process-name' returns. This new kind -of shell is intended to be used for generic communication related -to defined configurations. The main difference with global or -dedicated shells is that these ones are attached to a -configuration, not a buffer. This means that can be used for -example to retrieve the sys.path and other stuff, without messing -with user shells. Runs the hook -`inferior-python-mode-hook' (after the `comint-mode-hook' is -run). \(Type \\[describe-mode] in the process buffer for a list -of commands.)" - (let ((python-shell-enable-font-lock nil)) +`python-shell-internal-get-process-name' returns. + +This new kind of shell is intended to be used for generic +communication related to defined configurations, the main +difference with global or dedicated shells is that these ones are +attached to a configuration, not a buffer. This means that can +be used for example to retrieve the sys.path and other stuff, +without messing with user shells. Note that +`python-shell-enable-font-lock' and `inferior-python-mode-hook' +are set to nil for these shells, so setup codes are not sent at +startup." + (let ((python-shell-enable-font-lock nil) + (inferior-python-mode-hook nil)) (set-process-query-on-exit-flag (get-buffer-process (python-shell-make-comint @@ -1658,12 +1653,25 @@ there for compatibility with CEDET.") (make-variable-buffer-local 'python-shell-internal-buffer) +(defvar python-shell-internal-last-output nil + "Last output captured by the internal shell. +This is really not necessary at all for the code to work but it's +there for compatibility with CEDET.") +(make-variable-buffer-local 'python-shell-internal-last-output) + (defun python-shell-internal-get-or-create-process () "Get or create an inferior Internal Python process." (let* ((proc-name (python-shell-internal-get-process-name)) (proc-buffer-name (format "*%s*" proc-name))) - (run-python-internal) - (setq python-shell-internal-buffer proc-buffer-name) + (when (not (process-live-p proc-name)) + (run-python-internal) + (setq python-shell-internal-buffer proc-buffer-name) + ;; XXX: Why is this `sit-for' needed? + ;; `python-shell-make-comint' calls `accept-process-output' + ;; already but it is not helping to get proper output on + ;; 'gnu/linux when the internal shell process is not running and + ;; a call to `python-shell-internal-send-string' is issued. + (sit-for 0.1 t)) (get-buffer-process proc-buffer-name))) (define-obsolete-function-alias @@ -1672,6 +1680,9 @@ (define-obsolete-variable-alias 'python-buffer 'python-shell-internal-buffer "24.2") +(define-obsolete-variable-alias + 'python-preoutput-result 'python-shell-internal-last-output "24.2") + (defun python-shell-send-string (string &optional process msg) "Send STRING to inferior Python PROCESS. When MSG is non-nil messages the first line of STRING." @@ -1723,11 +1734,14 @@ (defun python-shell-internal-send-string (string) "Send STRING to the Internal Python interpreter. Returns the output. See `python-shell-send-string-no-output'." - (python-shell-send-string-no-output - ;; Makes this function compatible with the old - ;; python-send-receive. (At least for CEDET). - (replace-regexp-in-string "_emacs_out +" "" string) - (python-shell-internal-get-or-create-process) nil)) + ;; XXX Remove `python-shell-internal-last-output' once CEDET is + ;; updated to support this new mode. + (setq python-shell-internal-last-output + (python-shell-send-string-no-output + ;; Makes this function compatible with the old + ;; python-send-receive. (At least for CEDET). + (replace-regexp-in-string "_emacs_out +" "" string) + (python-shell-internal-get-or-create-process) nil))) (define-obsolete-function-alias 'python-send-receive 'python-shell-internal-send-string "24.2") @@ -1808,7 +1822,6 @@ `python-shell-setup-codes' list." (let ((msg "Sent %s") (process (get-buffer-process (current-buffer)))) - (accept-process-output process python-shell-send-setup-max-wait) (dolist (code python-shell-setup-codes) (when code (message (format msg code)) ------------------------------------------------------------ revno: 109346 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-07-31 19:20:25 -0400 message: * configure.ac (S_FILE): Remove output variable. * src/Makefile.in (S_FILE): No longer set by configure. * msdos/sed1v2.inp (S_FILE): Update for format change. diff: === modified file 'ChangeLog' --- ChangeLog 2012-07-31 23:12:24 +0000 +++ ChangeLog 2012-07-31 23:20:25 +0000 @@ -1,5 +1,7 @@ 2012-07-31 Glenn Morris + * configure.ac (S_FILE): Remove output variable. + * configure.ac (opsysfile): Use AH_TEMPLATE. Doc fix. * configure.ac (NULL_DEVICE, SEPCHAR, USER_FULL_NAME): === modified file 'configure.ac' --- configure.ac 2012-07-31 23:12:24 +0000 +++ configure.ac 2012-07-31 23:20:25 +0000 @@ -3876,8 +3876,6 @@ AC_SUBST(CFLAGS) ## Used in lwlib/Makefile.in. AC_SUBST(X_TOOLKIT_TYPE) -S_FILE= -AC_SUBST(S_FILE) AC_SUBST(ns_appdir) AC_SUBST(ns_appbindir) AC_SUBST(ns_appresdir) === modified file 'msdos/ChangeLog' --- msdos/ChangeLog 2012-07-28 23:05:32 +0000 +++ msdos/ChangeLog 2012-07-31 23:20:25 +0000 @@ -1,3 +1,7 @@ +2012-07-31 Glenn Morris + + * sed1v2.inp (S_FILE): Update for format change. + 2012-07-28 Paul Eggert Use Gnulib stdalign module (Bug#9772, Bug#9960). === modified file 'msdos/sed1v2.inp' --- msdos/sed1v2.inp 2012-07-14 10:03:30 +0000 +++ msdos/sed1v2.inp 2012-07-31 23:20:25 +0000 @@ -129,7 +129,7 @@ /^MKDEPDIR *=/s/@MKDEPDIR@// /^version *=/s/@[^@\n]*@// /^M_FILE *=/s!@M_FILE@!$(srcdir)/m/intel386.h! -/^S_FILE *=/s!@S_FILE@!$(srcdir)/s/msdos.h! +/^S_FILE *=/s!=!= $(srcdir)/s/msdos.h! /^@SET_MAKE@$/s/@SET_MAKE@// /^ [ ]*\$(libsrc)\/make-docfile.*>.*\/DOC/s!make-docfile!make-docfile -o $(etc)/DOC! /^ [ ]*\$(libsrc)\/make-docfile.*>.*gl-tmp/s!make-docfile!make-docfile -o gl-tmp! === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-31 23:02:12 +0000 +++ src/ChangeLog 2012-07-31 23:20:25 +0000 @@ -1,5 +1,7 @@ 2012-07-31 Glenn Morris + * Makefile.in (S_FILE): No longer set by configure. + * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT is available. (alloca.h) [WINDOWSNT]: Don't include it on MS Windows. === modified file 'src/Makefile.in' --- src/Makefile.in 2012-07-30 21:20:43 +0000 +++ src/Makefile.in 2012-07-31 23:20:25 +0000 @@ -56,7 +56,8 @@ lispdir = ../lisp # Configuration files for .o files to depend on. -S_FILE = @S_FILE@ +# MS-DOS sets S_FILE non-nil. +S_FILE = config_h = config.h conf_post.h $(S_FILE) bootstrap_exe = $(abs_builddir)/bootstrap-emacs$(EXEEXT) ------------------------------------------------------------ revno: 109345 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-07-31 19:12:24 -0400 message: * configure.ac (opsysfile): Use AH_TEMPLATE. Doc fix. diff: === modified file 'ChangeLog' --- ChangeLog 2012-07-31 22:24:49 +0000 +++ ChangeLog 2012-07-31 23:12:24 +0000 @@ -1,5 +1,7 @@ 2012-07-31 Glenn Morris + * configure.ac (opsysfile): Use AH_TEMPLATE. Doc fix. + * configure.ac (NULL_DEVICE, SEPCHAR, USER_FULL_NAME): Move here from src. === modified file 'configure.ac' --- configure.ac 2012-07-31 22:24:49 +0000 +++ configure.ac 2012-07-31 23:12:24 +0000 @@ -3889,9 +3889,8 @@ [Define to the canonical Emacs configuration name.]) AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${ac_configure_args}", [Define to the options passed to configure.]) -if test -z "No longer used"; then - AC_DEFINE(config_opsysfile, [], [Define to the used os dependent file.]) -fi +AH_TEMPLATE(config_opsysfile, [Some platforms that do not use configure + define this to include extra configuration information.]) XMENU_OBJ= XOBJ= ------------------------------------------------------------ revno: 109344 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-07-31 19:03:04 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/config.in' --- autogen/config.in 2012-07-31 10:17:40 +0000 +++ autogen/config.in 2012-07-31 23:03:04 +0000 @@ -31,6 +31,10 @@ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD +/* Define to use the convention that & in the full name stands for the login + id. */ +#undef AMPERSAND_FULL_NAME + /* Define to the number of bits in type 'ptrdiff_t'. */ #undef BITSIZEOF_PTRDIFF_T @@ -1155,6 +1159,9 @@ /* Define to 1 if you are using NS windowing under GNUstep. */ #undef NS_IMPL_GNUSTEP +/* Name of the file to open to get a null file, or a data sink. */ +#undef NULL_DEVICE + /* Define to 1 if the nlist n_name member is a pointer */ #undef N_NAME_POINTER @@ -1237,6 +1244,9 @@ /* Define if emacs.c needs to call run_time_remap; for HPUX. */ #undef RUN_TIME_REMAP +/* Character that separates PATH elements. */ +#undef SEPCHAR + /* Define if process.c:child_setup should not call setpgrp. */ #undef SETPGRP_RELEASES_CTTY @@ -1321,6 +1331,9 @@ /* Define if the system has Unix98 PTYs. */ #undef UNIX98_PTYS +/* How to get a user's full name. */ +#undef USER_FULL_NAME + /* Define to 1 if using GTK. */ #undef USE_GTK @@ -1557,6 +1570,9 @@ /* Define as a signed type of the same size as size_t. */ #undef ssize_t +/* Define to enable asynchronous subprocesses. */ +#undef subprocesses + /* Define to any substitute for sys_siglist. */ #undef sys_siglist === modified file 'autogen/configure' --- autogen/configure 2012-07-31 10:17:40 +0000 +++ autogen/configure 2012-07-31 23:03:04 +0000 @@ -11283,8 +11283,22 @@ LIBXP= if test "${USE_X_TOOLKIT}" = "MOTIF"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Motif version 2.1" >&5 -$as_echo_n "checking for Motif version 2.1... " >&6; } + # OpenMotif may be installed in such a way on some GNU/Linux systems. + if test -d /usr/include/openmotif; then + CPPFLAGS="-I/usr/include/openmotif $CPPFLAGS" + emacs_cv_openmotif=yes + case "$canonical" in + x86_64-*-linux-gnu* | powerpc64-*-linux-gnu* | sparc64-*-linux-gnu*) + test -d /usr/lib64/openmotif && LDFLAGS="-L/usr/lib64/openmotif $LDFLAGS" + ;; + *) + test -d /usr/lib/openmotif && LDFLAGS="-L/usr/lib/openmotif $LDFLAGS" + esac + else + emacs_cv_openmotif=no + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for (Open)Motif version 2.1" >&5 +$as_echo_n "checking for (Open)Motif version 2.1... " >&6; } if test "${emacs_cv_motif_version_2_1+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -11353,6 +11367,9 @@ LIBXP=-lXp fi + if test x$emacs_cv_openmotif = xyes; then + REAL_CPPFLAGS="-I/usr/include/openmotif $REAL_CPPFLAGS" + fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LessTif where some systems put it" >&5 $as_echo_n "checking for LessTif where some systems put it... " >&6; } @@ -13031,7 +13048,7 @@ ## version number A.09.05. ## You can fix the math library by installing patch number PHSS_4630. ## But we can fix it more reliably for Emacs by just not using rint. -## We also skip HAVE_RANDOM - see comments in src/s/hpux10-20.h. +## We also skip HAVE_RANDOM - see comments in src/conf_post.h. case $opsys in hpux*) : ;; *) for ac_func in random rint @@ -14625,6 +14642,10 @@ +$as_echo "#define AMPERSAND_FULL_NAME 1" >>confdefs.h + + + $as_echo "#define CLASH_DETECTION 1" >>confdefs.h @@ -14638,6 +14659,22 @@ +$as_echo "#define NULL_DEVICE \"/dev/null\"" >>confdefs.h + + + +$as_echo "#define SEPCHAR ':'" >>confdefs.h + + + +$as_echo "#define subprocesses 1" >>confdefs.h + + + +$as_echo "#define USER_FULL_NAME pw->pw_gecos" >>confdefs.h + + + case $opsys in ------------------------------------------------------------ revno: 109343 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-07-31 19:02:12 -0400 message: Minor rearrangement for src/conf_post.h * src/conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT is available. (alloca.h) [WINDOWSNT]: Don't include it on MS Windows. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-31 22:24:49 +0000 +++ src/ChangeLog 2012-07-31 23:02:12 +0000 @@ -1,5 +1,9 @@ 2012-07-31 Glenn Morris + * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT + is available. + (alloca.h) [WINDOWSNT]: Don't include it on MS Windows. + * process.h (NULL_DEVICE): * emacs.c (SEPCHAR): * editfns.c (USER_FULL_NAME): Let configure set them. === modified file 'src/conf_post.h' --- src/conf_post.h 2012-07-31 18:34:26 +0000 +++ src/conf_post.h 2012-07-31 23:02:12 +0000 @@ -27,11 +27,18 @@ /* Code: */ +/* Include any platform specific configuration file. */ +#ifdef config_opsysfile +# include config_opsysfile +#endif + +#ifndef WINDOWSNT /* On AIX 3 this must be included before any other include file. */ #include #if ! HAVE_ALLOCA # error "alloca not available on this machine" #endif +#endif #ifdef SIGNAL_H_AHB #undef SIGNAL_H_AHB @@ -107,11 +114,6 @@ #endif #endif /* USG5_4 */ -/* Include the os dependent file. */ -#ifdef config_opsysfile -# include config_opsysfile -#endif - /* Mac OS X / GNUstep need a bit more pure memory. Of the existing knobs, SYSTEM_PURESIZE_EXTRA seems like the least likely to cause problems. */ #ifdef HAVE_NS ------------------------------------------------------------ revno: 109342 committer: Andreas Schwab branch nick: emacs timestamp: Wed 2012-08-01 00:34:36 +0200 message: Fixes: debbugs:12108 * buff-menu.el (list-buffers-noselect): Use prefix-numeric-value. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-31 21:38:18 +0000 +++ lisp/ChangeLog 2012-07-31 22:34:36 +0000 @@ -1,10 +1,15 @@ +2012-07-31 Andreas Schwab + + * buff-menu.el (list-buffers-noselect): Use prefix-numeric-value. + (Bug#12108) + 2012-07-31 Jay Belanger * calc-mode.el (calc-basic-simplification-mode): Rename from `calc-limited-simplification-mode'. (calc-alg-simplification-mode): New function. (calc-set-simplify-mode): Adjust message. - + * calc.el (calc-set-mode-line): Adjust mode line display for basic simplification mode. @@ -3862,7 +3867,7 @@ * cus-edit.el (custom-variable-documentation): Simplify with format. 2012-05-01 Aaron S. Hawley - Stefan Monnier + Stefan Monnier * simple.el (suggest-key-bindings, execute-extended-command): Move from keyboard.c. @@ -6190,7 +6195,7 @@ (save-place-to-alist): Use it. 2012-02-17 Lawrence Mitchell - Stefan Monnier + Stefan Monnier * newcomment.el (uncomment-region-default): Don't leave extra space when an arg is provided (bug#8150). @@ -14645,7 +14650,7 @@ * textmodes/reftex-dcr.el (reftex-view-crossref): at at -> at a 2011-05-10 Glenn Morris - Stefan Monnier + Stefan Monnier * files.el (hack-one-local-variable-eval-safep): Consider "eval: (foo-mode)" to be safe. (Bug#8613) === modified file 'lisp/buff-menu.el' --- lisp/buff-menu.el 2012-07-13 07:06:09 +0000 +++ lisp/buff-menu.el 2012-07-31 22:34:36 +0000 @@ -564,7 +564,8 @@ (buffer (get-buffer-create "*Buffer List*"))) (with-current-buffer buffer (Buffer-menu-mode) - (setq Buffer-menu-files-only (and files-only (>= files-only 0))) + (setq Buffer-menu-files-only + (and files-only (>= (prefix-numeric-value files-only) 0))) (list-buffers--refresh buffer-list old-buffer) (tabulated-list-print)) buffer)) ------------------------------------------------------------ revno: 109341 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-07-31 18:24:49 -0400 message: * configure.ac (NULL_DEVICE, SEPCHAR, USER_FULL_NAME): Move here from src. * src/editfns.c (USER_FULL_NAME): * src/emacs.c (SEPCHAR): * src/process.h (NULL_DEVICE): Let configure set them. diff: === modified file 'ChangeLog' --- ChangeLog 2012-07-31 17:50:52 +0000 +++ ChangeLog 2012-07-31 22:24:49 +0000 @@ -1,5 +1,8 @@ 2012-07-31 Glenn Morris + * configure.ac (NULL_DEVICE, SEPCHAR, USER_FULL_NAME): + Move here from src. + * configure.ac (AMPERSAND_FULL_NAME, subprocesses): Move here from conf_post.h. === modified file 'configure.ac' --- configure.ac 2012-07-31 18:39:38 +0000 +++ configure.ac 2012-07-31 22:24:49 +0000 @@ -3147,9 +3147,16 @@ AC_DEFINE(HAVE_SOCKETS, 1, [Define if the system supports 4.2-compatible sockets.]) +AC_DEFINE(NULL_DEVICE, ["/dev/null"], [Name of the file to open to get + a null file, or a data sink.]) + +AC_DEFINE(SEPCHAR, [':'], [Character that separates PATH elements.]) + dnl Everybody supports this, except MS-DOS. AC_DEFINE(subprocesses, 1, [Define to enable asynchronous subprocesses.]) +AC_DEFINE(USER_FULL_NAME, [pw->pw_gecos], [How to get a user's full name.]) + AH_TEMPLATE(NO_EDITRES, [Define if XEditRes should not be used.]) === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-31 18:51:24 +0000 +++ src/ChangeLog 2012-07-31 22:24:49 +0000 @@ -1,5 +1,9 @@ 2012-07-31 Glenn Morris + * process.h (NULL_DEVICE): + * emacs.c (SEPCHAR): + * editfns.c (USER_FULL_NAME): Let configure set them. + * s/README, s/template.h: Remove files. * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT. === modified file 'src/editfns.c' --- src/editfns.c 2012-07-27 07:51:52 +0000 +++ src/editfns.c 2012-07-31 22:24:49 +0000 @@ -59,10 +59,6 @@ #include "window.h" #include "blockinput.h" -#ifndef USER_FULL_NAME -#define USER_FULL_NAME pw->pw_gecos -#endif - #ifndef USE_CRT_DLL extern char **environ; #endif === modified file 'src/emacs.c' --- src/emacs.c 2012-07-26 19:58:48 +0000 +++ src/emacs.c 2012-07-31 22:24:49 +0000 @@ -2222,9 +2222,6 @@ } #endif /* HAVE_SETLOCALE */ -#ifndef SEPCHAR -#define SEPCHAR ':' -#endif Lisp_Object decode_env_path (const char *evarname, const char *defalt) === modified file 'src/process.h' --- src/process.h 2012-06-22 21:17:42 +0000 +++ src/process.h 2012-07-31 22:24:49 +0000 @@ -163,12 +163,6 @@ this is exit code of synchronous subprocess. */ extern int synch_process_retcode; -/* The name of the file open to get a null file, or a data sink. - MS-DOS, and OS/2 redefine this. */ -#ifndef NULL_DEVICE -#define NULL_DEVICE "/dev/null" -#endif - /* Nonzero means don't run process sentinels. This is used when exiting. */ extern int inhibit_sentinels; ------------------------------------------------------------ revno: 109340 committer: Jay Belanger branch nick: trunk timestamp: Tue 2012-07-31 16:38:18 -0500 message: calc-mode.el (calc-set-simplify-mode): Adjust message. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-31 21:32:28 +0000 +++ lisp/ChangeLog 2012-07-31 21:38:18 +0000 @@ -3,7 +3,8 @@ * calc-mode.el (calc-basic-simplification-mode): Rename from `calc-limited-simplification-mode'. (calc-alg-simplification-mode): New function. - + (calc-set-simplify-mode): Adjust message. + * calc.el (calc-set-mode-line): Adjust mode line display for basic simplification mode. === modified file 'lisp/calc/calc-mode.el' --- lisp/calc/calc-mode.el 2012-07-31 21:32:28 +0000 +++ lisp/calc/calc-mode.el 2012-07-31 21:38:18 +0000 @@ -504,7 +504,7 @@ mode))) (message "%s" (if (eq calc-simplify-mode mode) msg - "Default algebraic simplifications enabled"))) + "Algebraic simplification occurs by default"))) (defun calc-no-simplify-mode (arg) (interactive "P") ------------------------------------------------------------ revno: 109339 committer: Jay Belanger branch nick: trunk timestamp: Tue 2012-07-31 16:32:28 -0500 message: calc-mode.el (calc-basic-simplification-mode): Rename from `calc-limited-simplification-mode'. (calc-alg-simplification-mode): New function. calc.el (calc-set-mode-line): Adjust mode line display for basic simplification mode. calc-help.el (calc-m-prefix-help): Update help message. calc-ext.el (calc-init-extensions): Add bindings and autoloads for `calc-basic-simplify-mode' and `calc-alg-simplify-mode'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-31 13:34:20 +0000 +++ lisp/ChangeLog 2012-07-31 21:32:28 +0000 @@ -1,3 +1,17 @@ +2012-07-31 Jay Belanger + + * calc-mode.el (calc-basic-simplification-mode): Rename from + `calc-limited-simplification-mode'. + (calc-alg-simplification-mode): New function. + + * calc.el (calc-set-mode-line): Adjust mode line display for + basic simplification mode. + + * calc-help.el (calc-m-prefix-help): Update help message. + + * calc-ext.el (calc-init-extensions): Add bindings and autoloads + for `calc-basic-simplify-mode' and `calc-alg-simplify-mode'. + 2012-07-31 Bastien Guerry * man.el (man): Fix comment. (bug#12101) === modified file 'lisp/calc/README' --- lisp/calc/README 2012-07-29 23:19:09 +0000 +++ lisp/calc/README 2012-07-31 21:32:28 +0000 @@ -74,7 +74,7 @@ Algebraic simplification mode is now the default. To restrict to the limited simplifications given by the former -default simplification mode, use `m L'. +default simplification mode, use `m I'. Emacs 24.1 === modified file 'lisp/calc/calc-ext.el' --- lisp/calc/calc-ext.el 2012-07-30 02:32:57 +0000 +++ lisp/calc/calc-ext.el 2012-07-31 21:32:28 +0000 @@ -454,12 +454,13 @@ (define-key calc-mode-map "mv" 'calc-matrix-mode) (define-key calc-mode-map "mw" 'calc-working) (define-key calc-mode-map "mx" 'calc-always-load-extensions) + (define-key calc-mode-map "mA" 'calc-alg-simplify-mode) (define-key calc-mode-map "mB" 'calc-bin-simplify-mode) (define-key calc-mode-map "mC" 'calc-auto-recompute) (define-key calc-mode-map "mD" 'calc-default-simplify-mode) (define-key calc-mode-map "mE" 'calc-ext-simplify-mode) (define-key calc-mode-map "mF" 'calc-settings-file-name) - (define-key calc-mode-map "mL" 'calc-limited-simplify-mode) + (define-key calc-mode-map "mI" 'calc-basic-simplify-mode) (define-key calc-mode-map "mM" 'calc-more-recursion-depth) (define-key calc-mode-map "mN" 'calc-num-simplify-mode) (define-key calc-mode-map "mO" 'calc-no-simplify-mode) @@ -1093,13 +1094,13 @@ calc-sin calc-sincos calc-sinh calc-sqrt calc-tan calc-tanh calc-to-degrees calc-to-radians) - ("calc-mode" calc-limited-simplify-mode calc-algebraic-mode + ("calc-mode" calc-alg-simplify-mode calc-algebraic-mode calc-always-load-extensions calc-auto-recompute calc-auto-why -calc-bin-simplify-mode calc-break-vectors calc-center-justify -calc-default-simplify-mode calc-display-raw calc-eng-notation -calc-ext-simplify-mode calc-fix-notation calc-full-trail-vectors -calc-full-vectors calc-get-modes calc-group-char calc-group-digits -calc-infinite-mode calc-left-justify calc-left-label +calc-basic-simplify-mode calc-bin-simplify-mode calc-break-vectors +calc-center-justify calc-default-simplify-mode calc-display-raw +calc-eng-notation calc-ext-simplify-mode calc-fix-notation +calc-full-trail-vectors calc-full-vectors calc-get-modes calc-group-char +calc-group-digits calc-infinite-mode calc-left-justify calc-left-label calc-line-breaking calc-line-numbering calc-matrix-brackets calc-matrix-center-justify calc-matrix-left-justify calc-matrix-mode calc-matrix-right-justify calc-mode-record-mode calc-no-simplify-mode === modified file 'lisp/calc/calc-help.el' --- lisp/calc/calc-help.el 2012-07-29 23:25:39 +0000 +++ lisp/calc/calc-help.el 2012-07-31 21:32:28 +0000 @@ -642,7 +642,7 @@ '("Deg, Rad, HMS; Frac; Polar; Inf; Alg, Total; Symb; Vec/mat" "Working; Xtensions; Mode-save; preserve Embedded modes" "SHIFT + Shifted-prefixes, mode-Filename; Record; reCompute" - "SHIFT + simplify: Off, Num, Limited, Default, Bin, Ext, Units") + "SHIFT + simplify: Off, Num, basIc, Algebraic, Bin, Ext, Units") "mode" ?m)) === modified file 'lisp/calc/calc-mode.el' --- lisp/calc/calc-mode.el 2012-07-30 02:32:57 +0000 +++ lisp/calc/calc-mode.el 2012-07-31 21:32:28 +0000 @@ -510,24 +510,24 @@ (interactive "P") (calc-wrapper (calc-set-simplify-mode 'none arg - "All default simplifications are disabled"))) + "Simplification is disabled"))) (defun calc-num-simplify-mode (arg) (interactive "P") (calc-wrapper (calc-set-simplify-mode 'num arg - "Default simplifications apply only if arguments are numeric"))) + "Basic simplifications apply only if arguments are numeric"))) (defun calc-default-simplify-mode (arg) (interactive "P") (cond ((or (not arg) (= arg 3)) (calc-wrapper (calc-set-simplify-mode - 'alg nil "Default algebraic simplifications enabled"))) + 'alg nil "Algebraic simplification occurs by default"))) ((= arg 1) (calc-wrapper (calc-set-simplify-mode - nil nil "Limited simplifications occur by default"))) + nil nil "Only basic simplifications occur by default"))) ((= arg 0) (calc-num-simplify-mode 1)) ((< arg 0) (calc-no-simplify-mode 1)) ((= arg 2) (calc-bin-simplify-mode 1)) @@ -542,11 +542,17 @@ (format "Binary simplification occurs by default (word size=%d)" calc-word-size)))) -(defun calc-limited-simplify-mode (arg) +(defun calc-basic-simplify-mode (arg) (interactive "P") (calc-wrapper (calc-set-simplify-mode nil arg - "Limited simplifications occur by default"))) + "Only basic simplifications occur by default"))) + +(defun calc-alg-simplify-mode (arg) + (interactive "P") + (calc-wrapper + (calc-set-simplify-mode 'alg arg + "Algebraic simplification occurs by default"))) (defun calc-ext-simplify-mode (arg) (interactive "P") === modified file 'lisp/calc/calc.el' --- lisp/calc/calc.el 2012-07-29 23:19:09 +0000 +++ lisp/calc/calc.el 2012-07-31 21:32:28 +0000 @@ -1760,7 +1760,7 @@ ((eq calc-simplify-mode 'alg) "") ((eq calc-simplify-mode 'ext) "ExtSimp ") ((eq calc-simplify-mode 'units) "UnitSimp ") - (t "LimSimp ")) + (t "BasicSimp ")) ;; Display modes (cond ((= calc-number-radix 10) "") ------------------------------------------------------------ revno: 109338 committer: Jan D. branch nick: trunk timestamp: Tue 2012-07-31 21:23:33 +0200 message: * TODO (NS port): Add text about event loop. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2012-07-29 07:16:45 +0000 +++ etc/ChangeLog 2012-07-31 19:23:33 +0000 @@ -1,3 +1,7 @@ +2012-07-31 Jan Djärv + + * TODO (NS port): Add text about event loop. + 2012-07-29 Paul Eggert deactive->inactive, inactivate->deactivate spelling fixes (Bug#10150) === modified file 'etc/TODO' --- etc/TODO 2012-06-28 07:05:15 +0000 +++ etc/TODO 2012-07-31 19:23:33 +0000 @@ -614,6 +614,15 @@ *** Bugs +**** The event loop relies on polling and that hurts performance. + A better strategy is to have the select part in its own thread and let + the main thread communicate with that thread (see how Gdk does it for + inspiration). A problem is that redraw don't happen during resize, + because we can't break out from the NSapp loop during resize. + There is a special trick to detect mouse press in the lower right + corner and track mouse movements, but this does not work well, and is + not scalable to the new Lion "resize on every window edge" behavior. + **** (mouse-avoidance-mode 'banish) then minimize Emacs, will pop window back up on top of all others ------------------------------------------------------------ revno: 109337 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-07-31 14:51:24 -0400 message: * src/s/README, src/s/template.h: Remove files. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-31 18:34:26 +0000 +++ src/ChangeLog 2012-07-31 18:51:24 +0000 @@ -1,5 +1,7 @@ 2012-07-31 Glenn Morris + * s/README, s/template.h: Remove files. + * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT. * conf_post.h (AMPERSAND_FULL_NAME, subprocesses): === removed file 'src/s/README' --- src/s/README 1999-10-01 12:43:57 +0000 +++ src/s/README 1970-01-01 00:00:00 +0000 @@ -1,8 +0,0 @@ -This directory contains C header files containing -operating-system-specific definitions. Each file describes a -particular operating system. The emacs configuration script edits -../config.h to include the appropriate one of these files, and then -each emacs source file includes config.h. - -template.h is a generic template for system descriptions; it describes -the parameters a system file can specify. === removed file 'src/s/template.h' --- src/s/template.h 2012-07-13 02:34:05 +0000 +++ src/s/template.h 1970-01-01 00:00:00 +0000 @@ -1,53 +0,0 @@ -/* Template for system description header files. - This file describes the parameters that system description files - should define or not. - -Copyright (C) 1985-1986, 1992, 1999, 2001-2012 Free Software Foundation, Inc. - -This file is part of GNU Emacs. - -GNU Emacs is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -GNU Emacs is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Emacs. If not, see . */ - -/* subprocesses should be undefined if you do NOT want to - have code for asynchronous subprocesses - (as used in M-x compile and M-x shell). - Currently only MSDOS does not support this. */ - -/* #undef subprocesses */ - -/* If the character used to separate elements of the executable path - is not ':', #define this to be the appropriate character constant. */ -/* #define SEPCHAR ':' */ - -/* ============================================================ */ - -/* Here, add any special hacks needed to make Emacs work on this - system. For example, you might define certain system call names - that don't exist on your system, or that do different things on - your system and must be used only through an encapsulation (which - you should place, by convention, in sysdep.c). */ - -/* ============================================================ */ - -/* After adding support for a new system, modify the large case - statement in configure.ac to recognize reasonable - configuration names, and add a description of the system to - `etc/MACHINES'. - - Check for any tests of $opsys in configure.ac, and add an entry - for the new system if needed. - - If you've just fixed a problem in an existing configuration file, - you should also check `etc/MACHINES' to make sure its descriptions - of known problems in that configuration should be updated. */ ------------------------------------------------------------ revno: 109336 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-07-31 14:39:38 -0400 message: Comment diff: === modified file 'configure.ac' --- configure.ac 2012-07-31 18:34:26 +0000 +++ configure.ac 2012-07-31 18:39:38 +0000 @@ -2730,7 +2730,7 @@ ## version number A.09.05. ## You can fix the math library by installing patch number PHSS_4630. ## But we can fix it more reliably for Emacs by just not using rint. -## We also skip HAVE_RANDOM - see comments in src/s/hpux10-20.h. +## We also skip HAVE_RANDOM - see comments in src/conf_post.h. case $opsys in hpux*) : ;; *) AC_CHECK_FUNCS(random rint) ;; ------------------------------------------------------------ revno: 109335 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-07-31 14:34:26 -0400 message: * src/conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT. This is a belt-and-braces approach. * configure.ac: Related comment. diff: === modified file 'configure.ac' --- configure.ac 2012-07-31 17:50:52 +0000 +++ configure.ac 2012-07-31 18:34:26 +0000 @@ -2725,7 +2725,6 @@ AC_CHECK_FUNCS(getwd) fi -dnl FIXME Fragile: see above. ## Eric Backus says, HP-UX 9.x on HP 700 machines ## has a broken `rint' in some library versions including math library ## version number A.09.05. === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-31 17:50:52 +0000 +++ src/ChangeLog 2012-07-31 18:34:26 +0000 @@ -1,5 +1,7 @@ 2012-07-31 Glenn Morris + * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT. + * conf_post.h (AMPERSAND_FULL_NAME, subprocesses): Move to configure.ac. === modified file 'src/conf_post.h' --- src/conf_post.h 2012-07-31 17:50:52 +0000 +++ src/conf_post.h 2012-07-31 18:34:26 +0000 @@ -71,11 +71,16 @@ renaming the functions via macros. The system's stdlib.h has fully prototyped declarations, which yields a conflicting definition of srand48; it tries to redeclare what was once srandom to be srand48. - So we go with HAVE_LRAND48 being defined. Note we also undef - HAVE_RANDOM via configure. */ + So we go with HAVE_LRAND48 being defined. */ #ifdef HPUX #undef srandom #undef random +/* We try to avoid checking for random and rint on hpux in + configure.ac, but some other configure test might check for them as + a dependency, so to be safe we also undefine them here. + */ +#undef HAVE_RANDOM +#undef HAVE_RINT #endif #ifdef IRIX6_5 ------------------------------------------------------------ revno: 109334 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-07-31 13:50:52 -0400 message: Move AMPERSAND_FULL_NAME, subprocesses from conf_post.h to configure.ac * configure.ac (AMPERSAND_FULL_NAME, subprocesses): Move here from conf_post.h. * src/conf_post.h (AMPERSAND_FULL_NAME, subprocesses): Move to configure.ac. diff: === modified file 'ChangeLog' --- ChangeLog 2012-07-31 11:37:38 +0000 +++ ChangeLog 2012-07-31 17:50:52 +0000 @@ -1,3 +1,8 @@ +2012-07-31 Glenn Morris + + * configure.ac (AMPERSAND_FULL_NAME, subprocesses): + Move here from conf_post.h. + 2012-07-31 Dmitry Antipov Improve OpenMotif detection on GNU/Linux systems. === modified file 'configure.ac' --- configure.ac 2012-07-31 11:37:38 +0000 +++ configure.ac 2012-07-31 17:50:52 +0000 @@ -3125,6 +3125,10 @@ dnl AC_DEFINE(HAVE_TCATTR, 1, [Define to 1 if you have tcgetattr and tcsetattr.]) dnl fi +dnl Turned on June 1996 supposing nobody will mind it. +AC_DEFINE(AMPERSAND_FULL_NAME, 1, [Define to use the convention that & + in the full name stands for the login id.]) + dnl Every platform that uses configure (ie every non-MS platform) dnl supports this. There is a create-lockfiles option you can dnl customize if you do not want the lock files to be written. @@ -3144,6 +3148,9 @@ AC_DEFINE(HAVE_SOCKETS, 1, [Define if the system supports 4.2-compatible sockets.]) +dnl Everybody supports this, except MS-DOS. +AC_DEFINE(subprocesses, 1, [Define to enable asynchronous subprocesses.]) + AH_TEMPLATE(NO_EDITRES, [Define if XEditRes should not be used.]) === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-31 17:34:51 +0000 +++ src/ChangeLog 2012-07-31 17:50:52 +0000 @@ -1,3 +1,8 @@ +2012-07-31 Glenn Morris + + * conf_post.h (AMPERSAND_FULL_NAME, subprocesses): + Move to configure.ac. + 2012-07-31 Eli Zaretskii * .gdbinit (xframe): Adapt to introduction of FVAR and the === modified file 'src/conf_post.h' --- src/conf_post.h 2012-07-31 06:43:37 +0000 +++ src/conf_post.h 2012-07-31 17:50:52 +0000 @@ -102,19 +102,6 @@ #endif #endif /* USG5_4 */ -/* Define AMPERSAND_FULL_NAME if you use the convention - that & in the full name stands for the login id. */ -/* Turned on June 1996 supposing nobody will mind it. */ -#define AMPERSAND_FULL_NAME - -/* `subprocesses' should be defined if you want to - have code for asynchronous subprocesses - (as used in M-x compile and M-x shell). - Only MSDOS does not support this (it overrides - this in its config_opsysfile below). */ - -#define subprocesses - /* Include the os dependent file. */ #ifdef config_opsysfile # include config_opsysfile ------------------------------------------------------------ revno: 109333 committer: Eli Zaretskii branch nick: trunk timestamp: Tue 2012-07-31 20:34:51 +0300 message: Fix 'xframe' in .gdbinit. src/.gdbinit (xframe): Adapt to introduction of FVAR and the resulting renaming of 'struct frame' members. diff: === modified file 'src/.gdbinit' --- src/.gdbinit 2012-07-27 20:50:02 +0000 +++ src/.gdbinit 2012-07-31 17:34:51 +0000 @@ -765,7 +765,7 @@ define xframe xgetptr $ print (struct frame *) $ptr - xgetptr $->name + xgetptr $->name_ set $ptr = (struct Lisp_String *) $ptr xprintstr $ptr echo \n === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-31 16:59:55 +0000 +++ src/ChangeLog 2012-07-31 17:34:51 +0000 @@ -1,5 +1,8 @@ 2012-07-31 Eli Zaretskii + * .gdbinit (xframe): Adapt to introduction of FVAR and the + resulting renaming of 'struct frame' members. + * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR. * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING ------------------------------------------------------------ revno: 109332 committer: Eli Zaretskii branch nick: trunk timestamp: Tue 2012-07-31 19:59:55 +0300 message: Fix some of the breakage introduced with revision 109327. src/w32menu.c (w32_menu_show): Revert bogus introduction of FVAR. src/fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING after introduction of FVAR. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-31 16:19:03 +0000 +++ src/ChangeLog 2012-07-31 16:59:55 +0000 @@ -1,3 +1,10 @@ +2012-07-31 Eli Zaretskii + + * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR. + + * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING + after introduction of FVAR. + 2012-07-31 Jan Djärv * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id. === modified file 'src/fontset.c' --- src/fontset.c 2012-07-11 07:19:44 +0000 +++ src/fontset.c 2012-07-31 16:59:55 +0000 @@ -2117,7 +2117,8 @@ if (FRAME_LIVE_P (f)) ASET (vec, 1, - Fcons (FONTSET_NAME (FONTSET_BASE (fontset)), f->name)); + Fcons (FONTSET_NAME (FONTSET_BASE (fontset)), + FVAR (f, name))); else ASET (vec, 1, Fcons (FONTSET_NAME (FONTSET_BASE (fontset)), Qnil)); === modified file 'src/w32menu.c' --- src/w32menu.c 2012-07-31 12:36:19 +0000 +++ src/w32menu.c 2012-07-31 16:59:55 +0000 @@ -854,7 +854,7 @@ wv_title->name = SSDATA (title); wv_title->enabled = TRUE; - FVAR (wv_title, title) = TRUE; + wv_title->title = TRUE; wv_title->button_type = BUTTON_TYPE_NONE; wv_title->help = Qnil; wv_title->next = wv_sep; ------------------------------------------------------------ revno: 109331 committer: Jan D. branch nick: trunk timestamp: Tue 2012-07-31 18:19:03 +0200 message: Fix compiler and run time warnings in nsmenu.m and nsterm.m * nsfns.m, nsmenu.m, msterm.m: Adopt to struct frame/FVAR changes. * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id. * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect instead of compositeToPoint. (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-31 15:15:29 +0000 +++ src/ChangeLog 2012-07-31 16:19:03 +0000 @@ -1,5 +1,11 @@ 2012-07-31 Jan Djärv + * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id. + + * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect + instead of compositeToPoint. + (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel. + * nsfns.m, nsmenu.m, msterm.m: Adopt to struct frame/FVAR changes. 2012-07-31 Dmitry Antipov === modified file 'src/nsmenu.m' --- src/nsmenu.m 2012-07-31 15:15:29 +0000 +++ src/nsmenu.m 2012-07-31 16:19:03 +0000 @@ -1102,7 +1102,7 @@ NSDictionary *dict = [toolbar configurationDictionary]; NSMutableDictionary *newDict = [dict mutableCopy]; NSEnumerator *keys = [[dict allKeys] objectEnumerator]; - NSObject *key; + id key; while ((key = [keys nextObject]) != nil) { NSObject *val = [dict objectForKey: key]; === modified file 'src/nsterm.m' --- src/nsterm.m 2012-07-31 15:15:29 +0000 +++ src/nsterm.m 2012-07-31 16:19:03 +0000 @@ -2267,7 +2267,6 @@ if (p->which) { NSRect r = NSMakeRect (p->x+xAdjust, p->y, p->wd, p->h); - NSPoint pt = r.origin; EmacsImage *img = bimgs[p->which - 1]; if (!img) @@ -2290,9 +2289,13 @@ to erase the whole background. */ [ns_lookup_indexed_color(face->background, f) set]; NSRectFill (r); - pt.y += p->h; [img setXBMColor: ns_lookup_indexed_color(face->foreground, f)]; - [img compositeToPoint: pt operation: NSCompositeSourceOver]; + [img drawInRect: r + fromRect: NSZeroRect + operation: NSCompositeSourceOver + fraction: 1.0 + respectFlipped: YES + hints: nil]; } ns_unfocus (f); } @@ -3035,8 +3038,12 @@ /* Draw the image.. do we need to draw placeholder if img ==nil? */ if (img != nil) - [img compositeToPoint: NSMakePoint (x, y + s->slice.height) - operation: NSCompositeSourceOver]; + [img drawInRect: br + fromRect: NSZeroRect + operation: NSCompositeSourceOver + fraction: 1.0 + respectFlipped: YES + hints: nil]; if (s->hl == DRAW_CURSOR) { @@ -4433,7 +4440,7 @@ return NSTerminateNow; ret = NSRunAlertPanel(ns_app_name, - [NSString stringWithUTF8String:"Exit requested. Would you like to Save Buffers and Exit, or Cancel the request?"], + @"Exit requested. Would you like to Save Buffers and Exit, or Cancel the request?", @"Save Buffers and Exit", @"Cancel", nil); if (ret == NSAlertDefaultReturn) ------------------------------------------------------------ revno: 109330 committer: Jan D. branch nick: trunk timestamp: Tue 2012-07-31 17:15:29 +0200 message: * nsfns.m, nsmenu.m, msterm.m: Adopt to struct frame/FVAR changes. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-31 12:36:19 +0000 +++ src/ChangeLog 2012-07-31 15:15:29 +0000 @@ -1,3 +1,7 @@ +2012-07-31 Jan Djärv + + * nsfns.m, nsmenu.m, msterm.m: Adopt to struct frame/FVAR changes. + 2012-07-31 Dmitry Antipov Generalize INTERNAL_FIELD between buffers, keyboards and frames. === modified file 'src/nsfns.m' --- src/nsfns.m 2012-07-31 12:36:19 +0000 +++ src/nsfns.m 2012-07-31 15:15:29 +0000 @@ -448,16 +448,16 @@ else if (!STRINGP (oldval) && EQ (oldval, Qnil) == EQ (arg, Qnil)) return; - f->icon_name = arg; + FVAR (f, icon_name) = arg; if (NILP (arg)) { - if (!NILP (f->title)) - arg = f->title; + if (!NILP (FVAR (f, title))) + arg = FVAR (f, title); else /* explicit name and no icon-name -> explicit_name */ if (f->explicit_name) - arg = f->name; + arg = FVAR (f, name); else { /* no explicit name and no icon-name -> @@ -496,10 +496,10 @@ if (! [[[view window] title] isEqualToString: str]) [[view window] setTitle: str]; - if (!STRINGP (f->icon_name)) + if (!STRINGP (FVAR (f, icon_name))) encoded_icon_name = encoded_name; else - encoded_icon_name = ENCODE_UTF_8 (f->icon_name); + encoded_icon_name = ENCODE_UTF_8 (FVAR (f, icon_name)); str = [NSString stringWithUTF8String: SSDATA (encoded_icon_name)]; @@ -537,14 +537,14 @@ CHECK_STRING (name); /* Don't change the name if it's already NAME. */ - if (! NILP (Fstring_equal (name, f->name))) + if (! NILP (Fstring_equal (name, FVAR (f, name)))) return; - f->name = name; + FVAR (f, name) = name; /* title overrides explicit name */ - if (! NILP (f->title)) - name = f->title; + if (! NILP (FVAR (f, title))) + name = FVAR (f, title); ns_set_name_internal (f, name); } @@ -594,7 +594,7 @@ FVAR (f, title) = name; if (NILP (name)) - name = f->name; + name = FVAR (f, name); else CHECK_STRING (name); @@ -607,7 +607,7 @@ { NSView *view; Lisp_Object name, filename; - Lisp_Object buf = XWINDOW (f->selected_window)->buffer; + Lisp_Object buf = XWINDOW (FVAR (f, selected_window))->buffer; const char *title; NSAutoreleasePool *pool; struct gcpro gcpro1; @@ -615,7 +615,7 @@ NSString *str; NSTRACE (ns_set_name_as_filename); - if (f->explicit_name || ! NILP (f->title) || ns_in_resize) + if (f->explicit_name || ! NILP (FVAR (f, title)) || ns_in_resize) return; BLOCK_INPUT; @@ -677,7 +677,7 @@ [[view window] setRepresentedFilename: fstr]; [[view window] setTitle: str]; - f->name = name; + FVAR (f, name) = name; } [pool release]; @@ -690,7 +690,7 @@ { NSView *view = FRAME_NS_VIEW (f); NSAutoreleasePool *pool; - if (!MINI_WINDOW_P (XWINDOW (f->selected_window))) + if (!MINI_WINDOW_P (XWINDOW (FVAR (f, selected_window)))) { BLOCK_INPUT; pool = [[NSAutoreleasePool alloc] init]; @@ -777,7 +777,7 @@ BLOCK_INPUT; pool = [[NSAutoreleasePool alloc] init]; if (f->output_data.ns->miniimage - && [[NSString stringWithUTF8String: SSDATA (f->name)] + && [[NSString stringWithUTF8String: SSDATA (FVAR (f, name))] isEqualToString: [(NSImage *)f->output_data.ns->miniimage name]]) { [pool release]; @@ -785,7 +785,7 @@ return; } - tem = assq_no_quit (Qicon_type, f->param_alist); + tem = assq_no_quit (Qicon_type, FVAR (f, param_alist)); if (CONSP (tem) && ! NILP (XCDR (tem))) { [pool release]; @@ -799,17 +799,17 @@ { elt = XCAR (chain); /* special case: 't' means go by file type */ - if (SYMBOLP (elt) && EQ (elt, Qt) && SSDATA (f->name)[0] == '/') + if (SYMBOLP (elt) && EQ (elt, Qt) && SSDATA (FVAR (f, name))[0] == '/') { NSString *str - = [NSString stringWithUTF8String: SSDATA (f->name)]; + = [NSString stringWithUTF8String: SSDATA (FVAR (f, name))]; if ([[NSFileManager defaultManager] fileExistsAtPath: str]) image = [[[NSWorkspace sharedWorkspace] iconForFile: str] retain]; } else if (CONSP (elt) && STRINGP (XCAR (elt)) && STRINGP (XCDR (elt)) && - fast_string_match (XCAR (elt), f->name) >= 0) + fast_string_match (XCAR (elt), FVAR (f, name)) >= 0) { image = [EmacsImage allocInitFromFile: XCDR (elt)]; if (image == nil) @@ -1205,10 +1205,11 @@ FRAME_FONTSET (f) = -1; - f->icon_name = x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title", + FVAR (f, icon_name) = x_get_arg (dpyinfo, parms, Qicon_name, + "iconName", "Title", RES_TYPE_STRING); - if (! STRINGP (f->icon_name)) - f->icon_name = Qnil; + if (! STRINGP (FVAR (f, icon_name))) + FVAR (f, icon_name) = Qnil; FRAME_NS_DISPLAY_INFO (f) = dpyinfo; @@ -1231,12 +1232,12 @@ be set. */ if (EQ (name, Qunbound) || NILP (name) || ! STRINGP (name)) { - f->name = build_string ([ns_app_name UTF8String]); + FVAR (f, name) = build_string ([ns_app_name UTF8String]); f->explicit_name = 0; } else { - f->name = name; + FVAR (f, name) = name; f->explicit_name = 1; specbind (Qx_resource_name, name); } @@ -1397,7 +1398,7 @@ by x_get_arg and friends, now go in the misc. alist of the frame. */ for (tem = parms; CONSP (tem); tem = XCDR (tem)) if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem)))) - f->param_alist = Fcons (XCAR (tem), f->param_alist); + FVAR (f, param_alist) = Fcons (XCAR (tem), FVAR (f, param_alist)); UNGCPRO; === modified file 'src/nsmenu.m' --- src/nsmenu.m 2012-07-22 16:35:15 +0000 +++ src/nsmenu.m 2012-07-31 15:15:29 +0000 @@ -222,13 +222,13 @@ /* Save the frame's previous menu bar contents data */ if (previous_menu_items_used) - memcpy (previous_items, &AREF (f->menu_bar_vector, 0), + memcpy (previous_items, &AREF (FVAR (f, menu_bar_vector), 0), previous_menu_items_used * sizeof (Lisp_Object)); /* parse stage 1: extract from lisp */ save_menu_items (); - menu_items = f->menu_bar_vector; + menu_items = FVAR (f, menu_bar_vector); menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0; submenu_start = alloca (ASIZE (items) * sizeof *submenu_start); submenu_end = alloca (ASIZE (items) * sizeof *submenu_end); @@ -341,7 +341,7 @@ } /* The menu items are different, so store them in the frame */ /* FIXME: this is not correct for single-submenu case */ - f->menu_bar_vector = menu_items; + FVAR (f, menu_bar_vector) = menu_items; f->menu_bar_items_used = menu_items_used; /* Calls restore_menu_items, etc., as they were outside */ @@ -1041,7 +1041,7 @@ /* update EmacsToolbar as in GtkUtils, build items list */ for (i = 0; i < f->n_tool_bar_items; ++i) { -#define TOOLPROP(IDX) AREF (f->tool_bar_items, \ +#define TOOLPROP(IDX) AREF (FVAR (f, tool_bar_items), \ i * TOOL_BAR_ITEM_NSLOTS + (IDX)) BOOL enabled_p = !NILP (TOOLPROP (TOOL_BAR_ITEM_ENABLED_P)); === modified file 'src/nsterm.m' --- src/nsterm.m 2012-07-31 12:36:19 +0000 +++ src/nsterm.m 2012-07-31 15:15:29 +0000 @@ -1306,7 +1306,7 @@ FRAME_PIXEL_HEIGHT (f) = pixelheight; /* SET_FRAME_GARBAGED (f); // this short-circuits expose call in drawRect */ - mark_window_cursors_off (XWINDOW (f->root_window)); + mark_window_cursors_off (XWINDOW (FVAR (f, root_window))); cancel_mouse_face (f); UNBLOCK_INPUT; @@ -5535,7 +5535,7 @@ if (ns_drag_types) [self registerForDraggedTypes: ns_drag_types]; - tem = f->name; + tem = FVAR (f, name); name = [NSString stringWithUTF8String: NILP (tem) ? "Emacs" : SSDATA (tem)]; [win setTitle: name]; @@ -5553,7 +5553,7 @@ #endif FRAME_TOOLBAR_HEIGHT (f) = 0; - tem = f->icon_name; + tem = FVAR (f, icon_name); if (!NILP (tem)) [win setMiniwindowTitle: [NSString stringWithUTF8String: SSDATA (tem)]]; @@ -5734,7 +5734,7 @@ { NSInteger tag = [sender tag]; find_and_call_menu_selection (emacsframe, emacsframe->menu_bar_items_used, - emacsframe->menu_bar_vector, + FVAR (emacsframe, menu_bar_vector), (void *)tag); } @@ -5768,7 +5768,7 @@ emacs_event->kind = TOOL_BAR_EVENT; /* XSETINT (emacs_event->code, 0); */ - emacs_event->arg = AREF (emacsframe->tool_bar_items, + emacs_event->arg = AREF (FVAR (emacsframe, tool_bar_items), idx + TOOL_BAR_ITEM_KEY); emacs_event->modifiers = EV_MODIFIERS (theEvent); EV_TRAILER (theEvent); @@ -6056,7 +6056,8 @@ { Lisp_Object str = Qnil; struct frame *f = SELECTED_FRAME (); - struct buffer *curbuf = XBUFFER (XWINDOW (f->selected_window)->buffer); + struct buffer *curbuf + = XBUFFER (XWINDOW (FVAR (f, selected_window))->buffer); if ([attribute isEqualToString:NSAccessibilityRoleAttribute]) return NSAccessibilityTextFieldRole; ------------------------------------------------------------ revno: 109329 committer: Bastien Guerry branch nick: trunk timestamp: Tue 2012-07-31 15:34:20 +0200 message: Fix comment in man.el. See bug#12101. Thanks to Reuben Thomas for catching this. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-31 08:36:32 +0000 +++ lisp/ChangeLog 2012-07-31 13:34:20 +0000 @@ -1,3 +1,7 @@ +2012-07-31 Bastien Guerry + + * man.el (man): Fix comment. (bug#12101) + 2012-07-31 Martin Rudalics * window.el (switch-to-prev-buffer, switch-to-next-buffer): === modified file 'lisp/man.el' --- lisp/man.el 2012-07-11 23:13:41 +0000 +++ lisp/man.el 2012-07-31 13:34:20 +0000 @@ -868,7 +868,7 @@ (list (let* ((default-entry (Man-default-man-entry)) ;; ignore case because that's friendly for bizarre ;; caps things like the X11 function names and because - ;; "man" itself is case-sensitive on the command line + ;; "man" itself is case-insensitive on the command line ;; so you're accustomed not to bother about the case ;; ("man -k" is case-insensitive similarly, so the ;; table has everything available to complete) ------------------------------------------------------------ revno: 109328 committer: Bastien Guerry branch nick: trunk timestamp: Tue 2012-07-31 15:32:21 +0200 message: Remove outdate comment section in woman.el. See bug #12099. diff: === modified file 'lisp/woman.el' --- lisp/woman.el 2012-07-25 05:48:19 +0000 +++ lisp/woman.el 2012-07-31 13:32:21 +0000 @@ -115,25 +115,6 @@ ;; package will over-write the WoMan binding to "w", whereas (by ;; default) WoMan will not overwrite the `dired-x' binding.) -;; The following is based on suggestions by Guy Gascoigne-Piggford and -;; Juanma Barranquero. If you really want to square the man-woman -;; circle then you might care to define the following bash function in -;; .bashrc: - -;; man() { gnudoit -q '(raise-frame (selected-frame)) (woman' \"$1\" ')' ; } - -;; If you use Microsoft COMMAND.COM then you can create a file called -;; man.bat somewhere in your path containing the two lines: - -;; @echo off -;; gnudoit -q (raise-frame (selected-frame)) (woman \"%1\") - -;; and then (e.g. from a command prompt or the Run... option in the -;; Start menu) just execute - -;; man man_page_name - - ;; Using the word at point as the default topic ;; ============================================ ------------------------------------------------------------ revno: 109327 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2012-07-31 16:36:19 +0400 message: Generalize INTERNAL_FIELD between buffers, keyboards and frames. * src/lisp.h (INTERNAL_FIELD): New macro. * src/buffer.h (BUFFER_INTERNAL_FIELD): Removed. (BVAR): Change to use INTERNAL_FIELD. * src/keyboard.h (KBOARD_INTERNAL_FIELD): Likewise. (KVAR): Change to use INTERNAL_FIELD. * src/frame.h (FVAR): New macro. (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields. * src/alloc.c, src/buffer.c, src/data.c, src/dispnew.c, src/dosfns.c * src/eval.c, src/frame.c, src/fringe.c, src/gtkutil.c, src/minibuf.c * src/nsfns.m, src/nsterm.m, src/print.c, src/term.c, src/w32fns.c * src/w32menu.c, src/w32term.c, src/window.c, src/window.h, src/xdisp.c * src/xfaces.c, src/xfns.c, src/xmenu.c, src/xterm.c: Users changed. * admin/coccinelle/frame.cocci: Semantic patch to replace direct access to Lisp_Object members of struct frame to FVAR. diff: === modified file 'admin/ChangeLog' --- admin/ChangeLog 2012-07-28 23:05:32 +0000 +++ admin/ChangeLog 2012-07-31 12:36:19 +0000 @@ -1,3 +1,8 @@ +2012-07-31 Dmitry Antipov + + * coccinelle/frame.cocci: Semantic patch to replace direct + access to Lisp_Object members of struct frame to FVAR. + 2012-07-28 Paul Eggert Use Gnulib environ and stdalign modules (Bug#9772, Bug#9960). === added file 'admin/coccinelle/frame.cocci' --- admin/coccinelle/frame.cocci 1970-01-01 00:00:00 +0000 +++ admin/coccinelle/frame.cocci 2012-07-31 12:36:19 +0000 @@ -0,0 +1,133 @@ +// Change direct access to Lisp_Object fields of struct frame to FVAR. +@@ +expression F; +@@ +( +- F->icon_name ++ FVAR (F, icon_name) +| +- F->title ++ FVAR (F, title) +| +- F->focus_frame ++ FVAR (F, focus_frame) +| +- F->root_window ++ FVAR (F, root_window) +| +- F->selected_window ++ FVAR (F, selected_window) +| +- F->minibuffer_window ++ FVAR (F, minibuffer_window) +| +- F->param_alist ++ FVAR (F, param_alist) +| +- F->scroll_bars ++ FVAR (F, scroll_bars) +| +- F->condemned_scroll_bars ++ FVAR (F, condemned_scroll_bars) +| +- F->menu_bar_items ++ FVAR (F, menu_bar_items) +| +- F->face_alist ++ FVAR (F, face_alist) +| +- F->menu_bar_vector ++ FVAR (F, menu_bar_vector) +| +- F->buffer_predicate ++ FVAR (F, buffer_predicate) +| +- F->buffer_list ++ FVAR (F, buffer_list) +| +- F->buried_buffer_list ++ FVAR (F, buried_buffer_list) +| +- F->menu_bar_window ++ FVAR (F, menu_bar_window) +| +- F->tool_bar_window ++ FVAR (F, tool_bar_window) +| +- F->tool_bar_items ++ FVAR (F, tool_bar_items) +| +- F->tool_bar_position ++ FVAR (F, tool_bar_position) +| +- F->desired_tool_bar_string ++ FVAR (F, desired_tool_bar_string) +| +- F->current_tool_bar_string ++ FVAR (F, current_tool_bar_string) + +| + +- XFRAME (F)->icon_name ++ FVAR (XFRAME (F), icon_name) +| +- XFRAME (F)->title ++ FVAR (XFRAME (F), title) +| +- XFRAME (F)->focus_frame ++ FVAR (XFRAME (F), focus_frame) +| +- XFRAME (F)->root_window ++ FVAR (XFRAME (F), root_window) +| +- XFRAME (F)->selected_window ++ FVAR (XFRAME (F), selected_window) +| +- XFRAME (F)->minibuffer_window ++ FVAR (XFRAME (F), minibuffer_window) +| +- XFRAME (F)->param_alist ++ FVAR (XFRAME (F), param_alist) +| +- XFRAME (F)->scroll_bars ++ FVAR (XFRAME (F), scroll_bars) +| +- XFRAME (F)->condemned_scroll_bars ++ FVAR (XFRAME (F), condemned_scroll_bars) +| +- XFRAME (F)->menu_bar_items ++ FVAR (XFRAME (F), menu_bar_items) +| +- XFRAME (F)->face_alist ++ FVAR (XFRAME (F), face_alist) +| +- XFRAME (F)->menu_bar_vector ++ FVAR (XFRAME (F), menu_bar_vector) +| +- XFRAME (F)->buffer_predicate ++ FVAR (XFRAME (F), buffer_predicate) +| +- XFRAME (F)->buffer_list ++ FVAR (XFRAME (F), buffer_list) +| +- XFRAME (F)->buried_buffer_list ++ FVAR (XFRAME (F), buried_buffer_list) +| +- XFRAME (F)->menu_bar_window ++ FVAR (XFRAME (F), menu_bar_window) +| +- XFRAME (F)->tool_bar_window ++ FVAR (XFRAME (F), tool_bar_window) +| +- XFRAME (F)->tool_bar_items ++ FVAR (XFRAME (F), tool_bar_items) +| +- XFRAME (F)->tool_bar_position ++ FVAR (XFRAME (F), tool_bar_position) +| +- XFRAME (F)->desired_tool_bar_string ++ FVAR (XFRAME (F), desired_tool_bar_string) +| +- XFRAME (F)->current_tool_bar_string ++ FVAR (XFRAME (F), current_tool_bar_string) +) === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-31 11:37:38 +0000 +++ src/ChangeLog 2012-07-31 12:36:19 +0000 @@ -1,5 +1,20 @@ 2012-07-31 Dmitry Antipov + Generalize INTERNAL_FIELD between buffers, keyboards and frames. + * lisp.h (INTERNAL_FIELD): New macro. + * buffer.h (BUFFER_INTERNAL_FIELD): Removed. + (BVAR): Change to use INTERNAL_FIELD. + * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise. + (KVAR): Change to use INTERNAL_FIELD. + * frame.h (FVAR): New macro. + (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields. + * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c + * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c + * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h, + * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed. + +2012-07-31 Dmitry Antipov + Miscellaneous fixes for non-default X toolkits. * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings. * xterm.c (x_frame_of_widget): Remove redundant prototype. === modified file 'src/alloc.c' --- src/alloc.c 2012-07-30 18:56:42 +0000 +++ src/alloc.c 2012-07-31 12:36:19 +0000 @@ -4424,7 +4424,7 @@ must not have been killed. */ return (m->type == MEM_TYPE_BUFFER && p == m->start - && !NILP (((struct buffer *) p)->BUFFER_INTERNAL_FIELD (name))); + && !NILP (((struct buffer *) p)->INTERNAL_FIELD (name))); } #endif /* GC_MARK_STACK || defined GC_MALLOC_CHECK */ @@ -5549,10 +5549,10 @@ turned off in that buffer. Calling truncate_undo_list on Qt tends to return NULL, which effectively turns undo back on. So don't call truncate_undo_list if undo_list is Qt. */ - if (! EQ (nextb->BUFFER_INTERNAL_FIELD (undo_list), Qt)) + if (! EQ (nextb->INTERNAL_FIELD (undo_list), Qt)) { Lisp_Object tail, prev; - tail = nextb->BUFFER_INTERNAL_FIELD (undo_list); + tail = nextb->INTERNAL_FIELD (undo_list); prev = Qnil; while (CONSP (tail)) { @@ -5561,7 +5561,7 @@ && !XMARKER (XCAR (XCAR (tail)))->gcmarkbit) { if (NILP (prev)) - nextb->BUFFER_INTERNAL_FIELD (undo_list) = tail = XCDR (tail); + nextb->INTERNAL_FIELD (undo_list) = tail = XCDR (tail); else { tail = XCDR (tail); @@ -5577,7 +5577,7 @@ } /* Now that we have stripped the elements that need not be in the undo_list any more, we can finally mark the list. */ - mark_object (nextb->BUFFER_INTERNAL_FIELD (undo_list)); + mark_object (nextb->INTERNAL_FIELD (undo_list)); } gc_sweep (); === modified file 'src/buffer.c' --- src/buffer.c 2012-07-29 22:42:12 +0000 +++ src/buffer.c 2012-07-31 12:36:19 +0000 @@ -191,9 +191,9 @@ Lisp_Object args[3]; CHECK_FRAME (frame); - framelist = Fcopy_sequence (XFRAME (frame)->buffer_list); + framelist = Fcopy_sequence (FVAR (XFRAME (frame), buffer_list)); prevlist = Fnreverse (Fcopy_sequence - (XFRAME (frame)->buried_buffer_list)); + (FVAR (XFRAME (frame), buried_buffer_list))); /* Remove from GENERAL any buffer that duplicates one in FRAMELIST or PREVLIST. */ @@ -1324,7 +1324,7 @@ pred = frame_buffer_predicate (frame); /* Consider buffers that have been seen in the frame first. */ - tail = XFRAME (frame)->buffer_list; + tail = FVAR (XFRAME (frame), buffer_list); for (; CONSP (tail); tail = XCDR (tail)) { buf = XCAR (tail); @@ -1446,7 +1446,7 @@ /* Skip dead buffers, indirect buffers and buffers which aren't changed since last compaction. */ - if (!NILP (buffer->BUFFER_INTERNAL_FIELD (name)) + if (!NILP (buffer->INTERNAL_FIELD (name)) && (buffer->base_buffer == NULL) && (buffer->text->compact != buffer->text->modiff)) { @@ -1454,7 +1454,7 @@ turned off in that buffer. Calling truncate_undo_list on Qt tends to return NULL, which effectively turns undo back on. So don't call truncate_undo_list if undo_list is Qt. */ - if (!EQ (buffer->BUFFER_INTERNAL_FIELD (undo_list), Qt)) + if (!EQ (buffer->INTERNAL_FIELD (undo_list), Qt)) truncate_undo_list (buffer); /* Shrink buffer gaps. */ @@ -1764,8 +1764,8 @@ Vinhibit_quit = tem; /* Update buffer list of selected frame. */ - f->buffer_list = Fcons (buffer, Fdelq (buffer, f->buffer_list)); - f->buried_buffer_list = Fdelq (buffer, f->buried_buffer_list); + FVAR (f, buffer_list) = Fcons (buffer, Fdelq (buffer, FVAR (f, buffer_list))); + FVAR (f, buried_buffer_list) = Fdelq (buffer, FVAR (f, buried_buffer_list)); /* Run buffer-list-update-hook. */ if (!NILP (Vrun_hooks)) @@ -1802,8 +1802,9 @@ Vinhibit_quit = tem; /* Update buffer lists of selected frame. */ - f->buffer_list = Fdelq (buffer, f->buffer_list); - f->buried_buffer_list = Fcons (buffer, Fdelq (buffer, f->buried_buffer_list)); + FVAR (f, buffer_list) = Fdelq (buffer, FVAR (f, buffer_list)); + FVAR (f, buried_buffer_list) + = Fcons (buffer, Fdelq (buffer, FVAR (f, buried_buffer_list))); /* Run buffer-list-update-hook. */ if (!NILP (Vrun_hooks)) === modified file 'src/buffer.h' --- src/buffer.h 2012-07-22 03:44:35 +0000 +++ src/buffer.h 2012-07-31 12:36:19 +0000 @@ -472,14 +472,9 @@ int inhibit_shrinking; }; -/* Lisp fields in struct buffer are hidden from most code and accessed - via the BVAR macro, below. Only select pieces of code, like the GC, - are allowed to use BUFFER_INTERNAL_FIELD. */ -#define BUFFER_INTERNAL_FIELD(field) field ## _ +/* Most code should use this macro to access Lisp fields in struct buffer. */ -/* Most code should use this macro to access Lisp fields in struct - buffer. */ -#define BVAR(buf, field) ((buf)->BUFFER_INTERNAL_FIELD (field)) +#define BVAR(buf, field) ((buf)->INTERNAL_FIELD (field)) /* This is the structure that the buffer Lisp object points to. */ @@ -493,17 +488,17 @@ struct vectorlike_header header; /* The name of this buffer. */ - Lisp_Object BUFFER_INTERNAL_FIELD (name); + Lisp_Object INTERNAL_FIELD (name); /* The name of the file visited in this buffer, or nil. */ - Lisp_Object BUFFER_INTERNAL_FIELD (filename); + Lisp_Object INTERNAL_FIELD (filename); /* Directory for expanding relative file names. */ - Lisp_Object BUFFER_INTERNAL_FIELD (directory); + Lisp_Object INTERNAL_FIELD (directory); /* True if this buffer has been backed up (if you write to the visited file and it hasn't been backed up, then a backup will be made). */ - Lisp_Object BUFFER_INTERNAL_FIELD (backed_up); + Lisp_Object INTERNAL_FIELD (backed_up); /* Length of file when last read or saved. -1 means auto saving turned off because buffer shrank a lot. @@ -511,132 +506,132 @@ (That value is used with buffer-swap-text.) This is not in the struct buffer_text because it's not used in indirect buffers at all. */ - Lisp_Object BUFFER_INTERNAL_FIELD (save_length); + Lisp_Object INTERNAL_FIELD (save_length); /* File name used for auto-saving this buffer. This is not in the struct buffer_text because it's not used in indirect buffers at all. */ - Lisp_Object BUFFER_INTERNAL_FIELD (auto_save_file_name); + Lisp_Object INTERNAL_FIELD (auto_save_file_name); /* Non-nil if buffer read-only. */ - Lisp_Object BUFFER_INTERNAL_FIELD (read_only); + Lisp_Object INTERNAL_FIELD (read_only); /* "The mark". This is a marker which may point into this buffer or may point nowhere. */ - Lisp_Object BUFFER_INTERNAL_FIELD (mark); + Lisp_Object INTERNAL_FIELD (mark); /* Alist of elements (SYMBOL . VALUE-IN-THIS-BUFFER) for all per-buffer variables of this buffer. For locally unbound symbols, just the symbol appears as the element. */ - Lisp_Object BUFFER_INTERNAL_FIELD (local_var_alist); + Lisp_Object INTERNAL_FIELD (local_var_alist); /* Symbol naming major mode (e.g., lisp-mode). */ - Lisp_Object BUFFER_INTERNAL_FIELD (major_mode); + Lisp_Object INTERNAL_FIELD (major_mode); /* Pretty name of major mode (e.g., "Lisp"). */ - Lisp_Object BUFFER_INTERNAL_FIELD (mode_name); + Lisp_Object INTERNAL_FIELD (mode_name); /* Mode line element that controls format of mode line. */ - Lisp_Object BUFFER_INTERNAL_FIELD (mode_line_format); + Lisp_Object INTERNAL_FIELD (mode_line_format); /* Analogous to mode_line_format for the line displayed at the top of windows. Nil means don't display that line. */ - Lisp_Object BUFFER_INTERNAL_FIELD (header_line_format); + Lisp_Object INTERNAL_FIELD (header_line_format); /* Keys that are bound local to this buffer. */ - Lisp_Object BUFFER_INTERNAL_FIELD (keymap); + Lisp_Object INTERNAL_FIELD (keymap); /* This buffer's local abbrev table. */ - Lisp_Object BUFFER_INTERNAL_FIELD (abbrev_table); + Lisp_Object INTERNAL_FIELD (abbrev_table); /* This buffer's syntax table. */ - Lisp_Object BUFFER_INTERNAL_FIELD (syntax_table); + Lisp_Object INTERNAL_FIELD (syntax_table); /* This buffer's category table. */ - Lisp_Object BUFFER_INTERNAL_FIELD (category_table); + Lisp_Object INTERNAL_FIELD (category_table); /* Values of several buffer-local variables. */ /* tab-width is buffer-local so that redisplay can find it in buffers that are not current. */ - Lisp_Object BUFFER_INTERNAL_FIELD (case_fold_search); - Lisp_Object BUFFER_INTERNAL_FIELD (tab_width); - Lisp_Object BUFFER_INTERNAL_FIELD (fill_column); - Lisp_Object BUFFER_INTERNAL_FIELD (left_margin); + Lisp_Object INTERNAL_FIELD (case_fold_search); + Lisp_Object INTERNAL_FIELD (tab_width); + Lisp_Object INTERNAL_FIELD (fill_column); + Lisp_Object INTERNAL_FIELD (left_margin); /* Function to call when insert space past fill column. */ - Lisp_Object BUFFER_INTERNAL_FIELD (auto_fill_function); + Lisp_Object INTERNAL_FIELD (auto_fill_function); /* Case table for case-conversion in this buffer. This char-table maps each char into its lower-case version. */ - Lisp_Object BUFFER_INTERNAL_FIELD (downcase_table); + Lisp_Object INTERNAL_FIELD (downcase_table); /* Char-table mapping each char to its upper-case version. */ - Lisp_Object BUFFER_INTERNAL_FIELD (upcase_table); + Lisp_Object INTERNAL_FIELD (upcase_table); /* Char-table for conversion for case-folding search. */ - Lisp_Object BUFFER_INTERNAL_FIELD (case_canon_table); + Lisp_Object INTERNAL_FIELD (case_canon_table); /* Char-table of equivalences for case-folding search. */ - Lisp_Object BUFFER_INTERNAL_FIELD (case_eqv_table); + Lisp_Object INTERNAL_FIELD (case_eqv_table); /* Non-nil means do not display continuation lines. */ - Lisp_Object BUFFER_INTERNAL_FIELD (truncate_lines); + Lisp_Object INTERNAL_FIELD (truncate_lines); /* Non-nil means to use word wrapping when displaying continuation lines. */ - Lisp_Object BUFFER_INTERNAL_FIELD (word_wrap); + Lisp_Object INTERNAL_FIELD (word_wrap); /* Non-nil means display ctl chars with uparrow. */ - Lisp_Object BUFFER_INTERNAL_FIELD (ctl_arrow); + Lisp_Object INTERNAL_FIELD (ctl_arrow); /* Non-nil means reorder bidirectional text for display in the visual order. */ - Lisp_Object BUFFER_INTERNAL_FIELD (bidi_display_reordering); + Lisp_Object INTERNAL_FIELD (bidi_display_reordering); /* If non-nil, specifies which direction of text to force in all the paragraphs of the buffer. Nil means determine paragraph direction dynamically for each paragraph. */ - Lisp_Object BUFFER_INTERNAL_FIELD (bidi_paragraph_direction); + Lisp_Object INTERNAL_FIELD (bidi_paragraph_direction); /* Non-nil means do selective display; see doc string in syms_of_buffer (buffer.c) for details. */ - Lisp_Object BUFFER_INTERNAL_FIELD (selective_display); + Lisp_Object INTERNAL_FIELD (selective_display); /* Non-nil means show ... at end of line followed by invisible lines. */ - Lisp_Object BUFFER_INTERNAL_FIELD (selective_display_ellipses); + Lisp_Object INTERNAL_FIELD (selective_display_ellipses); /* Alist of (FUNCTION . STRING) for each minor mode enabled in buffer. */ - Lisp_Object BUFFER_INTERNAL_FIELD (minor_modes); + Lisp_Object INTERNAL_FIELD (minor_modes); /* t if "self-insertion" should overwrite; `binary' if it should also overwrite newlines and tabs - for editing executables and the like. */ - Lisp_Object BUFFER_INTERNAL_FIELD (overwrite_mode); + Lisp_Object INTERNAL_FIELD (overwrite_mode); /* Non-nil means abbrev mode is on. Expand abbrevs automatically. */ - Lisp_Object BUFFER_INTERNAL_FIELD (abbrev_mode); + Lisp_Object INTERNAL_FIELD (abbrev_mode); /* Display table to use for text in this buffer. */ - Lisp_Object BUFFER_INTERNAL_FIELD (display_table); + Lisp_Object INTERNAL_FIELD (display_table); /* t means the mark and region are currently active. */ - Lisp_Object BUFFER_INTERNAL_FIELD (mark_active); + Lisp_Object INTERNAL_FIELD (mark_active); /* Non-nil means the buffer contents are regarded as multi-byte form of characters, not a binary code. */ - Lisp_Object BUFFER_INTERNAL_FIELD (enable_multibyte_characters); + Lisp_Object INTERNAL_FIELD (enable_multibyte_characters); /* Coding system to be used for encoding the buffer contents on saving. */ - Lisp_Object BUFFER_INTERNAL_FIELD (buffer_file_coding_system); + Lisp_Object INTERNAL_FIELD (buffer_file_coding_system); /* List of symbols naming the file format used for visited file. */ - Lisp_Object BUFFER_INTERNAL_FIELD (file_format); + Lisp_Object INTERNAL_FIELD (file_format); /* List of symbols naming the file format used for auto-save file. */ - Lisp_Object BUFFER_INTERNAL_FIELD (auto_save_file_format); + Lisp_Object INTERNAL_FIELD (auto_save_file_format); /* True if the newline position cache and width run cache are enabled. See search.c and indent.c. */ - Lisp_Object BUFFER_INTERNAL_FIELD (cache_long_line_scans); + Lisp_Object INTERNAL_FIELD (cache_long_line_scans); /* If the width run cache is enabled, this table contains the character widths width_run_cache (see above) assumes. When we @@ -644,102 +639,102 @@ current display table to see whether the display table has affected the widths of any characters. If it has, we invalidate the width run cache, and re-initialize width_table. */ - Lisp_Object BUFFER_INTERNAL_FIELD (width_table); + Lisp_Object INTERNAL_FIELD (width_table); /* In an indirect buffer, or a buffer that is the base of an indirect buffer, this holds a marker that records PT for this buffer when the buffer is not current. */ - Lisp_Object BUFFER_INTERNAL_FIELD (pt_marker); + Lisp_Object INTERNAL_FIELD (pt_marker); /* In an indirect buffer, or a buffer that is the base of an indirect buffer, this holds a marker that records BEGV for this buffer when the buffer is not current. */ - Lisp_Object BUFFER_INTERNAL_FIELD (begv_marker); + Lisp_Object INTERNAL_FIELD (begv_marker); /* In an indirect buffer, or a buffer that is the base of an indirect buffer, this holds a marker that records ZV for this buffer when the buffer is not current. */ - Lisp_Object BUFFER_INTERNAL_FIELD (zv_marker); + Lisp_Object INTERNAL_FIELD (zv_marker); /* This holds the point value before the last scroll operation. Explicitly setting point sets this to nil. */ - Lisp_Object BUFFER_INTERNAL_FIELD (point_before_scroll); + Lisp_Object INTERNAL_FIELD (point_before_scroll); /* Truename of the visited file, or nil. */ - Lisp_Object BUFFER_INTERNAL_FIELD (file_truename); + Lisp_Object INTERNAL_FIELD (file_truename); /* Invisibility spec of this buffer. t => any non-nil `invisible' property means invisible. A list => `invisible' property means invisible if it is memq in that list. */ - Lisp_Object BUFFER_INTERNAL_FIELD (invisibility_spec); + Lisp_Object INTERNAL_FIELD (invisibility_spec); /* This is the last window that was selected with this buffer in it, or nil if that window no longer displays this buffer. */ - Lisp_Object BUFFER_INTERNAL_FIELD (last_selected_window); + Lisp_Object INTERNAL_FIELD (last_selected_window); /* Incremented each time the buffer is displayed in a window. */ - Lisp_Object BUFFER_INTERNAL_FIELD (display_count); + Lisp_Object INTERNAL_FIELD (display_count); /* Widths of left and right marginal areas for windows displaying this buffer. */ - Lisp_Object BUFFER_INTERNAL_FIELD (left_margin_cols); - Lisp_Object BUFFER_INTERNAL_FIELD (right_margin_cols); + Lisp_Object INTERNAL_FIELD (left_margin_cols); + Lisp_Object INTERNAL_FIELD (right_margin_cols); /* Widths of left and right fringe areas for windows displaying this buffer. */ - Lisp_Object BUFFER_INTERNAL_FIELD (left_fringe_width); - Lisp_Object BUFFER_INTERNAL_FIELD (right_fringe_width); + Lisp_Object INTERNAL_FIELD (left_fringe_width); + Lisp_Object INTERNAL_FIELD (right_fringe_width); /* Non-nil means fringes are drawn outside display margins; othersize draw them between margin areas and text. */ - Lisp_Object BUFFER_INTERNAL_FIELD (fringes_outside_margins); + Lisp_Object INTERNAL_FIELD (fringes_outside_margins); /* Width and type of scroll bar areas for windows displaying this buffer. */ - Lisp_Object BUFFER_INTERNAL_FIELD (scroll_bar_width); - Lisp_Object BUFFER_INTERNAL_FIELD (vertical_scroll_bar_type); + Lisp_Object INTERNAL_FIELD (scroll_bar_width); + Lisp_Object INTERNAL_FIELD (vertical_scroll_bar_type); /* Non-nil means indicate lines not displaying text (in a style like vi). */ - Lisp_Object BUFFER_INTERNAL_FIELD (indicate_empty_lines); + Lisp_Object INTERNAL_FIELD (indicate_empty_lines); /* Non-nil means indicate buffer boundaries and scrolling. */ - Lisp_Object BUFFER_INTERNAL_FIELD (indicate_buffer_boundaries); + Lisp_Object INTERNAL_FIELD (indicate_buffer_boundaries); /* Logical to physical fringe bitmap mappings. */ - Lisp_Object BUFFER_INTERNAL_FIELD (fringe_indicator_alist); + Lisp_Object INTERNAL_FIELD (fringe_indicator_alist); /* Logical to physical cursor bitmap mappings. */ - Lisp_Object BUFFER_INTERNAL_FIELD (fringe_cursor_alist); + Lisp_Object INTERNAL_FIELD (fringe_cursor_alist); /* Time stamp updated each time this buffer is displayed in a window. */ - Lisp_Object BUFFER_INTERNAL_FIELD (display_time); + Lisp_Object INTERNAL_FIELD (display_time); /* If scrolling the display because point is below the bottom of a window showing this buffer, try to choose a window start so that point ends up this number of lines from the top of the window. Nil means that scrolling method isn't used. */ - Lisp_Object BUFFER_INTERNAL_FIELD (scroll_up_aggressively); + Lisp_Object INTERNAL_FIELD (scroll_up_aggressively); /* If scrolling the display because point is above the top of a window showing this buffer, try to choose a window start so that point ends up this number of lines from the bottom of the window. Nil means that scrolling method isn't used. */ - Lisp_Object BUFFER_INTERNAL_FIELD (scroll_down_aggressively); + Lisp_Object INTERNAL_FIELD (scroll_down_aggressively); /* Desired cursor type in this buffer. See the doc string of per-buffer variable `cursor-type'. */ - Lisp_Object BUFFER_INTERNAL_FIELD (cursor_type); + Lisp_Object INTERNAL_FIELD (cursor_type); /* An integer > 0 means put that number of pixels below text lines in the display of this buffer. */ - Lisp_Object BUFFER_INTERNAL_FIELD (extra_line_spacing); + Lisp_Object INTERNAL_FIELD (extra_line_spacing); /* Cursor type to display in non-selected windows. t means to use hollow box cursor. See `cursor-type' for other values. */ - Lisp_Object BUFFER_INTERNAL_FIELD (cursor_in_non_selected_windows); + Lisp_Object INTERNAL_FIELD (cursor_in_non_selected_windows); /* No more Lisp_Object beyond this point. Except undo_list, which is handled specially in Fgarbage_collect . */ @@ -861,7 +856,7 @@ buffer of an indirect buffer. But we can't store it in the struct buffer_text because local variables have to be right in the struct buffer. So we copy it around in set_buffer_internal. */ - Lisp_Object BUFFER_INTERNAL_FIELD (undo_list); + Lisp_Object INTERNAL_FIELD (undo_list); }; @@ -1020,7 +1015,7 @@ from the start of a buffer structure. */ #define PER_BUFFER_VAR_OFFSET(VAR) \ - offsetof (struct buffer, BUFFER_INTERNAL_FIELD (VAR)) + offsetof (struct buffer, INTERNAL_FIELD (VAR)) /* Used to iterate over normal Lisp_Object fields of struct buffer (all Lisp_Objects except undo_list). If you add, remove, or reorder === modified file 'src/data.c' --- src/data.c 2012-07-30 18:56:42 +0000 +++ src/data.c 2012-07-31 12:36:19 +0000 @@ -1006,7 +1006,7 @@ XSETSYMBOL (var, symbol); if (blv->frame_local) { - tem1 = assq_no_quit (var, XFRAME (selected_frame)->param_alist); + tem1 = assq_no_quit (var, FVAR (XFRAME (selected_frame), param_alist)); blv->where = selected_frame; } else @@ -1179,7 +1179,7 @@ XSETSYMBOL (symbol, sym); /* May have changed via aliasing. */ tem1 = Fassq (symbol, (blv->frame_local - ? XFRAME (where)->param_alist + ? FVAR (XFRAME (where), param_alist) : BVAR (XBUFFER (where), local_var_alist))); blv->where = where; blv->found = 1; === modified file 'src/dispnew.c' --- src/dispnew.c 2012-07-10 23:24:36 +0000 +++ src/dispnew.c 2012-07-31 12:36:19 +0000 @@ -841,12 +841,12 @@ /* Clear the matrix of the menu bar window, if such a window exists. The menu bar window is currently used to display menus on X when no toolkit support is compiled in. */ - if (WINDOWP (f->menu_bar_window)) - clear_glyph_matrix (XWINDOW (f->menu_bar_window)->current_matrix); + if (WINDOWP (FVAR (f, menu_bar_window))) + clear_glyph_matrix (XWINDOW (FVAR (f, menu_bar_window))->current_matrix); /* Clear the matrix of the tool-bar window, if any. */ - if (WINDOWP (f->tool_bar_window)) - clear_glyph_matrix (XWINDOW (f->tool_bar_window)->current_matrix); + if (WINDOWP (FVAR (f, tool_bar_window))) + clear_glyph_matrix (XWINDOW (FVAR (f, tool_bar_window))->current_matrix); /* Clear current window matrices. */ eassert (WINDOWP (FRAME_ROOT_WINDOW (f))); @@ -862,11 +862,11 @@ if (f->desired_matrix) clear_glyph_matrix (f->desired_matrix); - if (WINDOWP (f->menu_bar_window)) - clear_glyph_matrix (XWINDOW (f->menu_bar_window)->desired_matrix); + if (WINDOWP (FVAR (f, menu_bar_window))) + clear_glyph_matrix (XWINDOW (FVAR (f, menu_bar_window))->desired_matrix); - if (WINDOWP (f->tool_bar_window)) - clear_glyph_matrix (XWINDOW (f->tool_bar_window)->desired_matrix); + if (WINDOWP (FVAR (f, tool_bar_window))) + clear_glyph_matrix (XWINDOW (FVAR (f, tool_bar_window))->desired_matrix); /* Do it for window matrices. */ eassert (WINDOWP (FRAME_ROOT_WINDOW (f))); @@ -1901,7 +1901,7 @@ adjust_frame_glyphs_initially (void) { struct frame *sf = SELECTED_FRAME (); - struct window *root = XWINDOW (sf->root_window); + struct window *root = XWINDOW (FVAR (sf, root_window)); struct window *mini = XWINDOW (root->next); int frame_lines = FRAME_LINES (sf); int frame_cols = FRAME_COLS (sf); @@ -2184,15 +2184,15 @@ { /* Allocate a dummy window if not already done. */ struct window *w; - if (NILP (f->menu_bar_window)) + if (NILP (FVAR (f, menu_bar_window))) { - f->menu_bar_window = make_window (); - w = XWINDOW (f->menu_bar_window); + FVAR (f, menu_bar_window) = make_window (); + w = XWINDOW (FVAR (f, menu_bar_window)); XSETFRAME (w->frame, f); w->pseudo_window_p = 1; } else - w = XWINDOW (f->menu_bar_window); + w = XWINDOW (FVAR (f, menu_bar_window)); /* Set window dimensions to frame dimensions and allocate or adjust glyph matrices of W. */ @@ -2210,15 +2210,15 @@ /* Allocate/ reallocate matrices of the tool bar window. If we don't have a tool bar window yet, make one. */ struct window *w; - if (NILP (f->tool_bar_window)) + if (NILP (FVAR (f, tool_bar_window))) { - f->tool_bar_window = make_window (); - w = XWINDOW (f->tool_bar_window); + FVAR (f, tool_bar_window) = make_window (); + w = XWINDOW (FVAR (f, tool_bar_window)); XSETFRAME (w->frame, f); w->pseudo_window_p = 1; } else - w = XWINDOW (f->tool_bar_window); + w = XWINDOW (FVAR (f, tool_bar_window)); XSETFASTINT (w->top_line, FRAME_MENU_BAR_LINES (f)); XSETFASTINT (w->left_col, 0); @@ -2278,28 +2278,28 @@ f->glyphs_initialized_p = 0; /* Release window sub-matrices. */ - if (!NILP (f->root_window)) - free_window_matrices (XWINDOW (f->root_window)); + if (!NILP (FVAR (f, root_window))) + free_window_matrices (XWINDOW (FVAR (f, root_window))); /* Free the dummy window for menu bars without X toolkit and its glyph matrices. */ - if (!NILP (f->menu_bar_window)) + if (!NILP (FVAR (f, menu_bar_window))) { - struct window *w = XWINDOW (f->menu_bar_window); + struct window *w = XWINDOW (FVAR (f, menu_bar_window)); free_glyph_matrix (w->desired_matrix); free_glyph_matrix (w->current_matrix); w->desired_matrix = w->current_matrix = NULL; - f->menu_bar_window = Qnil; + FVAR (f, menu_bar_window) = Qnil; } /* Free the tool bar window and its glyph matrices. */ - if (!NILP (f->tool_bar_window)) + if (!NILP (FVAR (f, tool_bar_window))) { - struct window *w = XWINDOW (f->tool_bar_window); + struct window *w = XWINDOW (FVAR (f, tool_bar_window)); free_glyph_matrix (w->desired_matrix); free_glyph_matrix (w->current_matrix); w->desired_matrix = w->current_matrix = NULL; - f->tool_bar_window = Qnil; + FVAR (f, tool_bar_window) = Qnil; } /* Release frame glyph matrices. Reset fields to zero in @@ -2722,7 +2722,7 @@ /* If we are called on frame matrices, perform analogous operations for window matrices. */ if (frame_matrix_frame) - mirror_make_current (XWINDOW (frame_matrix_frame->root_window), row); + mirror_make_current (XWINDOW (FVAR (frame_matrix_frame, root_window)), row); } @@ -2820,7 +2820,7 @@ /* Do the same for window matrices, if MATRIX is a frame matrix. */ if (frame_matrix_frame) - mirror_line_dance (XWINDOW (frame_matrix_frame->root_window), + mirror_line_dance (XWINDOW (FVAR (frame_matrix_frame, root_window)), unchanged_at_top, nlines, copy_from, retained_p); } @@ -3183,7 +3183,7 @@ { /* 1 means display has been paused because of pending input. */ int paused_p; - struct window *root_window = XWINDOW (f->root_window); + struct window *root_window = XWINDOW (FVAR (f, root_window)); if (redisplay_dont_pause) force_p = 1; @@ -3218,13 +3218,13 @@ /* Update the menu bar on X frames that don't have toolkit support. */ - if (WINDOWP (f->menu_bar_window)) - update_window (XWINDOW (f->menu_bar_window), 1); + if (WINDOWP (FVAR (f, menu_bar_window))) + update_window (XWINDOW (FVAR (f, menu_bar_window)), 1); /* Update the tool-bar window, if present. */ - if (WINDOWP (f->tool_bar_window)) + if (WINDOWP (FVAR (f, tool_bar_window))) { - struct window *w = XWINDOW (f->tool_bar_window); + struct window *w = XWINDOW (FVAR (f, tool_bar_window)); /* Update tool-bar window. */ if (w->must_be_updated_p) @@ -3236,9 +3236,10 @@ /* Swap tool-bar strings. We swap because we want to reuse strings. */ - tem = f->current_tool_bar_string; - f->current_tool_bar_string = f->desired_tool_bar_string; - f->desired_tool_bar_string = tem; + tem = FVAR (f, current_tool_bar_string); + FVAR (f, current_tool_bar_string) = FVAR (f, + desired_tool_bar_string); + FVAR (f, desired_tool_bar_string) = tem; } } @@ -5759,8 +5760,8 @@ if ((FRAME_TERMCAP_P (f) && !pretend) || FRAME_MSDOS_P (f)) FrameCols (FRAME_TTY (f)) = newwidth; - if (WINDOWP (f->tool_bar_window)) - XSETFASTINT (XWINDOW (f->tool_bar_window)->total_cols, newwidth); + if (WINDOWP (FVAR (f, tool_bar_window))) + XSETFASTINT (XWINDOW (FVAR (f, tool_bar_window))->total_cols, newwidth); } FRAME_LINES (f) = newheight; @@ -6084,7 +6085,7 @@ goto changed; if (vecp == end) goto changed; - if (!EQ (*vecp++, XFRAME (frame)->name)) + if (!EQ (*vecp++, FVAR (XFRAME (frame), name))) goto changed; } /* Check that the buffer info matches. */ @@ -6141,7 +6142,7 @@ FOR_EACH_FRAME (tail, frame) { *vecp++ = frame; - *vecp++ = XFRAME (frame)->name; + *vecp++ = FVAR (XFRAME (frame), name); } for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail)) { === modified file 'src/dosfns.c' --- src/dosfns.c 2012-07-20 07:29:04 +0000 +++ src/dosfns.c 2012-07-31 12:36:19 +0000 @@ -468,15 +468,15 @@ x_set_title (struct frame *f, Lisp_Object name) { /* Don't change the title if it's already NAME. */ - if (EQ (name, f->title)) + if (EQ (name, FVAR (f, title))) return; update_mode_lines = 1; - f->title = name; + FVAR (f, title) = name; if (NILP (name)) - name = f->name; + name = FVAR (f, name); if (FRAME_MSDOS_P (f)) { === modified file 'src/eval.c' --- src/eval.c 2012-07-29 17:14:51 +0000 +++ src/eval.c 2012-07-31 12:36:19 +0000 @@ -3254,7 +3254,7 @@ local binding, but only if that binding still exists. */ else if (BUFFERP (where) ? !NILP (Flocal_variable_p (symbol, where)) - : !NILP (Fassq (symbol, XFRAME (where)->param_alist))) + : !NILP (Fassq (symbol, FVAR (XFRAME (where), param_alist)))) set_internal (symbol, this_binding.old_value, where, 1); } /* If variable has a trivial value (no forwarding), we can === modified file 'src/frame.c' --- src/frame.c 2012-07-25 09:34:48 +0000 +++ src/frame.c 2012-07-31 12:36:19 +0000 @@ -170,7 +170,7 @@ windows_or_buffers_changed++; FRAME_WINDOW_SIZES_CHANGED (f) = 1; FRAME_MENU_BAR_LINES (f) = nlines; - set_menu_bar_lines_1 (f->root_window, nlines - olines); + set_menu_bar_lines_1 (FVAR (f, root_window), nlines - olines); adjust_glyphs (f); } } @@ -269,7 +269,7 @@ /* Initialize Lisp data. Note that allocate_frame initializes all Lisp data to nil, so do it only for slots which should not be nil. */ - f->tool_bar_position = Qtop; + FVAR (f, tool_bar_position) = Qtop; /* Initialize non-Lisp data. Note that allocate_frame zeroes out all non-Lisp data, so do it only for slots which should not be zero. @@ -293,13 +293,13 @@ XWINDOW (mini_window)->prev = root_window; XWINDOW (mini_window)->mini = 1; XWINDOW (mini_window)->frame = frame; - f->minibuffer_window = mini_window; + FVAR (f, minibuffer_window) = mini_window; } else { mini_window = Qnil; XWINDOW (root_window)->next = Qnil; - f->minibuffer_window = Qnil; + FVAR (f, minibuffer_window) = Qnil; } XWINDOW (root_window)->frame = frame; @@ -339,7 +339,7 @@ etc. Running Lisp functions at this point surely ends in a SEGV. */ set_window_buffer (root_window, buf, 0, 0); - f->buffer_list = Fcons (buf, Qnil); + FVAR (f, buffer_list) = Fcons (buf, Qnil); } if (mini_p) @@ -352,11 +352,11 @@ 0, 0); } - f->root_window = root_window; - f->selected_window = root_window; + FVAR (f, root_window) = root_window; + FVAR (f, selected_window) = root_window; /* Make sure this window seems more recently used than a newly-created, never-selected window. */ - XWINDOW (f->selected_window)->use_time = ++window_select_count; + XWINDOW (FVAR (f, selected_window))->use_time = ++window_select_count; return f; } @@ -398,10 +398,11 @@ UNGCPRO; } - mini_window = XFRAME (KVAR (kb, Vdefault_minibuffer_frame))->minibuffer_window; + mini_window = FVAR (XFRAME (KVAR (kb, Vdefault_minibuffer_frame)), + minibuffer_window); } - f->minibuffer_window = mini_window; + FVAR (f, minibuffer_window) = mini_window; /* Make the chosen minibuffer window display the proper minibuffer, unless it is already showing a minibuffer. */ @@ -436,7 +437,7 @@ Avoid infinite looping on the window chain by marking next pointer as nil. */ - mini_window = f->minibuffer_window = f->root_window; + mini_window = FVAR (f, minibuffer_window) = FVAR (f, root_window); XWINDOW (mini_window)->mini = 1; XWINDOW (mini_window)->next = Qnil; XWINDOW (mini_window)->prev = Qnil; @@ -477,7 +478,7 @@ Vframe_list = Fcons (frame, Vframe_list); tty_frame_count = 1; - f->name = build_pure_c_string ("F1"); + FVAR (f, name) = build_pure_c_string ("F1"); f->visible = 1; f->async_visible = 1; @@ -518,7 +519,7 @@ XSETFRAME (frame, f); Vframe_list = Fcons (frame, Vframe_list); - f->name = make_formatted_string (name, "F%"pMd, ++tty_frame_count); + FVAR (f, name) = make_formatted_string (name, "F%"pMd, ++tty_frame_count); f->visible = 1; /* FRAME_SET_VISIBLE wd set frame_garbaged. */ f->async_visible = 1; /* Don't let visible be cleared later. */ @@ -569,7 +570,7 @@ result = Fassq (parameter, supplied_parms); if (NILP (result)) - result = Fassq (parameter, XFRAME (selected_frame)->param_alist); + result = Fassq (parameter, FVAR (XFRAME (selected_frame), param_alist)); if (NILP (result) && current_value != NULL) result = build_string (current_value); if (!NILP (result) && !STRINGP (result)) @@ -688,11 +689,11 @@ /* Make the frame face alist be frame-specific, so that each frame could change its face definitions independently. */ - f->face_alist = Fcopy_alist (sf->face_alist); + FVAR (f, face_alist) = Fcopy_alist (FVAR (sf, face_alist)); /* Simple Fcopy_alist isn't enough, because we need the contents of the vectors which are the CDRs of associations in face_alist to be copied as well. */ - for (tem = f->face_alist; CONSP (tem); tem = XCDR (tem)) + for (tem = FVAR (f, face_alist); CONSP (tem); tem = XCDR (tem)) XSETCDR (XCAR (tem), Fcopy_sequence (XCDR (XCAR (tem)))); return frame; } @@ -796,7 +797,7 @@ if (! FRAME_MINIBUF_ONLY_P (XFRAME (selected_frame))) last_nonminibuf_frame = XFRAME (selected_frame); - Fselect_window (XFRAME (frame)->selected_window, norecord); + Fselect_window (FVAR (XFRAME (frame), selected_window), norecord); /* We want to make sure that the next event generates a frame-switch event to the appropriate frame. This seems kludgy to me, but @@ -1237,11 +1238,11 @@ } /* Don't allow minibuf_window to remain on a deleted frame. */ - if (EQ (f->minibuffer_window, minibuf_window)) + if (EQ (FVAR (f, minibuffer_window), minibuf_window)) { - Fset_window_buffer (sf->minibuffer_window, + Fset_window_buffer (FVAR (sf, minibuffer_window), XWINDOW (minibuf_window)->buffer, Qnil); - minibuf_window = sf->minibuffer_window; + minibuf_window = FVAR (sf, minibuffer_window); /* If the dying minibuffer window was selected, select the new one. */ @@ -1250,8 +1251,8 @@ } /* Don't let echo_area_window to remain on a deleted frame. */ - if (EQ (f->minibuffer_window, echo_area_window)) - echo_area_window = sf->minibuffer_window; + if (EQ (FVAR (f, minibuffer_window), echo_area_window)) + echo_area_window = FVAR (sf, minibuffer_window); /* Clear any X selections for this frame. */ #ifdef HAVE_X_WINDOWS @@ -1272,8 +1273,8 @@ /* Mark all the windows that used to be on FRAME as deleted, and then remove the reference to them. */ - delete_all_child_windows (f->root_window); - f->root_window = Qnil; + delete_all_child_windows (FVAR (f, root_window)); + FVAR (f, root_window) = Qnil; Vframe_list = Fdelq (frame, Vframe_list); FRAME_SET_VISIBLE (f, 0); @@ -1282,7 +1283,7 @@ garbage collection. The frame object itself may not be garbage collected until much later, because recent_keys and other data structures can still refer to it. */ - f->menu_bar_vector = Qnil; + FVAR (f, menu_bar_vector) = Qnil; free_font_driver_list (f); xfree (f->namebuf); @@ -1655,7 +1656,7 @@ } #endif - make_frame_visible_1 (XFRAME (frame)->root_window); + make_frame_visible_1 (FVAR (XFRAME (frame), root_window)); /* Make menu bar update for the Buffers and Frames menus. */ windows_or_buffers_changed++; @@ -1709,12 +1710,12 @@ error ("Attempt to make invisible the sole visible or iconified frame"); /* Don't allow minibuf_window to remain on a deleted frame. */ - if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window)) + if (EQ (FVAR (XFRAME (frame), minibuffer_window), minibuf_window)) { struct frame *sf = XFRAME (selected_frame); - Fset_window_buffer (sf->minibuffer_window, + Fset_window_buffer (FVAR (sf, minibuffer_window), XWINDOW (minibuf_window)->buffer, Qnil); - minibuf_window = sf->minibuffer_window; + minibuf_window = FVAR (sf, minibuffer_window); } /* I think this should be done with a hook. */ @@ -1747,12 +1748,12 @@ #endif /* Don't allow minibuf_window to remain on a deleted frame. */ - if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window)) + if (EQ (FVAR (XFRAME (frame), minibuffer_window), minibuf_window)) { struct frame *sf = XFRAME (selected_frame); - Fset_window_buffer (sf->minibuffer_window, + Fset_window_buffer (FVAR (sf, minibuffer_window), XWINDOW (minibuf_window)->buffer, Qnil); - minibuf_window = sf->minibuffer_window; + minibuf_window = FVAR (sf, minibuffer_window); } /* I think this should be done with a hook. */ @@ -1906,7 +1907,7 @@ f = XFRAME (frame); - f->focus_frame = focus_frame; + FVAR (f, focus_frame) = focus_frame; if (FRAME_TERMINAL (f)->frame_rehighlight_hook) (*FRAME_TERMINAL (f)->frame_rehighlight_hook) (f); @@ -1939,7 +1940,7 @@ { register Lisp_Object tem; - tem = Fassq (prop, frame->param_alist); + tem = Fassq (prop, FVAR (frame, param_alist)); if (EQ (tem, Qnil)) return tem; return Fcdr (tem); @@ -1951,7 +1952,7 @@ Lisp_Object frame_buffer_predicate (Lisp_Object frame) { - return XFRAME (frame)->buffer_predicate; + return FVAR (XFRAME (frame), buffer_predicate); } /* Return the buffer-list of the selected frame. */ @@ -1959,7 +1960,7 @@ static Lisp_Object frame_buffer_list (Lisp_Object frame) { - return XFRAME (frame)->buffer_list; + return FVAR (XFRAME (frame), buffer_list); } /* Discard BUFFER from the buffer-list and buried-buffer-list of each frame. */ @@ -1971,10 +1972,10 @@ FOR_EACH_FRAME (tail, frame) { - XFRAME (frame)->buffer_list - = Fdelq (buffer, XFRAME (frame)->buffer_list); - XFRAME (frame)->buried_buffer_list - = Fdelq (buffer, XFRAME (frame)->buried_buffer_list); + FVAR (XFRAME (frame), buffer_list) + = Fdelq (buffer, FVAR (XFRAME (frame), buffer_list)); + FVAR (XFRAME (frame), buried_buffer_list) + = Fdelq (buffer, FVAR (XFRAME (frame), buried_buffer_list)); } } @@ -2022,8 +2023,8 @@ /* Check for no change needed in this very common case before we do any consing. */ - if (frame_name_fnn_p (SSDATA (f->name), - SBYTES (f->name))) + if (frame_name_fnn_p (SSDATA (FVAR (f, name)), + SBYTES (FVAR (f, name)))) return; name = make_formatted_string (namebuf, "F%"pMd, ++tty_frame_count); @@ -2033,7 +2034,7 @@ CHECK_STRING (name); /* Don't change the name if it's already NAME. */ - if (! NILP (Fstring_equal (name, f->name))) + if (! NILP (Fstring_equal (name, FVAR (f, name)))) return; /* Don't allow the user to set the frame name to F, so it @@ -2042,7 +2043,7 @@ error ("Frame names of the form F are usurped by Emacs"); } - f->name = name; + FVAR (f, name) = name; update_mode_lines = 1; } @@ -2059,7 +2060,7 @@ for (; CONSP (val); val = XCDR (val)) if (!NILP (Fbuffer_live_p (XCAR (val)))) list = Fcons (XCAR (val), list); - f->buffer_list = Fnreverse (list); + FVAR (f, buffer_list) = Fnreverse (list); return; } if (EQ (prop, Qburied_buffer_list)) @@ -2068,7 +2069,7 @@ for (; CONSP (val); val = XCDR (val)) if (!NILP (Fbuffer_live_p (XCAR (val)))) list = Fcons (XCAR (val), list); - f->buried_buffer_list = Fnreverse (list); + FVAR (f, buried_buffer_list) = Fnreverse (list); return; } @@ -2103,9 +2104,9 @@ FRAME_TTY (f)->previous_frame = NULL; /* Update the frame parameter alist. */ - old_alist_elt = Fassq (prop, f->param_alist); + old_alist_elt = Fassq (prop, FVAR (f, param_alist)); if (EQ (old_alist_elt, Qnil)) - f->param_alist = Fcons (Fcons (prop, val), f->param_alist); + FVAR (f, param_alist) = Fcons (Fcons (prop, val), FVAR (f, param_alist)); else Fsetcdr (old_alist_elt, val); @@ -2113,7 +2114,7 @@ in addition to the alist. */ if (EQ (prop, Qbuffer_predicate)) - f->buffer_predicate = val; + FVAR (f, buffer_predicate) = val; if (! FRAME_WINDOW_P (f)) { @@ -2129,11 +2130,11 @@ error ("Surrogate minibuffer windows must be minibuffer windows"); if ((FRAME_HAS_MINIBUF_P (f) || FRAME_MINIBUF_ONLY_P (f)) - && !EQ (val, f->minibuffer_window)) + && !EQ (val, FVAR (f, minibuffer_window))) error ("Can't change the surrogate minibuffer of a frame with its own minibuffer"); /* Install the chosen minibuffer window, with proper buffer. */ - f->minibuffer_window = val; + FVAR (f, minibuffer_window) = val; } } @@ -2158,7 +2159,7 @@ if (!FRAME_LIVE_P (f)) return Qnil; - alist = Fcopy_alist (f->param_alist); + alist = Fcopy_alist (FVAR (f, param_alist)); GCPRO1 (alist); if (!FRAME_WINDOW_P (f)) @@ -2204,7 +2205,7 @@ : FRAME_W32_P (f) ? "w32term" :"tty")); } - store_in_alist (&alist, Qname, f->name); + store_in_alist (&alist, Qname, FVAR (f, name)); height = (f->new_text_lines ? f->new_text_lines : FRAME_LINES (f)); store_in_alist (&alist, Qheight, make_number (height)); width = (f->new_text_cols ? f->new_text_cols : FRAME_COLS (f)); @@ -2216,7 +2217,8 @@ : FRAME_MINIBUF_WINDOW (f))); store_in_alist (&alist, Qunsplittable, (FRAME_NO_SPLIT_P (f) ? Qt : Qnil)); store_in_alist (&alist, Qbuffer_list, frame_buffer_list (frame)); - store_in_alist (&alist, Qburied_buffer_list, XFRAME (frame)->buried_buffer_list); + store_in_alist (&alist, Qburied_buffer_list, + FVAR (XFRAME (frame), buried_buffer_list)); /* I think this should be done with a hook. */ #ifdef HAVE_WINDOW_SYSTEM @@ -2257,7 +2259,7 @@ { /* Avoid consing in frequent cases. */ if (EQ (parameter, Qname)) - value = f->name; + value = FVAR (f, name); #ifdef HAVE_X_WINDOWS else if (EQ (parameter, Qdisplay) && FRAME_X_P (f)) value = XCAR (FRAME_X_DISPLAY_INFO (f)->name_list_element); @@ -2265,7 +2267,7 @@ else if (EQ (parameter, Qbackground_color) || EQ (parameter, Qforeground_color)) { - value = Fassq (parameter, f->param_alist); + value = Fassq (parameter, FVAR (f, param_alist)); if (CONSP (value)) { value = XCDR (value); @@ -2303,7 +2305,7 @@ } else if (EQ (parameter, Qdisplay_type) || EQ (parameter, Qbackground_mode)) - value = Fcdr (Fassq (parameter, f->param_alist)); + value = Fcdr (Fassq (parameter, FVAR (f, param_alist))); else /* FIXME: Avoid this code path at all (as well as code duplication) by sharing more code with Fframe_parameters. */ @@ -2889,14 +2891,14 @@ if (! TYPE_RANGED_INTEGERP (int, icon_left)) { icon_left_no_change = 1; - icon_left = Fcdr (Fassq (Qicon_left, f->param_alist)); + icon_left = Fcdr (Fassq (Qicon_left, FVAR (f, param_alist))); if (NILP (icon_left)) XSETINT (icon_left, 0); } if (! TYPE_RANGED_INTEGERP (int, icon_top)) { icon_top_no_change = 1; - icon_top = Fcdr (Fassq (Qicon_top, f->param_alist)); + icon_top = Fcdr (Fassq (Qicon_top, FVAR (f, param_alist))); if (NILP (icon_top)) XSETINT (icon_top, 0); } @@ -3056,7 +3058,7 @@ store_in_alist (alistptr, Qouter_window_id, make_formatted_string (buf, "%lu", w)); #endif - store_in_alist (alistptr, Qicon_name, f->icon_name); + store_in_alist (alistptr, Qicon_name, FVAR (f, icon_name)); FRAME_SAMPLE_VISIBILITY (f); store_in_alist (alistptr, Qvisibility, (FRAME_VISIBLE_P (f) ? Qt @@ -3070,7 +3072,7 @@ XSETFASTINT (tem, FRAME_X_OUTPUT (f)->parent_desc); store_in_alist (alistptr, Qexplicit_name, (f->explicit_name ? Qt : Qnil)); store_in_alist (alistptr, Qparent_id, tem); - store_in_alist (alistptr, Qtool_bar_position, f->tool_bar_position); + store_in_alist (alistptr, Qtool_bar_position, FVAR (f, tool_bar_position)); } @@ -3130,7 +3132,7 @@ signal_error ("Invalid screen-gamma", new_value); /* Apply the new gamma value to the frame background. */ - bgcolor = Fassq (Qbackground_color, f->param_alist); + bgcolor = Fassq (Qbackground_color, FVAR (f, param_alist)); if (CONSP (bgcolor) && (bgcolor = XCDR (bgcolor), STRINGP (bgcolor))) { Lisp_Object parm_index = Fget (Qbackground_color, Qx_frame_parameter); @@ -3459,7 +3461,7 @@ { Lisp_Object tem; - tem = assq_no_quit (Qicon_type, f->param_alist); + tem = assq_no_quit (Qicon_type, FVAR (f, param_alist)); if (CONSP (tem)) return XCDR (tem); else === modified file 'src/frame.h' --- src/frame.h 2012-05-25 18:19:24 +0000 +++ src/frame.h 2012-07-31 12:36:19 +0000 @@ -80,6 +80,10 @@ struct font_driver_list; +/* Most code should use this macro to access Lisp fields in struct frame. */ + +#define FVAR(frame, field) ((frame)->INTERNAL_FIELD (field)) + struct frame { struct vectorlike_header header; @@ -89,15 +93,15 @@ /* Name of this frame: a Lisp string. It is used for looking up resources, as well as for the title in some cases. */ - Lisp_Object name; + Lisp_Object INTERNAL_FIELD (name); /* The name to use for the icon, the last time it was refreshed. nil means not explicitly specified. */ - Lisp_Object icon_name; + Lisp_Object INTERNAL_FIELD (icon_name); /* This is the frame title specified explicitly, if any. Usually it is nil. */ - Lisp_Object title; + Lisp_Object INTERNAL_FIELD (title); /* The frame which should receive keystrokes that occur in this frame, or nil if they should go to the frame itself. This is @@ -110,29 +114,29 @@ to shift from one frame to the other, any redirections to the original frame are shifted to the newly selected frame; if focus_frame is nil, Fselect_frame will leave it alone. */ - Lisp_Object focus_frame; + Lisp_Object INTERNAL_FIELD (focus_frame); /* This frame's root window. Every frame has one. If the frame has only a minibuffer window, this is it. Otherwise, if the frame has a minibuffer window, this is its sibling. */ - Lisp_Object root_window; + Lisp_Object INTERNAL_FIELD (root_window); /* This frame's selected window. Each frame has its own window hierarchy and one of the windows in it is selected within the frame. The selected window of the selected frame is Emacs's selected window. */ - Lisp_Object selected_window; + Lisp_Object INTERNAL_FIELD (selected_window); /* This frame's minibuffer window. Most frames have their own minibuffer windows, but only the selected frame's minibuffer window can actually appear to exist. */ - Lisp_Object minibuffer_window; + Lisp_Object INTERNAL_FIELD (minibuffer_window); /* Parameter alist of this frame. These are the parameters specified when creating the frame or modified with modify-frame-parameters. */ - Lisp_Object param_alist; + Lisp_Object INTERNAL_FIELD (param_alist); /* List of scroll bars on this frame. Actually, we don't specify exactly what is stored here at all; the @@ -141,50 +145,51 @@ instead of in the `device' structure so that the garbage collector doesn't need to look inside the window-system-dependent structure. */ - Lisp_Object scroll_bars; - Lisp_Object condemned_scroll_bars; + Lisp_Object INTERNAL_FIELD (scroll_bars); + Lisp_Object INTERNAL_FIELD (condemned_scroll_bars); /* Vector describing the items to display in the menu bar. Each item has four elements in this vector. They are KEY, STRING, SUBMAP, and HPOS. (HPOS is not used in when the X toolkit is in use.) There are four additional elements of nil at the end, to terminate. */ - Lisp_Object menu_bar_items; + Lisp_Object INTERNAL_FIELD (menu_bar_items); /* Alist of elements (FACE-NAME . FACE-VECTOR-DATA). */ - Lisp_Object face_alist; + Lisp_Object INTERNAL_FIELD (face_alist); /* A vector that records the entire structure of this frame's menu bar. For the format of the data, see extensive comments in xmenu.c. Only the X toolkit version uses this. */ - Lisp_Object menu_bar_vector; + Lisp_Object INTERNAL_FIELD (menu_bar_vector); /* Predicate for selecting buffers for other-buffer. */ - Lisp_Object buffer_predicate; + Lisp_Object INTERNAL_FIELD (buffer_predicate); /* List of buffers viewed in this frame, for other-buffer. */ - Lisp_Object buffer_list; + Lisp_Object INTERNAL_FIELD (buffer_list); /* List of buffers that were viewed, then buried in this frame. The most recently buried buffer is first. For last-buffer. */ - Lisp_Object buried_buffer_list; + Lisp_Object INTERNAL_FIELD (buried_buffer_list); /* A dummy window used to display menu bars under X when no X toolkit support is available. */ - Lisp_Object menu_bar_window; + Lisp_Object INTERNAL_FIELD (menu_bar_window); /* A window used to display the tool-bar of a frame. */ - Lisp_Object tool_bar_window; + Lisp_Object INTERNAL_FIELD (tool_bar_window); /* Desired and current tool-bar items. */ - Lisp_Object tool_bar_items; + Lisp_Object INTERNAL_FIELD (tool_bar_items); /* Where tool bar is, can be left, right, top or bottom. The native tool bar only supports top. */ - Lisp_Object tool_bar_position; + Lisp_Object INTERNAL_FIELD (tool_bar_position); /* Desired and current contents displayed in tool_bar_window. */ - Lisp_Object desired_tool_bar_string, current_tool_bar_string; + Lisp_Object INTERNAL_FIELD (desired_tool_bar_string); + Lisp_Object INTERNAL_FIELD (current_tool_bar_string); /* Beyond here, there should be no more Lisp_Object components. */ @@ -635,13 +640,13 @@ #define FRAME_WINDOW_SIZES_CHANGED(f) (f)->window_sizes_changed /* The minibuffer window of frame F, if it has one; otherwise nil. */ -#define FRAME_MINIBUF_WINDOW(f) (f)->minibuffer_window +#define FRAME_MINIBUF_WINDOW(f) FVAR (f, minibuffer_window) /* The root window of the window tree of frame F. */ -#define FRAME_ROOT_WINDOW(f) (f)->root_window +#define FRAME_ROOT_WINDOW(f) FVAR (f, root_window) /* The currently selected window of the window tree of frame F. */ -#define FRAME_SELECTED_WINDOW(f) (f)->selected_window +#define FRAME_SELECTED_WINDOW(f) FVAR (f, selected_window) #define FRAME_INSERT_COST(f) (f)->insert_line_cost #define FRAME_DELETE_COST(f) (f)->delete_line_cost @@ -649,7 +654,7 @@ #define FRAME_DELETEN_COST(f) (f)->delete_n_lines_cost #define FRAME_MESSAGE_BUF(f) (f)->message_buf #define FRAME_SCROLL_BOTTOM_VPOS(f) (f)->scroll_bottom_vpos -#define FRAME_FOCUS_FRAME(f) (f)->focus_frame +#define FRAME_FOCUS_FRAME(f) FVAR (f, focus_frame) /* Nonzero if frame F supports scroll bars. If this is zero, then it is impossible to enable scroll bars @@ -750,10 +755,10 @@ /* Nonzero if frame F has scroll bars. */ -#define FRAME_SCROLL_BARS(f) ((f)->scroll_bars) +#define FRAME_SCROLL_BARS(f) (FVAR (f, scroll_bars)) -#define FRAME_CONDEMNED_SCROLL_BARS(f) ((f)->condemned_scroll_bars) -#define FRAME_MENU_BAR_ITEMS(f) ((f)->menu_bar_items) +#define FRAME_CONDEMNED_SCROLL_BARS(f) (FVAR (f, condemned_scroll_bars)) +#define FRAME_MENU_BAR_ITEMS(f) (FVAR (f, menu_bar_items)) #define FRAME_COST_BAUD_RATE(f) ((f)->cost_calculation_baud_rate) #define FRAME_DESIRED_CURSOR(f) ((f)->desired_cursor) === modified file 'src/fringe.c' --- src/fringe.c 2012-07-15 00:52:16 +0000 +++ src/fringe.c 2012-07-31 12:36:19 +0000 @@ -1338,8 +1338,8 @@ int o_right = FRAME_RIGHT_FRINGE_WIDTH (f); int o_cols = FRAME_FRINGE_COLS (f); - Lisp_Object left_fringe = Fassq (Qleft_fringe, f->param_alist); - Lisp_Object right_fringe = Fassq (Qright_fringe, f->param_alist); + Lisp_Object left_fringe = Fassq (Qleft_fringe, FVAR (f, param_alist)); + Lisp_Object right_fringe = Fassq (Qright_fringe, FVAR (f, param_alist)); int left_fringe_width, right_fringe_width; if (!NILP (left_fringe)) === modified file 'src/gtkutil.c' --- src/gtkutil.c 2012-07-15 14:22:09 +0000 +++ src/gtkutil.c 2012-07-31 12:36:19 +0000 @@ -1148,8 +1148,10 @@ gtk_widget_set_name (wfixed, SSDATA (Vx_resource_name)); /* If this frame has a title or name, set it in the title bar. */ - if (! NILP (f->title)) title = SSDATA (ENCODE_UTF_8 (f->title)); - else if (! NILP (f->name)) title = SSDATA (ENCODE_UTF_8 (f->name)); + if (! NILP (FVAR (f, title))) + title = SSDATA (ENCODE_UTF_8 (FVAR (f, title))); + else if (! NILP (FVAR (f, name))) + title = SSDATA (ENCODE_UTF_8 (FVAR (f, name))); if (title) gtk_window_set_title (GTK_WINDOW (wtop), title); @@ -2059,7 +2061,7 @@ { cl_data = xmalloc (sizeof *cl_data); cl_data->f = f; - cl_data->menu_bar_vector = f->menu_bar_vector; + cl_data->menu_bar_vector = FVAR (f, menu_bar_vector); cl_data->menu_bar_items_used = f->menu_bar_items_used; cl_data->highlight_cb = highlight_cb; cl_data->ref_count = 0; @@ -2091,7 +2093,7 @@ if (cl_data) { cl_data->f = f; - cl_data->menu_bar_vector = f->menu_bar_vector; + cl_data->menu_bar_vector = FVAR (f, menu_bar_vector); cl_data->menu_bar_items_used = f->menu_bar_items_used; cl_data->highlight_cb = highlight_cb; } @@ -3808,12 +3810,12 @@ struct input_event event; EVENT_INIT (event); - if (! f || ! f->n_tool_bar_items || NILP (f->tool_bar_items)) + if (! f || ! f->n_tool_bar_items || NILP (FVAR (f, tool_bar_items))) return; idx *= TOOL_BAR_ITEM_NSLOTS; - key = AREF (f->tool_bar_items, idx + TOOL_BAR_ITEM_KEY); + key = AREF (FVAR (f, tool_bar_items), idx + TOOL_BAR_ITEM_KEY); XSETFRAME (frame, f); /* We generate two events here. The first one is to set the prefix @@ -4084,16 +4086,16 @@ FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA); Lisp_Object help, frame; - if (! f || ! f->n_tool_bar_items || NILP (f->tool_bar_items)) + if (! f || ! f->n_tool_bar_items || NILP (FVAR (f, tool_bar_items))) return FALSE; if (event->type == GDK_ENTER_NOTIFY) { idx *= TOOL_BAR_ITEM_NSLOTS; - help = AREF (f->tool_bar_items, idx + TOOL_BAR_ITEM_HELP); + help = AREF (FVAR (f, tool_bar_items), idx + TOOL_BAR_ITEM_HELP); if (NILP (help)) - help = AREF (f->tool_bar_items, idx + TOOL_BAR_ITEM_CAPTION); + help = AREF (FVAR (f, tool_bar_items), idx + TOOL_BAR_ITEM_CAPTION); } else help = Qnil; @@ -4221,7 +4223,7 @@ } -#define PROP(IDX) AREF (f->tool_bar_items, i * TOOL_BAR_ITEM_NSLOTS + (IDX)) +#define PROP(IDX) AREF (FVAR (f, tool_bar_items), i * TOOL_BAR_ITEM_NSLOTS + (IDX)) /* Find the right-to-left image named by RTL in the tool bar images for F. Returns IMAGE if RTL is not found. */ @@ -4704,7 +4706,7 @@ if (f->n_tool_bar_items != 0) { if (pack_tool_bar) - xg_pack_tool_bar (f, f->tool_bar_position); + xg_pack_tool_bar (f, FVAR (f, tool_bar_position)); gtk_widget_show_all (GTK_WIDGET (x->handlebox_widget)); if (xg_update_tool_bar_sizes (f)) xg_height_or_width_changed (f); === modified file 'src/keyboard.h' --- src/keyboard.h 2012-07-09 16:38:45 +0000 +++ src/keyboard.h 2012-07-31 12:36:19 +0000 @@ -19,14 +19,9 @@ #include "systime.h" /* for EMACS_TIME, Time */ #include "coding.h" /* for ENCODE_UTF_8 and ENCODE_SYSTEM */ -/* Lisp fields in struct keyboard are hidden from most code and accessed - via the KVAR macro, below. Only select pieces of code, like the GC, - are allowed to use KBOARD_INTERNAL_FIELD. */ -#define KBOARD_INTERNAL_FIELD(field) field ## _ +/* Most code should use this macro to access Lisp fields in struct kboard. */ -/* Most code should use this macro to access Lisp fields in struct - kboard. */ -#define KVAR(kboard, field) ((kboard)->KBOARD_INTERNAL_FIELD (field)) +#define KVAR(kboard, field) ((kboard)->INTERNAL_FIELD (field)) /* Each KBOARD represents one logical input stream from which Emacs gets input. If we are using ordinary terminals, it has one KBOARD @@ -79,32 +74,32 @@ can effectively wait for input in the any-kboard state, and hence avoid blocking out the other KBOARDs. See universal-argument in lisp/simple.el for an example. */ - Lisp_Object KBOARD_INTERNAL_FIELD (Voverriding_terminal_local_map); + Lisp_Object INTERNAL_FIELD (Voverriding_terminal_local_map); /* Last command executed by the editor command loop, not counting commands that set the prefix argument. */ - Lisp_Object KBOARD_INTERNAL_FIELD (Vlast_command); + Lisp_Object INTERNAL_FIELD (Vlast_command); /* Normally same as last-command, but never modified by other commands. */ - Lisp_Object KBOARD_INTERNAL_FIELD (Vreal_last_command); + Lisp_Object INTERNAL_FIELD (Vreal_last_command); /* User-supplied table to translate input characters through. */ - Lisp_Object KBOARD_INTERNAL_FIELD (Vkeyboard_translate_table); + Lisp_Object INTERNAL_FIELD (Vkeyboard_translate_table); /* Last command that may be repeated by `repeat'. */ - Lisp_Object KBOARD_INTERNAL_FIELD (Vlast_repeatable_command); + Lisp_Object INTERNAL_FIELD (Vlast_repeatable_command); /* The prefix argument for the next command, in raw form. */ - Lisp_Object KBOARD_INTERNAL_FIELD (Vprefix_arg); + Lisp_Object INTERNAL_FIELD (Vprefix_arg); /* Saved prefix argument for the last command, in raw form. */ - Lisp_Object KBOARD_INTERNAL_FIELD (Vlast_prefix_arg); + Lisp_Object INTERNAL_FIELD (Vlast_prefix_arg); /* Unread events specific to this kboard. */ - Lisp_Object KBOARD_INTERNAL_FIELD (kbd_queue); + Lisp_Object INTERNAL_FIELD (kbd_queue); /* Non-nil while a kbd macro is being defined. */ - Lisp_Object KBOARD_INTERNAL_FIELD (defining_kbd_macro); + Lisp_Object INTERNAL_FIELD (defining_kbd_macro); /* The start of storage for the current keyboard macro. */ Lisp_Object *kbd_macro_buffer; @@ -126,28 +121,28 @@ ptrdiff_t kbd_macro_bufsize; /* Last anonymous kbd macro defined. */ - Lisp_Object KBOARD_INTERNAL_FIELD (Vlast_kbd_macro); + Lisp_Object INTERNAL_FIELD (Vlast_kbd_macro); /* Alist of system-specific X windows key symbols. */ - Lisp_Object KBOARD_INTERNAL_FIELD (Vsystem_key_alist); + Lisp_Object INTERNAL_FIELD (Vsystem_key_alist); /* Cache for modify_event_symbol. */ - Lisp_Object KBOARD_INTERNAL_FIELD (system_key_syms); + Lisp_Object INTERNAL_FIELD (system_key_syms); /* The kind of display: x, w32, ... */ - Lisp_Object KBOARD_INTERNAL_FIELD (Vwindow_system); + Lisp_Object INTERNAL_FIELD (Vwindow_system); /* Keymap mapping keys to alternative preferred forms. See the DEFVAR for more documentation. */ - Lisp_Object KBOARD_INTERNAL_FIELD (Vlocal_function_key_map); + Lisp_Object INTERNAL_FIELD (Vlocal_function_key_map); /* Keymap mapping ASCII function key sequences onto their preferred forms. Initialized by the terminal-specific lisp files. See the DEFVAR for more documentation. */ - Lisp_Object KBOARD_INTERNAL_FIELD (Vinput_decode_map); + Lisp_Object INTERNAL_FIELD (Vinput_decode_map); /* Minibufferless frames on this display use this frame's minibuffer. */ - Lisp_Object KBOARD_INTERNAL_FIELD (Vdefault_minibuffer_frame); + Lisp_Object INTERNAL_FIELD (Vdefault_minibuffer_frame); /* Number of displays using this KBOARD. Normally 1, but can be larger when you have multiple screens on a single X display. */ @@ -155,7 +150,7 @@ /* The text we're echoing in the modeline - partial key sequences, usually. This is nil when not echoing. */ - Lisp_Object KBOARD_INTERNAL_FIELD (echo_string); + Lisp_Object INTERNAL_FIELD (echo_string); /* This flag indicates that events were put into kbd_queue while Emacs was running for some other KBOARD. === modified file 'src/lisp.h' --- src/lisp.h 2012-07-30 18:56:42 +0000 +++ src/lisp.h 2012-07-31 12:36:19 +0000 @@ -622,8 +622,13 @@ #define CHECK_TYPE(ok, Qxxxp, x) \ do { if (!(ok)) wrong_type_argument (Qxxxp, (x)); } while (0) - - +/* Lisp fields are usually hidden from most code and accessed + via special macros. Only select pieces of code, like the GC, + are allowed to use INTERNAL_FIELD directly. Objects which + aren't using this convention should be fixed. */ + +#define INTERNAL_FIELD(field) field ## _ + /* See the macros in intervals.h. */ typedef struct interval *INTERVAL; === modified file 'src/minibuf.c' --- src/minibuf.c 2012-07-11 07:19:44 +0000 +++ src/minibuf.c 2012-07-31 12:36:19 +0000 @@ -102,14 +102,14 @@ { if (FRAMEP (selected_frame) && FRAME_LIVE_P (XFRAME (selected_frame)) - && !EQ (minibuf_window, XFRAME (selected_frame)->minibuffer_window)) + && !EQ (minibuf_window, FVAR (XFRAME (selected_frame), minibuffer_window))) { struct frame *sf = XFRAME (selected_frame); Lisp_Object buffer; /* I don't think that any frames may validly have a null minibuffer window anymore. */ - if (NILP (sf->minibuffer_window)) + if (NILP (FVAR (sf, minibuffer_window))) abort (); /* Under X, we come here with minibuf_window being the @@ -117,8 +117,8 @@ init_window_once. That window doesn't have a buffer. */ buffer = XWINDOW (minibuf_window)->buffer; if (BUFFERP (buffer)) - Fset_window_buffer (sf->minibuffer_window, buffer, Qnil); - minibuf_window = sf->minibuffer_window; + Fset_window_buffer (FVAR (sf, minibuffer_window), buffer, Qnil); + minibuf_window = FVAR (sf, minibuffer_window); } /* Make sure no other frame has a minibuffer as its selected window, === modified file 'src/nsfns.m' --- src/nsfns.m 2012-07-13 18:03:10 +0000 +++ src/nsfns.m 2012-07-31 12:36:19 +0000 @@ -586,12 +586,12 @@ { NSTRACE (x_set_title); /* Don't change the title if it's already NAME. */ - if (EQ (name, f->title)) + if (EQ (name, FVAR (f, title))) return; update_mode_lines = 1; - f->title = name; + FVAR (f, title) = name; if (NILP (name)) name = f->name; === modified file 'src/nsterm.m' --- src/nsterm.m 2012-07-31 05:56:36 +0000 +++ src/nsterm.m 2012-07-31 12:36:19 +0000 @@ -2125,8 +2125,8 @@ int y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, desired_row->y)); /* Internal border is drawn below the tool bar. */ - if (WINDOWP (f->tool_bar_window) - && w == XWINDOW (f->tool_bar_window)) + if (WINDOWP (FVAR (f, tool_bar_window)) + && w == XWINDOW (FVAR (f, tool_bar_window))) y -= width; /* end copy from other terms */ === modified file 'src/print.c' --- src/print.c 2012-07-23 16:57:20 +0000 +++ src/print.c 2012-07-31 12:36:19 +0000 @@ -1897,7 +1897,7 @@ else if (FRAMEP (obj)) { int len; - Lisp_Object frame_name = XFRAME (obj)->name; + Lisp_Object frame_name = FVAR (XFRAME (obj), name); strout ((FRAME_LIVE_P (XFRAME (obj)) ? "#param_alist); + tem = assq_no_quit (Qtty_color_mode, FVAR (f, param_alist)); val = CONSP (tem) ? XCDR (tem) : Qnil; if (INTEGERP (val)) === modified file 'src/w32fns.c' --- src/w32fns.c 2012-07-30 17:07:33 +0000 +++ src/w32fns.c 2012-07-31 12:36:19 +0000 @@ -1489,7 +1489,7 @@ else if (!NILP (arg) || NILP (oldval)) return; - f->icon_name = arg; + FVAR (f, icon_name) = arg; #if 0 if (f->output_data.w32->icon_bitmap != 0) @@ -1498,11 +1498,11 @@ BLOCK_INPUT; result = x_text_icon (f, - SSDATA ((!NILP (f->icon_name) - ? f->icon_name - : !NILP (f->title) - ? f->title - : f->name))); + SSDATA ((!NILP (FVAR (f, icon_name)) + ? FVAR (f, icon_name) + : !NILP (FVAR (f, title)) + ? FVAR (f, title) + : FVAR (f, name)))); if (result) { @@ -1631,8 +1631,8 @@ } UNBLOCK_INPUT; - if (WINDOWP (f->tool_bar_window)) - clear_glyph_matrix (XWINDOW (f->tool_bar_window)->current_matrix); + if (WINDOWP (FVAR (f, tool_bar_window))) + clear_glyph_matrix (XWINDOW (FVAR (f, tool_bar_window))->current_matrix); } run_window_configuration_change_hook (f); @@ -1674,7 +1674,7 @@ /* Check for no change needed in this very common case before we do any consing. */ if (!strcmp (FRAME_W32_DISPLAY_INFO (f)->w32_id_name, - SDATA (f->name))) + SDATA (FVAR (f, name)))) return; name = build_string (FRAME_W32_DISPLAY_INFO (f)->w32_id_name); } @@ -1682,15 +1682,15 @@ CHECK_STRING (name); /* Don't change the name if it's already NAME. */ - if (! NILP (Fstring_equal (name, f->name))) + if (! NILP (Fstring_equal (name, FVAR (f, name)))) return; - f->name = name; + FVAR (f, name) = name; /* For setting the frame title, the title parameter should override the name parameter. */ - if (! NILP (f->title)) - name = f->title; + if (! NILP (FVAR (f, title))) + name = FVAR (f, title); if (FRAME_W32_WINDOW (f)) { @@ -1728,15 +1728,15 @@ x_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name) { /* Don't change the title if it's already NAME. */ - if (EQ (name, f->title)) + if (EQ (name, FVAR (f, title))) return; update_mode_lines = 1; - f->title = name; + FVAR (f, title) = name; if (NILP (name)) - name = f->name; + name = FVAR (f, name); if (FRAME_W32_WINDOW (f)) { @@ -3896,8 +3896,8 @@ int explicit = f->explicit_name; f->explicit_name = 0; - name = f->name; - f->name = Qnil; + name = FVAR (f, name); + FVAR (f, name) = Qnil; x_set_name (f, name, explicit); } @@ -3944,9 +3944,9 @@ ? IconicState : NormalState)); - x_text_icon (f, SSDATA ((!NILP (f->icon_name) - ? f->icon_name - : f->name))); + x_text_icon (f, SSDATA ((!NILP (FVAR (f, icon_name)) + ? FVAR (f, icon_name) + : FVAR (f, name)))); #endif UNBLOCK_INPUT; @@ -4146,11 +4146,11 @@ f->output_data.w32 = xzalloc (sizeof (struct w32_output)); FRAME_FONTSET (f) = -1; - f->icon_name + FVAR (f, icon_name) = x_get_arg (dpyinfo, parameters, Qicon_name, "iconName", "Title", RES_TYPE_STRING); - if (! STRINGP (f->icon_name)) - f->icon_name = Qnil; + if (! STRINGP (FVAR (f, icon_name))) + FVAR (f, icon_name) = Qnil; /* FRAME_W32_DISPLAY_INFO (f) = dpyinfo; */ @@ -4179,12 +4179,12 @@ be set. */ if (EQ (name, Qunbound) || NILP (name)) { - f->name = build_string (dpyinfo->w32_id_name); + FVAR (f, name) = build_string (dpyinfo->w32_id_name); f->explicit_name = 0; } else { - f->name = name; + FVAR (f, name) = name; f->explicit_name = 1; /* use the frame's title when getting resources for this frame. */ specbind (Qx_resource_name, name); @@ -4359,7 +4359,7 @@ by x_get_arg and friends, now go in the misc. alist of the frame. */ for (tem = parameters; CONSP (tem); tem = XCDR (tem)) if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem)))) - f->param_alist = Fcons (XCAR (tem), f->param_alist); + FVAR (f, param_alist) = Fcons (XCAR (tem), FVAR (f, param_alist)); UNGCPRO; @@ -5231,7 +5231,7 @@ f->output_data.w32 = xzalloc (sizeof (struct w32_output)); FRAME_FONTSET (f) = -1; - f->icon_name = Qnil; + FVAR (f, icon_name) = Qnil; #ifdef GLYPH_DEBUG image_cache_refcount = @@ -5246,12 +5246,12 @@ be set. */ if (EQ (name, Qunbound) || NILP (name)) { - f->name = build_string (dpyinfo->w32_id_name); + FVAR (f, name) = build_string (dpyinfo->w32_id_name); f->explicit_name = 0; } else { - f->name = name; + FVAR (f, name) = name; f->explicit_name = 1; /* use the frame's title when getting resources for this frame. */ specbind (Qx_resource_name, name); === modified file 'src/w32menu.c' --- src/w32menu.c 2012-07-29 08:18:29 +0000 +++ src/w32menu.c 2012-07-31 12:36:19 +0000 @@ -277,7 +277,7 @@ return; entry = Qnil; subprefix_stack = (Lisp_Object *) alloca (f->menu_bar_items_used * sizeof (Lisp_Object)); - vector = f->menu_bar_vector; + vector = FVAR (f, menu_bar_vector); prefix = Qnil; i = 0; while (i < f->menu_bar_items_used) @@ -419,14 +419,14 @@ /* Save the frame's previous menu bar contents data. */ if (previous_menu_items_used) - memcpy (previous_items, XVECTOR (f->menu_bar_vector)->contents, + memcpy (previous_items, XVECTOR (FVAR (f, menu_bar_vector))->contents, previous_menu_items_used * sizeof (Lisp_Object)); /* Fill in menu_items with the current menu bar contents. This can evaluate Lisp code. */ save_menu_items (); - menu_items = f->menu_bar_vector; + menu_items = FVAR (f, menu_bar_vector); menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0; submenu_start = (int *) alloca (ASIZE (items) * sizeof (int)); submenu_end = (int *) alloca (ASIZE (items) * sizeof (int)); @@ -500,7 +500,7 @@ return; } - f->menu_bar_vector = menu_items; + FVAR (f, menu_bar_vector) = menu_items; f->menu_bar_items_used = menu_items_used; /* This undoes save_menu_items. */ @@ -854,7 +854,7 @@ wv_title->name = SSDATA (title); wv_title->enabled = TRUE; - wv_title->title = TRUE; + FVAR (wv_title, title) = TRUE; wv_title->button_type = BUTTON_TYPE_NONE; wv_title->help = Qnil; wv_title->next = wv_sep; === modified file 'src/w32term.c' --- src/w32term.c 2012-07-30 17:07:33 +0000 +++ src/w32term.c 2012-07-31 12:36:19 +0000 @@ -4189,7 +4189,7 @@ /* We may get paint messages even though the client area is clipped - these are not expose events. */ DebPrint (("clipped frame %p (%s) got WM_PAINT - ignored\n", f, - SDATA (f->name))); + SDATA (FVAR (f, name)))); } else if (f->async_visible != 1) { @@ -4198,7 +4198,7 @@ f->async_iconified = 0; SET_FRAME_GARBAGED (f); DebPrint (("frame %p (%s) reexposed by WM_PAINT\n", f, - SDATA (f->name))); + SDATA (FVAR (f, name)))); /* WM_PAINT serves as MapNotify as well, so report visibility changes properly. */ @@ -4254,7 +4254,7 @@ if (f && !f->iconified) { if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight) - && !EQ (f->tool_bar_window, hlinfo->mouse_face_window)) + && !EQ (FVAR (f, tool_bar_window), hlinfo->mouse_face_window)) { clear_mouse_face (hlinfo); hlinfo->mouse_face_hidden = 1; @@ -4279,7 +4279,7 @@ if (f && !f->iconified) { if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight) - && !EQ (f->tool_bar_window, hlinfo->mouse_face_window)) + && !EQ (FVAR (f, tool_bar_window), hlinfo->mouse_face_window)) { clear_mouse_face (hlinfo); hlinfo->mouse_face_hidden = 1; @@ -4357,7 +4357,7 @@ if (f && !f->iconified) { if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight) - && !EQ (f->tool_bar_window, hlinfo->mouse_face_window)) + && !EQ (FVAR (f, tool_bar_window), hlinfo->mouse_face_window)) { clear_mouse_face (hlinfo); hlinfo->mouse_face_hidden = 1; @@ -4481,8 +4481,8 @@ construct_mouse_click (&inev, &msg, f); /* Is this in the tool-bar? */ - if (WINDOWP (f->tool_bar_window) - && WINDOW_TOTAL_LINES (XWINDOW (f->tool_bar_window))) + if (WINDOWP (FVAR (f, tool_bar_window)) + && WINDOW_TOTAL_LINES (XWINDOW (FVAR (f, tool_bar_window)))) { Lisp_Object window; int x = XFASTINT (inev.x); @@ -4490,7 +4490,7 @@ window = window_from_coordinates (f, x, y, 0, 1); - if (EQ (window, f->tool_bar_window)) + if (EQ (window, FVAR (f, tool_bar_window))) { w32_handle_tool_bar_click (f, &inev); tool_bar_p = 1; @@ -4935,7 +4935,7 @@ if (!FRAME_OBSCURED_P (f)) { DebPrint (("frame %p (%s) obscured\n", f, - SDATA (f->name))); + SDATA (FVAR (f, name)))); } } else @@ -4947,7 +4947,7 @@ { SET_FRAME_GARBAGED (f); DebPrint (("obscured frame %p (%s) found to be visible\n", f, - SDATA (f->name))); + SDATA (FVAR (f, name)))); /* Force a redisplay sooner or later. */ record_asynch_buffer_change (); @@ -5595,7 +5595,7 @@ SET_FRAME_GARBAGED (f); /* If cursor was outside the new size, mark it as off. */ - mark_window_cursors_off (XWINDOW (f->root_window)); + mark_window_cursors_off (XWINDOW (FVAR (f, root_window))); /* Clear out any recollection of where the mouse highlighting was, since it might be in a place that's outside the new frame size. === modified file 'src/window.c' --- src/window.c 2012-07-23 16:57:20 +0000 +++ src/window.c 2012-07-31 12:36:19 +0000 @@ -191,13 +191,13 @@ Lisp_Object window; if (NILP (frame_or_window)) - window = SELECTED_FRAME ()->root_window; + window = FVAR (SELECTED_FRAME (), root_window); else if (WINDOWP (frame_or_window)) - window = XFRAME (WINDOW_FRAME (XWINDOW (frame_or_window)))->root_window; + window = FVAR (XFRAME (WINDOW_FRAME (XWINDOW (frame_or_window))), root_window); else { CHECK_LIVE_FRAME (frame_or_window); - window = XFRAME (frame_or_window)->root_window; + window = FVAR (XFRAME (frame_or_window), root_window); } return window; @@ -235,13 +235,13 @@ Lisp_Object window; if (NILP (frame_or_window)) - window = SELECTED_FRAME ()->root_window; + window = FVAR (SELECTED_FRAME (), root_window); else if (WINDOWP (frame_or_window)) - window = XFRAME (WINDOW_FRAME (XWINDOW (frame_or_window)))->root_window; + window = FVAR (XFRAME (WINDOW_FRAME (XWINDOW (frame_or_window))), root_window); else { CHECK_LIVE_FRAME (frame_or_window); - window = XFRAME (frame_or_window)->root_window; + window = FVAR (XFRAME (frame_or_window), root_window); } while (NILP (XWINDOW (window)->buffer)) @@ -269,13 +269,14 @@ Lisp_Object window; if (NILP (frame_or_window)) - window = SELECTED_FRAME ()->selected_window; + window = FVAR (SELECTED_FRAME (), selected_window); else if (WINDOWP (frame_or_window)) - window = XFRAME (WINDOW_FRAME (XWINDOW (frame_or_window)))->selected_window; + window = FVAR (XFRAME (WINDOW_FRAME (XWINDOW (frame_or_window))), + selected_window); else { CHECK_LIVE_FRAME (frame_or_window); - window = XFRAME (frame_or_window)->selected_window; + window = FVAR (XFRAME (frame_or_window), selected_window); } return window; @@ -303,7 +304,7 @@ if (EQ (frame, selected_frame)) return Fselect_window (window, norecord); else - return XFRAME (frame)->selected_window = window; + return FVAR (XFRAME (frame), selected_window) = window; } DEFUN ("selected-window", Fselected_window, Sselected_window, 0, 0, 0, @@ -346,7 +347,7 @@ sf = SELECTED_FRAME (); if (XFRAME (WINDOW_FRAME (w)) != sf) { - XFRAME (WINDOW_FRAME (w))->selected_window = window; + FVAR (XFRAME (WINDOW_FRAME (w)), selected_window) = window; /* Use this rather than Fhandle_switch_frame so that FRAME_FOCUS_FRAME is moved appropriately as we move around in the state where a minibuffer in a separate @@ -357,7 +358,7 @@ return window; } else - sf->selected_window = window; + FVAR (sf, selected_window) = window; /* Store the current buffer's actual point into the old selected window. It belongs to that window, @@ -1219,13 +1220,13 @@ bar exists. */ if (NILP (window) && tool_bar_p - && WINDOWP (f->tool_bar_window) - && WINDOW_TOTAL_LINES (XWINDOW (f->tool_bar_window)) > 0 - && (coordinates_in_window (XWINDOW (f->tool_bar_window), x, y) + && WINDOWP (FVAR (f, tool_bar_window)) + && WINDOW_TOTAL_LINES (XWINDOW (FVAR (f, tool_bar_window))) > 0 + && (coordinates_in_window (XWINDOW (FVAR (f, tool_bar_window)), x, y) != ON_NOTHING)) { *part = ON_TEXT; - window = f->tool_bar_window; + window = FVAR (f, tool_bar_window); } return window; @@ -2319,7 +2320,7 @@ (Lisp_Object frame, Lisp_Object minibuf, Lisp_Object window) { if (NILP (window)) - window = FRAMEP (frame) ? XFRAME (frame)->selected_window : selected_window; + window = FRAMEP (frame) ? FVAR (XFRAME (frame), selected_window) : selected_window; CHECK_WINDOW (window); if (NILP (frame)) frame = selected_frame; @@ -3555,9 +3556,9 @@ void resize_frame_windows (struct frame *f, int size, int horflag) { - Lisp_Object root = f->root_window; + Lisp_Object root = FVAR (f, root_window); struct window *r = XWINDOW (root); - Lisp_Object mini = f->minibuffer_window; + Lisp_Object mini = FVAR (f, minibuffer_window); struct window *m; /* new_size is the new size of the frame's root window. */ int new_size = (horflag @@ -3603,7 +3604,7 @@ { /* We lost. Delete all windows but the frame's selected one. */ - root = f->selected_window; + root = FVAR (f, selected_window); Fdelete_other_windows_internal (root, Qnil); if (horflag) XSETFASTINT (XWINDOW (root)->total_cols, new_size); @@ -6464,8 +6465,8 @@ struct frame *f = make_initial_frame (); XSETFRAME (selected_frame, f); Vterminal_frame = selected_frame; - minibuf_window = f->minibuffer_window; - selected_window = f->selected_window; + minibuf_window = FVAR (f, minibuffer_window); + selected_window = FVAR (f, selected_window); last_nonminibuf_frame = f; window_initialized = 1; === modified file 'src/window.h' --- src/window.h 2012-07-05 15:20:12 +0000 +++ src/window.h 2012-07-31 12:36:19 +0000 @@ -460,14 +460,14 @@ /* 1 if W is a menu bar window. */ #define WINDOW_MENU_BAR_P(W) \ - (WINDOWP (WINDOW_XFRAME (W)->menu_bar_window) \ - && (W) == XWINDOW (WINDOW_XFRAME (W)->menu_bar_window)) + (WINDOWP (FVAR (WINDOW_XFRAME (W), menu_bar_window)) \ + && (W) == XWINDOW (FVAR (WINDOW_XFRAME (W), menu_bar_window))) /* 1 if W is a tool bar window. */ #define WINDOW_TOOL_BAR_P(W) \ - (WINDOWP (WINDOW_XFRAME (W)->tool_bar_window) \ - && (W) == XWINDOW (WINDOW_XFRAME (W)->tool_bar_window)) + (WINDOWP (FVAR (WINDOW_XFRAME (W), tool_bar_window)) \ + && (W) == XWINDOW (FVAR (WINDOW_XFRAME (W), tool_bar_window))) /* Return the frame y-position at which window W starts. This includes a header line, if any. */ === modified file 'src/xdisp.c' --- src/xdisp.c 2012-07-30 18:56:42 +0000 +++ src/xdisp.c 2012-07-31 12:36:19 +0000 @@ -10892,7 +10892,7 @@ /* 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); + ASET (vector, 8, FVAR (target_frame, selected_window)); if (FRAME_TERMCAP_P (target_frame)) ASET (vector, 9, FRAME_TTY (target_frame)->top_frame); } @@ -11052,13 +11052,13 @@ format_mode_line_unwind_data (f, current_buffer, selected_window, 0)); - Fselect_window (f->selected_window, Qt); - set_buffer_internal_1 (XBUFFER (XWINDOW (f->selected_window)->buffer)); + Fselect_window (FVAR (f, selected_window), Qt); + set_buffer_internal_1 (XBUFFER (XWINDOW (FVAR (f, selected_window))->buffer)); fmt = FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format; mode_line_target = MODE_LINE_TITLE; title_start = MODE_LINE_NOPROP_LEN (0); - init_iterator (&it, XWINDOW (f->selected_window), -1, -1, + init_iterator (&it, XWINDOW (FVAR (f, selected_window)), -1, -1, NULL, DEFAULT_FACE_ID); display_mode_element (&it, 0, -1, -1, fmt, Qnil, 0); len = MODE_LINE_NOPROP_LEN (title_start); @@ -11070,9 +11070,9 @@ already wasted too much time by walking through the list with display_mode_element, then we might need to optimize at a higher level than this.) */ - if (! STRINGP (f->name) - || SBYTES (f->name) != len - || memcmp (title, SDATA (f->name), len) != 0) + if (! STRINGP (FVAR (f, name)) + || SBYTES (FVAR (f, name)) != len + || memcmp (title, SDATA (FVAR (f, name)), len) != 0) x_implicitly_set_name (f, make_string (title, len), Qnil); } } @@ -11172,7 +11172,7 @@ if (windows_or_buffers_changed && FRAME_NS_P (f)) ns_set_doc_edited (f, Fbuffer_modified_p - (XWINDOW (f->selected_window)->buffer)); + (XWINDOW (FVAR (f, selected_window))->buffer)); #endif UNGCPRO; } @@ -11413,8 +11413,8 @@ #if defined (USE_GTK) || defined (HAVE_NS) int do_update = FRAME_EXTERNAL_TOOL_BAR (f); #else - int do_update = WINDOWP (f->tool_bar_window) - && WINDOW_TOTAL_LINES (XWINDOW (f->tool_bar_window)) > 0; + int do_update = WINDOWP (FVAR (f, tool_bar_window)) + && WINDOW_TOTAL_LINES (XWINDOW (FVAR (f, tool_bar_window))) > 0; #endif if (do_update) @@ -11475,18 +11475,18 @@ selected_frame = frame; /* Build desired tool-bar items from keymaps. */ - new_tool_bar = tool_bar_items (Fcopy_sequence (f->tool_bar_items), - &new_n_tool_bar); + new_tool_bar = tool_bar_items + (Fcopy_sequence (FVAR (f, tool_bar_items)), &new_n_tool_bar); /* Redisplay the tool-bar if we changed it. */ if (new_n_tool_bar != f->n_tool_bar_items - || NILP (Fequal (new_tool_bar, f->tool_bar_items))) + || NILP (Fequal (new_tool_bar, FVAR (f, tool_bar_items)))) { /* Redisplay that happens asynchronously due to an expose event may access f->tool_bar_items. Make sure we update both variables within BLOCK_INPUT so no such event interrupts. */ BLOCK_INPUT; - f->tool_bar_items = new_tool_bar; + FVAR (f, tool_bar_items) = new_tool_bar; f->n_tool_bar_items = new_n_tool_bar; w->update_mode_line = 1; UNBLOCK_INPUT; @@ -11519,22 +11519,22 @@ Otherwise, make a new string. */ /* The size of the string we might be able to reuse. */ - size = (STRINGP (f->desired_tool_bar_string) - ? SCHARS (f->desired_tool_bar_string) + size = (STRINGP (FVAR (f, desired_tool_bar_string)) + ? SCHARS (FVAR (f, desired_tool_bar_string)) : 0); /* We need one space in the string for each image. */ size_needed = f->n_tool_bar_items; /* Reuse f->desired_tool_bar_string, if possible. */ - if (size < size_needed || NILP (f->desired_tool_bar_string)) - f->desired_tool_bar_string = Fmake_string (make_number (size_needed), - make_number (' ')); + if (size < size_needed || NILP (FVAR (f, desired_tool_bar_string))) + FVAR (f, desired_tool_bar_string) + = Fmake_string (make_number (size_needed), make_number (' ')); else { props = list4 (Qdisplay, Qnil, Qmenu_item, Qnil); Fremove_text_properties (make_number (0), make_number (size), - props, f->desired_tool_bar_string); + props, FVAR (f, desired_tool_bar_string)); } /* Put a `display' property on the string for the images to display, @@ -11542,7 +11542,8 @@ is the index of the item in F's tool-bar item vector. */ for (i = 0; i < f->n_tool_bar_items; ++i) { -#define PROP(IDX) AREF (f->tool_bar_items, i * TOOL_BAR_ITEM_NSLOTS + (IDX)) +#define PROP(IDX) \ + AREF (FVAR (f, tool_bar_items), i * TOOL_BAR_ITEM_NSLOTS + (IDX)) int enabled_p = !NILP (PROP (TOOL_BAR_ITEM_ENABLED_P)); int selected_p = !NILP (PROP (TOOL_BAR_ITEM_SELECTED_P)); @@ -11651,11 +11652,11 @@ string. The string can be longer than needed when we reuse a previous string. */ if (i + 1 == f->n_tool_bar_items) - end = SCHARS (f->desired_tool_bar_string); + end = SCHARS (FVAR (f, desired_tool_bar_string)); else end = i + 1; Fadd_text_properties (make_number (i), make_number (end), - props, f->desired_tool_bar_string); + props, FVAR (f, desired_tool_bar_string)); #undef PROP } @@ -11805,7 +11806,7 @@ static int tool_bar_lines_needed (struct frame *f, int *n_rows) { - struct window *w = XWINDOW (f->tool_bar_window); + struct window *w = XWINDOW (FVAR (f, tool_bar_window)); struct it it; /* tool_bar_lines_needed is called from redisplay_tool_bar after building the desired matrix, so use (unused) mode-line row as temporary row to @@ -11817,7 +11818,7 @@ init_iterator (&it, w, -1, -1, temp_row, TOOL_BAR_FACE_ID); it.first_visible_x = 0; it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f); - reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); + reseat_to_string (&it, NULL, FVAR (f, desired_tool_bar_string), 0, 0, 0, -1); it.paragraph_embedding = L2R; while (!ITERATOR_AT_END_P (&it)) @@ -11851,8 +11852,8 @@ CHECK_FRAME (frame); f = XFRAME (frame); - if (WINDOWP (f->tool_bar_window) - && (w = XWINDOW (f->tool_bar_window), + if (WINDOWP (FVAR (f, tool_bar_window)) + && (w = XWINDOW (FVAR (f, tool_bar_window)), WINDOW_TOTAL_LINES (w) > 0)) { update_tool_bar (f, 1); @@ -11887,8 +11888,8 @@ do anything. This means you must start with tool-bar-lines non-zero to get the auto-sizing effect. Or in other words, you can turn off tool-bars by specifying tool-bar-lines zero. */ - if (!WINDOWP (f->tool_bar_window) - || (w = XWINDOW (f->tool_bar_window), + if (!WINDOWP (FVAR (f, tool_bar_window)) + || (w = XWINDOW (FVAR (f, tool_bar_window)), WINDOW_TOTAL_LINES (w) == 0)) return 0; @@ -11900,7 +11901,7 @@ /* Build a string that represents the contents of the tool-bar. */ build_desired_tool_bar_string (f); - reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); + reseat_to_string (&it, NULL, FVAR (f, desired_tool_bar_string), 0, 0, 0, -1); /* FIXME: This should be controlled by a user option. But it doesn't make sense to have an R2L tool bar if the menu bar cannot be drawn also R2L, and making the menu bar R2L is tricky due @@ -12057,14 +12058,14 @@ /* This function can be called asynchronously, which means we must exclude any possibility that Fget_text_property signals an error. */ - charpos = min (SCHARS (f->current_tool_bar_string), glyph->charpos); + charpos = min (SCHARS (FVAR (f, current_tool_bar_string)), glyph->charpos); charpos = max (0, charpos); /* Get the text property `menu-item' at pos. The value of that property is the start index of this item's properties in F->tool_bar_items. */ prop = Fget_text_property (make_number (charpos), - Qmenu_item, f->current_tool_bar_string); + Qmenu_item, FVAR (f, current_tool_bar_string)); if (INTEGERP (prop)) { *prop_idx = XINT (prop); @@ -12092,7 +12093,7 @@ int *hpos, int *vpos, int *prop_idx) { Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); - struct window *w = XWINDOW (f->tool_bar_window); + struct window *w = XWINDOW (FVAR (f, tool_bar_window)); int area; /* Find the glyph under X/Y. */ @@ -12106,7 +12107,7 @@ return -1; /* Is mouse on the highlighted item? */ - if (EQ (f->tool_bar_window, hlinfo->mouse_face_window) + if (EQ (FVAR (f, tool_bar_window), hlinfo->mouse_face_window) && *vpos >= hlinfo->mouse_face_beg_row && *vpos <= hlinfo->mouse_face_end_row && (*vpos > hlinfo->mouse_face_beg_row @@ -12131,7 +12132,7 @@ int modifiers) { Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); - struct window *w = XWINDOW (f->tool_bar_window); + struct window *w = XWINDOW (FVAR (f, tool_bar_window)); int hpos, vpos, prop_idx; struct glyph *glyph; Lisp_Object enabled_p; @@ -12142,7 +12143,7 @@ return; /* If item is disabled, do nothing. */ - enabled_p = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_ENABLED_P); + enabled_p = AREF (FVAR (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_ENABLED_P); if (NILP (enabled_p)) return; @@ -12163,7 +12164,7 @@ show_mouse_face (hlinfo, DRAW_IMAGE_RAISED); hlinfo->mouse_face_image_state = DRAW_IMAGE_RAISED; - key = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_KEY); + key = AREF (FVAR (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_KEY); XSETFRAME (frame, f); event.kind = TOOL_BAR_EVENT; @@ -12188,7 +12189,7 @@ static void note_tool_bar_highlight (struct frame *f, int x, int y) { - Lisp_Object window = f->tool_bar_window; + Lisp_Object window = FVAR (f, tool_bar_window); struct window *w = XWINDOW (window); Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); @@ -12234,7 +12235,7 @@ draw = mouse_down_p ? DRAW_IMAGE_SUNKEN : DRAW_IMAGE_RAISED; /* If tool-bar item is not enabled, don't highlight it. */ - enabled_p = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_ENABLED_P); + enabled_p = AREF (FVAR (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_ENABLED_P); if (!NILP (enabled_p)) { /* Compute the x-position of the glyph. In front and past the @@ -12268,9 +12269,9 @@ XTread_socket does the rest. */ help_echo_object = help_echo_window = Qnil; help_echo_pos = -1; - help_echo_string = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_HELP); + help_echo_string = AREF (FVAR (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_HELP); if (NILP (help_echo_string)) - help_echo_string = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_CAPTION); + help_echo_string = AREF (FVAR (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_CAPTION); } #endif /* HAVE_WINDOW_SYSTEM */ @@ -12851,7 +12852,8 @@ selected_frame = frame; do { - for (tail = XFRAME (frame)->param_alist; CONSP (tail); tail = XCDR (tail)) + for (tail = FVAR (XFRAME (frame), param_alist); + CONSP (tail); tail = XCDR (tail)) if (CONSP (XCAR (tail)) && (tem = XCAR (XCAR (tail)), SYMBOLP (tem)) @@ -13424,7 +13426,7 @@ if (!f->already_hscrolled_p) { f->already_hscrolled_p = 1; - if (hscroll_windows (f->root_window)) + if (hscroll_windows (FVAR (f, root_window))) goto retry; } @@ -13437,7 +13439,7 @@ STOP_POLLING; /* Update the display. */ - set_window_update_flags (XWINDOW (f->root_window), 1); + set_window_update_flags (XWINDOW (FVAR (f, root_window)), 1); pending |= update_frame (f, 0, 0); f->updated_p = 1; } @@ -13450,7 +13452,8 @@ and selected_window to be temporarily out-of-sync but let's make sure this stays contained. */ select_frame_for_redisplay (old_frame); - eassert (EQ (XFRAME (selected_frame)->selected_window, selected_window)); + eassert (EQ (FVAR (XFRAME (selected_frame), selected_window), + selected_window)); if (!pending) { @@ -13462,7 +13465,7 @@ struct frame *f = XFRAME (frame); if (f->updated_p) { - mark_window_display_accurate (f->root_window, 1); + mark_window_display_accurate (FVAR (f, root_window), 1); if (FRAME_TERMINAL (f)->frame_up_to_date_hook) FRAME_TERMINAL (f)->frame_up_to_date_hook (f); } @@ -16158,7 +16161,7 @@ if (FRAME_EXTERNAL_TOOL_BAR (f)) redisplay_tool_bar (f); #else - if (WINDOWP (f->tool_bar_window) + if (WINDOWP (FVAR (f, tool_bar_window)) && (FRAME_TOOL_BAR_LINES (f) > 0 || !NILP (Vauto_resize_tool_bars)) && redisplay_tool_bar (f)) @@ -18113,7 +18116,7 @@ (Lisp_Object row, Lisp_Object glyphs) { struct frame *sf = SELECTED_FRAME (); - struct glyph_matrix *m = XWINDOW (sf->tool_bar_window)->current_matrix; + struct glyph_matrix *m = XWINDOW (FVAR (sf, tool_bar_window))->current_matrix; EMACS_INT vpos; CHECK_NUMBER (row); @@ -20098,8 +20101,8 @@ /* Menu bar lines are displayed in the desired matrix of the dummy window menu_bar_window. */ struct window *menu_w; - eassert (WINDOWP (f->menu_bar_window)); - menu_w = XWINDOW (f->menu_bar_window); + eassert (WINDOWP (FVAR (f, menu_bar_window))); + menu_w = XWINDOW (FVAR (f, menu_bar_window)); init_iterator (&it, menu_w, -1, -1, menu_w->desired_matrix->rows, MENU_FACE_ID); it.first_visible_x = 0; @@ -21403,10 +21406,10 @@ case 'F': /* %F displays the frame name. */ - if (!NILP (f->title)) - return SSDATA (f->title); + if (!NILP (FVAR (f, title))) + return SSDATA (FVAR (f, title)); if (f->explicit_name || ! FRAME_WINDOW_P (f)) - return SSDATA (f->name); + return SSDATA (FVAR (f, name)); return "Emacs"; case 'f': @@ -25570,7 +25573,7 @@ } /* Detect a nonselected window or nonselected frame. */ - else if (w != XWINDOW (f->selected_window) + else if (w != XWINDOW (FVAR (f, selected_window)) || f != FRAME_X_DISPLAY_INFO (f)->x_highlight_frame) { *active_cursor = 0; @@ -26112,7 +26115,7 @@ void x_update_cursor (struct frame *f, int on_p) { - update_cursor_in_window_tree (XWINDOW (f->root_window), on_p); + update_cursor_in_window_tree (XWINDOW (FVAR (f, root_window)), on_p); } @@ -26271,7 +26274,7 @@ if (FRAME_WINDOW_P (f)) { if (draw == DRAW_NORMAL_TEXT - && !EQ (hlinfo->mouse_face_window, f->tool_bar_window)) + && !EQ (hlinfo->mouse_face_window, FVAR (f, tool_bar_window))) FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->text_cursor); else if (draw == DRAW_MOUSE_FACE) FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->hand_cursor); @@ -27627,7 +27630,7 @@ #ifdef HAVE_WINDOW_SYSTEM /* Handle tool-bar window differently since it doesn't display a buffer. */ - if (EQ (window, f->tool_bar_window)) + if (EQ (window, FVAR (f, tool_bar_window))) { note_tool_bar_highlight (f, x, y); return; @@ -28537,18 +28540,18 @@ } TRACE ((stderr, "(%d, %d, %d, %d)\n", r.x, r.y, r.width, r.height)); - mouse_face_overwritten_p = expose_window_tree (XWINDOW (f->root_window), &r); + mouse_face_overwritten_p = expose_window_tree (XWINDOW (FVAR (f, root_window)), &r); - if (WINDOWP (f->tool_bar_window)) + if (WINDOWP (FVAR (f, tool_bar_window))) mouse_face_overwritten_p - |= expose_window (XWINDOW (f->tool_bar_window), &r); + |= expose_window (XWINDOW (FVAR (f, tool_bar_window)), &r); #ifdef HAVE_X_WINDOWS #ifndef MSDOS #ifndef USE_X_TOOLKIT - if (WINDOWP (f->menu_bar_window)) + if (WINDOWP (FVAR (f, menu_bar_window))) mouse_face_overwritten_p - |= expose_window (XWINDOW (f->menu_bar_window), &r); + |= expose_window (XWINDOW (FVAR (f, menu_bar_window)), &r); #endif /* not USE_X_TOOLKIT */ #endif #endif === modified file 'src/xfaces.c' --- src/xfaces.c 2012-07-30 06:43:46 +0000 +++ src/xfaces.c 2012-07-31 12:36:19 +0000 @@ -2051,7 +2051,7 @@ Lisp_Object lface; if (f) - lface = assq_no_quit (face_name, f->face_alist); + lface = assq_no_quit (face_name, FVAR (f, face_alist)); else lface = assq_no_quit (face_name, Vface_new_frame_defaults); @@ -2678,7 +2678,8 @@ lface = Fmake_vector (make_number (LFACE_VECTOR_SIZE), Qunspecified); ASET (lface, 0, Qface); - f->face_alist = Fcons (Fcons (face, lface), f->face_alist); + FVAR (f, face_alist) = Fcons (Fcons (face, lface), FVAR (f, + face_alist)); } else for (i = 1; i < LFACE_VECTOR_SIZE; ++i) @@ -3357,7 +3358,7 @@ /* If there are no faces yet, give up. This is the case when called from Fx_create_frame, and we do the necessary things later in face-set-after-frame-defaults. */ - if (NILP (f->face_alist)) + if (NILP (FVAR (f, face_alist))) return; if (EQ (param, Qforeground_color)) @@ -4043,7 +4044,7 @@ (Lisp_Object frame) { struct frame *f = frame_or_selected_frame (frame, 0); - return f->face_alist; + return FVAR (f, face_alist); } @@ -4334,7 +4335,7 @@ matrices as invalid because they will reference faces freed above. This function is also called when a frame is destroyed. In this case, the root window of F is nil. */ - if (WINDOWP (f->root_window)) + if (WINDOWP (FVAR (f, root_window))) { clear_current_matrices (f); ++windows_or_buffers_changed; @@ -5107,7 +5108,7 @@ { frame = XCAR (fl_tail); if (!NILP (Fequal (Fcdr (Fassq (Qdisplay, - XFRAME (frame)->param_alist)), + FVAR (XFRAME (frame), param_alist))), display))) break; } @@ -5403,7 +5404,7 @@ { /* This function is called so early that colors are not yet set in the frame parameter list. */ - Lisp_Object color = Fassq (Qforeground_color, f->param_alist); + Lisp_Object color = Fassq (Qforeground_color, FVAR (f, param_alist)); if (CONSP (color) && STRINGP (XCDR (color))) LFACE_FOREGROUND (lface) = XCDR (color); @@ -5419,7 +5420,7 @@ { /* This function is called so early that colors are not yet set in the frame parameter list. */ - Lisp_Object color = Fassq (Qbackground_color, f->param_alist); + Lisp_Object color = Fassq (Qbackground_color, FVAR (f, param_alist)); if (CONSP (color) && STRINGP (XCDR (color))) LFACE_BACKGROUND (lface) = XCDR (color); else if (FRAME_WINDOW_P (f)) === modified file 'src/xfns.c' --- src/xfns.c 2012-07-31 11:37:38 +0000 +++ src/xfns.c 2012-07-31 12:36:19 +0000 @@ -665,7 +665,7 @@ #ifdef USE_GTK if (xg_change_toolbar_position (f, new_value)) - f->tool_bar_position = new_value; + FVAR (f, tool_bar_position) = new_value; #endif } @@ -1123,9 +1123,9 @@ BLOCK_INPUT; if (NILP (arg)) result = x_text_icon (f, - SSDATA ((!NILP (f->icon_name) - ? f->icon_name - : f->name))); + SSDATA ((!NILP (FVAR (f, icon_name)) + ? FVAR (f, icon_name) + : FVAR (f, name)))); else result = x_bitmap_icon (f, arg); @@ -1152,7 +1152,7 @@ else if (!NILP (arg) || NILP (oldval)) return; - f->icon_name = arg; + FVAR (f, icon_name) = arg; if (f->output_data.x->icon_bitmap != 0) return; @@ -1160,11 +1160,11 @@ BLOCK_INPUT; result = x_text_icon (f, - SSDATA ((!NILP (f->icon_name) - ? f->icon_name - : !NILP (f->title) - ? f->title - : f->name))); + SSDATA ((!NILP (FVAR (f, icon_name)) + ? FVAR (f, icon_name) + : !NILP (FVAR (f, title)) + ? FVAR (f, title) + : FVAR (f, name)))); if (result) { @@ -1352,8 +1352,8 @@ UNBLOCK_INPUT; } - if (WINDOWP (f->tool_bar_window)) - clear_glyph_matrix (XWINDOW (f->tool_bar_window)->current_matrix); + if (WINDOWP (FVAR (f, tool_bar_window))) + clear_glyph_matrix (XWINDOW (FVAR (f, tool_bar_window))->current_matrix); } run_window_configuration_change_hook (f); @@ -1548,7 +1548,7 @@ if (text.nitems != bytes) error ("Window name too large"); - if (!STRINGP (f->icon_name)) + if (!STRINGP (FVAR (f, icon_name))) { icon = text; encoded_icon_name = encoded_name; @@ -1556,7 +1556,7 @@ else { /* See the above comment "Note: Encoding strategy". */ - icon.value = x_encode_text (f->icon_name, coding_system, 0, + icon.value = x_encode_text (FVAR (f, icon_name), coding_system, 0, &bytes, &stringp, &do_free_icon_value); icon.encoding = (stringp ? XA_STRING : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT); @@ -1565,7 +1565,7 @@ if (icon.nitems != bytes) error ("Icon name too large"); - encoded_icon_name = ENCODE_UTF_8 (f->icon_name); + encoded_icon_name = ENCODE_UTF_8 (FVAR (f, icon_name)); } #ifdef USE_GTK @@ -1632,7 +1632,7 @@ /* Check for no change needed in this very common case before we do any consing. */ if (!strcmp (FRAME_X_DISPLAY_INFO (f)->x_id_name, - SSDATA (f->name))) + SSDATA (FVAR (f, name)))) return; name = build_string (FRAME_X_DISPLAY_INFO (f)->x_id_name); } @@ -1640,15 +1640,15 @@ CHECK_STRING (name); /* Don't change the name if it's already NAME. */ - if (! NILP (Fstring_equal (name, f->name))) + if (! NILP (Fstring_equal (name, FVAR (f, name)))) return; - f->name = name; + FVAR (f, name) = name; /* For setting the frame title, the title parameter should override the name parameter. */ - if (! NILP (f->title)) - name = f->title; + if (! NILP (FVAR (f, title))) + name = FVAR (f, title); x_set_name_internal (f, name); } @@ -1678,15 +1678,15 @@ x_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name) { /* Don't change the title if it's already NAME. */ - if (EQ (name, f->title)) + if (EQ (name, FVAR (f, title))) return; update_mode_lines = 1; - f->title = name; + FVAR (f, title) = name; if (NILP (name)) - name = f->name; + name = FVAR (f, name); else CHECK_STRING (name); @@ -2571,8 +2571,8 @@ int explicit = f->explicit_name; f->explicit_name = 0; - name = f->name; - f->name = Qnil; + name = FVAR (f, name); + FVAR (f, name) = Qnil; x_set_name (f, name, explicit); } @@ -2714,8 +2714,8 @@ int explicit = f->explicit_name; f->explicit_name = 0; - name = f->name; - f->name = Qnil; + name = FVAR (f, name); + FVAR (f, name) = Qnil; x_set_name (f, name, explicit); } @@ -2791,9 +2791,9 @@ : NormalState)); #endif - x_text_icon (f, SSDATA ((!NILP (f->icon_name) - ? f->icon_name - : f->name))); + x_text_icon (f, SSDATA ((!NILP (FVAR (f, icon_name)) + ? FVAR (f, icon_name) + : FVAR (f, name)))); UNBLOCK_INPUT; } @@ -3135,11 +3135,11 @@ f->output_data.x->scroll_bar_bottom_shadow_pixel = -1; #endif /* USE_TOOLKIT_SCROLL_BARS */ - f->icon_name + FVAR (f, icon_name) = x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title", RES_TYPE_STRING); - if (! STRINGP (f->icon_name)) - f->icon_name = Qnil; + if (! STRINGP (FVAR (f, icon_name))) + FVAR (f, icon_name) = Qnil; FRAME_X_DISPLAY_INFO (f) = dpyinfo; @@ -3196,12 +3196,12 @@ be set. */ if (EQ (name, Qunbound) || NILP (name)) { - f->name = build_string (dpyinfo->x_id_name); + FVAR (f, name) = build_string (dpyinfo->x_id_name); f->explicit_name = 0; } else { - f->name = name; + FVAR (f, name) = name; f->explicit_name = 1; /* use the frame's title when getting resources for this frame. */ specbind (Qx_resource_name, name); @@ -3340,7 +3340,7 @@ x_default_parameter (f, parms, Qfullscreen, Qnil, "fullscreen", "Fullscreen", RES_TYPE_SYMBOL); x_default_parameter (f, parms, Qtool_bar_position, - f->tool_bar_position, 0, 0, RES_TYPE_SYMBOL); + FVAR (f, tool_bar_position), 0, 0, RES_TYPE_SYMBOL); /* Compute the size of the X window. */ window_prompting = x_figure_window_size (f, parms, 1); @@ -3468,7 +3468,7 @@ by x_get_arg and friends, now go in the misc. alist of the frame. */ for (tem = parms; CONSP (tem); tem = XCDR (tem)) if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem)))) - f->param_alist = Fcons (XCAR (tem), f->param_alist); + FVAR (f, param_alist) = Fcons (XCAR (tem), FVAR (f, param_alist)); UNGCPRO; @@ -4621,7 +4621,7 @@ f->output_data.x->scroll_bar_top_shadow_pixel = -1; f->output_data.x->scroll_bar_bottom_shadow_pixel = -1; #endif /* USE_TOOLKIT_SCROLL_BARS */ - f->icon_name = Qnil; + FVAR (f, icon_name) = Qnil; FRAME_X_DISPLAY_INFO (f) = dpyinfo; f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window; f->output_data.x->explicit_parent = 0; @@ -4663,12 +4663,12 @@ be set. */ if (EQ (name, Qunbound) || NILP (name)) { - f->name = build_string (dpyinfo->x_id_name); + FVAR (f, name) = build_string (dpyinfo->x_id_name); f->explicit_name = 0; } else { - f->name = name; + FVAR (f, name) = name; f->explicit_name = 1; /* use the frame's title when getting resources for this frame. */ specbind (Qx_resource_name, name); === modified file 'src/xmenu.c' --- src/xmenu.c 2012-07-19 11:39:38 +0000 +++ src/xmenu.c 2012-07-31 12:36:19 +0000 @@ -835,7 +835,7 @@ if (!f) return; find_and_call_menu_selection (f, f->menu_bar_items_used, - f->menu_bar_vector, client_data); + FVAR (f, menu_bar_vector), client_data); } #endif /* not USE_GTK */ @@ -1014,14 +1014,14 @@ /* Save the frame's previous menu bar contents data. */ if (previous_menu_items_used) - memcpy (previous_items, XVECTOR (f->menu_bar_vector)->contents, + memcpy (previous_items, XVECTOR (FVAR (f, menu_bar_vector))->contents, previous_menu_items_used * sizeof (Lisp_Object)); /* Fill in menu_items with the current menu bar contents. This can evaluate Lisp code. */ save_menu_items (); - menu_items = f->menu_bar_vector; + menu_items = FVAR (f, menu_bar_vector); menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0; subitems = ASIZE (items) / 4; submenu_start = alloca ((subitems + 1) * sizeof *submenu_start); @@ -1100,7 +1100,7 @@ } /* The menu items are different, so store them in the frame. */ - f->menu_bar_vector = menu_items; + FVAR (f, menu_bar_vector) = menu_items; f->menu_bar_items_used = menu_items_used; /* This undoes save_menu_items. */ === modified file 'src/xterm.c' --- src/xterm.c 2012-07-31 11:37:38 +0000 +++ src/xterm.c 2012-07-31 12:36:19 +0000 @@ -6357,7 +6357,7 @@ mouse highlighting. */ if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight) && (f == 0 - || !EQ (f->tool_bar_window, hlinfo->mouse_face_window))) + || !EQ (FVAR (f, tool_bar_window), hlinfo->mouse_face_window))) { clear_mouse_face (hlinfo); hlinfo->mouse_face_hidden = 1; @@ -6904,15 +6904,15 @@ if (f) { /* Is this in the tool-bar? */ - if (WINDOWP (f->tool_bar_window) - && WINDOW_TOTAL_LINES (XWINDOW (f->tool_bar_window))) + if (WINDOWP (FVAR (f, tool_bar_window)) + && WINDOW_TOTAL_LINES (XWINDOW (FVAR (f, tool_bar_window)))) { Lisp_Object window; int x = event.xbutton.x; int y = event.xbutton.y; window = window_from_coordinates (f, x, y, 0, 1); - tool_bar_p = EQ (window, f->tool_bar_window); + tool_bar_p = EQ (window, FVAR (f, tool_bar_window)); if (tool_bar_p && event.xbutton.button < 4) { @@ -7503,7 +7503,7 @@ } #ifdef HAVE_X_I18N - if (w == XWINDOW (f->selected_window)) + if (w == XWINDOW (FVAR (f, selected_window))) if (FRAME_XIC (f) && (FRAME_XIC_STYLE (f) & XIMPreeditPosition)) xic_set_preeditarea (w, x, y); #endif @@ -8154,7 +8154,7 @@ xic_set_statusarea (f); if (FRAME_XIC_STYLE (f) & XIMPreeditPosition) { - struct window *w = XWINDOW (f->selected_window); + struct window *w = XWINDOW (FVAR (f, selected_window)); xic_set_preeditarea (w, w->cursor.x, w->cursor.y); } } @@ -8942,7 +8942,7 @@ #endif /* not USE_GTK */ /* If cursor was outside the new size, mark it as off. */ - mark_window_cursors_off (XWINDOW (f->root_window)); + mark_window_cursors_off (XWINDOW (FVAR (f, root_window))); /* Clear out any recollection of where the mouse highlighting was, since it might be in a place that's outside the new frame size. @@ -10399,13 +10399,10 @@ connection = ConnectionNumber (dpyinfo->display); dpyinfo->connection = connection; - - { - dpyinfo->gray - = XCreatePixmapFromBitmapData (dpyinfo->display, dpyinfo->root_window, - gray_bits, gray_width, gray_height, - 1, 0, 1); - } + dpyinfo->gray + = XCreatePixmapFromBitmapData (dpyinfo->display, dpyinfo->root_window, + gray_bits, gray_width, gray_height, + 1, 0, 1); #ifdef HAVE_X_I18N xim_initialize (dpyinfo, resource_name); ------------------------------------------------------------ revno: 109326 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2012-07-31 15:37:38 +0400 message: Miscellaneous fixes for non-default X toolkits. * configure.ac (MOTIF): Check for /usr/include/openmotif and /usr/(lib|lib64)/openmotif if --with-x-toolkit=motif. * lwlib/lwlib-Xm.c (make_menu_in_widget): Remove unused variable. * src/xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings. * src/xterm.c (x_frame_of_widget): Remove redundant prototype. Move under #ifdef USE_LUCID. (x_create_toolkit_scroll_bar): Adjust scroll_bar_name definition and usage to avoid warnings. diff: === modified file 'ChangeLog' --- ChangeLog 2012-07-31 07:58:08 +0000 +++ ChangeLog 2012-07-31 11:37:38 +0000 @@ -1,3 +1,9 @@ +2012-07-31 Dmitry Antipov + + Improve OpenMotif detection on GNU/Linux systems. + * configure.ac (MOTIF): Check for /usr/include/openmotif + and /usr/(lib|lib64)/openmotif if --with-x-toolkit=motif. + 2012-07-31 Andreas Schwab * Makefile.in (install-arch-indep): Avoid eval. === modified file 'configure.ac' --- configure.ac 2012-07-31 06:52:13 +0000 +++ configure.ac 2012-07-31 11:37:38 +0000 @@ -2139,7 +2139,21 @@ LIBXP= if test "${USE_X_TOOLKIT}" = "MOTIF"; then - AC_CACHE_CHECK(for Motif version 2.1, emacs_cv_motif_version_2_1, + # OpenMotif may be installed in such a way on some GNU/Linux systems. + if test -d /usr/include/openmotif; then + CPPFLAGS="-I/usr/include/openmotif $CPPFLAGS" + emacs_cv_openmotif=yes + case "$canonical" in + x86_64-*-linux-gnu* | powerpc64-*-linux-gnu* | sparc64-*-linux-gnu*) + test -d /usr/lib64/openmotif && LDFLAGS="-L/usr/lib64/openmotif $LDFLAGS" + ;; + *) + test -d /usr/lib/openmotif && LDFLAGS="-L/usr/lib/openmotif $LDFLAGS" + esac + else + emacs_cv_openmotif=no + fi + AC_CACHE_CHECK(for (Open)Motif version 2.1, emacs_cv_motif_version_2_1, [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[#if XmVERSION > 2 || (XmVERSION == 2 && XmREVISION >= 1) int x = 5; @@ -2149,6 +2163,9 @@ emacs_cv_motif_version_2_1=yes, emacs_cv_motif_version_2_1=no)]) if test $emacs_cv_motif_version_2_1 = yes; then AC_CHECK_LIB(Xp, XpCreateContext, LIBXP=-lXp) + if test x$emacs_cv_openmotif = xyes; then + REAL_CPPFLAGS="-I/usr/include/openmotif $REAL_CPPFLAGS" + fi else AC_CACHE_CHECK(for LessTif where some systems put it, emacs_cv_lesstif, # We put this in CFLAGS temporarily to precede other -I options === modified file 'lwlib/ChangeLog' --- lwlib/ChangeLog 2012-07-14 02:08:32 +0000 +++ lwlib/ChangeLog 2012-07-31 11:37:38 +0000 @@ -1,3 +1,8 @@ +2012-07-31 Dmitry Antipov + + Avoid unused variable warning if --with-x-toolkit=motif. + * lwlib-Xm.c (make_menu_in_widget): Remove unused variable. + 2012-07-06 Paul Eggert Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786). === modified file 'lwlib/lwlib-Xm.c' --- lwlib/lwlib-Xm.c 2012-06-26 01:05:39 +0000 +++ lwlib/lwlib-Xm.c 2012-07-31 11:37:38 +0000 @@ -490,7 +490,6 @@ int child_index; widget_value* cur; Widget button = 0; - Widget title = 0; Widget menu; Arg al [256]; int ac; @@ -554,7 +553,7 @@ { ac = 0; XtSetArg (al[ac], XmNalignment, XmALIGNMENT_CENTER); ac++; - title = button = XmCreateLabel (widget, cur->name, al, ac); + button = XmCreateLabel (widget, cur->name, al, ac); } else if (lw_separator_p (cur->name, &separator, 1)) { === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-31 07:42:43 +0000 +++ src/ChangeLog 2012-07-31 11:37:38 +0000 @@ -1,3 +1,12 @@ +2012-07-31 Dmitry Antipov + + Miscellaneous fixes for non-default X toolkits. + * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings. + * xterm.c (x_frame_of_widget): Remove redundant prototype. + Move under #ifdef USE_LUCID. + (x_create_toolkit_scroll_bar): Adjust scroll_bar_name + definition and usage to avoid warnings. + 2012-07-31 Jan Djärv * nsterm.m (openFiles): Fix previous checkin. === modified file 'src/xfns.c' --- src/xfns.c 2012-07-27 09:24:34 +0000 +++ src/xfns.c 2012-07-31 11:37:38 +0000 @@ -5382,7 +5382,7 @@ /* Create the dialog with PROMPT as title, using DIR as initial directory and using "*" as pattern. */ dir = Fexpand_file_name (dir, Qnil); - dir_xmstring = XmStringCreateLocalized (SDATA (dir)); + dir_xmstring = XmStringCreateLocalized (SSDATA (dir)); pattern_xmstring = XmStringCreateLocalized ("*"); XtSetArg (al[ac], XmNtitle, SDATA (prompt)); ++ac; @@ -5435,12 +5435,12 @@ XmTextPosition last_pos = XmTextFieldGetLastPosition (wtext); XmTextFieldReplace (wtext, 0, last_pos, - (SDATA (Ffile_name_nondirectory (default_filename)))); + (SSDATA (Ffile_name_nondirectory (default_filename)))); /* Select DEFAULT_FILENAME in the files list box. DEFAULT_FILENAME must include the path for this to work. */ - default_xmstring = XmStringCreateLocalized (SDATA (default_filename)); + default_xmstring = XmStringCreateLocalized (SSDATA (default_filename)); if (XmListItemExists (list, default_xmstring)) { === modified file 'src/xterm.c' --- src/xterm.c 2012-07-10 23:24:36 +0000 +++ src/xterm.c 2012-07-31 11:37:38 +0000 @@ -1438,12 +1438,12 @@ #ifdef USE_X_TOOLKIT -static struct frame *x_frame_of_widget (Widget); static Boolean cvt_string_to_pixel (Display *, XrmValue *, Cardinal *, XrmValue *, XrmValue *, XtPointer *); static void cvt_pixel_dtor (XtAppContext, XrmValue *, XtPointer, XrmValue *, Cardinal *); +#ifdef USE_LUCID /* Return the frame on which widget WIDGET is used.. Abort if frame cannot be determined. */ @@ -1478,9 +1478,6 @@ abort (); } - -#ifdef USE_LUCID - /* Allocate a color which is lighter or darker than *PIXEL by FACTOR or DELTA. Try a color with RGB values multiplied by FACTOR first. If this produces the same color as PIXEL, try a color where all RGB @@ -1496,7 +1493,7 @@ return x_alloc_lighter_color (f, display, cmap, pixel, factor, delta); } -#endif +#endif /* USE_LUCID */ /* Structure specifying which arguments should be passed by Xt to @@ -4635,7 +4632,7 @@ Widget widget; Arg av[20]; int ac = 0; - char const *scroll_bar_name = SCROLL_BAR_NAME; + const char *scroll_bar_name = SCROLL_BAR_NAME; unsigned long pixel; BLOCK_INPUT; @@ -4665,7 +4662,7 @@ } widget = XmCreateScrollBar (f->output_data.x->edit_widget, - scroll_bar_name, av, ac); + (char *) scroll_bar_name, av, ac); /* Add one callback for everything that can happen. */ XtAddCallback (widget, XmNdecrementCallback, xm_scroll_callback, ------------------------------------------------------------ revno: 109325 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-07-31 06:17:40 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/config.in' --- autogen/config.in 2012-07-29 10:19:06 +0000 +++ autogen/config.in 2012-07-31 10:17:40 +0000 @@ -1246,6 +1246,9 @@ /* Make process_send_signal work by "typing" a signal character on the pty. */ #undef SIGNALS_VIA_CHARACTERS +/* Define if AH_BOTTOM should include signal.h. */ +#undef SIGNAL_H_AHB + /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type 'sig_atomic_t'. */ #undef SIG_ATOMIC_T_SUFFIX @@ -1295,6 +1298,9 @@ /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME +/* Some platforms redefine this. */ +#undef TIOCSIGSEND + /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME @@ -1342,6 +1348,9 @@ /* Define if the system is compatible with System V. */ #undef USG5 +/* Define if the system is compatible with System V Release 4. */ +#undef USG5_4 + /* Define for USG systems where it works to open a pty's tty in the parent process, then close and reopen it in the child. */ #undef USG_SUBTTY_WORKS @@ -1372,6 +1381,9 @@ # endif #endif +/* Some platforms redefine this. */ +#undef WRETCODE + /* Define this to check for malloc buffer overrun. */ #undef XMALLOC_OVERRUN_CHECK @@ -1473,6 +1485,12 @@ declarations. Define as empty for no equivalent. */ #undef __restrict_arr +/* Some platforms redefine this. */ +#undef _longjmp + +/* Some platforms redefine this. */ +#undef _setjmp + /* Define to the used os dependent file. */ #undef config_opsysfile @@ -1575,102 +1593,10 @@ /* Define as `fork' if `vfork' does not work. */ #undef vfork - -/* On AIX 3 this must be included before any other include file. */ -#include -#if ! HAVE_ALLOCA -# error "alloca not available on this machine" -#endif - -/* This silences a few compilation warnings on FreeBSD. */ -#ifdef BSD_SYSTEM_AHB -#undef BSD_SYSTEM_AHB -#undef BSD_SYSTEM -#if __FreeBSD__ == 1 -#define BSD_SYSTEM 199103 -#elif __FreeBSD__ == 2 -#define BSD_SYSTEM 199306 -#elif __FreeBSD__ >= 3 -#define BSD_SYSTEM 199506 -#endif -#endif - -/* Define AMPERSAND_FULL_NAME if you use the convention - that & in the full name stands for the login id. */ -/* Turned on June 1996 supposing nobody will mind it. */ -#define AMPERSAND_FULL_NAME - -/* `subprocesses' should be defined if you want to - have code for asynchronous subprocesses - (as used in M-x compile and M-x shell). - Only MSDOS does not support this (it overrides - this in its config_opsysfile below). */ - -#define subprocesses - -/* Include the os dependent file. */ -#ifdef config_opsysfile -# include config_opsysfile -#endif - -/* Mac OS X / GNUstep need a bit more pure memory. Of the existing knobs, - SYSTEM_PURESIZE_EXTRA seems like the least likely to cause problems. */ -#ifdef HAVE_NS -#if defined NS_IMPL_GNUSTEP -# define SYSTEM_PURESIZE_EXTRA 30000 -#elif defined DARWIN_OS -# define SYSTEM_PURESIZE_EXTRA 200000 -#endif -#endif - -#ifdef emacs /* Don't do this for lib-src. */ -/* Tell regex.c to use a type compatible with Emacs. */ -#define RE_TRANSLATE_TYPE Lisp_Object -#define RE_TRANSLATE(TBL, C) CHAR_TABLE_TRANSLATE (TBL, C) -#ifdef make_number -/* If make_number is a macro, use it. */ -#define RE_TRANSLATE_P(TBL) (!EQ (TBL, make_number (0))) -#else -/* If make_number is a function, avoid it. */ -#define RE_TRANSLATE_P(TBL) (!(INTEGERP (TBL) && XINT (TBL) == 0)) -#endif -#endif - -#include -#include - -#if __GNUC__ >= 3 /* On GCC 3.0 we might get a warning. */ -#define NO_INLINE __attribute__((noinline)) -#else -#define NO_INLINE -#endif - -#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) -#define EXTERNALLY_VISIBLE __attribute__((externally_visible)) -#else -#define EXTERNALLY_VISIBLE -#endif - -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) -# define ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) -#else -# define ATTRIBUTE_FORMAT(spec) /* empty */ -#endif - -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) -# define ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \ - ATTRIBUTE_FORMAT ((__gnu_printf__, formatstring_parameter, first_argument)) -#else -# define ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \ - ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument)) -#endif - -#define ATTRIBUTE_CONST _GL_ATTRIBUTE_CONST - -/* Some versions of GNU/Linux define noinline in their headers. */ -#ifdef noinline -#undef noinline -#endif +/* Some platforms redefine this. */ +#undef wait3 + +#include #endif /* EMACS_CONFIG_H */ === modified file 'autogen/configure' --- autogen/configure 2012-07-30 10:17:41 +0000 +++ autogen/configure 2012-07-31 10:17:40 +0000 @@ -4353,9 +4353,6 @@ * ) srcdir="`(cd ${srcdir}; pwd)`" ;; esac -#### Given the configuration name, set opsysfile to the -#### name of s/*.h file we should use. - ### Canonicalize the configuration name. # Make sure we can run config.sub. @@ -4604,8 +4601,6 @@ Check \`etc/MACHINES' for recognized configuration names." "$LINENO" 5 fi -opsysfile="s/${opsys}.h" - #### Choose a compiler. @@ -15164,11 +15159,43 @@ fi case $opsys in + sol2* | unixware ) + +$as_echo "#define _setjmp setjmp" >>confdefs.h + + +$as_echo "#define _longjmp longjmp" >>confdefs.h + + +$as_echo "#define TIOCSIGSEND TIOCSIGNAL" >>confdefs.h + + ;; +esac + +case $opsys in + irix6-5 | sol2* | unixware ) + +$as_echo "#define wait3(status, options, rusage) waitpid ((pid_t) -1, (status), (options))" >>confdefs.h + + +$as_echo "#define WRETCODE(w) (w >> 8)" >>confdefs.h + + ;; +esac + + +case $opsys in hpux* | sol2* ) $as_echo "#define XOS_NEEDS_TIME_H 1" >>confdefs.h ;; + + netbsd | openbsd ) + +$as_echo "#define SIGNAL_H_AHB 1" >>confdefs.h + + ;; esac @@ -15177,9 +15204,9 @@ + case $opsys in aix4-2) - opsysfile= $as_echo "#define USG /**/" >>confdefs.h $as_echo "#define USG5 /**/" >>confdefs.h @@ -15210,7 +15237,6 @@ ;; cygwin) - opsysfile= $as_echo "#define CYGWIN 1" >>confdefs.h @@ -15227,7 +15253,6 @@ ;; freebsd) - opsysfile= $as_echo "#define BSD4_2 /**/" >>confdefs.h @@ -15263,7 +15288,6 @@ ;; gnu-linux | gnu-kfreebsd ) - opsysfile= $as_echo "#define USG /**/" >>confdefs.h @@ -15286,28 +15310,32 @@ $as_echo "#define USG5 /**/" >>confdefs.h + $as_echo "#define USG5_4 /**/" >>confdefs.h + $as_echo "#define IRIX6_5 /**/" >>confdefs.h ;; sol2*) - opsysfile="s/usg5-4-common.h" $as_echo "#define USG /**/" >>confdefs.h $as_echo "#define USG5 /**/" >>confdefs.h + $as_echo "#define USG5_4 /**/" >>confdefs.h + $as_echo "#define SOLARIS2 /**/" >>confdefs.h ;; unixware) - opsysfile="s/usg5-4-common.h" $as_echo "#define USG /**/" >>confdefs.h $as_echo "#define USG5 /**/" >>confdefs.h + $as_echo "#define USG5_4 /**/" >>confdefs.h + ;; esac @@ -15319,8 +15347,6 @@ ;; - gnu) opsysfile= ;; - hpux11) $as_echo "#define BROKEN_SA_RESTART 1" >>confdefs.h @@ -15328,8 +15354,6 @@ $as_echo "#define USG_SUBTTY_WORKS 1" >>confdefs.h - - opsysfile="s/hpux10-20.h" ;; irix6-5) @@ -15341,13 +15365,10 @@ ;; - openbsd) opsysfile="s/netbsd.h" ;; - sol2-10) $as_echo "#define _STRUCTURED_PROC 1" >>confdefs.h - opsysfile="s/sol2-6.h" ;; esac @@ -15401,11 +15422,7 @@ ## Used in lwlib/Makefile.in. -if test -n "${opsysfile}"; then - S_FILE="\$(srcdir)/${opsysfile}" -else - S_FILE= -fi +S_FILE= @@ -15424,11 +15441,9 @@ #define EMACS_CONFIG_OPTIONS "${ac_configure_args}" _ACEOF -if test -n "$opsysfile"; then +if test -z "No longer used"; then -cat >>confdefs.h <<_ACEOF -#define config_opsysfile "${opsysfile}" -_ACEOF +$as_echo "#define config_opsysfile /**/" >>confdefs.h fi @@ -23787,7 +23802,6 @@ Configured for \`${canonical}'. Where should the build process find the source code? ${srcdir} - What operating system file should Emacs use? ${opsysfile:-none} What compiler should emacs be built with? ${CC} ${CFLAGS} Should Emacs use the GNU version of malloc? ${GNU_MALLOC}${GNU_MALLOC_reason} Should Emacs use a relocating allocator for buffers? ${REL_ALLOC} @@ -25450,7 +25464,7 @@ ;; "epaths":C) echo creating src/epaths.h -${MAKE-make} epaths-force +${MAKE-make} MAKEFILE_NAME=do-not-make-Makefile epaths-force ;; "gdbinit":C) if test ! -f src/.gdbinit && test -f $srcdir/src/.gdbinit; then ------------------------------------------------------------ revno: 109324 committer: martin rudalics branch nick: trunk timestamp: Tue 2012-07-31 10:36:32 +0200 message: Fix return values of switch-to-prev/next-buffer. * window.el (switch-to-prev-buffer, switch-to-next-buffer): Don't return a non-nil value when no suitable buffer was found. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-31 03:31:10 +0000 +++ lisp/ChangeLog 2012-07-31 08:36:32 +0000 @@ -1,3 +1,8 @@ +2012-07-31 Martin Rudalics + + * window.el (switch-to-prev-buffer, switch-to-next-buffer): + Don't return a non-nil value when no suitable buffer was found. + 2012-07-31 Fabián Ezequiel Gallina * progmodes/python.el (run-python-internal): Disable font lock for === modified file 'lisp/window.el' --- lisp/window.el 2012-07-18 10:02:54 +0000 +++ lisp/window.el 2012-07-31 08:36:32 +0000 @@ -2669,6 +2669,8 @@ (defun switch-to-prev-buffer (&optional window bury-or-kill) "In WINDOW switch to previous buffer. WINDOW must be a live window and defaults to the selected one. +Return the buffer switched to, nil if no suitable buffer could be +found. Optional argument BURY-OR-KILL non-nil means the buffer currently shown in WINDOW is about to be buried or killed and consequently @@ -2679,7 +2681,7 @@ (old-buffer (window-buffer window)) ;; Save this since it's destroyed by `set-window-buffer'. (next-buffers (window-next-buffers window)) - entry new-buffer killed-buffers visible) + entry buffer new-buffer killed-buffers visible) (when (window-dedicated-p window) (error "Window %s is dedicated to buffer %s" window old-buffer)) @@ -2687,20 +2689,20 @@ ;; Scan WINDOW's previous buffers first, skipping entries of next ;; buffers. (dolist (entry (window-prev-buffers window)) - (when (and (setq new-buffer (car entry)) - (or (buffer-live-p new-buffer) + (when (and (setq buffer (car entry)) + (or (buffer-live-p buffer) (not (setq killed-buffers - (cons new-buffer killed-buffers)))) - (not (eq new-buffer old-buffer)) - (or bury-or-kill - (not (memq new-buffer next-buffers)))) + (cons buffer killed-buffers)))) + (not (eq buffer old-buffer)) + (or bury-or-kill (not (memq buffer next-buffers)))) (if (and (not switch-to-visible-buffer) - (get-buffer-window new-buffer frame)) + (get-buffer-window buffer frame)) ;; Try to avoid showing a buffer visible in some other window. - (setq visible new-buffer) - (set-window-buffer-start-and-point - window new-buffer (nth 1 entry) (nth 2 entry)) - (throw 'found t)))) + (setq visible buffer) + (setq new-buffer buffer) + (set-window-buffer-start-and-point + window new-buffer (nth 1 entry) (nth 2 entry)) + (throw 'found t)))) ;; Scan reverted buffer list of WINDOW's frame next, skipping ;; entries of next buffers. Note that when we bury or kill a ;; buffer we don't reverse the global buffer list to avoid showing @@ -2767,13 +2769,15 @@ (defun switch-to-next-buffer (&optional window) "In WINDOW switch to next buffer. -WINDOW must be a live window and defaults to the selected one." +WINDOW must be a live window and defaults to the selected one. +Return the buffer switched to, nil if no suitable buffer could be +found." (interactive) (let* ((window (window-normalize-window window t)) (frame (window-frame window)) (old-buffer (window-buffer window)) (next-buffers (window-next-buffers window)) - new-buffer entry killed-buffers visible) + buffer new-buffer entry killed-buffers visible) (when (window-dedicated-p window) (error "Window %s is dedicated to buffer %s" window old-buffer)) @@ -2804,16 +2808,17 @@ ;; Scan WINDOW's reverted previous buffers last (must not use ;; nreverse here!) (dolist (entry (reverse (window-prev-buffers window))) - (when (and (setq new-buffer (car entry)) - (or (buffer-live-p new-buffer) + (when (and (setq buffer (car entry)) + (or (buffer-live-p buffer) (not (setq killed-buffers - (cons new-buffer killed-buffers)))) - (not (eq new-buffer old-buffer))) + (cons buffer killed-buffers)))) + (not (eq buffer old-buffer))) (if (and (not switch-to-visible-buffer) - (get-buffer-window new-buffer frame)) + (get-buffer-window buffer frame)) ;; Try to avoid showing a buffer visible in some other window. (unless visible - (setq visible new-buffer)) + (setq visible buffer)) + (setq new-buffer buffer) (set-window-buffer-start-and-point window new-buffer (nth 1 entry) (nth 2 entry)) (throw 'found t)))) ------------------------------------------------------------ revno: 109323 committer: Andreas Schwab branch nick: emacs timestamp: Tue 2012-07-31 09:58:08 +0200 message: * Makefile.in (install-arch-indep): Avoid eval. diff: === modified file 'ChangeLog' --- ChangeLog 2012-07-31 06:52:13 +0000 +++ ChangeLog 2012-07-31 07:58:08 +0000 @@ -1,3 +1,7 @@ +2012-07-31 Andreas Schwab + + * Makefile.in (install-arch-indep): Avoid eval. + 2012-07-31 Glenn Morris * configure.ac (opsysfile, S_FILE): Now they are always empty. === modified file 'Makefile.in' --- Makefile.in 2012-07-30 20:34:58 +0000 +++ Makefile.in 2012-07-31 07:58:08 +0000 @@ -495,8 +495,11 @@ ## http://lists.gnu.org/archive/html/autoconf-patches/2004-11/msg00005.html install-arch-indep: install-info install-man ${INSTALL_ARCH_INDEP_EXTRA} umask 022 ; \ - eval $(MKDIR_P) \ - "'$(DESTDIR)`echo ${locallisppath}|sed \"s,:,' '$(DESTDIR),g\"`'" + locallisppath='${locallisppath}'; \ + IFS=:; \ + for d in $$locallisppath; do \ + ${MKDIR_P} "$(DESTDIR)$$d"; \ + done -set ${COPYDESTS} ; \ unset CDPATH; \ $(set_installuser); \ ------------------------------------------------------------ revno: 109322 committer: Jan Djärv branch nick: trunk timestamp: Tue 2012-07-31 09:42:43 +0200 message: Fix error in ChangeLog entry. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-31 06:43:37 +0000 +++ src/ChangeLog 2012-07-31 07:42:43 +0000 @@ -32,7 +32,7 @@ 2012-07-30 Jan Djärv * nsterm.m (ns_do_open_file): New variable. - (ns_term_init): Set ns_do_open_file to NO after run returns. + (ns_term_init): Set ns_do_open_file to YES after run returns. (openFile, openTempFile, openFileWithoutUI, openFiles): Open files only if ns_do_open_file. ------------------------------------------------------------ revno: 109321 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-07-31 00:15:11 -0700 message: Remove references to s/ and m/ files in INSTALL (in the massively pointless "Configuration By Hand" section) diff: === modified file 'INSTALL' --- INSTALL 2012-07-31 07:00:19 +0000 +++ INSTALL 2012-07-31 07:15:11 +0000 @@ -667,13 +667,6 @@ 1) Copy `./src/config.in' to `./src/config.h'. -2) Consult `./etc/MACHINES' to see what configuration name you should -use for your system. Look at the code of the `configure' script to -see which operating system and architecture description files from -`src/s' and `src/m' should be used for that configuration name. Edit -`src/config.h', and change the two `#include' directives to include -the appropriate system and architecture description files. - 2) Edit `./src/config.h' to set the right options for your system. 3) Create `Makefile' files in various directories from the ------------------------------------------------------------ revno: 109320 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-07-31 00:09:39 -0700 message: Remove references to s/ and m/ files in etc/MACHINES diff: === modified file 'etc/MACHINES' --- etc/MACHINES 2012-01-19 07:21:25 +0000 +++ etc/MACHINES 2012-07-31 07:09:39 +0000 @@ -10,19 +10,12 @@ supported, has been removed. Consult older versions of this file if you are interested in this information. -The `configure' script uses the configuration name to decide which -machine and operating system description files `src/config.h' should -include. The machine description files are all in `src/m', and have -names similar to, but not identical to, the machine names used in -configuration names. The operating system files are all in `src/s', -and are named similarly. See the `configure' script if you need to -know which configuration names use which machine and operating system -description files. +The `configure' script uses the configuration name, and the results of +testing the system, to decide which options to use in src/config.h and +elsewhere (eg Makefiles). If you add support for a new configuration, add a section to this -file, and then edit the `configure' script to tell it which -configuration name(s) should select your new machine description and -system description files. +file, and edit the `configure.ac' source as needed. Some obsolete platforms are unsupported beginning with Emacs 23.1. See the list at the end of this file. ------------------------------------------------------------ revno: 109319 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-07-31 00:00:19 -0700 message: Remove INSTALL reference to s/ and m/ files. diff: === modified file 'INSTALL' --- INSTALL 2012-07-09 04:52:49 +0000 +++ INSTALL 2012-07-31 07:00:19 +0000 @@ -674,10 +674,7 @@ `src/config.h', and change the two `#include' directives to include the appropriate system and architecture description files. -2) Edit `./src/config.h' to set the right options for your system. If -you need to override any of the definitions in the s/*.h and m/*.h -files for your system and machine, do so by editing config.h, not by -changing the s/*.h and m/*.h files. +2) Edit `./src/config.h' to set the right options for your system. 3) Create `Makefile' files in various directories from the corresponding `Makefile.in' files. This isn't so hard, just a matter ------------------------------------------------------------ revno: 109318 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-07-30 23:58:54 -0700 message: etc/PROBLEMS small updates Remove references to m/ and s/ files. Remove reference to hpux _FILE_OFFSET_BITS issue, no longer true since 2012-05-31. diff: === modified file 'etc/PROBLEMS' --- etc/PROBLEMS 2012-07-11 07:07:19 +0000 +++ etc/PROBLEMS 2012-07-31 06:58:54 +0000 @@ -388,7 +388,7 @@ the `flock' system call. The other involves creating a lock file; `movemail' must be able to write in /usr/spool/mail in order to do this. You control which one is used by defining, or not defining, -the macro MAIL_USE_FLOCK in config.h or the m/ or s/ file it includes. +the macro MAIL_USE_FLOCK in config.h. IF YOU DON'T USE THE FORM OF INTERLOCKING THAT IS NORMAL ON YOUR SYSTEM, YOU CAN LOSE MAIL! @@ -2904,10 +2904,6 @@ pen@lysator.liu.se says (Feb 1998) that the Compose key does work if you link with the MIT X11 libraries instead of the Solaris X11 libraries. -*** HP/UX 10: Large file support is disabled. -(HP/UX 10 was end-of-lifed in May 1999.) -See the comments in src/s/hpux10-20.h. - *** HP/UX: Emacs is slow using X11R5. This happens if you use the MIT versions of the X libraries--it