* lisp/vc/ediff-wind.el (ediff-refresh-mode-lines): Decide whether to
display "Quick Help" in the mode-line based on the value of
`ediff-use-long-help-message' instead of checking
`ediff-window-setup-function' (Bug#12840).
Add mechanism for gradually phasing in new byte compilation warnings
* lisp/Makefile.in (BYTE_COMPILE_FLAGS): Enable all byte
compilation warnings.
* lisp/emacs-lisp/bytecomp.el (byte-compile-warning-types): Add
docstrings-non-ascii-quotes and document new semantics for `all'
and t.
(byte-compile--emacs-build-warning-types): New constant.
(byte-compile-warning-enabled-p): Implement the new semantics.
(byte-compile-docstring-style-warn): Reinstate the Unicode quote
warning.
Po Lu [Sun, 19 Jun 2022 04:22:12 +0000 (12:22 +0800)]
Fix XDND from Firefox again
* lisp/x-dnd.el (x-dnd-handle-xdnd): Prevent nil from appearing
in format 32 list.
(x-dnd-handle-motif): Send reply if the user quit out of the
drop handler as well.
Po Lu [Sun, 19 Jun 2022 03:35:12 +0000 (11:35 +0800)]
Cache the Motif drag window to avoid fetching it every time
* src/xterm.c (xm_get_drag_window_1): New function.
(xm_get_drag_window): Cache the window. If it already exists,
just return it.
(xm_setup_dnd_targets): If a BadWindow error occurs, re-create
the Motif drag window.
* src/xterm.h (struct x_display_info): New field
`motif_drag_window'.
Po Lu [Sun, 19 Jun 2022 02:31:33 +0000 (10:31 +0800)]
Fix timestamps recorded in Motif DND top level leave messages
* src/xterm.c (xm_send_top_level_leave_message): Use X_SHRT_MAX
since Motif treats x and y as signed.
(handle_one_xevent): Use correct time for lmsg.timestamp sent in
response to entering the return-frame.
Stefan Kangas [Sat, 18 Jun 2022 14:01:45 +0000 (16:01 +0200)]
Respect no-face argument in literal key substitutions
* lisp/help.el (substitute-command-keys): Respect 'no-face' argument
also in literal key substitutions.
* test/lisp/help-tests.el
(help-tests-substitute-key-bindings/help-key-binding-face): Rename
from help-tests-substitute-key-bindings/face-help-key-binding.
(help-tests-substitute-key-bindings/help-key-binding-no-face): New test.
* lisp/frame.el (tty-select-active-regions): Pacify warning about
missing defcustom :group by specifying the same group as
select-active-regions, as well as the frames group.
* src/keyboard.c (command_loop_1, syms_of_keyboard): Rename last
occurrences of xterm-select-active-regions to
tty-select-active-regions (bug#55883).
Alan Mackenzie [Sat, 18 Jun 2022 16:41:57 +0000 (16:41 +0000)]
CC Mode: Add accurate handling for backslash in C line and block comments
This is needed to handle the idiosyncratic meaning of backslash in comments in
the C and C++ standards.
* lisp/progmodes/cc-engine.el: Correct a spelling error.
* lisp/progmodes/cc-mode.el (c-before-change-fix-comment-escapes)
(c-after-change-fix-comment-escapes): New functions.
* lisp/progmodes/cc-langs.el (c-get-state-before-change-functions): Add
c-before-change-fix-comment-escapes to the C/Objc and C++ values.
(c-before-font-lock-functions): Add c-after-change-fix-comment-escapes to the
C/Objc and C++ values.
Eli Zaretskii [Sat, 18 Jun 2022 16:21:21 +0000 (19:21 +0300)]
Fix test failures due to 'xterm-select-active-regions'
* lisp/frame.el (tty-select-active-regions): Rename from
xterm-select-active-regions and move here from xterm.c.
(display-selections-p): Adjust to the above. (Bug#55883)
More aggressive bytecode split between top-level forms (bug#55972)
* lisp/emacs-lisp/bytecomp.el (byte-compile-keep-pending):
Allow bytecode split between all kinds of top-level forms, not just
those with chunk handlers, to prevent individual chunks from growing
too large. In particular this helps compilation of
package-quickstart.el.
Richard Hansen [Sat, 18 Jun 2022 12:11:01 +0000 (14:11 +0200)]
Fix invalid defcustom :group when :predicate is used
* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Fix
invalid `:group' argument for the `-modes' defcustom that is created
when `:predicate' is used (bug#56049).
Alan Mackenzie [Sat, 18 Jun 2022 11:23:06 +0000 (11:23 +0000)]
CC Mode: Fix infinite loop in noise macro near end of buffer
This fixes bug #55771. Also fix an inaccuracy in c-defun-name-1 with the same
cause.
* lisp/progmodes/cc-cmds.el (c-defun-name-1)
* lisp/progmodes/cc-engine.el (c-forward-noise-clause): Check the return
value of c-forward-token-2 and act upon it when not zero.
Duncan Findlay [Sat, 11 Jun 2022 01:46:49 +0000 (18:46 -0700)]
Support `select-active-regions' with xterm
This allows Emacs to save the active region to the user's
primary selection on supported terminals. The behavior follows
the existing `select-active-regions' variable and requires
`xterm-select-active-regions' to be non-nil.
* src/keyboard.c (command_loop_1):
* lisp/frame.el (display-selections-p): On text terminals, check
terminal parameter `xterm--set-selections' and variable
`xterm-select-active-regions' when deciding whether to update
primary selection. (bug#55883)
* lisp/term/xterm.el (xterm-select-active-regions): New
defcustom.
Constructs such as ?\C-^@ or ?\C-\C-m literally apply a Control
modifier twice which doesn't make sense at all. What is really meant
is a C0 base character with the Control modifier bit set.
This change is only stylistic in nature.
* lisp/edmacro.el (edmacro-format-keys):
* lisp/keymap.el (key-parse):
* lisp/subr.el (event-modifiers, event-basic-type):
* test/lisp/subr-tests.el (subr-test-kbd):
Use \0 and \r instead of ^@ and \C-m to represent NUL and RET
when combined with other modifiers.
Stefan Kangas [Sat, 18 Jun 2022 04:31:18 +0000 (06:31 +0200)]
Merge from origin/emacs-28
d671cd57c4 Update cl-struct-sequence-type doc string 017bdb1611 Fix a tagging problem in tramp.texi e0bac17bbc Mention face quirks after the final line in the lispref ma... ad74677cf3 Delete reference to obsolete library complete.el
Stefan Kangas [Fri, 17 Jun 2022 19:30:34 +0000 (21:30 +0200)]
Delete another library obsolete since 24.1
This file was missed in the last commit to delete libraries obsolete
since Emacs 24.3 or older.
* lisp/obsolete/pc-mode.el: Delete file. This library has been
obsolete since Emacs 24.1. (Bug#50999)
Slightly faster hash-table-keys and hash-table-values
* lisp/emacs-lisp/subr-x.el (hash-table-keys, hash-table-values):
Omit the reversal of the returned list. It is not ordered anyway.
* test/lisp/emacs-lisp/subr-x-tests.el
(subr-x--hash-table-keys-and-values): New test.
* lisp/emacs-lisp/byte-run.el (byte-run--set-obsolete): The `when'
is a string (or nil), so don't quote it (bug#48145).
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--print-form):
Adjust folding.
Warn about misplaced or duplicated function/macro declarations
Doc strings, `declare` and `interactive` forms must appear in that
order and at most once each. Complain if they don't, instead of
silently ignoring the problem (bug#55905).
* lisp/emacs-lisp/byte-run.el (byte-run--parse-body)
(byte-run--parse-declarations): New.
(defmacro, defun): Check for declaration well-formedness as
described above. Clarify doc strings. Refactor some common code.
* test/lisp/emacs-lisp/bytecomp-resources/fun-attr-warn.el:
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-fun-attr-warn):
New test.
Stefan Kangas [Fri, 17 Jun 2022 14:06:10 +0000 (16:06 +0200)]
Rename command to bookmark-edit-annotation-confirm
* lisp/bookmark.el (bookmark-edit-annotation-confirm): Rename from
'bookmark-send-edited-annotation' to be more consistent with
'bookmark-edit-annotation-cancel'. Make the old name into an
obsolete function alias.
Stefan Kangas [Fri, 17 Jun 2022 14:03:52 +0000 (16:03 +0200)]
Improve help-enable-variable-value-editing help
* lisp/help-fns.el (help-enable-variable-value-editing): Expand
docstring to better explain what effect it has.
(help-fns-edit-variable): Use command substitution.
* doc/lispref/os.texi (Time Parsing): Clarify which functions
take/return timestamps and which ones take decoded time structures.
* src/timefns.c (Fdecode_time): Clarify TIME argument (bug#46505).
Dmitry Gutov [Fri, 17 Jun 2022 12:22:29 +0000 (15:22 +0300)]
buffer-match-p: Resolve backward compat concerns
* doc/lispref/buffers.texi (Buffer List): Document 'major-mode'
and 'derived-mode' predicates. Fix some typos.
* lisp/subr.el (buffer-match-p): Use the structure initially
pioneered by project-kill-buffer-conditions as-is (bug#54296).
* lisp/progmodes/project.el (project-kill-buffer-conditions)
(project--buffer-check): Revert the latest change.
(project--buffer-check): Add support for lambda predicates.
* lisp/net/eww.el (eww-update-header-line-format): Use
string-pixel-width (since we don't care about shr-use-fonts here).
* lisp/net/shr.el (shr-string-pixel-width): Use
`string-pixel-width', which should be faster.
Stefan Kangas [Fri, 17 Jun 2022 11:34:36 +0000 (13:34 +0200)]
Cancel editing bookmark annotations with C-c C-k
* lisp/bookmark.el (bookmark-edit-annotation-cancel): New command.
(bookmark-edit-annotation-mode): Document it.
(bookmark-edit-annotation-mode-map): Bind it to 'C-c C-k'.
(bookmark-default-annotation-text): Announce it when editing
annotations.
(bookmark-edit-annotation--maybe-display-list): New macro.
(bookmark-send-edited-annotation): Use above new macro.
Stefan Kangas [Fri, 17 Jun 2022 10:49:57 +0000 (12:49 +0200)]
Use command substitution in bookmark-edit-annotation
* lisp/bookmark.el (bookmark-default-annotation-text): Use command
substitution.
(bookmark-edit-annotation): Enter mode before inserting annotation
to get the correct command substitution.
Po Lu [Fri, 17 Jun 2022 07:29:59 +0000 (15:29 +0800)]
Improve compatibility when receiving drops from early XDND programs
* lisp/x-dnd.el (x-dnd-handle-xdnd): Save version in state.
If version is less than 5, don't put action and success in
XdndFinished events. If less than 2, always use `copy' as
the selected action.
Stefan Kangas [Fri, 17 Jun 2022 04:30:35 +0000 (06:30 +0200)]
Merge from origin/emacs-28
f419de6eca * lisp/textmodes/artist.el: Minor doc fixes. 5ddd0f1a35 * lisp/net/tramp.el (tramp-methods): Fix quoting in docstr... b0c5accb99 Update MS Windows FAQ for MinGW64-w64/MSYS2
Po Lu [Fri, 17 Jun 2022 02:57:42 +0000 (10:57 +0800)]
Improve window manager user time reporting mode switching
* src/xterm.c (x_display_set_last_user_time): Stop periodically
checking for user time window support.
(x_update_frame_user_time_window): New function.
(handle_one_xevent): Call it on toplevel ReparentNotify if the
frame has been visible at least once.
Po Lu [Fri, 17 Jun 2022 02:24:05 +0000 (10:24 +0800)]
Update last event time during DND operations
* lisp/x-dnd.el (x-dnd-handle-xdnd, x-dnd-handle-motif): Set
last user time to provided timestamp.
* src/xfns.c (Fx_display_last_user_time): New function.
(syms_of_xfns): New defsubr.
* src/xterm.c (x_set_last_user_time_from_lisp): New function.
* src/xterm.h: Update prototypes.
Eli Zaretskii [Thu, 16 Jun 2022 16:53:45 +0000 (19:53 +0300)]
Fix disruption of windows' display by shr.el
* src/window.c (struct saved_window): New member 'vscroll'.
(Fset_window_configuration, save_window_save): Save and restore
the window's vscroll value.
* lisp/net/shr.el (shr-insert-document): Restore the original
window's hscroll, in case we are rendering in a window other than
where the document will be eventually displayed. This avoids
resetting hscroll of windows we use temporarily for shr's
rendering job. (Bug#56008)
Stefan Kangas [Thu, 16 Jun 2022 07:48:18 +0000 (09:48 +0200)]
Make artist-version variable obsolete
* lisp/textmodes/artist.el (artist-version): Make obsolete. This has
not been updated in nearly two decades; use the Emacs version instead.
(artist-submit-bug-report): Don't use above obsolete variable.