Robert Pluim [Thu, 22 Jun 2023 14:59:19 +0000 (16:59 +0200)]
Autodetect coding system when yanking media
Some browers send eg 'text/html' selections formatted as UTF-8, but
with a type of STRING, which actually means iso-latin-1. Autodetect
the correct coding system to use by calling 'gui-get-selection'.
* lisp/yank-media.el (yank-media--get-selection): Call
'gui-get-selection' instead of 'gui-backend-get-selection'.
Avoid saying that 'project-current' asks specifically for a
directory, as it can also ask for a project's directory by other
identifiers, such as the project's name, when 'project-prompter'
is set to a different value than the default
'project-prompt-project-dir'. (Bug#64266)
Po Lu [Wed, 12 Jul 2023 10:07:53 +0000 (18:07 +0800)]
Minor correction to X error handling
* src/xterm.c (x_error_handler): Clear fail->selection_serial
after reporting an error during selection transfer, in case any
other outstanding requests within the protected section also
report errors.
* lisp/net/tramp.el (tramp-handle-file-remote-p): Handle CONNECTED
value of 'never'.
* lisp/eshell/esh-ext.el (eshell-explicit-remote-commands): New
option.
(eshell-ext-initialize): Apply 'eshell-handle-remote-command' when
requested.
(eshell-handle-remote-command): New function.
(eshell-remote-command): Reimplement this function and dispatch to
'eshell-external-command', which can handle remote processes on its
own.
* test/lisp/eshell/esh-ext-tests.el
(esh-ext-test/explicitly-remote-command)
(esh-ext-test/explicitly-local-command): New tests.
Paul Eggert [Mon, 10 Jul 2023 16:53:07 +0000 (09:53 -0700)]
Further simplify configure-time locale testing
* configure.ac (gl_STDLIB_H): Replace this, not gt_LOCALE_FR_UTF8,
as this lets us also omit MB_CUR_MAX checking that will never be
executed, and also lets us remove testing for ecvt, fcvt, gcvt
that Emacs doesn’t need.
(AC_C_RESTRICT): Invoke explicitly, as Emacs uses ‘restrict’
directly. Also, simplifies the replacement for gl_STDLIB_H, which
would otherwise need to AC_REQUIRE AC_C_RESTRICT.
* lib/gnulib.mk.in: Regenerate via admin/merge-gnulib.
Paul Eggert [Sun, 9 Jul 2023 20:27:54 +0000 (13:27 -0700)]
Simplify ‘configure’ check for MB_CUR_MAX
* admin/merge-gnulib: Remove m4/locale-fr.m4.
* configure.ac (gt_LOCALE_FR_UTF8): Replace Gnulib’s
definition with a near no-op, as Emacs doesn’t care
about the Solaris 10 MB_CUR_MAX bug.
* lib/gnulib.mk.in: Regenerate.
* m4/locale-fr.m4: Remove; no longer needed due
to above changes.
Stefan Monnier [Sun, 9 Jul 2023 00:19:02 +0000 (20:19 -0400)]
cl-print.el: Reduce code duplication
While at it, fix a bug in `cl-print-object-contents` for strings,
where we forgot to pass `stream` to `princ` at one place and simplify
a `substring` call using a negative offset.
* lisp/emacs-lisp/cl-print.el (cl-print--cons-tail)
(cl-print--vector-contents, cl-print--struct-contents)
(cl-print--string-props): New functions, extracted from
`cl-print-object-contents`.
(cl-print-object, cl-print-object-contents): Use them.
* lisp/treesit.el (treesit-fontify-with-override): Fix docstring
grammar. Remove redundant precondition (bug#64052).
* src/treesit.c (Ftreesit_parser_set_included_ranges): Fix typo in
commentary.
(treesit_predicate_equal, treesit_predicate_match)
(treesit_predicate_pred): Avoid fixnum roundtrip by using
list_length in place of Flength. Make error messages more accurate.
(treesit_eval_predicates): Quote predicate names in error message.
* src/search.c: Move commentary that used to precede search_buffer
to that location once more. Update it for the current arglist.
(search_command, search_buffer_non_re, search_buffer):
* src/lisp.h (search_buffer): Turn RE flag/argument from an int into
a bool. All callers changed (bug#64049).
Michael Albinus [Sat, 8 Jul 2023 14:48:20 +0000 (16:48 +0200)]
Rearrange setting date and modes in Tramp
* lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file): Set date
and modes if appropriate.
(tramp-do-copy-or-rename-file-via-buffer)
(tramp-do-copy-or-rename-file-directly)
(tramp-do-copy-or-rename-file-out-of-band): Do not set date and modes.
Mention minibuffer-next-completion in completion-help
Now that it's not necessary to switch to the *Completions* buffer to
switch between and choose completions, we should make that clear in
the help text. Let's also make the bindings uniform both in and
outside the *Completions* buffer so users don't have to think about
the difference.
In working with new users, they've assumed that since the help text in
*Completions* says "Click on a completion to select it", that that's
the only way to select a completion. This text should help clarify
that.
* doc/emacs/mini.texi (Completion Commands): Document new bindings.
* lisp/simple.el (completion-list-mode-map): Bind
minibuffer-{next,previous,choose}-completion.
(completion-setup-function): Mention bindings for
minibuffer-{next,previous,choose}-completion. (Bug#64425)
Disambiguate mode line indication for utf-8 and utf-16
* lisp/international/mule-conf.el (utf-7):
* lisp/language/cyrillic.el (koi8-u): Change mnemonic letters to
?u and ?\N{cyrillic capital letter u}, respectively.
Vladimir Sedach [Tue, 27 Jun 2023 04:32:07 +0000 (22:32 -0600)]
Fix 'shell-dirtrack-mode' showing as enabled in unrelated buffers
* lisp/shell.el (shell-dirtrack-mode): Reverse the alias.
(shell-dirtrack-mode): Move before first use of the variable. Add
:interactive keyword.
(shell-directory-tracker, shell-cd): Use 'shell-dirtrack-mode'
instead of 'shell-dirtrackp'. (Bug#64311)
Mark failing icalendar test as unstable (bug#56241)
* test/lisp/calendar/icalendar-tests.el
(icalendar-export-bug-56241-dotted-pair):
This test started failing early July 2023 in multiple branches at
once without any change to the code and is likely sensitive to the
current date. Tag it to keep it quiet for now.
Juri Linkov [Fri, 7 Jul 2023 07:18:43 +0000 (10:18 +0300)]
* lisp/tab-bar.el: Fix tab-bar-tab-name-current for active minibuffer.
(tab-bar-tab-name-current): Use get-mru-window in the active minibuffer
when minibuffer-selected-window is nil after switching to another tab.
(tab-bar-tab-name-current-with-count)
(tab-bar-tab-name-truncated): Use tab-bar-tab-name-current.
(tab-bar-select-tab): Set tab-bar-minibuffer-restore-tab and
minibuffer-exit-hook minibuffer-locally to handle recursive minibuffers
for non-nil read-minibuffer-restore-windows.
(tab-bar-minibuffer-restore-tab): No need to reset minibuffer-local values.
Harald Jörg [Thu, 6 Jul 2023 15:29:42 +0000 (17:29 +0200)]
; cperl-mode: Refine syntax of attributes
Attributes may start with underscore, and must be separated.
Thanks to Mattias Engdegård for pointing out a regex mistake.
* lisp/progmodes/cperl-mode.el (defconst): Fix bad grouping and
allow attributes to start with an underscore in
cperl--single-attribute-rx. Adjust cperl--attribute-list-rx
accordingly.
(cperl-find-sub-attrs): Allow attributes to start with an underscore.
* test/lisp/progmodes/cperl-mode-tests.el
(cperl-test-attribute-list-rx): Add new test cases for valid and
invalid attribute lists.
Eli Zaretskii [Thu, 6 Jul 2023 08:50:41 +0000 (11:50 +0300)]
Use 'emacs-lisp-compilation-mode' in native compilation buffers
* lisp/emacs-lisp/comp.el (comp-log-to-buffer)
(comp-run-async-workers): Use 'emacs-lisp-compilation-mode' in the
buffers where we log the results of native compilation. Suggested
by No Wayman <iarchivedmywholelife@gmail.com>. (Bug#64452)
This is a step in the direction of making ediff behave better by
default under tiling window managers and fixing Bug#62164.
* lisp/vc/ediff-wind.el (ediff-floating-control-frame): Add
defcustom.
(ediff-frame-make-utility, ediff-setup-control-frame): Allow setting
the control frame up as a utility window under X. (Bug#62164)
Hugo Heagren [Sat, 1 Apr 2023 21:27:25 +0000 (22:27 +0100)]
Support right-align in mode-line
* lisp/bindings.el (mode-line-right-align-edge): New custom
variable, controls where `mode-line-format-right-align' should
align to.
(mode-line-format-right-align): New function. If the symbol
`mode-line-format-right-align' appears in `mode-line-format',
then return return a padding string which aligns everything
after that symbol to the right. Padding width is altered with
the display property and depends on the value of
`mode-line-right-align-edge'.
(mode-line-format-right-align): New variable. Convenience
definition for including right alignment in `mode-line-format'.
* doc/lispref/modes.texi (Mode Line Variables): Document new
alignment functionality and user option. (Bug#62606)
Wang Diancheng [Fri, 30 Jun 2023 07:08:18 +0000 (15:08 +0800)]
Fix target-async and background execution in gdb-mi.el
* lisp/progmodes/gdb-mi.el (gdb-target-async-checked): New
variable.
(gdb-non-stop-setting): Change the value back to default to
non-nil on systems other than MS-Windows.
(gdb-non-stop-handler): Try to set mi-async first, falling back to
target-async by calling 'gdb-set-mi-async-handler'.
(gdb-set-mi-async-handler, gdb-try-check-target-async-support):
New functions.
(gdb-check-target-async): Set 'gdb-non-stop' here...
(gdb-starting): ...and here.
(gdb-stopped): Call 'gdb-try-check-target-async-support' when the
program stops for the first time. (Bug#64186) (Bug#63084)
* lisp/language/tibetan.el (tibetan-regexp, tibetan-precomposed-regexp)
(tibetan-precomposition-rule-regexp):
Don't use regexp-opt after all since it breaks bootstrapping.
Michael Albinus [Wed, 5 Jul 2023 14:19:23 +0000 (16:19 +0200)]
Adapt information about Tramp's temporary directory
* doc/misc/tramp.texi (Overview): Use scp in the example.
(FUSE-based methods): Move information about mount point to node
"FUSE setup".
(Overview, Predefined connection information, FUSE setup)
(Traces and Profiles): Refer to node "Temporary directory".
(Frequently Asked Questions): Move information about temporary
directory to node "Temporary directory".
(Temporary directory): New node.
(Top, Files directories and localnames): Add it to @menu.
Andrew G Cohen [Tue, 27 Jun 2023 13:11:35 +0000 (21:11 +0800)]
Fix parsing of mail address headers (bug#64296)
RFC5322 specifies that an address header may be a list of both
individual mailboxes and mailbox groups. This patch introduces
support for parsing headers that include groups.
* lisp/mail/ietf-drums.el (ietf-drums-parse-addresses): Allow message
address headers to include both mailboxes and groups.
Eliza Velasquez [Sat, 1 Jul 2023 00:35:44 +0000 (17:35 -0700)]
Fix `async-shell-command-display-buffer' display
* lisp/simple.el (shell-command): If `async-shell-command-display-buffer'
was nil, it did not respect `display-buffer-alist' entries with
`display-buffer-no-window'. This behavior has been fixed (bug#64394).
Robert Pluim [Tue, 4 Jul 2023 15:44:43 +0000 (17:44 +0200)]
Improve natnump shortdoc
* lisp/emacs-lisp/shortdoc.el (number): Make it clear that zero
satisfies 'natnump'. Move 'natnump' next to 'cl-plusp' to highlight
the difference between them.
* lisp/progmodes/cperl-mode.el (defconst): Add a word-start
assertion to cperl--single-attribute-rx
(cperl-after-sub-regexp): Dito
(cperl-init-faces): shorten matches of incomplete sub declarations
Alan Mackenzie [Tue, 4 Jul 2023 15:29:53 +0000 (15:29 +0000)]
objc-mode: Handle (de)propertization of < and >.
* lisp/progmodes/cc-langs.el
(c-get-state-before-change-functions)
(c-before-font-lock-functions): Separate the C and objc
versions, and add (to the first) c-unmark-<>-around-region and
c-before-change-check-<>-operators, (to the second)
c-unmark-<>-around-region and c-restore-<>-properties into the
objc versions of these lang variables.
Alan Mackenzie [Tue, 4 Jul 2023 12:43:31 +0000 (12:43 +0000)]
objc-mode: Fix exceptions in fontification.
These exceptions ("Invalid search bound (wrong side of point)")
were observed in test suite file class-24.m when moving point
up and down a line at a time.
* lisp/progmodes/cc-engine.el (c-forward-declarator): In the
c-syntactic-re-search-forward ~30 lines from the end of the
function amend the regexp for objc-mode such that "@end"
terminates the search, but "<" doesn't.
* lisp/progmodes/cc-fonts.el
(c-make-font-lock-search-function): supply a non-nil
CHECK-POINT argument to c-make-font-lock-search-form.
Harald Jörg [Mon, 3 Jul 2023 20:55:19 +0000 (22:55 +0200)]
cperl-mode.el: Add support for new Perl syntax in Perl 5.36 and 5.38
Perl 5.38 was released on 2023-07-03. This patch supports the new features
for 5.36 and 5.38 for font-lock, indentation, and imenu index creation.
* lisp/progmodes/cperl-mode.el (cperl-praise): Mention classes.
(defconst): Fix typo in docstring of cperl--single-attribute-rx.
Add "class" to cperl--package-rx, and adjust its docstring.
New rx sequence cperl--class-for-imenu-rx to capture classes,
use this in cperl--imenu-entries-rx.
Add "method" to cperl--sub-name-for-imenu-rx.
Add "class" to cperl--block-declaration-rx.
(cperl-sub-keywords): Add "method".
(cperl-mode): Add "ADJUST" to defun-prompt-regexp.
(cperl-after-block-p): Add new keywords for Perl 5.36 and 5.38.
(cperl-indent-exp): Add "field" to expression starters.
(cperl-imenu--create-perl-index): Rename variables refering to
"package", because they also contain classes.
(cperl-init-faces): Add new keywords for Perl 5.36 and 5.38.
(cperl-find-tags): Add support for "class".
(cperl-short-docs): Add new keywords for Perl 5.36 and 5.38.
(cperl-indent-exp): Add new keywords for Perl 5.36 and 5.38.
* test/lisp/progmodes/cperl-mode-tests.el
(cperl-test-fontify-class): New test for fontification of class
elements.
(cperl-test-imenu-index): Add tests for (nested) class
definitions.
* test/lisp/progmodes/cperl-mode-resources/cperl-indents.erts:
Add test cases for try/catch/finally, defer, class, method
* test/lisp/progmodes/cperl-mode-resources/perl-class.pl: New
resource for fontification tests of class elements.
* test/lisp/progmodes/cperl-mode-resources/grammar.pl: Add some
classes to the test resource.
* lisp/files.el (remote-file-name-access-timeout): New defcustom.
(remote-file-name-inhibit-auto-save-visited)
(remote-file-name-inhibit-locks, remote-file-name-inhibit-cache)
(remote-file-name-inhibit-delete-by-moving-to-trash):
* lisp/simple.el (remote-file-name-inhibit-auto-save): Add group `tramp'.
* lisp/net/tramp.el (with-tramp-timeout, with-tramp-suspended-timers):
New defmacros.
(tramp-dont-suspend-timers): New defvar.
(tramp-handle-access-file): Implement handling of
`remote-file-name-access-timeout'. (Bug#64401)
(tramp-action-show-and-confirm-message, tramp-process-actions)
(with-tramp-locked-connection, tramp-wait-for-regexp)
(tramp-read-passwd, tramp-read-passwd-without-cache): Use the macros.
F. Jason Park [Mon, 3 Jul 2023 03:57:46 +0000 (20:57 -0700)]
Revert "Account for leading timestamps in erc-match"
This reverts commit 99d74dcd45938e2686d93eb5649800e14a88cd84 but keeps
the test file test/lisp/erc/erc-scenarios-match.el. It also
implements a partial alternative solution by undoing the reordering of
insert hooks owned by the `stamp' and `match' modules. The initial
reordering stems from d880a08f "Cement ordering of essential hook
members in ERC" and was intended to address the problem of timestamps
not being hidden in matched "fool" messages. However, a more
comprehensive solution is being pursued as part of bug#64301. The
following changes differ from those in a pure revert.
* erc/ERC-NEWS: Fix erroneous claim about relative hook ordering
pre-5.6.
* lisp/erc/erc-match.el (erc-match-mode, erc-match-enable): Lower hook
depth of `erc-match-message' in `erc-insert-modify-hook' from 60 to
50.
(erc-text-matched-hook): Retain cleaned-up portion of revised doc
string instead of reverting completely.
* lisp/erc/erc-stamp.el (erc-stamp-mode, erc-stamp-enable): Raise
depth of `erc-add-timestamp' in `erc-insert-modify-hook' and
`erc-send-modify-hook' from 50 to 60.
* test/lisp/erc/erc-scenarios-match.el
(erc-scenarios-match--stamp-left-current-nick
erc-scenarios-match--stamp-left-fools-invisible): Temporarily disable
the latter and fix expected hook ordering.
* test/lisp/erc/erc-tests.el (erc--essential-hook-ordering): Fix
expected order of default insert hooks. (Bug#60936)
Stephen Berman [Mon, 3 Jul 2023 12:19:41 +0000 (14:19 +0200)]
Fix and improve setting priority of todo-mode items (bug#64433)
* lisp/calendar/todo-mode.el (todo-set-item-priority): Bugfixes:
Prevent interactively setting item priority to its current
priority in the same category and prompt user for a different
priority (but allow using the same priority when item is moved to
another category). Ensure that the priority passed as a prefix
argument is suitable: if it is not an integer between 1 and the
highest item number, signal a user error. New feature: Use the
sequence of numbers of the category's items as the minibuffer
history.
* doc/misc/todo-mode.texi (Inserting New Items):
(Reprioritizing Items): Document using the minibuffer history.
* test/lisp/calendar/todo-mode-tests.el
(todo-test-item-insertion-with-priority-1)
(todo-test-item-insertion-with-priority-2)
(todo-test-item-insertion-with-priority-3): New tests.
Include a help-echo for flymake's modeline counters
This helps clarify what each of these numbers mean. This is inspired
by 'compilation-mode-line-errors' which does the same.
* lisp/progmodes/flymake.el (flymake--mode-line-counter): Add
help-echo to mode line properties. (Bug#64424)