Alan Mackenzie [Sun, 25 Apr 2021 17:40:16 +0000 (17:40 +0000)]
CC Mode: Get proper search limits in c-font-lock-cut-off-declarators
* lisp/progmodes/cc-fonts.el (c-font-lock-cut-off-declarators): Instead of
using a crude 2,000 characters back limit for backward searching, which is
erroneous when that point is in a literal, use the already calculated
c-determine-limit result.
Daniel Mendler [Mon, 19 Apr 2021 22:01:44 +0000 (00:01 +0200)]
(completion-all-sorted-completions): Fix history use with boundaries
Preprocess the history (and the default) through the new function
`minibuffer--sort-preprocess-history` to filter out the completion
base for completion tables with boundaries (in particular the file
completion table).
* lisp/minibuffer.el (minibuffer--sort-preprocess-history_: New function.
(completion-all-sorted-completions): Use it.
* test/lisp/minibuffer-tests.el (completion-all-sorted-completions):
Add tests for various combinations of with/without history/base/default.
Stefan Monnier [Sat, 24 Apr 2021 19:57:22 +0000 (15:57 -0400)]
* lisp/mpc.el: Avoid (implicit) `eval`; prefer #' to quote function names
(mpc-format): Compose functions instead of constructing
source-code expressions at run time.
Rename `mpc-pred` property to `mpc--uptodate-p`.
(mpc-status-buffer-refresh): Adjust to the new property name.
Simlify top-level Makefile since admin is always included
* Makefile.in (clean_dirs, distclean_dirs, maintainer_clean_dirs):
Add admin directories.
(clean, distclean, bootstrap-clean, maintainer-clean): Simplify.
(maybeclean_dirs): Remove - this dates to when admin/ was not
included in tar files.
Stefan Kangas [Sat, 24 Apr 2021 13:18:03 +0000 (15:18 +0200)]
Redesign and improve the help-for-help (C-h C-h) command
* lisp/help.el (help-for-help): Redesign help screen; add sections,
rearrange and reword.
(help-for-help-header): New face.
(help--for-help-make-commands, help--for-help-make-sections): New
functions.
(help-for-help-buffer-name): New variable.
* lisp/help-macro.el (make-help-screen): New optional argument
BUFFER-NAME. Fontify keys.
This change was discussed in:
https://lists.gnu.org/r/emacs-devel/2021-02/msg01695.html
https://lists.gnu.org/r/emacs-devel/2021-03/msg00670.html
https://lists.gnu.org/r/emacs-devel/2021-04/msg00292.html
Eli Zaretskii [Sat, 24 Apr 2021 12:17:40 +0000 (15:17 +0300)]
Minor update for make-tarball.txt
* admin/make-tarball.txt (UPDATING THE EMACS WEB PAGES AFTER A
RELEASE): Update and enhance the section to make it easier to find
the banner and verify the updated pages are in place.
Fix thinko introduced in the last ERC patch (bug#47788)
* lisp/erc/erc-backend.el (erc-open-network-stream): Need to use apply
to call open-network-stream with the supplied arguments because of the
plist p of arguments. Thanks to neverwas for pointing it out.
Philipp Stephani [Fri, 23 Apr 2021 10:52:51 +0000 (12:52 +0200)]
Fix small bug in 'completion-table-subvert'.
Even for a trivial underlying completion table (where the 'boundaries'
action returns nil), we need to provide nontrivial boundaries so that
they match the behavior of 'all-completions'.
* lisp/minibuffer.el (completion-table-subvert): Return boundaries
even for trivial underlying completion table.
* test/lisp/minibuffer-tests.el (completion-table-subvert-test):
Amend unit test to also test boundaries. While there, also test
the other completion functions.
Add support for using a TLS client certificate with 'erc-tls' (bug#47788)
* lisp/erc/erc-backend.el (erc-session-client-certificate): New
buffer-local variable storing the TLS client certificate used for the
current connection.
(erc-open-network-stream): Use open-network-stream instead of
make-network-process, and pass any additional arguments to it.
(erc-server-connect): Add an optional client-certificate argument
that if present is passed with the :client-certificate keyword as part
of the arguments to erc-server-connect-function.
* lisp/erc/erc.el (erc-open): Add new optional client-certificate
argument, set it as erc-session-client-certificate, and pass it along
to erc-server-connect.
(erc): Clarify documentation string with respect to the full-name
argument.
(erc-tls): Add new client-certificate keyword argument and pass it in
the direct call to erc-open (instead of going through erc).
(erc-open-tls-stream): Pass any additional arguments (such as
:client-certificate) to open-network-stream. Also allow overriding
:nowait if desired.
* doc/misc/erc.texi: Add documentation for erc-tls, including the new
:client-certificate argument.
* lisp/progmodes/project.el (project-compilation-buffer-name-function):
New option.
(project-compile): Use it.
(project-prefixed-buffer-name): New function.
Eli Zaretskii [Thu, 22 Apr 2021 17:23:23 +0000 (20:23 +0300)]
Fix MS-Windows link switches for unexec
* configure.ac (LD_SWITCH_SYSTEM_TEMACS) [mingw32]: Disable ASLR
when linking for unexec. Reported by Nikolay Kudryavtsev
<nikolay.kudryavtsev@gmail.com>.
Stefan Monnier [Thu, 22 Apr 2021 13:32:04 +0000 (09:32 -0400)]
Fix unload+reload of files using `custom-initialize-delay` (bug#47072)
* lisp/custom.el (custom-initialize-delay): Don't delay if
`custom-delayed-init-variables` has already been processed.
* lisp/startup.el (command-line): Mark `custom-delayed-init-variables`
as processed.
Alan Mackenzie [Thu, 22 Apr 2021 12:07:21 +0000 (12:07 +0000)]
Fix unclean "can't happen" error handling in read_minibuf_unwind
Also fix a bug where, with minibuffer-follows-selected-frame neither nil nor
t, a minibuffer could appear in two frames at the same time.
* src/window.c (Fset_window_configuration): Add a new &optional parameter
DONT-SET-MINIWINDOW, which inhibits the minibuffer from being restored from
the supplied window configuration.
(restore_window_configuration): Enhance to match the above.
* src/minibuf.c (read_minibuf): Enhance the argument list to the
restore_window_configuration calls to match the above. In the main case,
restoring the minibuffer is inhibited.
(read_minibuf_unwind): Should the frame with the expired minibuffer not be
found ("can't happen"), unwind the stacked data nevertheless, rather than just
exiting.
* src/keyboard.c (read_char_help_form_unwind): Amend a call of
Fset_window_configuration.
* doc/lispref/windows.texi (Window Configurations): Document the new form of
set-window-configuration.
* etc/NEWS (Lisp Changes in Emacs 28.1): Amend the entry for
set-window-configuration.
Eli Zaretskii [Thu, 22 Apr 2021 11:01:42 +0000 (14:01 +0300)]
Fix Isearch hscrolling in a corner case
* lisp/isearch.el (isearch-update): When we start hscrolled,
consider also the case that point ends up being to the left of the
hscrolled window's edge. (Bug#46316)
In order to correctly detect the case of the "new style" with an empty body,
remove the old optional arguments `init-value`, `lighter`, and `keymap`,
so we can distinguish the "nil arg" from the "absent arg" cases.
Harald Jörg [Mon, 19 Apr 2021 22:25:39 +0000 (00:25 +0200)]
cperl-mode: Avoid abbrev expansion in variable names
* lisp/progmodes/cperl-mode.el (cperl-electric-else): Don't expand
scalar variables like '$continue' as keywords. (Bug#47902)
* test/lisp/progmodes/cperl-mode-tests.el
(cperl-test-hyperactive-electric-else): Verify that keywords are
expanded but variable names aren't.
Eli Zaretskii [Tue, 20 Apr 2021 14:58:18 +0000 (17:58 +0300)]
Fix Rmail-MIME size estimations
The quoted-printable estimation was obviously wrong: the size becomes
smaller when decoded, not larger...
* lisp/mail/rmailmm.el (rmail-mime-set-bulk-data): Fix estimations
of decoded MIME attachment.
Alan Mackenzie [Tue, 20 Apr 2021 10:14:40 +0000 (10:14 +0000)]
Introduce and use minibuffer-mode. This fixes bug #47150
* lisp/minibuffer.el (minibuffer-mode): New derived mode.
* src/minibuf.c (syms_of_minibuf): New DEFSYMs Qminibuffer_mode,
Qminibuffer_inactive_mode, Qminibuffer_completing_file_name,
Qselect_frame_set_input_focus, Qadd_to_history.
(read_minibuf, set_minibuffer_mode, read_minibuf_unwind): Use the new DEFSYMs
in place of continual interning.
(set_minibuffer_mode): Put an active minibuffer into minibuffer-mode rather
than fundamental-mode.
Even in the cases where it does not make much visible difference,
it brings the benefit of making the result deterministic.
* minibuffer.el (minibuffer--sort-by-length-alpha): New function.
(minibuffer--sort-by-position): New function extracted from
`completion-all-sorted-completions`.
(completion-all-sorted-completions): Use use them.
Philipp Stephani [Mon, 19 Apr 2021 19:10:20 +0000 (21:10 +0200)]
Seccomp filter: deal with arch_prctl(ARCH_CET_STATUS, ...).
The dynamic loader of GNU libc 2.28 uses this system call to
initialize CPU information, see
https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/x86/cpu-features.c;hb=glibc-2.28#l28.
Simulating an older kernel by returning EINVAL should be the most
harmless rule here.
The ARCH_CET_STATUS symbol isn't yet exposed by the kernel headers;
see the FIXME at the top of
https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/x86/include/asm/prctl.h;hb=glibc-2.28.
* lib-src/seccomp-filter.c (ARCH_CET_STATUS): Define if not
already present. Inline the value because there doesn't seem to
be a header file exporting this constant yet.
(main): Make ARCH_CET_STATUS subfunction of arch_prctl return EINVAL.
* lisp/minibuffer.el (completion-all-sorted-completions): Use hash
table for sorting by history position, O(m+n*log(n)) instead of
O(m*n*log(n)) with history length `m` and candidate length `n`.
Philipp Stephani [Sun, 18 Apr 2021 19:47:53 +0000 (21:47 +0200)]
Add quoted filename support to 'project-find-regexp' (Bug#47799).
This is only a band-aid; it would be better to fix xref.el to work
with quoted filenames as well.
* lisp/progmodes/project.el (project--find-regexp-in-files): Unquote
filenames before passing them to 'xref-matches-in-files'.
* test/lisp/progmodes/project-tests.el (project/quoted-directory):
Also test 'project-find-regexp'.