1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-16 08:10:43 -08:00
Commit graph

44429 commits

Author SHA1 Message Date
Po Lu
5bab113486 Add `xwidget-webkit-estimated-load-progress'
* doc/lispref/display.texi (Xwidgets): Document new function.
* etc/NEWS: Announce new function.

* src/xwidget.c (Fxwidget_webkit_estimated_load_progress): New
function.
(syms_of_xwidget): Define new subr.
2021-11-19 17:48:57 +08:00
Stefan Kangas
c6d5fccc92 Merge from origin/emacs-28
02853edba7 Fix sorting of menus in `context-menu-local' (bug#50067).
14271d050a Fix flyspell-correct-word selected from context menu opene...
bf824843f4 * lisp/repeat.el (describe-repeat-maps): Print all bound k...
6fc94fb99e * lisp/tab-bar.el: Use 'mouse-1' for history buttons like ...
5eeaf85767 Improve documentation of window hooks
7404f4b4e0 Improve doc string of 'highlight-nonselected-windows'
2021-11-19 07:00:24 +01:00
Eli Zaretskii
4da785ec98 ; Minor fixes of doc strings in xdisp.c
* src/xdisp.c (syms_of_xdisp) <redisplay-skip-initial-frame>
<redisplay--all-windows-cause, redisplay--mode-lines-cause>: Doc fix.
2021-11-18 19:17:52 +02:00
Mattias Engdegård
d7f52c6466 ; * src/macfont.m: fix typing errors 2021-11-18 10:03:13 +01:00
Eli Zaretskii
7404f4b4e0 Improve doc string of 'highlight-nonselected-windows'
* src/xdisp.c (syms_of_xdisp) <highlight-nonselected-windows>:
Clarify the doc string.  (Bug#51927)
2021-11-18 08:46:17 +02:00
Eli Zaretskii
bf04c19cdd Fix recent changes related to USABLE_SIGIO
* src/process.c (wait_reading_process_output) [WINDOWSNT]:
* src/keyboard.c (handle_async_input) [DOS_NT]: Ifdef away the
code that is not needed on MS-Windows.  (Bug#50403) (Bug#51820)
2021-11-17 20:33:40 +02:00
Ken Brown
d4e2915dab Make process_pending_signals useful on systems without SIGIO
* src/keyboard.c (handle_async_input): Call gobble_input
unconditionally, not just if USABLE_SIGIO is defined.  This makes
process_pending_signals do something useful on systems that have
to poll for input.  (Bug#51820)
2021-11-17 13:02:44 -05:00
Ken Brown
5896ca8925 Avoid delays waiting for input on systems without SIGIO
* src/process.c (wait_reading_process_output) [!USABLE_SIGIO]: If
we're waiting for input, don't use a timeout of more than 25 msec
in the call to select.  (Bug#50043)
2021-11-17 11:56:14 -05:00
Po Lu
3b2421e6a7 Prevent subprocess hangs in xwidget
* src/xwidget.c (Fmake_xwidget, Fxwidget_webkit_goto_url): Use
`catch_child_signal' instead of trying to preserve the previous
signal handler.
2021-11-17 21:32:52 +08:00
Po Lu
9ae741750c Don't draw xwidgets that have just been resized
This serves to eliminate the huge black bar displayed when the
offscreen widget has been resized (and as such the damage event
signal is sent), but the X window hasn't.

* src/xwidget.c (xv_do_draw): Don't draw xwidgets that have
just been resized.
(x_draw_xwidget_glyph_string)
(xwidget_init_view): Clear just_resized.

(Fxwidget_resize): Set just_resized first, then queue allocate.
2021-11-17 20:34:30 +08:00
Alan Third
058c012f73 Only set LANG if the ID is valid
* src/nsterm.m (ns_init_locale): Check the provided locale identifier
is available before trying to use it.
2021-11-16 20:52:10 +00:00
Lars Ingebrigtsen
ee2a578456 Fix compilation error in previous keymap.c change
* src/keymap.c (initial_define_lispy_key, define_as_prefix): Fix
--enable-checking error.
2021-11-16 14:10:56 +01:00
Po Lu
8d0c19fb0c Lower xwidget views owned by parent when lowering frame
* src/xterm.c (x_lower_frame): Lower parent frame's xwidget
views as well.

* src/xwidget.h (lower_frame_xwidget_views):
* src/xwidget.c (lower_frame_xwidget_views): New function.
2021-11-16 17:51:07 +08:00
Lars Ingebrigtsen
de477ec683 Add new 'keymap-*' functions
* lisp/keymap.el: New file with all the new keymap-* functions.

* lisp/loadup.el ("keymap"): Load.

* lisp/subr.el (kbd): Refactor out all the code to key-parse.
(define-key-after, keyboard-translate, global-set-key)
(local-set-key, global-unset-key, local-unset-key)
(local-key-binding, global-key-binding)
(substitute-key-definition): Note in doc strings that these are
legacy functions.
(define-keymap--define): Use keymap-set.

* lisp/emacs-lisp/byte-opt.el: Remove the optimizations for
defvar-keymap and define-keymap since the macros now only
understand the kbd syntax.
* lisp/emacs-lisp/bytecomp.el (byte-compile-define-keymap)
(byte-compile-define-keymap--define): Warn about invalid key
definitions in all keymap-* functions.

* lisp/emacs-lisp/shortdoc.el (keymaps): Add shortdocs form
keymap* functions.

* src/keymap.c (possibly_translate_key_sequence): Adjust callers
to key-valid-p and key-parse.
(syms_of_keymap): Adjust defs.
2021-11-16 08:26:24 +01:00
Lars Ingebrigtsen
560c921ed8 Allow removing keymap definitions
* src/keymap.c (initial_define_lispy_key): Adjust caller.
(store_in_keymap): Allow removing definitions in addition to
setting them to nil.
(Fdefine_key): Ditto.
(define_as_prefix): Adjust caller.

* src/term.c (term_get_fkeys_1): Adjust caller.
2021-11-16 08:26:24 +01:00
Stefan Kangas
e0abd83b49 Merge from origin/emacs-28
e852822f3d Fix removal of fringe marks of deleted bookmarks
b418aad85a * lisp/repeat.el (repeat-echo-message): Bind message-log-m...
fe2ac7cb7c * lisp/repeat.el (describe-repeat-maps): Use help-fns--ana...
c840bfe7e1 * lisp/repeat.el: Detect changes in the minibuffer state (...
5044151486 Avoid segfaults due to freed face cache
199e2468d3 Doc fix; change recommended file name of custom-file
2021-11-16 07:18:19 +01:00
Po Lu
7cfc3f34bb Prevent xwidget windows from obscuring child frames
* src/xwidget.c (x_draw_xwidget_glyph_string): Lower view window
when creating it.
2021-11-16 09:32:37 +08:00
Po Lu
367cf464a1 Fix documentation string
* src/xwidget.c (Vxwidget_list, Vxwidget_views_list): Fix
horrid doc string.
2021-11-16 09:32:37 +08:00
Eli Zaretskii
5044151486 Avoid segfaults due to freed face cache
* src/xfaces.c (face_at_buffer_position): Make sure DEFAULT_FACE
is usable.  (Bug#51864)
2021-11-15 15:35:31 +02:00
Po Lu
d5a4772712 Fix xwidget-webkit-back-forward-list
* src/xwidget.c (Fxwidget_webkit_back_forward_list): Use correct
list variable in loop.
2021-11-15 13:43:55 +08:00
Po Lu
d9e91da769 Stop assuming xwidget views will only be displayed in TEXT_AREA
* src/xterm.c (x_scroll_run): Use view->area when calculating
xwidget view clipping.

* src/xwidget.c (x_draw_xwidget_glyph_string): Set view->area
to s->area and use that instead.

* src/xwidget.h (struct xwidget_view): Add glyph row area field.
2021-11-15 09:27:31 +08:00
Ken Brown
364cf2494c Prefer POSIX timers to timerfd timers
* src/atimer.c (set_alarm): Try to start a POSIX timer before
starting a timerfd timer.  On Cygwin, return if the POSIX timer is
started successfully. (Bug#51734)
2021-11-14 14:06:55 -05:00
Stefan Monnier
572eed83fc * src/lread.c (read_escape): Fix handling of ?\C-<char> for chars 128-255 2021-11-14 12:56:11 -05:00
Eli Zaretskii
96806a22fb Merge from origin/emacs-28
a56dd60 Improve style and comments in font-related sources
2021-11-14 15:02:40 +02:00
Eli Zaretskii
289f3a9e5f Add more files to be natively-compiled AOT
* src/Makefile.in (elnlisp): Add emacs-lisp/gv.eln and other
missing dependencies of comp.el.
2021-11-14 14:46:27 +02:00
Po Lu
c3f53d2604 Expose xwidget navigation history to Lisp code
* doc/lispref/display.texi (Xwidgets): Document changes.
* etc/NEWS: Announce new function.
* src/xwidget.c (Fxwidget_webkit_back_forward_list): New
function.
(syms_of_xwidget): Define new subr.
2021-11-14 17:45:23 +08:00
Po Lu
609bc1d33a Add `kill-xwidget'
* doc/lispref/display.texi (Xwidgets): Document 'kill-xwidget'.
* src/xwidget.c (kill_xwidget, Fkill_xwidget): New function.
(syms_of_xwidget): Define new subr.
(kill_buffer_xwidgets): Use `kill_xwidget' instead.
2021-11-14 17:42:16 +08:00
Po Lu
9627b731c0 Fix crash in xwidget_end_redisplay
* src/xwidget.c (xwidget_end_redisplay): Always test if xv is
NULL.
2021-11-14 10:00:40 +08:00
Eli Zaretskii
480241983e Fix compilation on MS-Windows
* src/callproc.c (emacs_spawn) <fork_done>: Define the label only
if USABLE_POSIX_SPAWN is defined, to avoid a compiler warning.

(cherry picked from commit a8fc080851)
2021-11-13 16:46:31 +01:00
Philipp Stephani
cc4edea872 Use posix_spawn if possible.
posix_spawn is less error-prone than vfork + execve, and can make
better use of system-specific enhancements like 'clone' on Linux.  Use
it if we don't need to configure a pseudoterminal.

Backported from commit a60053f836.
Unlike that commit, only define USABLE_POSIX_SPAWN on macOS, because
there posix_spawn is much faster than vfork.

Don't merge to master.

* configure.ac (HAVE_SPAWN_H, HAVE_POSIX_SPAWN)
(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR)
(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR_NP)
(HAVE_POSIX_SPAWNATTR_SETFLAGS, HAVE_DECL_POSIX_SPAWN_SETSID): New
configuration variables.
* src/callproc.c (USABLE_POSIX_SPAWN): New configuration macro.
(emacs_posix_spawn_init_actions)
(emacs_posix_spawn_init_attributes, emacs_posix_spawn_init): New
helper functions.
(emacs_spawn): Use posix_spawn if possible.

(cherry picked from commit a60053f836)
2021-11-13 16:45:19 +01:00
Eli Zaretskii
a56dd60d2f Improve style and comments in font-related sources
* src/w32font.c (fill_in_logfont): Stylistic changes.
* src/font.h (font_property_index, font_select_entity):
Add/improve comments.
2021-11-13 16:37:39 +02:00
Po Lu
f7abc04c40 Fix scroll event test in handle_one_xevent
* src/xterm.c (handle_one_xevent): Test for scroll wheel button
correctly in xwidget code.
2021-11-13 21:38:06 +08:00
Eli Zaretskii
89d7a71ce6 Fix font selection via :family on MS-Windows
* src/font.c (font_delete_unmatched) [HAVE_NTGUI]: Allow non-exact
matches of :weight when looking for a suitable font.  (Bug#51768)
2021-11-13 15:22:12 +02:00
Alan Mackenzie
f740becf8a Correct patch from 2021-11-12 on src/fileio.c
* src/fileio.c (restore_window_points): Reverse commit
974192413f and instead replace a < by a <=.
This ensures that if w->mpoint is at the top of the middle region being
replaced, it gets adjusted and stays at the top after the reinsertion.
2021-11-13 12:58:23 +00:00
Po Lu
102406edb1 Don't emit SELECT_WINDOW_EVENT when an xwidget is scrolled
* src/xterm.c (handle_one_event): Don't select xwidget window
on button event if the button pressed actually represents the
scroll wheel.
2021-11-13 20:04:47 +08:00
Po Lu
dafebe37eb Use GTK native file choosers in xwidget callback
* src/xwidget.c (run_file_chooser_cb): Use GtkFileChooserNative
instead.
2021-11-13 15:38:12 +08:00
Stefan Kangas
b4c6ab8cb6 Merge from origin/emacs-28
42d4e24ff3 ; Fix typos
0d0125daae Improve documentation of 'decode-coding-region'
2021-11-13 07:00:30 +01:00
Po Lu
a5008352c4 Prevent NULL-pointer dereference on xwidget callback error
* src/xwidget.c (webkit_javascript_finished_cb): Check if
`error' is NULL before freeing it.
2021-11-13 13:02:09 +08:00
Po Lu
eb4567e5be Fix file chooser hangs inside xwidget-webkit
* src/xwidget.c (run_file_chooser_cb): New function that runs
a nested event loop instead of acting asynchronously.
(Fmake_xwidget): Attach file chooser signal.
2021-11-13 11:24:13 +08:00
Po Lu
59a58328bc Remove unused xwidget code in EmacsFixed GTK widget class
This is no longer required, as we rely on X to position
xwidgets now.  It also makes resizing Emacs frames slightly
slower.

* src/emacsgtkfixed.c (EMACS_FIXED_GET_CLASS)
(struct GtkFixedPrivateL)
(emacs_fixed_gtk_widget_size_allocate)
(emacs_fixed_class_init) [HAVE_XWIDGETS]: Remove unused code.
2021-11-13 08:51:32 +08:00
Ken Brown
e4f8ce7818 Don't start both timerfd and alarms on Cygwin
* src/atimer.c (set_alarm) [CYGWIN]: Don't start both timerfd and
alarms; this causes a slowdown.  (Bug#51734)
2021-11-12 15:04:49 -05:00
Alan Mackenzie
974192413f In insert_file_contents, always set windows' point markers.
This fixes bug #51776.

* src/fileio.c (restore_window_points): Restore a w->mpoint even when that
marker originally pointed into the unchanged area near BOB or EOB.  This
prevents that window's point being moved a long way from its starting place
due to the removal of the central part of the buffer by insert_file_contents.
2021-11-12 18:43:22 +00:00
Stefan Kangas
42d4e24ff3 ; Fix typos 2021-11-12 13:59:58 +01:00
Eli Zaretskii
0d0125daae Improve documentation of 'decode-coding-region'
* src/coding.c (Fdecode_coding_region): Doc fix.

* doc/lispref/nonascii.texi (Coding System Basics)
(Explicit Encoding): Explain the significance of using 'undecided'
in 'decode-coding-*' functions.
2021-11-12 10:53:52 +02:00
Eli Zaretskii
766f636a72 ; * src/lread.c (safe_to_load_version, Fload): Fix coding style. 2021-11-12 09:47:44 +02:00
Lars Ingebrigtsen
0c3bf6ce11 Remove unused xlfd_ enums
* src/xfaces.c: Remove xlfd_weight, xlfd_swidth and xlfd_slant
enums.  These seem to be unused in the Emacs sources.
2021-11-12 08:23:45 +01:00
Po Lu
e9a68b1de5 Remove obsolete comment
The comment probably dated back to when xwidgets supported
many other GTK+ widgets with other data.  In the current
implementation of xwidgets, everything that should be freed
is already freed in `kill_buffer_xwidgets'.

* src/xwidget.c (kill_buffer_xwidgets): Remove outdated TODO.
2021-11-12 14:31:36 +08:00
Lars Ingebrigtsen
dae3c4e89b Allow choosing regular-weighted fonts when medium-weighted exist
* src/ftfont.c (ftfont_pattern_entity): Allow using both regular
and medium-weighted fonts.
2021-11-12 07:19:25 +01:00
Stefan Kangas
fc00fe53e1 Merge from origin/emacs-28
a6905e90cc Fix problem with temp buffer killing in package-install-file
144ad77fda Fix Lisp Intro markup error
24b86cb4f7 Fix ACL errors with WebDAV volumes on MS-Windows
2021-11-12 07:17:11 +01:00
Po Lu
070d6297ca Fix doc string for xwidget-webkit-load-html
* src/xwidget.c (Fxwidget_webkit_load_html): Fix doc string.
2021-11-12 14:16:31 +08:00