Ignore quit while getting interprogram paste in kill-new
On X, if the current selection owner is not responding to selection
requests, the user may want to take ownership of the selection. The
obvious way to do this is to kill some text (which a user might also
be doing just as part of normal editing at the time the selection
owner becomes nonresponsive). However, if
save-interprogram-paste-before-kill is non-nil, then killing text will
hang until the user quits, and this quit will abort the entire
kill-new, preventing the user from taking ownership of the selection.
Now instead if the user quits while we are attempting to retrieve the
selection from hanging owner, we will proceed to take ownership of the
selection as normal, resolving the problem.
(One example of a selction owner that might not be responding to
selection requests is another instance of Emacs itself; while Emacs is
blocked in call-process or Lisp execution, it currently does not
respond to selection requests.)
* lisp/simple.el (kill-new): Ignore quit while getting interprogram
paste (bug#64423)
* configure.ac (netbsd): Don't set TERMINFO=no unless the termcap
library is either -ltermcap or -lcurses. This prevents aborts
because on recent versions of NetBSD libtermcap is actually a
symlink to libterminfo. (Bug#64577)
This adds a section for documenting all the optional modules.
Do not merge to master. This is a backport of f2981a1681d.
* doc/misc/eshell.texi (Extension modules): Move explanation about
writing modules to...
(Writing a module): ... here.
(Module testing): Remove. Testing an Eshell module doesn't require
any special documentation.
(Key binding, Smart scrolling, Electric forward slash): Move under...
(Optional modules): ... here.
(Directory handling, Terminal emulation): Remove. These modules are
enabled by default, and so are documented above.
(Tramp extensions, Extra built-in commands): New sections.
* doc/misc/epa.texi (Top): Add menu entry for new node GnuPG Pinentry.
(Quick Start): Add information on and reference to basic GnuPG
configuration.
(Encrypting/decrypting gpg files): Add usage information.
(GnuPG version compatibility): Update version information.
(GnuPG Pinentry): Add new node.
(Caching Passphrases): Describe mandatory gpg-agent usage for GnuPG
2.0 and later.
(Overview, Encrypting/decrypting gpg files, GnuPG version compatibility)
(Caching Passphrases, Bug Reports): Fix references, terminology,
mark-up, and index entries. (Bug#64154)
Eli Zaretskii [Mon, 10 Jul 2023 14:15:21 +0000 (17:15 +0300)]
Fix show-paren-mode when the parentheses is partially visible
* lisp/paren.el (show-paren-function): Support the case where the
open paren is partially visible, but enough so to not consider it
"off-screen". (Bug#64547)
* lisp/subr.el (with-restriction):
* doc/lispref/positions.texi (Narrowing): Make it clear that the
argument is evaluated and that the result of the evaluation must
not be nil.
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.
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.