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.
dickmao [Thu, 13 May 2021 13:21:53 +0000 (15:21 +0200)]
Process sentinels need to work under X and commandline
* src/process.c (add_non_keyboard_read_fd): Make this a public function.
(add_process_read_fd): Fold old, static add_non_keyboard_read_fd guts
into here.
* src/xsmfns.c (ice_conn_watch_CB): Call add_non_keyboard_read_fd
(bug#43834).
Eli Zaretskii [Thu, 13 May 2021 13:12:10 +0000 (16:12 +0300)]
Fix vertical cursor motion across tall text or small images
'line-move-partial' should in general leave it to the display
engine to scroll or recenter the window due to vertical motion of
the cursor. The only purpose of this function is to produce
vscroll suitable for scrolling across large (relatively to the
window's height) images, where moving by display lines is not
appropriate.
* src/xdisp.c (Fdisplay__line_is_continued_p): New primitive.
* lisp/simple.el (line-move-partial): Call
'display--line-is-continued-p' to decide whether to leave it to
redisplay to scroll the window as appropriate. (Bug#48170)
Stefan Kangas [Thu, 13 May 2021 10:17:53 +0000 (12:17 +0200)]
Don't consider obsolete commands for completion in some cases
* lisp/simple.el (read-extended-command): Exclude obsolete commands
that are either lacking a 'current-name' or were obsoleted in a
previous major version (bug#43300).
(There's been some back and forth here. Obsolete commands used to be
treated normally for completion, and then they were removed. Then
they were put back again, but annotated with what they were
obsoleting. There was some pushback on this change, so this latest
changes is a compromise between the last two states.)
Tom Gillespie [Wed, 12 May 2021 21:31:23 +0000 (23:31 +0200)]
Fix evaluation order for hack-local-variables
* lisp/files.el (hack-local-variables): Fix the ordering which
local variables are evaluated by `hack-local-variables' so that
prop-line local variables are evaluated first. There is a hidden
nreverse lurking in `hack-local-variables-apply' which means that
the prop line variables must come second in order to be evaluated
before the end of file variables.
* lisp/uniquify.el (uniquify-rationalize-file-buffer-names):
Protect against exponential `uniquify-managed' growth when
reverting several (more than two) buffers that have the same file
name (bug#36877).
Eli Zaretskii [Wed, 12 May 2021 13:41:03 +0000 (16:41 +0300)]
Fix the tests for 'string-limit'
* test/lisp/emacs-lisp/subr-x-tests.el (subr-string-limit-coding):
Fix the expected results of string-limit when encoding with
UTF-16. Add tests for UTF-8 with BOM. (Bug#48324)
* lisp/emacs-lisp/subr-x.el (string-limit): Add FIXME comment
about the current implementation, which is faulty by design.
Martin Rudalics [Wed, 12 May 2021 07:44:02 +0000 (09:44 +0200)]
Handle Bug#24526 without breaking Emacs on tiling WMs (Bug#48268)
Since tiling window managers may react allergically to resize
requests immediately following MapNotify events on X, make sure
that such requests are issued only when a new frame should not
become visible and a size has been explicitly requested for it.
* lisp/faces.el (x-create-frame-with-faces): Mark frame as
'was-invisible' if it should be initially invisible or iconified
and has its size specified explicitly.
* src/frame.c (make_frame): Initialize new frame's was_invisible
flag.
(Fframe__set_was_invisible): New internal function.
* src/frame.h (struct frame): Specify size of new_size_p slot.
New flag was_invisible.
* src/w32fns.c (Fx_create_frame)
* src/nsfns.m (Fx_create_frame)
* src/xfns.c (Fx_create_frame): Set new frame's was_invisible
flag.
* src/xterm.c (handle_one_xevent): Call xg_frame_set_char_size
after a PropertyNotify or MapNotify event only if F's
was_invisible flag was set.
Richard Stallman [Wed, 12 May 2021 02:38:21 +0000 (22:38 -0400)]
Little improvements in rmail.el. Recognize encryped override headers.
* lisp/mail/rmail.el (rmail-simplified-subject): Delete `[External] :'.
(rmail-reply): In encrypted message, search for other header fields
inside the encrypted part, and use them instead of the real header.
(rmail-epa-decrypt): Don't set MIME unless it's Rmail mode.
Richard Stallman [Wed, 12 May 2021 02:19:00 +0000 (22:19 -0400)]
Use rfc822-goto-eoh rather that mail-header-separator.
* lisp/epa-mail.el (epa-mail-sign)
(epa-mail-default-recipients, epa-mail-encrypt):
Use rfc822-goto-eoh, not mail-header-separator.
(epa-mail-default-recipients): Assume epa-mail-aliases
elements are lower case, search case-independently.
Eli Zaretskii [Tue, 11 May 2021 20:18:01 +0000 (23:18 +0300)]
Move the Text Properties menu back to Edit
* lisp/textmodes/enriched.el (enriched-mode): Don't add "Text
Properties" sub-menu to Text mode menu.
* lisp/facemenu.el (menu-bar-edit-menu): Add "Text Properties"
sub-menu back to the Edit menu.
Tassilo Horn [Tue, 11 May 2021 19:07:49 +0000 (21:07 +0200)]
Fix dired confirm message asking to kill buffers of deleted dir (bug#48301)
* lisp/dired.el (dired-clean-up-after-deletion): Fix dired
confirmation message asking to kill buffers of deleted dir in the case
where `dired-listing-switches' contain -p (bug#48301).
(font-lock-fontify-syntactically-region): Use `comment-end-skip` as
fallback for `font-lock-comment-end-skip`, as is done for
`font-lock-comment-start-skip` (and as the name suggests).
* lisp/progmodes/opascal.el (opascal-mode): Revert last change,
made unnecessary.
Eli Zaretskii [Tue, 11 May 2021 11:55:29 +0000 (14:55 +0300)]
Fix Hexl handling of coding-systems with BOM
* lisp/international/mule-cmds.el (encode-coding-char): If
CODING-SYSTEM produces BOM, remove the BOM bytes from the produced
byte sequence. (Bug#48324)
* lisp/hexl.el (hexl-mode): Use bufferpos-to-filepos to convert
point to offset into the original file.
(hexl-mode-exit, hexl-maybe-dehexlify-buffer): Use
filepos-to-bufferpos to restore point in the original buffer.
(hexl-mode, hexl-insert-multibyte-char)
(hexl-self-insert-command, hexl-insert-hex-char)
(hexl-insert-decimal-char, hexl-insert-octal-char)
(hexl-find-file): Enhance the doc strings, mainly explaining the
complications of inserting multibyte characters.
(hexl-insert-multibyte-char): Don't treat CH as unibyte if the
coding-system isn't ASCII-compatible. Don't treat null bytes as
multibyte.
Amin Bandali [Tue, 11 May 2021 01:32:42 +0000 (21:32 -0400)]
Tweak documentation relating to 'erc-tls'
* doc/misc/erc.texi (Connecting): Add a reference to the auth manual.
* etc/NEWS: Remove the verbose, detailed example of client certificate
specification and refer to the ERC manual instead.
* lisp/erc/erc.el (erc-tls): Fix leftover path example in docstring.
Glenn Morris [Mon, 10 May 2021 17:42:53 +0000 (10:42 -0700)]
Always include the test/ directory in tarfiles
In hindsight, it's hard to see why not including it was ever an option.
* make-dist: Always include the test/ directory.
(with_tests): Remove.
(--tests, --no-tests): Make these options no-ops.
* Makefile.in (mostlyclean_dirs, maintainer_clean_dirs): Add "test".
(mostlyclean, clean, distclean, maintainer-clean):
Remove special-casing for "test".
($(CHECK_TARGETS)): Simplify.
Mauro Aranda [Mon, 10 May 2021 11:33:32 +0000 (13:33 +0200)]
Avoid saving session customizations in the custom-file
* lisp/custom.el (custom-theme-recalc-variable): Only stash theme
settings for void variables.
(custom-declare-variable): After initializing a variable, unstash a
theme setting, if present.
(disable-theme): When disabling a theme, maybe unstash a theme
setting.
* test/lisp/custom-resources/custom--test-theme.el: Add two settings
for testing the fix.
* doc/lispref/variables.texi (File Local Variables): Document
`permanently-enabled-local-variables'.
* lisp/files.el (enable-local-variables): Mention the new variable.
(set-auto-mode): Always call `hack-local-variables'.
(hack-local-variables): Factor out the variable gathering into its
own function, and respect the new variable (bug#47843).
(hack-local-variables--find-variables): Factored out from
`hack-local-variables'.
(permanently-enabled-local-variables): New variable.
This reverts commit 3d276324edd90b2df9f0987f635ca0c39037a81d
2021-05-09 "; Fix decoded-time-set-defaults typo in NEWS.27."
which was mistakenly applied to etc/NEWS.27 on the master branch.
It is replaced by commit c233f4eccddf09e41441b2a292491b469fd61792
2021-05-09 "; * etc/NEWS: Fix decoded-time-set-defaults typo."
on the emacs-27 branch (bug#48298).
This was mistakenly applied to NEWS.27 on the master branch in
2021-05-09 "; Fix decoded-time-set-defaults typo in NEWS.27."
but that has now been reverted (bug#48298).