Simplify after adding internal function to enter a labeled restriction
* src/editfns.c: (Finternal__labeled_narrow_to_region): Merge the
code of Finternal__label_restriction into this function.
(Finternal__label_restriction): Remove this function.
(syms_of_editfns): Remove the 'outermost-restriction' buffer local
variable, which is not used anymore, and the symbol of
'internal--label-restriction'.
(Fwiden): Remove the call to reset the 'outermost-restriction'
buffer local variable.
Add internal function to enter a labeled restriction
* src/editfns.c (Finternal__labeled_narrow_to_region): New
function. A specific function is necessary to avoid unnecessary
slowdowns when 'narrow-to-region'/'widen' are called in a loop.
(Fnarrow_to_region): Remove the call to Fset, which has been moved
into Finternal__labeled_narrow_to_region.
(labeled_narrow_to_region): Use the new function.
(syms_of_editfns): Add the symbol of the new function.
* lisp/subr.el (internal--with-restriction): Use the new function.
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.
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)
Eli Zaretskii [Sun, 2 Jul 2023 06:16:58 +0000 (09:16 +0300)]
Avoid errors in completion due to 'completion-regexp-list'
* doc/lispref/minibuf.texi (Basic Completion):
* src/minibuf.c (syms_of_minibuf) <completion-regexp-list>:
Document that global non-nil settings of 'completion-regexp-list'
are not safe.
* lisp/minibuffer.el (completion-pcm--merge-completions): Avoid
errors in 'try-completion' when PREFIX is nil. (Bug#64351)
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)