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.
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'.
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.
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.
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.
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.
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".
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).
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'.
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.
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)
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)
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.
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)
* 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.
* 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.
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.
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.
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.
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.
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.
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.
* 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.
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.
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.
Po Lu [Wed, 23 Mar 2022 01:21:04 +0000 (09:21 +0800)]
Reported taken action correctly when dragging to another frame on X
* src/xterm.c (x_dnd_cleanup_drag_and_drop, x_dnd_update_state)
(x_free_frame_resources, handle_one_xevent): Set
`x_dnd_end_window'.
(x_dnd_begin_drag_and_drop): Return `XdndActionPrivate' if the
drop landed on one of our own frames.
Andrew G Cohen [Tue, 22 Mar 2022 04:11:14 +0000 (12:11 +0800)]
Refactor gnus/nnselect artlist saving and getting
* lisp/gnus/nnselect.el (nnselect-generate-run): New function that
replaces nnselect-run.
(nnselect-store-artlist): New function.
(nnselect-get-artlist): Update function.
(nnselect-request-group, nnselect-request-thread)
(nnselect-request-create-group, nnselect-request-group-scan): Use the
new functions.
* doc/misc/gnus.texi (Selection Groups): Document artlist storage and
retrieval.
Alexander Adolf [Mon, 14 Mar 2022 20:23:18 +0000 (21:23 +0100)]
Enable Better Alignment of EUDC Inline Expansion With RFC5322
The format of EUDC inline expansion results is formatted according to
the variable eudc-inline-expansion-format, which previously defaulted
to '("%s %s <%s>" firstname name email).
Since email address specifications need to comply with RFC 5322 in
order to be useful in messages, there was little headroom for users to
change this format anyway. Plus, if an EUDC back-end returned an empty
first and last name, the result was the email address in angle
brackets. Whilst this was standard with RFC 822, it is marked as
obsolete syntax by its successor RFC 5322. Also, the first and last
name part was never enclosed in double quotes, potentially producing
invalid address specifications, which may be rejected by a receiving
MTA.
This commit updates the variable eudc-inline-expansion-format, so that
it can, in addition to the current ("format" attributes) list, now
alternatively be set to nil, or a formatting function. In both cases
the resulting email address is formatted using the new function
eudc-rfc5322-make-address, whose results fully comply with RFC 5322.
If the value is nil (the new default value), eudc-rfc5322-make-address
will be called to produce any of the default formats
ADDRESS
FIRST <ADDRESS>
LAST <ADDRESS>
FIRST LAST <ADDRESS>
depending on whether a first and/or last name are returned by the
query, or not.
If the value is a formatting function, that will be called to allow
the user to supply content for the phrase and comment parts of the
address (cf. RFC 5322). Thus one can produce any of the formats:
This can for example be used to get "last, first <address>" instead of
the default "first last <address>".
In any case when using nil, or the formatting function, the phrase
part of the result will be enclosed in double quotes if needed, and
the comment part will be omitted if it contains characters not allowed
by RFC 5322.
When eudc-inline-expansion-format remains set to a list as previously,
the old behaviour is fully retained.