1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-26 07:33:47 +00:00
Commit Graph

154800 Commits

Author SHA1 Message Date
Stefan Kangas
200627c255 Merge from origin/emacs-28
0090318c61 * lib-src/seccomp-filter.c (main): Use faccessat2 only if ...
3bb01a499b Fix regression in derived-mode-init-mode-variables
2022-03-06 06:32:23 +01:00
Po Lu
e09bbfc37d Implement "window cascading" on NS
* src/nsfns.m (Fx_create_frame): Cascade new frame position if
size hint flags are not USPosition or PPosition.
2022-03-06 10:43:25 +08:00
Po Lu
db2cb522e1 Reduce non-toolkit scroll bar flicker
* src/xterm.c (x_scroll_bar_create): Initialize double buffer
for scroll bar.
(x_scroll_bar_set_handle)
(x_scroll_bar_remove, x_scroll_bar_expose): Draw to back buffer
instead.
(x_scroll_bar_end_update): New function.
(x_scroll_bar_clear): Fill the scroll bar with the background
instead when double buffered.
* src/xterm.h (struct scroll_bar): New field `x_drawable'.
2022-03-06 10:02:03 +08:00
Po Lu
c9667e9b60 Fix reporting of menu bar wheel events on no toolkit builds
* src/xterm.c (x_toolkit_position): Handle menu bar position
on no-toolkit builds.
(x_create_terminal): Always add `toolkit_position_hook'.
2022-03-06 08:56:46 +08:00
Robert Pluim
98d2dc6522 Use pselect instead of select in nsterm.m
* src/nsterm.m ([EmacsApp fdhandler:]): Use pselect instead of
the single remaining use of select (because we try to avoid using
select directly) (bug#54245).
2022-03-05 20:00:09 +01:00
Lars Ingebrigtsen
d70ad7229a Fix emacs-module-test after recent changes
* test/Makefile.in ($(test_module)): Include libgnu.a in the
module test (because the module uses functions from gnulib)
(bug#32452).
2022-03-05 19:06:20 +01:00
Andreas Schwab
0090318c61 * lib-src/seccomp-filter.c (main): Use faccessat2 only if defined. 2022-03-05 14:41:22 +01:00
Po Lu
1e1d2f18c6 Obey decorator-specified width and height of tooltip frames on Haiku
* src/haiku_support.cc (BWindow_dimensions): New functions.
* src/haiku_support.h: Update prototypes.
* src/haikufns.c (Fx_show_tip): Use actual dimensions, because
the decorator might specify a minimum width and height for the
tooltip frame.
* src/haikuterm.c (haiku_update_size_hints): Ignore tooltip
frames.
2022-03-05 10:20:04 +00:00
Po Lu
8969953328 Garbage Haiku tooltip frames on size change
* haikuterm.c (haiku_read_socket): If tooltip frame dimensions
actually changed, garbage the frame.
2022-03-05 06:24:09 +00:00
Paul Eggert
2f5a8c4f27 Fix process-attributes time precision on BSD
* src/sysdep.c (timeval_to_timespec) [__FreeBSD__ || DARWIN_OS]:
Remove; no longer needed.
(make_lisp_s_us) [__FreeBSD__ || DARWIN_OS || __OpenBSD__]:
New function.
(make_lisp_timeval) [__FreeBSD__ || DARWIN_OS || __OpenBSD__]:
Rework in terms of make_lisp_s_us.
(system_process_attributes) [__FreeBSD__ || DARWIN_OS ||
__OpenBSD__]: Simplify by using the above.  This fixes some minor
problems where timestamps promised more precision than was
actually available.
2022-03-04 19:29:06 -08:00
Paul Eggert
2fbd48f733 Fix process-attributes time precision on GNU/Linux
* src/sysdep.c [GNU_LINUX]:
(time_from_jiffies): Simplify by using time-convert.  Change args
and result type.  All uses changed.
(ltime_from_jiffies): Remove; call time_from_jiffies instead.
(put_jiffies): New function.
(get_up_time): Return Lisp_Object not struct timespec.
All uses changed.  Simplify by using time-add.
(system_process_attributes): Simplify by using the above.
This fixes some minor problems where timestamps promised more
precision than was actually available.  When info is not
available (e.g., sysconf fails) do not place it into the alist.
* src/timefns.c (float_time): Now extern.
2022-03-04 19:29:05 -08:00
Paul Eggert
b19ec1be3c %CPU can exceed 100 on GNU/Linux
* src/sysdep.c (system_process_attributes) [GNU_LINUX]:
CPU usage can exceed 100% on a multicore platform when Emacs is
not entirely single-threaded.
2022-03-04 19:29:05 -08:00
Paul Eggert
af742bb3bb Avoid unnecessary make_float in time arithmetic
* src/timefns.c (float_time): New function.
(time_arith, Ffloat_time): Use it.
2022-03-04 19:29:04 -08:00
Paul Eggert
58b5652f6b Fix FreeBSD typo in process-attributes cstime
* src/sysdep.c (system_process_attributes) [__FreeBSD__]:
Fix typo that caused cstime to always equal cutime.
2022-03-04 19:29:04 -08:00
Po Lu
3c5aad0b8b Flush default GC before using it in functions that accept a GContext
* src/xterm.c (x_scroll_run): Flush normal_gc, since some of the
following code depends on it being up-to-date.
2022-03-05 11:13:37 +08:00
Po Lu
4564ae5a3d Remove render code in x_scroll_run and drop NoExpose events instead
* src/xterm.c (x_scroll_run): Stop avoiding NoExpose events
through XRenderComposite.
(handle_one_xevent): Drop NoExpose events to placate some code
in Athena widgets.
2022-03-05 10:47:32 +08:00
Dmitry Gutov
a658be7742 project-shell: Ensure the resulting buffer is live
* lisp/progmodes/project.el (project-shell):
Make sure to recreate the shell if the buffer exists but not live
(https://lists.gnu.org/archive/html/emacs-devel/2022-03/msg00017.html).
2022-03-05 04:33:10 +02:00
Po Lu
76d79e1576 Prevent some NoExpose events from being generated
* src/xterm.c (x_scroll_run): Use the rendering extension if
available to avoid NoExpose events.
2022-03-05 10:05:14 +08:00
Po Lu
6efed75ff3 Implement `pre_activate' callbacks for Motif menus
* lwlib/lwlib-Xm.c (make_menu_in_widget): Add
xm_pop_up_callback as the popup callback.
(xm_pop_up_callback): New function.
2022-03-05 09:35:44 +08:00
Po Lu
08221a58b7 Fix the MS-DOS build
* msdos/sedlibmk.inp: Update for gnulib merge.
2022-03-05 08:15:25 +08:00
Stefan Monnier
6ad223fa9f trace.el: Preserve the line structure
Print newlines appearing inside values (i.e. inside strings) as \n
rather than actual newlines so as to avoid messing up the main
structure of the trace buffer.

* lisp/emacs-lisp/trace.el (trace-entry-message)
(trace-exit-message, trace--read-args): Quote newlines
2022-03-04 12:18:41 -05:00
Lars Ingebrigtsen
5f7db63a93 Avoid statting directories on startup for Info
* doc/misc/efaq.texi (File-name conventions) Mention
Info-directory-list instead.

* doc/misc/info.texi (Emacs Info Variables): Mention
Info--default-directory-list.

* lisp/info.el (Info-default-directory-list): Default to nil to
avoid statting directories on Emacs startup (bug#27933).
(Info--default-directory-list): Factored out into own function.
(Info-default-dirs): Append value of Info-default-directory-list
to the value returned from Info--default-directory-list.
2022-03-04 17:36:20 +01:00
Lars Ingebrigtsen
18e25c198f Improve scroll-bar-mode/default-frame-alist interaction docs
* lisp/scroll-bar.el (scroll-bar-mode): Mention
default-frame-alist (bug#54237).

* src/frame.c (syms_of_frame): Clarify further that setting this
variable may have unintended consequences.
2022-03-04 16:55:57 +01:00
Lars Ingebrigtsen
cdbc2f9d27 Add some sleeps to gnutls_try_handshake
* admin/merge-gnulib (GNULIB_MODULES): Add the nanosleep module.
* m4/gnulib-comp.m4 (gl_EARLY):
* lib/gnulib.mk.in: Automatic update.

* m4/nanosleep.m4:
* lib/nanosleep.c: New module.

* nt/mingw-cfg.site (gl_cv_func_free_preserves_errno):
* nt/gnulib-cfg.mk (OMIT_GNULIB_MODULE_nanosleep): Omit nanosleep,
since mingw has it.

* src/gnutls.c (gnutls_try_handshake): Add some sleeping to the
busy-wait loop so that we don't use 100% CPU here (bug#32452).
2022-03-04 16:27:10 +01:00
Lars Ingebrigtsen
3bb01a499b Fix regression in derived-mode-init-mode-variables
* lisp/emacs-lisp/derived.el (derived-mode-init-mode-variables):
Fix regression caused by lexical-binding derived.el (bug#54240).
2022-03-04 16:19:54 +01:00
Po Lu
345c4c6532 Add a few warnings about special event structures on X
* xterm.c (x_construct_mouse_click)
(x_note_mouse_movement): Add comments explaining the nature of
some special event structures.
2022-03-04 20:54:02 +08:00
Po Lu
f685bcb65d Fix some errors in stretch glyphs code on PGTK
* src/pgtkterm.c (x_draw_stretch_glyph_string): Remove
unnecessary code.  Reported by Eli Zaretskii <eliz@gnu.org>.
2022-03-04 20:39:31 +08:00
Eli Zaretskii
33958bcd3d Fix wording and punctuation in recent Gnus documentation changes
* lisp/gnus/nnselect.el (nnselect-allow-ephemeral-expiry): Make
the first sentence of the doc string be a single line.

* doc/misc/gnus.texi (Creating Search Groups): Fix space between
sentences.
2022-03-04 13:52:09 +02:00
Po Lu
f9f6c67181 Initialize time inside motion and button events converted from XI events
* src/xterm.c (handle_one_xevent): Make sure time is initialized
in artificial events passed to functions that use it.
2022-03-04 18:34:57 +08:00
Andrew G Cohen
62d97d4afd Turn expiry on for nnselect groups
Articles in (persistent) groups from the gnus/nnselect backend will
now be run through the expiry process upon exit, like other persistent
groups. Expiry is not on by default for ephemeral nnselect groups but
may be turned on with nnselect-allow-ephemeral-expiry set to t.

* lisp/gnus/nnselect.el (nnselect-request-expire-articles): Make
article expiry work.
(nnselect-allow-ephemeral-expiry): New variable.
* doc/misc/gnus.texi (Creating Search Groups): Document
nnselect-allow-ephemeral-expiry.
2022-03-04 16:20:01 +08:00
Andrew G Cohen
4f6583ab8a ; Fetch the nnselect-rescan parameter from the topic or group
* lisp/gnus/nnselect.el (nnselect-request-scan-group): Allow the
nnselect-rescan parameter to be set in the topic or the group.
2022-03-04 16:08:32 +08:00
Po Lu
b305f5a3ab Correctly process legacy XI wheel events on top of scroll bars
* src/xterm.c (handle_one_xevent): Handle XI button events
generated by scroll wheels on top of scroll bars.
2022-03-04 14:16:15 +08:00
Po Lu
6058daedf7 Pass core scroll wheel events outside the edit widget to Emacs on GTK
* src/xterm.c (x_construct_mouse_click): Translate coordinates
if the event window is not the edit widget window.
(handle_one_xevent): Treat core scroll wheel events specially,
if mouse_or_wdesc_frame did not find the frame.
2022-03-04 09:43:52 +08:00
Po Lu
4df7bb9c01 Fix display of stretch glyphs when hscrolled on PGTK
* pgtkterm.c (x_draw_stretch_glyph_string): Use correct box
dimensions.
2022-03-04 09:13:08 +08:00
Po Lu
cba88c275b * src/pgtkterm.c (pgtk_draw_fringe_bitmap): Synchronize logic with X. 2022-03-04 09:11:36 +08:00
Po Lu
848e96acdd ; * src/nsterm.m (ns_draw_fringe_bitmap): Fix typo in last change. 2022-03-04 09:08:33 +08:00
Po Lu
a421f40d87 Synchronize NS fringe bitmap code with X
* nsterm.m (ns_draw_fringe_bitmap): Redefine bitmap if it does
not already exist.
2022-03-04 09:06:20 +08:00
Po Lu
77483ac881 Synchronize Haiku fringe bitmap code with X
* haikuterm.c (haiku_draw_fringe_bitmap):
(haiku_define_fringe_bitmap):
(haiku_destroy_fringe_bitmap): Synchronize logic with X.
2022-03-04 01:01:07 +00:00
Po Lu
18868de463 Merge from origin/emacs-28
29ff903bb0 Avoid crashes when fringe bitmaps are defined in daemon mode
92e2d19fe7 One more fix of the BPA implementation
cd51d9c7ab Fix handling of brackets in BPA
2022-03-04 00:52:18 +00:00
Philipp Stephani
aeb25f9d3d Teach Edebug about the special '&whole' syntax for compiler macros.
* lisp/emacs-lisp/cl-macs.el (cl-define-compiler-macro-list): New
Edebug element specification.
(cl-define-compiler-macro): Use it.

* test/lisp/emacs-lisp/cl-macs-tests.el
(cl-define-compiler-macro/edebug): New unit test.
2022-03-03 19:57:00 +01:00
Eli Zaretskii
29ff903bb0 Avoid crashes when fringe bitmaps are defined in daemon mode
* src/dispextern.h (gui_define_fringe_bitmap): Add prototype.
(max_used_fringe_bitmap): Add declaration.
* src/fringe.c (gui_define_fringe_bitmap): New function.
* src/w32term.c (w32_draw_fringe_bitmap):
* src/xterm.c (x_draw_fringe_bitmap) [USE_CAIRO]: Call
'gui_define_fringe_bitmap' if the terminal-specific bitmap data is
not available when a fringe bitmap is about to be drawn.  Don't
try to draw a bitmap that is not known to fringe.c.  (Bug#54183)
2022-03-03 20:31:33 +02:00
Stefan Monnier
dc8a692f97 (with-demoted-errors): Fix bug#54225
* lisp/subr.el (with-demoted-errors): Adjust to argument order of
`macroexp-warn-and-return` changed in f262a6af36.
2022-03-03 10:12:44 -05:00
Lars Ingebrigtsen
b6587090bf Fix clobbering of match data in executable-set-magic
* lisp/progmodes/executable.el (executable-set-magic): Switching
buffers may clobber match data, so save the match data first
(bug#54218).
2022-03-03 15:43:35 +01:00
Jim Porter
d72cd4a2b7 Allow splitting strings in Eshell expansions with "plain" strings
Since '$var[hello 0]' doesn't make sense when 'var' is a string, the
previous restriction was unnecessary.

* lisp/eshell/esh-var.el (Commentary): Update documentation.
(eshell-apply-indices): Allow "plain" strings to split strings.

* test/lisp/eshell/esh-var-test.el
(esh-var-test/interp-var-string-split-indices)
(esh-var-test/quoted-interp-var-string-split-indices): Update tests.

* doc/misc/eshell.texi (Dollars expansion): Update documentation.
2022-03-03 14:59:33 +01:00
Jim Porter
990f36fa10 Fix parsing of indices in Eshell expansions
Previously, more-complex index expansions, like '$var[":" 0]' or
'$var[$(expr) 0]' failed to parse correctly.

* lisp/eshell/esh-var.el (Commentary): Clarify indexing and length
expansions.
(eshell-parse-indices): Expand docstring and support parsing inside
double-quotes.
(eshell-eval-indices): New function.
(eshell-parse-variable): Use it.

* test/lisp/eshell/esh-var-tests.el (eshell-test-value): New defvar.
(esh-var-test/interp-var-indices,
(esh-var-test/interp-var-split-indices)
(esh-var-test/interp-var-string-split-indices)
(esh-var-test/interp-var-regexp-split-indices)
(esh-var-test/interp-var-assoc, esh-var-test/interp-var-length-list)
(esh-var-test/interp-var-length-string)
(esh-var-test/interp-var-length-alist)
(esh-var-test/quoted-interp-var-indices)
(esh-var-test/quoted-interp-var-split-indices)
(esh-var-test/quoted-interp-var-string-split-indices)
(esh-var-test/quoted-interp-var-regexp-split-indices)
(esh-var-test/quoted-interp-var-assoc)
(esh-var-test/quoted-interp-var-length-list)
(esh-var-test/quoted-interp-var-length-string)
(esh-var-test/quoted-interp-var-length-alist): New tests.

* doc/misc/eshell.texi (Dollars Expansion): Expand and reword
documentation for indexing and length expansions.
2022-03-03 14:59:33 +01:00
Jim Porter
cccee7e840 Fix Eshell dollar interpolation inside of double-quotes
For example,

  echo "${echo hi}"

previously tried to run the program named 'echo hi', instead of 'echo'
with the argument 'hi'.

* lisp/eshell/esh-arg.el (eshell-parse-inner-double-quote):
New function.

* lisp/eshell/esh-var.el (eshell-parse-variable-ref): Support parsing
when wrapped in double-quiotes.

* test/lisp/eshell/esh-var-tests.el (esh-var-test/interp-var)
(esh-var-test/interp-quoted-var)
(esh-var-test/interp-quoted-var-concat)
(esh-var-test/quoted-interp-var)
(esh-var-test/quoted-interp-quoted-var)
(esh-var-test/quoted-interp-lisp, esh-var-test/quoted-interp-cmd)
(esh-var-test/quoted-interp-temp-cmd): New tests.
2022-03-03 14:59:33 +01:00
Jim Porter
ae1acb6017 Add a new macro to simplify parsing temporary Eshell command strings
This abstracts out the somewhat-unusual "insert&delete" logic in
'eshell-parse-command' so that it can be used elsewhere, and also
ensures that the deletion occurs even if an an error occurs.

* lisp/eshell/esh-cmd.el (eshell-with-temp-command): New macro.
(eshell-parse-command): Use it.
2022-03-03 14:59:33 +01:00
Jim Porter
7c7a4c26cb Move Eshell variable interpolation tests to their own file
* test/lisp/eshell/eshell-tests.el (eshell-test/interp-cmd)
(eshell-test/interp-lisp, eshell-test/interp-temp-cmd)
(eshell-test/interp-concat, eshell-test/interp-concat-lisp)
(eshell-test/interp-concat2, eshell-test/interp-concat-lisp2)
(eshell-test/interp-cmd-external)
(eshell-test/interp-cmd-external-concat, eshell-test/window-height)
(eshell-test/window-width, eshell-test/last-result-var)
(eshell-test/last-result-var2, eshell-test/last-arg-var):
Move from here...

* test/lisp/eshell/esh-var-test.el (esh-var-test/interp-lisp)
(esh-var-test/interp-cmd, esh-var-test/interp-cmd-external)
(esh-var-test/interp-temp-cmd, esh-var-test/interp-concat-lisp)
(esh-var-test/interp-concat-lisp2, esh-var-test/interp-concat-cmd)
(esh-var-test/interp-concat-cmd2)
(esh-var-test/interp-concat-cmd-external, esh-var-test/window-height)
(esh-var-test/window-width, esh-var-test/last-result-var)
(esh-var-test/last-result-var2, esh-var-test/last-arg-var):
... to here.
2022-03-03 14:59:33 +01:00
Eli Zaretskii
92e2d19fe7 One more fix of the BPA implementation
* src/bidi.c (bidi_find_bracket_pairs): Disable BPA optimization
when there are no strong directional characters inside the
bracketed pair.  (Bug#54219)
2022-03-03 15:53:04 +02:00
Eli Zaretskii
cd51d9c7ab Fix handling of brackets in BPA
* src/bidi.c (bidi_resolve_brackets): Fix implementation of UBA's
N0 rule when there are no strong directional characters inside the
bracketed pair.  (Bug#54219)
2022-03-03 14:46:20 +02:00