]> git.eshelyaron.com Git - emacs.git/log
emacs.git
2 years agoFix clearing of scroll bars on builds with disabled double buffers
Po Lu [Mon, 7 Mar 2022 02:54:48 +0000 (10:54 +0800)]
Fix clearing of scroll bars on builds with disabled double buffers

* src/xterm.c (x_scroll_bar_clear): Use XClearArea if the scroll
bar is not double-buffered.

2 years agoTweak how bibtex-mark-entry places point
Lars Ingebrigtsen [Mon, 7 Mar 2022 02:51:55 +0000 (03:51 +0100)]
Tweak how bibtex-mark-entry places point

* lisp/textmodes/bibtex.el (bibtex-mark-entry): Make `C-M-h'
behave like in other modes (with point at the beginning of the
region) (bug#4717).

2 years agoShow SVN status on "." directories, too
Lars Ingebrigtsen [Mon, 7 Mar 2022 02:47:13 +0000 (03:47 +0100)]
Show SVN status on "." directories, too

* lisp/vc/vc-svn.el (vc-svn-after-dir-status): Allow tracking
state of the "." directory, too, since they may have modified
properties (bug#7861).

2 years agoFix `W' in Dired with non-ASCII file names
Lars Ingebrigtsen [Mon, 7 Mar 2022 02:27:55 +0000 (03:27 +0100)]
Fix `W' in Dired with non-ASCII file names

* lisp/net/browse-url.el (browse-url--file-name-coding-system):
Factor out into own function.
(browse-url-file-url): Property encode non-ASCII characters so
that external browsers can understand them.
(browse-url-emacs): Make `W' in Dired work with non-ASCII file
names (bug#54271).

2 years agoGet rid of a loop through all frames when processing events
Po Lu [Mon, 7 Mar 2022 00:53:50 +0000 (08:53 +0800)]
Get rid of a loop through all frames when processing events

* src/xterm.c (handle_one_xevent): Just flip back buffer of f
and any instead.
(flush_dirty_back_buffer_on): New function.
(flush_dirty_back_buffers): Delete function.

2 years agoDisplay complex data types in gdb-mi
Gustaf Waldemarson [Sun, 6 Mar 2022 21:56:04 +0000 (22:56 +0100)]
Display complex data types in gdb-mi

* lisp/progmodes/gdb-mi.el (bindat): Require.
(gdb-invalidate-locals): Use `-stack-list-variables` instead of
the deprecated `-stack-list-locals`. Additionally, this allow
function arguments to be displayed in the locals buffer.
(gdb-locals-values-buffer, gdb-locals-values-buffer-name)
(gdb-locals-simple-values-only, gdb-locals-values-table): New
variables.
(gdb-locals-values-handler-custom): Create a new gdb buffer for
extracting local variable values. To
extract the values for 'complex' data-types, the command
`-stack-list-locals` is used with the `--all-values` flag.

The extracted values are then stored in a hash-table for later use in
the `gdb-locals-handler-custom` that performs the actual update of the
Local variable buffer.

All variable values are filtered to fit it into a single line, being
truncated as necessary by the user customizable option
`gdb-locals-value-limit`.

The old behavior of hiding complex values can be restored using the
customizable `gdb-locals-simple-values-only` option.

Patch amended by William Xu <william.xwl@gmail.com>.

2 years agoFix syntax error in obsolete message function
Lars Ingebrigtsen [Sun, 6 Mar 2022 18:34:54 +0000 (19:34 +0100)]
Fix syntax error in obsolete message function

* lisp/gnus/message.el (message-send-mail-function): Fix syntax error.

2 years agoFix url-interactive-p type
Lars Ingebrigtsen [Sun, 6 Mar 2022 18:02:45 +0000 (19:02 +0100)]
Fix url-interactive-p type

* lisp/url/url-vars.el (url-interactive-pw): Fix typo in previous
checkin (bug#54275).

2 years agoFix problem with fetching images via Cloudflare
Lars Ingebrigtsen [Sun, 6 Mar 2022 16:41:18 +0000 (17:41 +0100)]
Fix problem with fetching images via Cloudflare

* lisp/url/url-http.el (url-http): Factor out url-interactive-p.
* lisp/url/url-auth.el (url-basic-auth):
(url-basic-auth):
(url-digest-prompt-creds): Use it to not query the user.

* lisp/url/url-queue.el (url-queue-start-retrieve): Don't send a
bogus empty Authorization header (bug#54246) -- this triggers
Cloudflare's anti-attack software.  Instead rely on
url-request-noninteractive.

* lisp/url/url-vars.el (url-interactive-p): New utility function.

2 years ago(ecomplete-add-item): Preserve the more complete text
Stefan Monnier [Sun, 6 Mar 2022 15:14:42 +0000 (10:14 -0500)]
(ecomplete-add-item): Preserve the more complete text

Avoid replacing "John Doe <john@doe.ch>" with "john@doe.ch".

* lisp/ecomplete.el (ecomplete-add-item): Keep the longest text

2 years agoRestore call to byte-run-strip-symbol-positions in byte-compile-out
Alan Mackenzie [Sun, 6 Mar 2022 13:37:30 +0000 (13:37 +0000)]
Restore call to byte-run-strip-symbol-positions in byte-compile-out

Also increment a loop counter.  This should fix bug #54248.

* lisp/emacs-lisp/byte-run.el (byte-run--strip-vector/record): increment the
loop counter 'i' in the main loop.

* lisp/emacs-lisp/bytecomp.el (byte-compile-out): call
byte-run-strip-symbol-positions on operands which are one-element lists.

2 years agoDon't accept whitespace or hex floats in rgbi: colour specs
Mattias Engdegård [Sun, 6 Mar 2022 09:50:27 +0000 (10:50 +0100)]
Don't accept whitespace or hex floats in rgbi: colour specs

`color-values-from-color-spec` (new in Emacs 28) erroneously accepted
leading whitespace and hex floats in rgbi: components.

Reported by Philip Kaludercic.

* src/xfaces.c (parse_float_color_comp): Disallow leading whitespace
and hex floats.
* test/src/xfaces-tests.el
(xfaces-internal-color-values-from-color-spec): Add test cases.

2 years agoRespect inhibit-double-buffering on non-toolkit scroll bars
Po Lu [Sun, 6 Mar 2022 13:04:34 +0000 (21:04 +0800)]
Respect inhibit-double-buffering on non-toolkit scroll bars

* src/xfns.c (x_set_inhibit_double_buffering): Force scroll bars
to be re-created on builds without toolkit scroll bars.

* src/xterm.c (x_scroll_bar_create): Don't initialize back
buffer if double buffering is disabled for the frame.

2 years agoSlightly fix mouse-highlight processing on Haiku
Po Lu [Sun, 6 Mar 2022 10:42:33 +0000 (10:42 +0000)]
Slightly fix mouse-highlight processing on Haiku

* src/haikuterm.c (haiku_read_socket): If no corresponding frame
was found for a keyboard event, clear mouse highlight.

2 years agoImplement frame cascading on Haiku
Po Lu [Sun, 6 Mar 2022 07:13:07 +0000 (07:13 +0000)]
Implement frame cascading on Haiku

* haikufns.c (haiku_create_frame): Cascade frame position with
the focused frame if position is not user or programmer
specified.

2 years agoMerge from origin/emacs-28
Stefan Kangas [Sun, 6 Mar 2022 05:32:23 +0000 (06:32 +0100)]
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

2 years agoImplement "window cascading" on NS
Po Lu [Sun, 6 Mar 2022 02:43:25 +0000 (10:43 +0800)]
Implement "window cascading" on NS

* src/nsfns.m (Fx_create_frame): Cascade new frame position if
size hint flags are not USPosition or PPosition.

2 years agoReduce non-toolkit scroll bar flicker
Po Lu [Sun, 6 Mar 2022 02:02:03 +0000 (10:02 +0800)]
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'.

2 years agoFix reporting of menu bar wheel events on no toolkit builds
Po Lu [Sun, 6 Mar 2022 00:56:02 +0000 (08:56 +0800)]
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'.

2 years agoUse pselect instead of select in nsterm.m
Robert Pluim [Sat, 5 Mar 2022 19:00:09 +0000 (20:00 +0100)]
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).

2 years agoFix emacs-module-test after recent changes
Lars Ingebrigtsen [Sat, 5 Mar 2022 18:06:20 +0000 (19:06 +0100)]
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).

2 years ago* lib-src/seccomp-filter.c (main): Use faccessat2 only if defined.
Andreas Schwab [Sat, 5 Mar 2022 12:44:08 +0000 (13:44 +0100)]
* lib-src/seccomp-filter.c (main): Use faccessat2 only if defined.

2 years agoObey decorator-specified width and height of tooltip frames on Haiku
Po Lu [Sat, 5 Mar 2022 10:20:04 +0000 (10:20 +0000)]
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.

2 years agoGarbage Haiku tooltip frames on size change
Po Lu [Sat, 5 Mar 2022 06:23:30 +0000 (06:23 +0000)]
Garbage Haiku tooltip frames on size change

* haikuterm.c (haiku_read_socket): If tooltip frame dimensions
actually changed, garbage the frame.

2 years agoFix process-attributes time precision on BSD
Paul Eggert [Sat, 5 Mar 2022 03:21:38 +0000 (19:21 -0800)]
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.

2 years agoFix process-attributes time precision on GNU/Linux
Paul Eggert [Sat, 5 Mar 2022 03:21:38 +0000 (19:21 -0800)]
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.

2 years ago%CPU can exceed 100 on GNU/Linux
Paul Eggert [Sat, 5 Mar 2022 03:21:38 +0000 (19:21 -0800)]
%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.

2 years agoAvoid unnecessary make_float in time arithmetic
Paul Eggert [Sat, 5 Mar 2022 03:21:38 +0000 (19:21 -0800)]
Avoid unnecessary make_float in time arithmetic

* src/timefns.c (float_time): New function.
(time_arith, Ffloat_time): Use it.

2 years agoFix FreeBSD typo in process-attributes cstime
Paul Eggert [Sat, 5 Mar 2022 03:21:37 +0000 (19:21 -0800)]
Fix FreeBSD typo in process-attributes cstime

* src/sysdep.c (system_process_attributes) [__FreeBSD__]:
Fix typo that caused cstime to always equal cutime.

2 years agoFlush default GC before using it in functions that accept a GContext
Po Lu [Sat, 5 Mar 2022 03:13:37 +0000 (11:13 +0800)]
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.

2 years agoRemove render code in x_scroll_run and drop NoExpose events instead
Po Lu [Sat, 5 Mar 2022 02:44:26 +0000 (10:44 +0800)]
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.

2 years agoproject-shell: Ensure the resulting buffer is live
Dmitry Gutov [Sat, 5 Mar 2022 02:32:54 +0000 (04:32 +0200)]
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).

2 years agoPrevent some NoExpose events from being generated
Po Lu [Sat, 5 Mar 2022 02:05:14 +0000 (10:05 +0800)]
Prevent some NoExpose events from being generated

* src/xterm.c (x_scroll_run): Use the rendering extension if
available to avoid NoExpose events.

2 years agoImplement `pre_activate' callbacks for Motif menus
Po Lu [Sat, 5 Mar 2022 01:35:44 +0000 (09:35 +0800)]
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.

2 years agoFix the MS-DOS build
Po Lu [Sat, 5 Mar 2022 00:15:25 +0000 (08:15 +0800)]
Fix the MS-DOS build

* msdos/sedlibmk.inp: Update for gnulib merge.

2 years agotrace.el: Preserve the line structure
Stefan Monnier [Fri, 4 Mar 2022 17:18:41 +0000 (12:18 -0500)]
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

2 years agoAvoid statting directories on startup for Info
Lars Ingebrigtsen [Fri, 4 Mar 2022 16:36:20 +0000 (17:36 +0100)]
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.

2 years agoImprove scroll-bar-mode/default-frame-alist interaction docs
Lars Ingebrigtsen [Fri, 4 Mar 2022 15:55:57 +0000 (16:55 +0100)]
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.

2 years agoAdd some sleeps to gnutls_try_handshake
Lars Ingebrigtsen [Fri, 4 Mar 2022 15:27:10 +0000 (16:27 +0100)]
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).

2 years agoFix regression in derived-mode-init-mode-variables
Lars Ingebrigtsen [Fri, 4 Mar 2022 15:19:42 +0000 (16:19 +0100)]
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).

2 years agoAdd a few warnings about special event structures on X
Po Lu [Fri, 4 Mar 2022 12:54:02 +0000 (20:54 +0800)]
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.

2 years agoFix some errors in stretch glyphs code on PGTK
Po Lu [Fri, 4 Mar 2022 12:37:50 +0000 (20:37 +0800)]
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>.

2 years agoFix wording and punctuation in recent Gnus documentation changes
Eli Zaretskii [Fri, 4 Mar 2022 11:52:09 +0000 (13:52 +0200)]
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.

2 years agoInitialize time inside motion and button events converted from XI events
Po Lu [Fri, 4 Mar 2022 10:33:46 +0000 (18:33 +0800)]
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.

2 years agoTurn expiry on for nnselect groups
Andrew G Cohen [Fri, 4 Mar 2022 08:20:01 +0000 (16:20 +0800)]
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.

2 years ago; Fetch the nnselect-rescan parameter from the topic or group
Andrew G Cohen [Fri, 4 Mar 2022 08:08:32 +0000 (16:08 +0800)]
; 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.

2 years agoCorrectly process legacy XI wheel events on top of scroll bars
Po Lu [Fri, 4 Mar 2022 06:16:15 +0000 (14:16 +0800)]
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.

2 years agoPass core scroll wheel events outside the edit widget to Emacs on GTK
Po Lu [Fri, 4 Mar 2022 01:42:33 +0000 (09:42 +0800)]
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.

2 years agoFix display of stretch glyphs when hscrolled on PGTK
Po Lu [Fri, 4 Mar 2022 01:13:08 +0000 (09:13 +0800)]
Fix display of stretch glyphs when hscrolled on PGTK

* pgtkterm.c (x_draw_stretch_glyph_string): Use correct box
dimensions.

2 years ago* src/pgtkterm.c (pgtk_draw_fringe_bitmap): Synchronize logic with X.
Po Lu [Fri, 4 Mar 2022 01:11:36 +0000 (09:11 +0800)]
* src/pgtkterm.c (pgtk_draw_fringe_bitmap): Synchronize logic with X.

2 years ago; * src/nsterm.m (ns_draw_fringe_bitmap): Fix typo in last change.
Po Lu [Fri, 4 Mar 2022 01:08:33 +0000 (09:08 +0800)]
; * src/nsterm.m (ns_draw_fringe_bitmap): Fix typo in last change.

2 years agoSynchronize NS fringe bitmap code with X
Po Lu [Fri, 4 Mar 2022 01:06:20 +0000 (09:06 +0800)]
Synchronize NS fringe bitmap code with X

* nsterm.m (ns_draw_fringe_bitmap): Redefine bitmap if it does
not already exist.

2 years agoSynchronize Haiku fringe bitmap code with X
Po Lu [Fri, 4 Mar 2022 01:01:07 +0000 (01:01 +0000)]
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.

2 years agoMerge from origin/emacs-28
Po Lu [Fri, 4 Mar 2022 00:52:18 +0000 (00:52 +0000)]
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

2 years agoTeach Edebug about the special '&whole' syntax for compiler macros.
Philipp Stephani [Thu, 3 Mar 2022 18:56:09 +0000 (19:56 +0100)]
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.

2 years agoAvoid crashes when fringe bitmaps are defined in daemon mode
Eli Zaretskii [Thu, 3 Mar 2022 18:31:33 +0000 (20:31 +0200)]
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)

2 years ago(with-demoted-errors): Fix bug#54225
Stefan Monnier [Thu, 3 Mar 2022 15:12:44 +0000 (10:12 -0500)]
(with-demoted-errors): Fix bug#54225

* lisp/subr.el (with-demoted-errors): Adjust to argument order of
`macroexp-warn-and-return` changed in f262a6af3694b41828ff.

2 years agoFix clobbering of match data in executable-set-magic
Lars Ingebrigtsen [Thu, 3 Mar 2022 14:43:35 +0000 (15:43 +0100)]
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).

2 years agoAllow splitting strings in Eshell expansions with "plain" strings
Jim Porter [Wed, 2 Mar 2022 02:53:42 +0000 (18:53 -0800)]
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.

2 years agoFix parsing of indices in Eshell expansions
Jim Porter [Wed, 2 Mar 2022 02:36:08 +0000 (18:36 -0800)]
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.

2 years agoFix Eshell dollar interpolation inside of double-quotes
Jim Porter [Mon, 28 Feb 2022 05:04:30 +0000 (21:04 -0800)]
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.

2 years agoAdd a new macro to simplify parsing temporary Eshell command strings
Jim Porter [Sun, 27 Feb 2022 04:55:22 +0000 (20:55 -0800)]
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.

2 years agoMove Eshell variable interpolation tests to their own file
Jim Porter [Mon, 28 Feb 2022 02:34:22 +0000 (18:34 -0800)]
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.

2 years agoOne more fix of the BPA implementation
Eli Zaretskii [Thu, 3 Mar 2022 13:53:04 +0000 (15:53 +0200)]
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)

2 years agoFix handling of brackets in BPA
Eli Zaretskii [Thu, 3 Mar 2022 12:46:20 +0000 (14:46 +0200)]
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)

2 years agoMerge from origin/emacs-28
Stefan Kangas [Thu, 3 Mar 2022 05:30:34 +0000 (06:30 +0100)]
Merge from origin/emacs-28

225e0d6047 Correct etc/NEWS entry about bitmapped fonts

# Conflicts:
# etc/NEWS

2 years agoCache the backend value together with the project root
Dmitry Gutov [Thu, 3 Mar 2022 03:23:26 +0000 (05:23 +0200)]
Cache the backend value together with the project root

* lisp/progmodes/project.el (project-try-vc):
Cache the backend value together with the root.
(project-root, project-files, project-ignores):
Update to access the new data structure.

2 years ago* src/xterm.c: Fix commentary on GTK client side windows.
Po Lu [Thu, 3 Mar 2022 03:39:55 +0000 (11:39 +0800)]
* src/xterm.c: Fix commentary on GTK client side windows.

2 years agoFix Motif build without toolkit scroll bars
Po Lu [Thu, 3 Mar 2022 03:16:25 +0000 (11:16 +0800)]
Fix Motif build without toolkit scroll bars

* src/xterm.c: Always include Xm.h on Motif.

2 years ago* lisp/progmodes/xref.el: Bump the version.
Dmitry Gutov [Thu, 3 Mar 2022 02:55:05 +0000 (04:55 +0200)]
* lisp/progmodes/xref.el: Bump the version.

2 years agoDon't calculate any frame for extension events
Po Lu [Thu, 3 Mar 2022 02:49:55 +0000 (10:49 +0800)]
Don't calculate any frame for extension events

* src/xterm.c (handle_one_xevent): If event is not a core event,
don't try to calculate any from event.xany.window.

2 years agoImplement `toolkit_position_hook' on PGTK
Po Lu [Thu, 3 Mar 2022 01:05:00 +0000 (09:05 +0800)]
Implement `toolkit_position_hook' on PGTK

* src/pgtkterm.c (pgtk_toolkit_position): New function.
(pgtk_create_terminal): Set it as the toolkit position hook.

2 years ago; * src/termhooks.h (struct terminal): Fix typo in comment.
Po Lu [Wed, 2 Mar 2022 11:16:53 +0000 (19:16 +0800)]
; * src/termhooks.h (struct terminal): Fix typo in comment.

2 years agoFix menu bar position reporting on Haiku as well
Po Lu [Wed, 2 Mar 2022 11:10:00 +0000 (11:10 +0000)]
Fix menu bar position reporting on Haiku as well

* src/haikuterm.c (haiku_toolkit_position): New function.
(haiku_create_terminal): Register new hook.

2 years agoFix reporting of imaginary key prefixes on toolkit tool and menu bars
Po Lu [Wed, 2 Mar 2022 11:00:21 +0000 (19:00 +0800)]
Fix reporting of imaginary key prefixes on toolkit tool and menu bars

* src/keyboard.c (make_lispy_position): Set imaginary prefix if
the terminal says what widget the position is on top of.
* src/termhooks.h (struct terminal): New field
`toolkit_position_hook'.
* src/xterm.c (x_toolkit_position): New function.
(x_create_terminal): Register hook.

2 years agoCorrect etc/NEWS entry about bitmapped fonts
Po Lu [Wed, 2 Mar 2022 08:22:18 +0000 (09:22 +0100)]
Correct etc/NEWS entry about bitmapped fonts

* etc/NEWS: Don't say that bitmap font issues are due to Pango, that's
not accurate.

2 years agoMerge from origin/emacs-28
Stefan Kangas [Wed, 2 Mar 2022 05:33:19 +0000 (06:33 +0100)]
Merge from origin/emacs-28

9dadcbe429 ; * doc/misc/eshell.texi (Dollars Expansion): Fix markup.
2c3d1b6bf4 Improve/correct documentation about Eshell variable expansion
9e257aecc9 Partially revert b03f74e0f2a578b1580e8b1c368665850ee7f808

2 years ago; Merge from origin/emacs-28
Stefan Kangas [Wed, 2 Mar 2022 05:33:19 +0000 (06:33 +0100)]
; Merge from origin/emacs-28

The following commit was skipped:

b8bc359bbf Backport: Port pre-commit hook to Git 2.35.0

2 years agoFix some bugs with multiple terminals on Haiku
Po Lu [Wed, 2 Mar 2022 05:21:20 +0000 (05:21 +0000)]
Fix some bugs with multiple terminals on Haiku

* src/haikuterm.c (haiku_mouse_position): Only clear
`mouse_moved' for Haiku frames.

2 years agoFix persistent help text on disabled menu items
Po Lu [Wed, 2 Mar 2022 03:12:09 +0000 (11:12 +0800)]
Fix persistent help text on disabled menu items

* oldXMenu/Activate.c (XMenuActivate): Always deactivate help
echo upon leaving a menu item.

2 years ago* src/msdos.c (dos_rawgetc): Handle tab bar clicks correctly.
Po Lu [Wed, 2 Mar 2022 02:07:59 +0000 (10:07 +0800)]
* src/msdos.c (dos_rawgetc): Handle tab bar clicks correctly.

2 years agoDismiss help text when item becomes unactivated on oldXMenu
Po Lu [Wed, 2 Mar 2022 01:46:44 +0000 (09:46 +0800)]
Dismiss help text when item becomes unactivated on oldXMenu

* oldXMenu/Activate.c (XMenuActivate): Dismiss help text when
leaving an item.

2 years agoFix odd scrolling bugs on LessTif
Po Lu [Wed, 2 Mar 2022 01:34:05 +0000 (09:34 +0800)]
Fix odd scrolling bugs on LessTif

* src/xterm.c (handle_one_xevent): Give emulated button events
to Motif.

2 years agoImprove behavior of Motif popup menus on XI2
Po Lu [Wed, 2 Mar 2022 01:01:48 +0000 (09:01 +0800)]
Improve behavior of Motif popup menus on XI2

* src/xmenu.c (create_and_show_popup_menu): Set input focus to
menu window.

2 years agoRevert previous merge-gnulib change
Paul Eggert [Tue, 1 Mar 2022 18:06:27 +0000 (10:06 -0800)]
Revert previous merge-gnulib change

* admin/merge-gnulib: Revert previous stopgap change.
It shouldn’t be needed now that Gnulib has the change
2022-03-01T18:01:59Z!eggert@cs.ucla.edu.

2 years ago; * doc/misc/eshell.texi (Dollars Expansion): Fix markup.
Eli Zaretskii [Tue, 1 Mar 2022 13:08:38 +0000 (15:08 +0200)]
; * doc/misc/eshell.texi (Dollars Expansion): Fix markup.

2 years agoImprove/correct documentation about Eshell variable expansion
Jim Porter [Sun, 27 Feb 2022 21:20:51 +0000 (13:20 -0800)]
Improve/correct documentation about Eshell variable expansion

* lisp/eshell/esh-var.el: Correct documentation comment.
(eshell-parse-variable-ref): Correct docstring.

* doc/misc/eshell.texi (Dollars Expansion): Add documentation for
$"var"/$'var' and $<command> syntaxes.

2 years agoPartially revert b03f74e0f2a578b1580e8b1c368665850ee7f808
Jim Porter [Mon, 28 Feb 2022 17:31:22 +0000 (09:31 -0800)]
Partially revert b03f74e0f2a578b1580e8b1c368665850ee7f808

That commit regressed '$<command>' forms in Eshell, due to a
limitation/bug in how 'eshell-do-eval' works.  This fixes
bug#54190.

* lisp/eshell/esh-var.el (eshell-parse-variable-ref): Quote a lambda.

* test/lisp/eshell/eshell-tests.el (eshell-test/interp-temp-cmd):
New test.

2 years ago; Add a comment in recently installed code
Po Lu [Tue, 1 Mar 2022 12:48:55 +0000 (20:48 +0800)]
; Add a comment in recently installed code

* faces.el (face-spec-recalc): Add a comment describing the
special treatement of the scroll-bar face.

2 years agoAdd PropertyChangeMask to the standard event set
Po Lu [Tue, 1 Mar 2022 12:15:02 +0000 (20:15 +0800)]
Add PropertyChangeMask to the standard event set

* src/xfns.c (x_window): Remove special Motif code.
* src/xterm.h (STANDARD_EVENT_SET): Add PropertyChangeMask.

2 years agoFix crashes and other bugs on LessTif
Po Lu [Tue, 1 Mar 2022 11:15:46 +0000 (19:15 +0800)]
Fix crashes and other bugs on LessTif

* lwlib/lwlib-Xm.c (make_menu_in_widget): XmIsRowColumn is
broken on the latest LessTif release, so avoid that here.
* src/xfns.c (x_window): Add PropertyChangeMask which LessTif
doesn't do itself.

2 years agoFix reporting of wheel events on top of GTK scroll bars
Po Lu [Tue, 1 Mar 2022 10:38:08 +0000 (18:38 +0800)]
Fix reporting of wheel events on top of GTK scroll bars

* src/gtkutil.c (xg_update_scrollbar_pos):
(xg_update_horizontal_scrollbar_pos): Stop ensuring the window
is native.
(xg_event_is_for_scrollbar): New variable `for_valuator'.
All callers changed.
* src/gtkutil.h: Update prototypes.
* src/xterm.c (handle_one_xevent): Drop all valuator change
events destined for scroll bars.

2 years agoBackport: Port pre-commit hook to Git 2.35.0
Paul Eggert [Wed, 23 Feb 2022 19:29:56 +0000 (11:29 -0800)]
Backport: Port pre-commit hook to Git 2.35.0

* build-aux/git-hooks/pre-commit: Use LC_ALL=C grep -E instead of
sane_egrep (removed in Git 2.35.0).

(cherry picked from commit b8a96f055624f86fe965a0d1b7b2495b2db80e63)

2 years ago; * src/xwidget.c: Add missing part of last change.
Po Lu [Tue, 1 Mar 2022 07:49:03 +0000 (15:49 +0800)]
; * src/xwidget.c: Add missing part of last change.

2 years ago* src/xwidget.h: Fix build with XI 2.4.
Po Lu [Tue, 1 Mar 2022 07:45:50 +0000 (15:45 +0800)]
* src/xwidget.h: Fix build with XI 2.4.

2 years agoMake precision scrolling on top of the tool bar work
Po Lu [Tue, 1 Mar 2022 07:38:37 +0000 (15:38 +0800)]
Make precision scrolling on top of the tool bar work

* lisp/pixel-scroll.el (pixel-scroll-precision-mode-map): Bind
some more events.

(pixel-scroll-precision):
(pixel-scroll-start-momentum): If window is a frame, use its
selected window.

2 years agoAvoid duplicate wheel and button events on non-toolkit scroll bars
Po Lu [Tue, 1 Mar 2022 06:59:32 +0000 (14:59 +0800)]
Avoid duplicate wheel and button events on non-toolkit scroll bars

* src/xterm.c (x_scroll_bar_create): Set appropriate input
extension event mask.
(handle_one_xevent): Move some ifdefs around and handle input
extension button events on scroll bars.

2 years agoFix old X menu on builds with XI2
Po Lu [Tue, 1 Mar 2022 06:44:02 +0000 (14:44 +0800)]
Fix old X menu on builds with XI2

* oldXMenu/Activate.c (XMenuActivateSetTranslateFunction): New
function.
(XMenuActivate): Handle generic events.
* oldXMenu/XMenu.h: New prototypes.
(Translate_func): New type.
* src/xmenu.c (x_menu_wait_translate_generic_event): New
function.
(x_menu_show): Set translate function.

2 years agoDisable some code that interferes with menus on Lucid
Po Lu [Tue, 1 Mar 2022 06:06:52 +0000 (14:06 +0800)]
Disable some code that interferes with menus on Lucid

* src/xmenu.c (create_and_show_popup_menu)
(server_timestamp_predicate): Disable timestamp code on builds
using the Lucid menu bar widget.

2 years agoMerge from origin/emacs-28
Stefan Kangas [Tue, 1 Mar 2022 06:05:15 +0000 (07:05 +0100)]
Merge from origin/emacs-28

6dbc3da205 Fix :tag for eol in tab-first-completion