Stefan Kangas [Mon, 9 Nov 2020 10:35:32 +0000 (11:35 +0100)]
Remove test for return value of set-keymap-parent
* test/src/keymap-tests.el
(keymap-keymap-set-parent/returns-parent): Remove test for the return
value of set-keymap-parent. It is not clear that returning the value
is a very good idea.
Problem pointed out by Stefan Monnier <monnier@iro.umontreal.ca>.
Eric Abrahamsen [Mon, 9 Nov 2020 00:32:10 +0000 (16:32 -0800)]
Add more protections to gnus-search query parsing
* lisp/gnus/gnus-group.el (gnus-group-make-search-group,
gnus-group-read-ephemeral-search-group): If the query is coming in via
the old 'nnir-query-spec key, we know not to parse it.
* lisp/gnus/gnus-search.el (gnus-search-make-query-string): Check if
the query was sent in as '(query "query"), and not '(query . "query).
(gnus-search-imap-search-keys): Add x-gm-raw to imap search keys.
(gnus-search-prepare-query): If we know this query should be raw,
don't even try parsing it, as it probably won't work.
Juri Linkov [Sun, 8 Nov 2020 19:45:02 +0000 (21:45 +0200)]
* lisp/progmodes/project.el: Don't truncate the saved project list.
* lisp/progmodes/project.el (project--write-project-list):
Let-bind print-length and print-level to nil to not truncate the
saved project list with unreadable ellipsis.
Eric Abrahamsen [Sun, 8 Nov 2020 16:37:03 +0000 (08:37 -0800)]
Another backwards-compatibility fix for gnus-search
* lisp/gnus/gnus-search.el (gnus-search-server-to-engine): Because of
the way we've set up the obsolete variable alias for
`nnir-method-default-engines', we may end up with its value in
`gnus-search-default-engines'. Make the check for "old style" values
general, so we catch them no matter where they came from.
Glenn Morris [Sat, 7 Nov 2020 17:57:56 +0000 (09:57 -0800)]
Merge from origin/emacs-27
f5d7fb3a2d (origin/emacs-27) Fix 'uudecode-decode-region-internal' in... d4242177da Fix 'send-string-to-terminal' writing very long strings 9da0f4026c * lisp/subr.el (read-char-from-minibuffer): Doc fix. (Bug... 9899f74e4e Merge branch 'emacs-27' of git.savannah.gnu.org:/srv/git/e... a6fcba783e Fix documentation of 'windmove-swap-states-default-keybind... f4acd7a924 Split windows evenly when 'min-margins' parameter was set ...
Glenn Morris [Sat, 7 Nov 2020 17:57:56 +0000 (09:57 -0800)]
Merge from origin/emacs-27
53933cdf5c ; * lisp/international/mule.el (define-coding-system): Doc... e90ffcf759 * src/w32fns.c (Fw32_register_hot_key): Doc fix. (Bug#44456) 89740e9cb5 Prevent redisplay from moving point behind user's back 5932df7435 Document that the :match function for a widget takes an ex... 1b7ab9d0ac Don't render XML declaration of an HTML document (bug#44348)
Eric Abrahamsen [Sat, 7 Nov 2020 17:40:40 +0000 (09:40 -0800)]
Various fixes and backward compatibility for gnus-search
* lisp/gnus/gnus-group.el (gnus-group-make-search-group,
gnus-group-read-ephemeral-search-group): Check for and accept the old
nnir-* spec keys.
* lisp/gnus/gnus-search.el (shared-initialize): Use
generate-new-buffer instead of doing it ourselves.
(gnus-search-server-to-engine): Raise an informative error explicitly
if we can't find a search engine, rather than letting it fall through
to something less helpful.
(gnus-search-make-spec): Add `gnus-search--complete-key-data' to
`completion-at-point-functions' locally, not globally.
Mauro Aranda [Sat, 7 Nov 2020 12:53:21 +0000 (09:53 -0300)]
Add test for recent change in enable-theme
* test/lisp/custom-tests.el (custom-test-enable-theme-keeps-settings):
Enabling a theme should not change the theme settings, so test for
that. See
https://lists.gnu.org/archive/html/emacs-devel/2020-11/msg00232.html
Kazuhiro Ito [Thu, 5 Nov 2020 10:48:08 +0000 (19:48 +0900)]
Fix 'uudecode-decode-region-internal' in multibyte buffers
* lisp/mail/uudecode.el (uudecode-decode-region-internal): Fix
inserting the decoded string into a multibyte buffer. Optimize by
working with characters, not strings. (Bug#44411)
Eli Zaretskii [Sat, 7 Nov 2020 08:27:15 +0000 (10:27 +0200)]
Fix scrolling problems with misc-fixed fonts under Cairo
* src/ftcrfont.c (ftcrfont_glyph_extents): Avoid rounding up the
glyph ascent to a higher value than needed due to floating-point
roundoff errors. (Bug#44284)
Martin Rudalics [Sat, 7 Nov 2020 08:20:14 +0000 (09:20 +0100)]
Split windows evenly when 'min-margins' parameter was set (Bug#44483)
* lisp/window.el (split-window): Make new window inherit any
'min-margins' parameter from WINDOW so that horizontal splits
reliably produce windows of same width (Bug#44483).
Stefan Kangas [Tue, 3 Nov 2020 00:35:01 +0000 (01:35 +0100)]
Backport: Fix exiting the finder-commentary buffer
Do not merge to master.
* lisp/finder.el (finder-exit): Fix exiting the finder-commentary
buffer. (Bug#44384)
(finder-buffer): New defconst.
(finder-list-keywords): Use above new defconst.
Fix javac message parsing column number off-by-one
* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
'javac': Column numbers are 1-based by default; remove subtraction and
η-reduce. Translate regexp to rx (mechanised).
* test/lisp/progmodes/compile-tests.el (compile-tests--test-regexps-data):
Adapt 'javac' test cases to the change.
Reduce integer-output-format to print-integers-as-characters
The variable now only controls whether characters are printed, not
the radix. Control chars are printed in human-readable syntax
only when special escapes such as ?\n are available. Spaces,
formatting and combining chars are excluded (bug#44155).
Done in collaboration with Juri Linkov.
* src/character.c (graphic_base_p):
* src/print.c (named_escape): New functions.
(print_object): Change semantics as described above.
(syms_of_print): Rename integer-output-format. Update doc string.
* doc/lispref/streams.texi (Output Variables):
* etc/NEWS:
* test/src/print-tests.el (print-integers-as-characters):
Rename and update according to new semantics. The test now passes.
Mauro Aranda [Fri, 6 Nov 2020 12:34:08 +0000 (09:34 -0300)]
Go back to not using custom-push-theme when enabling a theme
* lisp/custom.el (enable-theme): Relying on custom-push-theme to
handle theme settings and prior user settings was a mistake. The
theme settings haven't changed between loading the theme and enabling
it, so we don't need all of what custom-push-theme does. However, we
still need to save a user setting outside of Customize, in order to be
able to get back to it, so do that in enable-theme itself.
* lisp/international/isearch-x.el (isearch-transient-input-method):
New function.
(isearch-process-search-multibyte-characters):
Call 'deactivate-transient-input-method' after 'read-string'.
* lisp/international/mule-cmds.el (mule-menu-keymap): Remove
duplicate menu item 'describe-input-method'. Add new menu item
'activate-transient-input-method'.
(default-transient-input-method): Rename from transient-input-method.
(current-transient-input-method)
(previous-transient-input-method): New buffer-local variables.
(deactivate-input-method): Don't add
current-transient-input-method to input-method-history.
(toggle-input-method): Call deactivate-transient-input-method
when current-transient-input-method is non-nil.
(activate-transient-input-method): Rename from transient-input-method.
(deactivate-transient-input-method): New function with body from
renamed function transient-input-method.
* lisp/isearch.el (isearch-menu-bar-map): Add new menu item
'isearch-transient-input-method'.
(isearch-mode-map): Bind 'C-x \' to isearch-transient-input-method.
(isearch-forward): Add isearch-transient-input-method to docstring.
(isearch-message-prefix): Use shorter string for narrowed buffer.
Eric Abrahamsen [Thu, 5 Nov 2020 05:13:03 +0000 (21:13 -0800)]
Fixes and improvements to gnus-search
* lisp/gnus/gnus-search.el (gnus-search-default-engines): Change type
from a list of two-element lists, to alist. This matches nnir's old
option type, and should make transition easier.
(nnir-imap-default-search-key): Note that variable is obsolete.
(gnus-search-transform-expression): Interpret the "attachment" key as
"body" in imap searches. Allow specifying larger/smaller message size
values in KB or MB units.
(gnus-search-server-to-engine): Fix error in this function, and
clarify somewhat.
Mauro Aranda [Thu, 5 Nov 2020 21:56:29 +0000 (18:56 -0300)]
Enable/disable buttons, tool bar and menu items in Custom buffer (Bug#14398)
* lisp/cus-edit.el (custom-reset-extended-menu): Keymap menu for the
Revert... menu button.
(custom-reset-menu): Keep for backward compatibility, but default to
nil, so we prefer the keymap menu instead.
(custom-reset): Pass the new keymap menu to widget-choose.
(custom-commands): Add an element to each list item, to manage its
enable/disable state. Add docstring.
(custom-command-buttons): New variable, to hold the buttons that act
on all options in a Custom buffer.
(custom-buffer-create-internal): When creating the command buttons,
add the optional :notify function to enable/disable them. Add the
buttons to the new variable custom-command-buttons.
(customize-menu-create): Notify the command buttons after creating the
Custom buffer, so they are correctly enabled/disabled.
(custom-redraw-magic, custom-notify): Notify the command buttons and
update the tool bar when changing a widget to the modified state.
* lisp/net/eww.el (eww-display-pdf): Make *eww pdf* buffer unibyte
before populating it to avoid conversions. The binding for
coding-system-for-write is then no longer necessary, and can be
delegated to the viewer invoked by mailcap-view-mime. Suggested by
Stefan Monnier <monnier@iro.umontreal.ca>. (Bug#44338)
* src/lisp.h (Top level): Add prototypes for move_minibuffer_onto_frame and
is_minibuffer.
* src/minibuf.c (minibuf_follows_frame): New function which ignores local and
let-bound values of minibuffer-follows-selected-frame.
(choose_minibuf_frame): Reformulate this function to reuse a minibuffer window
where possible, and to ensure no other frame has its minibuffer current, but
only when `minibuffer-follows-selected-frame'.
(move_minibuffer_onto_frame): New function.
(live_minibuffer_p): New function.
(Fminibufferp): Add a new &optional parameter LIVE. Reformulate, possibly
calling live_minibuffer_p.
(read_minibuf): move the incrementation of minibuf_level to before the call of
choose_minibuf_frame. Empty the miniwindows of frames without an active
minibuffer, rather than of all but the current frame.
(is_minibuffer): New function.
(read_minibuf_unwind): Note the miniwindow being restored and resize all other
miniwindows to zero size.
(minibuffer-follows-selected-frame): New configuration variable.
* src/window.c (candidate_window_p): In some scenarios, check the miniwindow
holds an active minibuffer.
* src/xdisp.c (get_window_cursor_type): Suppress the cursor for non-active
miniwindows, regardless of minibuf_level.
The *eww pdf* buffer is only needed when viewing PDFs within Emacs,
e.g., with doc-view-mode. External PDF viewers are called with a
temporary file, so the buffer is not needed in that case. What's
more, mailcap-view-mime erased the buffer and left it in
fundamental-mode until now, so the user was left staring at a
useless, empty buffer. To make things even worse, external viewers
were invoked synchronously until now, so the user could not browse
the PDF file and use Emacs simultaneously.
* lisp/net/mailcap.el (mailcap--async-shell): New function.
(mailcap-view-mime): Use it to invoke external viewers
asynchronously. Mention erasure of current buffer in that case in
docstring. Add a period between the temporary file name and its
extension.
* lisp/net/eww.el (eww-display-pdf): Simplify using
insert-buffer-substring. Fix coding-system-for-write for a stream
of raw bytes. Pop to *eww pdf* buffer only if it is used for
displaying a document; otherwise kill it. (bug#44338)
* test/lisp/net/tramp-tests.el (tramp--test-share-p): New defun.
(tramp-test05-expand-file-name-relative): Use it.
(tramp-test16-directory-files)
(tramp-test19-directory-files-and-attributes): Strengthen test.
(tramp-test20-file-modes): Simplify check.
* lisp/textmodes/bibtex.el (bibtex-BibTeX-entry-alist): Fix
abbreviation of PhD.
(bibtex-biblatex-entry-alist, bibtex-biblatex-field-alist): Sync
standard entry and field types with those described in the biblatex
v3.15 manual of 2020-08-19 (bug#44322).
Stephen Berman [Wed, 4 Nov 2020 22:52:21 +0000 (23:52 +0100)]
Improve display of tabulated list header line labels (bug#44068)
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-init-header):
Ensure sort indicator appears after the label of any selected
sortable column that is wide enough and enable label truncation
when narrowing a column.
Eli Zaretskii [Wed, 4 Nov 2020 20:10:06 +0000 (22:10 +0200)]
Prevent redisplay from moving point behind user's back
* src/bidi.c (bidi_at_paragraph_end, bidi_find_paragraph_start):
Bind inhibit-quit to a non-nil value around calls to
fast_looking_at, to prevent breaking out of redisplay_window,
which temporarily moves point in buffers shown in non-selected
windows. (Bug#44448)
Eric Abrahamsen [Wed, 4 Nov 2020 06:31:42 +0000 (22:31 -0800)]
Avoid use of eieio-oset-default
* lisp/gnus/gnus-search.el: Replace with an :initform tag on the slot
definition. `symbol-value' is necessary, otherwise the defclass macro
will treat the option as a quoted symbol.
Stefan Monnier [Wed, 4 Nov 2020 16:37:00 +0000 (11:37 -0500)]
* lisp-mode.el: Fix missing highlight of "hidden" string arg
* lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2)
(lisp-cl-font-lock-keywords-2): Highlight "hidden arg" even if it
already has another face.
Eric Abrahamsen [Thu, 15 Oct 2020 04:39:46 +0000 (21:39 -0700)]
New gnus-search library
This library provides a fundamental reworking of the search
functionality previously found in nnir.el. It uses class-based search
engines to interface with external searching facilities, and a parsed
search query syntax that can search multiple engines.
* lisp/gnus/gnus-search.el: New library containing search
functionality for Gnus.
* doc/misc/gnus.texi: Document.
* lisp/gnus/gnus-group.el (gnus-group-make-search-group,
gnus-group-read-ephemeral-search-group): Remove references to nnir,
change meaning of prefix argument, change values of nnselect-function
and nnselect-args.
* lisp/gnus/nnselect.el: Replace references to nnir
(nnselect-request-article): Use gnus-search functions, and search
criteria.
(nnselect-request-thread, nnselect-search-thread): Use gnus-search
thread search.
(gnus-summary-make-search-group): Switch to use gnus-search function
and arguments.
* test/lisp/gnus/search-tests.el: Tests for new functionality.
* test/lisp/net/tramp-tests.el (tramp-test14-delete-directory):
Do not run trash test for ange-ftp.
(tramp-test16-directory-files)
(tramp-test19-directory-files-and-attributes): Check COUNT argument.
Mauro Aranda [Tue, 3 Nov 2020 13:02:51 +0000 (10:02 -0300)]
Fix customizing user options of type face
* lisp/cus-edit.el (face): Move the %f escape after the tag, because
otherwise customizing a face user option doesn't work:
custom-variable-value-create thinks that everything up until the first
":" is part of the tag, and the item widget doesn't know how to handle
the %f escape.
Stefan Kangas [Tue, 3 Nov 2020 01:06:05 +0000 (02:06 +0100)]
Use lexical-binding in pcmpl-cvs.el
* lisp/pcmpl-cvs.el: Use lexical-binding.
(executable): Remove unnecessary require.
(pcmpl-cvs-binary): Remove redundant :group arg.
(pcmpl-cvs-tags): Quote function symbol as such.
Stefan Kangas [Tue, 3 Nov 2020 00:35:01 +0000 (01:35 +0100)]
Fix exiting the finder-commentary buffer
* lisp/finder.el (finder-exit): Fix exiting the finder-commentary
buffer. (Bug#44384)
(finder-buffer): New defconst.
(finder-list-keywords): Use above new defconst.
Harald Jörg [Mon, 2 Nov 2020 22:44:58 +0000 (23:44 +0100)]
cperl-mode: Skip a test for older Emacsen (preparing for ELPA)
* test/lisp/progmodes/cperl-mode-tests.el (cperl-bug37127):
Skip this test for older Emacsen. The bug has been fixed
in Emacs, but outside of CPerl mode, and therefore will not
be available for older versions via ELPA.
Reuben Thomas [Mon, 2 Nov 2020 21:37:46 +0000 (21:37 +0000)]
Fix previous code change to `ispell--call-enchant-lsmod'
* lisp/textmodes/ispell.el (ispell--call-enchant-lsmod): Restore the
use of with-current-buffer, to avoid enchant-lsmod’s output being
dumped into the current buffer.
Glenn Morris [Mon, 2 Nov 2020 17:27:40 +0000 (09:27 -0800)]
Merge from origin/emacs-27
1fc9de4b81 Improve reproducibility of generated -pkg.el files da6234e2df Make sure pixel sizes are zero when setting window size fo... 2d15296db1 Fix failure of 'emacs --daemon' on Cygwin 8abce5b0c6 CC Mode: Only recognize foo (*bar) as a function pointer w... 85d1d8d768 Fix NEWS entry for fix of Bug#44080 2443b15a91 * src/buffer.c (syms_of_buffer) <fill-column>: Improve doc...
* test/src/dired-tests.el: Removed. Tests moved to
test/lisp/dired-tests.el.
* test/lisp/dired-tests.el (dired-test-bug27899): Tag it :unstable.
(dired-test-directory-files)
(dired-test-directory-files-and-attributes): New tests.
To be backward compatible, this function must return nil when there is
a symbol at point but no documentation for it. Before this fixed it
returned the string "<symbol-name>: nil".
* lisp/progmodes/elisp-mode.el (elisp--documentation-one-liner):
Check callback actually produced non-nil doc.
Mauro Aranda [Mon, 2 Nov 2020 12:33:55 +0000 (09:33 -0300)]
Document that the :match function for a widget takes an external value
* doc/misc/widget.texi (Basic Types): Document what an external value
is. Document that a :match function expects the value to be in the
external format. (Bug#8717)