Fix some cases of incomplete code's indentation [c/c++-ts-mode]
* lisp/progmodes/c-ts-mode.el (c-ts-base--before-indent): Try to
guess when the parse tree is incomplete, and provide a better node
to indent against (bug#62717).
(c-ts-base-mode): Set up advice for local treesit-indent-function.
João Távora [Fri, 7 Apr 2023 13:55:01 +0000 (14:55 +0100)]
Backport: Eglot: no more tests based on Pylsp (bug#62694)
The functionality under test in eglot.el is exactly the same, but use
the clangd server only, as that is used in more tests, and it is much
easier to check if it misbehaves or not.
Tests pass with clangd version 15.
* test/lisp/progmodes/eglot-tests.el (python): Don't require it.
(eglot--call-with-fixture): Simplify.
(eglot--wait-for-clangd): New helper.
(eglot-test-basic-completions)
(eglot-test-non-unique-completions, eglot-test-basic-xref)
(eglot-test-snippet-completions)
(eglot-test-snippet-completions-with-company)
(eglot-test-eldoc-after-completions, eglot-test-multiline-eldoc):
Use clangd, not pylsp.
(eglot-test-formatting): Renamed from
eglot-test-python-autopep-formatting.
(eglot-test-python-yapf-formatting): Remove.
Eli Zaretskii [Sat, 8 Apr 2023 17:10:49 +0000 (20:10 +0300)]
Fix 'C-h k' for "Paste from Kill Menu" in context menus
* lisp/mouse.el (context-menu-region): Make the entries be
symbols, not just integers, to prevent "C-h c" from interpreting
them as character keys. (Bug#62626)
Eli Zaretskii [Sat, 8 Apr 2023 15:36:23 +0000 (18:36 +0300)]
Improve the documentation of the XDS support
* doc/lispref/frames.texi (Drag and Drop): Rephrase and rearrange
the documentation of XDS support. Add indexing. Document
'x-dnd-save-direct' and 'x-dnd-save-direct-immediately'. Original
patch from Po Lu <luangruo@yahoo.com>.
* lisp/x-dnd.el (x-dnd-types-alist, x-dnd-test-function)
(x-dnd-default-test-function, x-dnd-direct-save-function): Doc
fixes.
(x-dnd-save-direct, x-dnd-save-direct-immediately): Rename the
second argument to FILENAME. Doc fix.
Eli Zaretskii [Sat, 8 Apr 2023 13:00:29 +0000 (16:00 +0300)]
Allow reindentation of images inserted by 'mm-inline-image'
* lisp/gnus/mm-view.el (mm-inline-image): Use "x" as text on which
to put the image 'display' property, so that indentation commands
don't destroy the image inadvertently. (Bug#62637)
Daniel Martín [Sun, 2 Apr 2023 20:39:44 +0000 (22:39 +0200)]
Change cursor color on NS port when it matches the face background
* src/macfont.m (CG_SET_FILL_COLOR_WITH_FRAME_CURSOR): New macro.
(CG_SET_FILL_COLOR_WITH_FRAME_BACKGROUND): New macro.
(macfont_draw): When the cursor's color matches the face background,
set the fill color of the cursor to the face foreground.
* src/nsterm.m (ns_maybe_dumpglyphs_background): When dumping the
background of a glyph string, apply the logic mentioned
above. (Bug#62573)
Eli Zaretskii [Sat, 8 Apr 2023 11:33:06 +0000 (14:33 +0300)]
Improve documentation of image-related commands
* lisp/image.el (image-map): Make it inherit from
'image-slice-map' instead of repeating the bindings.
* doc/emacs/files.texi (Image Mode): Document the key bindings set
by 'insert-image'. Add indexing.
* doc/lispref/display.texi (Showing Images): Make the description
of user commands more concise. Add index entries and
cross-reference to the Emacs manual.
* etc/NEWS: Rearrange entries relevant to image commands.
Eli Zaretskii [Sat, 8 Apr 2023 09:43:34 +0000 (12:43 +0300)]
Fix handling of sliced images
* lisp/image.el (image-slice-map): New keymap, without some
bindings that make no sense with sliced images.
(insert-image, insert-sliced-image): Use it.
(insert-sliced-image): Make the 'keymap' property rear-nonsticky,
to prevent calling image commands when point is to the right of
the slice. (Bug#62679)
* lisp/image/image-crop.el (image-cut, image-crop): Doc fixes.
(image-crop): Don't try using stock MS-Widows convert.exe
program. Use 'image--get-image' to support sliced images.
Eli Zaretskii [Sat, 8 Apr 2023 07:41:53 +0000 (10:41 +0300)]
; Minor addition to the Emacs FAQ
* doc/misc/efaq.texi (Fullscreen mode on MS-Windows): Tell how to
avoid the initial screen changing size on display without using
the Registry. Suggested by David Hedlund <public@beloved.name>.
João Távora [Fri, 7 Apr 2023 18:33:12 +0000 (19:33 +0100)]
Jsonrpc: don't bind inhibit-read-only to t so early
Related to https://github.com/joaotavora/eglot/discussions/1202, where
because of this very wide binding to inhibit-read-only to t, Eglot was
managing to write into read-only buffers from the response handlers
that ran from within the stack of the jsonrpc.el process filter.
This is of course illegal and dangerous, but Eglot wasn't made aware
because of the binding.
* lisp/jsonrpc.el (jsonrpc--process-filter): Don't bind
inhibit-read-only so early.
Eli Zaretskii [Fri, 7 Apr 2023 15:31:42 +0000 (18:31 +0300)]
Allow active region when IM is used
* lisp/international/quail.el (quail-minibuffer-message): Bind
deactivate-mark to allow setting active region in the minibuffer
when an input method is used. (Bug#62709)
Robert Pluim [Wed, 5 Apr 2023 13:19:13 +0000 (15:19 +0200)]
Make emoji-zoom-{increase,decrease} set text properties correctly
* lisp/international/emoji.el (emoji-zoom-increase): Ensure that we're
increasing the :height of the anonymous face at point, rather than
having two :height properties, which appeared to work by
accident, and don't error at eob. (Bug#62675)
Eli Zaretskii [Wed, 5 Apr 2023 09:31:01 +0000 (12:31 +0300)]
; Improve documentation of 'declare-function'
* doc/lispref/functions.texi (Declaring Functions):
* lisp/subr.el (declare-function): Document explicitly that
ARGLIST argument, if provided, should include the parentheses.
Eli Zaretskii [Wed, 5 Apr 2023 08:31:15 +0000 (11:31 +0300)]
; Fix description of new 'keymap-*' functions
* doc/lispref/keymaps.texi (Prefix Keys): Fix example (bug#62673).
(Functions for Key Lookup): Clarify the possible values of KEYMAP
argument of 'keymap-lookup'.
(Active Keymaps): Fix typo in function name; add cross-reference.
Eshel Yaron [Fri, 31 Mar 2023 14:54:12 +0000 (17:54 +0300)]
Preserve peer information for web page in eww-readable
The :peer property in eww-data affects the face of the page title
in 'header-line-format' as set by 'eww-update-header-line-format'.
Preserving this property in eww-readable avoids having the header
line's appearance change when this command is called.
* lisp/net/eww.el (eww-readable): Preserve eww-data's :peer
property. (Bug#62574)
Jim Porter [Sat, 1 Apr 2023 17:28:02 +0000 (10:28 -0700)]
; Make sure 'eshell-command' tests don't prompt the user
* test/lisp/eshell/eshell-tests.el
(eshell-test/eshell-command/background)
(eshell-test/eshell-command/background-pipeline): Wait for the process
to finish.
Eli Zaretskii [Sat, 1 Apr 2023 06:24:38 +0000 (09:24 +0300)]
Fix new Eshell tests on MS-Windows
* test/lisp/eshell/eshell-tests.el (eshell-test/eshell-command/background)
(eshell-test/eshell-command/background-pipeline): Allow for ".exe"
in the program's name. This fixes these tests on MS-Windows.
João Távora [Thu, 30 Mar 2023 22:52:27 +0000 (23:52 +0100)]
Eglot: unbreak eglot-extend-to-xref on w32
Because of a drive-letter casing mismatch between 'buffer-file-name'
and the return value of 'url-generic-parse-url', the hash-table test
'equal' in 'eglot-current-server' failed.
This failed to recognize that the file xref landed us on really is
managed by the language server that facilitated that jump.
The function w32-long-file-name seems to convert "C:/Users/" to
"c:/Users" consistently and so is a good addition to
eglot--uri-to-path.
* lisp/progmodes/eglot.el (eglot--uri-to-path): Use
w32-long-file-name.
Eli Zaretskii [Thu, 30 Mar 2023 13:34:41 +0000 (16:34 +0300)]
; Clarify documentation of 'cursor' text property
* doc/lispref/text.texi (Special Properties): Clarify that
'cursor' property is only considered when the overlay hides buffer
text on display. (Bug#62540)
Yuan Fu [Fri, 24 Mar 2023 23:45:15 +0000 (16:45 -0700)]
Add two typescript-ts-mode faces (bug#62429)
* lisp/progmodes/typescript-ts-mode.el:
(typescript-ts-mode-jsx-tag-face)
(typescript-ts-mode-jsx-attribute-face): New faces.
(typescript-ts-mode--font-lock-settings): Use new faces.
(tsx-ts-mode): Mention the new faces in the docstring.
Shynur [Wed, 29 Mar 2023 17:29:17 +0000 (01:29 +0800)]
Fix scrolling window when point moves up
This fixes the case when both 'scroll-conservatively' and
'scroll-step' are customized to non-default values.
* src/xdisp.c (try_scrolling): Fix precedence between
'scroll-step' and 'scroll-conservatively' when scrolling with
'previous-line'. (Bug#62530)
Andrea Corallo [Wed, 29 Mar 2023 16:02:30 +0000 (18:02 +0200)]
Comp fix calls to redefined primtives with op-bytecode (bug#61917)
* test/src/comp-tests.el (61917-1): New test.
* src/comp.c (syms_of_comp): New variable.
* lisp/loadup.el: Store primitive arities before dumping.
* lisp/emacs-lisp/comp.el (comp--func-arity): New function.
(comp-emit-set-call-subr): Make use of `comp--func-arity'.
Eli Zaretskii [Tue, 28 Mar 2023 18:08:12 +0000 (21:08 +0300)]
Improve documentation of 'read-choice' and related symbols
* doc/lispref/commands.texi (Reading One Event):
* lisp/subr.el (read-char-choice-use-read-key, read-char-choice)
(read-char-choice-with-read-key, y-or-n-p-use-read-key): Improve
documentation of these functions and variables.
Eli Zaretskii [Tue, 28 Mar 2023 11:08:29 +0000 (14:08 +0300)]
; Fix incompatibility in 'display-buffer-assq-regexp'
* lisp/window.el (display-buffer-assq-regexp): Make it accept a
buffer's name again, as it did in Emacs 28. This makes computing
the buffer's name inside the function unnecessary.
(display-buffer): Always pass the buffer's name to
'display-buffer-assq-regexp'. (Bug#62417)
This change makes it work again, restoring compatibility.
* lisp/subr.el (buffer-match-p): Fix and adjust docstring.
* lisp/window.el (display-buffer-alist): Adjust docstring.
(display-buffer-assq-regexp): Make good on promise of display-buffer-alist.
Dmitry Gutov [Mon, 27 Mar 2023 00:49:13 +0000 (03:49 +0300)]
ruby-ts-mode: Fix/simplify Imenu index generation
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--full-name): Drop '#'
from the end of resulting string when the node is not a method.
Support 'singleton_method' nodes.
(ruby-ts--imenu-helper): Simplify, to create a "flat" list of
entries, rather than a nested one. The previous implementation
had problems (like producing a nested structure of full-qualified
names, thus creating a lot of textual repetition), seems easier to
just follow ruby-mode's example here, at least for Emacs 29's
release.
* test/lisp/progmodes/ruby-ts-mode-tests.el (ruby-ts-imenu-index):
New test.
Ken Brown [Sat, 25 Mar 2023 20:37:51 +0000 (16:37 -0400)]
Skip failing tests on Cygwin with native compilation (bug#62450)
* test/Makefile.in (TEST_NATIVE_COMP): New variable, used to
determine whether to run tests tagged with :nativecomp. Set it to
"no" on Cygwin and to $(HAVE_NATIVE_COMP) otherwise.
* test/lisp/emacs-lisp/benchmark-tests.el (benchmark-tests): Skip
on Cygwin with native-compilation.
Eli Zaretskii [Sun, 26 Mar 2023 11:56:57 +0000 (14:56 +0300)]
; Fix last change
* lisp/net/eww.el (eww-download-directory): Rename from
'eww-default-download-directory'. All users changed. Change
:type to be a directory. Doc fix. (Bug#62435)
Phil Sainty [Sun, 14 Aug 2022 10:34:41 +0000 (22:34 +1200)]
* src/buffer.c (mode-line-format): Remove docs for obsolete %t construct
This documentation had been previously removed in 1999 in [1]
but was subsequently restored again in a different form in 2006
in [2] as the construct was still supported on some systems.
However it looks like it hasn't done what that documentation
indicated since [3] in 2011, and the final remnant of this
functionality was removed in [4] in 2013; so it seems clear that
it's no longer supported and shouldn't be documented now.
kobarity [Sat, 25 Mar 2023 13:59:05 +0000 (22:59 +0900)]
Improve indenting "case" in Python
* lisp/progmodes/python.el (python-info-dedenter-statement-p): Do not
consider the first "case" in the block as dedenter.
* test/lisp/progmodes/python-tests.el
(python-info-dedenter-opening-block-positions-7)
(python-info-dedenter-statement-p-6): New tests. (Bug#62092)
Ken Brown [Fri, 24 Mar 2023 15:35:40 +0000 (11:35 -0400)]
Fix failure of fns-tests-collate-strings on Cygwin
* test/src/fns-tests.el (fns-tests-collate-strings): Use
en_XY.UTF-8 instead of en_DE.UTF-8 as an example of an invalid
locale; en_DE.UTF-8 is actually a valid locale on Cygwin.
Note: The test will still fail on Cygwin releases < 3.5
because of a Cygwin bug. (Bug#62420)