Eli Zaretskii [Thu, 20 May 2021 09:01:40 +0000 (12:01 +0300)]
Fix arg-out-of-range errors in 'line-number-at-pos'
* src/fns.c (Fline_number_at_pos): Pass character position to
args_out_of_range. Suggested by Andreas Schwab
<schwab@linux-m68k.org>. Call args_out_of_range_3 to show both
ends of the accessible portion.
Eli Zaretskii [Thu, 20 May 2021 08:44:54 +0000 (11:44 +0300)]
Make sure gmalloc's hybrid_free preserves errno
* src/gmalloc.c (hybrid_free_1): New function, with the body of
the previous 'hybrid_free'.
(hybrid_free): Call 'hybrid_free_1' while preserving the value of
'errno'. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
Eli Zaretskii [Thu, 20 May 2021 08:26:00 +0000 (11:26 +0300)]
Clean up the fix for unexec build on GNU/Linux
* src/conf_post.h [HYBRID_MALLOC || DARWIN_OS && HAVE_UNEXEC]:
Include <stdlib.h> here, before redirecting 'malloc' and friends
to their hybrid_* and unexec_* equivalents. #undef malloc and
friends before redefining. Provide prototypes for the
replacements. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
* src/gmalloc.c [HYBRID_MALLOC]: Remove declarations of 'malloc'
and friends, as they are now redundant: we include <stdlib.h> in
conf_post.h before redefining 'malloc' etc., and that provides
prototypes from system headers.
* configure.ac (HYBRID_MALLOC): Remove kludge to avoid replacement
of 'free' by Gnulib. (Bug#36649)
Tassilo Horn [Wed, 19 May 2021 19:21:03 +0000 (21:21 +0200)]
Add a section about bug-reference-mode.
* doc/emacs/maintaining.texi (Maintaining): Add a section about
bug-reference-mode.
* doc/emacs/emacs.texi (Top): Link to the new section about
bug-reference-mode.
Eli Zaretskii [Wed, 19 May 2021 16:01:07 +0000 (19:01 +0300)]
Fix rare failures in 'window-default-font-height'
* lisp/window.el (window-default-font-height): Avoid signaling an
error when a client TTY frame happens to have an X-style 'display'
parameter. (Bug#48408)
Eli Zaretskii [Wed, 19 May 2021 14:42:50 +0000 (17:42 +0300)]
Fix the unexec build on GNU/Linux
The unexec build on GNU/Linux must use HYBRID_MALLOC (gmalloc.c) and
sheap.c. This was inadvertently disabled because a configure-time
test for 'sbrk' was moved as side effect of an unrelated change.
* configure.ac: Test for 'sbrk' before using the result in the
decision about SYSTEM_MALLOC and HYBRID_MALLOC.
(HYBRID_MALLOC): Prevent Gnulib from redirecting 'free' to its
replacement 'rpl_free'.
* lib/Makefile.in (not_emacs_OBJECTS): Add mallooc/%.o and free.o.
Mauro Aranda [Wed, 19 May 2021 12:57:46 +0000 (09:57 -0300)]
Lift restriction for finding theme summary line
* lisp/cus-theme.el (custom-theme-summary): Don't limit the file to
having the deftheme form as the very first form, rather look for the
deftheme form explicitly.
Stefan Monnier [Tue, 18 May 2021 21:53:23 +0000 (17:53 -0400)]
* lisp/eshell/em-pred.el: Take advantage of lexical scoping
Also remove redundant `:group` arguments.
(eshell-parse-modifiers): Make sure we pass a function value.
(eshell-parse-arg-modifier, eshell-parse-modifiers)
(eshell-add-pred-func, eshell-pred-user-or-group)
(eshell-pred-file-time, eshell-pred-file-type, eshell-pred-file-mode)
(eshell-pred-file-links, eshell-pred-file-size)
(eshell-pred-substitute, eshell-include-members, eshell-join-members)
(eshell-split-members): Use proper closures.
Juri Linkov [Tue, 18 May 2021 21:02:42 +0000 (00:02 +0300)]
* lisp/repeat.el (repeat-exit-timeout): New defcustom (bug#48472).
(repeat-exit-timer): New variable.
(repeat-post-hook): Run idle timer with an "exit function"
returned from set-transient-map.
Suggested by Gustavo Barros <gusbrs.2016@gmail.com>.
(repeat-echo-message): Remove own previous message when input arg is nil.
Philipp Stephani [Tue, 18 May 2021 16:43:11 +0000 (18:43 +0200)]
Recreate symptom of Bug#42701.
The fix to Bug#48489 (commit 9676d41b8301b84e07717e633059a3f2b5c4c9d8)
has masked the symptom of Bug#42701 for 'if-let'. Create a helper
macro that still exemplifies the bug.
* test/lisp/emacs-lisp/edebug-tests.el
(edebug-tests--duplicate-symbol-backtrack): New helper macro.
(edebug-tests-duplicate-symbol-backtrack): Use it instead of 'if-let'.
* lisp/emacs-lisp/eldoc.el (eldoc--echo-area-prefer-doc-buffer-p):
Look for a window displaying the ElDoc documentation buffer in all
visible frames, as promised by the user option
eldoc-echo-area-prefer-doc-buffer (bug#48278).
Miha Rihtaršič [Tue, 18 May 2021 15:08:58 +0000 (17:08 +0200)]
Fix problem with focusing in `C-o' in ibuffer in some circumstances
* lisp/ibuffer.el (ibuffer-visit-buffer-other-window-noselect):
Use display-buffer instead of pop-to-buffer and selecting the old
window. `pop-to-buffer' focuses the new frame, but
`select-window' usually fails to focus the original frame. This
simple patch fixes that (bug#48218).
Stefan Monnier [Tue, 18 May 2021 14:37:57 +0000 (10:37 -0400)]
* lisp/kmacro.el: Fix test cases broken by last change
(kmacro-lambda-form): Remove unused args `counter` and `format`.
Arrange to be able to extract `mac` from the function.
(kmacro-extract-lambda): Use this new extraction instead of digging
into the guts of a function's code.
Sun Lin [Mon, 17 May 2021 16:03:55 +0000 (18:03 +0200)]
Allow specifying the default archive types to compress to in Dired
* lisp/dired-aux.el (dired-compress-file-default-suffix):
(dired-compress-directory-default-suffix): New user options
(bug#47119).
(dired-compress-file-alist): New variable.
* lisp/dired-aux.el (dired-compress-file): Use them.
(dired-compress-file-suffixes): Remove the directory item.
* lib-src/etags.c (Rust_functions): New function to make tags for rust
files.
(Rust_help, Rust_suffixes): New constant.
* doc/emacs/maintaining.texi (Tag Syntax): Add Rust item.
* doc/man/etags.1: Add Rust (bug#46055).
Eli Zaretskii [Mon, 17 May 2021 12:17:57 +0000 (15:17 +0300)]
Improve documentation of new behavior of 'M-y'
* lisp/minibuffer.el (minibuffer-local-map): Switch the order of
'\r' and '\n' bindings.
* lisp/simple.el (yank-pop, read-from-kill-ring)
(yank-from-kill-ring): Doc fixes.
* doc/emacs/search.texi (Isearch Yank):
* doc/emacs/killing.texi (Yanking): Improve the description of the
new functionality of 'M-y'.
* doc/lispref/text.texi (Yank Commands): Remove inaccurate
description of 'M-y' in Isearch.
Philipp Stephani [Mon, 17 May 2021 08:43:54 +0000 (10:43 +0200)]
Add a unit test to reproduce Bug#48471.
* test/lisp/progmodes/project-tests.el (project-tests--trivial)
(project-root, project-ignores): New test project type.
(project-ignores): New unit test.
Philipp Stephani [Mon, 17 May 2021 08:00:36 +0000 (10:00 +0200)]
Fix a few Edebug specifications where code is wrapped in lambdas.
As the Info node `(elisp) Specification List' explains, it is not
correct to use `body' or t for a piece of code that the macro wraps in
a `lambda' form. These should use `def-body' instead.
* lisp/info-xref.el (info-xref-with-file):
* lisp/subr.el (subr--with-wrapper-hook-no-warnings, track-mouse)
(combine-change-calls, with-eval-after-load):
* lisp/emacs-lisp/bytecomp.el (displaying-byte-compile-warnings):
* lisp/emacs-lisp/cl-macs.el (cl-do-symbols, cl-progv):
* lisp/emacs-lisp/ert-x.el (ert-with-test-buffer):
* lisp/emacs-lisp/gv.el (gv-letplace):
* lisp/emacs-lisp/nadvice.el (define-advice):
* lisp/emacs-lisp/thunk.el (thunk-delay):
* lisp/vc/vc-dispatcher.el (vc-run-delayed): Use 'def-body' instead of
t or 'body' where applicable.
* lisp/emacs-lisp/package.el (package--with-response-buffer): Remove
evaluation of the body altogether. I have no idea how to write it
correctly in this case.
Eric Abrahamsen [Sat, 15 May 2021 16:36:05 +0000 (09:36 -0700)]
Add a 'silent option for native-comp-async-report-warnings-errors
* lisp/emacs-lisp/comp.el (native-comp-async-report-warnings-errors):
Set to 'silent to log warnings, but not pop up the *Warnings* buffer.
* lisp/emacs-lisp/comp.el (comp-accept-and-process-async-output):
Check value.
Eric Abrahamsen [Sun, 16 May 2021 17:19:41 +0000 (10:19 -0700)]
Fix function signature for gnus-search-indexed-parse-output
* lisp/gnus/gnus-search.el (gnus-search-indexed-parse-output): Generic
function arg list didn't match the method arglist, which made for
confusing function help.
Previously, the preoutput filter `sql-remove-continuation-prompt'
inserted a leading newline in the interactive SQL buffer if it decided
that is has to remove continuation prompts and that it had found all
it was looking for.
1) This filter function was a doubtful place to do that (arguably, its
name does not suggest any action like this).
2) The behavior worked inconsistently, eg, when sending a single-line
"SELECT" statement, because it only ran when the filter function
needed to remove any prompts (for example, not when sending a
region without newlines).
This can lead to misaligned table headers, which explains why
emacswiki and stackoverflow both present several fixes to this
behavior.
Tassilo Horn [Sun, 16 May 2021 14:19:57 +0000 (16:19 +0200)]
Add bug-reference-mode-force-auto-setup
* lisp/progmodes/bug-reference.el
(bug-reference-try-setup-from-rmail): Match the Rmail mbox filename
against GROUP-REGEXP in bug-reference-setup-from-mail-alist.
(bug-reference-mode-force-auto-setup): New function which forces
auto-setup even if bug-reference-bug-regexp and
bug-reference-url-format are already set.
Sebastian Urban [Sun, 16 May 2021 13:29:39 +0000 (15:29 +0200)]
Improve some quotation quoting in the Emacs manual
* doc/emacs/text.texi (Quotation Marks, Quotation Marks):
* doc/emacs/display.texi (Text Display): Fix some issues when
quoting quote marks and the like (bug#35885).
* doc/emacs/emacs.texi: Switch on double-sided printing headings.
Noam Postavsky [Sun, 16 May 2021 13:19:57 +0000 (15:19 +0200)]
Remove unreliable test for match data clobbering
* src/search.c (Freplace_match): Don't test for change in search_regs
start and end, this is unreliable if change hooks modify text earlier
in the buffer (bug#35264).
Optimize calls to 'eql', 'memql' and similar for fixnums.
It's good practice to compare integers using 'eql' because two bignum
objects representing the same integer might not be 'eq'. However,
'eql' is slower and doesn't have its own byte code. Therefore,
replace it with 'eq' if one argument is guaranteed to be a fixnum on
all platforms.
* lisp/emacs-lisp/byte-opt.el (byte-optimize--fixnump): New helper
function.
(byte-optimize-equal, byte-optimize-member, byte-optimize-assoc): Use
it to optimize 'eql' etc. to 'eq' if it will always compare fixnums.
Tassilo Horn [Sat, 15 May 2021 19:19:55 +0000 (21:19 +0200)]
Refactor bug-reference setup functions into a defvar
* lisp/progmodes/bug-reference.el
(bug-reference-auto-setup-functions): New defvar so that other
packages can add their own auto-setup functions to it.
* lisp/progmodes/bug-reference.el (bug-reference--run-auto-setup): Use
the new variable instead of hard-coding the 4 functions we've had
already.
Eli Zaretskii [Sat, 15 May 2021 17:44:40 +0000 (20:44 +0300)]
Fix segfaults when byte-compiling with native-compilation
* src/emacs.c (main): Call 'set_initial_minibuffer_mode' before
entering recursive-exit.
* src/minibuf.c (init_minibuf_once_for_pdumper): Don't call
'set_minibuffer_mode' here...
(set_initial_minibuffer_mode): ... set it in this new function.
(Bug#48446)
* src/lisp.h: Add prototype for 'set_initial_minibuffer_mode'.
Alan Mackenzie [Sat, 15 May 2021 11:49:49 +0000 (11:49 +0000)]
Miscellaneous corrections to src/minibuf.c for bug #48337
* src/minibuf.c (read_minibuf): Call get_minibuffer before incrementing
minibuf_level, in case a hook function calls Factive_minibuffer_window.
(init_minibuf_once_for_pdumper): Create *Minibuf-0* here (moved from
init_minibuf_once), and set its mode, so that clicking in the mini-window
immediately after start up works (thanks, Eli Z.).
pillule [Sat, 15 May 2021 08:47:07 +0000 (10:47 +0200)]
Fix `quit-restore-window' when all previous buffers got killed (Bug#48367)
* lisp/window.el (quit-restore-window): Simplify calculation of
WINDOW's previous buffer. Avoid that killing WINDOW's previous
buffers results in a state where `quit-window' has no more
effect, by simply deleting WINDOW in that case (Bug#48367).
Dmitry Gutov [Sat, 15 May 2021 00:17:17 +0000 (03:17 +0300)]
Include colons in the completion strings
* lisp/textmodes/css-mode.el
(css--complete-pseudo-element-or-class):
Include colons in the completion strings. That's simply the nicer
behavior (e.g. someone typing : will see pseudo-elements in
completions as well), and by the standards, the colons are part of
their names anyway (of pseudo-elements and classes).
Dmitry Gutov [Fri, 14 May 2021 23:47:05 +0000 (02:47 +0300)]
Add :company-kind support to css-mode completion
* lisp/textmodes/css-mode.el (css--complete-pseudo-element-or-class)
(css--complete-property-value, css-completion-at-point)
(css--complete-at-rule): Add :company-kind properties, to annotate
completions with kinds returned in each case.
Alan Mackenzie [Fri, 14 May 2021 15:52:21 +0000 (15:52 +0000)]
Various detailed fixes to minibuf.c, etc., to fix bug #48337
Also fix some unsafe coding.
* lisp/window.el (push-window-buffer-onto-prev): New function, extracted from
(record-window-buffer): Refactor by extracting the above, and removing the now
redundant parameter DO-MINIBUF.
* src/minibuf.c (zip_minibuffer_stacks, read_minibuf): Replace calls to
get_minibuffer (0) by nth_minibuffer (0). Replace calls to
Qrecord_window_buffer by calls to Qpush_window_buffer_onto_prev.
(Factive_minibuffer_window, read_minibuf_unwind): Call abort_emacs should an
"impossible" null value be returned by nth_minibuffer.
(read_minibuf): Move the get_minibuffer_call to just after the incrementation
of minibuf_level as a precaution against a missing buffer in
Vminibuffer_list.
(nth_minibuffer): Replace XCAR by Fcar, to allow (car nil) to work.
(init_minibuf_once): Create the inactive buffer *Minibuf-0*.
(syms_of_minibuf): New DEFSYM, Qpush_window_buffer_onto_prev.
* src/window.c (restore_window_configuration): Replace some XCARs and XCDRs
by Fcar_safe and Fcdr_safe.