]> git.eshelyaron.com Git - emacs.git/log
emacs.git
11 months agoImprove font-locking in lua-ts-mode (bug#67554)
john muhl [Tue, 14 Nov 2023 22:25:43 +0000 (16:25 -0600)]
Improve font-locking in lua-ts-mode (bug#67554)

* lisp/progmodes/lua-ts-mode.el (lua-ts-mode): Move property
highlighting to level 4.
(lua-ts--keywords): Remove `true', `false' and `nil' from
keywords.
(lua-ts--font-lock-settings): Highlight assignments, functions
and labels in more places. Distinguish comment delimiters.
(lua-ts--comment-font-lock): New function.

11 months agoFacilitate using Completion Preview with the mouse (bug#67479)
Eshel Yaron [Sun, 26 Nov 2023 16:00:32 +0000 (17:00 +0100)]
Facilitate using Completion Preview with the mouse (bug#67479)

Allow users to accept the completion suggestion by clicking on it, and
to cycle between completion suggestions by scrolling (with a mouse
wheel or a trackpad) over the preview.

Also display a message by default when cycling to inform the user
about the index of the current suggestion out of the available total.

* lisp/completion-preview.el (completion-preview-highlight): New face.
(completion-preview-message-format): New user option.
(completion-preview--mouse-map): New keymap.
(completion-preview--try-table, completion-preview--show)
(completion-preview-next-candidate): Apply 'keymap' and 'mouse-face'
properties to completion preview string.
(completion-preview--internal-commands): Add 'mwheel-scroll'.  This
prevents incidental scrolls outside of the preview from dismissing the
preview when you actually want to cycle it.
(completion-preview--active-p): New function.  Use it as a
'completion-predicate' symbol property for commands that should only
be used when the preview is shown to otherwise exclude these commands
from M-x completion candidates.

11 months agoMerge branch 'register_preview'
Thierry Volpiatto [Sat, 2 Dec 2023 08:04:03 +0000 (09:04 +0100)]
Merge branch 'register_preview'

11 months agoDelete register-tests.el now no more needed
Thierry Volpiatto [Thu, 30 Nov 2023 10:04:47 +0000 (11:04 +0100)]
Delete register-tests.el now no more needed

* register-tests.el: Deleted file.

11 months agoUpdate register manual
Thierry Volpiatto [Thu, 30 Nov 2023 09:53:46 +0000 (10:53 +0100)]
Update register manual

doc/emacs/regs.texi: Do it.

11 months agoFix register-preview-default
Thierry Volpiatto [Thu, 30 Nov 2023 09:38:52 +0000 (10:38 +0100)]
Fix register-preview-default

We need to print the string representation (one char) of an eventual
key description e.g. "^X" instead of "C-x".
However the key description is still displayed in a display property.

* lisp/register.el (register-preview-default): Use `string' to print register.

11 months ago* test/lisp/net/tramp-tests.el (tramp-test31-signal-process): Extend.
Michael Albinus [Fri, 1 Dec 2023 15:29:37 +0000 (16:29 +0100)]
* test/lisp/net/tramp-tests.el (tramp-test31-signal-process): Extend.

11 months agoFix mode-line-inactive face
Eli Zaretskii [Fri, 1 Dec 2023 12:15:30 +0000 (14:15 +0200)]
Fix mode-line-inactive face

* src/xfaces.c (Finternal_set_lisp_face_attribute): Fix validation
of the :style attribute of :box.  Previously, nil for :style was not
accepted, which causes 'mode-line-inactive' face to be rejected.
(Bug#67567)

11 months ago* lisp/simple.el (minibuffer-default-add-shell-commands): Require 'dired-aux'.
Juri Linkov [Fri, 1 Dec 2023 07:18:28 +0000 (09:18 +0200)]
* lisp/simple.el (minibuffer-default-add-shell-commands): Require 'dired-aux'.

This is necessary for 'shell-command-guess' after removing autoload cookie
since declare-function doesn't autoload it.

11 months ago* lisp/simple.el: Add declare-function for shell-command-guess.
Juri Linkov [Thu, 30 Nov 2023 18:11:36 +0000 (20:11 +0200)]
* lisp/simple.el: Add declare-function for shell-command-guess.

* lisp/dired-aux.el (shell-command-guess): Remove unneeded autoload cookie.

11 months ago* lisp/dired-aux.el (shell-command-guess-open): New defcustom (bug#18132).
Juri Linkov [Thu, 30 Nov 2023 17:39:16 +0000 (19:39 +0200)]
* lisp/dired-aux.el (shell-command-guess-open): New defcustom (bug#18132).

(shell-command-guess-open): New function.
(shell-command-guess-functions): Add 'shell-command-guess-open' to choice.

11 months agoFix validation of :box face attribute
Eli Zaretskii [Thu, 30 Nov 2023 15:17:02 +0000 (17:17 +0200)]
Fix validation of :box face attribute

* src/xfaces.c (Finternal_set_lisp_face_attribute): Fix the logic
of validating the :box attribute.  The previous code would always
allow invalid attributes of :box as long as the invalid attribute
was the last in the list.  (Bug#67404)

11 months ago* lisp/net/tramp.el (tramp-signal-process): PROCESS can also be a string.
Michael Albinus [Thu, 30 Nov 2023 14:02:37 +0000 (15:02 +0100)]
* lisp/net/tramp.el (tramp-signal-process): PROCESS can also be a string.

* test/lisp/net/tramp-tests.el (tramp-test31-signal-process): Extend.

11 months ago* lisp/net/tramp.el (tramp-local-host-regexp): Extend.
Michael Albinus [Thu, 30 Nov 2023 13:48:54 +0000 (14:48 +0100)]
* lisp/net/tramp.el (tramp-local-host-regexp): Extend.

11 months agoMove malformed-function warning from byte-opt to cconv (bug#67483)
Mattias Engdegård [Wed, 29 Nov 2023 16:51:46 +0000 (17:51 +0100)]
Move malformed-function warning from byte-opt to cconv (bug#67483)

We shouldn't be warning inside the optimiser in the first place.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-form):
Remove byte-compile-form-stack manipulation.
(byte-optimize-form-code-walker): Move malformed function warning
from here...
* lisp/emacs-lisp/cconv.el: ...to here.

11 months agoMake register-preview-delay obsolete
Thierry Volpiatto [Thu, 30 Nov 2023 07:03:45 +0000 (08:03 +0100)]
Make register-preview-delay obsolete

* etc/NEWS: Update.
* lisp/register.el (register-preview-delay): Make it obsolete.

11 months ago; Fix typos in a recent man.el change
Stephen Berman [Wed, 29 Nov 2023 17:44:35 +0000 (18:44 +0100)]
; Fix typos in a recent man.el change

* lisp/man.el (Man-getpage-in-background): Delete unintended space
characters in the strings for the buffer name.

11 months ago; * lisp/calc/calc-units.el (math-standard-units): Fix typo.
Ulrich Müller [Wed, 29 Nov 2023 16:02:22 +0000 (17:02 +0100)]
; * lisp/calc/calc-units.el (math-standard-units): Fix typo.

11 months ago; * lisp/calc/calc-units.el: Update dead URL.
Ulrich Müller [Wed, 29 Nov 2023 15:48:11 +0000 (16:48 +0100)]
; * lisp/calc/calc-units.el: Update dead URL.

11 months agoUpdate Calc units table
Ulrich Müller [Wed, 29 Nov 2023 09:24:06 +0000 (10:24 +0100)]
Update Calc units table

* lisp/calc/calc-units.el (math-standard-units): Update to 2018
CODATA adjustment. Use exact value for V0. Update some spellings,
e.g. "Planck constant" instead of "Planck's constant".

11 months ago* lisp/emacs-lisp/eieio-core.el (eieio-set-defaults): Silence errors
Stefan Monnier [Wed, 29 Nov 2023 15:45:33 +0000 (10:45 -0500)]
* lisp/emacs-lisp/eieio-core.el (eieio-set-defaults): Silence errors

See bug#66938

11 months ago; * lisp/indent.el (indent-for-tab-command): Use 'memq'. (Bug#67158)
Eli Zaretskii [Wed, 29 Nov 2023 14:24:48 +0000 (16:24 +0200)]
; * lisp/indent.el (indent-for-tab-command): Use 'memq'.  (Bug#67158)

11 months agoImprove register-preview (Fix bug#66394)
Thierry Volpiatto [Sun, 19 Nov 2023 19:42:56 +0000 (20:42 +0100)]
Improve register-preview (Fix bug#66394)

A minibuffer is used now instead of read-key.
Registers in preview buffer are now filtered according to type of
registers the current command requires.
Navigation with C-n/p or up/down is now provided and update
minibuffer.
Current register is highlighted in preview buffer.

* lisp/register.el: (register-preview-default-keys)
(register-use-preview): New user variables.
(register-preview-info): New structure to store various info for
 preview.
(register-command-info): New generic.
(register-preview-forward-line): New, provide navigation in preview
buffer.
(register-preview-next, register-preview-previous): New, navigation.
(register-type): New, returns register type.
(register--type): Generic fn, new, returns register type according
to value.
(register-of-type-alist): New, filter register-alist according to
type.
(register-preview): Signature changed, use TYPES now.
(register-preview-get-defaults): New generic, compute defauts
according to action.
(register-read-with-preview): Now use read-from-minibuffer and
minibuffer-setup-hook.

* lisp/emacs-lisp/cl-generic.el: Add a call to
'cl--generic-prefill-dispatchers' to fix a build error.

11 months agoVarious improvements to font-lock-settings for elixir-ts-mode
Wilhelm H Kirschbaum [Wed, 15 Nov 2023 18:41:08 +0000 (20:41 +0200)]
Various improvements to font-lock-settings for elixir-ts-mode

Changes and made from conversations from the Elixir slack channel,
the github issue
https://github.com/wkirschbaum/elixir-ts-mode/issues/35 and bug#67246.

* lisp/progmodes/elixir-ts-mode.el
(elixir-ts--font-lock-settings): Update features.
(elixir-ts-mode): Update treesit-font-lock-feature-list.
(elixir-ts-font-comment-doc-identifier-face): Rename to
elixir-ts-comment-doc-identifier.
(elixir-ts-font-comment-doc-attribute-face): Rename to
elixir-ts-comment-doc-attribute.
(elixir-ts-font-sigil-name-face): Rename to elixir-ts-sigil-name.
(elixir-ts-atom-key-face)
(elixir-ts-keyword-key-face)
(elixir-ts-attribute-face): Add new custom face.

11 months agoClean up some redundant or otherwise suspect code
Po Lu [Wed, 29 Nov 2023 02:46:42 +0000 (10:46 +0800)]
Clean up some redundant or otherwise suspect code

* java/org/gnu/emacs/EmacsOpenActivity.java (onCreate):
Don't check if URI is non-NULL, for instanceof checks this
also.

* java/org/gnu/emacs/EmacsSafThread.java (accessDocument1):
Don't check !writable twice.

* java/org/gnu/emacs/EmacsService.java (documentIdFromName):
Designate this function as public, since it is called
through JNI.

11 months agoJsonrpc: prevent while-no-input messing with jsonrpc-request
João Távora [Wed, 29 Nov 2023 00:47:09 +0000 (18:47 -0600)]
Jsonrpc: prevent while-no-input messing with jsonrpc-request

'jsonrpc-request' already has its "interrupt on user input" mechanism
base on 'sit-for'.  If called from a situation that uses
while-no-input to do basically the same, that mechanism may become
confused, so it's important to prevent that interfence.

This was confirmed to be a problem when using the Corfu completion
front-end.

See also
https://github.com/joaotavora/eglot/discussions/1127#discussioncomment-7277567

Many thanks to JD Smith <jdtsmith@gmail.com> for helping me debug this
and pointing in the right direction.

* lisp/jsonrpc.el (Version): Bump to 1.0.18
(jsonrpc-request): Bind throw-on-input to nil

11 months agoUnbreak Eglot, Jsonrpc as EIEIO inches closer to CLOS (bug#67480)
João Távora [Wed, 29 Nov 2023 00:33:09 +0000 (18:33 -0600)]
Unbreak Eglot, Jsonrpc as EIEIO inches closer to CLOS (bug#67480)

EIEIO is an innacurate emulation of CLOS in many aspects and one of
them in accessor definition.  Before this commit

commit 6c47931a1ad4de4af3f147b9604169c2441100fe
Author: Brandon <brandon.irizarry@gmail.com>
Date:   Sat Nov 4 17:11:32 2023 -0400

    Make EIEIO ':accessor' behave like ':reader' when reading (bug#66938)

An :initform-less, non-:initarg'ed slot with be read using an
:accessor which would just return nil.  This is EIEIO specific of
course, but it made for (my) sloppy programming in jsonrpc.el and
eglot.el.

Tightening up the rules a bit meant these things broke and now I'm
fixing them.

* lisp/jsonrpc.el (jsonrpc-connection): Add a bunch of :initform nil
(jsonrpc-process-connection): Add a bunch of :initform nil

* lisp/progmodes/eglot.el (eglot-lsp-server): Add a bunch of :initform nil

11 months ago* lisp/dired.el (dired-context-menu): Add menu item "Open With" (bug#63911).
Juri Linkov [Mon, 27 Nov 2023 17:35:45 +0000 (19:35 +0200)]
* lisp/dired.el (dired-context-menu): Add menu item "Open With" (bug#63911).

Populate the menu item "Open With" with commands returned
by 'shell-command-guess' on the current file name.

11 months agoNew user option 'shell-command-guess-functions' (bug#18132)
Juri Linkov [Mon, 27 Nov 2023 17:32:10 +0000 (19:32 +0200)]
New user option 'shell-command-guess-functions' (bug#18132)

* lisp/dired-aux.el (dired-minibuffer-default-add-shell-commands):
Remove function since now mailcap commands are available
by shell-command-guess-mailcap for shell-command-guess
used by dired-guess-shell-command.
(dired-read-shell-command): Don't set minibuffer-default-add-function
to dired-minibuffer-default-add-shell-commands.
(dired-guess-shell-command): Replace dired-guess-default
with shell-command-guess.
(shell-command-guess-functions): New defcustom.
(shell-command-guess, shell-command-guess-dired)
(shell-command-guess-mailcap, shell-command-guess-xdg):
New functions.

* lisp/simple.el (minibuffer-default-add-shell-commands):
Use 'shell-command-guess' instead of requiring 'mailcap'
with 'mailcap-file-default-commands'.  Remove 'interactive'.

11 months ago* lisp/dired.el (dired-insert-set-properties): Fix 'isearch-open-invisible'.
Juri Linkov [Mon, 27 Nov 2023 17:16:02 +0000 (19:16 +0200)]
* lisp/dired.el (dired-insert-set-properties): Fix 'isearch-open-invisible'.

Set overlay property 'isearch-open-invisible' to 'delete-overlay'
for 'dired-filename-display-length' (bug#67161).

11 months ago* lisp/progmodes/project.el (project-prompt-project-name): Add 'reverse'.
Juri Linkov [Mon, 27 Nov 2023 17:09:49 +0000 (19:09 +0200)]
* lisp/progmodes/project.el (project-prompt-project-name): Add 'reverse'.

Reverse ret that should restore order for 'C-x p p M-n M-n ...' (bug#67310).

11 months agoCompiler optimizer: push forms onto byte-compile-form-stack
Alan Mackenzie [Mon, 27 Nov 2023 15:36:36 +0000 (15:36 +0000)]
Compiler optimizer: push forms onto byte-compile-form-stack

This fixes bug#67483.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-form): Push and
pop FORM onto/off byte-compile-form-stack so that warning
messages get a position near to the erroneous source.

11 months ago* lisp/vc/vc.el (vc-deduce-backend-nonvc-modes): Use defcustom (bug#67171).
Juri Linkov [Mon, 27 Nov 2023 07:38:34 +0000 (09:38 +0200)]
* lisp/vc/vc.el (vc-deduce-backend-nonvc-modes): Use defcustom (bug#67171).

(vc-deduce-backend): Check for t value of vc-deduce-backend-nonvc-modes.

11 months agoRestore prompt correctly when reconnecting in ERC
F. Jason Park [Sun, 26 Nov 2023 03:23:55 +0000 (19:23 -0800)]
Restore prompt correctly when reconnecting in ERC

* lisp/erc/erc.el (erc--initialize-markers): Commit 0d6c8d41ab7 "Use
overlay instead of text prop to hide ERC's prompt" introduced a bug
that caused the prompt to remain hidden upon reconnecting because the
stashed overlay would get clobbered by ERC's major-mode setup.
Binding its old value while unhiding fixes the issue.
* test/lisp/erc/erc-tests.el (erc-hide-prompt): Don't permanently set
the default value of `erc-hide-prompt'.
* test/lisp/erc/resources/erc-scenarios-common.el
(erc-scenarios-common--join-network-id): Add assertions for prompt
hiding and unhiding on reconnect.  (Bug#51082)

11 months ago; Fix erc--channel-modes test on graphical displays
F. Jason Park [Sun, 26 Nov 2023 03:23:55 +0000 (19:23 -0800)]
; Fix erc--channel-modes test on graphical displays

* lisp/erc/erc-fill.el (erc-fill--wrap-insert-merged-post): Use
correct variable.
* test/lisp/erc/erc-scenarios-display-message.el: Mute unrelated noisy
test.
* test/lisp/erc/erc-tests.el (erc--channel-modes): Bail out following
first group of assertions when running on a graphical display.
(erc--channel-modes/graphic-p): New test asserting different values
for graphical terminals.  Note that this too is tagged as :unstable.
See also: d2ce30afdd2 "; Mark test for erc--update-channel-modes as
:unstable".

11 months agoFont-lock shorthands with arbitrary punctuation (bug#67390)
João Távora [Sun, 26 Nov 2023 21:49:59 +0000 (15:49 -0600)]
Font-lock shorthands with arbitrary punctuation (bug#67390)

* lisp/emacs-lisp/shorthands.el
(shorthands--mismatch-from-end): Rework and document.  Works like
CL's mismatch now.
(shorthands-font-lock-shorthands): Allow arbitrary punctuation
as separator for font-locking logic.

11 months agoAdd autoload cookie to autoload-compute-prefixes (bug#67325)
João Távora [Sun, 26 Nov 2023 21:04:06 +0000 (15:04 -0600)]
Add autoload cookie to autoload-compute-prefixes (bug#67325)

* lisp/emacs-lisp/loaddefs-gen.el (autoload-compute-prefixes): Add
autoload cookie.

11 months ago(ruby-ts-mode): Extend treesit-thing-settings more
Dmitry Gutov [Sun, 26 Nov 2023 16:25:26 +0000 (18:25 +0200)]
(ruby-ts-mode): Extend treesit-thing-settings more

* lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode):
Add 'while', 'until' and 'for'.

11 months ago(ruby-ts-mode): Also add 'self' and 'super' to things
Dmitry Gutov [Sun, 26 Nov 2023 16:04:14 +0000 (18:04 +0200)]
(ruby-ts-mode): Also add 'self' and 'super' to things

* lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode):
(ruby-ts-mode): Also add 'self' and 'super'.

11 months ago(ruby-ts-mode): Extend treesit-thing-settings (bug#67036)
Dmitry Gutov [Sun, 26 Nov 2023 15:35:06 +0000 (17:35 +0200)]
(ruby-ts-mode): Extend treesit-thing-settings (bug#67036)

* lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode): Add to
'treesit-thing-settings': 'singleton_class', 'else' and 'then'.
The latter two help with navigation across elseif's a little, but
not quite perfectly.

11 months agoMake EIEIO ':accessor' behave like ':reader' when reading (bug#66938)
Brandon [Sat, 4 Nov 2023 21:11:32 +0000 (17:11 -0400)]
Make EIEIO ':accessor' behave like ':reader' when reading (bug#66938)

Clones of instances of subclasses of 'eieio-instance-inheritor' didn't
delegate to their ':parent-instance' field when reading object fields
using ':accessor'.

* lisp/emacs-lisp/eieio.el (defclass): Remove 'slot-boundp' check for
:accessor's getter
* test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
(eieio-test-use-accessor-function-with-cloned-object): New test.

Copyright-paperwork-exempt: yes

11 months ago.elc format: Record lambdas' doc strings lazily, not inline
Alan Mackenzie [Sun, 26 Nov 2023 12:25:30 +0000 (12:25 +0000)]
.elc format: Record lambdas' doc strings lazily, not inline

Also refactor the pertinent part of bytecomp.el.

* lisp/emacs-lisp/bytecomp.el (byte-compile-output-file-form):
Use byte-compile-output-docform for all forms, not just those
with doc strings.
(byte-compile--output-docform-recurse): New function extracted
from byte-compile-output-docform.  This function recurses on
functions contained in the constants vector.
(byte-compile-output-docform): Extract parameter DOCINDEX from
the INFO list.  Add parameter CVECINDEX, the index of the
constants vector in FORM.
(byte-compile-file-form-defmumble): Several detailed
refactorings.  Call byte-compile-output-docform with the new
interface.
(byte-compile-output-as-comment): On exit, leave point after
the inserted text.  No longer assume that the output is being
inserted at the end of the buffer.

11 months ago; * lisp/textmodes/ispell.el (ispell-complete-word): Remove FIXME.
Eli Zaretskii [Sun, 26 Nov 2023 11:23:14 +0000 (13:23 +0200)]
; * lisp/textmodes/ispell.el (ispell-complete-word): Remove FIXME.

11 months agoFix 'dired--get-ellipsis-length'
Eli Zaretskii [Sun, 26 Nov 2023 10:46:53 +0000 (12:46 +0200)]
Fix 'dired--get-ellipsis-length'

* lisp/dired.el (dired--get-ellipsis-length): Handle glyphs with
faces.  (Bug#67161)

11 months agoUnbind 'C-M-i' in Text mode
Eshel Yaron [Tue, 21 Nov 2023 11:39:23 +0000 (12:39 +0100)]
Unbind 'C-M-i' in Text mode

Remove the binding of 'C-M-i' to 'ispell-complete-word' in Text mode.
Define a new 'ispell-completion-at-point' function and add that to
'completion-at-point-functions' in Text mode, such that
'completion-at-point' provides the same word completions as
'ispell-complete-word' does OOTB.

* lisp/textmodes/ispell.el (ispell-completion-at-point): New function.
* lisp/textmodes/text-mode.el (text-mode): Add it to 'c-a-p-functions'.
(text-mode-map): Remove 'C-M-i' binding.
(text-mode-meta-tab-ispell-complete-word): New user option.
* etc/NEWS: Announce it.
* doc/emacs/fixit.texi (Spelling)
* doc/emacs/text.texi (Text Mode)
* doc/lispref/modes.texi (Basic Major Modes)
(Example Major Modes): Update.
* lisp/mail/sendmail.el (mail-abbrevs-loaded)
* lisp/nxml/nxml-mode.el (nxml-mode-map): Remove superfluous binding.

11 months agoSimplify gnus-group-search-forward
Eric Abrahamsen [Sun, 26 Nov 2023 01:46:07 +0000 (17:46 -0800)]
Simplify gnus-group-search-forward

Bug#67445

* lisp/gnus/gnus-group.el (gnus-group-search-forward): The
special-case check for backwards-and-bobp is odd and unnecessary, just
perform an equivalent search from point depending on direction.

11 months ago* src/pdumper.c (dump_vectorlike): Avert compiler warning.
Po Lu [Sun, 26 Nov 2023 00:29:40 +0000 (08:29 +0800)]
* src/pdumper.c (dump_vectorlike): Avert compiler warning.

11 months ago; Update Autoconf auxiliaries in exec
Po Lu [Sun, 26 Nov 2023 00:27:38 +0000 (08:27 +0800)]
; Update Autoconf auxiliaries in exec

* exec/config.guess:

* exec/config.sub: Update configury files.

11 months ago; Mark test for erc--update-channel-modes as :unstable
F. Jason Park [Sat, 25 Nov 2023 22:26:24 +0000 (14:26 -0800)]
; Mark test for erc--update-channel-modes as :unstable

* test/lisp/erc/erc-scenarios-auth-source.el
(erc-scenarios-common--auth-source): Extend timeout.
* test/lisp/erc/erc-scenarios-base-buffer-display.el
(erc-scenarios-base-buffer-display--count-reset-timeout): Await
initial condition.
* test/lisp/erc/erc-scenarios-base-renick.el
(erc-scenarios-base-renick-queries-solo): Extend timeout.
* test/lisp/erc/erc-scenarios-misc.el (erc-scenarios-base-flood):
Extend timeout.
* test/lisp/erc/erc-tests.el (erc--channel-modes): Mark test as
:unstable pending further investigation.  This test has been shown to
be unreliable, possibly because it expects Emacs to report characters
being a certain width in all environments.  Thanks to Mattias
Engdegård for reporting this failure.
* test/lisp/erc/resources/base/reuse-buffers/server/barnet.eld:
Extend timeouts.
* test/lisp/erc/resources/base/reuse-buffers/server/foonet.eld:
Extend timeouts.

11 months agoSimplify option erc-fill-wrap-merge-indicator
F. Jason Park [Fri, 24 Nov 2023 23:00:55 +0000 (15:00 -0800)]
Simplify option erc-fill-wrap-merge-indicator

* lisp/erc/erc-fill.el (erc-fill-function): Add hyperlink to
`erc-fill-wrap-mode' in doc string.
(erc-fill-wrap-merge-indicator-face): New face.  The rationale for
adding this is that hard-coding `erc-fill-wrap-merge-indicator' to use
specific non-ERC faces forces folks to customize the option by
specifying a value manually, which may not be easy for new users,
seeing as its :type is relatively complex.
(erc-fill-wrap-merge-indicator): Add new preset without leading
space, for narrow windows, and replace `shadow' with
`erc-fill-wrap-merge-indicator-face' everywhere.
(erc-fill-wrap-mode): Add configuration hint to doc string for related
options when facing narrow windows.
(erc-fill--wrap-insert-merged-post, erc-fill--wrap-insert-merged-pre):
Fix sloppy thinko in which "-pre" and "-post" stash variables for
precomputed values were swapped.  Also accommodate :type string
variant for option `erc-fill-wrap-merge-indicator'.
(erc-fill--wrap-rejigger-region): Clear pre-computed merge-indicator
value.  (Bug#60936)

11 months agoRefactor pseudovector printing
Mattias Engdegård [Sat, 25 Nov 2023 16:36:53 +0000 (17:36 +0100)]
Refactor pseudovector printing

* src/print.c (print_vectorlike): Split into...
(print_bignum, print_bool_vector, print_vectorlike_unreadable):
...these functions.  Exhaustive switch on pseudovector type.
Remove unused return value.
(print_object): Use new functions and simplify.

11 months ago; * src/pdumper.c (dump_vectorlike): Populate switch fully.
Mattias Engdegård [Sat, 25 Nov 2023 10:26:54 +0000 (11:26 +0100)]
; * src/pdumper.c (dump_vectorlike): Populate switch fully.

11 months agoregex-emacs.c (forall_firstchar): Fix regression bug#67226
Stefan Monnier [Sat, 25 Nov 2023 16:03:08 +0000 (11:03 -0500)]
regex-emacs.c (forall_firstchar): Fix regression bug#67226

All zero-width operations need to be taken into account when reaching
`succeed` in `mutually_exclusive_one`!

* src/regex-emacs.c (forall_firstchar_1): Call `f` for all zero-width
matching operators.
(analyze_first_fastmap, analyze_first_null, mutually_exclusive_one):
Adjust accordingly.

11 months agoRepair `tab-first-completion` (bug#67158)
Aymeric Agon-Rambosson [Sat, 25 Nov 2023 15:07:49 +0000 (10:07 -0500)]
Repair `tab-first-completion` (bug#67158)

Copyright-paperwork-exempt: yes

* lisp/indent.el (indent-for-tab-command): Use `syntax-class` to fix
longstanding thinko introduced back in 2020 in commit 64c851166442.
Rework the check for `syn` because TAB always completed when
`tab-first-completion` had value `word-or-paren` or `word-or-paren-or-punct`.

11 months ago(project-prompt-project-name): Simplify a bit
Dmitry Gutov [Sat, 25 Nov 2023 15:04:32 +0000 (17:04 +0200)]
(project-prompt-project-name): Simplify a bit

* lisp/progmodes/project.el (project-prompt-project-name):
Fold the inner 'let' into 'when-let'.

11 months ago; project-prompt-project-name: Reword a comment
Dmitry Gutov [Sat, 25 Nov 2023 14:07:06 +0000 (16:07 +0200)]
; project-prompt-project-name: Reword a comment

11 months ago; * configure.ac: Fix the unexec build.
Eli Zaretskii [Sat, 25 Nov 2023 12:05:57 +0000 (07:05 -0500)]
; * configure.ac: Fix the unexec build.

11 months agoMerge from origin/emacs-29
Eli Zaretskii [Sat, 25 Nov 2023 11:42:53 +0000 (06:42 -0500)]
Merge from origin/emacs-29

77ab00207d6 ; * admin/authors.el (authors-aliases): Add Noah Peart.
6f843f03dc2 typescript-ts-mode: Add missing 'operator' to treesit-fon...
0676a029310 Extend D-Bus doc and test
df094dd4bc1 Do not unregister a D-Bus service which is a unique name
e6ad97a3338 Fix byte-compilation warnings about 'sqlite-rollback'

11 months agoMerge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Eli Zaretskii [Sat, 25 Nov 2023 10:58:21 +0000 (12:58 +0200)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

11 months agoDon't insert subscript on a newline
Rahguzar [Wed, 25 Oct 2023 13:20:29 +0000 (15:20 +0200)]
Don't insert subscript on a newline

* lisp/net/shr.el (shr-tag-sub): Don't insert subscript on a
newline.  (Bug#66676)

11 months agoOptionally turn on visual-line-mode + outline support
Rahguzar [Tue, 24 Oct 2023 21:35:44 +0000 (23:35 +0200)]
Optionally turn on visual-line-mode + outline support

* lisp/net/eww.el (eww-render): Turn on 'visual-line-mode'
in absence of filling.
(eww-mode): Set 'outline-regexp' and 'outline-level'.
(Bug#66676)

11 months agoOutline support for shr rendered documents
Rahguzar [Tue, 24 Oct 2023 20:07:51 +0000 (22:07 +0200)]
Outline support for shr rendered documents

* lisp/net/shr.el
(shr-heading): Propertize heading with level.
(shr-outline-search):  An 'outline-search-function' that finds
headings using text property search.
(shr-outline-level): Outline level for 'shr-outline-search'.
(Bug#66676)

11 months agoAllow displaying images inline
Rahguzar [Tue, 24 Oct 2023 18:30:23 +0000 (20:30 +0200)]
Allow displaying images inline

* lisp/net/shr.el
(shr-max-inline-image-size): New custom variable.
(shr--inline-image-p): New helper function to decide if an
image should be inserted inline.
(shr-insert, shr-put-image, shr-tag-img): Use
'shr-max-inline-image-size' to insert some images inline.
(Bug#66676)

11 months agoMake some aspects of shr rendering customizable
Rahguzar [Mon, 23 Oct 2023 19:23:53 +0000 (21:23 +0200)]
Make some aspects of shr rendering customizable

* lisp/net/shr.el (shr-fill-text, shr-sup-raise-factor)
(shr-sub-raise-factor, shr-image-ascent): New custom variables.
(shr-fill-lines): Only fill if 'shr-fill-text' is non-nil.
(shr-put-image): Use 'shr-image-ascent' as value of :ascent.
(shr-rescale-image, shr-make-placeholder-image): Use
'shr-image-ascent'.
(shr-tag-sup, shr-tag-sub): Use 'shr-sup/sub-raise-factor'.
(Bug#66676)

11 months agoDon't enable pinentry loopback mode for gpgsm
Ulrich Müller [Fri, 17 Nov 2023 11:16:54 +0000 (12:16 +0100)]
Don't enable pinentry loopback mode for gpgsm

* lisp/epg.el (epg--start): Passphrase entry through the
minibuffer is currently not supported with gpgsm, therefore don't
pass "--pinentry-mode loopback" as an argument when the protocol
is CMS.  (Bug#67012)
* doc/misc/epa.texi (GnuPG Pinentry): Document it.

11 months agoAdd option `dired-filename-display-length'
Liu Hui [Mon, 20 Nov 2023 04:09:15 +0000 (12:09 +0800)]
Add option `dired-filename-display-length'

* lisp/dired.el (dired-filename-display-length): New option.
(dired-insert-set-properties): Set invisible property for long
filenames.
(dired--get-ellipsis-length, dired--get-filename-display-length)
(dired-filename-update-invisibility-spec): New functions.
(dired-mode): Add filename invisibility spec.
(dired-make-directory-clickable)
(dired-kill-when-opening-new-dired-buffer)
(dired-hide-details-preserved-columns): Add missing :group.
* lisp/wdired.el (wdired-change-to-wdired-mode)
(wdired-change-to-dired-mode): Update filename invisibility spec.
* etc/NEWS: Announce the change.  (Bug#67161)

11 months agoFix merging italic and underline faces with other fonts
Eli Zaretskii [Sat, 25 Nov 2023 10:30:03 +0000 (12:30 +0200)]
Fix merging italic and underline faces with other fonts

* lisp/faces.el (italic, underline): Leave the 'slant'
resp. 'underline' attributes even when they are not supported by
the default font.  (Bug#67269)

11 months ago; Avoid 'completion-at-point' in 'completion-preview-insert'
Eshel Yaron [Mon, 20 Nov 2023 11:45:11 +0000 (12:45 +0100)]
; Avoid 'completion-at-point' in 'completion-preview-insert'

Insert the completion suggestion directly in
'completion-preview-insert' instead of using 'completion-at-point' to
do that.  This fixes an issue where 'completion-preview-insert' would
not work correctly when the user uses 'add-hook' with a DEPTH argument
below a certain value to add functions to
'completion-at-point-functions', and obviates the need to manipulate
'completion-at-point-functions' when showing the preview all together.

* lisp/completion-preview.el (completion-preview--make-overlay)
(completion-preview-prev-candidate)
(completion-preview-next-candidate)
(completion-preview-mode): Improve docstring.
(completion-preview--exit-function)
(completion-preview--insert)
(completion-preview-insert-on-completion): Remove, no longer used.
(completion-preview--get): Turn into a 'defsubst'.
(completion-preview-active-mode)
(completion-preview--capf-wrapper): Simplify.
(completion-preview--try-table)
(completion-preview--update): Keep the completion "base" as a property
of the preview overlay, for use in completion exit functions.
(completion-preview-insert): Insert completion and call exit function
directly instead of manipulating 'completion-at-point' to do so.
(Bug#67275)

11 months ago; Improve and add tests for Completion Preview mode
Eshel Yaron [Sun, 19 Nov 2023 09:55:15 +0000 (10:55 +0100)]
; Improve and add tests for Completion Preview mode

Fix handling of capfs that return a function or signal an error,
respect the ':exclusive' completion property, fix lingering "exact"
face after deletion that makes the matches non-exact, and add tests.

* lisp/completion-preview.el (completion-preview--make-overlay): Only
reuse the previous 'after-string' if it has the right face.
(completion-preview--try-table)
(completion-preview--capf-wrapper): New functions.
(completion-preview--update): Use them.
* test/lisp/completion-preview-tests.el: New file.  (Bug#67275)

11 months ago; * admin/authors.el (authors-aliases): Add Noah Peart.
Eli Zaretskii [Sat, 25 Nov 2023 09:48:38 +0000 (11:48 +0200)]
; * admin/authors.el (authors-aliases): Add Noah Peart.

11 months agoFix test name with erts-run-test with Point-Char
nverno [Fri, 17 Nov 2023 01:55:59 +0000 (17:55 -0800)]
Fix test name with erts-run-test with Point-Char

* lisp/progmodes/erts-mode.el (erts-run-test): Fix finding
the test name when Point-Char is defined,  (Bug#67235)

11 months ago; Correct typos
Po Lu [Sat, 25 Nov 2023 04:52:09 +0000 (12:52 +0800)]
; Correct typos

* doc/lispref/frames.texi (Window System Selections): Correct
documentation typos.

11 months agoDismiss Android Back key events that are canceled
Po Lu [Sat, 25 Nov 2023 02:40:13 +0000 (10:40 +0800)]
Dismiss Android Back key events that are canceled

* java/org/gnu/emacs/EmacsWindow.java (onKeyDown): Disregard
KEYCODE_BACK events.
(onKeyUp): If the event is KEYCODE_BACK, deliver the disregarded
key press event, unless FLAG_CANCELED is set.

11 months agoUse the project--list as history when prompting for a project
Spencer Baugh [Tue, 21 Nov 2023 15:11:52 +0000 (10:11 -0500)]
Use the project--list as history when prompting for a project

The project--list is already ordered such that the most recently used
projects are at the front.  Now we use it as the minibuffer history
when prompting for a project.

To avoid savehist from picking up project--list as a minibuffer
history variable and overriding our own persistence mechanism, we
don't pass project--list directly as a history variable, but instead
pass project--dir-history or project--name-history, dynamically-bound
to an appropriate value.  project--dir-history and
project--name-history won't be persisted since they're always unbound
at the top level; but if they are persisted anyway somehow, it won't
affect us.

If we later find a way to rely on savehist for persistence instead of
having our own mechanism, we can change the in-memory format of
project--list to be just a list of directories, and our explicit calls
to project--add-dir can be replaced by let-binding
history-delete-duplicates=t, history-length=t.

* lisp/progmodes/project.el (project--remember-dir): Add.
(project-remember-project): Use project--remember-dir.
(project--name-history, project-prompt-project-name)
(project--dir-history, project-prompt-project-dir): Pass a
preprocessed project--list as HIST to completing-read.  (bug#67310)
(project-switch-project): Call project--remember-dir.

11 months agoOptionally allow substitution patterns in erc-prompt
F. Jason Park [Thu, 7 Oct 2021 12:26:36 +0000 (14:26 +0200)]
Optionally allow substitution patterns in erc-prompt

* etc/ERC-NEWS: Add entry for `erc-prompt-format'.
* lisp/erc/erc-compat.el (erc-compat--defer-format-spec-in-buffer):
New macro to wrap `format-spec' specification values in functions that
run in the current buffer and fall back to the empty string.
* lisp/erc/erc.el (erc-prompt): Add predefined Custom choice for
function type in `erc-prompt-format'.
(erc--prompt-format-face-example): New "pre-propertized" value for
option `erc-prompt-format'.
(erc-prompt-format): New companion option for `erc-prompt' choice
`erc-prompt-format'.  New function of the same name to perform format
substitutions and serve as a Custom choice value for `erc-prompt'.
Based on work and ideas originally proposed by Stefan Kangas.
(erc--away-indicator, erc-away-status-indicator,
erc--format-away-indicator): New formatting function and helper
variables for displaying short away status.
(erc--user-modes-indicator): New variable.
(erc--format-user-modes): New function.
(erc--format-channel-status-prefix): New function.
(erc--format-modes): New function.
* test/lisp/erc/erc-scenarios-prompt-format.el: New file.  (Bug#51082)

Co-authored-by: Stefan Kangas <stefankangas@gmail.com>
11 months agoAdd merged-message indicator option for erc-fill-wrap
F. Jason Park [Mon, 20 Nov 2023 01:18:29 +0000 (17:18 -0800)]
Add merged-message indicator option for erc-fill-wrap

* lisp/erc/erc-fill.el (erc-fill): Use `when-let' instead of
`when-let*'.
(erc-fill-wrap-merge): Mention companion options in doc string.
(erc-fill-wrap-merge-indicator): New option to display a
distinguishing "indicator" in the form of a one-character string
between messages from the same speaker.
(erc-fill-wrap-mode, erc-fill-wrap-disable): Mention
`erc-fill-wrap-merge-indicator' in doc string and kill related local
variables.
(erc-fill--wrap-merge-indicator-pre,
erc-fill--wrap-merge-indicator-post): New internal variables for
caching merge indicator.
(erc-fill--wrap-insert-merged-post, erc-fill--wrap-insert-merged-pre):
New functions for adding merge indicators either before or after a
message.
(erc-fill-wrap): Add logic for deferring to merge-indicator helpers
when needed.
* test/lisp/erc/erc-fill-tests.el (erc-fill-wrap-tests--merge-action,
erc-fill-wrap--merge-action): Move body of latter test into former, a
new fixture function.
(erc-fill-wrap--merge-action/indicator-pre,
erc-fill-wrap--merge-action/indicator-post): New tests.
* test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-post-01.eld:
New test data file.
* test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-pre-01.eld:
New test data file.  (Bug#60936)

11 months agoOptionally align prompt to prefix in erc-fill-wrap
F. Jason Park [Mon, 20 Nov 2023 01:18:29 +0000 (17:18 -0800)]
Optionally align prompt to prefix in erc-fill-wrap

* lisp/erc/erc-fill.el (erc-fill-wrap-align-prompt): New option for
aligning prompt with leading portion of messages at the common "static
center" pivot-column barrier, so it appears "dedented" along with all
speaker name tags.  Tests for this functionality appear in the
subsequent patch of this same change set.
(erc-fill-wrap-use-pixels): Demote from user option to normal variable
because it has no practical use other than for testing.  Don't rename
as internal variable to spare the improbable user of ERC on HEAD who's
already customized this.
(erc-fill-wrap-mode, erc-fill-wrap-enable, erc-fill-wrap-disable):
Take care to disable prompt-in-left-margin behavior when option
`erc-fill-wrap-align-prompt' is non-nil.
(erc-fill--wrap-measure): Improve doc string and always attempt to
leverage `buffer-text-pixel-size', even when the variable
`erc-fill-wrap-use-pixels' is nil.
(erc-fill--wrap-indent-prompt): New function to massage prompt
`line-prefix' after updates, such as changes to away status.
(Bug#51082)

11 months agoUse overlay instead of text prop to hide ERC's prompt
F. Jason Park [Sun, 19 Nov 2023 07:44:20 +0000 (23:44 -0800)]
Use overlay instead of text prop to hide ERC's prompt

* lisp/erc/erc-backend.el (erc--hidden-prompt-overlay):
New variable, a buffer-local handle for the prompt overlay.
(erc--reveal-prompt): Delete overlay instead of text prop.
(erc--conceal-prompt): Add overlay instead of text prop.
(erc--unhide-prompt): Run `erc--refresh-prompt-hook' after revealing.
(erc--hide-prompt): Run `erc--refresh-prompt-hook' after hiding.
* lisp/erc/erc-stamp.el (erc-stamp--adjust-margin): Attempt a more
accurate estimate of the prompt's width in columns when initially
setting left-margin.
(erc-stamp--skip-left-margin-prompt-p): New variable to inhibit normal
behavior of displaying prompt in left margin.
(erc-stamp--display-margin-mode): Allow opting out of
prompt-in-left-margin behavior.
(erc--reveal-prompt): Delete unneeded method implementation.
(erc--conceal-prompt): Put overlay in margin.
* test/lisp/erc/erc-tests.el (erc-hide-prompt): Use
`get-char-property' instead of `get-text-property' in order to
accommodate overlay-based prompt hiding.  (Bug#51082)

11 months agoDon't inherit properties when refreshing ERC's prompt
F. Jason Park [Sun, 19 Nov 2023 07:04:50 +0000 (23:04 -0800)]
Don't inherit properties when refreshing ERC's prompt

* lisp/erc/erc.el (erc--merge-prop-behind-p): New variable to be
dynamically bound around rare calls to `erc--merge-props' when the
latter should append to the end of existing list-valued text
properties.
(erc--inhibit-prompt-display-property-p): New variable to be non-nil
in buffers where an active module needs to reserve all uses of the
`display' text property in the prompt region for itself.
(erc--prompt-properties): Collect all common prompt properties in one
place for code reuse and maintenance purposes.
(erc--refresh-prompt-continue, erc--refresh-prompt-continue-request):
New function and state variable for custom `erc-prompt' functions to
indicate to ERC that they need the prompt to be refreshed in all
buffers and not just the current one.
(erc--refresh-prompt): Merge `erc-prompt-face' behind any applied by a
customized `erc-prompt' function value.  Crucially, don't inherit
properties at the beginning of the prompt because doing so may clobber
any added by a custom `erc-prompt' function.  Instead, apply known
properties from `erc-display-prompt' manually.  Integrate
`erc--refresh-prompt-continue' logic.
(erc--merge-prop): Recognize flag to activate `append' behavior in
which new prop values are appended to the tail of existing ones rather
than consed in front.  This functionality could be extended to
arbitrary splices as well.
(erc-display-prompt): Use common text properties defined elsewhere.
* test/lisp/erc/erc-tests.el (erc--merge-prop): Add assertion for
`erc--merge-prop-behind-p' non-nil behavior.  (Bug#51082)

11 months agoFix speedbar help-echo in erc-nickbar-mode
F. Jason Park [Thu, 23 Nov 2023 21:30:06 +0000 (13:30 -0800)]
Fix speedbar help-echo in erc-nickbar-mode

* lisp/erc/erc-speedbar.el (erc-speedbar-buttons): "Spoof"
`dframe-help-echo-function' in channel buffers to get around the fact
that we're not using the real speedbar frame.
(erc-speedbar--fmt-sentinel): New variable.
(erc-speedbar-expand-channel): Use cached channel-mode string for mode
item.  Use button chars to mark mode and topic items and move verbose
labels into mouse-hover text.  Also set face for mode and topic.
(erc-speedbar-item-info): Look for `speedbar-token' as a fallback even
when the primary pattern doesn't match.  If the value's contents are
structured like a `format' function call, use them.
(erc-speedbar--emulate-sidebar): Add comment about speedbar setting
everything globally in older Emacsen.  (Bug#63595)

11 months agoCache UI string for channel modes in ERC
F. Jason Park [Tue, 21 Nov 2023 03:45:30 +0000 (19:45 -0800)]
Cache UI string for channel modes in ERC

* etc/ERC-NEWS: Add entry for more expansive "%m" in header line.
* lisp/erc/erc-common.el (erc--channel-mode-types): New slot
`shortargs' for caching truncated mode args.
* lisp/erc/erc.el (erc--mode-line-chanmodes-arg-len): New internal
variable for adjusting the truncation length of channel-mode arguments
as they appear in the header line.
(erc--mode-line-mode-string): New variable for caching the relevant
"modestring", if any, in ERC buffers.
(erc--process-channel-modes): Don't associate args with group 4/D,
which are all nullary modes.  This fixes a bug in which arguments were
associated with the wrong letters.  Also, set cached mode string for
channel.
(erc--user-modes): Simplify slightly by removing likely useless
variant for overloaded arg AS-TYPE.  This function is new in ERC 5.6.
(erc--channel-modes):  New function.  A higher-level getter for
current channel mode representation to complement `erc--user-modes'.
(erc--parse-user-modes): Set `erc--mode-line-mode-string in server
buffers.
(erc--handle-channel-mode): Change model to associate modes of type A
with a running plus/minus tally of state changes since joining the
channel.
(erc-update-mode-line-buffer): Use cached verbose representation of
channel or user modes instead of calling `erc-format-channel-modes'.
* test/lisp/erc/erc-tests.el (erc--update-channel-modes): Update to
reflect new running tally associations for type A modes.
(erc--channel-modes): New test.
(erc--user-modes): Update to reflect parameter simplification.
(Bug#67220)

11 months agotypescript-ts-mode: Add missing 'operator' to treesit-font-lock-features
nverno [Fri, 24 Nov 2023 15:18:26 +0000 (07:18 -0800)]
typescript-ts-mode: Add missing 'operator' to treesit-font-lock-features

* lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode):
Add operator to treesit-font-lock-feature-list (bug#67433).

11 months agoExtend D-Bus doc and test
Michael Albinus [Fri, 24 Nov 2023 15:34:26 +0000 (16:34 +0100)]
Extend D-Bus doc and test

* doc/misc/dbus.texi (Register Objects): Adapt doc of
dbus-unregister-service.

* test/lisp/net/dbus-tests.el (dbus--test-register-service):
Extend test.

11 months agoCC Mode: Fontify int unsigned Foo;
Alan Mackenzie [Fri, 24 Nov 2023 12:22:08 +0000 (12:22 +0000)]
CC Mode: Fontify int unsigned Foo;

This fixes bug#59953.  Foo now gets fontified when unsigned
comes after int.

* lisp/progmodes/cc-engine.el (c-forward-type): Refactor nested
`if' forms into a cond form.  Loop around matches for
c-opt-type-component-key, advancing over them.

11 months agoDo not unregister a D-Bus service which is a unique name
Michael Albinus [Fri, 24 Nov 2023 10:09:15 +0000 (11:09 +0100)]
Do not unregister a D-Bus service which is a unique name

* lisp/net/dbus.el (dbus-unregister-service): Check, whether
SERVICE is a known name.  (Bug#67386)

11 months agoCC Mode: Add second anchor point to class-open and class-close
Alan Mackenzie [Fri, 24 Nov 2023 10:03:33 +0000 (10:03 +0000)]
CC Mode: Add second anchor point to class-open and class-close

This fixes the second (last) part of bug#66911.  The new second
anchor points allow the indentation of braces in template
classes to be anchored on the keyword 'class' rather than the
`template' at the beginning of the statement.

* lisp/progmodes/cc-engine.el (c-add-class-syntax): Add &rest
args parameter for additional anchor points.  Pass these to
c-add-syntax.
(c-guess-continued-construct): CASE B.1: Note return value from
c-looking-at-decl-block and pass this to c-add-syntax for a
class-open construct.
(c-guess-basic-syntax): CASE 4: Duplicate anchor position for
class-open.
(c-guess-basic-syntax): CASE 5A.2: Note return value of
c-looking-at-decl-block and pass it as extra argument to
c-add-syntax for a class-open construct.
(c-guess-basic-syntax): CASE 5G: Call c-looking-at-decl-block
to determine the second anchor point for a class-close, and
pass it to c-add-class-syntax.

* doc/misc/cc-mode.texi (Class Symbols): Document the anchor
points for class-open and class-close.

11 months agoFix byte-compilation warnings about 'sqlite-rollback'
Eli Zaretskii [Fri, 24 Nov 2023 07:30:53 +0000 (09:30 +0200)]
Fix byte-compilation warnings about 'sqlite-rollback'

* lisp/sqlite.el (sqlite-transaction, sqlite-commit)
(sqlite-rollback): Declare.
* lisp/emacs-lisp/multisession.el (sqlite-commit)
(sqlite-transaction): Remove declaration.

11 months agoPrevent touch screen translation from entering invalid state
Po Lu [Fri, 24 Nov 2023 02:39:49 +0000 (10:39 +0800)]
Prevent touch screen translation from entering invalid state

* lisp/subr.el (touch-screen-events-received): New variable.
(read--potential-mouse-event): If a touch screen event's been
registered thus far, continue as though xterm-mouse-mode is
enabled.

* lisp/touch-screen.el (touch-screen-handle-touch): Set that
variable.  If t-s-c-t already exists but the new touch point was
assigned the same number by the system, replace the current tool
with it rather than installing it as the anciliary tool.

11 months ago; Complete merge of emoji.el
Po Lu [Fri, 24 Nov 2023 00:45:18 +0000 (08:45 +0800)]
; Complete merge of emoji.el

* lisp/international/emoji.el (emoji-list): Import changes
from emacs-29.

11 months agoMerge from savannah/emacs-29
Po Lu [Fri, 24 Nov 2023 00:44:34 +0000 (08:44 +0800)]
Merge from savannah/emacs-29

1978b603bc3 Make python-ts-mode's syntax-highlighting more standardized
99658346d1e ; Improve documentation of desktop.el in user manual
f7dc0202127 Fix "Text is read-only" on backspacing initial Calc input
662d54775d5 Add a doc string to simple.el (bug#67355)
5a5e36d2aad ; Improve function documentation tips
86016d8ecdb Mention "visual line" in user manual
4bb65ed77a8 ; * doc/lispref/minibuf.texi (Programmed Completion): Imp...
dfb3dcb404c Allow listing Emoji from a read-only buffer

# Conflicts:
# lisp/calc/calc.el
# lisp/international/emoji.el

11 months ago; Merge from savannah/emacs-29
Po Lu [Fri, 24 Nov 2023 00:38:06 +0000 (08:38 +0800)]
; Merge from savannah/emacs-29

The following commits were skipped:

8256bf4cdfb Fix CRLF handling in Tramp (don't merge)
81b63ec032f Annotate java-ts-mode-test-movement with expected result
054202d48c3 Backport: Add more java indentation tests
d2776d8254f Backport: Add test for java indentation (bug#61115)

11 months agoMerge from savannah/emacs-29
Po Lu [Fri, 24 Nov 2023 00:38:06 +0000 (08:38 +0800)]
Merge from savannah/emacs-29

9af03e0e189 typescript-ts-mode: Support indentation for conditionals ...

11 months ago; Merge from savannah/emacs-29
Po Lu [Fri, 24 Nov 2023 00:38:05 +0000 (08:38 +0800)]
; Merge from savannah/emacs-29

The following commit was skipped:

61cdf42a48f Backport: Add some basic tests for java-ts-mode and types...

11 months agoMerge from savannah/emacs-29
Po Lu [Fri, 24 Nov 2023 00:38:03 +0000 (08:38 +0800)]
Merge from savannah/emacs-29

d72a4ed65ce Fix 'with-sqlite-transaction' when BODY fails
a7b3c923733 ; * doc/emacs/cmdargs.texi (Initial Options): Fix last ch...
fd76a80864d ; Mention that -x and --script ignore file-locals
e0469ddb9d4 ; * doc/emacs/search.texi (Special Isearch): More accurat...
e521669fb3f Fix wording in ELisp Intro manual
da946ca6924 Add missing python-ts-mode keyword (bug#67015)
0128495afde Fix string-pixel-width with global setting of display-lin...

# Conflicts:
# etc/NEWS

11 months agoMake python-ts-mode's syntax-highlighting more standardized
Dmitry Gutov [Thu, 23 Nov 2023 22:00:32 +0000 (00:00 +0200)]
Make python-ts-mode's syntax-highlighting more standardized

This was brought up in a Reddit discussion.

* lisp/progmodes/python.el (python--treesit-fontify-variable):
Use font-lock-variable-use-face (since it applies to references).
(python-ts-mode): Move 'property' from 3rd to 4th
treesit-font-lock-level.

11 months agoSupport dired-movement-style in dired-next-dirline and dired-prev-dirline
Juri Linkov [Thu, 23 Nov 2023 18:12:40 +0000 (20:12 +0200)]
Support dired-movement-style in dired-next-dirline and dired-prev-dirline

* lisp/dired.el (dired-movement-style): Mention dired-next-dirline
and dired-prev-dirline in the docstring (bug#67303).
(dired-next-line): Refactor most code to dired--move-to-next-line.
(dired--move-to-next-line): New function with code from dired-next-line.
(dired--trivial-next-dirline): Rename from dired-next-dirline.
(dired-next-dirline): New function body that uses dired-movement-style,
dired--move-to-next-line and dired--trivial-next-dirline.
(dired-prev-dirline): Mention dired-movement-style in the docstring.

11 months agoRemove spurious "nil" from Gnus mode line
Manuel Giraud [Thu, 23 Nov 2023 17:14:16 +0000 (09:14 -0800)]
Remove spurious "nil" from Gnus mode line

Bug#67322

* lisp/gnus/gnus.el (gnus-mode-line-buffer-identification): Handle a
nil return value from `gnus-emacs-version'.

11 months agoAdjust affected callers of derived-mode-p` to use the new convention
Stefan Monnier [Tue, 14 Nov 2023 00:09:17 +0000 (19:09 -0500)]
Adjust affected callers of derived-mode-p` to use the new convention

* lisp/align.el (align-rules-list): Prefer `derived-mode-p` over
`provided-mode-derived-p`.
(align--rule-should-run):
* lisp/window.el (display-buffer-reuse-mode-window):
* lisp/whitespace.el (whitespace-enable-predicate):
* lisp/transient.el (transient--do-suffix-p):
* lisp/so-long.el (so-long--set-auto-mode):
* lisp/simple.el (command-completion-with-modes-p):
* lisp/progmodes/tcl.el (tcl-current-word):
* lisp/progmodes/idlwave.el (idlwave-fix-keywords):
* lisp/progmodes/gdb-mi.el (gdb, gdb-locals-mode-map)
(gdb-registers-mode-map, gdb-function-buffer-p):
* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-style-setter)
(c-ts-mode-set-style):
* lisp/progmodes/bug-reference.el (bug-reference--try-setup-gnus-article):
* lisp/help-fns.el (help-fns--list-local-commands):
* lisp/emulation/viper.el (viper-mode)
(viper-this-major-mode-requires-vi-state):
* lisp/emacs-lisp/easy-mmode.el (easy-mmode--globalized-predicate-p):
* lisp/dired.el (dired-hide-details-mode, dired-click-to-select-mode):
* lisp/calendar/todo-mode.el (todo-reset-nondiary-marker)
(todo-reset-done-string, todo-reset-comment-string):
* lisp/vc/vc.el (vc-deduce-backend): Use new calling convention for
`derived-mode-p` and `provided-mode-derived-p`.

11 months ago(derived-mode-p): Take MODES as a single argument
Stefan Monnier [Thu, 16 Nov 2023 22:21:18 +0000 (17:21 -0500)]
(derived-mode-p): Take MODES as a single argument

Looking at uses of `derived-mode-p` and `provide-mode-derived-p`,
I can't find a single use case where it wouldn't be preferable for
it to take a single argument instead of `&rest`: all the calls are
either passing a single argument anyway, or passing a fixed list of modes.
The use of `&rest` just makes the code less efficient and sometimes
more clunky (because of the need for `apply`).
So let's change that (while preserving backward compatibility, of course).

* doc/lispref/modes.texi (Derived Modes): Adjust accordingly.

* lisp/subr.el (provided-mode-derived-p, derived-mode-p): Take the
`modes` as a single argument.

11 months agoCC Mode: Handle noise clauses, template arglists in any order
Alan Mackenzie [Thu, 23 Nov 2023 16:31:52 +0000 (16:31 +0000)]
CC Mode: Handle noise clauses, template arglists in any order

This fixes the first part of bug#66911.

* lisp/progmodes/cc-engine.el (c-looking-at-decl-block): Skip
back over template arglists and noise clauses in any order, no
longer assuming the noise clauses are before the template
arglist in the buffer.  When scanning forward, take noise
clauses into account.  Refactor a collection of nested `if'
forms as a cond form.