Eli Zaretskii [Sat, 25 Sep 2021 09:18:27 +0000 (12:18 +0300)]
Fix cursor motion around some Emoji sequences
* src/character.h: Add TAG_SPACE and CANCEL_TAG to known Unicode
characters values.
* src/composite.c (char_composable_p): Recognize TAG characters
relevant to Emoji as composable regardless of their General
Category. (Bug#39799)
Eli Zaretskii [Sat, 25 Sep 2021 07:30:27 +0000 (10:30 +0300)]
Use explicit man-page section in references
* lisp/dired-aux.el (dired-do-chmod): Use explicit man-page
section in the doc string. This avoids inadvertently showing
the wrong man page, when several identically-named pages are
possible in different sections. E.g., there's also chmod(2).
Stephen Gildea [Sat, 25 Sep 2021 04:59:17 +0000 (21:59 -0700)]
; tramp-auto-save-directory: set mode atomically when creating
* lisp/net/tramp.el (tramp-handle-make-auto-save-file-name):
Use with-file-modes around make-directory. We can do this because
Tramp now honors default file modes in make-directory.
Stefan Kangas [Sat, 25 Sep 2021 01:03:34 +0000 (03:03 +0200)]
Add support for man page hyperlinks in doc strings
* lisp/help-mode.el (help-man): New button type.
(help-xref-man-regexp): New const.
(help-make-xrefs): Use them to allow making man page buttons.
* doc/lispref/tips.texi (Documentation Tips): Document the new
hyperlink type. (Bug#39215)
Daniel Martín [Fri, 24 Sep 2021 13:32:01 +0000 (15:32 +0200)]
Mention the 'r' key in ask-user-about-supersession-help
* lisp/userlock.el (ask-user-about-supersession-help): Replace "n, and
then M-x revert-buffer" in the help message with "r", which does the
same thing. (Bug#50780)
Indent bodies of local function definitions properly in elisp-mode
* lisp/emacs-lisp/lisp-mode.el (lisp-indent-function): Check for
local defforms (`cl-flet' and `cl-labels').
(lisp--local-defform-body): New auxiliary function (bug#9622).
Stefan Kangas [Fri, 24 Sep 2021 22:33:21 +0000 (00:33 +0200)]
Fix alignment on font size change in tabulated-list-mode
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-print-col): Fix
bug where the columns didn't align correctly when using
'text-scale-mode' to decrease the font size. (Bug#48639)
Stefan Kangas [Fri, 24 Sep 2021 20:17:04 +0000 (22:17 +0200)]
Revert change to use seq-random-elt in Tramp test
* test/lisp/net/tramp-tests.el (tramp-test44-asynchronous-requests):
Revert change to use seq-random-elt, as Tramp needs to be compatible
with Emacs 25, and the function was only added in 26.1.
Stefan Kangas [Fri, 24 Sep 2021 20:04:55 +0000 (22:04 +0200)]
checkdoc: Improve wide line warning to decrease false positives
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
Respect 'byte-compile-docstring-max-column' if it is set. Allow the
first line to be three characters longer than the others to account
for indentation and the opening string character.
Robert Pluim [Thu, 23 Sep 2021 09:31:46 +0000 (11:31 +0200)]
Generate skin tone compositions from emoji-sequences.txt
Read skin tone modifier sequences from emoji-sequences.txt and add
them to the per-character composition rules derived from
emoji-zwj-sequences.txt, rather than adding them as lookback rules for
the skin tone modifiers. This avoids an issue with the application of
such lookback rules. See Bug#39799,
specifically
<https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-09/msg01878.html>
for more details.
* admin/unidata/Makefile.in (zwj): Add emoji-sequences.txt as a dependency.
* admin/unidata/emoji-zwj.awk: Match RGI_Emoji_ZWJ_Sequence and
RGI_Emoji_Modifier_Sequence. Remove manual addition of skin tone
composition rules with lookback.
* lisp/progmodes/sh-script.el (sh-shell-process): If a *shell* buffer
doesn't exist, 'C-c C-n' creates one and displays it. This patch
prevents it from being displayed in the selected window.
Additionally, it ensures that the local `sh-shell-process' variable is
set in the correct buffer (bug#50765).
Stefan Kangas [Thu, 23 Sep 2021 19:10:08 +0000 (21:10 +0200)]
Avoid jumping too far in checkdoc-in-abbreviation-p
* lisp/emacs-lisp/checkdoc.el (checkdoc-in-abbreviation-p): Use
'forward-ward' instead of 'forward-sexp' to avoid jumping too far in
some situations. (Bug#50731)
* test/lisp/emacs-lisp/checkdoc-tests.el
(checkdoc-tests--abbrev-test): New helper function.
(checkdoc-tests-in-abbrevation-p/basic-case): Rename from
'checkdoc-tests-in-abbrevation-p'.
(checkdoc-tests-in-abbrevation-p/with-parens)
(checkdoc-tests-in-abbrevation-p/with-escaped-parens): Use above new
helper function.
(checkdoc-tests-in-abbrevation-p/single-char)
(checkdoc-tests-in-abbrevation-p/with-em-dash)
(checkdoc-tests-in-abbrevation-p/incorrect-abbreviation): New tests.
* lisp/progmodes/xref.el (xref--collect-matches):
Move 'remote-id' and 'syntax-needed' definitions to the caller
function. Bind 'inhibit-modification-hooks' to t (bug#50733).
xref-matches-in-files: Decrease per match and per group overhead
* lisp/progmodes/xref.el (xref-search-program-alist):
Add '--null' argument for slightly faster parsing and probably
better behavior with weirder file names.
(xref--alistify): Don't accept TEST argument, use 'assoc' instead
of 'cl-assoc', use a tash table during sorting (bug#50733).
Juri Linkov [Thu, 23 Sep 2021 16:32:36 +0000 (19:32 +0300)]
New thing-at-point target 'list-or-string' used in context-menu-region
* lisp/mouse.el (context-menu-region): Rearrange the order to
All>Defun>List>Line>Symbol. Show title either "List" or "String"
depending on syntax-ppss, then use thing 'list-or-string' (bug#9054).
* lisp/thingatpt.el (thing-at-point-bounds-of-list-at-point): Add optional
args 'escape-strings' and 'no-syntax-crossing' like in 'up-list'.
(list-or-string): New target 'list-or-string'.
(thing-at-point-bounds-of-list-or-string-at-point): New function.
Juri Linkov [Thu, 23 Sep 2021 16:14:56 +0000 (19:14 +0300)]
* lisp/outline.el (outline-minor-mode-cycle-filter): New defcustom (bug#50679)
(outline-minor-mode-cycle--bind): New helper function.
(outline-minor-mode-cycle-map): Rename from outline-mode-cycle-map.
(outline-mode-map): Revert part of 6458e16f33 to disassociate
keymaps outline-mode-map and outline-minor-mode-cycle-map.
(outline-font-lock-keywords, outline-minor-mode-highlight-buffer):
Use outline-minor-mode-cycle-map instead of outline-mode-cycle-map.
* lisp/help.el (describe-bindings): Rename outline-mode-cycle-map
to outline-minor-mode-cycle-map.
* lisp/mouse.el (context-menu-undo): Add "in Region" to the titles
when the region is active.
(context-menu-region): Use 'mouse-yank-from-menu' in menu items
created from 'yank-menu' for submenu "Paste from Kill Menu".
(context-menu-region): Add submenu "Select" with things to mark.
(mark-thing-at-mouse, mouse-yank-from-menu): New functions.
* lisp/thingatpt.el (bounds-of-thing-at-mouse): New function.
* lisp/progmodes/elisp-mode.el (elisp-context-menu):
* lisp/progmodes/prog-mode.el (prog-context-menu):
Use full symbol/identifier names in :help strings.
Wilson Snyder [Wed, 22 Sep 2021 14:19:57 +0000 (10:19 -0400)]
verilog-mode.el: Enable lexical binding, and merge from upstream.
* lisp/progmodes/verilog-mode.el: Enable lexical binding. Templates that
used the never-documented `inst' or `submod' variables may need to change
to use vl-... variables.
(verilog-at-constraint-p): Fix indentation on double curly brackets
(#1719) (#1744). Reported by Nikolay Puzanov.
* test/lisp/button-tests.el (button--help-echo-form):
* test/lisp/files-tests.el (files-tests-permanent-local-variables):
Remove assumption that `with-temp-buffer` creates a buffer
where `lexical-binding` is nil.
Eli Zaretskii [Wed, 22 Sep 2021 07:07:25 +0000 (10:07 +0300)]
Update comments warning about GC-resistant C programming
* src/eval.c: Remove an outdated comment about protection from GC.
* src/buffer.h:
* src/lisp.h: Add warnings about using 'char *' pointers to text
of Lisp strings and buffer text in code that could GC. Reported by
Po Lu <luangruo@yahoo.com>
Stephen Gildea [Wed, 22 Sep 2021 05:01:03 +0000 (22:01 -0700)]
Migrate MH-E functional tests from SourceForge
* test/lisp/mh-e/mh-limit-tests.el:
* test/lisp/mh-e/mh-utils-tests.el:
* test/lisp/mh-e/mh-xface-tests.el:
Import the functional tests from src/mh-unit.el.
mh-unit.el is from the old SourceForge mh-e repository, last changed
in 2017. To this are applied unmerged patches Mike Kupfer wrote in
2018 ("Refactor mh-unit into functional and release tests" and
"Fix the functional tests").
All tests have been converted to run under Emacs's ERT framework.
Some tests for mh-utils use MH programs to examine mail folders.
These tests require an MH variant to be installed on the system; for
these, added both a mock harness that pretends the needed files and MH
programs do exist, and a wrapper that creates the necessary mail files.
New function 'mh-test-utils-setup-with-variant' bears some resemblance
to 'mh-test-folders-set-up' from the original tests. New function
'mh-test-utils-setup-with-mocks' is new functionality for these tests.