]> git.eshelyaron.com Git - emacs.git/log
emacs.git
2 years ago* lisp/emacs-lisp/oclosure.el (oclosure--define): Autoload
Stefan Monnier [Tue, 29 Mar 2022 07:23:38 +0000 (03:23 -0400)]
* lisp/emacs-lisp/oclosure.el (oclosure--define): Autoload

2 years agoSpecially decode more selection types on Haiku
Po Lu [Tue, 29 Mar 2022 06:35:09 +0000 (06:35 +0000)]
Specially decode more selection types on Haiku

* src/haiku_select.cc (be_get_point_data, be_add_point_data):
New functions.
* src/haikuselect.c (haiku_message_to_lisp, lisp_to_type_code)
(haiku_lisp_to_message): Accept new types `size_t', `ssize_t'
and `point'.
(Fhaiku_drag_message): Update doc string.
(syms_of_haikuselect): New defsyms.
* src/haikuselect.h: Update prototypes.

2 years agoTemporarily fix the oclosure bootstrap
Po Lu [Tue, 29 Mar 2022 05:58:40 +0000 (13:58 +0800)]
Temporarily fix the oclosure bootstrap

* lisp/emacs-lisp/oclosure.el (oclosure-define): Load oclosure
from source if `oclosure--define' is not defined during byte
compilation.

2 years agoDon't loop through useless region when searching for DND toplevel
Po Lu [Tue, 29 Mar 2022 01:08:22 +0000 (09:08 +0800)]
Don't loop through useless region when searching for DND toplevel

* src/xterm.c (x_dnd_compute_toplevels): Optimize for the
bounding rect being the window dimensions.

2 years agoAdd search function to search within filenames in Dired and WDired (bug#14013)
Juri Linkov [Mon, 28 Mar 2022 18:00:32 +0000 (21:00 +0300)]
Add search function to search within filenames in Dired and WDired (bug#14013)

* lisp/dired-aux.el (dired-isearch-filenames-mode): Use
dired-isearch-search-filenames on isearch-search-fun-function
instead of dired-isearch-filter-filenames on isearch-filter-predicate.
(dired-isearch-filter-filenames): Remove function.
(dired-isearch-search-filenames): Add function.

* lisp/isearch.el (isearch-message-prefix): Add isearch-search-fun-function
to the list of supported advice-functions along with isearch-filter-predicate.

* lisp/replace.el (replace-search): Add comment.

* lisp/wdired.el (wdired-search-replace-filenames): New defcustom.
(wdired-isearch-filter-read-only): Remove function.
(wdired-change-to-wdired-mode, wdired-change-to-dired-mode):
Add and remove dired-isearch-search-filenames on isearch-search-fun-function
instead of wdired-isearch-filter-read-only on isearch-filter-predicate.
Also set/unset replace-search-function and replace-re-search-function.
Remove and restore isearch-mode-hook with dired-isearch-filenames-setup.
The problem is that dired-isearch-filenames-setup adds
dired-isearch-filenames-end to isearch-mode-end-hook that removes
dired-isearch-search-filenames added to isearch-search-fun-function
in wdired-change-to-wdired-mode.  Then replace-highlight can't use
dired-isearch-search-filenames.

2 years agoAdd OClosures, a cross between functions and structs
Stefan Monnier [Mon, 28 Mar 2022 14:53:14 +0000 (10:53 -0400)]
Add OClosures, a cross between functions and structs

We here just add the new type.  It is not fully self-contained.
It requires cooperation from `cconv.el` on the one hand, and it
hijacks the docstring info to hold the type of OClosure objects.
This does imply that OClosures can't have docstrings, tho this
limitation will be lifted in subsequent patches.

* lisp/emacs-lisp/oclosure.el: New file.
* test/lisp/emacs-lisp/oclosure-tests.el: New file.
* doc/lispref/functions.texi (OClosures): New section.

* src/eval.c (Ffunction): Accept symbols instead of strings for docstrings.
* src/doc.c (store_function_docstring): Avoid overwriting an OClosure type.
* lisp/emacs-lisp/cconv.el (cconv--convert-function): Tweak ordering of
captured variables.
(cconv-convert): Add case for `oclosure--fix-type`.

2 years agoFix doc of `gui-get-selection' as to what is really valid as `data'
Po Lu [Mon, 28 Mar 2022 12:34:03 +0000 (20:34 +0800)]
Fix doc of `gui-get-selection' as to what is really valid as `data'

* doc/lispref/frames.texi (Window System Selections):
* lisp/select.el (gui-set-selection): Don't say `data' can be a
cons or list of two integers, since that's not supported.

2 years agoMinor fixes to Haiku selection support
Po Lu [Mon, 28 Mar 2022 12:28:53 +0000 (12:28 +0000)]
Minor fixes to Haiku selection support

* lisp/term/haiku-win.el (haiku-selection-bounds): New function.
(haiku-dnd-convert-string, haiku-select-encode-xstring)
(haiku-select-encode-utf-8-string): Handle position pairs
correctly.
(gui-backend-set-selection): Adjust for new airity.
* src/haikuselect.c (Fhaiku_selection_put): Fix arity.

2 years agoImprove portability of XCB configure checks
Po Lu [Mon, 28 Mar 2022 10:41:12 +0000 (18:41 +0800)]
Improve portability of XCB configure checks

* configure.ac: Look for xcb_aux_sync in -lxcb-aux if it's not
in -lxcb-util.

2 years agoDo not register Tramp file name handlers twice
Michael Albinus [Mon, 28 Mar 2022 10:02:23 +0000 (12:02 +0200)]
Do not register Tramp file name handlers twice

* lisp/net/tramp.el (tramp-register-autoload-file-name-handlers):
* lisp/net/tramp-archive.el (tramp-register-archive-file-name-handler):
Check, whether the real file name handler is already registered.

2 years agoAvoid extra sync when fetching DND proxy window
Po Lu [Mon, 28 Mar 2022 05:52:17 +0000 (13:52 +0800)]
Avoid extra sync when fetching DND proxy window

* src/xterm.c (x_dnd_get_proxy_proto): New function.
(x_dnd_get_target_window): Use it on XCB to determine window
proxy and proto for toplevel window.

2 years agoClean up some uses of XInternAtom
Po Lu [Mon, 28 Mar 2022 00:59:50 +0000 (08:59 +0800)]
Clean up some uses of XInternAtom

* src/xfns.c (x_set_undecorated, x_set_no_focus_on_map, x_window)
(set_machine_and_pid_properties): Move calls to XInternAtom for
static string to use previously interned atoms.
(Fx_change_window_property): Use XCB if available to avoid extra
call to XSync.
* src/xterm.c (x_term_init):
* src/xterm.h (struct x_display_info): New atoms _MOTIF_WM_HINTS
and _NET_WM_PID.

2 years ago; * src/xterm.c (x_dnd_compute_toplevels): Use right enum on XCB.
Po Lu [Mon, 28 Mar 2022 00:39:37 +0000 (08:39 +0800)]
; * src/xterm.c (x_dnd_compute_toplevels): Use right enum on XCB.

2 years agoStore latin-1 content into the Haiku clipboard as well
Po Lu [Sun, 27 Mar 2022 13:36:45 +0000 (13:36 +0000)]
Store latin-1 content into the Haiku clipboard as well

* lisp/term/haiku-win.el (haiku-normal-selection-encoders): New
variable.
(haiku-select-encode-utf-8-string, haiku-select-encode-xstring):
New functions.
(gui-backend-set-selection): Use new selection encoder functions
instead of hard-coding UTF-8.
(haiku-dnd-handle-drag-n-drop-event): Rename to
`haiku-drag-and-drop'.

* src/haiku_select.cc (be_lock_clipboard_message): Accept new
argument `clear'.
(be_unlock_clipboard): Accept new argument `discard'.

* src/haikuselect.c (Fhaiku_selection_data): Change calls to
`be_lock_clipboard_message' and `be_unlock_clipboard'.
(haiku_unwind_clipboard_lock): New function.
(Fhaiku_selection_put): Accept new meaning of `name' which means
to set the selection message.

* src/haikuselect.h: Update prototypes.

2 years agoClean up PGTK cursor blanking code
Po Lu [Sun, 27 Mar 2022 11:53:49 +0000 (19:53 +0800)]
Clean up PGTK cursor blanking code

* src/pgtkterm.c (XTframe_rehighlight): Rename to
`pgtk_frame_rehighlight_hook'.  All callers changed.
(x_toggle_visible_pointer): Rename to
`pgtk_toggle_visible_pointer'.  All callers changed.
(x_setup_pointer_blanking, XTtoggle_invisible_pointer): Delete
functions.
(pgtk_create_terminal): Use new names for various hooks.
(pgtk_term_init): Set up blank cursor directly.

* src/pgtkterm.h (struct pgtk_display_info): Remove
`toggle_visible_pointer'.

2 years agoDon't wait for XdndFinished messages if the target did not send status
Po Lu [Sun, 27 Mar 2022 07:51:41 +0000 (15:51 +0800)]
Don't wait for XdndFinished messages if the target did not send status

* src/xterm.c (x_dnd_send_leave): Return if we should wait for a
XdndFinished message.
(handle_one_xevent): Use that value for
`x_dnd_waiting_for_finish'.

2 years agoAlways run 'isearch-lazy-count-update-hook' with point at match
Augusto Stoffel [Fri, 25 Mar 2022 07:46:57 +0000 (08:46 +0100)]
Always run 'isearch-lazy-count-update-hook' with point at match

* lisp/isearch.el (isearch-lazy-highlight-buffer-update):  Run
'isearch-lazy-count-update-hook' outside of save-excursion, so point
is at the current match.

2 years agoFix processing of DND grab on non-XI2 builds
Po Lu [Sun, 27 Mar 2022 05:01:18 +0000 (13:01 +0800)]
Fix processing of DND grab on non-XI2 builds

* src/xterm.c (handle_one_xevent): Process DND grab flag
correctly.

2 years agoMerge from origin/emacs-28
Stefan Kangas [Sun, 27 Mar 2022 04:30:16 +0000 (06:30 +0200)]
Merge from origin/emacs-28

1bef52ce73 * doc/emacs/anti.texi (Antinews): Unannounce removal of Mo...

2 years agoFix no-toolkit build
Po Lu [Sun, 27 Mar 2022 01:48:37 +0000 (09:48 +0800)]
Fix no-toolkit build

* src/xterm.c (x_top_window_to_frame): Declare correctly on
no-toolkit builds.

2 years agoAvoid excessive synchronization when handling ShapeNotify events
Po Lu [Sun, 27 Mar 2022 00:53:12 +0000 (08:53 +0800)]
Avoid excessive synchronization when handling ShapeNotify events

* src/xterm.c (handle_one_xevent): Use XCB to handle ShapeNotify
events when we want both the bounding and input rects.

2 years ago; * src/haikuimage.c (syms_of_haikuimage): Remove duplicate DEFSYM.
Po Lu [Sun, 27 Mar 2022 00:34:25 +0000 (00:34 +0000)]
; * src/haikuimage.c (syms_of_haikuimage): Remove duplicate DEFSYM.

2 years agoFix reader infinite recursion for circular mixed-type values
Mattias Engdegård [Sat, 26 Mar 2022 15:44:18 +0000 (16:44 +0100)]
Fix reader infinite recursion for circular mixed-type values

Make sure that the value added to the `read_objects_completed` set is
the one we actually return; previously this wasn't the case for conses
because of an optimisation (bug#54501).

Also add a check for vacuous self-references such as #1=#1# instead of
returning a nonsense value from thin air.

* src/lread.c (read1): Treat numbered conses correctly as described
above.  Detect vacuous self-references.
* test/src/lread-tests.el (lread-test-read-and-print)
(lread-test-circle-cases, lread-circle): Add tests.

2 years ago; * src/image.c (syms_of_image): Fix whitespace.
Eli Zaretskii [Sat, 26 Mar 2022 12:29:11 +0000 (15:29 +0300)]
; * src/image.c (syms_of_image): Fix whitespace.

2 years agoEnable the native display of BMP images on Haiku
Po Lu [Sat, 26 Mar 2022 12:16:46 +0000 (12:16 +0000)]
Enable the native display of BMP images on Haiku

* src/image.c (syms_of_image): Also register `bmp' image type on
Haiku when native image APIs are enabled.

2 years agoFix crash when timer signals or throws inside a popup menu on Haiku
Po Lu [Sat, 26 Mar 2022 12:01:58 +0000 (12:01 +0000)]
Fix crash when timer signals or throws inside a popup menu on Haiku

* src/haikumenu.c (haiku_process_pending_signals_for_menu_1)
(haiku_process_pending_signals_for_menu_2): New functions.
(haiku_process_pending_signals_for_menu): Catch non local exits
around `timer_check'.

2 years ago; * src/xterm.c (x_dnd_compute_toplevels): Fix cookie leak if rc is 0.
Po Lu [Sat, 26 Mar 2022 11:38:30 +0000 (19:38 +0800)]
; * src/xterm.c (x_dnd_compute_toplevels): Fix cookie leak if rc is 0.

2 years agoFix processing of emacs:window_id inside DND messages if it already exists
Po Lu [Sat, 26 Mar 2022 10:13:47 +0000 (10:13 +0000)]
Fix processing of emacs:window_id inside DND messages if it already exists

* src/haiku_support.cc (MessageReceived): Use DropPoint instead
of getting it manually.
(be_drag_message): Replace window_id if it already exists.

2 years ago; Improve readablity in grep.el
Michael Albinus [Sat, 26 Mar 2022 09:40:16 +0000 (10:40 +0100)]
; Improve readablity in grep.el

* lisp/progmodes/grep.el (grep-compute-defaults): Set a more
readable value for `grep-quoting-style'.

2 years agoDon't let Tramp block dired (Bug#54542)
Michael Albinus [Sat, 26 Mar 2022 09:39:39 +0000 (10:39 +0100)]
Don't let Tramp block dired  (Bug#54542)

* lisp/dired.el (dired-find-buffer-nocreate): Avoid avoid hangs in
remote buffers with a blocked connection.  (Bug#54542)

* lisp/net/tramp-sh.el (tramp-maybe-open-connection):
Extend suppression rules.

2 years agoMinor fixes to last change
Po Lu [Sat, 26 Mar 2022 09:12:34 +0000 (17:12 +0800)]
Minor fixes to last change

* src/Makefile.in: Add XSHAPE_LIBS and XSHAPE_CFLAGS.
(LIBES, EMACS_CFLAGS): Likewise.

* src/xterm.c (x_dnd_compute_toplevels): Fix build without
HAVE_XCB_SHAPE.

2 years agoAlso fetch shapes via XCB for drag and drop
Po Lu [Sat, 26 Mar 2022 09:10:42 +0000 (17:10 +0800)]
Also fetch shapes via XCB for drag and drop

* configure.ac: Also look for xcb-shape.
* src/xterm.c (HAVE_XCB_SHAPE_INPUT_RECTS): New define.
(x_dnd_compute_toplevels): Use XCB for input shapes if possible.

2 years agoUse native image APIs on MS-Windows by default
Eli Zaretskii [Sat, 26 Mar 2022 08:52:41 +0000 (11:52 +0300)]
Use native image APIs on MS-Windows by default

* src/w32term.c (syms_of_w32term) <w32-use-native-image-API>: Now
t by default on W2K and later systems, but only on WINDOWSNT
builds.

* etc/NEWS: Announce the change.

2 years agoSupport display of BMP images on MS-Windows
Eli Zaretskii [Sat, 26 Mar 2022 08:31:46 +0000 (11:31 +0300)]
Support display of BMP images on MS-Windows

* src/w32image.c (w32_can_use_native_image_api): Support BMP
images.
* src/image.c (syms_of_image) <Qbmp>: New symbol.
[HAVE_NTGUI]: Add 'bmp' to list of supported image types.

* doc/lispref/display.texi (Image Formats): Document built-in
support for BMP images.

* etc/NEWS: Announce the change.

2 years agoImprove 'desktop--emacs-pid-running-p'
Eli Zaretskii [Sat, 26 Mar 2022 07:28:52 +0000 (10:28 +0300)]
Improve 'desktop--emacs-pid-running-p'

* lisp/desktop.el (desktop--emacs-pid-running-p): Avoid false
negatives on MS-Windows and with some symlinks to Emacs
executables.  (Bug#1474)

2 years ago* doc/emacs/anti.texi (Antinews): Unannounce removal of Motif.
Po Lu [Sat, 26 Mar 2022 06:46:00 +0000 (14:46 +0800)]
* doc/emacs/anti.texi (Antinews): Unannounce removal of Motif.

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

4ec9f9edd1 Fix eshell-explicit-command-char doc string typo

2 years agoFix crash when windows are destroyed by faulty clients
Po Lu [Sat, 26 Mar 2022 04:20:23 +0000 (12:20 +0800)]
Fix crash when windows are destroyed by faulty clients

* src/xterm.c (x_dnd_compute_toplevels): Make sure
property_reply is non-NULL before testing its format and length.

2 years agoAvoid excessive synchronization when initiating drag-and-drop
Po Lu [Sat, 26 Mar 2022 04:14:52 +0000 (12:14 +0800)]
Avoid excessive synchronization when initiating drag-and-drop

* src/xterm.c (x_dnd_compute_toplevels): Use XCB to get WM
state, attributes, geometry and to translate coordinates.  This
avoids 4 calls to XSync.

2 years agoFix compiler warning in x-dnd.el
Po Lu [Sat, 26 Mar 2022 02:17:12 +0000 (10:17 +0800)]
Fix compiler warning in x-dnd.el

* lisp/x-dnd.el (x-dnd-xdnd-to-action): Move declaration
earlier.

2 years agoAvoid ClientMessage overhead when dragging stuff to other frames
Po Lu [Sat, 26 Mar 2022 02:15:53 +0000 (10:15 +0800)]
Avoid ClientMessage overhead when dragging stuff to other frames

* lisp/dired.el (dired-mouse-drag): Handle correctly dragging
from dired buffers in nonselected windows.
* lisp/x-dnd.el (x-dnd-handle-drag-n-drop-event): Understand new
client message type.
* src/xterm.c (x_dnd_send_enter, x_dnd_send_position)
(x_dnd_send_leave): Ignore if window is the top window of a
frame.
(x_dnd_send_drop): Send special DND event in that case.

2 years agoFix minor issues with dired-mouse-drag-files
Po Lu [Sat, 26 Mar 2022 00:45:08 +0000 (08:45 +0800)]
Fix minor issues with dired-mouse-drag-files

* lisp/dired.el (dired-mouse-drag-files): Update doc string and
add setter.
(dired-insert-set-properties): Don't insert misleading tooltip
if feature is not available.

2 years ago; * lisp/gnus/nnselect.el (nnselect-get-artlist): Fix last change.
Andrew G Cohen [Fri, 25 Mar 2022 22:58:23 +0000 (06:58 +0800)]
; * lisp/gnus/nnselect.el (nnselect-get-artlist): Fix last change.

2 years ago; Restore regexp-quote for gnus subject match
Andrew G Cohen [Fri, 25 Mar 2022 08:06:34 +0000 (16:06 +0800)]
; Restore regexp-quote for gnus subject match

* lisp/gnus/gnus-sum.el (gnus-summary-limit-include-thread): Restore
regexp-quote that was inadvertently dropped in commit 2021-12-21 "Fix
gnus subject matching when subject is empty".

2 years agoFix eshell-explicit-command-char doc string typo
Lars Ingebrigtsen [Fri, 25 Mar 2022 18:01:51 +0000 (19:01 +0100)]
Fix eshell-explicit-command-char doc string typo

* lisp/eshell/esh-ext.el (eshell-explicit-command-char): Fix typo
in doc string (bug#54567).

2 years agoFix (bounds-of-thing-at-point 'number)
Lars Ingebrigtsen [Fri, 25 Mar 2022 16:32:40 +0000 (17:32 +0100)]
Fix (bounds-of-thing-at-point 'number)

* lisp/thingatpt.el (number): Make (bounds-of-thing-at-point
'number) work (bug#54555).

2 years agoFix reporting of read error line/columns in the init file
Lars Ingebrigtsen [Fri, 25 Mar 2022 16:20:35 +0000 (17:20 +0100)]
Fix reporting of read error line/columns in the init file

* src/lread.c (invalid_syntax_lisp): The comments here said that
we were supposed to be called with point in the readcharfun
buffer.  This was not the case (at least) when reading the Emacs
init file, so the reported line/column was always wrong (1 and 0,
respectively) (bug#54550).

2 years agoImprove pp-last-sexp ergonomics
Lars Ingebrigtsen [Fri, 25 Mar 2022 15:44:01 +0000 (16:44 +0100)]
Improve pp-last-sexp ergonomics

* lisp/emacs-lisp/pp.el (pp-last-sexp): Ignore ,@?
before a sexp, because eval-ing that will always lead to an error
(bug#54537).

2 years agoImplement new drag and drop parameter on Haiku
Po Lu [Fri, 25 Mar 2022 13:41:30 +0000 (13:41 +0000)]
Implement new drag and drop parameter on Haiku

* lisp/term/haiku-win.el (x-begin-drag): Implement
`allow-current-frame'.
* src/haiku_support.cc (be_drag_message): New argument
`allow_same_view'.
* src/haiku_support.h: Update prototypes.
* src/haikuselect.c (Fhaiku_drag_message): New parameter
`allow-same-frame'.

2 years agoAllow dragging files from dired to windows on the same frame
Po Lu [Fri, 25 Mar 2022 13:24:03 +0000 (21:24 +0800)]
Allow dragging files from dired to windows on the same frame

* doc/lispref/frames.texi (Drag and Drop): Document new
parameter to `x-begin-drag'.
* lisp/dired.el (dired-mouse-drag): Utilize new parameter.
* lisp/term/haiku-win.el (x-begin-drag): Add new parameter.
* src/xfns.c (Fx_begin_drag): New parameter
`allow-current-frame'.  Fix typo and update doc string.
* src/xterm.c (x_dnd_get_window_proto): Respect
`x_dnd_allow_current_frame'.
(x_dnd_begin_drag_and_drop): New parameter
`allow_current_frame'.
* src/xterm.h: Update prototypes.

2 years agoImprove documentation of 'completion-auto-select'
Eli Zaretskii [Fri, 25 Mar 2022 12:39:44 +0000 (15:39 +0300)]
Improve documentation of 'completion-auto-select'

* lisp/simple.el (completion-auto-select):
* doc/emacs/mini.texi (Completion Options): Improve documentation
and description of customization options of 'completion-auto-select'.

2 years agoMake it easier to select text inside dired when mouse dragging is on
Po Lu [Fri, 25 Mar 2022 12:33:23 +0000 (20:33 +0800)]
Make it easier to select text inside dired when mouse dragging is on

* lisp/dired.el (dired-insert-set-properties): Only set drag
keymap on the filename itself.

2 years ago* admin/notes/emba: Mention workflow rules for branches.
Michael Albinus [Fri, 25 Mar 2022 08:28:44 +0000 (09:28 +0100)]
* admin/notes/emba: Mention workflow rules for branches.

2 years agoFix quitting DND while waiting for finish
Po Lu [Fri, 25 Mar 2022 08:21:17 +0000 (16:21 +0800)]
Fix quitting DND while waiting for finish

* src/xterm.c (x_dnd_begin_drag_and_drop): Always clear finish
flag before quitting.

2 years agoTake window shapes into account when processing drag and drop
Po Lu [Fri, 25 Mar 2022 08:15:57 +0000 (16:15 +0800)]
Take window shapes into account when processing drag and drop

* configure.ac: Test for the Nonrectangular Window Shape
extension.
* msdos/sed1v2.inp: Update.
* src/xterm.c (struct x_client_list_window): New fields for
shapes.
(x_dnd_free_toplevels): Free shapes.
(x_dnd_compute_toplevels): Populate window shapes.
(x_dnd_get_target_window_2): New function.
(x_dnd_get_target_window_1): Test WM state of window before
taking it into account.
(x_dnd_begin_drag_and_drop): Use outer window as the initial
last seen window.
(x_dnd_update_state): Small fixes to frame tracking.
(handle_one_xevent): Handle ShapeNotify events correctly.
(x_term_init): Test for the Nonrectangular Window Shape
extension.
* src/xterm.h (struct x_display_info): New atom `WM_STATE'.

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

d3d6f1c9bd Clarify the description of "selected tags table"

2 years agoUse _NET_CLIENT_LIST_STACKING to optimize drag and drop window discovery
Po Lu [Fri, 25 Mar 2022 03:09:43 +0000 (11:09 +0800)]
Use _NET_CLIENT_LIST_STACKING to optimize drag and drop window discovery

* src/xterm.c (struct x_client_list_window): New struct.
(x_dnd_free_toplevels, x_dnd_compute_toplevels)
(x_dnd_get_target_window_1): New functions.
(x_dnd_get_target_window): Search in the toplevel list if it
exists.
(x_dnd_cleanup_drag_and_drop): Clean up toplevel list.
(x_dnd_begin_drag_and_drop): Compute toplevel list if the
window manager supports it.
(handle_one_xevent): Update the toplevel list if prudent.

2 years agoFix wrapping of 'previous-completion' at the beginning of buffer
Philip Kaludercic [Thu, 24 Mar 2022 18:11:01 +0000 (20:11 +0200)]
Fix wrapping of 'previous-completion' at the beginning of buffer

* lisp/simple.el (next-completion): Prevent an error of
'previous-completion' at the beginning of completions buffer.
Also fix 'previous-completion' to wrap to the last completion.
(bug#54374)

2 years agoSmall fixes for the new feature 'second-tab' of 'completion-auto-select'
Juri Linkov [Thu, 24 Mar 2022 17:54:14 +0000 (19:54 +0200)]
Small fixes for the new feature 'second-tab' of 'completion-auto-select'

* lisp/simple.el (completion-auto-select): Extend the docstring.

2 years agoClarify the description of "selected tags table"
Eli Zaretskii [Thu, 24 Mar 2022 15:22:43 +0000 (17:22 +0200)]
Clarify the description of "selected tags table"

* doc/emacs/maintaining.texi (Select Tags Table): Clarify the
distinction between the "selected tags table" and the "current
list of tags tables".  (Bug#54543)

2 years agoHandle invisible text in Eldoc when calculating size
Augusto Stoffel [Thu, 24 Mar 2022 15:05:39 +0000 (15:05 +0000)]
Handle invisible text in Eldoc when calculating size

Co-authored-by: João Távora <joaotavora@gmail.com>
* lisp/emacs-lisp/eldoc.el (eldoc--echo-area-substring,
eldoc-display-in-echo-area):  Take invisible text into consideration
when counting lines to crop an echo-area message.
(Version): Bump.

2 years ago; * etc/NEWS: Fix wording of a recently added entry.
Eli Zaretskii [Thu, 24 Mar 2022 14:55:28 +0000 (16:55 +0200)]
; * etc/NEWS: Fix wording of a recently added entry.

2 years agoAllow fetching events from other displays inside DND
Po Lu [Thu, 24 Mar 2022 13:23:58 +0000 (21:23 +0800)]
Allow fetching events from other displays inside DND

* src/xterm.c (x_dnd_begin_drag_and_drop): Get the next event
from the app connection instead on Xt.

2 years ago; Fix filename in undigest-tests.el header
Mauro Aranda [Thu, 24 Mar 2022 12:41:20 +0000 (09:41 -0300)]
; Fix filename in undigest-tests.el header

2 years agoAdapt Tramp to dired--insert-disk-space assumptions
Michael Albinus [Thu, 24 Mar 2022 11:50:34 +0000 (12:50 +0100)]
Adapt Tramp to dired--insert-disk-space assumptions

* lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory):
* lisp/net/tramp-smb.el (tramp-smb-handle-insert-directory):
Do not modify disk space information when
`dired--insert-disk-space' is available.  (Bug#54512)

2 years agoFix autoinsert.el byte compilation warning
Lars Ingebrigtsen [Thu, 24 Mar 2022 10:39:13 +0000 (11:39 +0100)]
Fix autoinsert.el byte compilation warning

* lisp/autoinsert.el (sgml-tag): Fix a byte compilation warning.

2 years agoMerge 'completion-auto-select new value secont-tab'
Jimmy Aguilar Mena [Thu, 24 Mar 2022 10:23:32 +0000 (11:23 +0100)]
Merge 'completion-auto-select new value secont-tab'

This includes the second-tab value for completion-auto-select and
documentation related.

2 years agoAdd documentation entries for completion-auto-select user option.
Jimmy Aguilar Mena [Thu, 24 Mar 2022 10:05:26 +0000 (11:05 +0100)]
Add documentation entries for completion-auto-select user option.

2 years agoAdd completion-auto-select second-tab value.
Jimmy Aguilar Mena [Tue, 22 Mar 2022 20:24:13 +0000 (21:24 +0100)]
Add completion-auto-select second-tab value.

* lisp/minibuffer.el (completion--in-region-1) : Change if with cond and
check if completion-auto-select.
* lisp/simple.el (completion-auto-select) : Move before first use.
(completion-setup-function) : Make a more precise check for when
completion-auto-select is t.

2 years ago* lisp/select.el (xselect-convert-to-targets): Use `delete-dups` and `delq`
Stefan Monnier [Thu, 24 Mar 2022 09:32:10 +0000 (05:32 -0400)]
* lisp/select.el (xselect-convert-to-targets): Use `delete-dups` and `delq`

2 years ago* lisp/autoinsert.el (auto-insert-alist): Expose lambdas as code
Stefan Monnier [Thu, 24 Mar 2022 09:19:19 +0000 (05:19 -0400)]
* lisp/autoinsert.el (auto-insert-alist): Expose lambdas as code

2 years ago(archive-*-write-file-member): Fix relative file name
Stefan Monnier [Thu, 24 Mar 2022 09:12:45 +0000 (05:12 -0400)]
(archive-*-write-file-member): Fix relative file name

* lisp/arc-mode.el (archive-*-write-file-member): Set the pwd

2 years agoDo some NEWS tagging
Lars Ingebrigtsen [Thu, 24 Mar 2022 09:09:47 +0000 (10:09 +0100)]
Do some NEWS tagging

2 years agoAvoid crashes if async input arrives when setting properties for DND
Po Lu [Thu, 24 Mar 2022 08:59:03 +0000 (16:59 +0800)]
Avoid crashes if async input arrives when setting properties for DND

* src/xterm.c (x_dnd_begin_drag_and_drop): Block input around
non-async signal safe functions.

2 years agoMention frame-text-* function in frame-pixel-* doc strings
Lars Ingebrigtsen [Thu, 24 Mar 2022 08:59:40 +0000 (09:59 +0100)]
Mention frame-text-* function in frame-pixel-* doc strings

* src/frame.c (Fframe_native_width, Fframe_native_height): Link to
`frame-text-*' functions.

2 years agoFix image-mode-fit-frame some more
Lars Ingebrigtsen [Thu, 24 Mar 2022 08:54:38 +0000 (09:54 +0100)]
Fix image-mode-fit-frame some more

* lisp/image-mode.el (image-mode-fit-frame): Use frame-text-width
and fit-frame-to-buffer instead of computing things ourselves
(bug#37630).  This makes things work better across platforms.

2 years agoFix some bugs with drag and drop and Mozilla
Po Lu [Thu, 24 Mar 2022 08:36:47 +0000 (16:36 +0800)]
Fix some bugs with drag and drop and Mozilla

* src/xfns.c (Fx_begin_drag): Call maybe_quit when iterating
through potentially long lists.  Also allow specifying
XdndActionAsk manually again, since it's useful for debugging.
* src/xterm.c (x_dnd_begin_drag_and_drop): Delete XdndActionList
and XdndActionDescription if they were not specified.

2 years agoLoad desktop without prompting if process is dead
Stefan Kangas [Thu, 24 Mar 2022 08:23:31 +0000 (09:23 +0100)]
Load desktop without prompting if process is dead

* doc/emacs/misc.texi (Saving Emacs Sessions): Document the new
'check' value.
* etc/NEWS: Announce the change (bug#1474).
* lisp/desktop.el (desktop-load-locked-desktop): Add new value 'check'
to load desktop file without prompting if locking Emacs process does
not exist on the local machine.  (Bug#1474)
(desktop-read): Extract function from here...
(desktop--load-locked-desktop-p): ...to here.  New function handles
the semantics of 'desktop-load-locked-desktop', including above new
value 'check'.
(desktop--emacs-pid-running-p): New function.

* test/lisp/desktop-tests.el: New file with tests for the above.

2 years agoFix setter for hl-line-sticky-flag when hl-line is not loaded
Po Lu [Thu, 24 Mar 2022 05:50:55 +0000 (13:50 +0800)]
Fix setter for hl-line-sticky-flag when hl-line is not loaded

* lisp/hl-line.el (hl-line-sticky-flag): Wrap most of setter
around (featurep 'hl-line).  Reported by Michael Heerdegen
<michael_heerdegen@web.de>.

2 years agoAllow holding down scroll bar buttons on Haiku when overscrolling
Po Lu [Thu, 24 Mar 2022 05:32:34 +0000 (05:32 +0000)]
Allow holding down scroll bar buttons on Haiku when overscrolling

* src/haiku_support.cc (EmacsWindow): Set appropriate pulse
rate.
(class EmacsScrollBar, ValueChanged): Don't send any part events
here.
(MouseDown): Set dragging to a value larger than 1 if the scroll
bar is at the end.
(Pulse): New method.

2 years agoFix an infinite loop if the window manager pings Emacs during DND
Po Lu [Thu, 24 Mar 2022 03:41:29 +0000 (11:41 +0800)]
Fix an infinite loop if the window manager pings Emacs during DND

* src/xterm.c (handle_one_xevent): Work around _NET_WM_PING
infinite loop during drag and drop.

2 years agoFix copying font names around on Haiku
Po Lu [Thu, 24 Mar 2022 01:50:18 +0000 (01:50 +0000)]
Fix copying font names around on Haiku

* src/haiku_font_support.cc (font_style_to_flags)
(haiku_font_fill_pattern, BFont_open_pattern)
(BFont_populate_fixed_family, BFont_populate_plain_family):
* src/haiku_support.cc (be_get_version_string):
* src/haikufont.c (haikufont_spec_or_entity_to_pattern): Stop
assuming patterns were allocated by xzalloc.

2 years agoAllow dragging and dropping multiple actions
Po Lu [Thu, 24 Mar 2022 01:42:47 +0000 (09:42 +0800)]
Allow dragging and dropping multiple actions

* doc/lispref/frames.texi (Drag and Drop): Document new meaning
of `action'.
* lisp/term/haiku-win.el (x-begin-drag): Correct for new meaning
of `action'.
* src/xfns.c (Fx_begin_drag): Handle new alist meaning of
`action'.
* src/xterm.c (x_dnd_begin_drag_and_drop): New parameters
`ask_action_list', `ask_action_names' and `n_ask_actions'.
* src/xterm.h: Update prototypes.

2 years agoFix regression in isearch-yank-char-in-minibuffer
Augusto Stoffel [Wed, 23 Mar 2022 18:43:13 +0000 (19:43 +0100)]
Fix regression in isearch-yank-char-in-minibuffer

* lisp/isearch.el (isearch-yank-char-in-minibuffer): Select the
original window in order to restore point.  This is needed when
minibuffer lazy highlight is in effect.

2 years agoMake undigest work with multipart/mixed messages
Mauro Aranda [Wed, 23 Mar 2022 19:42:55 +0000 (20:42 +0100)]
Make undigest work with multipart/mixed messages

* test/lisp/mail/undigest.el: New test file (bug#12873).
* lisp/mail/undigest.el (rmail-digest-methods): Install
rmail-digest-parse-mixed-mime.
(rmail-content-type-boundary): New function, to get a specific
Content-type boundary.
(rmail-digest-parse-mixed-mime): New function, to search for a
multipart/digest message inside a multipart/mixed message.

2 years agoMake quoting of shell arguments in grep.el more robust
Michael Albinus [Wed, 23 Mar 2022 18:54:53 +0000 (19:54 +0100)]
Make quoting of shell arguments in grep.el more robust

* lisp/progmodes/grep.el (grep-apply-setting)
(grep-compute-defaults): Adapt docstring.
(grep-quoting-style): New variable.
(grep-compute-defaults, grep-default-command)
(grep-expand-keywords, lgrep, rgrep-default-command): Use it.

2 years ago* doc/misc/eudc.texi (Inline Query Expansion): Unbreak it.
Glenn Morris [Wed, 23 Mar 2022 15:44:18 +0000 (08:44 -0700)]
* doc/misc/eudc.texi (Inline Query Expansion): Unbreak it.

2 years agoSupport changing remoteness of DIR in rgrep and lgrep
Michael Albinus [Wed, 23 Mar 2022 15:04:57 +0000 (16:04 +0100)]
Support changing remoteness of DIR in rgrep and lgrep

* lisp/net/tramp-sh.el (tramp-get-remote-dev-tty): New defun.
(tramp-sh-handle-make-process): Use it.

* lisp/progmodes/grep.el: Prefer #' to quote named functions.
(lgrep, rgrep): Recompute grep defaults when the remoteness of DIR
changes.

2 years agoImprovements to Haiku selection handling
Po Lu [Wed, 23 Mar 2022 14:15:22 +0000 (14:15 +0000)]
Improvements to Haiku selection handling

* lisp/term/haiku-win.el (haiku-selection-targets): Implement in Lisp.
* src/haiku_select.cc (be_get_message_type):
(be_set_message_type):
(be_get_message_message):
(be_add_message_message): New functions.

* src/haiku_support.cc (MessageReceived): Fix typo.
* src/haikuselect.c (haiku_selection_data_1)
(Fhaiku_selection_targets): Delete functions.
(haiku_message_to_lisp, lisp_to_type_code)
(haiku_lisp_to_message): Correctly decode and encode nested
messages, and fix encoding specially decoded types via numeric
names.  Also store and decode message types inside Lisp
messages.
(Fhaiku_drag_message): Update doc string.
(syms_of_haikuselect): Update subrs.
* src/haikuselect.h: Update prototypes.

2 years agoReinstate `C-M-<delete>'
Lars Ingebrigtsen [Wed, 23 Mar 2022 13:29:03 +0000 (14:29 +0100)]
Reinstate `C-M-<delete>'

* lisp/bindings.el (global-map): Reinstate `C-M-<delete>' and
`C-M-<backspace>' (bug#29430).  These used to kill X, but that
hasn't been the case in any common GNU/Linux distributions for
decades.

2 years agoFix image-mode-fit-frame resizing
Lars Ingebrigtsen [Wed, 23 Mar 2022 13:17:58 +0000 (14:17 +0100)]
Fix image-mode-fit-frame resizing

* lisp/image-mode.el (image-mode-fit-frame): Use pixel sizes
instead of lines/columns to get more accurate resizing (bug#37630).

2 years ago* lisp/term/pgtk-win.el: Update header comment.
Andreas Schwab [Wed, 23 Mar 2022 13:13:06 +0000 (14:13 +0100)]
* lisp/term/pgtk-win.el: Update header comment.

2 years agoFix hl-line tests
Po Lu [Wed, 23 Mar 2022 12:25:33 +0000 (20:25 +0800)]
Fix hl-line tests

* lisp/hl-line.el (hl-line-mode): Restore old setter.
* test/lisp/hl-line-tests.el (hl-line-tests-verify): Don't rely
`cl-some' always returning t on success.
(hl-line-tests-sticky-across-frames): Use correct global variable.

2 years ago* lisp/calendar/todo-mode.el: Restore old code.
Po Lu [Wed, 23 Mar 2022 08:51:01 +0000 (16:51 +0800)]
* lisp/calendar/todo-mode.el: Restore old code.

2 years agoRestore old hl-line code
Po Lu [Wed, 23 Mar 2022 08:48:49 +0000 (16:48 +0800)]
Restore old hl-line code

* lisp/hl-line.el: Restore old code to remove obsoletions.
(hl-line-overlay-priority): Make defcustom.

2 years agoAllow retrieving some more kinds of clipboard data on Haiku
Po Lu [Wed, 23 Mar 2022 08:17:49 +0000 (08:17 +0000)]
Allow retrieving some more kinds of clipboard data on Haiku

* src/haiku_select.cc (BClipboard_find_data): Handle NULL
characters inside data correctly.
(be_lock_clipboard_message, be_unlock_clipboard): New functions.
* src/haikuselect.c (Fhaiku_selection_data): Return entire
clipboard contents as a message when clipboard is NULL.
(haiku_lisp_to_message): Allow quitting when iterating through
potentially large or circular lists.
* src/haikuselect.h (enum haiku_clipboard): New enum.

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

The following commit was skipped:

c69a617742 Add notes about command modes and nativecomp interaction

2 years agoFix crash in haiku_message_to_lisp
Po Lu [Wed, 23 Mar 2022 04:01:01 +0000 (04:01 +0000)]
Fix crash in haiku_message_to_lisp

* src/haikuselect.c (haiku_message_to_lisp): Block input around
`free'.

2 years agoHandle quitting correctly during interprogram drag-and-drop
Po Lu [Wed, 23 Mar 2022 03:30:13 +0000 (11:30 +0800)]
Handle quitting correctly during interprogram drag-and-drop

* lisp/mouse.el (mouse-drag-and-drop-region): Handle quit
correctly by exiting the cross program drag and drop.

2 years ago* src/xterm.c (x_dnd_begin_drag_and_drop): Fix test against DND frame.
Po Lu [Wed, 23 Mar 2022 03:14:13 +0000 (11:14 +0800)]
* src/xterm.c (x_dnd_begin_drag_and_drop): Fix test against DND frame.