<feed xmlns='http://www.w3.org/2005/Atom'>
<title>emacs/src/termhooks.h, branch pending</title>
<subtitle>Emacs is the extensible, customizable, self-documenting real-time display editor. 
</subtitle>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/'/>
<entry>
<title>Add 2012 to FSF copyright years for Emacs files</title>
<updated>2012-01-05T09:46:05+00:00</updated>
<author>
<name>Glenn Morris</name>
</author>
<published>2012-01-05T09:46:05+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=acaf905b1130aae80fa59d2c861ffd4c8eb75486'/>
<id>acaf905b1130aae80fa59d2c861ffd4c8eb75486</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Spelling fixes.</title>
<updated>2011-12-12T05:32:49+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2011-12-12T05:32:49+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=333f9019e29e9b6de3a7ec07448be1d364ba540b'/>
<id>333f9019e29e9b6de3a7ec07448be1d364ba540b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix incorrect comment.</title>
<updated>2011-07-20T00:09:31+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2011-07-20T00:09:31+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=722e028b38b63a4f32be9670359a1344befd1578'/>
<id>722e028b38b63a4f32be9670359a1344befd1578</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Support X clipboard managers.</title>
<updated>2011-05-27T16:17:59+00:00</updated>
<author>
<name>Chong Yidong</name>
</author>
<published>2011-05-27T16:17:59+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=a9f737eef69ffe03dd045df555300ae6b41d0edf'/>
<id>a9f737eef69ffe03dd045df555300ae6b41d0edf</id>
<content type='text'>
* lisp/select.el (xselect-convert-to-targets): Add MULTIPLE target to list.
(xselect-convert-to-save-targets): New function.

* src/xselect.c: Support for clipboard managers.
(Vselection_alist): Move to termhooks.h as terminal-local var.
(LOCAL_SELECTION): New macro.
(x_atom_to_symbol): Handle x_display_info_for_display fail case.
(symbol_to_x_atom): Remove gratuitous arg.
(x_handle_selection_request, lisp_data_to_selection_data)
(x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
(x_own_selection, x_get_local_selection, x_convert_selection): New
arg, specifying work frame.  Use terminal-local Vselection_alist.
(some_frame_on_display): Delete unused function.
(Fx_own_selection_internal, Fx_get_selection_internal)
(Fx_disown_selection_internal, Fx_selection_owner_p)
(Fx_selection_exists_p): New optional frame arg.
(frame_for_x_selection, Fx_clipboard_manager_save): New functions.
(x_handle_selection_clear): Don't treat other terminals with the
same keyboard specially.  Use the terminal-local Vselection_alist.
(x_clear_frame_selections): Use Frun_hook_with_args.

* src/termhooks.h (Vselection_alist): Make it terminal-local.

* src/terminal.c (create_terminal): Initialize it.

* src/xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.

* src/xterm.h: Add support for those atoms.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* lisp/select.el (xselect-convert-to-targets): Add MULTIPLE target to list.
(xselect-convert-to-save-targets): New function.

* src/xselect.c: Support for clipboard managers.
(Vselection_alist): Move to termhooks.h as terminal-local var.
(LOCAL_SELECTION): New macro.
(x_atom_to_symbol): Handle x_display_info_for_display fail case.
(symbol_to_x_atom): Remove gratuitous arg.
(x_handle_selection_request, lisp_data_to_selection_data)
(x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
(x_own_selection, x_get_local_selection, x_convert_selection): New
arg, specifying work frame.  Use terminal-local Vselection_alist.
(some_frame_on_display): Delete unused function.
(Fx_own_selection_internal, Fx_get_selection_internal)
(Fx_disown_selection_internal, Fx_selection_owner_p)
(Fx_selection_exists_p): New optional frame arg.
(frame_for_x_selection, Fx_clipboard_manager_save): New functions.
(x_handle_selection_clear): Don't treat other terminals with the
same keyboard specially.  Use the terminal-local Vselection_alist.
(x_clear_frame_selections): Use Frun_hook_with_args.

* src/termhooks.h (Vselection_alist): Make it terminal-local.

* src/terminal.c (create_terminal): Initialize it.

* src/xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.

* src/xterm.h: Add support for those atoms.
</pre>
</div>
</content>
</entry>
<entry>
<title>Be more systematic about user-interface timestamps.</title>
<updated>2011-05-12T20:23:33+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2011-05-12T20:23:33+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=08dc5ae68e9c699410256ca9052bd09f336ac87f'/>
<id>08dc5ae68e9c699410256ca9052bd09f336ac87f</id>
<content type='text'>
Before, the code sometimes used 'Time', sometimes 'unsigned long',
and sometimes 'EMACS_UINT', to represent these timestamps.  This
change causes it to use 'Time' uniformly, as that's what X uses.
This makes the code easier to follow, and makes it easier to catch
integer overflow bugs such as Bug#8664.
* frame.c (Fmouse_position, Fmouse_pixel_position):
Use Time, not unsigned long, for user-interface timestamps.
* keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
(button_down_time, make_lispy_position, make_lispy_movement): Likewise.
* keyboard.h (last_event_timestamp): Likewise.
* menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
* menu.h (xmenu_show): Likewise.
* term.c (term_mouse_position): Likewise.
* termhooks.h (struct input_event.timestamp): Likewise.
(struct terminal.mouse_position_hook): Likewise.
* xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
* xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
* systime.h (Time): New decl.  Pull it in from &lt;X11/X.h&gt; if
HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
what it was before.
* menu.h, termhooks.h: Include "systime.h", for Time.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before, the code sometimes used 'Time', sometimes 'unsigned long',
and sometimes 'EMACS_UINT', to represent these timestamps.  This
change causes it to use 'Time' uniformly, as that's what X uses.
This makes the code easier to follow, and makes it easier to catch
integer overflow bugs such as Bug#8664.
* frame.c (Fmouse_position, Fmouse_pixel_position):
Use Time, not unsigned long, for user-interface timestamps.
* keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
(button_down_time, make_lispy_position, make_lispy_movement): Likewise.
* keyboard.h (last_event_timestamp): Likewise.
* menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
* menu.h (xmenu_show): Likewise.
* term.c (term_mouse_position): Likewise.
* termhooks.h (struct input_event.timestamp): Likewise.
(struct terminal.mouse_position_hook): Likewise.
* xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
* xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
* systime.h (Time): New decl.  Pull it in from &lt;X11/X.h&gt; if
HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
what it was before.
* menu.h, termhooks.h: Include "systime.h", for Time.
</pre>
</div>
</content>
</entry>
<entry>
<title>* lisp.h: Say "vectorlike header" rather than "vector header.</title>
<updated>2011-04-25T19:40:22+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2011-04-25T19:40:22+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=b102ceb110a9cd38f5c589c1869747b1e1c792cb'/>
<id>b102ceb110a9cd38f5c589c1869747b1e1c792cb</id>
<content type='text'>
(struct vectorlike_header): Rename from struct vector_header.
(XVECTORLIKE_HEADER_SIZE): Renamed from XVECTOR_HEADER_SIZE.
All uses changed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(struct vectorlike_header): Rename from struct vector_header.
(XVECTORLIKE_HEADER_SIZE): Renamed from XVECTOR_HEADER_SIZE.
All uses changed.
</pre>
</div>
</content>
</entry>
<entry>
<title>lisp.h: Fix a problem with aliasing and vector headers.</title>
<updated>2011-04-25T07:14:46+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2011-04-25T07:14:46+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=eab3844f965646b62e242aa622754b86d1fd3444'/>
<id>eab3844f965646b62e242aa622754b86d1fd3444</id>
<content type='text'>
GCC 4.6.0 optimizes based on type-based alias analysis.  For
example, if b is of type struct buffer * and v of type struct
Lisp_Vector *, then gcc -O2 was incorrectly assuming that &amp;b-&gt;size
!= &amp;v-&gt;size, and therefore "v-&gt;size = 1; b-&gt;size = 2; return
v-&gt;size;" must therefore return 1.  This assumption is incorrect
for Emacs, since it type-puns struct Lisp_Vector * with many other
types.  To fix this problem, this patch adds a new type struct
vector_header that documents the constraints on layout of vectors
and pseudovectors, and helps optimizing compilers not get fooled
by Emacs's type punning.  It also adds the macros XSETTYPED_PVECTYPE
XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
* lisp.h (XVECTOR_SIZE): New convenience macro.  All previous uses of
XVECTOR (foo)-&gt;size replaced to use this macro, to avoid the hassle
of writing XVECTOR (foo)-&gt;header.size.
(XVECTOR_HEADER_SIZE): New macro, for use in XSETPSEUDOVECTOR.
(XSETTYPED_PVECTYPE): New macro, specifying the name of the size
member.
(XSETPVECTYPE): Rewrite in terms of new macro.
(XSETPVECTYPESIZE): New macro, specifying both type and size.
This is a bit clearer, and further avoids the possibility of
undesirable aliasing.
(XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
(XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR
and XVECTOR_HEADER_SIZE.
(XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
since Lisp_Subr is a special case (no "next" field).
(ASIZE): Rewrite in terms of XVECTOR_SIZE.
(struct vector_header): New type.
(TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
object, to help avoid aliasing.
(PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
(SUBRP): Likewise, since Lisp_Subr is a special case.
* lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
(struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
(struct Lisp_Hash_Table): Combine first two members into a single
struct vector_header member.  All uses of "size" and "next" members
changed to be "header.size" and "header.next".
* buffer.h (struct buffer): Likewise.
* font.h (struct font_spec, struct font_entity, struct font): Likewise.
* frame.h (struct frame): Likewise.
* process.h (struct Lisp_Process): Likewise.
* termhooks.h (struct terminal): Likewise.
* window.c (struct save_window_data, struct saved_window): Likewise.
* window.h (struct window): Likewise.
* alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
* buffer.c (init_buffer_once): Likewise.
* lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
special case.
* process.c (Fformat_network_address): Use local var for size,
for brevity.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
GCC 4.6.0 optimizes based on type-based alias analysis.  For
example, if b is of type struct buffer * and v of type struct
Lisp_Vector *, then gcc -O2 was incorrectly assuming that &amp;b-&gt;size
!= &amp;v-&gt;size, and therefore "v-&gt;size = 1; b-&gt;size = 2; return
v-&gt;size;" must therefore return 1.  This assumption is incorrect
for Emacs, since it type-puns struct Lisp_Vector * with many other
types.  To fix this problem, this patch adds a new type struct
vector_header that documents the constraints on layout of vectors
and pseudovectors, and helps optimizing compilers not get fooled
by Emacs's type punning.  It also adds the macros XSETTYPED_PVECTYPE
XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
* lisp.h (XVECTOR_SIZE): New convenience macro.  All previous uses of
XVECTOR (foo)-&gt;size replaced to use this macro, to avoid the hassle
of writing XVECTOR (foo)-&gt;header.size.
(XVECTOR_HEADER_SIZE): New macro, for use in XSETPSEUDOVECTOR.
(XSETTYPED_PVECTYPE): New macro, specifying the name of the size
member.
(XSETPVECTYPE): Rewrite in terms of new macro.
(XSETPVECTYPESIZE): New macro, specifying both type and size.
This is a bit clearer, and further avoids the possibility of
undesirable aliasing.
(XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
(XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR
and XVECTOR_HEADER_SIZE.
(XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
since Lisp_Subr is a special case (no "next" field).
(ASIZE): Rewrite in terms of XVECTOR_SIZE.
(struct vector_header): New type.
(TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
object, to help avoid aliasing.
(PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
(SUBRP): Likewise, since Lisp_Subr is a special case.
* lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
(struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
(struct Lisp_Hash_Table): Combine first two members into a single
struct vector_header member.  All uses of "size" and "next" members
changed to be "header.size" and "header.next".
* buffer.h (struct buffer): Likewise.
* font.h (struct font_spec, struct font_entity, struct font): Likewise.
* frame.h (struct frame): Likewise.
* process.h (struct Lisp_Process): Likewise.
* termhooks.h (struct terminal): Likewise.
* window.c (struct save_window_data, struct saved_window): Likewise.
* window.h (struct window): Likewise.
* alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
* buffer.c (init_buffer_once): Likewise.
* lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
special case.
* process.c (Fformat_network_address): Use local var for size,
for brevity.
</pre>
</div>
</content>
</entry>
<entry>
<title>Minor redisplay cleanups.</title>
<updated>2011-04-17T18:40:55+00:00</updated>
<author>
<name>Chong Yidong</name>
</author>
<published>2011-04-17T18:40:55+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=4581706e272ad522d495dd12040d94b86a333b6d'/>
<id>4581706e272ad522d495dd12040d94b86a333b6d</id>
<content type='text'>
* src/dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
definition for no-X builds.

* src/termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.

* src/xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
definition for no-X builds.

* src/termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.

* src/xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
</pre>
</div>
</content>
</entry>
<entry>
<title>* termhooks.h (struct terminal): Likewise.</title>
<updated>2011-04-16T21:27:29+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2011-04-16T21:27:29+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=e264f2620be29b32f02b529847dfd6621ca4a7f9'/>
<id>e264f2620be29b32f02b529847dfd6621ca4a7f9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>* term.c: Make symbols static if they're not exported.</title>
<updated>2011-04-14T02:52:33+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2011-04-14T02:52:33+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=64520e5cf9ad7cba4f23288bffeec1aa2fff6c49'/>
<id>64520e5cf9ad7cba4f23288bffeec1aa2fff6c49</id>
<content type='text'>
(tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
(max_frame_lines, tty_set_terminal_modes):
(tty_reset_terminal_modes, tty_turn_off_highlight):
(get_tty_terminal): Now static.
(term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
* termhooks.h (term_mouse_moveto): Do not declare if
HAVE_WINDOW_SYSTEMM.
* dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
(tty_turn_off_highlight, get_tty_terminal): Remove decls.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
(max_frame_lines, tty_set_terminal_modes):
(tty_reset_terminal_modes, tty_turn_off_highlight):
(get_tty_terminal): Now static.
(term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
* termhooks.h (term_mouse_moveto): Do not declare if
HAVE_WINDOW_SYSTEMM.
* dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
(tty_turn_off_highlight, get_tty_terminal): Remove decls.
</pre>
</div>
</content>
</entry>
</feed>
