<feed xmlns='http://www.w3.org/2005/Atom'>
<title>emacs/src, branch scratch/low-level-key</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>Go through normal keymaps</title>
<updated>2025-06-30T15:34:54+00:00</updated>
<author>
<name>Cecilio Pardo</name>
</author>
<published>2024-12-02T16:30:42+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=ba02efb85e403a55d321e3d213f1449246ad9484'/>
<id>ba02efb85e403a55d321e3d213f1449246ad9484</id>
<content type='text'>
In this new version I changed the way events are handled.
Now llk-handle generates input events to be used with normal
keymaps, instead of running a command. The function llk-bind
activates event generation for a key and a combination of
events press, release, double, triple.

I also made changes following your notes, such as:

- Clarification on the event's time, documentation of
  keysyms variables moved, don't limit to GUI systems.
- cl-defstruct for the event payload.
- Format and naming conventions.
- Default timeout to mouse double click timeout.

You suggested to auto generate the keysym table, but we
would still need a table to relate the Windows keys to the X
equivalent.

* doc/lispref/commands.texi (Misc Events): Adjust to new semantics.
* src/keyboard.c (syms_of_keyboard): Adust docstring.

FIXME: Old commit msg.

* lisp/low-level-key.el (New file).
(low-level-key): Struct with event data.
(llk-bindings): User bindings for low level key events.
(llk-tap-timeout): User option.
(llk-keysyms): List of available keysyms.
(llk--define-xk): Macro for defining keysyms.
(llk--define-keysyms): Build llk-keysyms.
(llk-bind): Function to create a binding.
(llk--event-history-for-tap): Event history for tap detection.
(llk--detect-n-tap): Function to detect taps.
(describe-low-level-key): Command to get information about a key.
(llk--describe): Show help buffer with information
about an event.
(llk-handle): Handler for key events.
(llk--generate-event): Generate input event for key.
(llk--generate-events): Generate input events for key.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In this new version I changed the way events are handled.
Now llk-handle generates input events to be used with normal
keymaps, instead of running a command. The function llk-bind
activates event generation for a key and a combination of
events press, release, double, triple.

I also made changes following your notes, such as:

- Clarification on the event's time, documentation of
  keysyms variables moved, don't limit to GUI systems.
- cl-defstruct for the event payload.
- Format and naming conventions.
- Default timeout to mouse double click timeout.

You suggested to auto generate the keysym table, but we
would still need a table to relate the Windows keys to the X
equivalent.

* doc/lispref/commands.texi (Misc Events): Adjust to new semantics.
* src/keyboard.c (syms_of_keyboard): Adust docstring.

FIXME: Old commit msg.

* lisp/low-level-key.el (New file).
(low-level-key): Struct with event data.
(llk-bindings): User bindings for low level key events.
(llk-tap-timeout): User option.
(llk-keysyms): List of available keysyms.
(llk--define-xk): Macro for defining keysyms.
(llk--define-keysyms): Build llk-keysyms.
(llk-bind): Function to create a binding.
(llk--event-history-for-tap): Event history for tap detection.
(llk--detect-n-tap): Function to detect taps.
(describe-low-level-key): Command to get information about a key.
(llk--describe): Show help buffer with information
about an event.
(llk-handle): Handler for key events.
(llk--generate-event): Generate input event for key.
(llk--generate-events): Generate input events for key.
</pre>
</div>
</content>
</entry>
<entry>
<title>low-level-key-event: Minor doc style improvement</title>
<updated>2025-06-30T15:34:54+00:00</updated>
<author>
<name>Cecilio Pardo</name>
</author>
<published>2024-12-02T16:30:42+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=67aed063f6460e8add0fcfdebf562a3062cc26a2'/>
<id>67aed063f6460e8add0fcfdebf562a3062cc26a2</id>
<content type='text'>
* doc/lispref/commands.texi (Misc Events): Improve style and clarify
the dependence on `enable-low-level-key-events`.
* src/keyboard.c (syms_of_keyboard): Fix markup.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* doc/lispref/commands.texi (Misc Events): Improve style and clarify
the dependence on `enable-low-level-key-events`.
* src/keyboard.c (syms_of_keyboard): Fix markup.
</pre>
</div>
</content>
</entry>
<entry>
<title>Include a manual entry, and correct doc strings and comments</title>
<updated>2025-06-30T15:34:54+00:00</updated>
<author>
<name>Cecilio Pardo</name>
</author>
<published>2024-12-02T16:30:42+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=4d26a17b01ac7794bf3d3ed7ce9e5ceb0ecec74d'/>
<id>4d26a17b01ac7794bf3d3ed7ce9e5ceb0ecec74d</id>
<content type='text'>
* doc/lispref/commands.texi: Added information about new event.
* src/keyboard.c (syms_of_keyboard): Tweak docstring.

FIXME: Old commit msg.

* lisp/low-level-key.el (New file).
(llk-bindings): User bindings for low level key events.
(llk-tap-count): User option.
(llk-tap-timeout): User option.
(llk-tap-keys): User option.
(llk-keysyms): List of available keysyms.
(define-xk): Macro for defining keysyms.
(llk-define-keysyms): Build llk-keysyms.
(llk-init): Function to initialize low level key handling.
(event-is-key-press): Get field from event.
(event-keysym): Get field from event.
(event-modifier): Get field from event.
(event-time): Get field from event.
(llk-bind): Function to create a binding.
(llk-events): Event history for tap detection.
(llk-detect-n-tap): Function to detect taps.
(describe-low-level-key): Command to get information about a key.
(llk-show-event-description): Show help buffer with information
about an event.
(llk-handle): Handler for key events.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* doc/lispref/commands.texi: Added information about new event.
* src/keyboard.c (syms_of_keyboard): Tweak docstring.

FIXME: Old commit msg.

* lisp/low-level-key.el (New file).
(llk-bindings): User bindings for low level key events.
(llk-tap-count): User option.
(llk-tap-timeout): User option.
(llk-tap-keys): User option.
(llk-keysyms): List of available keysyms.
(define-xk): Macro for defining keysyms.
(llk-define-keysyms): Build llk-keysyms.
(llk-init): Function to initialize low level key handling.
(event-is-key-press): Get field from event.
(event-keysym): Get field from event.
(event-modifier): Get field from event.
(event-time): Get field from event.
(llk-bind): Function to create a binding.
(llk-events): Event history for tap detection.
(llk-detect-n-tap): Function to detect taps.
(describe-low-level-key): Command to get information about a key.
(llk-show-event-description): Show help buffer with information
about an event.
(llk-handle): Handler for key events.
</pre>
</div>
</content>
</entry>
<entry>
<title>Send event for key presses and key releases.</title>
<updated>2025-06-30T15:34:54+00:00</updated>
<author>
<name>Cecilio Pardo</name>
</author>
<published>2024-12-02T16:30:42+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=ce3bbe1c42c50c444059202553be703f9d66d77e'/>
<id>ce3bbe1c42c50c444059202553be703f9d66d77e</id>
<content type='text'>
Detect double/tripe taps.

[FIXME: Need adjustments in the description below!]

* src/gtkutil.c (xg_create_frame_widgets): Modified to handle key
release events.
(xg_maybe_send_low_level_key_event): New function that sends key
events.
(xg_widget_key_press_event_cb): Modified to send low level key events.
(xg_widget_key_release_event_cb):New function to send low level key
events on key release.
* src/keyboard.c (kbd_buffer_get_event): Modified to handle low level
keyboard events.
(make_lispy_event): Modified to handle low level keyboard events.
(kbd_low_level_key_is_enabled): New function to decice if a particular
key should generate events, looking at configuration,
(syms_of_keyboard): Added symbols and varialbles.
(keys_of_keyboard): Modified to map low level key events to
'special-event-map'.
* src/keyboard.h: Modified with function prototype.
* src/pgtkterm.c (pgtk_maybe_send_low_level_key_event): New function
that sends key events.
(key_press_event): Modified to handle low level keyboard events.
(key_release_event): Modified to handle low level keyboard events.
* src/termhooks.h: Modified to define constant.
* src/w32fns.c (w32_wnd_proc): Modified to generate low level key
events.
* src/w32term.c (w32_read_socket): Modified to generate low level key
events.
* src/xterm.c (x_get_modifier_for_keycode): New function to decide
which (if any) modifier corresponds to a given key.
(x_maybe_send_low_level_key_event): New function that sends key
events.
(handle_one_xevent): Modified to handle low level key events.
(syms_of_xterm): Modified to definde symbol.
* src/xterm.h: Modified with function prototype
* lisp/low-level-key.el (New file).
(llk-bindings): User bindings for low level key events.
(llk-tap-count): User option.
(llk-tap-timeout): User option.
(llk-tap-keys): User option.
(llk-keysyms): List of available keysyms.
(define-xk): Macro for defining keysyms.
(llk-define-keysyms): Build llk-keysyms.
(llk-init): Function to initialize low level key handling.
(event-is-key-press): Get field from event.
(event-keysym): Get field from event.
(event-modifier): Get field from event.
(event-time): Get field from event.
(llk-bind): Function to create a binding.
(llk-events): Event history for tap detection.
(llk-detect-n-tap): Function to detect taps.
(describe-low-level-key): Command to get information about a key.
(llk-show-event-description): Show help buffer with information
about an event.
(llk-handle): Handler for key events.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Detect double/tripe taps.

[FIXME: Need adjustments in the description below!]

* src/gtkutil.c (xg_create_frame_widgets): Modified to handle key
release events.
(xg_maybe_send_low_level_key_event): New function that sends key
events.
(xg_widget_key_press_event_cb): Modified to send low level key events.
(xg_widget_key_release_event_cb):New function to send low level key
events on key release.
* src/keyboard.c (kbd_buffer_get_event): Modified to handle low level
keyboard events.
(make_lispy_event): Modified to handle low level keyboard events.
(kbd_low_level_key_is_enabled): New function to decice if a particular
key should generate events, looking at configuration,
(syms_of_keyboard): Added symbols and varialbles.
(keys_of_keyboard): Modified to map low level key events to
'special-event-map'.
* src/keyboard.h: Modified with function prototype.
* src/pgtkterm.c (pgtk_maybe_send_low_level_key_event): New function
that sends key events.
(key_press_event): Modified to handle low level keyboard events.
(key_release_event): Modified to handle low level keyboard events.
* src/termhooks.h: Modified to define constant.
* src/w32fns.c (w32_wnd_proc): Modified to generate low level key
events.
* src/w32term.c (w32_read_socket): Modified to generate low level key
events.
* src/xterm.c (x_get_modifier_for_keycode): New function to decide
which (if any) modifier corresponds to a given key.
(x_maybe_send_low_level_key_event): New function that sends key
events.
(handle_one_xevent): Modified to handle low level key events.
(syms_of_xterm): Modified to definde symbol.
* src/xterm.h: Modified with function prototype
* lisp/low-level-key.el (New file).
(llk-bindings): User bindings for low level key events.
(llk-tap-count): User option.
(llk-tap-timeout): User option.
(llk-tap-keys): User option.
(llk-keysyms): List of available keysyms.
(define-xk): Macro for defining keysyms.
(llk-define-keysyms): Build llk-keysyms.
(llk-init): Function to initialize low level key handling.
(event-is-key-press): Get field from event.
(event-keysym): Get field from event.
(event-modifier): Get field from event.
(event-time): Get field from event.
(llk-bind): Function to create a binding.
(llk-events): Event history for tap detection.
(llk-detect-n-tap): Function to detect taps.
(describe-low-level-key): Command to get information about a key.
(llk-show-event-description): Show help buffer with information
about an event.
(llk-handle): Handler for key events.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add events for key press and key release on gui systems.</title>
<updated>2025-06-30T15:34:54+00:00</updated>
<author>
<name>Cecilio Pardo</name>
</author>
<published>2024-10-28T22:57:35+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=bcdd9ffac79b7868df0a96940891bd4bead2f362'/>
<id>bcdd9ffac79b7868df0a96940891bd4bead2f362</id>
<content type='text'>
And detection of double/triple taps on modifier keys.

* lisp/low-level-key.el (llk-tap-timeout):
(llk-tap-count):
(llk-tap-keys):
(llk-bindings):
(llk-modifier-bindings):
(llk-init):
(llk-bind):
(llk-modifier-bind):
(llk-events):
(llk-modifier-events):
(llm-handle):
* src/gtkutil.c (xg_create_frame_widgets):
(xg_maybe_send_low_level_key_event):
(xg_widget_key_press_event_cb):
(xg_widget_key_release_event_cb):
* src/xterm.c (x_maybe_send_physical_key_event):
(x_filter_event):
(handle_one_xevent):
(syms_of_xterm):
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
And detection of double/triple taps on modifier keys.

* lisp/low-level-key.el (llk-tap-timeout):
(llk-tap-count):
(llk-tap-keys):
(llk-bindings):
(llk-modifier-bindings):
(llk-init):
(llk-bind):
(llk-modifier-bind):
(llk-events):
(llk-modifier-events):
(llm-handle):
* src/gtkutil.c (xg_create_frame_widgets):
(xg_maybe_send_low_level_key_event):
(xg_widget_key_press_event_cb):
(xg_widget_key_release_event_cb):
* src/xterm.c (x_maybe_send_physical_key_event):
(x_filter_event):
(handle_one_xevent):
(syms_of_xterm):
</pre>
</div>
</content>
</entry>
<entry>
<title>Properly invalidate XRender surfaces when only EmacsFrame is resized</title>
<updated>2025-06-28T14:14:35+00:00</updated>
<author>
<name>Po Lu</name>
</author>
<published>2025-06-28T14:14:35+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=987cd7012de3cbbdc6a3cfaae337bf9cf752abb3'/>
<id>987cd7012de3cbbdc6a3cfaae337bf9cf752abb3</id>
<content type='text'>
* src/xterm.c (handle_one_xevent): Drop XRender surfaces when
the frame widget is resized, rather than when the toplevel is.
(bug#77988)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/xterm.c (handle_one_xevent): Drop XRender surfaces when
the frame widget is resized, rather than when the toplevel is.
(bug#77988)
</pre>
</div>
</content>
</entry>
<entry>
<title>Avoid extra output in Vprin1_to_string_buffer (bug#78842)</title>
<updated>2025-06-28T10:46:08+00:00</updated>
<author>
<name>Pip Cet</name>
</author>
<published>2025-06-28T09:33:01+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=6b19eb53c5048cfec1f3601afb44f94ebbb9d138'/>
<id>6b19eb53c5048cfec1f3601afb44f94ebbb9d138</id>
<content type='text'>
print_error_message can throw after producing some output, so use
unwind-protect to ensure prin1-to-string-buffer is cleared.

* src/print.c (erase_prin1_to_string_buffer): New.
(Ferror_message_string): Use it to catch errors thrown in
'print_error_message'.
* test/src/print-tests.el (error-message-string-circular): Expand
test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
print_error_message can throw after producing some output, so use
unwind-protect to ensure prin1-to-string-buffer is cleared.

* src/print.c (erase_prin1_to_string_buffer): New.
(Ferror_message_string): Use it to catch errors thrown in
'print_error_message'.
* test/src/print-tests.el (error-message-string-circular): Expand
test.
</pre>
</div>
</content>
</entry>
<entry>
<title>Port varargs macros better to C99</title>
<updated>2025-06-28T06:54:45+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2025-06-28T06:53:32+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=dd1efa5309d82139c6637e21ebd9eeb55e1814c1'/>
<id>dd1efa5309d82139c6637e21ebd9eeb55e1814c1</id>
<content type='text'>
C99 prohibits passing zero args to macro’s ‘...’.
* lib-src/seccomp-filter.c (RULE0): New macro, which is like RULE
except with zero args.  All zero-arg uses of RULE changed to RULE0.
* src/comp.c (compile_function, Fcomp__init_ctxt, syms_of_comp):
Change ‘CALLN (Fmake_hash_table)’ to ‘Fmake_hash_table (0, NULL)’,
since CALLN requires at least two args in C99.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
C99 prohibits passing zero args to macro’s ‘...’.
* lib-src/seccomp-filter.c (RULE0): New macro, which is like RULE
except with zero args.  All zero-arg uses of RULE changed to RULE0.
* src/comp.c (compile_function, Fcomp__init_ctxt, syms_of_comp):
Change ‘CALLN (Fmake_hash_table)’ to ‘Fmake_hash_table (0, NULL)’,
since CALLN requires at least two args in C99.
</pre>
</div>
</content>
</entry>
<entry>
<title>(Finsert_file_contents): Refine commit d07af40d8826</title>
<updated>2025-06-28T03:11:39+00:00</updated>
<author>
<name>Stefan Monnier</name>
</author>
<published>2025-06-23T02:25:03+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=6c0bbf0f921682a185ebd57efef1e9d4f8ced788'/>
<id>6c0bbf0f921682a185ebd57efef1e9d4f8ced788</id>
<content type='text'>
* src/fileio.c (Finsert_file_contents): Inhibit ask-supersession
only if we're VISITing in a non-narrowed buffer (bug#78866).

* test/src/fileio-tests.el (ert--tests-dir): New var.
(fileio-tests--insert-file-contents-supersession): New test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/fileio.c (Finsert_file_contents): Inhibit ask-supersession
only if we're VISITing in a non-narrowed buffer (bug#78866).

* test/src/fileio-tests.el (ert--tests-dir): New var.
(fileio-tests--insert-file-contents-supersession): New test.
</pre>
</div>
</content>
</entry>
<entry>
<title>Avoid segfault when profiling Lisp programs with threads</title>
<updated>2025-06-21T08:53:24+00:00</updated>
<author>
<name>Eli Zaretskii</name>
</author>
<published>2025-06-21T08:53:24+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=dd95447b05eb2e86e0500d953f43213df028c19a'/>
<id>dd95447b05eb2e86e0500d953f43213df028c19a</id>
<content type='text'>
* src/eval.c (backtrace_top): Don't segfault if current_thread is
NULL.  (Bug#76970)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/eval.c (backtrace_top): Don't segfault if current_thread is
NULL.  (Bug#76970)
</pre>
</div>
</content>
</entry>
</feed>
