Eli Zaretskii [Thu, 10 Dec 2020 15:10:06 +0000 (17:10 +0200)]
Avoid segfaults in pos_visible_p
* src/xdisp.c (pos_visible_p): Don't try accessing the glyphs
produced by iterator whose glyph_row was set to NULL; instead,
record the X coordinate before the display string when moving past
it, and use the recorded coordinate if needed. (Bug#45156)
* test/src/casefiddle-tests.el (casefiddle-tests-char-casing):
(upcase ?ß) now returns ?ẞ (U+7838), partly for technical reasons but
the previous behaviour was arbitrary and arguably less useful.
Correct upcasing of ß is normally SS, which is what Fupcase returns if
given a string, or (for special purposes) ẞ.
Stefan Kangas [Wed, 9 Dec 2020 21:40:31 +0000 (22:40 +0100)]
Fix thinko in my previous commit
* lisp/pcomplete.el (pcomplete-comint-setup): Fix thinko in my
previous commit. This was not a quoted symbol but a variable, and
therefore cannot use setq-local.
Juri Linkov [Wed, 9 Dec 2020 19:30:47 +0000 (21:30 +0200)]
Remove isearch-input-method-local-p and always set buffer-local input-method
* lisp/isearch.el (isearch-input-method-local-p): Remove defvar.
(isearch-mode): Don't set isearch-input-method-local-p.
Set buffer-local input-method-function to nil.
(isearch-done): When isearch-input-method-function is still non-nil,
set the buffer-local value of input-method-function. (Bug#45005)
* lisp/international/isearch-x.el (isearch-toggle-specified-input-method)
(isearch-toggle-input-method, isearch-transient-input-method):
Don't set isearch-input-method-local-p to t. Set buffer-local
input-method-function to nil.
* lisp/language/korea-util.el (isearch-toggle-korean-input-method)
(isearch-hangul-switch-symbol-ksc, isearch-hangul-switch-hanja):
Don't set isearch-input-method-local-p to t. Set buffer-local
input-method-function to nil.
* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
Rule 'gradle-kotlin': don't be more forgiving than necessary; we know
exactly what the output looks like (see
https://github.com/JetBrains/kotlin/commit/\ ffe8ae3840d7b9bdc82170c8181031f05ced68bd) and there is no reason to
risk mismatches or expensive backtracking (bug#18109). Recognise
'info' level messages. Convert to rx.
* doc/lispref/display.texi (Defining Faces):
* doc/lispref/variables.texi (Defining Variables): Update the
descriptions of 'defvar' and 'defface' per recent changes in
'eval-last-sexp'. (Bug#45125)
Recognise ß properly as a lower-case letter (bug#11309)
ß was incorrectly treated as a caseless character and thus not matched
by the regexp [[:lower:]] (or, in case-folding mode, [[:upper:]]).
The reason is that the upcase table maps it to itself, which can be
remedied by mapping it to ẞ (U+7838) instead. Doing so does not
affect upcasing since the special-uppercase property maps it to SS.
* lisp/international/characters.el (tbl): Map ß to ẞ in the upcase
table.
* test/src/regex-emacs-tests.el (regexp-eszett): Uncomment previously
failing tests. Add checks to make sure that case transformations
remain valid.
* lisp/vc/ediff-ptch.el (ediff-fixup-patch-map): Offer to create
the inferred file name (if it doesn't exist) (bug#8009). This allows
applying a patch that creates a file.
Fix [:upper:] and [:lower:] for Unicode characters (bug#11309)
* src/regex-emacs.c (execute_charset): Add canon_table argument to
allow expression of a correct predicate for [:upper:] and [:lower:].
(mutually_exclusive_p, re_match_2_internal): Pass extra argument.
* test/src/regex-emacs-tests.el (regexp-case-fold, regexp-eszett):
New tests. Parts of regexp-eszett still fail and are commented out.
* src/image.c (equal_lists): Remove.
(search_image_cache): Use Fequal instead of equal_lists.
Benchmarking shows no measurable time difference, and this
restores the cache semantics from Emacs 27 (where file names
didn't have to be EQ for the cache to be used).
Serge Tupchii [Tue, 8 Dec 2020 20:22:34 +0000 (21:22 +0100)]
Fix crash (segfault) in etags on generating tags for Erlang files
* lib-src/etags.c: Set allocated and lastlen to zero, after
freeing last ptr in Erlang_functions to prevent dereferencing NULL
pointer (bug#45122).
Copyright-paperwork-exempt: yes
Make rcirc nick renaming heed nickname max lengths
* lisp/net/rcirc.el (rcirc-server-parameters): New variable (bug#6795).
(rcirc-connect): Set it.
(rcirc-handler-433): Use the length from the server.
(rcirc-handler-005): Collect server data.
(rcirc-server-parameter-value): New utility function.
(rcirc--make-new-nick): New function.
* lisp/hexl.el (hexl-scroll-down):
(hexl-scroll-up): Take ruler-mode into account when computing the
number of lines (bug#7031). These commands would previously jump
one line too many by default, skipping one line.
Make the history traversal functions in coming more regular
* lisp/comint.el (comint-previous-matching-input): Allow restoring
the input on wraps (bug#7885).
(comint-previous-matching-input-from-input): Restore input on wraps.
The debugger needs to receive a list of the error symbol and data;
cf. the documentation of the `debugger' variable. This bug manifested
itself in ERT forms such as (should (integerp (ert-fail "Boo"))),
which resulted in an incorrect condition object. Note that forms such
as (should (ert-fail "Boo")) weren't affected because they wouldn't
use the `ert--should-signal-hook'.
* test/emacs-lisp/ert.el (ert--should-signal-hook): Call debugger with
the right arguments.
* test/lisp/emacs-lisp/ert-tests.el (ert-test-fail-inside-should): Add
unit test.
* lisp/desktop.el (desktop-read): Don't reload the desktop file if
it's already been loaded, because the later query may lead to
desktop-dirname being set to nil (bug#9765).
Daniel Martín [Mon, 7 Dec 2020 16:01:35 +0000 (17:01 +0100)]
Add commands xref-next-group and xref-prev-group
* lisp/progmodes/xref.el (xref-next-group): New command that navigates
to the first item of the next xref group (typically a file).
(xref-prev-group): New command that navigates
to the first item of the next xref group (typically a file).
(xref--xref-buffer-mode-map): Bound the new commands to 'N' and 'P',
respectively.
* doc/emacs/maintaining.texi (Xref Commands): Document the new
commands in the Emacs manual.
* etc/NEWS: Announce them (bug#45089).
* lisp/server.el (server-execute): Focus the frame here...
(server-switch-buffer): Instead of here (bug#15469). This ensures
that the frame has focus if Emacs is querying the user about
something when opening a file (for instance "Revert from file?").
Allow using newer versions of Gnuplot from calc again
* lisp/calc/calc-graph.el (calc-graph-plot): Don't use the "time"
abbreviation for "timestamp" (bug#39232) -- it's no longer valid
after
https://github.com/gnuplot/gnuplot/commit/b979b5371bc1c18bf8f5bd756e7c1fb54dafd8cc
* lisp/textmodes/tex-mode.el (tex--quote-spec): New function
(bug#14286).
(tex-format-cmd): Use it.
(tex-compile): Don't quote the file names, because we're using
`file-exists-p' and friends on the results later, and that fails
on systems where everything is quoted, and on file names that need
quoting.
Add new variable to selectively suppress backtraces in batch mode.
* src/eval.c (syms_of_eval): Define new variable
'backtrace-on-error-noninteractive' to selectively enable backtrace
printing in batch mode.
(signal_or_quit): Use it.
* etc/NEWS: Document new variable.
* test/src/eval-tests.el (eval-tests/backtrace-in-batch-mode/inhibit):
New unit test.
Stefan Monnier [Mon, 7 Dec 2020 03:18:48 +0000 (22:18 -0500)]
* lisp/emacs-lisp/lisp-mode.el: Give paren syntax to [...] in lisp-data-mode
(lisp-data-mode-syntax-table): Rename from lisp--mode-syntax-table.
Adjust all users. Set [...] to have paren syntax.
(lisp-data-mode): Don't set `lisp-syntax` arg any more
* lisp/progmodes/elisp-mode.el (emacs-lisp-mode-syntax-table):
Don't bother setting [...] to have paren syntax any more.
* lisp/progmodes/inf-lisp.el (inferior-lisp-mode): Don't use
`lisp-syntax` arg of lisp-mode-variables any more.