<feed xmlns='http://www.w3.org/2005/Atom'>
<title>emacs/src, branch scratch/sigchld-fd</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>Don't crash if no asynchronous process has been created yet.</title>
<updated>2021-01-16T18:46:44+00:00</updated>
<author>
<name>Philipp Stephani</name>
</author>
<published>2021-01-10T16:59:29+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=df34ed8cbfdcf4584aa0ebfe827fac3a8d932bb6'/>
<id>df34ed8cbfdcf4584aa0ebfe827fac3a8d932bb6</id>
<content type='text'>
* src/process.c (wait_reading_process_output): Allow
child_signal_read_fd &lt; 0.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/process.c (wait_reading_process_output): Allow
child_signal_read_fd &lt; 0.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix deadlock when receiving SIGCHLD during 'pselect'.</title>
<updated>2021-01-16T18:46:44+00:00</updated>
<author>
<name>Philipp Stephani</name>
</author>
<published>2021-01-10T15:31:12+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=8f0ce42d3eb9b212424a4a25a376287ffc94a73e'/>
<id>8f0ce42d3eb9b212424a4a25a376287ffc94a73e</id>
<content type='text'>
If we receive and handle a SIGCHLD signal for a process while waiting
for that process, 'pselect' might never return.  Instead, we have to
explicitly 'pselect' that the process status has changed.  We do this
by writing to a pipe in the SIGCHLD handler and having
'wait_reading_process_output' select on it.

* src/process.c (child_signal_init): New helper function to create a
pipe for SIGCHLD notifications.
(child_signal_read, child_signal_notify): New helper functions to
read from/write to the child signal pipe.
(create_process): Initialize the child signal pipe on first use.
(handle_child_signal): Notify waiters that a process status has
changed.
(wait_reading_process_output): Make sure that we also catch
SIGCHLD/process status changes.

* test/src/process-tests.el
(process-tests/fd-setsize-no-crash/make-process): Remove workaround,
which is no longer needed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If we receive and handle a SIGCHLD signal for a process while waiting
for that process, 'pselect' might never return.  Instead, we have to
explicitly 'pselect' that the process status has changed.  We do this
by writing to a pipe in the SIGCHLD handler and having
'wait_reading_process_output' select on it.

* src/process.c (child_signal_init): New helper function to create a
pipe for SIGCHLD notifications.
(child_signal_read, child_signal_notify): New helper functions to
read from/write to the child signal pipe.
(create_process): Initialize the child signal pipe on first use.
(handle_child_signal): Notify waiters that a process status has
changed.
(wait_reading_process_output): Make sure that we also catch
SIGCHLD/process status changes.

* test/src/process-tests.el
(process-tests/fd-setsize-no-crash/make-process): Remove workaround,
which is no longer needed.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix last change</title>
<updated>2021-01-16T13:02:48+00:00</updated>
<author>
<name>Eli Zaretskii</name>
</author>
<published>2021-01-16T13:02:48+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=c55b7b8e1f46612849a25f035578a46fa3fe343b'/>
<id>c55b7b8e1f46612849a25f035578a46fa3fe343b</id>
<content type='text'>
* src/frame.c (Fset_mouse_position, Fset_mouse_pixel_position):
Don't compile the FRAME_MSDOS_P case on platforms other than
MSDOS, as that will never happen there.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/frame.c (Fset_mouse_position, Fset_mouse_pixel_position):
Don't compile the FRAME_MSDOS_P case on platforms other than
MSDOS, as that will never happen there.
</pre>
</div>
</content>
</entry>
<entry>
<title>Make mouse-related calls be more consistent on all frame types</title>
<updated>2021-01-16T13:02:10+00:00</updated>
<author>
<name>Jared Finder</name>
</author>
<published>2020-12-02T08:05:59+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=ba29d13f41b777969a324894ba82646d36e1ff5c'/>
<id>ba29d13f41b777969a324894ba82646d36e1ff5c</id>
<content type='text'>
* src/frame.c (Fset_mouse_position, Fset_mouse_pixel_position): Call
Fselect_frame and appropriate mouse_moveto function on all non-GUI
frame types, independent of #ifdef's.
* src/term.c (init_tty): Initialize mouse_face_window for all
non-GUI frame types.
(term_mouse_moveto) [HAVE_GPM]: Make available even if
HAVE_WINDOW_SYSTEM is defined.
* src/xdisp.c (try_window_id): Call gui_clear_window_mouse_face
in all cases.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/frame.c (Fset_mouse_position, Fset_mouse_pixel_position): Call
Fselect_frame and appropriate mouse_moveto function on all non-GUI
frame types, independent of #ifdef's.
* src/term.c (init_tty): Initialize mouse_face_window for all
non-GUI frame types.
(term_mouse_moveto) [HAVE_GPM]: Make available even if
HAVE_WINDOW_SYSTEM is defined.
* src/xdisp.c (try_window_id): Call gui_clear_window_mouse_face
in all cases.
</pre>
</div>
</content>
</entry>
<entry>
<title>* src/dispnew.c (sit_for): Return nil when interrupted by process output</title>
<updated>2021-01-16T03:38:52+00:00</updated>
<author>
<name>Stefan Monnier</name>
</author>
<published>2021-01-16T03:38:52+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=5d6817086d6485bc6e3dde054d877c0759656ddd'/>
<id>5d6817086d6485bc6e3dde054d877c0759656ddd</id>
<content type='text'>
Before adbb4eacc2a984c0fc0b65ec761368fd9067d6c5,
`read_and_dispose_of_process_output` called
`record_asynch_buffer_change` which added "artificial" input events
(in the form of BUFFER_SWITCH_EVENTs), causing sit_for to return
Qnil when interrupted by process output.  Without those BUFFER_SWITCH_EVENTs,
sit_for now tends to return Qt when interrupted by process output
making `read_char` believe that we've waited the whole timeout,
As consequence incoming process output tended to cause premature
auto-saving of files (sometimes right after almost every key press).

This patch recovers the previous behavior, which is not ideal
(incoming process output can delay auto-save indefinitely), but has
been good enough for many years.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before adbb4eacc2a984c0fc0b65ec761368fd9067d6c5,
`read_and_dispose_of_process_output` called
`record_asynch_buffer_change` which added "artificial" input events
(in the form of BUFFER_SWITCH_EVENTs), causing sit_for to return
Qnil when interrupted by process output.  Without those BUFFER_SWITCH_EVENTs,
sit_for now tends to return Qt when interrupted by process output
making `read_char` believe that we've waited the whole timeout,
As consequence incoming process output tended to cause premature
auto-saving of files (sometimes right after almost every key press).

This patch recovers the previous behavior, which is not ideal
(incoming process output can delay auto-save indefinitely), but has
been good enough for many years.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix 'window-text-pixel-size' when there are leading/trailing spaces</title>
<updated>2021-01-15T12:04:25+00:00</updated>
<author>
<name>Aaron Jensen</name>
</author>
<published>2021-01-10T02:43:32+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=4dc72dd9deb1c3394ada3de3f52bc7c1ff831ab6'/>
<id>4dc72dd9deb1c3394ada3de3f52bc7c1ff831ab6</id>
<content type='text'>
First, scan to find the first non-whitespace character and then
backtrack to find the beginning of the line.  The previous
algorithm always started on the non-whitespace character during
the backtrack, causing it to stop immediately and not actually
find the beginning of the line.  The same applies to the end of
line calculation.
* src/xdisp.c: (Fwindow_text_pixel_size): Fix off by one error.
(Bug#45748)

* test/src/xdisp-tests.el (xdisp-tests--window-text-pixel-size)
(xdisp-tests--window-text-pixel-size-leading-space)
(xdisp-tests--window-text-pixel-size-trailing-space): New tests.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
First, scan to find the first non-whitespace character and then
backtrack to find the beginning of the line.  The previous
algorithm always started on the non-whitespace character during
the backtrack, causing it to stop immediately and not actually
find the beginning of the line.  The same applies to the end of
line calculation.
* src/xdisp.c: (Fwindow_text_pixel_size): Fix off by one error.
(Bug#45748)

* test/src/xdisp-tests.el (xdisp-tests--window-text-pixel-size)
(xdisp-tests--window-text-pixel-size-leading-space)
(xdisp-tests--window-text-pixel-size-trailing-space): New tests.
</pre>
</div>
</content>
</entry>
<entry>
<title>Make libraries works with xterm-mouse-mode.</title>
<updated>2021-01-15T11:50:07+00:00</updated>
<author>
<name>Jared Finder</name>
</author>
<published>2021-01-02T22:10:17+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=66ac17289a5d04366a6b05eb5a105dff408b16b8'/>
<id>66ac17289a5d04366a6b05eb5a105dff408b16b8</id>
<content type='text'>
Change calls from 'read-event' to 'read-key' in libraries expecting
mouse events.  Do this only when 'xterm-mouse-mode' is enabled.  That
way those libraries read decoded mouse events instead of the
underlying escape sequence.  Add a parameter to 'read-key' that avoids
running any of the unbound fallbacks in 'read-key-sequence' so the
libraries can read mouse button-down events.

For backward compatibility purposes, the above logic is contained in a
new internal-only function: 'read--potential-mouse-event'.

* doc/lispref/commands.texi (Reading One Event): Document new
parameter to 'read-key'.  Mention that non-character events on
terminals need 'read-key'.
* lisp/subr.el (read-key-full-map): Add new keymap used by 'read-key'.
(read-key): Add new parameter 'fallbacks-disabled' to prevent running
any of the unbound fallbacks normally run by 'read-key-sequence'.
(read--potential-mouse-event): Add new function that calls 'read-key'
or 'read-event' depending on if 'xterm-mouse-mode' is set.
* lisp/foldout.el (foldout-mouse-swallow-events):
* lisp/isearch.el (isearch-pre-command-hook):
* lisp/mouse-drag.el (mouse-drag-throw, mouse-drag-drag):
* lisp/mouse.el (mouse-drag-secondary):
* lisp/ruler-mode.el (ruler-mode-mouse-grab-any-column)
(ruler-mode-mouse-drag-any-column-iteration):
* lisp/strokes.el (strokes-read-stroke, strokes-read-complex-stroke):
* lisp/textmodes/artist.el (artist-mouse-draw-continously)
(artist-mouse-draw-poly, artist-mouse-draw-2points):
* lisp/vc/ediff-wind.el (ediff-get-window-by-clicking):
* lisp/wid-edit.el (widget-button--check-and-call-button)
(widget-button-click): Call 'read--potential-mouse-event' instead of
'read-event'.
* lisp/wid-edit.el (widget-key-sequence-read-event): Call 'read-key'
with 'fallbacks-disabled' set instead of 'read-event'.  Unlike above
changes, this is unconditionally applied so it works for function
keys too.  Apply 'local-function-key-map' instead of
'function-key-map' as that contains the full terminal translations.
* lisp/vc/ediff.el (ediff-windows): Use 'display-mouse-p' to check if
a mouse is available.
* src/lread.c (Fread_event): Recommend 'read-key' in docstring for
'read-event' for non-character events.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change calls from 'read-event' to 'read-key' in libraries expecting
mouse events.  Do this only when 'xterm-mouse-mode' is enabled.  That
way those libraries read decoded mouse events instead of the
underlying escape sequence.  Add a parameter to 'read-key' that avoids
running any of the unbound fallbacks in 'read-key-sequence' so the
libraries can read mouse button-down events.

For backward compatibility purposes, the above logic is contained in a
new internal-only function: 'read--potential-mouse-event'.

* doc/lispref/commands.texi (Reading One Event): Document new
parameter to 'read-key'.  Mention that non-character events on
terminals need 'read-key'.
* lisp/subr.el (read-key-full-map): Add new keymap used by 'read-key'.
(read-key): Add new parameter 'fallbacks-disabled' to prevent running
any of the unbound fallbacks normally run by 'read-key-sequence'.
(read--potential-mouse-event): Add new function that calls 'read-key'
or 'read-event' depending on if 'xterm-mouse-mode' is set.
* lisp/foldout.el (foldout-mouse-swallow-events):
* lisp/isearch.el (isearch-pre-command-hook):
* lisp/mouse-drag.el (mouse-drag-throw, mouse-drag-drag):
* lisp/mouse.el (mouse-drag-secondary):
* lisp/ruler-mode.el (ruler-mode-mouse-grab-any-column)
(ruler-mode-mouse-drag-any-column-iteration):
* lisp/strokes.el (strokes-read-stroke, strokes-read-complex-stroke):
* lisp/textmodes/artist.el (artist-mouse-draw-continously)
(artist-mouse-draw-poly, artist-mouse-draw-2points):
* lisp/vc/ediff-wind.el (ediff-get-window-by-clicking):
* lisp/wid-edit.el (widget-button--check-and-call-button)
(widget-button-click): Call 'read--potential-mouse-event' instead of
'read-event'.
* lisp/wid-edit.el (widget-key-sequence-read-event): Call 'read-key'
with 'fallbacks-disabled' set instead of 'read-event'.  Unlike above
changes, this is unconditionally applied so it works for function
keys too.  Apply 'local-function-key-map' instead of
'function-key-map' as that contains the full terminal translations.
* lisp/vc/ediff.el (ediff-windows): Use 'display-mouse-p' to check if
a mouse is available.
* src/lread.c (Fread_event): Recommend 'read-key' in docstring for
'read-event' for non-character events.
</pre>
</div>
</content>
</entry>
<entry>
<title>Lift {global,local}-key-binding to Lisp</title>
<updated>2021-01-13T17:54:09+00:00</updated>
<author>
<name>Stefan Kangas</name>
</author>
<published>2021-01-13T17:54:09+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=a9658cd5b07e88a5d413cbb4dfd8f9d9d0c8bbf5'/>
<id>a9658cd5b07e88a5d413cbb4dfd8f9d9d0c8bbf5</id>
<content type='text'>
* lisp/subr.el (local-key-binding, global-key-binding): New defuns.
* src/keymap.c (Flocal_key_binding, Fglobal_key_binding): Remove DEFUNs.
(syms_of_keymap): Remove defsubrs for above DEFUNs.
* test/lisp/subr-tests.el (subr-test-local-key-binding)
(subr-test-global-key-binding): New tests.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* lisp/subr.el (local-key-binding, global-key-binding): New defuns.
* src/keymap.c (Flocal_key_binding, Fglobal_key_binding): Remove DEFUNs.
(syms_of_keymap): Remove defsubrs for above DEFUNs.
* test/lisp/subr-tests.el (subr-test-local-key-binding)
(subr-test-global-key-binding): New tests.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix 'visual-line-mode' when 'word-wrap-by-category' is in effect</title>
<updated>2021-01-13T14:45:31+00:00</updated>
<author>
<name>Eli Zaretskii</name>
</author>
<published>2021-01-13T14:45:31+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=19b169c4e22abe5112d36ff4740f382409f6acdf'/>
<id>19b169c4e22abe5112d36ff4740f382409f6acdf</id>
<content type='text'>
* src/xdisp.c (move_it_in_display_line_to): Don't reset
next_may_wrap after saving a potential wrap point.  This fixes the
case where several characters in a row can serve as a wrap point.
(Bug#45837)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/xdisp.c (move_it_in_display_line_to): Don't reset
next_may_wrap after saving a potential wrap point.  This fixes the
case where several characters in a row can serve as a wrap point.
(Bug#45837)
</pre>
</div>
</content>
</entry>
<entry>
<title>Add a new function 'buffer-line-statistics'</title>
<updated>2021-01-12T17:43:53+00:00</updated>
<author>
<name>Lars Ingebrigtsen</name>
</author>
<published>2021-01-12T17:43:53+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=792ba7196ff1171f44571d9ba9b88b96d5be85ad'/>
<id>792ba7196ff1171f44571d9ba9b88b96d5be85ad</id>
<content type='text'>
* src/fns.c (Fbuffer_line_statistics): New function.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/fns.c (Fbuffer_line_statistics): New function.
</pre>
</div>
</content>
</entry>
</feed>
