<feed xmlns='http://www.w3.org/2005/Atom'>
<title>emacs/src/keyboard.c, branch scratch/sort-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>Implement notification callbacks on Android</title>
<updated>2024-03-11T13:41:14+00:00</updated>
<author>
<name>Po Lu</name>
</author>
<published>2024-03-11T13:40:47+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=a7a37341cad230448e487d0ffa343eeeb8a66a65'/>
<id>a7a37341cad230448e487d0ffa343eeeb8a66a65</id>
<content type='text'>
* doc/lispref/os.texi (Desktop Notifications): Document that
:on-cancel, :on-action and :actions are now supported on
Android.

* java/org/gnu/emacs/EmacsActivity.java (onNewIntent): New
function.

* java/org/gnu/emacs/EmacsDesktopNotification.java
(NOTIFICATION_ACTION, NOTIFICATION_TAG, NOTIFICATION_DISMISSED):
New constants.  &lt;actions, titles&gt;: New fields.
(insertActions): New function.
(display1, display): Insert actions on Jelly Bean and up, and
arrange to be notified when the notification is dismissed.
(CancellationReceiver): New class.

* java/org/gnu/emacs/EmacsNative.java (sendNotificationDeleted)
(sendNotificationAction): New functions.

* src/android.c (sendDndDrag, sendDndUri, sendDndText): Correct
return types.
(sendNotificationDeleted, sendNotificationAction)
(android_exception_check_5, android_exception_check_6): New
functions.

* src/android.h:

* src/androidgui.h (struct android_notification_event): New
structure.
(union android_event): New member for notification events.

* src/androidselect.c (android_init_emacs_desktop_notification):
Update JNI signatures.
(android_notifications_notify_1, Fandroid_notifications_notify):
New arguments ACTIONS, ACTION_CB and CANCEL_CB.  Convert and
record them as appropriate.
(android_notification_deleted, android_notification_action): New
functions.
(syms_of_androidselect): Prepare a hash table of outstanding
notifications.
&lt;QCactions, QCon_action, QCon_cancel&gt; New defsyms.

* src/androidterm.c (handle_one_android_event)
&lt;ANDROID_NOTIFICATION_DELETED&gt;
&lt;ANDROID_NOTIFICATION_ACTION&gt;: Dispatch event contents to
androidselect.c for processing.

* src/androidterm.h:

* src/androidvfs.c (java_string_class): Export.

* src/keyboard.c (kbd_buffer_get_event) &lt;NOTIFICATION_EVENT&gt;:
Call callback specified by the event.

* src/termhooks.h (enum event_kind) [HAVE_ANDROID]: New
enum NOTIFICATION_EVENT.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* doc/lispref/os.texi (Desktop Notifications): Document that
:on-cancel, :on-action and :actions are now supported on
Android.

* java/org/gnu/emacs/EmacsActivity.java (onNewIntent): New
function.

* java/org/gnu/emacs/EmacsDesktopNotification.java
(NOTIFICATION_ACTION, NOTIFICATION_TAG, NOTIFICATION_DISMISSED):
New constants.  &lt;actions, titles&gt;: New fields.
(insertActions): New function.
(display1, display): Insert actions on Jelly Bean and up, and
arrange to be notified when the notification is dismissed.
(CancellationReceiver): New class.

* java/org/gnu/emacs/EmacsNative.java (sendNotificationDeleted)
(sendNotificationAction): New functions.

* src/android.c (sendDndDrag, sendDndUri, sendDndText): Correct
return types.
(sendNotificationDeleted, sendNotificationAction)
(android_exception_check_5, android_exception_check_6): New
functions.

* src/android.h:

* src/androidgui.h (struct android_notification_event): New
structure.
(union android_event): New member for notification events.

* src/androidselect.c (android_init_emacs_desktop_notification):
Update JNI signatures.
(android_notifications_notify_1, Fandroid_notifications_notify):
New arguments ACTIONS, ACTION_CB and CANCEL_CB.  Convert and
record them as appropriate.
(android_notification_deleted, android_notification_action): New
functions.
(syms_of_androidselect): Prepare a hash table of outstanding
notifications.
&lt;QCactions, QCon_action, QCon_cancel&gt; New defsyms.

* src/androidterm.c (handle_one_android_event)
&lt;ANDROID_NOTIFICATION_DELETED&gt;
&lt;ANDROID_NOTIFICATION_ACTION&gt;: Dispatch event contents to
androidselect.c for processing.

* src/androidterm.h:

* src/androidvfs.c (java_string_class): Export.

* src/keyboard.c (kbd_buffer_get_event) &lt;NOTIFICATION_EVENT&gt;:
Call callback specified by the event.

* src/termhooks.h (enum event_kind) [HAVE_ANDROID]: New
enum NOTIFICATION_EVENT.
</pre>
</div>
</content>
</entry>
<entry>
<title>* src/keyboard.c (read_key_sequence): Remove MSVC compatibility hack</title>
<updated>2024-03-10T14:40:21+00:00</updated>
<author>
<name>Tim Ruffing</name>
</author>
<published>2024-03-09T11:15:22+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=2fdb281a276af57c104008d68ae95c7f4b1c3da8'/>
<id>2fdb281a276af57c104008d68ae95c7f4b1c3da8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Continue reading in 'read-event' etc. at the end of a keyboard macro</title>
<updated>2024-03-10T14:40:13+00:00</updated>
<author>
<name>Tim Ruffing</name>
</author>
<published>2023-12-27T13:32:09+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=6f46dd516b84ad7d59b49c2e9e3fc1a2d4ef4d1c'/>
<id>6f46dd516b84ad7d59b49c2e9e3fc1a2d4ef4d1c</id>
<content type='text'>
This fixes a bug that could make 'read-event', 'read-char', and
'read-char-exclusive' erroneously return -1, an internal magic return
value of 'read_char' leaked from C to lisp. Instead of returning -1, the
aforementioned lisp functions now transparently continue reading
available input (e.g., from the keyboard) when reaching the end of a
keyboard macro.

* src/keyboard.c (read_char, read_key_sequence): Move handling
of the end of a keyboard macro from 'read_char' to its caller
'read_key_sequence', which is the only caller that can
meaningfully deal with this case.
* src/macros.c (Fexecute_kbd_macro): Document how the end of keyboard
macro is processed.
* etc/NEWS: Announce this change.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes a bug that could make 'read-event', 'read-char', and
'read-char-exclusive' erroneously return -1, an internal magic return
value of 'read_char' leaked from C to lisp. Instead of returning -1, the
aforementioned lisp functions now transparently continue reading
available input (e.g., from the keyboard) when reaching the end of a
keyboard macro.

* src/keyboard.c (read_char, read_key_sequence): Move handling
of the end of a keyboard macro from 'read_char' to its caller
'read_key_sequence', which is the only caller that can
meaningfully deal with this case.
* src/macros.c (Fexecute_kbd_macro): Document how the end of keyboard
macro is processed.
* etc/NEWS: Announce this change.
</pre>
</div>
</content>
</entry>
<entry>
<title>* src/keyboard.c (requeued_events_pending_p): New function</title>
<updated>2024-03-10T14:40:11+00:00</updated>
<author>
<name>Tim Ruffing</name>
</author>
<published>2023-12-27T13:29:34+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=d6f326452ecc761498d627a365c8014a467812eb'/>
<id>d6f326452ecc761498d627a365c8014a467812eb</id>
<content type='text'>
* src/keyboard.c, src/keyboard.h (requeued_events_pending_p): Add
function 'requeued_events_pending_p' (whose name was made available in
the previous commit). As opposed to the previous function with the same
name, the new function covers both command and other events.
* src/keyboard.c (Finput_pending_p): Use the new function.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/keyboard.c, src/keyboard.h (requeued_events_pending_p): Add
function 'requeued_events_pending_p' (whose name was made available in
the previous commit). As opposed to the previous function with the same
name, the new function covers both command and other events.
* src/keyboard.c (Finput_pending_p): Use the new function.
</pre>
</div>
</content>
</entry>
<entry>
<title>* src/keyboard.c (requeued_events_pending_p): Improve name and fix comment</title>
<updated>2024-03-10T14:40:07+00:00</updated>
<author>
<name>Tim Ruffing</name>
</author>
<published>2023-12-27T13:29:34+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=385a02cffde6d0fd80ff189704ad70cfebc3e8d4'/>
<id>385a02cffde6d0fd80ff189704ad70cfebc3e8d4</id>
<content type='text'>
* src/keyboard.c, src/keyboard.h (requeued_events_pending_p): Rename to
'requeued_command_events_pending_p' to clarify that the function covers
only command events. Fix wrong comment that claimed that the function
was unused.
* src/process.c (wait_reading_process_output): Update caller to use the
new name.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/keyboard.c, src/keyboard.h (requeued_events_pending_p): Rename to
'requeued_command_events_pending_p' to clarify that the function covers
only command events. Fix wrong comment that claimed that the function
was unused.
* src/process.c (wait_reading_process_output): Update caller to use the
new name.
</pre>
</div>
</content>
</entry>
<entry>
<title>Extract check for end of macro to function</title>
<updated>2024-03-10T14:40:01+00:00</updated>
<author>
<name>Tim Ruffing</name>
</author>
<published>2023-12-27T13:26:26+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=fbc5fb2561d9e1d4e5b69b349a26c49d30ffc938'/>
<id>fbc5fb2561d9e1d4e5b69b349a26c49d30ffc938</id>
<content type='text'>
* src/macros.h (at_end_of_macro_p):
* src/macros.c (at_end_of_macro_p):
New function.
* src/keyboard.c (read_char): Use the new function.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/macros.h (at_end_of_macro_p):
* src/macros.c (at_end_of_macro_p):
New function.
* src/keyboard.c (read_char): Use the new function.
</pre>
</div>
</content>
</entry>
<entry>
<title>Check daemon is initialized before suppressing its init errors</title>
<updated>2024-02-24T09:24:26+00:00</updated>
<author>
<name>Spencer Baugh</name>
</author>
<published>2024-02-13T17:20:39+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=526c262149839702b94253d5eff195054ac5cd9e'/>
<id>526c262149839702b94253d5eff195054ac5cd9e</id>
<content type='text'>
Previously, the default error handler would correctly suppress
unhandled errors raised when IS_DAEMON and the initial frame
was current, since this is the normal state of operation for a
daemon-mode Emacs.  However, this also incorrectly suppressed
errors raised while a daemon-mode Emacs was starting up.

Now, errors raised while a daemon-mode Emacs is starting up will be
handled just like errors when a non-daemon Emacs is starting up.

This was previously the case before changes for bug#1310 and
bug#1836, which added the suppression of errors when IS_DAEMON.
DAEMON_RUNNING didn't exist at the time of those changes, but now
it does, so we can do better.

* src/keyboard.c (Fcommand_error_default_function): Check
!DAEMON_RUNNING in addition to IS_DAEMON.  (Bug#68799)
* src/lisp.h (DAEMON_RUNNING): Add a clarifying comment about
what this #define means.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, the default error handler would correctly suppress
unhandled errors raised when IS_DAEMON and the initial frame
was current, since this is the normal state of operation for a
daemon-mode Emacs.  However, this also incorrectly suppressed
errors raised while a daemon-mode Emacs was starting up.

Now, errors raised while a daemon-mode Emacs is starting up will be
handled just like errors when a non-daemon Emacs is starting up.

This was previously the case before changes for bug#1310 and
bug#1836, which added the suppression of errors when IS_DAEMON.
DAEMON_RUNNING didn't exist at the time of those changes, but now
it does, so we can do better.

* src/keyboard.c (Fcommand_error_default_function): Check
!DAEMON_RUNNING in addition to IS_DAEMON.  (Bug#68799)
* src/lisp.h (DAEMON_RUNNING): Add a clarifying comment about
what this #define means.
</pre>
</div>
</content>
</entry>
<entry>
<title>Make sure the binding shown by echo-keystrokes-help is not shadowed</title>
<updated>2024-02-11T20:34:41+00:00</updated>
<author>
<name>Dmitry Gutov</name>
</author>
<published>2024-02-11T20:32:44+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=c0f656617d6848b94413b79b390788565d338fcd'/>
<id>c0f656617d6848b94413b79b390788565d338fcd</id>
<content type='text'>
And choose just one binding to display rather than two together.
(https://lists.gnu.org/archive/html/emacs-devel/2024-02/msg00311.html)

* lisp/help.el (help--append-keystrokes-help): New function.

* src/keyboard.c (syms_of_keyboard): Add a symbol for it.
(echo_dash): Use them here.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
And choose just one binding to display rather than two together.
(https://lists.gnu.org/archive/html/emacs-devel/2024-02/msg00311.html)

* lisp/help.el (help--append-keystrokes-help): New function.

* src/keyboard.c (syms_of_keyboard): Add a symbol for it.
(echo_dash): Use them here.
</pre>
</div>
</content>
</entry>
<entry>
<title>; * src/keyboard.c (echo_dash): Mention F1 in echo_keystrokes_help.</title>
<updated>2024-02-08T06:48:20+00:00</updated>
<author>
<name>Eli Zaretskii</name>
</author>
<published>2024-02-08T06:48:20+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=a48cf0c94ca4a4e3fe045be6149025955e9dfa4f'/>
<id>a48cf0c94ca4a4e3fe045be6149025955e9dfa4f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Prevent echo area help message from being printed repeatedly</title>
<updated>2024-02-08T02:32:28+00:00</updated>
<author>
<name>Po Lu</name>
</author>
<published>2024-02-08T02:32:28+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=ed2450e79b597e0306f14b542e934a90dfd9786f'/>
<id>ed2450e79b597e0306f14b542e934a90dfd9786f</id>
<content type='text'>
* src/keyboard.c (echo_dash): Detect echo_keystrokes_help
messages and return if they be present.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/keyboard.c (echo_dash): Detect echo_keystrokes_help
messages and return if they be present.
</pre>
</div>
</content>
</entry>
</feed>
