Eli Zaretskii [Fri, 30 Jun 2023 07:13:53 +0000 (10:13 +0300)]
Improve documentation of registers
* doc/lispref/text.texi (Registers): Document buffers in
registers. Mention "frameset" as another name for "frame
configuration".
* doc/emacs/regs.texi (Registers, Configuration Registers)
(File and Buffer Registers): Clarify and improve wording. Add
cross-references and indexing.
(Configuration Registers): Rename the section to a more accurate
name. (Bug#64354)
Andrew G Cohen [Tue, 27 Jun 2023 07:40:46 +0000 (15:40 +0800)]
Use a temporary buffer in nnagent-request-set-mark (bug#64117)
Commit cb12a84f2c519a48dd87453c925e3bc36d9944db inadvertently removed
the use of a temporary buffer in nnagent-request-set-mark. Bug and
fix reported by Jens Schmidt <jschmidt4gnu@vodafonemail.de>
* lisp/gnus/nnagent.el (nnagent-request-set-mark): Restore the use of
a temporary buffer that was inadvertently removed.
Daniel Martín [Sun, 25 Jun 2023 20:17:14 +0000 (22:17 +0200)]
Make js-beginning-of-defun return non-nil on success
The docstring of 'beginning-of-defun-function' says that the
function shall return non-nil when it found the beginning
of a defun. This is specially important because the calling
code decides when to move point depending on the return value.
* lisp/progmodes/js.el (js-beginning-of-defun)
(js--beginning-of-defun-flat): Return non-nil when the beginning
of a defun is found. (Bug#64283)
* test/lisp/progmodes/js-tests.el (js-mode-end-of-defun): Add a unit
test.
Yuan Fu [Wed, 28 Jun 2023 03:58:34 +0000 (20:58 -0700)]
Tree-sitter use with-silent-modifications like jit-lock (bug#64321)
* lisp/treesit.el (treesit--font-lock-notifier): Use
with-silent-modifications when marking modified text to be fontified
by jit-lock. This is what jit-lock itself does.
Stephen Berman [Tue, 27 Jun 2023 15:50:18 +0000 (17:50 +0200)]
Fix todo-mode.el Commentary and a doc string (bug#64298)
* lisp/calendar/todo-mode.el: Explicitly note in the Commentary
that the Todo mode user manual is a separate Info manual in the
Emacs installation.
(todo-always-add-time-string): Replace doc string, which was
mistakenly retained in the initial merge of this version of
todo-mode.el, by a correct description of this user option.
Stephen Berman [Tue, 27 Jun 2023 15:38:20 +0000 (17:38 +0200)]
Prevent truncation of todo-mode categories sexp
* lisp/calendar/todo-mode.el (todo-delete-file)
(todo-move-category, todo-convert-legacy-files)
(todo-update-categories-sexp, todo-check-format):
Bind print-length and print-level to nil before using prin1
and related functions, to avoid truncating the todo categories
sexp and possibly corrupting the file format.
Stephen Berman [Tue, 27 Jun 2023 15:27:42 +0000 (17:27 +0200)]
Avoid making todo-mode buffers manually editable
* lisp/calendar/todo-mode.el (todo-add-category)
(todo-move-category, todo-edit-item--header)
(todo-set-item-priority, todo-move-item, todo-item-undone)
(todo-archive-done-item, todo-set-category-number): Restrict the
scope of nil buffer-read-only to the function calls that change
buffer text, thereby preventing todo mode buffers from becoming
manually editable and hence possibly corrupted when the minibuffer
is in use.
* doc/lispintro/emacs-lisp-intro.texi (Lists diagrammed):
Mention "cons cell". Add index entries.
(car & cdr): Simplify etymology of `car' and `cdr'.
Explain why for some purposes they are better than `first' and `rest'.
Mention cons cells.
Alan Mackenzie [Wed, 21 Jun 2023 14:23:14 +0000 (14:23 +0000)]
Fix bug#64152 (Minibuffer sometimes goes "modal")
In particular, when a frame has no minibuffer and is using that
of a different "normal" frame, C-x 5 o, etc., and GUI
operations fail.
Fix by partially reverting the commit from 2022-07-07 15:38:09
+0000 "Remove obscure, obsolete code from do_switch_frame". As
a consequent change, also revert the commit from 2022-07-08
20:19:03 +0000 "Remove now unused parameter TRACK from
do_switch_frame".
* src/frame.c (do_switch_frame): Restore the TRACK parameter.
Restore the code which redirects the frame focus when a new
frame gets selected.
Filipp Gunbin [Tue, 20 Jun 2023 15:25:24 +0000 (18:25 +0300)]
Revert "Fix parsing of dn line if WITHDN is non-nil"
This reverts commits 71b27779a9a and d2246b26275, because they change
the return value of "ldap-search" in an incompatible way. The fix
(a different one) will be done on master instead (bug#64089).
Eli Zaretskii [Tue, 20 Jun 2023 13:35:09 +0000 (16:35 +0300)]
Don't truncate filenames with "emacs.el" in them
* lisp/emacs-lisp/find-func.el (find-function-search-for-symbol):
Avoid false positives when looking for "emacs.el" matches the
likes of "emacs.elpa". (Bug#64143)
Eli Zaretskii [Tue, 20 Jun 2023 12:31:57 +0000 (15:31 +0300)]
Improve documentation of 'minibuffer-message'
* doc/lispref/minibuf.texi (Minibuffer Misc): Clarify that
'minibuffer-message' behaves like 'message' if called from a
buffer that is not a minibuffer.
João Távora [Mon, 19 Jun 2023 22:31:03 +0000 (23:31 +0100)]
Eglot: again fix positions of coinciding inlay hint overlays (bug#64101)
This bug originated from the previous fix, and is reproducible on non
Mac OS platforms, as long as the very latest version (at time of
writing) of the rust-analyzer server is used.
* lisp/progmodes/eglot.el (eglot--update-hints-1): Reverse
priorities when pegging overlays after (i.e. when before-string is
used).
Describe primarily the Emacs s-exp dialect for treesit queries
* doc/lispref/parsing.texi (Pattern Matching, Multiple Languages):
Writing tree-sitter queries as Emacs s-expressions is much more
convenient than using the native query notation inside a string,
so it makes sense to base the documentation on the former dialect
(bug#64017).
Eli Zaretskii [Sun, 18 Jun 2023 05:50:54 +0000 (08:50 +0300)]
Fix documentation of :predicate in 'define-globalized-minor-mode'
* doc/lispref/modes.texi (Defining Minor Modes):
* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Document that :predicate creates a customizable user option.
(Bug#64048)
Alan Mackenzie [Sat, 17 Jun 2023 16:14:14 +0000 (16:14 +0000)]
After minibuffer action, don't make the minibuffer current
This fixes bug#63967.
* src/minibuf.c (minibuffer_unwind): After restoring the next
minibuffer outwards to the mini window (when
enable-recursive-minibuffers is non-nil), don't call
Fset_frame_selected_window, which used to set the current
window to be the mini window.
The shy groups were caught by modified versions of the GNU ELPA
packages xr and relint:
- https://github.com/mattiase/xr/pull/6
- https://github.com/mattiase/relint/pull/14
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--s-p-query): Quote special
character in regexp.
* lisp/progmodes/java-ts-mode.el (java-ts-mode--font-lock-settings):
* lisp/progmodes/js.el (js--plain-method-re):
(js--treesit-font-lock-settings):
* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--font-lock-settings):
* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--font-lock-settings): Replace character
alternative [\\d], which matches '\' or 'd', with the most likely
intention [0-9]. Fix shy groups mistyped as optional colons.
Remove unneeded numbered :match group in rust-ts-mode (bug#64019).
Jens Schmidt [Thu, 15 Jun 2023 22:04:04 +0000 (00:04 +0200)]
Fix parsing of dn line if WITHDN is non-nil
Function `ldap-search' errors out with `wrong-type-argument listp'
when called with WITHDN non-nil.
* lisp/net/ldap.el (ldap-search-internal): Parse the dn line
correctly so that `ldap-search' can grok it. (Bug#64089)
Eli Zaretskii [Thu, 15 Jun 2023 07:08:55 +0000 (10:08 +0300)]
Fix subscripts in the Calc manual
* doc/misc/calc.texi (Musical Notes): Use @sub instead of TeX-only
'_' notation. For the details, see the discussion in
https://lists.gnu.org/archive/html/emacs-devel/2023-06/msg00096.html.
* doc/lispref/positions.texi (List Motion): Incorporate more
accurate description of treesit-defun-type-regexp from
'(elisp) Tree-sitter Major Modes', replacing that duplicate
entry (bug#64018).
* doc/lispref/parsing.texi (Parsing Program Source)
(Language Grammar, Using Parser, Retrieving Nodes)
(Accessing Node Information, Pattern Matching, Multiple Languages):
(Tree-sitter Major Modes):
* doc/lispref/modes.texi (Parser-based Font Lock): Improve wording,
grammar, punctuation, and markup. Fix typos.
(Parser-based Indentation): Ditto. Document indent rule presets
field-is, catch-all, nth-sibling, grand-parent, and
great-grand-parent.
Eli Zaretskii [Sun, 11 Jun 2023 06:15:01 +0000 (09:15 +0300)]
Fix tex-mode display-buffer issues
* lisp/window.el (display-tex-shell-buffer-action): New defcustom.
* lisp/textmodes/tex-mode.el (tex-display-shell)
(tex-cmd-doc-view, tex-recenter-output-buffer): Use it.
(Bug#63956)
Morgan Smith [Tue, 6 Jun 2023 19:02:57 +0000 (15:02 -0400)]
Add test for when 'completion-auto-help' is 'visible'
* test/lisp/minibuffer-tests.el (completion-auto-help-test): Add
test for when 'completion-auto-help' is 'visible'. Also test
for successful completion message. (Bug#63913)
Daniel Martín [Sat, 10 Jun 2023 10:36:53 +0000 (12:36 +0200)]
Mention indent-rigidly in the Emacs manual
* doc/emacs/indent.texi (Indentation Commands): Rewrite the first
sentence of 'C-x TAB' to mention the command that it executes, and
without using passive voice. (Bug#63997)
Morgan Smith [Mon, 5 Jun 2023 17:34:59 +0000 (13:34 -0400)]
Don't ding when completion succeeded
* lisp/minibuffer.el (minibuffer-completion-help): Ensure 'ding'
is not called on a successful completion. Ensure 'ding' is not
called on a failure if 'completion-fail-discreetly' is set.
Also change "No completions" to "No match" as that is what is
used elsewhere. (Bug#63913)
This reverts commit fb87d5008e21d1bc03547c1edf2280fb4cb8311e.
It caused problems when new versions of packages are installed
without deleting old versions. (Bug#63757)
Michael Albinus [Thu, 8 Jun 2023 07:59:06 +0000 (09:59 +0200)]
Fix connection-local user options handling (bug#63300)
* lisp/files-x.el (connection-local-set-profiles)
(connection-local-set-profile-variables): Avoid saving the changed
user option to file unless triggered explicitly by user. (Bug#63300)
Andrea Corallo [Tue, 6 Jun 2023 09:27:13 +0000 (11:27 +0200)]
Fix `emacs-lisp-native-compile-and-load' for C-h f (bug#58314)
* lisp/emacs-lisp/comp.el (comp-write-bytecode-file): New function
spilling code from `batch-byte+native-compile'.
(batch-byte+native-compile): Make use of.
* lisp/progmodes/elisp-mode.el
(emacs-lisp-native-compile-and-load): Produce the elc file and ask
to have it loaded.
Revert changes to the order in which package descs are loaded
* lisp/emacs-lisp/package.el (package-load-all-descriptors): Remove
NOSORT argument to 'directory-files', reverting back to the behaviour
as of Emacs 28. (Bug#63757)
Spencer Baugh [Sat, 3 Jun 2023 00:57:32 +0000 (20:57 -0400)]
Handle point in last file-name component in minibuffer completion
This is a followup to commit e338a8ac41d4a9fd798dda90275abe75ac071335
(Handle point not at EOB in minibuffer-choose-completion).
That commit added a heuristic, but the heuristic was insufficient:
It still had the original wrong behavior when completing the last
file-name component (i.e., the completion category is 'file' and
there's no slash after point). This patch makes the heuristic
cover that case as well.
* lisp/minibuffer.el (minibuffer-next-completion)
(minibuffer-choose-completion): If in file completion and there's no
slash after point, clear what's after point when we complete.
(Bug#62700)
Some AWK implementations have a fixed buffer for sprintf; for mawk the
default size is 8192 bytes. Hoist a string concatenation from
a sprintf call to avoid running into that limit. See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2023-06/msg00090.html .