* src/xterm.c (x_clean_failable_requests): Avoid redundant
memcpy if first == last.
(x_ignore_errors_for_next_request): Fix check for last request.
(x_check_errors, x_had_errors_p): Clean up failable requests
here.
Po Lu [Wed, 29 Jun 2022 06:05:25 +0000 (06:05 +0000)]
Handle be:actions field in Haiku DND messages
* lisp/term/haiku-win.el (haiku-get-numeric-enum): New function.
(haiku-numeric-enum): New macro.
(haiku-select-encode-xstring, haiku-select-encode-utf-8-string):
Replace hard-coded numeric enumerators.
(haiku-parse-drag-actions): New function.
(haiku-drag-and-drop): Use action returned by that function.
(x-begin-drag): Replace hard-coded enumerator.
Po Lu [Wed, 29 Jun 2022 02:24:14 +0000 (10:24 +0800)]
Fix reported problem with drag-and-drop inside VirtualBox
* lisp/x-dnd.el (x-dnd-handle-old-kde, x-dnd-handle-offix)
(x-dnd-handle-motif): Select window before handling drop, like
on Xdnd.
(x-dnd-convert-to-offix, x-dnd-do-offix-drop)
(x-dnd-handle-unsupported-drop): Accept local selection data and
use that instead.
* src/keyboard.c (kbd_buffer_get_event): Call unsupported drop
function with local selection data as 8th arg.
* src/xselect.c (x_get_local_selection): Accept new arg
`local_value'. All callers changed.
(Fx_get_local_selection): New function.
(syms_of_xselect): Update defsubrs.
* src/xterm.c (x_dnd_lose_ownership): New function.
(x_dnd_begin_drag_and_drop): Unless new variable is true, disown
XdndSelection after returning. This supposedly makes
drag-and-drop from guest to host work in VirtualBox without
causing pointer motion to become choppy afterwards.
(syms_of_xterm): New variable `x_dnd_preserve_selection_data'
and update doc string of `x-dnd-unsupported-drop-function'.
* test/lisp/dnd-tests.el (dnd-tests-begin-text-drag)
(dnd-tests-begin-file-drag, dnd-tests-begin-drag-files): Set new
variable to nil during tests.
Juri Linkov [Tue, 28 Jun 2022 17:20:21 +0000 (20:20 +0300)]
* lisp/isearch.el (isearch-delete-char): Improve fix for bug#52248.
When reaching the top of the stack where isearch-other-end is nil,
still close unnecessary overlays for the previous position.
(isearch-close-unnecessary-overlays): Rename arg BEG for consistency.
* lisp/help-fns.el (help-fns--obsolete): Remove indentation and fill.
(help-fns--var-obsolete): Ditto.
(describe-function-1): Output the obsoletion info first since it's
vital information.
(describe-variable): Ditto (bug#56251).
* doc/lispref/hash.texi (Defining Hash): Explain more about what
sxhash-equal is for and what the caveats are.
* src/fns.c (Fsxhash_eql, Fsxhash_equal): Clarify doc string.
Michael Albinus [Tue, 28 Jun 2022 12:41:45 +0000 (14:41 +0200)]
Tramp shall not trap unrelated D-Bus errors
* lisp/net/tramp-gvfs.el (tramp-gvfs-dbus-event-vector): Declare.
(tramp-gvfs-file-name-handler): Let-bind it.
(tramp-gvfs-dbus-event-vector): Fix docstring.
(tramp-gvfs-maybe-open-connection): Do not set it globally. (Bug#56162)
Jim Meyering [Mon, 27 Jun 2022 04:26:01 +0000 (21:26 -0700)]
Fix configure.ac quoting of AC_CHECK_LIB's 2nd arg
Running an autoconf-head-generated configure, would fail like this:
/emacs/configure: line 18002: syntax error near unexpected token `;;'
/emacs/configure: line 18002: ` ;;'
That is due to under-quoting of AC_CHECK_LIB's second argument, which led to
the comma in an embedded string being interpreted as paramater-delimiting.
* configure.ac: Quote the second arg of each AC_CHECK_LIB invocation.
(Bug#56272)
Eli Zaretskii [Mon, 27 Jun 2022 12:32:53 +0000 (15:32 +0300)]
Fix deletion of composed text
* lisp/composite.el (lgstring-glyph-boundary): New function.
* lisp/simple.el (delete-forward-char): Call
'lgstring-glyph-boundary' to find where to end the deletion inside
an automatic composition. (Bug#56237)
* lisp/subr.el (plistp): New type predicate (bug#47427). This
referred to in the error message from plist-put: "Debugger
entered--Lisp error: (wrong-type-argument plistp (a b c))".
* src/fns.c (plist_get):
(plist_put):
(plist_member): New functions (without optional third parameter)
to be used in C code.
* src/fns.c (Fplist_get, Fplist_put, Fplist_member): Take an
optional predicate parameter (bug#47425).
* src/lisp.h: Declare new plist_put, plist_get and plist_member
functions.
* test/lisp/json-tests.el (test-json-add-to-plist): Use plist-get.
* test/src/fns-tests.el (test-cycle-lax-plist-get):
(test-cycle-lax-plist-put):
(lax-plist-get/odd-number-of-elements):
(test-plist): Remove lax-plist tests, since semantics have changed
(they no longer error out on cycles).
Allen Li [Mon, 27 Jun 2022 07:46:27 +0000 (09:46 +0200)]
find-dired: Add find-dired-with-command
Add a command that runs and sets up the find-dired buffer with an
arbitrary find command. Also rewrite the existing find-dired commands
using it.
The set of commands possible with find-dired is limited; the new
command allows users to run the full set of commands, but also leaves
the responsibility to the user to construct the command manually.
* lisp/find-dired.el (find-command-history): New var.
(find-dired-with-command): New command.
(find-dired): Rewritten with new command.
Po Lu [Mon, 27 Jun 2022 06:16:52 +0000 (06:16 +0000)]
Implement stipples for images on Haiku
* src/haiku_draw_support.cc (be_draw_bitmap_with_mask): New
function.
* src/haiku_support.h: Add prototype.
* src/haikuterm.c (haiku_draw_image_glyph_string): Draw stipple
correctly.
(haiku_draw_glyph_string): Fix conditions under which
row->stipple_p is set.
Make `signal-process' allow completing over signal names
* lisp/simple.el (read-signal-name): New function.
* src/process.c (Fsignal_process): Use it to allow completing over
the signal names (bug#56239).
(Fsignal_names): New function.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Turn functions into nil when compiled for-effect since they have no
side-effects on their own. This may enable further improvements such
as the elimination of variable bindings.
`unwind-protect` forms can be treated as plain function call at this
point. In particular, their unwind function argument should be
not optimised for effect since it's a function.
Visuwesh [Sun, 26 Jun 2022 15:30:04 +0000 (17:30 +0200)]
Make <mouse-3> in the mode line more careful
* lisp/mouse.el (mouse-delete-window): Only delete the window if
the user hasn't moved point out of the mode line before releasing
the button (bug#56198).
Jim Porter [Sun, 26 Jun 2022 01:19:01 +0000 (18:19 -0700)]
Make Eshell globs ending in "/" match directories only
* lisp/eshell/em-glob.el (eshell-glob-convert): Return whether to
match directories only.
(eshell-glob-entries): Add ONLY-DIRS argument.
* test/lisp/eshell/em-glob-tests.el
(em-glob-test/match-any-directory): New test.
(em-glob-test/match-recursive)
(em-glob-test/match-recursive-follow-symlinks): Add test cases for
when "**/" or "***/" are the last components in a glob.
Jim Porter [Fri, 24 Jun 2022 15:39:42 +0000 (08:39 -0700)]
Convert Eshell globs ahead of time instead of doing it repeatedly
* lisp/eshell/em-glob.el (eshell-glob-recursive): New variable.
(eshell-glob-convert-1, eshell-glob-convert): New functions.
(eshell-extended-glob): Use 'eshell-glob-convert'.
(eshell-glob-entries): Adapt function to use pre-converted globs.
* test/lisp/eshell-em-glob-tests.el (em-glob-test/match-dot-files):
New test.
Jim Porter [Sun, 26 Jun 2022 03:05:57 +0000 (20:05 -0700)]
Optionally signal an error if an Eshell predicate fails to match anything
* lisp/eshell/em-pred.el (eshell-error-if-no-glob): Declare it.
(eshell-apply-modifiers): Add STRING-DESC argument and signal an error
if there are no matches and 'eshell-error-if-no-glob' is set.
(eshell-parse-arg-modifier): Pass modifier string to
'eshell-apply-modifiers'.
* test/lisp/eshell/em-pred-tests.el (eshell-eval-predicate): Simplify.
(em-pred-test/no-matches): New test.
* doc/misc/eshell.texi (Bugs and ideas): Remove todo entry about this
change.
Daniel Martín [Sun, 26 Jun 2022 10:27:55 +0000 (12:27 +0200)]
Fix typo in signal-process-functions
* doc/lispref/processes.texi (Signals to Processes): Update reference
to correct default variable in the ELisp manual.
* etc/NEWS: The same for the NEWS entry (bug#56234).
Paul Eggert [Sat, 25 Jun 2022 19:51:28 +0000 (14:51 -0500)]
Port distribution tarball to Solaris 10
* make-dist (taropt): Use 'tar -H ustar' to generate a portable
tar file format instead of a GNU-specific format. Needed now that
Emacs tarballs contain file names longer than 100 bytes, e.g.:
emacs-28.1/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/C072AF82DCCCB9A7F1B85FFA10B802DC4ED16703.key
emacs-28.1/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-run-hook-with-args-until-success.el
Without this patch, extracting a tarball on Solaris 10 fails with
many diagnostics like “tar: ././@LongLink: typeflag 'L' not
recognized, converting to regular file”.
Stefan Monnier [Sun, 26 Jun 2022 12:59:38 +0000 (08:59 -0400)]
* lisp/emacs-lisp/syntax.el: Rework the handling of nested calls.
Nested calls to `syntax-ppss` and `syntax-propertize` can easily
happen unexpectedly via ondemand propertizing or `forward-sexp`.
Refine the handling of nested calls so we detect them more reliably
(e.g. also within `syntax-propertize-extend-region-functions`)
and so that the `syntax-ppss` cache is automatically flushed in case
it might have been filled with data that's become obsolete since.
(syntax-propertize--inhibit-flush): Delete var.
(syntax-propertize--in-process-p): New function to replace it.
(syntax-ppss-flush-cache): Use it.
(syntax-ppss--updated-cache): New var.
(syntax-propertize): Make `syntax-propertize--done` binding apply to
`syntax-propertize-extend-region-functions` as well, as intended (fixes
bug#46713). Use `syntax-ppss--updated-cache` to flush
syntax-ppss cache at the end when needed.
Don't bind `syntax-propertize--inhibit-flush` any more.
(syntax-ppss): Set `syntax-ppss--updated-cache` when applicable.
Eli Zaretskii [Sun, 26 Jun 2022 07:22:20 +0000 (10:22 +0300)]
Fix ispell-word on colorless TTY frames
* lisp/textmodes/ispell.el
(ispell-highlight-spelling-error-generic): Keep marker position of
END intact, deletion of text notwithstanding. (Bug#56219)
Po Lu [Sun, 26 Jun 2022 05:34:43 +0000 (13:34 +0800)]
Stop catching errors for some requests
* src/xterm.c (x_dnd_compute_toplevels)
(frame_set_mouse_pixel_position, x_focus_frame): Use
`x_ignore_errors_for_next_request'. This results in a healthy
~30% speedup for the involved requests.
Po Lu [Sun, 26 Jun 2022 02:20:35 +0000 (10:20 +0800)]
Handle errors while sending client events asynchronously
* src/xterm.c (xm_send_drop_message)
(xm_send_top_level_enter_message, xm_send_drag_motion_message)
(xm_send_top_level_leave_message, x_dnd_send_enter)
(x_dnd_send_position, x_dnd_send_leave, x_dnd_send_drop): Avoid
sync to check for errors while sending client events.
(x_dnd_begin_drag_and_drop, handle_one_xevent, XTread_socket):
Clean up failable requests.
(x_request_can_fail): New functions.
(x_clean_failable_requests, x_ignore_errors_for_next_request)
(x_uncatch_errors): Clean up failable requests.
(x_error_handler): If a request is allowed to fail, just return.
(x_term_init): Set up new pointer.
* src/xterm.h (N_FAILABLE_REQUESTS): New macro.
(struct x_display_info): New field `failable_requests' and
associated next pointer.
Paul Eggert [Sat, 25 Jun 2022 19:51:28 +0000 (14:51 -0500)]
Port distribution tarball to Solaris 10
* make-dist (taropt): Use 'tar -H ustar' to generate a portable
tar file format instead of a GNU-specific format. Needed now that
Emacs tarballs contain file names longer than 100 bytes, e.g.:
emacs-28.1/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/C072AF82DCCCB9A7F1B85FFA10B802DC4ED16703.key
emacs-28.1/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-run-hook-with-args-until-success.el
Without this patch, extracting a tarball on Solaris 10 fails with
many diagnostics like “tar: ././@LongLink: typeflag 'L' not
recognized, converting to regular file”.
Paul Eggert [Sat, 25 Jun 2022 18:00:28 +0000 (13:00 -0500)]
Pacify Oracle Studio re xterm.c
* src/xterm.c (xErrorHandler, xIOErrorHandler):
New typedefs.
(xm_get_drag_window_1, x_connection_closed): Use them instead of
void *, since the C standard frowns on converting function
pointers to and from void *. This pacifies Oracle Studio
diagnostics like “warning: assignment type mismatch: pointer to
void "=" pointer to function(pointer to struct _XDisplay {})\
returning int”.
(x_detect_pending_selection_requests, x_had_errors_p): Do not rely
on implicit conversion of a pointer to a bool return value; use !!
instead. This pacifies Oracle Studio’s “warning: improper
pointer/integer combination: op "="”.
(xim_open_dpy) [HAVE_X11R6 && !HAVE_X11R6_XIM]: Do not use
xim_destroy_callback; configure.ac says “inoue@ainet.or.jp says
Solaris has a bug related to X11R6-style ## XIM support” and
Oracle Studio complains “warning: assignment type mismatch:
pointer to function(pointer to struct _XIC {}, pointer to char,
pointer\ to char) returning void "=" pointer to function(pointer
to struct _XIM {}, pointer to char, pointer to char) returning
void”.
Paul Eggert [Sat, 25 Jun 2022 16:44:33 +0000 (11:44 -0500)]
Pacify Oracle Studio re print_vectorlike
* src/print.c (print_vectorlike): Use explicit cast of function
pointer to void *, to pacify Oracle Studio 12.6’s “warning:
assignment type mismatch: pointer to void "=" pointer to
function(pointer to void) returning void”. Admittedly this is
not strictly conforming C code even with the cast.
Po Lu [Sat, 25 Jun 2022 12:07:35 +0000 (20:07 +0800)]
Update input_pending after deferring selection requests
* src/xterm.c (x_defer_selection_requests): If kbd_fetch_ptr
moved, update input_pending. Bug found calling
`input-pending-p' inside the DND movement function.
Stefan Kangas [Sat, 25 Jun 2022 10:55:15 +0000 (12:55 +0200)]
New command recentf-open
* lisp/recentf.el (recentf-open): New command. (Bug#56148)
(recentf): New alias.
(recentf, recentf-mode): Update documentation to focus more on the
list of recently opened files and ways of accessing it, instead of
focusing on the menu bar only.
(recentf-list, recentf-enabled-p): Minor doc fixes.
Stefan Kangas [Sat, 25 Jun 2022 10:25:58 +0000 (12:25 +0200)]
Don't error out on invalid literal key substitutions
It would be backwards-incompatible to error out on invalid literal key
substitutions. Consider this docstring fragment, where "\\`" should
have been escaped but wasn't:
If we error out, we can't display this docstring at all. However, it
is clearly better to display something in such cases, even if
suboptimal, than refusing to display anything at all.
* lisp/help.el (substitute-command-keys): Don't error out on invalid
literal key substitutions: just ignore them instead.
* test/lisp/help-tests.el
(help-tests-substitute-command-keys/literal-key-sequence-errors):
Delete test.
(help-tests-substitute-command-keys/literal-key-sequence-ignore-invalid):
New test.
* lisp/term/haiku-win.el (require):
* lisp/progmodes/elisp-mode.el (require):
* lisp/isearch.el (require): Require subr-x at compile time, since
these use defsubsts/macros from there.
* lisp/emacs-lisp/subr-x.el (string-empty-p): Move from here...
* lisp/simple.el (string-empty-p): ... to here. This is to help
with a build problem where files.el is using the defsubst, but
requiring subr-x.el at compile time leads to load errors.
Po Lu [Sat, 25 Jun 2022 07:34:43 +0000 (07:34 +0000)]
Implement image transform smoothing on Haiku
* src/dispextern.h (struct image): New field
`use_bilinear_filtering'.
* src/haiku_draw_support.cc (BView_DrawBitmap): Accept it.
* src/haiku_support.h: Update prototypes.
* src/haikuterm.c (haiku_draw_image_glyph_string):
* src/image.c (image_set_transform): Set it.
Po Lu [Sat, 25 Jun 2022 06:20:57 +0000 (06:20 +0000)]
Implement "flip" image transforms on Haiku
* src/dispextern.h (struct image): New field `transform',
`original_width' and `original_height'.
* src/haiku_draw_support.cc (BView_DrawMask): Rename to
`be_draw_image_mask' and fix coding style.
(rotate_bitmap_270, BBitmap_transform_bitmap, rotate_bitmap_90):
Delete functions.
(be_apply_affine_transform): New function.
(be_apply_inverse_transform): New function.
* src/haiku_support.h: Update prototypes.
* src/haikuterm.c (haiku_translate_transform): New function.
(haiku_draw_image_glyph_string): Use affine transforms to
implement images.
* src/image.c (image_set_transform): Implement using affine
transforms on Haiku too.