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.
Reshuffle the generation of the OKURO-NASI entries to speed up build
* leim/Makefile.in (all): Remove the ja-dic target from all -- we
don't need this file generated before we generate the .elc files.
(generate-ja-dic): Add new target.
* lisp/Makefile.in (.PHONY, generate-ja-dic): Add new target.
(all): Make all depend on the new generate-ja-dic target so that
the OKURO-NASI entries are computed while the .elc files are
compiled. On a AMD Ryzen 9 5950X 16-Core Processor this brings
compilation time on a "make -j32 bootstrap" down from 1m52s to 1m34s.
Manuel Giraud [Tue, 31 May 2022 18:35:39 +0000 (20:35 +0200)]
Add a last-modified field when a bookmark is set
* test/lisp/bookmark-tests.el (bookmark-tests-make-record)
(bookmark-tests-make-record-list, bookmark-tests-set): fix tests
to not consider last-modified in bookmark equality.
* lisp/bookmark.el (bookmark-make-record-default): add a
last-modified field.
(bookmark-sort-flag): add the 'last-modified choice.
(bookmark-get-last-modified): new function to get last-modified
bookmark field.
(bookmark-maybe-sort-alist): sort in last-modified first order.
(bookmark-completing-read): use `bookmark-maybe-sort-alist'.
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Only update
the loaddefs section for the files that have changed. This makes
"git pull" (when few/no Lisp files have changed much faster).
Juri Linkov [Tue, 31 May 2022 17:52:37 +0000 (20:52 +0300)]
Fix handling of windows/buffers for non-nil completion-auto-select (bug#55712)
* lisp/minibuffer.el (completion--in-region-1): When completion-auto-select
is `second-tab', call switch-to-completions outside of `with-current-buffer'.
For the case of completion-auto-select customized to t,
move switch-to-completions from completion-setup-function
where it was called inside of with-current-buffer-window.
* lisp/simple.el (completion-setup-function): Move switch-to-completions
for completion-auto-select=t to completion--in-region-1 where it's
handled together with the case of `second-tab'.
(next-completion): Add check for the minibuffer to support in-buffer
inline completions.
* doc/lispref/loading.texi (Autoload, Autoload by Prefix): Refer
to loaddefs-generate instead of update-file-autoloads.
* lisp/Makefile.in (LOADDEFS): Remove, because all the loaddefs
files are created in one go now.
(COMPILE_FIRST): Add loaddefs-gen/radix-tree, and drop autoload.
($(lisp)/loaddefs.el): Use loaddefs-gen.
(MH_E_DIR, $(TRAMP_DIR)/tramp-loaddefs.el)
($(MH_E_DIR)/mh-loaddefs.el, $(CAL_DIR)/cal-loaddefs.el)
($(CAL_DIR)/diary-loaddefs.el, $(CAL_DIR)/hol-loaddefs.el): Remove.
* lisp/generic-x.el: Inhibit computing prefixes, because the
namespace here is all wonky.
* lisp/calendar/holidays.el ("holiday-loaddefs"): Renamed from
hol-loaddefs to have a more regular name.
* lisp/cedet/ede/proj-elisp.el (ede-emacs-cedet-autogen-compiler):
Refer to loaddefs-gen instead of autoload.
* lisp/emacs-lisp/autoload.el (make-autoload, autoload-rubric)
(autoload-insert-section-header): Made into aliases of
loaddefs-gen functions.
(autoload--make-defs-autoload): Ditto.
(autoload-ignored-definitions, autoload-compute-prefixes): Moved
to loaddefs-gen.
* lisp/emacs-lisp/lisp-mode.el (lisp-mode-autoload-regexp): New
constant.
(lisp-fdefs, lisp-mode-variables, lisp-outline-level): Use it to
recognize all ;;;###autoload forms.
* lisp/emacs-lisp/loaddefs-gen.el: New file.
* lisp/emacs-lisp/package.el: Use loaddefs-generate instead of
make-directory-autoloads.
* test/lisp/vc/vc-bzr-tests.el (vc-bzr-test-faulty-bzr-autoloads):
Use loaddefs instead of autoloads.
Po Lu [Tue, 31 May 2022 13:31:18 +0000 (13:31 +0000)]
Convert FILE_NAME to refs on Haiku instead of text/uri-list
* lisp/term/haiku-win.el (haiku-dnd-selection-converters): Use
more appropriate target for file names.
(haiku-dnd-convert-uri-list): Delete function.
(haiku-dnd-convert-file-name): New function. Also handle remote
file names.
Add support for the Makasar and Lontara scripts (bug#55734)
* lisp/language/indonesian.el ("Makasar") ("Buginese"):
New language environment. Add composition rules for Makasar
and Lontara. Add sample texts and input methods.
* lisp/international/fontset.el (script-representative-chars)
(setup-default-fontset): Support Makasar and Buginese.
* lisp/leim/quail/indonesian.el ("makasar") ("lontara"):
New input methods.
* etc/HELLO: Add Makasar and Buginese greetings.
* etc/NEWS: Announce the new language environments.
Po Lu [Tue, 31 May 2022 10:05:41 +0000 (18:05 +0800)]
Implement `return-frame' for DND on NS
* src/nsselect.m (Fns_begin_drag): New argument `return-frame'.
(syms_of_nsselect): New defsym.
* src/nsterm.h (EmacsWindow): New fields.
* src/nsterm.m (ns_read_socket): Split parts off to
ns_read_socket_1.
(ns_read_socket_1): New function.
(ns_flush_display): Use that function instead.
([EmacsWindow beginDrag:forPasteboard:]): Update for
return-frame.
Po Lu [Tue, 31 May 2022 08:40:57 +0000 (16:40 +0800)]
Fix autorelease pool "straddling" during DND on NS
* src/nsterm.m (ns_mouse_position): Implement `drag-source'
on NS.
([EmacsView draggingUpdated:]): Add autorelease pool around
callbacks.
([EmacsWindow beginDrag:forPasteboard:]): Block input around
dragImage.
Paul Eggert [Tue, 31 May 2022 08:19:32 +0000 (01:19 -0700)]
Pacify GCC 12 in x_get_current_wm_state
* src/xterm.c (x_get_current_wm_state): When lint checking,
initialize reply_data to a non-null dummy value instead of to a
null one. This pacifies GCC 12 -Wanalyzer-null-dereference.
Paul Eggert [Tue, 31 May 2022 08:19:32 +0000 (01:19 -0700)]
Simplify CHAR_TABLE_REF_ASCII
* src/lisp.h (CHAR_TABLE_REF_ASCII): Refactor as a straightforward
for-loop. Redo an if-then-else to be an (!if)-else-then as this
is a bit cleaner, and it also works around GCC bug 105755.
Paul Eggert [Tue, 31 May 2022 08:19:32 +0000 (01:19 -0700)]
Avoid undefined behavior in detect_coding routines
* src/coding.c (detect_coding): Always initialize all
components of detect_info, so that detect_coding_utf_8 etc.
do not have undefined behavior when they read detect_info.checked.
This bug is not likely to cause problems on real systems.
Problem found by GCC 12 -fanalyzer.
(detect_coding_system): Use consistent style with detect_coding
initialization.
* lib-src/etags.c (readline_internal): Do not copy a pointer to
freed storage, as that has undefined behavior even if the pointer
is not dereferenced.
(relative_filename): Avoid a backward scan by remembering where
the last slash was. This is a bit faster, and pacifies a GCC
false alarm.
Juri Linkov [Mon, 30 May 2022 16:30:54 +0000 (19:30 +0300)]
* lisp/progmodes/project.el: Improve file-reading history and default values.
(project-find-file): Use relative file name of the
currently visited file as an alternative default value.
(project-find-file-in, project-find-dir): Use 'file-name-history' (bug#55267).
Restructure the reader to be nonrecursive so that it is not limited by
the C stack or crashes Emacs when reading deeply nested data.
This also improves performance.
A few minor bugs were fixed:
- (a .{NBSP}b) where {NBSP} is a non-breaking space (U+00A0) is now
the dotted pair (a . b), not the 3-element list (a \. b), since U+00A0
is treated as whitespace everywhere else.
- #_ with no symbol following is now equivalent to ## (empty interned
symbol), not #: (empty uninterned symbol).
* src/alloc.c (garbage_collect): Call mark_lread.
* src/lread.c (readevalloop): Use read0 instead of read_list.
(stackbufsize): Increase to 1024, now that read0 isn't recursive.
(invalid_radix_integer): Buffer overflow check.
(read1, read_list, read_vector): Remove.
(read_char_literal, read_string_literal)
(hash_table_from_plist, record_from_list, vector_from_rev_list)
(bytecode_from_rev_list, char_table_from_rev_list)
(sub_char_table_from_rev_list, string_props_from_rev_list)
(read_bool_vector, skip_lazy_string, symbol_char_span)
(skip_space_and_comments)
(enum read_entry_type, struct read_stack_entry, struct read_stack)
(rdstack, mark_lread, read_stack_top, read_stack_pop)
(read_stack_empty_p, grow_read_stack, read_stack_push): New.
(read0): Rewrite to be nonrecursive.
* test/src/lread-tests.el (lread-deeply-nested, lread-misc): New tests.
Fix atimer setting and overdue expiration (bug#55628)
* src/atimer.c (set_alarm): If the atimer has already expired, signal
it right away instead of postponing it further. Previously this could
occur repeatedly, blocking atimers indefinitely.
Also only use `alarm` as fallback if `setitimer` is unavailable, not
both at the same time (which makes no sense, and they both typically
use the same mechanism behind the curtains).
* test/src/eval-tests.el (eval-tests/funcall-with-delayed-message):
New test, verifying proper functioning of funcall-with-delayed-message
which also serves as test for this bug (which also caused
debug-timer-check to fail, but that test is only run when Emacs is
built with enable-checking).
* lisp/language/indonesian.el ("Rejang"): New language environment.
Add composition rules for Rejang. Add sample text and input
method.
* lisp/international/fontset.el (script-representative-chars)
(setup-default-fontset): Support Rejang.
* lisp/leim/quail/indonesian.el ("rejang"): New input method.
* etc/HELLO: Add a Rejang greeting.
* etc/NEWS: Announce the new language environment.
Po Lu [Mon, 30 May 2022 10:09:41 +0000 (18:09 +0800)]
Get rid of `defvar-keymap' in flymake.el
* lisp/progmodes/flymake.el (flymake-mode-map)
(flymake-diagnostics-buffer-mode-map): Stop using
`defvar-keymap', since Flymake only requires Emacs 26.1.
Po Lu [Mon, 30 May 2022 07:54:22 +0000 (07:54 +0000)]
Update frame positions on Haiku after changing Z group
* src/haiku_support.cc (EmacsScreenChangeMonitor): Fix comment.
* src/haikufns.c (haiku_set_z_group): Ask for a position update,
since changing the Z group might change the feel of the window.
Po Lu [Mon, 30 May 2022 06:04:43 +0000 (14:04 +0800)]
Fix hangs when x-get-selection is called inside a popup menu
* src/xselect.c (wait_for_property_change):
(x_get_foreign_selection): Use `x_wait_for_cell_change' if input
is blocked. (bug#22214)
* src/xterm.c (x_wait_for_cell_change): New function.
* src/xterm.h: Update prototypes.
Po Lu [Mon, 30 May 2022 02:36:43 +0000 (10:36 +0800)]
Try to implement `dnd-indicate-insertion-point' on macOS
* lisp/term/ns-win.el (ns-handle-drag-motion): New function.
* src/nsterm.m ([EmacsView draggingUpdated:]): Call that
function instead.
(syms_of_nsterm): Clean up old style defvars and add new
defvar for the DND drag function.
Po Lu [Mon, 30 May 2022 01:25:03 +0000 (09:25 +0800)]
Further clean up DND target handling
* src/xfns.c (Fx_begin_drag): Alloca target list.
* src/xterm.c (x_set_dnd_targets): Copy the given targets list.
(x_dnd_begin_drag_and_drop): Record freeing the targets list on
the specpdl.
(handle_one_xevent, x_dnd_cleanup_drag_and_drop)
(x_connection_closed, x_delete_terminal): Stop calling
`x_set_dnd_targets' manually to free the targets list.
Paul Eggert [Sun, 29 May 2022 20:07:50 +0000 (13:07 -0700)]
ISO 8601 strings sans "Z" don’t specify DST flag
* lisp/calendar/iso8601.el (iso8601--zone-dst): New function.
(iso8601-parse, iso8601-parse-time): Use it.
(iso8601--decoded-time): Default dst to -1, not nil.
* test/lisp/calendar/iso8601-tests.el (test-iso8601-combined)
(standard-test-time-of-day-zone): Adjust to new behavior.
Stefan Monnier [Sun, 29 May 2022 17:37:44 +0000 (13:37 -0400)]
* lisp/shell.el (shell): Fix last change
Wrap the file-name prompt within `with-connection-local-variables` as
it was before the previous change.
While at it, make sure we set the `default-directory` of
the actual shell buffer after querying the user.
* lisp/language/indonesian.el ("Batak"): New language environment.
Add composition rules for Batak. Add sample text and input
method.
* lisp/international/fontset.el (script-representative-chars)
(setup-default-fontset): Support Batak.
* lisp/leim/quail/indonesian.el ("batak"): New input method.
Rename TITLE of balinese, javanese and sundanese in
("quail-define-package").
* etc/HELLO: Add a Batak greeting.
* etc/NEWS: Announce the new language environment and its
input method.
Traverse record literals in byte-compile--first-symbol-with-pos
* lisp/emacs-lisp/bytecomp.el (byte-compile--first-symbol-with-pos):
Traverse record literals as well as vectors. Either is rather
pointless but there were some strong feelings about it.