Lars Ingebrigtsen [Fri, 24 Jun 2022 12:35:23 +0000 (14:35 +0200)]
Fix some byte-compilation warnings about subr-x
* lisp/term/haiku-win.el (require):
* lisp/replace.el (require):
* lisp/progmodes/elisp-mode.el (require):
* lisp/isearch.el (require):
* lisp/files.el (require): Require subr-x when compiling.
Lars Ingebrigtsen [Fri, 24 Jun 2022 12:11:45 +0000 (14:11 +0200)]
Fix imenu popup syntax
* lisp/imenu.el (imenu--create-keymap): Fix menu syntax
(bug#56185).
Stefan Kangas [Fri, 24 Jun 2022 11:52:51 +0000 (13:52 +0200)]
Merge from origin/emacs-28
a772c0b852 ; Fix typos: prefer US spelling.
# Conflicts:
# doc/misc/modus-themes.org
Eli Zaretskii [Fri, 24 Jun 2022 11:14:41 +0000 (14:14 +0300)]
Fix assertion violation when 'max-redisplay-ticks' is set too low
* src/xdisp.c (update_redisplay_ticks): Disable 'scrolling_window'
optimization in 'update_window' when redisplay of a window is
aborted. (Bug#56184)
Lars Ingebrigtsen [Fri, 24 Jun 2022 09:57:02 +0000 (11:57 +0200)]
Add NEWS entry about kill-buffer change
Mattias Engdegård [Fri, 24 Jun 2022 09:48:42 +0000 (11:48 +0200)]
Bytecode opcode comments update
This is a cosmetic change only; there is no change in behaviour.
* lisp/emacs-lisp/bytecomp.el:
* src/bytecode.c (BYTE_CODES, exec_byte_code):
Update and/or remove incorrect, outdated or useless comments.
Clarify. Reorder where appropriate. Rename Bsave_current_buffer to
Bsave_current_buffer_OBSOLETE and Bsave_current_buffer_1 to
Bsave_current_buffer, reflecting the state since 1996.
Lars Ingebrigtsen [Fri, 24 Jun 2022 09:15:19 +0000 (11:15 +0200)]
Update seq.el comment
* lisp/emacs-lisp/seq.el: Update comment.
Lars Ingebrigtsen [Fri, 24 Jun 2022 09:04:03 +0000 (11:04 +0200)]
Allow `kill-buffer' query to save the buffer first
* lisp/loadup.el ("emacs-lisp/rmc"): Preload.
* lisp/simple.el (kill-buffer--possibly-save): New function to
offer to save the buffer before killing (bug#47075).
* src/buffer.c (Fkill_buffer): Call the new function to query the
user.
(syms_of_buffer): Define symbol.
Lars Ingebrigtsen [Fri, 24 Jun 2022 09:02:14 +0000 (11:02 +0200)]
Preload seq
* lisp/loadup.el ("emacs-lisp/seq"): Preload seq since it's now
almost impossible to do anything in Emacs that doesn't result in
seq being loaded -- for instance, visiting a .txt file or an .el
file, so this will speed up Emacs usage for basically everybody.
Lars Ingebrigtsen [Fri, 24 Jun 2022 09:00:06 +0000 (11:00 +0200)]
Allow read-multiple-choice to do long-form answers
* doc/lispref/commands.texi (Reading One Event): Document it.
* lisp/emacs-lisp/rmc.el (read-multiple-choice): Allow using
long-form answers instead of single character ones.
(read-multiple-choice--long-answers): New function.
(read-multiple-choice--short-answers): Refactored out from the
main function.
Lars Ingebrigtsen [Fri, 24 Jun 2022 08:54:01 +0000 (10:54 +0200)]
Fix cl-generic bootstrap problems
* lisp/sqlite-mode.el (require):
* lisp/net/eudc.el (require):
* lisp/arc-mode.el (require): Require subr-x, since these files
are using macros from there.
* lisp/emacs-lisp/subr-x.el (with-memoization): Move from here...
* lisp/subr.el (with-memoization): ... to here, as it's used from
the preloaded cl-generic.el file.
* lisp/emacs-lisp/cl-generic.el (cl--generic-compiler): Don't use
the autoloaded `byte-compile' function during bootstrap.
(cl--generic-get-dispatcher): Don't require subr-x, either.
cl-generic has been preloaded since 2015, and most usages of it (in
preloaded files) work fine. In particular, using `cl-defgeneric' is
unproblematic. However, `cl-defmethod' would end up pulling in the
byte compiler (at load time), which would make it impossible to use
`cl-defmethod' in pre-loaded files, and this change fixes that (but
possibly not in the most self-evidently correct way).
Lars Ingebrigtsen [Fri, 24 Jun 2022 08:45:34 +0000 (10:45 +0200)]
Make warning about require/autoload while bootstrapping not error out
* src/fns.c (Frequire):
* src/eval.c (Fautoload_do_load): Avoid further errors while
outputting the error about not being able to autoload/require
while bootstrapping.
Lars Ingebrigtsen [Fri, 24 Jun 2022 08:43:41 +0000 (10:43 +0200)]
Make debug-early-backtrace more resilient
* lisp/emacs-lisp/debug-early.el (debug-early-backtrace): Allow
outputting backtraces during bootstrap.
Po Lu [Fri, 24 Jun 2022 08:41:12 +0000 (16:41 +0800)]
Fix handling of mouse motion across screens during drag-and-drop
* src/xterm.c (x_dnd_fill_empty_target): New function.
(handle_one_xevent): Fill empty target if the event didn't come
from the same screen.
Po Lu [Fri, 24 Jun 2022 08:31:45 +0000 (16:31 +0800)]
; * etc/PROBLEMS: Fix errors in last change.
Lars Ingebrigtsen [Fri, 24 Jun 2022 06:57:30 +0000 (08:57 +0200)]
Fix previous nnimap header fetching change
* lisp/gnus/nnimap.el (nnimap-retrieve-headers): Ensure that the
splitting works.
Eli Zaretskii [Fri, 24 Jun 2022 07:44:44 +0000 (10:44 +0300)]
Merge branch 'abort-redisplay'
This allows abandoning the redisplay of a window
that takes too long to complete. Bug#45898
* src/xdisp.c (update_redisplay_ticks): New function.
(init_iterator, set_iterator_to_next): Call
'update_redisplay_ticks'.
(syms_of_xdisp) <max_redisplay_ticks>: New variable.
<list_of_error>: Remove 'void-variable': it is no longer needed,
since 'calc_pixel_width_or_height' can no longer signal a
void-variable error, and it gets in the way of aborting
redisplay via 'redisplay_window_error'.
* src/keyboard.c (command_loop_1): Reinitialize the tick count
before executing each command in the loop.
* src/syntax.c (scan_sexps_forward): Call 'update_redisplay_ticks'
after finishing the loop.
* src/dispnew.c (make_current): Make sure enabled rows of the
current matrix have a valid hash, even if redisplay of a window
was aborted due to slowness. This avoids assertion violations in
'scrolling_window' due to the wrong hash value.
* src/xdisp.c (display_working_on_window_p): New global variable.
(unwind_display_working_on_window): New function.
* src/keyboard.c (command_loop_1): Reset
'display_working_on_window_p' before and after executing commands.
* src/window.c (Frecenter, window_scroll, displayed_window_lines):
* src/indent.c (Fvertical_motion): Set
'display_working_on_window_p' before calling 'start_display'.
* src/syntax.c (scan_sexps_forward): Call 'update_redisplay_ticks'
after finishing the loop.
* src/regex-emacs.c (re_match_2_internal):
* src/bidi.c (bidi_find_bracket_pairs, bidi_fetch_char)
(bidi_paragraph_init, bidi_find_other_level_edge): Update the
redisplay tick count as appropriate, when moving the iterator by
one character position actually requires to examine many more
positions.
* src/xdisp.c (redisplay_window_error): Show messages about
aborted redisplay of a window as delayed-warnings.
* doc/emacs/trouble.texi (DEL Does Not Delete): Move to the end of
the chapter. This issue is no longer frequent or important as it
was back in Emacs 20 days.
(Long Lines): Document 'max-redisplay-ticks'.
* doc/emacs/emacs.texi (Top): Update the detailed menu.
* etc/NEWS: Announce 'max-redisplay-ticks'.
Eli Zaretskii [Fri, 24 Jun 2022 07:23:16 +0000 (10:23 +0300)]
; * etc/NEWS: Minor update of description of 'max-redisplay-ticks'.
Eli Zaretskii [Fri, 24 Jun 2022 07:09:39 +0000 (10:09 +0300)]
; * etc/PROBLEMS: Update the touch-gestures section.
Po Lu [Fri, 24 Jun 2022 02:57:35 +0000 (10:57 +0800)]
Improve grabbing detection with multiple master devices (MPX)
* src/frame.c (gui_mouse_grabbed): Respect any_grab_hook.
* src/termhooks.h (GCALIGNED_STRUCT): New hook `any_grab_hook'.
* src/xterm.c (x_have_any_grab): New function.
(x_create_terminal): Define hook on XI2 builds.
Po Lu [Fri, 24 Jun 2022 01:49:14 +0000 (09:49 +0800)]
Simplify XI event state conversion
* src/xterm.c (xi_convert_button_state, xi_convert_event_state):
New functions.
(handle_one_xevent): Reduce duplicate code for converting XI
state and button state into X state.
Stefan Kangas [Thu, 23 Jun 2022 20:03:50 +0000 (22:03 +0200)]
; Fix typos: prefer US spelling.
Stefan Kangas [Thu, 23 Jun 2022 19:51:19 +0000 (21:51 +0200)]
* lisp/net/browse-url.el: Doc fix; recommend keymap-* functions.
Stefan Kangas [Thu, 23 Jun 2022 19:04:59 +0000 (21:04 +0200)]
* lisp/recentf.el (recentf-auto-cleanup): Clarify docstring.
Mattias Engdegård [Thu, 23 Jun 2022 12:33:46 +0000 (14:33 +0200)]
Remove unused function in bytecomp.el
* lisp/emacs-lisp/bytecomp.el (byte-compile-delete-first): Remove.
Stefan Kangas [Thu, 23 Jun 2022 13:12:47 +0000 (15:12 +0200)]
; * lisp/uniquify.el: Remove incorrect comment.
Gerd Moellmann [Thu, 23 Jun 2022 12:38:13 +0000 (14:38 +0200)]
Save desktop-save-mode when changed from menu
* lisp/menu-bar.el (menu-bar-options-save): Save desktop-save-mode
(bug#56156).
Stefan Kangas [Thu, 23 Jun 2022 11:41:07 +0000 (13:41 +0200)]
Tag shortcut commands for recentf-dialog-mode
* lisp/recentf.el (recentf--shortcuts-keymap): Add interactive mode
tags for 'recentf-dialog-mode' specific commands.
Stefan Kangas [Thu, 23 Jun 2022 10:20:38 +0000 (12:20 +0200)]
Prefer defvar-keymap and keymap-set in recentf.el
* lisp/recentf.el (recentf-mode-map): Prefer defvar-keymap.
(recentf--shortcuts-keymap): Prefer keymap-set.
Stefan Kangas [Thu, 23 Jun 2022 09:00:19 +0000 (11:00 +0200)]
Use shortened filenames in recentf-mode
* lisp/recentf.el (recentf-filename-handlers): Set to
'abbreviate-file-name' to get shortened names by default. (Bug#56123)
Stefan Kangas [Thu, 23 Jun 2022 08:55:45 +0000 (10:55 +0200)]
Revert "Allow shortening filenames in recentf-mode menu"
This reverts commit
32906819addde1aa952d4718699d332d3a58b004.
Stefan Kangas [Thu, 23 Jun 2022 08:55:04 +0000 (10:55 +0200)]
Revert "Use short file names by default in recentf menu"
This reverts commit
ec9228eb81c0a89b18480dfff18cc9afdc3d0884.
Lars Ingebrigtsen [Thu, 23 Jun 2022 09:22:29 +0000 (11:22 +0200)]
Ensure that nnimap doesn't send too long lines to the server
* lisp/gnus/nnimap.el (nnimap-retrieve-headers): Don't send
too-long lines to the server (bug#56138).
Po Lu [Thu, 23 Jun 2022 07:35:37 +0000 (15:35 +0800)]
; * src/xterm.c (x_dnd_send_leave): Remove debugging code.
Po Lu [Thu, 23 Jun 2022 05:58:16 +0000 (13:58 +0800)]
Minor fixes to last change
* src/pgtkselect.c (pgtk_get_window_property): Add 1 to xdata
when it is GdkAtom.
* src/pgtkterm.c (drag_leave): Initialize inev.ie.
Po Lu [Thu, 23 Jun 2022 05:57:23 +0000 (13:57 +0800)]
Make DND from other GTK programs work on Wayland
* lisp/pgtk-dnd.el (pgtk-dnd-handle-gdk): Try to keep the
selection contents in extra-data during a motion event.
Po Lu [Thu, 23 Jun 2022 05:38:30 +0000 (13:38 +0800)]
Allow dropping more data types on PGTK
* lisp/loadup.el (featurep): Load `pgtk-dnd'.
* lisp/pgtk-dnd.el: New file.
(pgtk-dnd-test-function, pgtk-dnd-types-alist)
(pgtk-dnd-known-types, pgtk-dnd-use-offix-drop)
(pgtk-dnd-current-state, pgtk-get-selection-internal)
(pgtk-register-dnd-targets, pgtk-dnd-empty-state)
(pgtk-dnd-init-frame, pgtk-dnd-get-state-cons-for-frame)
(pgtk-dnd-get-state-for-frame, pgtk-dnd-default-test-function)
(pgtk-dnd-current-type, pgtk-dnd-forget-drop)
(pgtk-dnd-maybe-call-test-function, pgtk-dnd-save-state)
(pgtk-dnd-handle-moz-url, pgtk-dnd-insert-utf8-text)
(pgtk-dnd-insert-utf16-text, pgtk-dnd-insert-ctext)
(pgtk-dnd-handle-uri-list, pgtk-dnd-handle-file-name)
(pgtk-dnd-choose-type, pgtk-dnd-drop-data)
(pgtk-dnd-handle-drag-n-drop-event, pgtk-update-drop-status)
(pgtk-drop-finish, pgtk-dnd-handle-gdk, pgtk-dnd): New variables
and functions and library.
* lisp/term/pgtk-win.el (special-event-map): Load
`drag-n-drop-event'.
(after-make-frame-functions): Register DND after make frame
functions.
* src/emacs.c (main): Stop calling empty init_pgtkterm function.
* src/pgtkselect.c (Fpgtk_register_dnd_targets, Fpgtk_drop_finish)
(Fpgtk_update_drop_status): New functions.
(syms_of_pgtkselect): Register new functions.
* src/pgtkterm.c (struct event_queue_t): Fix coding style of
definition.
(symbol_to_drag_action, drag_action_to_symbol)
(pgtk_update_drop_status, pgtk_finish_drop): New functions.
(drag_data_received): Delete function.
(pgtk_set_event_handler): Register for DND correctly.
(syms_of_pgtkterm): New defsyms for DND types.
(init_pgtkterm): Delete function.
* src/pgtkterm.h: Update prototypes, fix prototype coding style.
Stefan Kangas [Thu, 23 Jun 2022 04:30:22 +0000 (06:30 +0200)]
Merge from origin/emacs-28
a3f294b37f Improve last change in autotype.texi
Po Lu [Thu, 23 Jun 2022 03:31:10 +0000 (11:31 +0800)]
Don't send XdndPosition before XdndStatus arrives
* src/xterm.c (x_dnd_send_position): Set pending DND message if
target is right.
(x_dnd_send_leave): Clear pending status target.
(x_dnd_begin_drag_and_drop): Clear new flags.
(handle_one_xevent): Respect those flags.
Po Lu [Thu, 23 Jun 2022 00:53:55 +0000 (08:53 +0800)]
Update device-specific grab during drag-and-drop
* src/xterm.c (x_detect_focus_change): Fix typo.
(handle_one_xevent): Set device if DND is in progress and update
device->grab.
Stefan Kangas [Wed, 22 Jun 2022 23:12:05 +0000 (01:12 +0200)]
Make recentf-elements obsolete
* lisp/recentf.el (recentf-elements): Make obsolete. Update
callers.
Stefan Kangas [Wed, 22 Jun 2022 23:00:54 +0000 (01:00 +0200)]
Convert several defsubst to defun in recentf.el
* lisp/recentf.el (recentf-enabled-p, recentf-string-equal)
(recentf-string-lessp, recentf-push, recentf-expand-file-name)
(recentf-add-file, recentf-remove-if-non-kept)
(recentf-digit-shortcut-command-name, recentf-elements)
(recentf-menu-bar, recentf-sort-ascending)
(recentf-sort-descending, recentf-sort-basenames-ascending)
(recentf-sort-basenames-descending)
(recentf-sort-directories-ascending)
(recentf-sort-directories-descending)
(recentf-show-basenames-ascending)
(recentf-show-basenames-descending): Change from defsubst to
defun.
Stefan Kangas [Wed, 22 Jun 2022 11:36:19 +0000 (13:36 +0200)]
Bind C-c C-c and C-c C-k in recentf-dialog-mode
* lisp/recentf.el (recentf-dialog-mode-map): Prefer defvar-keymap.
Bind `C-c C-c' and `C-c C-k' to confirm/cancel the dialog.
(recentf-cancel-dialog, recentf-edit-list-validate): Add
interactive mode tags for 'recentf-dialog-mode'.
(recentf-dialog-mode): Mark as non-interactive.
(recentf-edit-list): Display key binding.
Michael Albinus [Wed, 22 Jun 2022 15:47:39 +0000 (17:47 +0200)]
Fix dnd-tests-open-remote-url on EMBA
* test/lisp/dnd-tests.el (dnd-tests-open-remote-url): Check for
ftp client.
Mattias Engdegård [Wed, 22 Jun 2022 13:55:19 +0000 (15:55 +0200)]
duplicate-line: fix optional argument and add test (bug#46621)
The test assumes that the current semantics are intended and desired,
which may or may not be true, but it's better than not having any at
all.
* lisp/misc.el (duplicate-line): Don't crash if called with no argument.
* test/lisp/misc-tests.el (misc--duplicate-line): New test.
Richard Hansen [Thu, 16 Jun 2022 19:21:57 +0000 (15:21 -0400)]
bindat (strz): Null terminate fixed-length strings if there is room
* lisp/emacs-lisp/bindat.el (bindat--pack-strz): For fixed-length strz
fields, explicitly write a null terminator after the packed string if
there is room (bug#56048).
* doc/lispref/processes.texi (Bindat Types): Update documentation.
* test/lisp/emacs-lisp/bindat-tests.el (bindat-test--str-strz-prealloc):
Update tests.
Richard Hansen [Mon, 30 May 2022 01:23:57 +0000 (21:23 -0400)]
; bindat (strz): Move all pack logic to pack function (bug#56048)
Motivation/rationale:
* Improve code readability. Now `bindat--pack-strz` is used for all
`strz` packing, not just variable-length `strz` packing.
* Make it easier to change the behavior of fixed-length `strz`
packing without also affecting the behavior of `str` packing. (A
future commit will modify `strz` to write a null terminator if
there is room.)
Gerd Moellmann [Tue, 21 Jun 2022 13:49:44 +0000 (15:49 +0200)]
Prevent GC of window referenced from EmacsScroller
* src/nsterm.m (EmacsScroller.mark, mark_nsterm): New functions.
* src/nsterm.h (EmacsScroller.mark, mark_nsterm): Declare.
* src/alloc.c (garbage_collect) [MAVE_NS]: Call mark_nsterm.
(Bug#56095)
Eli Zaretskii [Wed, 22 Jun 2022 13:46:25 +0000 (16:46 +0300)]
Improve last change in autotype.texi
* doc/misc/autotype.texi (Autoinserting): Fix wording. Suggested
by Richard Stallman <rms@gnu.org>.
Stefan Kangas [Wed, 22 Jun 2022 10:42:01 +0000 (12:42 +0200)]
Prefer Emacs mouse button event names to XEmacs names
* lisp/mwheel.el:
* lisp/vc/ediff-mult.el (ediff-meta-buffer-verbose-message)
(ediff-draw-dir-diffs, ediff-redraw-registry-buffer): Prefer Emacs
mouse button event names to XEmacs names.
Stefan Kangas [Wed, 22 Jun 2022 10:34:05 +0000 (12:34 +0200)]
* lisp/bs.el (bs-mode-map): Prefer defvar-keymap.
Po Lu [Wed, 22 Jun 2022 10:37:32 +0000 (18:37 +0800)]
Fix non-system-malloc build
* src/xterm.c (x_gc_free_ext_data_private): New function.
(x_gc_get_ext_data): Set it as the private data free function.
Stefan Kangas [Wed, 22 Jun 2022 10:14:06 +0000 (12:14 +0200)]
Do interactive mode tagging in edmacro.el
* lisp/edmacro.el (edmacro-finish-edit, edmacro-insert-key):
Add interactive mode tag for edmacro-mode.
Stefan Kangas [Wed, 22 Jun 2022 09:47:30 +0000 (11:47 +0200)]
Use short file names by default in recentf menu
* lisp/recentf.el (recentf-menu-filter): Set the default to
'recentf-show-abbreviated' to get short file names. (Bug#56123)
Stefan Kangas [Wed, 22 Jun 2022 08:03:16 +0000 (10:03 +0200)]
; * lisp/edmacro.el: Minor doc fixes.
Sean Whitton [Wed, 22 Jun 2022 04:23:24 +0000 (06:23 +0200)]
Don't drop existing escape char in eshell
* lisp/eshell/em-term.el (eshell-exec-visual): Don't drop existing
escape char.
Po Lu [Wed, 22 Jun 2022 04:23:00 +0000 (12:23 +0800)]
* src/xterm.c (x_scroll_bar_note_movement): Fix no-toolkit build.
Lars Ingebrigtsen [Wed, 22 Jun 2022 03:25:48 +0000 (05:25 +0200)]
Mention the new Tetris user option
Po Lu [Wed, 22 Jun 2022 02:02:09 +0000 (10:02 +0800)]
Port x-selection-timeout to PGTK
* src/pgtkselect.c (pgtk_own_selection): Fix comment.
(wait_for_property_change, pgtk_get_foreign_selection): Respect
selection timeout.
(syms_of_pgtkselect): New variable `pgtk-selection-timeout'.
Po Lu [Wed, 22 Jun 2022 01:49:16 +0000 (09:49 +0800)]
Fix setting user time for mouse movement events
* src/xterm.c (x_note_mouse_movement, XTmouse_position)
(x_scroll_bar_note_movement, handle_one_xevent): Record whether
or not mouse movement was send_event before using the mouse
movement time.
* src/xterm.h (struct x_display_info): New field
`last_mouse_movement_time_send_event'.
Sam Steingold [Tue, 21 Jun 2022 22:41:13 +0000 (18:41 -0400)]
A trivial optimization and a formatting fix
* lisp/subr.el (internal--compiler-macro-cXXr): Re-use `head' for `n'.
Fix indentation and line length.
Tassilo Horn [Tue, 21 Jun 2022 19:53:57 +0000 (21:53 +0200)]
Merge from origin/emacs-28
f3acc09377 ; Revert "Use file-in-directory-p instead of obsolete dire...
5082d74cfd ; * lisp/recentf.el: Fix typo.
3f66e2a903 * lisp/repeat.el (repeat-mode): Fix message format.
137539c125 Clarify autotype.texi text slightly
Lars Ingebrigtsen [Tue, 21 Jun 2022 19:52:11 +0000 (21:52 +0200)]
Fix logic in previous Tetris change
* lisp/play/tetris.el (tetris-new-shape): Fix logic in previous
change.
Timothee Denizou [Tue, 21 Jun 2022 19:50:15 +0000 (21:50 +0200)]
Allow different randomization of shapes in Tetris
* lisp/play/tetris.el (tetris-allow-repetitions): New user option.
(tetris--shuffle, tetris--seven-bag): New functions.
(tetris-new-shape): Use the option.
* Added 7 bag randomizer for tetris
A piece is selected from the bag and removed each time we want a piece
When the bag is empty, refill the bag with the seven piece and shuffle it
Copyright-paperwork-exempt: yes
Tassilo Horn [Tue, 21 Jun 2022 19:21:12 +0000 (21:21 +0200)]
; Revert "Use file-in-directory-p instead of obsolete dired-in-this-tree-p"
Fixes bug#56126.
This reverts commit
b425966b072792b7b22b845b5f2e39ff4f60b5ab.
Lars Ingebrigtsen [Tue, 21 Jun 2022 18:51:33 +0000 (20:51 +0200)]
Fix shr--set-target-ids test for empty buffer
* lisp/net/shr.el (shr--set-target-ids): Fix the check for an
empty buffer (which may be narrowed).
Michael Heerdegen [Fri, 1 Apr 2022 22:56:09 +0000 (00:56 +0200)]
Fix autoload generation of iter-defun forms
This fixes Bug#54648.
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--make-autoload):
Add `iter-defun' and `cl-iter-defun' to the list of "complex cases"
that are macro-expanded and recursed on.
Philipp Stephani [Tue, 21 Jun 2022 17:10:14 +0000 (19:10 +0200)]
Document and test 'no-byte-compile' behavior.
* lisp/emacs-lisp/bytecomp.el (byte-compile-file): Document behavior
if 'no-byte-compile' is set.
* test/lisp/emacs-lisp/bytecomp-tests.el
(byte-compile-file/no-byte-compile): New unit test.
* test/lisp/emacs-lisp/bytecomp-resources/no-byte-compile.el: New test
file.
Lars Ingebrigtsen [Tue, 21 Jun 2022 17:08:16 +0000 (19:08 +0200)]
Fix too-long ediff
defface doc strings
* lisp/vc/ediff-init.el (ediff-fine-diff-Ancestor):
(ediff-even-diff-Ancestor):
(ediff-odd-diff-Ancestor): Fix too-long doc strings.
Lars Ingebrigtsen [Tue, 21 Jun 2022 17:07:46 +0000 (19:07 +0200)]
Check
defface doc strings
* lisp/emacs-lisp/bytecomp.el
(byte-compile-file-form-custom-declare-variable): We already warn
about missing groups from byte-compile-normal-call, so this would
be a double warning.
(custom-declare-face)
(byte-compile-file-form-custom-declare-face): Add doc string
checking for
defface.
Lars Ingebrigtsen [Tue, 21 Jun 2022 16:45:20 +0000 (18:45 +0200)]
Untabify doc strings before displaying in Customize
* lisp/cus-edit.el (custom-variable-documentation): Untabify the
doc string since we'll be indenting it when displaying it (which
makes the tabs not align properly).
Manuel Giraud [Tue, 21 Jun 2022 14:52:52 +0000 (16:52 +0200)]
Two typos captured on OpenBSD/clang
; * src/kqueue.c (kqueue_compare_dir_list): Indent typo.
; * src/sysdep.c (system_process_attributes): Unused variable on OpenBSD.
Po Lu [Tue, 21 Jun 2022 14:14:49 +0000 (22:14 +0800)]
Fix recent change to xlwmenu.c
* lwlib/xlwmenu.c (ungrab_all): Ungrab keyboard if it was
grabbed. This handles `lucid--menu-grab-keyboard' changing
while the menu is open.
(XlwMenuDestroy):
(pop_up_menu): Record if the keyboard was grabbed.
Po Lu [Tue, 21 Jun 2022 14:03:42 +0000 (22:03 +0800)]
Rewrite PGTK selection code from scratch
* src/frame.c (delete_frame): Clear selections and swallow
special events.
* src/keyboard.c (kbd_buffer_get_event, process_special_events):
Also handle selection events on PGTK.
* src/keyboard.h (union buffered_input_event): Include selection
events on PGTK.
* src/pgtkselect.c (symbol_to_gtk_clipboard, LOCAL_SELECTION):
New functions and macros.
(selection_type_to_quarks, get_func, clear_func): Delete
functions.
(pgtk_selection_init, pgtk_selection_lost):
(pgtk_selection_usable): New functions.
(Fpgtk_own_selection_internal, Fpgtk_disown_selection_internal)
(Fpgtk_selection_exists_p, Fpgtk_selection_owner_p)
(Fpgtk_get_selection_internal): Complete rewrite.
(syms_of_pgtkselect): Update defsyms and add more hooks.
* src/pgtkselect.h: Delete file.
* src/pgtkterm.c (evq_enqueue): Set last user time based on the
event.
(pgtk_any_window_to_frame, button_event): Fix coding style.
(pgtk_set_event_handler): Add selection events.
(pgtk_find_selection_owner, pgtk_selection_event): New
functions.
(pgtk_term_init): Remove call to `pgtk_selection_init'.
* src/pgtkterm.h (struct pgtk_display_info): New field
`display'.
(enum selection_input_event): New struct. New macros for
accessing its fields.
Eli Zaretskii [Tue, 21 Jun 2022 13:21:53 +0000 (16:21 +0300)]
; * doc/lispref/os.texi (Batch Mode): Fix typo and wording.
Lars Ingebrigtsen [Tue, 21 Jun 2022 13:11:28 +0000 (15:11 +0200)]
Fix previous -batch change for gc-cons-percentage
* src/emacs.c (main): Reset the default for gc-cons-percentage in
interactive Emacs.
Lars Ingebrigtsen [Tue, 21 Jun 2022 13:04:27 +0000 (15:04 +0200)]
Increase gc-cons-percentage in -batch Emacs
* doc/lispref/os.texi (Batch Mode): Document it.
* src/emacs.c (main): Use a gc-cons-percentage of 1.0 in
noninteractive Emacsen.
Michael Albinus [Tue, 21 Jun 2022 12:59:46 +0000 (14:59 +0200)]
Tramp code cleanup
* lisp/net/tramp-adb.el (tramp-adb-handle-make-process):
* lisp/net/tramp-sh.el (tramp-sh-handle-make-process):
Improve handling of "process-name" and "process-buffer" connection
properties.
Stefan Kangas [Tue, 21 Jun 2022 12:27:51 +0000 (14:27 +0200)]
Allow shortening filenames in recentf-mode menu
* lisp/recentf.el (recentf-show-abbreviated): New function.
(recentf--filter-names): New helper function.
(recentf-show-basenames): Use above new helper function.
(recentf-menu-filter): Allow setting user option to new value
'recentf-show-abbreviated'.
Eli Zaretskii [Tue, 21 Jun 2022 12:35:22 +0000 (15:35 +0300)]
; * lwlib/xlwmenu.c (ungrab_all): Fix typo.
Stefan Kangas [Tue, 21 Jun 2022 12:20:22 +0000 (14:20 +0200)]
; * lisp/recentf.el: Fix typo.
Stefan Kangas [Tue, 21 Jun 2022 11:56:58 +0000 (13:56 +0200)]
* lisp/repeat.el (repeat-mode): Fix message format.
kobarity [Tue, 21 Jun 2022 11:37:08 +0000 (13:37 +0200)]
Fix nested defuns handling in `python-nav-beginning-of-defun'
* lisp/progmodes/python.el (python-nav--beginning-of-defun): Fix
handling of nested defuns (bug#56105).
Lars Ingebrigtsen [Tue, 21 Jun 2022 11:34:54 +0000 (13:34 +0200)]
Fix previous describe-key change
* lisp/help.el (describe-function-orig-buffer): Ensure we bind
dynamically.
Lars Ingebrigtsen [Tue, 21 Jun 2022 11:33:02 +0000 (13:33 +0200)]
Make describe-key do doc string command key substitution again
* lisp/help.el (describe-key): Do doc string command key
substitution (bug#56106).
Lars Ingebrigtsen [Tue, 21 Jun 2022 11:25:19 +0000 (13:25 +0200)]
Fix fontification in describe-key
* lisp/help.el (describe-key): Use insert instead of princ so that
text properties on the key descriptions survive.
Kevin Brubeck Unhammer [Tue, 21 Jun 2022 11:02:05 +0000 (13:02 +0200)]
Speed up mail-extr in some configurations
* lisp/mail/mail-extr.el (mail-extract-address-components):
(mail-extract-address-components): The buffer is already in
fundamental-mode, so don't re-enable it (bug#56113).
Earl Hyatt [Tue, 21 Jun 2022 10:52:28 +0000 (12:52 +0200)]
Clarify autotype.texi text slightly
* doc/misc/autotype.texi (Autoinserting): Make text slightly
clearer (bug#56118).
Lars Ingebrigtsen [Tue, 21 Jun 2022 10:44:00 +0000 (12:44 +0200)]
Rename recently-introduced dired-omit-line-regexp user option
* lisp/dired-x.el (dired-omit-lines, dired-omit-mode): Rename
dired-omit-line-regexp to dired-omit-lines for consistency.
Lars Ingebrigtsen [Tue, 21 Jun 2022 10:15:11 +0000 (12:15 +0200)]
Make Lucid menus work from the keyboard also when uninstalled
* lwlib/xlwmenu.c (ungrab_all, pop_up_menu): Use it.
* src/keyboard.c (syms_of_keyboard): New variable (bug#46990).
Po Lu [Tue, 21 Jun 2022 05:04:24 +0000 (05:04 +0000)]
Allow toggling antialiasing inside the Haiku font dialog
* src/haiku_support.cc (struct font_selection_dialog_message):
New field `disable_antialias'.
(MessageReceived): Handle new message SET_DISABLE_ANTIALIASING.
(class DualLayoutView): Rename to `TripleLayoutView'.
(class TripleLayoutView): Rename from `DualLayoutView'.
(MinSize): Update computations for three views.
(class EmacsFontSelectionDialog, UpdatePreview)
(EmacsFontSelectionDialog): Add an antialiasing checkbox to
control antialiasing.
(be_select_font): New arguments `initial_antialias' and
`disable_antialias'.
* src/haiku_support.h: Update prototypes.
* src/haikufont.c (haikufont_pattern_from_object): Set
FSPEC_ANTIALIAS.
(Fx_select_font): Update accordingly.
Stefan Kangas [Tue, 21 Jun 2022 04:30:25 +0000 (06:30 +0200)]
Merge from origin/emacs-28
2eb738f2b8 Support builds configured with a separate --bindir
cf4c204df8 * doc/misc/eww.texi (Overview, Basics): Fix typos.
Po Lu [Tue, 21 Jun 2022 02:12:00 +0000 (10:12 +0800)]
Add test for bug#56078 fix
* test/lisp/dnd-tests.el (dnd-tests-open-remote-url): New test.
Po Lu [Tue, 21 Jun 2022 01:52:47 +0000 (09:52 +0800)]
Remove selection requests on the keyboard buffer when closing display
* src/xterm.c (X_NEXT_KBD_EVENT): New macro.
(x_defer_selection_requests): Set input_pending if the kbd
buffer was modified.
(x_delete_selection_requests): New function.
(x_delete_display): Call that. Bug found when a display died
while the clipboard manager was sending an unreasonably high
number of requests.
Po Lu [Tue, 21 Jun 2022 01:35:07 +0000 (09:35 +0800)]
Move selection delayed message to a better location
* lisp/term/x-win.el (gui-backend-get-selection): Remove
`with-delayed-message' here.
* src/xselect.c (x_display_selection_waiting_message)
(x_cancel_atimer): New functions.
(x_get_foreign_selection): Add an atimer that displays the
message after a while.
Sean Whitton [Tue, 21 Jun 2022 00:43:27 +0000 (17:43 -0700)]
* lisp/edmacro.el: Add missing (require 'seq).
Sean Whitton [Mon, 20 Jun 2022 21:33:51 +0000 (14:33 -0700)]
term-set-escape-char: Remove old binding from term-raw-escape-map
* lisp/term.el (term-set-escape-char): When replacing the escape char,
remove the binding of the old escape char in term-raw-escape-map.
Alan Mackenzie [Mon, 20 Jun 2022 18:31:05 +0000 (18:31 +0000)]
Fix potential (goto-char nil) in byte-compile-warning-prefix
* lisp/emacs-lisp/bytecomp.el (byte-compile-warning-prefix): Replace a wrong
'or' form involving OFFSET with simply OFFSET. This prevents OFFSET from
possibly being nil in the first branch of the containing `if' form.
Eli Zaretskii [Mon, 20 Jun 2022 16:04:06 +0000 (19:04 +0300)]
Support builds configured with a separate --bindir
* src/emacs.c (load_pdump): Don't overwrite the leading
directories of the Emacs executable just because the pdumper file
was not found in the expected directory relative to the binary.
This is needed to support builds with a separate --bindir
configure-time option and native-compilation. (Bug#55741)
Lars Ingebrigtsen [Mon, 20 Jun 2022 15:34:33 +0000 (17:34 +0200)]
Issue a message if getting a selection takes a long time
* lisp/term/x-win.el (gui-backend-get-selection): If getting the
selection takes a long time, issue a message after one second
(bug#46935).