Po Lu [Sun, 5 Jun 2022 01:24:20 +0000 (09:24 +0800)]
Make `mouse-position' work correctly with GTK tooltips
* src/xterm.c (x_tooltip_window_to_frame): New parameter
`unrelated_tooltip_p'.
(XTmouse_position): Pass that, and if it turns out to be true,
look beneath the tooltip window.
* lisp/international/ja-dic-cnv.el (skkdic-convert): The
replacement is literal and fixed-case. (The build on EMBA is
failing mysteriously with "Match data clobbered by buffer
modification hooks", so this is mainly a stab in the dark at
fixing that, but it's also generally correct.)
* lisp/emacs-lisp/shortdoc.el (string): Each example section is
supposed to contain only examples of using the function in
question (as policed by the FAILED shortdoc-examples test).
Po Lu [Sat, 4 Jun 2022 12:00:40 +0000 (20:00 +0800)]
Fix error during DND from both Emacs and GTK at the same time
* src/xterm.c (x_dnd_get_target_window): Make mapping and
releasing the COW atomic. This is to fix a rare bug when
MPX (multi-pointer X) is in use and the user tries to drag
from both GTK and Emacs at the same time using multiple seats.
Po Lu [Sat, 4 Jun 2022 10:07:20 +0000 (18:07 +0800)]
Allow keyboard modifiers to control the action taken during dired DND
* doc/emacs/dired.texi (Misc Dired Features): Update
documentation.
* lisp/dired.el (dired-mouse-drag-files): Update defcustom for
new values.
(dired-mouse-drag): Recognize more values of
`dired-mouse-drag-files' and keyboard modifiers.
(dired-mouse-drag-files-map): Add C-down-mouse-1, M-down-mouse-1
and S-down-mouse-1.
* lisp/language/indian.el ("Grantha"): New language environment.
Add composition rules for Grantha. Add sample text and input method.
* lisp/international/fontset.el (script-representative-chars)
(setup-default-fontset): Support Grantha.
* lisp/leim/quail/indian.el ("grantha"): New input method.
* etc/HELLO: Add two Grantha greetings.
* etc/NEWS: Announce the new language environment.
Po Lu [Sat, 4 Jun 2022 08:19:01 +0000 (16:19 +0800)]
Fix file drag-and-drop on GNUstep
* src/nsselect.m (ns_decode_data_to_pasteboard): Convert URL to
path names when we're using NSFilenamesPboardType.
* src/nsterm.m: ([EmacsView performDragOperation:]): Handle
cases where plist is a string.
Po Lu [Sat, 4 Jun 2022 07:45:41 +0000 (15:45 +0800)]
Support dragging multiple files on NS
This has to use a deprecated pasteboard type, since Emacs uses
the "old" (but not deprecated) dragImage: method for
drag-and-drop, which can't drop file URLs.
* lisp/term/ns-win.el (x-begin-drag): Update accordingly.
* src/nsselect.m (ns_decode_data_to_pasteboard):
(Fns_begin_drag): Allow files to be a list of filenames as well.
Po Lu [Sat, 4 Jun 2022 01:51:33 +0000 (09:51 +0800)]
Fix leak of DND toplevels when return-frame is non-nil
* src/xterm.c (x_dnd_free_toplevels): Don't leak DND toplevels
if returning a frame.
(x_dnd_begin_drag_and_drop): Make this function reentrant from
the IO error handler.
Eli Zaretskii [Fri, 3 Jun 2022 11:50:11 +0000 (14:50 +0300)]
; Improve documentation of new drag-and-drop APIs
* lisp/dnd.el (dnd-begin-text-drag, dnd-begin-file-drag):
* doc/lispref/frames.texi (Drag and Drop): Improve wording of
documentation of 'dnd-begin-text-drag' and 'dnd-begin-file-drag'.
Po Lu [Fri, 3 Jun 2022 11:43:06 +0000 (19:43 +0800)]
Allow dragging multiple files from a Dired buffer
* doc/lispref/frames.texi (Drag and Drop): Document new function
`dnd-begin-drag-files'.
* lisp/dired.el (dired-mouse-drag-files): Update doc string.
(dired-map-over-marks): Accept a new value of ARG `marked',
meaning to not fall back to the current file if no marks were
found.
(dired-mouse-drag): Handle marked files in an intuitive way.
* lisp/dnd.el (dnd-last-dragged-remote-file): Allow list values
as well.
(dnd-remove-last-dragged-remote-file): Handle list values.
(dnd-begin-file-drag): Fix file name expansion.
(dnd-begin-drag-files): New function.
* lisp/select.el (xselect-convert-to-filename): Handle mutiple
files
(a vector of file names):.
* src/lread.c (read_escape):
Signal an error for ?\LF since it cannot reasonably be intended.
* test/src/lread-tests.el (lread-escaped-lf): Update test.
* etc/NEWS: Announce.
* lisp/progmodes/idlwave.el (idlwave-comment-indent-char):
Use a space since that is clearly what was meant.
?\ at the end of a line (ie, ?\LF) never was well-defined and produced
-1 most of the time, but will soon raise an error (bug#55738).
This doesn't matter much becaue this variable is unused.
Po Lu [Fri, 3 Jun 2022 07:20:23 +0000 (15:20 +0800)]
Add new user option `mouse-drag-mode-line-buffer'
* etc/NEWS: Announce new option. Also add missing entries for
an earlier change.
* lisp/mouse.el (mouse-drag-mode-line-buffer): New user option.
(mouse-drag-mode-line): Implement that option.
* doc/emacs/display.texi (Optional Mode Line): Document it.
* lisp/battery.el (battery-update-functions): New user option
(bug#55770).
(battery-update): Use it.
* doc/lispref/windows.texi (Window Sizes):
* doc/lispref/display.texi (Size of Displayed Text): Remove
documentation.
* lisp/fringe.el (fringe-mode): Point to the right function.
* lisp/window.el (window-char-pixel-width)
(window-char-pixel-height, window-max-characters-per-line): Remove
functions -- this was already added as window-max-chars-per-line.
Po Lu [Fri, 3 Jun 2022 00:51:49 +0000 (08:51 +0800)]
Don't call XSelectInput on a dying display when cancelling drag-and-drop
* src/xterm.c (x_dnd_free_toplevels): New argument
`display_alive'.
(x_dnd_cleanup_drag_and_drop, x_dnd_begin_drag_and_drop)
(handle_one_xevent): Change calls to `x_dnd_free_toplevels'.
(x_connection_closed, x_delete_terminal): Set it to false.
Make checkdoc-file-comments-engine match more ;;;### forms
* lisp/emacs-lisp/checkdoc.el (checkdoc-file-comments-engine): Use
the more general lisp-mode-autoload-regexp instead of
generate-autoload-cookie (i.e., also match ;;;###tramp-autoload).
The old -1 value was an artefact of the reader implementation.
* src/lread.c (read_escape): Remove the `stringp` argument; assume
character literal syntax. Never return -1.
(read_string_literal): Handle string-specific escape semantics here
and simplify.
* test/src/lread-tests.el (lread-escaped-lf): New test.
Po Lu [Thu, 2 Jun 2022 11:54:09 +0000 (19:54 +0800)]
More gracefully handle errors during Motif drag window creation
* src/xterm.c (xm_drag_window_error_handler): Store whether or
not an error happened.
(xm_get_drag_window): Handle errors during XCreateWindow and
XChangeProperty without leaking anything.
(x_error_handler): Fix coding style.
* lisp/Makefile.in ($(lisp)/loaddefs.el): Use the new function.
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Pass in
whether to inhibit a partial build (to make the code more general).
(loaddefs-generate--emacs-batch): Add a new function specially for
the Emacs build that has the special rules needed. (This also
fixes out-of-tree builds.)
loaddefs-generate-batch can be used in general for packages etc.
(loaddefs-generate-batch): Remove the special code for Emacs builds.
Po Lu [Thu, 2 Jun 2022 07:46:42 +0000 (15:46 +0800)]
Fix flickering tooltips with mouse DND without interprogram drag
* src/haikuterm.c (haiku_read_socket):
* src/nsterm.m (ns_mouse_position):
* src/xterm.c (XTmouse_position, handle_one_xevent): Apply
special tooltip treatment to `dropping' as well as
`drag-source'.
Po Lu [Thu, 2 Jun 2022 06:27:38 +0000 (14:27 +0800)]
Fix help-echo tooltips interfering with mouse drag-and-drop
* lisp/mouse.el (mouse-drag-and-drop-region): Disable
tooltip-mode while mouse drag-and-drop is in progress. Also
restore state correctly in some more cases.
Po Lu [Thu, 2 Jun 2022 05:33:17 +0000 (13:33 +0800)]
Fix tooltips flickering on X during `mouse-drag-and-drop-region'
* src/xterm.c (x_get_window_below): New function.
(XTmouse_position): If track-mouse is drag-source and a window
is a tooltip, look below it.
(handle_one_xevent): Don't generate a nil help-echo event on
LeaveNotify if the display is grabbed and track-mouse is
drag-source.
Richard Hansen [Sun, 29 May 2022 22:09:08 +0000 (18:09 -0400)]
bindat (strz): Fix wrong-type-argument error when unpacking
* lisp/emacs-lisp/bindat.el (strz): Fix (wrong-type-argument
number-or-marker-p nil) error when unpacking a strz with
unspecified (variable) length.
* test/lisp/emacs-lisp/bindat-tests.el (strz): Mark test as passing.
Richard Hansen [Sun, 29 May 2022 03:10:44 +0000 (23:10 -0400)]
bindat (strz): Fix off-by-one bug in computed length
* lisp/emacs-lisp/bindat.el (strz): Include null terminator when
computing packed string length.
* test/lisp/emacs-lisp/bindat-tests.el (strz): Mark tests as passing.
Juri Linkov [Wed, 1 Jun 2022 19:12:12 +0000 (22:12 +0300)]
* lisp/simple.el (completion-setup-function): Use file-name-directory.
Replace file-name-as-directory with file-name-directory,
because file-name-as-directory returns a nonexistent dir
e.g. "/dir/prefix/" when completing "/dir/prefix".
OTOH, file-name-directory returns "/dir/" in such cases (bug#55743).
Eli Zaretskii [Wed, 1 Jun 2022 18:57:07 +0000 (21:57 +0300)]
Avoid segfaults on MS-Windows when invoked with --version
* src/emacs.c (main): If invoked with --version, call
'init_bignum' before calling 'format-time-string', as that is
needed for safe manipulation of bignums in timefns.c.
Make the character literal ?\LF (linefeed) generate 10, not -1.
Ensure that Control escape sequences in character literals are
idempotent: ?\C-\C-a and ?\^\^a mean the same thing as ?\C-a and ?\^a,
generating the control character with value 1. "\C-\C-a" no longer
signals an error.
* src/lread.c (read_escape): Make nonrecursive and only combine
the base char with modifiers at the end, creating control chars
if applicable. Remove the `stringp` argument; assume character
literal syntax. Never return -1.
(read_string_literal): Handle string-specific escape semantics here
and simplify.
* test/src/lread-tests.el (lread-misc-2): New test.
Michael Albinus [Wed, 1 Jun 2022 16:36:35 +0000 (18:36 +0200)]
Make files-tests.el more robust
* test/lisp/files-tests.el (files-tests--with-temp-non-special)
(files-tests--with-temp-non-special-and-file-name-handler): Make
it more robust wrt parallel test jobs. (Bug#55706)
Visuwesh [Sun, 29 May 2022 06:15:19 +0000 (11:45 +0530)]
delete-selection-mode: Add user option to delete temporary regions only
* lisp/delsel.el (delete-selection-temporary-region): Add new
user option.
(delete-selection-pre-hook): Respect it.
* doc/emacs/mark.texi (Using Region): Document the new user option.
* etc/NEWS: Announce the new user option. (bug#55692)
Po Lu [Wed, 1 Jun 2022 14:00:44 +0000 (22:00 +0800)]
Improve documentation of Lisp-level drag-and-drop features
* doc/lispref/frames.texi (Drag and Drop): Don't conflate X
Windows specific implementation details with general
drag-and-drop functionality, document what `dnd-protocol-alist'
actually means, and improve documentation on DND data types.
Stefan Kangas [Tue, 31 May 2022 13:20:44 +0000 (15:20 +0200)]
Make XEmacs compat code in gamegrid.el obsolete
* lisp/play/gamegrid.el (gamegrid-make-glyph): Warn on using obsolete
XEmacs style glyph. (This is currently unused in the Emacs tree.)
(gamegrid-make-image-from-vector): Make obsolete.
Po Lu [Wed, 1 Jun 2022 12:52:00 +0000 (20:52 +0800)]
Minor fixes to x_next_event_from_any_display
* src/xterm.c (x_next_event_from_any_display): Don't call
XPending unless there is input to be read on the connection, and
don't call ConnectionNumber twice.
Add support for the Hanifi Rohingya script (bug#55745)
* lisp/language/misc-lang.el ("Hanifi Rohingya"):
New language environment.
Add composition rules for Hanifi Rohingya.
Add sample text and input method.
* lisp/international/fontset.el (script-representative-chars)
(setup-default-fontset): Support Hanifi Rohingya.
* lisp/leim/quail/misc-lang.el ("hanifi-rohingya"):
New input method.
* etc/HELLO: Add a Hanifi Rohingya greeting.
* etc/NEWS: Announce the new language environment.
Start the org -> texi conversion while doing byte compilation
* lisp/Makefile.in (MAIN_FIRST): Compile stuff needed for org ->
texi generation.
(all): Add org-manuals.
(org-manuals): Start org -> texi conversion while we're doing byte
compilation to make things more parallel. This shaves off about
ten seconds of a "make -j8" build.
* admin/MAINTAINERS: Update link to the Git repository of the
modus-themes; point to the new mailing list; include command for
sending a bug report.
* doc/misc/modus-themes.org (Install from the archives): Minor
rewording.
(Dealing with byte compilation errors): Clarify that occasional bugs
are not always a fault of the themes.
(Custom hl-todo colors): Add note about package.:(Full support for
packages or face groups, Indirectly covered packages): Update lists of
supported packages.
(Note on avy hints): Remove obsolete node.
(Note on git-gutter in Doom Emacs): Note problem with custom bitmaps,
which is not the fault of the themes.
(Note on display-fill-column-indicator-mode): Show how to use a
thicker indicator.:(Why are colors mostly variants of blue, magenta,
cyan?): Minor rewording.
(Sources of the themes): Update official theme sources.
(Issues you can help with)
(Patches require copyright assignment to the FSF): Update the
information on potential contributions.
(Acknowledgements): Update list of contributors in the form of code or
ideas/feedback.
(Meta, Other notes about the project): Rename section and include more
links to development-related blog posts.
* etc/themes/modus-themes.el (seq): Stop requiring 'seq'.
(modus-themes--version): Use internal variable for the themes'
version.
(modus-themes-operandi-colors, modus-themes-vivendi-colors): Make
minor tweaks to the color palettes.
(modus-themes-variable-pitch): Remove obsolete symbol from doc string.
(modus-themes--alist-or-seq): Update function to not rely on 'seq'.
(modus-themes--current-theme): Make stylistic tweaks.
(modus-themes--markup): Use correct order of inheritance for faces.
(modus-themes--paren, modus-themes--heading)
(modus-themes--agenda-structure, modus-themes--agenda-date)
(modus-themes--agenda-habit, modus-themes--mode-line-attrs)
(modus-themes--mode-line-padded-box, modus-themes--button): Update to
use 'modus-themes--property-lookup' instead of the previous function
that depended on 'seq'.
(modus-themes--diff): Make it combine as expected with the user option
'modus-themes-deuteranopia'.
(modus-themes-faces): Update list of faces.
(modus-themes-custom-variables): Expand support for face rotation in
'highlight-changes'.
* etc/themes/modus-operandi-theme.el:
* etc/themes/modus-vivendi-theme.el: Bump version number to 2.4.1.
Tweak how loaddefs-gen decides whether to do a full update
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Do a
complete build more often to avoid problems with going from old
loaddefs.el files to new ones.
Po Lu [Wed, 1 Jun 2022 08:39:26 +0000 (08:39 +0000)]
Adjust last change to Haiku as well
* lisp/term/haiku-win.el (haiku-dnd-selection-converters): Add
text/uri-list.
(haiku-dnd-convert-text-uri-list): New function.
(x-begin-drag): Handle alternative data specified in selection
local values.
Po Lu [Wed, 1 Jun 2022 08:25:53 +0000 (16:25 +0800)]
Clean up text/uri-list mess inside the Dired drag-and-drop code
* doc/lispref/frames.texi (Window System Selections):
* etc/NEWS: Document new changes to `gui-get-selection'.
* lisp/dired.el (dired-mouse-drag): Specify text/uri-list value
explicitly.
* lisp/select.el (gui-set-selection): Update doc string.
(xselect-convert-to-text-uri-list): Update to handle either a
single URL (as a string) or a vector of URLs, instead of file
names.
(xselect-uri-list-available-p): Likewise.
* src/xselect.c (x_get_local_selection): Look in tem's text
properties (if it is a string) for a local value before using
tem itself.
Po Lu [Wed, 1 Jun 2022 06:13:57 +0000 (14:13 +0800)]
Fix hangs when explicitly moving frames with input blocked
* src/xterm.c (x_check_expected_move): Fix indent.
(x_sync_with_move): Use pselect to wait the 0.5 seconds instead
of wait_reading_process_output if input is blocked.