Merge from origin/emacs-30

74a972cace Skip proced refine tests on Darwin
c50ce03afc ; Fix recent additions to the manuals
c818c5bbaf ; * lisp/term/w32-win.el (tree-sitter--library-abi): Decl...
b71d3b2f52 ; Better clarify function types in C-h f (bug#73626)
59b3eae481 ; Introduce type specifiers to the elisp manual (bug#73626)
83fc3cf53a Future-proof loading tree-sitter library on MS-Windows
3eb3018682 ; Improve documentation of 'category' in display-buffer a...
4d80c4f485 ; More accurate documentation of 'set-mark-command'
70dd5705e1 Fix overriding 'c-ts-mode' by 'c-mode'
331610aef0 ; Improve vc-dir help-echo
9c484d5101 ; Avoid assertion violations in "temacs -Q"
8dc9dfdc38 lisp/progmodes/c-ts-mode.el: Demote loading c-ts-mode as ...
426bce8a67 ; In PROBLEMS mention issue with .Xresources on Gnome des...
This commit is contained in:
Eli Zaretskii 2024-11-23 04:46:10 -05:00
commit db7b3f6b95
14 changed files with 186 additions and 32 deletions

View file

@ -322,6 +322,15 @@ file where it was defined, whether it has been declared obsolete, and
yet further information is often reachable by clicking or typing
@key{RET} on emphasized parts of the text.
@cindex function type specifier
The function type, if known, is expressed with a @dfn{function type
specifier} (@pxref{Type Specifiers,,,elisp, The Emacs Lisp Reference
Manual}), it will be specified if the type was manually declared by a
Lisp program or inferred by the compiler. Note that function type
inference works only when native compilation is enabled (@pxref{native
compilation,,, elisp, The Emacs Lisp Reference Manual}).
@vindex help-enable-symbol-autoload
If you request help for an autoloaded function whose @code{autoload}
form (@pxref{Autoload,,, elisp, The Emacs Lisp Reference Manual})

View file

@ -112,7 +112,8 @@ to @code{set-mark-command}, so unless you are unlucky enough to have
a text terminal that behaves differently, you might as well think of
@kbd{C-@@} as @kbd{C-@key{SPC}}.}. This sets the mark where point is,
and activates it. You can then move point away, leaving the mark
behind.
behind. If the mark is already set where point is, this command doesn't
set another mark, but only activates the existing mark.
For example, suppose you wish to convert part of the buffer to upper
case. To accomplish this, go to one end of the desired text, type
@ -400,6 +401,11 @@ of buffers that you have been in, and, for each buffer, a place where
you set the mark. The length of the global mark ring is controlled by
@code{global-mark-ring-max}, and is 16 by default.
Note that a mark is recorded in the global mark ring only when some
command sets the mark. If an existing mark is merely activated, as is
the case when you use @kbd{C-@key{SPC}} where a mark is already set
(@pxref{Setting Mark}), that doesn't push the mark onto the global ring.
@kindex C-x C-SPC
@findex pop-global-mark
The command @kbd{C-x C-@key{SPC}} (@code{pop-global-mark}) jumps to

View file

@ -1000,6 +1000,12 @@ Satisfied if the buffer's major mode is equal to @var{expr}. Prefer
using @code{derived-mode} instead, when both can work. Note that this
condition might fail to report a match if @code{buffer-match-p} is
invoked before the major mode of the buffer has been established.
@item category
This is pertinent only when this function is called by
@code{display-buffer} (@pxref{Buffer Display Action Alists}), and is
satisfied if the action alist with which @code{display-buffer} was
called includes @w{@code{(category . @var{expr})}} in the value of its
@var{action} argument. @xref{Buffer Display Action Alists}.
@end table
@item t
Satisfied by any buffer. A convenient alternative to @code{""} (empty

View file

@ -2733,10 +2733,11 @@ native compiler (@pxref{Native Compilation}) for improving code
generation and for deriving more precisely the type of other functions
without type declaration.
@var{type} is a type specifier in the form @w{@code{(function
(ARG-1-TYPE ... ARG-N-TYPE) RETURN-TYPE)}}. Argument types can be
interleaved with symbols @code{&optional} and @code{&rest} to match the
function's arguments (@pxref{Argument List}).
@var{type} is a @dfn{type specifier} (@pxref{Type Specifiers}) in the
form @w{@code{(function (@var{arg-1-type} @dots{} @var{arg-n-type})
RETURN-TYPE)}}. Argument types can be interleaved with symbols
@code{&optional} and @code{&rest} to match the function's arguments
(@pxref{Argument List}).
@var{function} if present should be the name of function being defined.

View file

@ -247,6 +247,7 @@ latter are unique to Emacs Lisp.
* Closure Type:: A function written in Lisp.
* Record Type:: Compound objects with programmer-defined types.
* Type Descriptors:: Objects holding information about types.
* Type Specifiers:: Expressions which describe types.
* Autoload Type:: A type used for automatically loading seldom-used
functions.
* Finalizer Type:: Runs code when no longer reachable.
@ -1499,6 +1500,96 @@ free for use by Lisp extensions.
An example of a type descriptor is any instance of
@code{cl-structure-class}.
@node Type Specifiers
@subsection Type Specifiers
@cindex type specifier
A type specifier is an expression that denotes a type. A type
represents a set of possible values. Type specifiers can be classified
into primitive types and compound types.
Type specifiers are in use for several purposes, including: documenting
function interfaces through declaration (@pxref{Declare Form}),
specifying structure slot values (@pxref{Structures,,, cl, Common Lisp
Extensions for GNU Emacs Lisp}), type-checking through @code{cl-the}
(@pxref{Declarations,,, cl, Common Lisp Extensions for GNU Emacs Lisp}),
and others.
@table @asis
@item Primitive type specifiers
Primitive types specifiers are the basic types (i.e.@: not composed by other
type specifiers).
Built-in primitive types (like @code{integer}, @code{float},
@code{string} etc.@:) are listed in @ref{Type Hierarchy}.
@item Compound type specifiers
Compound types serve the purpose of defining more complex or precise
type specifications by combining or modifying simpler types.
List of compound type specifiers:
@table @code
@item (or @var{type-1} @dots{} @var{type-n})
The @code{or} type specifier describes a type that satisfies at least
one of the given types.
@item (and @var{type-1} @dots{} @var{type-n})
Similarly the @code{and} type specifier describes a type that satisfies
all of the given types.
@item (not @var{type})
The @code{not} type specifier defines any type except the specified one.
@item (member @var{value-1} @dots{} @var{value-n})
The @code{member} type specifier allows to specify a type that includes
only the explicitly listed values.
@item (function (@var{arg-1-type} @dots{} @var{arg-n-type}) @var{return-type})
The @code{function} type specifier is used to describe the argument
types and the return type of a function. Argument types can be interleaved
with symbols @code{&optional} and @code{&rest} to match the function's
arguments (@pxref{Argument List}).
The type specifier represent a function whose first parameter is of type
@code{symbol}, the second optional parameter is of type @code{float},
and which returns an @code{integer}:
@example
(function (symbol &optional float) integer)
@end example
@item (integer @var{lower-bound} @var{upper-bound})
The @code{integer} type specifier can also be used as a compound type
specifier to define a subset of integer values by specifying a range.
This allows to precisely control which integers are valid for a given
type.
@var{lower-bound} is the minimum integer value in the range and
@var{upper-bound} the maximum. You can use @code{*} instead of the
lower or upper bound to indicate no limit.
The following represents all integers from -10 to 10:
@example
(integer -10 10)
@end example
The following represents the single value of 10:
@example
(integer 10 10)
@end example
The following represents all the integers from negative infinity to 10:
@example
(integer * 10)
@end example
@end table
@end table
@node Autoload Type
@subsection Autoload Type

View file

@ -2746,6 +2746,9 @@ for example:
@end group
@end example
@noindent
@xref{Buffer List, @code{buffer-match-p}}.
Regardless of the displayed buffer's name the caller defines a category
as a symbol @code{comint}. Then @code{display-buffer-alist} matches
this category for all buffers displayed with the same category.
@ -3495,9 +3498,13 @@ windows were selected afterwards within this command.
@vindex category@r{, a buffer display action alist entry}
@item category
If the caller of @code{display-buffer} passes an alist entry
@code{(category . symbol)} in its @var{action} argument, then you can
match the displayed buffer by using the same category in the condition
part of @code{display-buffer-alist} entries.
@w{@code{(category . @var{symbol})}} in its @var{action} argument, then you
can match the displayed buffer by using the same category symbol in the
condition part of @code{display-buffer-alist} entries. @xref{Buffer
List, @code{buffer-match-p}}. Thus, if a Lisp program uses a particular
@var{symbol} as the category when calling @code{display-buffer}, users
can customize how these buffers will be displayed by including such an
entry in @code{display-buffer-alist}.
@end table
By convention, the entries @code{window-height}, @code{window-width}

View file

@ -1604,6 +1604,12 @@ after switching back from another virtual desktop. Setting the variable
'x-set-frame-visibility-more-laxly' to one of 'focus-in', 'expose' or
't' should fix this.
*** Gnome desktop does not respect frame size specified in .Xresources
This has been obeserved when running a GTK+ build of Emacs 29 from the
launch pad on Ubuntu 24.04 with mutter as window manager. The problem
can be resolved by running Emacs from the command line instead.
*** Gnome: Emacs receives input directly from the keyboard, bypassing XIM.
This seems to happen when gnome-settings-daemon version 2.12 or later

View file

@ -35,12 +35,6 @@
;; To use these modes by default, assuming you have the respective
;; tree-sitter grammars available, do one of the following:
;;
;; - If you have both C and C++ grammars installed, add
;;
;; (require 'c-ts-mode)
;;
;; to your init file.
;;
;; - Add one or mode of the following to your init file:
;;
;; (add-to-list 'major-mode-remap-alist '(c-mode . c-ts-mode))
@ -59,6 +53,12 @@
;;
;; will turn on the c++-ts-mode for C++ source files.
;;
;; - If you have both C and C++ grammars installed, add
;;
;; (load "c-ts-mode")
;;
;; to your init file.
;;
;; You can also turn on these modes manually in a buffer. Doing so
;; will set up Emacs to use the C/C++ modes defined here for other
;; files, provided that you have the corresponding parser grammar
@ -1539,19 +1539,20 @@ the code is C or C++, and based on that chooses whether to enable
'c-ts-mode)))
(funcall (major-mode-remap mode))))
;; The entries for C++ must come first to prevent *.c files be taken
;; as C++ on case-insensitive filesystems, since *.C files are C++,
;; not C.
(if (treesit-ready-p 'cpp)
(add-to-list 'major-mode-remap-defaults
'(c++-mode . c++-ts-mode)))
(when (treesit-ready-p 'cpp)
(setq major-mode-remap-defaults
(assq-delete-all 'c++-mode major-mode-remap-defaults))
(add-to-list 'major-mode-remap-defaults '(c++-mode . c++-ts-mode)))
(when (treesit-ready-p 'c)
(add-to-list 'major-mode-remap-defaults '(c++-mode . c++-ts-mode))
(setq major-mode-remap-defaults
(assq-delete-all 'c-mode major-mode-remap-defaults))
(add-to-list 'major-mode-remap-defaults '(c-mode . c-ts-mode)))
(when (and (treesit-ready-p 'cpp)
(treesit-ready-p 'c))
(setq major-mode-remap-defaults
(assq-delete-all 'c-or-c++-mode major-mode-remap-defaults))
(add-to-list 'major-mode-remap-defaults '(c-or-c++-mode . c-or-c++-ts-mode)))
(when (and c-ts-mode-enable-doxygen (not (treesit-ready-p 'doxygen t)))

View file

@ -7452,9 +7452,10 @@ CONDITION is either:
* `major-mode': the buffer matches if the buffer's major mode
is eq to the cons-cell's cdr. Prefer using `derived-mode'
instead when both can work.
* `category': the buffer matches a category as a symbol if
the caller of `display-buffer' provides `(category . symbol)'
in its action argument.
* `category': when this function is called from `display-buffer',
the buffer matches if the caller of `display-buffer' provides
`(category . SYMBOL)' in its ACTION argument, and SYMBOL is `eq'
to the cons-cell's cdr.
* `not': the cadr is interpreted as a negation of a condition.
* `and': the cdr is a list of recursive conditions, that all have
to be met.

View file

@ -247,6 +247,8 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
(defvar libgnutls-version) ; gnutls.c
(defvar tree-sitter--library-abi) ; treesit.c
;;; Set default known names for external libraries
(setq dynamic-library-alist
(list
@ -313,8 +315,18 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
'(lcms2 "liblcms2-2.dll")
'(gccjit "libgccjit-0.dll")
;; MSYS2 distributes libtree-sitter.dll, without API version
;; number...
'(tree-sitter "libtree-sitter.dll" "libtree-sitter-0.dll")))
;; number, upto and including version 0.24.3-2; later versions
;; come with libtree-sitter-major.minor.dll (as in
;; libtree-sitter-0.24.dll). Sadly, the header files don't have
;; any symbols for library version, so we can only use the
;; library-language ABI version; according to
;; https://github.com/tree-sitter/tree-sitter/issues/3925, the
;; language ABI must change when the library's ABI is modified.
(if (<= tree-sitter--library-abi 14)
'(tree-sitter "libtree-sitter-0.24.dll"
"libtree-sitter.dll"
"libtree-sitter-0.dll")
'(tree-sitter "libtree-sitter-0.25.dll"))))
;;; multi-tty support
(defvar w32-initialized nil

View file

@ -818,9 +818,9 @@ or an empty string if none."
"RET" #'push-button)
(defconst vc-git-stash-shared-help
"\\<vc-git-stash-shared-map>\\[vc-git-stash]: Create named stash\n\\[vc-git-stash-snapshot]: Snapshot stash")
"\\<vc-git-stash-shared-map>\\[vc-git-stash]: Create named stash\n\\[vc-git-stash-snapshot]: Snapshot: stash from current tree")
(defconst vc-git-stash-list-help (concat "\\<vc-git-stash-map>mouse-3: Show stash menu\n\\[vc-git-stash-show-at-point], =: Show stash\n\\[vc-git-stash-apply-at-point]: Apply stash\n\\[vc-git-stash-pop-at-point]: Apply and remove stash (pop)\n\\[vc-git-stash-delete-at-point]: Delete stash\n"
(defconst vc-git-stash-list-help (concat "\\<vc-git-stash-map>mouse-3: Show stash menu\n\\[vc-git-stash-show-at-point], =: Show stash\n\\[vc-git-stash-apply-at-point]: Apply stash\n\\[vc-git-stash-pop-at-point]: Apply and remove stash (pop)\n\\[vc-git-stash-delete-at-point]: Delete (drop) stash\n"
vc-git-stash-shared-help))
(defun vc-git--make-button-text (show count1 count2)
@ -858,19 +858,19 @@ or an empty string if none."
(let ((map (make-sparse-keymap "Git Stash")))
(define-key map [sn]
'(menu-item "Snapshot Stash" vc-git-stash-snapshot
:help "Snapshot stash"))
:help "Create stash from the current tree state"))
(define-key map [cr]
'(menu-item "Create Named Stash" vc-git-stash
:help "Create named stash"))
(define-key map [de]
'(menu-item "Delete Stash" vc-git-stash-delete-at-point
:help "Delete the current stash"))
:help "Delete (drop) the current stash"))
(define-key map [ap]
'(menu-item "Apply Stash" vc-git-stash-apply-at-point
:help "Apply the current stash and keep it in the stash list"))
(define-key map [po]
'(menu-item "Apply and Remove Stash (Pop)" vc-git-stash-pop-at-point
:help "Apply the current stash and remove it"))
:help "Apply the current stash and remove it (pop)"))
(define-key map [sh]
'(menu-item "Show Stash" vc-git-stash-show-at-point
:help "Show the contents of the current stash"))

View file

@ -2309,7 +2309,7 @@ build_load_history (Lisp_Object filename, bool entire)
if (entire || !foundit)
{
Lisp_Object tem = Fnreverse (Vcurrent_load_list);
eassert (EQ (filename, Fcar (tem)));
eassert (!NILP (Fequal (filename, Fcar (tem))));
Vload_history = Fcons (tem, Vload_history);
/* FIXME: There should be an unbind_to right after calling us which
should re-establish the previous value of Vcurrent_load_list. */

View file

@ -4516,4 +4516,15 @@ applies to LANGUAGE-A will be redirected to LANGUAGE-B instead. */);
defsubr (&Streesit_subtree_stat);
#endif /* HAVE_TREE_SITTER */
defsubr (&Streesit_available_p);
#ifdef WINDOWSNT
DEFSYM (Qtree_sitter__library_abi, "tree-sitter--library-abi");
Fset (Qtree_sitter__library_abi,
#if HAVE_TREE_SITTER
make_fixnum (TREE_SITTER_LANGUAGE_VERSION)
#else
make_fixnum (-1)
#endif
);
#endif
}

View file

@ -114,6 +114,8 @@ CPU is as in `proced--assert-process-valid-cpu-refinement'."
(proced--assert-emacs-pid-in-buffer))))
(ert-deftest proced-refine-test ()
;; %CPU is not implemented on macOS
(skip-when (eq system-type 'darwin))
(proced--within-buffer
'verbose
'user
@ -127,6 +129,7 @@ CPU is as in `proced--assert-process-valid-cpu-refinement'."
(forward-line)))))
(ert-deftest proced-refine-with-update-test ()
(skip-when (eq system-type 'darwin))
(proced--within-buffer
'verbose
'user