Improve documentation of exiting recursive editing
* doc/lispref/commands.texi (Recursive Editing): Mention what happens
when throwing a string or any other value to 'exit.
* src/keyboard.c (Frecursive_edit): Document throwing a function
to 'exit (bug#49700).
* lisp/minibuffer.el (minibuffer-quit-recursive-edit): New optional
argument to specify how many levels of recursion to quit.
* src/eval.c (internal_catch): Remove special handling of 'exit
tag (bug#49700).
* src/minibuf.c (Fabort_minibuffers): Use
minibuffer-quit-recursive-edit to quit multiple levels of minibuffer
recursion.
Eli Zaretskii [Sun, 19 Sep 2021 18:39:18 +0000 (21:39 +0300)]
Avoid segfaults due to 'bug-reference-mode'
* src/xdisp.c (handle_fontified_prop): Set the frame's
inhibit_clear_image_cache flag around calls to
'fontification-functions', to avoid Lisp triggering the clearing
of image and/or face caches behind redisplay's back. (Big#50571)
Stefan Kangas [Sun, 19 Sep 2021 16:33:35 +0000 (18:33 +0200)]
Be explicit about missing sections in eshell manual
* doc/misc/eshell.texi (Writing a module, Module testing)
(Directory handling, Key rebinding, Smart scrolling)
(Terminal emulation): Explicitly say that these sections remain to
be written. (Bug#49306)
The reader has an extra 1-char unread buffer that was incorrectly
initialised to 0, which means that the first character read would
always be NUL. As this is often the code that looks for the
lexical-binding cookie, the first loaded source module would be
treated as dynamically bound. During bootstrapping this is loadup.el
and so its local variables got dumped into the global environment.
* src/lread.c (unread_char): Initialise to empty.
(Fload): Initialise here too just in case.
Add new '/opme' and '/deopme' convenience ERC commands
* lisp/erc/erc.el (erc-cmd-OPME, erc-cmd-DEOPME): Add convenience
commands for setting and unsetting the operator status on the current
nick in the current channel. 'erc-cmd-OPME' relies on ChanServ for
obtaining the operator status (see doc string for more details).
* etc/NEWS: Announce the addition of the commands.
Stefan Kangas [Sat, 18 Sep 2021 13:38:36 +0000 (15:38 +0200)]
Use command substitution in checkdoc-recursive-edit
* lisp/emacs-lisp/checkdoc.el (checkdoc-recursive-edit): Use command
substitution.
(checkdoc--help-buffer): New variable. Use it instead of hard-coded
string.
Arthur Miller [Sat, 18 Sep 2021 17:51:47 +0000 (19:51 +0200)]
Add new help-enable-symbol-autoload user option
* lisp/help-fns.el (help-fns--analyze-function): Use it.
* lisp/help-fns.el (help-enable-symbol-autoload): New user option.
* doc/emacs/help.texi (Name Help): Document it.
Make argument optional in pulse-momentary-highlight-one-line
* lisp/cedet/pulse.el (pulse-momentary-highlight-one-line): Make
POINT optional (bug#50642) so that the function can be used more
easily from some hook functions.
Phil Sainty [Sat, 18 Sep 2021 02:16:13 +0000 (14:16 +1200)]
; * lisp/so-long.el: Documentation
Clarify things which are only relevant to 'global-so-long-mode', and
not when the 'so-long' command, or one of its actions, is invoked
directly.
Use the new "customization group" hyperlink syntax.
Only quote 'so-long' as a symbol when it specifically refers to the
command (or will otherwise generate a hyperlink which is appropriate
to the context). When referring to the library more generally, leave
it unquoted.
Eli Zaretskii [Sat, 18 Sep 2021 11:56:55 +0000 (14:56 +0300)]
Improve doc strings of a recent commit
* lisp/emacs-lisp/generator.el (iter-defun):
* lisp/emacs-lisp/comp.el (comp-clean-up-stale-eln):
* lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode):
* lisp/emacs-lisp/autoload.el (autoload-insert-section-header):
Include description of arguments in the doc string's first line.
Eli Zaretskii [Sat, 18 Sep 2021 10:23:48 +0000 (13:23 +0300)]
Fix performance degradation in commands that describe key bindings
* src/keymap.c (syms_of_keymap)
<describe-bindings-check-shadowing-in-ranges>: New variable.
(describe_vector): Check shadowing of consecutive keys only if
'describe-bindings-check-shadowing-in-ranges' is non-nil. Remove
redundant second loop when VECTOR is a char-table. Improve
comments. Patch by Stefan Kangas <stefan@marxist.se>. (Bug#45379)
* test/src/keymap-tests.el
(help--describe-vector/bug-9293-one-shadowed-in-range): Adapt the
test case for the new variable.
Stefan Kangas [Sat, 18 Sep 2021 08:39:35 +0000 (10:39 +0200)]
checkdoc: Only look for commonly used modifier keys
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
Search for the modifier key "s-", but not the modifier key "A-".
The latter is very uncommon and leads to false positives.
Check for null bytes in filenames in 'expand-file-name' (bug#49723)
* src/fileio.c (expand-file-name): Check for null bytes for both
NAME and DEFAULT-DIRECTORY arguments. Also check for null bytes
in buffer-local default-directory, assuming it is used.
* src/coding.c (encode_file_name): Use CHECK_STRING_NULL_BYTES.
* src/lisp.h (CHECK_STRING_NULL_BYTES): Add function for checking
for null bytes in Lisp strings.
* test/src/fileio-tests.el (fileio-test--expand-file-name-null-bytes):
Add test for new changes to expand-file-name.
* etc/NEWS: Announce changes.
Stefan Kangas [Thu, 16 Sep 2021 17:13:56 +0000 (19:13 +0200)]
checkdoc: 'y-or-n-p' no longer needs space
* lisp/emacs-lisp/checkdoc.el (checkdoc-message-text-engine):
Change 'y-or-n-p' check to accept prompt ending with both "? " or "?",
that is, it no longer needs the space. (Bug#50621)
(checkdoc--fix-y-or-n-p): New helper function.
* test/lisp/emacs-lisp/checkdoc-tests.el (checkdoc-tests-fix-y-or-n-p)
(checkdoc-tests-fix-y-or-n-p/no-change)
(checkdoc-tests-fix-y-or-n-p/with-space): New tests.
Robert Pluim [Fri, 17 Sep 2021 17:40:48 +0000 (19:40 +0200)]
Move emoji fontset addition later
* lisp/international/fontset.el (setup-default-fontset): Move the
fontset addition for emoji script after that for various graphic-like
characters, since they overlap, and we want the emoji setting to win.
* lisp/term.el (term-emulate-terminal): Don't record the selection
of the window here, because we're not doing a user-level window
selection, but just selecting the window for internal purposes
(bug#41984).
Stop imenu indexing after a certain number of seconds
* doc/emacs/programs.texi (Imenu): Document it.
* lisp/imenu.el (imenu-max-index-time): New user option.
(imenu-default-create-index-function, imenu--generic-function):
Use it (bug#18696).
Stephen Gildea [Fri, 17 Sep 2021 14:01:40 +0000 (07:01 -0700)]
MH-E: fix check for nmh or Mailutils installation
* lisp/mh-e/mh-e.el (mh-variant-gnu-mh-info, mh-variant-nmh-info):
Run install-mh, not mhparam, to check whether an MH variant is
installed on the system. mhparam fails if no user profile is found,
so it is not a reliable check of the state of the system as a whole.
Tested with:
nmh 1.4, nmh 1.7.1, GNU Mailutils 2.2, GNU Mailutils 3.7, GNU Mailutils 3.13
Eli Zaretskii [Fri, 17 Sep 2021 14:07:32 +0000 (17:07 +0300)]
Fix display of stretch glyphs
* src/xterm.c (x_draw_stretch_glyph_string):
* src/w32term.c (w32_draw_stretch_glyph_string): Fix drawing
stretch glyphs when the window is hscrolled. (The original
pre-Jan-2021 code was almost correct, except that it used
'window_box_left_offset' instead of 'window_box_left', and didn't
restrict the background_width fixup to text-area.) (Bug#50564)
Robert Pluim [Tue, 14 Sep 2021 17:07:03 +0000 (19:07 +0200)]
Split Unicode emoji into their own script
* admin/notes/unicode: Describe how to update emoji for new Unicode release.
* admin/unidata/Makefile.in: Pass emoji-data.txt to
blocks.awk script.
* admin/unidata/README: Add pointer to emoji-data.txt file.
* admin/unidata/blocks.awk: Parse emoji-data.txt, add emoji codepoints
to the 'emoji' script (except for the ASCII ones).
* admin/unidata/emoji-data.txt: New file.
* etc/NEWS: Describe new 'emoji' script.
* etc/TODO: Update item about 'emoji' script.
* lisp/international/fontset.el (script-representative-chars): Add
'emoji' script.
(setup-default-fontset): Add 'emoji' script. Use "Noto Color Emoji"
as default font for it.
For better compatibility with different systems.
Performance is unaffected, except in very pathological cases
(~100000 matches), and even then the overhead of 'sort' is comparable.
* lisp/progmodes/xref.el (xref-search-program-alist):
Drop the piping through 'sort'.
(xref-matches-in-files): Sort here instead.
Do that to both searchers' output as well now.
Stefan Kangas [Fri, 17 Sep 2021 09:02:38 +0000 (11:02 +0200)]
Make ediff-set-difference into obsolete alias for seq-difference
* lisp/vc/ediff-util.el (ediff-set-difference): Make into obsolete
function alias for 'seq-difference'.
* lisp/vc/ediff-mult.el (ediff-intersect-directories): Update single caller.
Stefan Kangas [Fri, 17 Sep 2021 09:00:06 +0000 (11:00 +0200)]
Make ediff-intersection into obsolete alias for seq-intersection
* lisp/vc/ediff-util.el (ediff-intersection): Make into obsolete
function alias for 'seq-intersection'.
* lisp/vc/ediff-mult.el (ediff-intersect-directories): Update
single caller.
Stefan Kangas [Fri, 17 Sep 2021 08:41:15 +0000 (10:41 +0200)]
Make ediff-union into obsolete alias for seq-union
* lisp/emacs-lisp/seq.el (seq-union): Autoload.
* lisp/vc/ediff-util.el (ediff-union): Make into obsolete function
alias for 'seq-union'.
* lisp/vc/ediff-mult.el (ediff-intersect-directories): Update single
caller.
John Cummings [Thu, 16 Sep 2021 23:00:50 +0000 (23:00 +0000)]
Fix disk-free info in 'insert-directory'
* lisp/files.el (insert-directory): Call 'get-free-disk-space'
with the argument FILE, to make sure the reported info is for the
correct volume. (Bug#50630)
Olivier Certner [Fri, 5 Feb 2021 14:34:50 +0000 (15:34 +0100)]
ERC: NickServ: Prompt for password last, overall simplifications (bug#46777)
When 'erc-prompt-for-nickserv-password' is non-nil, don't ignore the
other forms of identification. Instead, process them first, and
prompt for the password last. Separate concerns (determination of the
nick to use, of the password to use, and actual message sending).
Note that the user can be interactively prompted for a password on
reception of a NickServ request, as before (on
'erc-prompt-for-nickserv-password').
* lisp/erc/erc-services.el (erc-nickserv-identify): Make the password
argument optional (and don't prompt for it interactively). Further,
now take the nick to use for identification (interactively, ask for
it, defaulting to the current one). Move the actual message sending
into the new 'erc-nickserv-send-identify' function, and the password
prompting into 'erc-nickserv-get-password'.
(erc-nickserv-send-identify): New function containing the code for
sending the identify message to NickServ, given the nick and password.
(erc-nickserv-get-password): Try each password source in turn, in the
following order: 'erc-nickserv-passwords', auth-source (if
'erc-use-auth-source-for-nickserv-password' is non-nil), and in the
end prompt the user interactively (if
'erc-prompt-for-nickserv-password' is non-nil). If one source returns
a string, the function returns it, or nil if the string is empty.
(erc-nickserv-call-identify-function): Declare obsolete, but retain
for backward compatibility. Prefer invoking 'erc-nickserv-identify'
directly instead.
(erc-nickserv-identify-autodetect, erc-nickserv-identify-on-connect)
(erc-nickserv-identify-on-nick-change): Call 'erc-nickserv-identify'
directly ('erc-nickserv-call-identify-function' has been obsoleted).
For the last two functions, remove the redundant checks on the
NickServ identification flags (additionally, it is doubtful they have
any measurable impact on performance).