Merge remote-tracking branch 'origin/master' into feature/android

This commit is contained in:
Po Lu 2023-03-27 16:43:07 +08:00
commit 54d79f37ae
14 changed files with 132 additions and 50 deletions

View file

@ -6439,7 +6439,7 @@ case $opsys in
esac
case $opsys in
gnu-* | solaris )
gnu-* | solaris | cygwin )
dnl FIXME Can't we test if this exists (eg /proc/$$)?
AC_DEFINE([HAVE_PROCFS], [1], [Define if you have the /proc filesystem.])
;;

View file

@ -2349,18 +2349,19 @@ enabled separately in each buffer.
@defvar global-mode-string
This variable holds a mode line construct that, by default, appears in
the mode line just after the @code{which-function-mode} minor mode if
set, else after @code{mode-line-modes}. Elements that are added to
this construct should normally end in a space (to ensure that
consecutive @code{global-mode-string} elements display properly). For
instance, the command @code{display-time} sets
@code{global-mode-string} to refer to the variable
@code{display-time-string}, which holds a string containing the time
and load information.
the mode line as part of @code{mode-line-misc-info}, just after the
@code{which-function-mode} information if that minor mode is enabled,
else after @code{mode-line-modes}. Elements that are added to this
construct should normally end in a space (to ensure that consecutive
@code{global-mode-string} elements display properly). For instance,
the command @code{display-time} sets @code{global-mode-string} to
refer to the variable @code{display-time-string}, which holds a string
containing the time and load information.
The @samp{%M} construct substitutes the value of
@code{global-mode-string}, but that is obsolete, since the variable is
included in the mode line from @code{mode-line-format}.
@code{global-mode-string}. This construct is not used by the default
mode line, as the variable itself is used in
@code{mode-line-misc-info}.
@end defvar
Here is a simplified version of the default value of
@ -2389,6 +2390,7 @@ specifies addition of text properties.
@node %-Constructs
@subsection @code{%}-Constructs in the Mode Line
@cindex @code{%}-constructs in the mode line
Strings used as mode line constructs can use certain
@code{%}-constructs to substitute various kinds of data. The
@ -2440,6 +2442,10 @@ abbreviate.
The current line number of point, counting within the accessible portion
of the buffer.
@item %M
The value of @code{global-mode-string} (which is part of
@code{mode-line-misc-info} by default).
@item %n
@samp{Narrow} when narrowing is in effect; nothing otherwise (see
@code{narrow-to-region} in @ref{Narrowing}).
@ -2475,6 +2481,9 @@ The mnemonics of keyboard, terminal, and buffer coding systems.
@item %Z
Like @samp{%z}, but including the end-of-line format.
@item %&
@samp{*} if the buffer is modified, and @samp{-} otherwise.
@item %*
@samp{%} if the buffer is read only (see @code{buffer-read-only}); @*
@samp{*} if the buffer is modified (see @code{buffer-modified-p}); @*
@ -2486,9 +2495,6 @@ Like @samp{%z}, but including the end-of-line format.
@samp{-} otherwise. This differs from @samp{%*} only for a modified
read-only buffer. @xref{Buffer Modification}.
@item %&
@samp{*} if the buffer is modified, and @samp{-} otherwise.
@item %@@
@samp{@@} if the buffer's @code{default-directory} (@pxref{File Name
Expansion}) is on a remote machine, and @samp{-} otherwise.
@ -2510,13 +2516,16 @@ The character @samp{%}---this is how to include a literal @samp{%} in a
string in which @code{%}-constructs are allowed.
@end table
The following @code{%}-construct is still supported, but it is
obsolete, since you can get the same result using the variable
@code{mode-name}.
@subsubheading Obsolete @code{%}-Constructs
The following constructs should no longer be used.
@table @code
@item %m
The value of @code{mode-name}.
Obsolete; use the @code{mode-name} variable instead. The @code{%m}
construct is inadequate, as it produces an empty string if the value
of @code{mode-name} is a non-string mode-line construct (as in
@code{emacs-lisp-mode}, for example).
@end table
@node Properties in Mode

View file

@ -263,6 +263,14 @@ following to your init file:
(add-hook 'help-fns-describe-function-functions
#'shortdoc-help-fns-examples-function)
** Package
---
*** New user option 'package-vc-register-as-project'.
When non-nil, it will automatically register every package as a
project, that you can quickly select using 'project-switch-project'
('C-x p p').
* New Modes and Packages in Emacs 30.1

View file

@ -115,6 +115,11 @@ the `clone' function."
vc-handled-backends))
:version "29.1")
(defcustom package-vc-register-as-project t
"Non-nil means that packages should be registered as projects."
:type 'boolean
:version "30.1")
(defvar package-vc-selected-packages) ; pacify byte-compiler
;;;###autoload
@ -559,6 +564,8 @@ and return nil if it cannot reasonably guess."
(and url (alist-get url package-vc-heuristic-alist
nil nil #'string-match-p)))
(declare-function project-remember-projects-under "project" (dir &optional recursive))
(defun package-vc--clone (pkg-desc pkg-spec dir rev)
"Clone the package PKG-DESC whose spec is PKG-SPEC into the directory DIR.
REV specifies a specific revision to checkout. This overrides the `:branch'
@ -580,6 +587,11 @@ attribute in PKG-SPEC."
(or (and (not (eq rev :last-release)) rev) branch))
(error "Failed to clone %s from %s" name url))))
(when package-vc-register-as-project
(let ((default-directory dir))
(require 'project)
(project-remember-projects-under dir)))
;; Check out the latest release if requested
(when (eq rev :last-release)
(if-let ((release-rev (package-vc--release-rev pkg-desc)))

View file

@ -210,6 +210,20 @@ They are checked during start up via
tramp-gvfs-interface-mounttracker))
"The list of supported methods of the mount tracking interface.")
(defconst tramp-gvfs-listmountableinfo
(if (member "ListMountableInfo" tramp-gvfs-methods-mounttracker)
"ListMountableInfo"
"listMountableInfo")
"The name of the \"listMountableInfo\" method.
It has been changed in GVFS 1.14.")
(defconst tramp-gvfs-listmounttypes
(if (member "ListMountTypes" tramp-gvfs-methods-mounttracker)
"ListMountTypes"
"listMountTypes")
"The name of the \"listMountTypes\" method.
It has been changed in GVFS 1.14.")
(defconst tramp-gvfs-listmounts
(if (member "ListMounts" tramp-gvfs-methods-mounttracker)
"ListMounts"
@ -233,6 +247,12 @@ It has been changed in GVFS 1.14.")
It has been changed in GVFS 1.14.")
;; <interface name='org.gtk.vfs.MountTracker'>
;; <method name='listMountableInfo'>
;; <arg name='mountables' type='a(ssasib)' direction='out'/>
;; </method>
;; <method name='listMountTypes'>
;; <arg name='mount_types' type='as' direction='out'/>
;; </method>
;; <method name='listMounts'>
;; <arg name='mount_info_list'
;; type='a{sosssssbay{aya{say}}ay}'
@ -253,6 +273,13 @@ It has been changed in GVFS 1.14.")
;; </signal>
;; </interface>
;;
;; STRUCT mountable
;; STRING type
;; STRING scheme
;; ARRAY STRING scheme_aliases
;; INT32 default_port
;; BOOLEAN host_is_inet
;;
;; STRUCT mount_info
;; STRING dbus_id
;; OBJECT_PATH object_path
@ -2152,6 +2179,22 @@ connection if a previous connection has died for some reason."
(unless (tramp-connectable-p vec)
(throw 'non-essential 'non-essential))
;; Sanity check.
(let ((method (tramp-file-name-method vec)))
(unless (member
(or (rassoc method '(("smb" . "smb-share")
("davs" . "dav")
("nextcloud" . "dav")
("afp". "afp-volume")
("gdrive" . "google-drive")))
method)
(with-tramp-dbus-call-method vec t
:session tramp-gvfs-service-daemon
tramp-gvfs-path-mounttracker
tramp-gvfs-interface-mounttracker
tramp-gvfs-listmounttypes))
(tramp-error vec 'file-error "Method `%s' not supported by GVFS" method)))
;; For password handling, we need a process bound to the connection
;; buffer. Therefore, we create a dummy process. Maybe there is a
;; better solution?

View file

@ -322,7 +322,7 @@ PARENT is the same as other anchor functions."
;; nil.
parent (lambda (node)
(and node
(not (string-match "preproc" (treesit-node-type node)))
(not (string-search "preproc" (treesit-node-type node)))
(progn
(goto-char (treesit-node-start node))
(looking-back (rx bol (* whitespace))

View file

@ -255,9 +255,10 @@
(if (treesit-ready-p 'go)
(add-to-list 'auto-mode-alist '("\\.go\\'" . go-ts-mode)))
(defun go-ts-mode--defun-name (node)
(defun go-ts-mode--defun-name (node &optional skip-prefix)
"Return the defun name of NODE.
Return nil if there is no name or if NODE is not a defun node."
Return nil if there is no name or if NODE is not a defun node.
Methods are prefixed with the receiver name, unless SKIP-PREFIX is t."
(pcase (treesit-node-type node)
("function_declaration"
(treesit-node-text
@ -266,11 +267,10 @@ Return nil if there is no name or if NODE is not a defun node."
t))
("method_declaration"
(let* ((receiver-node (treesit-node-child-by-field-name node "receiver"))
(type-node (treesit-search-subtree receiver-node "type_identifier"))
(name-node (treesit-node-child-by-field-name node "name")))
(concat
"(" (treesit-node-text type-node) ")."
(treesit-node-text name-node))))
(receiver (treesit-node-text (treesit-search-subtree receiver-node "type_identifier")))
(method (treesit-node-text (treesit-node-child-by-field-name node "name"))))
(if skip-prefix method
(concat "(" receiver ")." method))))
("type_declaration"
(treesit-node-text
(treesit-node-child-by-field-name
@ -314,7 +314,7 @@ comment already exists, jump to it."
;; go to top comment line
(while (go-ts-mode--comment-on-previous-line-p)
(forward-line -1))
(insert "// " (treesit-defun-name defun-node))
(insert "// " (go-ts-mode--defun-name defun-node t))
(newline)
(backward-char))))

View file

@ -469,7 +469,7 @@ non-nil."
(let* (first-call )
(while (and parent
(setq first-call (treesit-node-parent parent))
(string-match-p "call" (treesit-node-type first-call)))
(string-search "call" (treesit-node-type first-call)))
(setq parent first-call))
(treesit-node-start (treesit-search-subtree parent "\\." nil t))))

View file

@ -1525,7 +1525,7 @@ The meanings of both arguments are the same as documented in
prompt))
(xref-backend-identifier-completion-table backend)
nil nil nil
'xref--read-identifier-history def)))
'xref--read-identifier-history def t)))
(if (equal id "")
(or def (user-error "There is no default identifier"))
id)))

View file

@ -1373,9 +1373,14 @@ Entry to this mode runs the hooks on `term-mode-hook'."
(interactive "e")
;; Give temporary modes such as isearch a chance to turn off.
(run-hooks 'mouse-leave-buffer-hook)
(setq this-command 'yank)
(mouse-set-point click)
(term-send-raw-string (gui-get-primary-selection)))
;; As we have moved point, bind `select-active-regions' to prevent
;; the `deactivate-mark' call in `term-send-raw-string' from
;; changing the primary selection (resulting in consecutive calls to
;; `term-mouse-paste' each sending different text). (bug#58608).
;; FIXME: Why does this command change point at all?
(let ((select-active-regions nil))
(term-send-raw-string (gui-get-primary-selection))))
(defun term-paste ()
"Insert the last stretch of killed text at point."

View file

@ -106,7 +106,7 @@ indent, imenu, etc."
;; 40MB for 64-bit systems, 15 for 32-bit.
(if (or (< most-positive-fixnum (* 2.0 1024 mb))
;; 32-bit system with wide ints.
(string-match-p "--with-wide-int" system-configuration-options))
(string-search "--with-wide-int" system-configuration-options))
(* 15 mb)
(* 40 mb)))
"Maximum buffer size (in bytes) for enabling tree-sitter parsing.
@ -3090,7 +3090,7 @@ function signals an error."
(with-temp-buffer
(insert-file-contents (find-library-name "treesit"))
(cl-remove-if
(lambda (name) (string-match "treesit--" name))
(lambda (name) (string-search "treesit--" name))
(cl-sort
(save-excursion
(goto-char (point-min))

View file

@ -5128,33 +5128,38 @@ A list whose car is an integer is processed by processing the cadr of
negative) to the width specified by that number.
A string is printed verbatim in the mode line except for %-constructs:
%b -- print buffer name. %f -- print visited file name.
%F -- print frame name.
%* -- print %, * or hyphen. %+ -- print *, % or hyphen.
%& is like %*, but ignore read-only-ness.
% means buffer is read-only and * means it is modified.
For a modified read-only buffer, %* gives % and %+ gives *.
%s -- print process status. %l -- print the current line number.
%b -- print buffer name.
%c -- print the current column number (this makes editing slower).
Columns are numbered starting from the left margin, and the
leftmost column is displayed as zero.
To make the column number update correctly in all cases,
`column-number-mode' must be non-nil.
`column-number-mode' must be non-nil.
%C -- Like %c, but the leftmost column is displayed as one.
%e -- print error message about full memory.
%f -- print visited file name.
%F -- print frame name.
%i -- print the size of the buffer.
%I -- like %i, but use k, M, G, etc., to abbreviate.
%l -- print the current line number.
%n -- print Narrow if appropriate.
%o -- print percent of window travel through buffer, or Top, Bot or All.
%p -- print percent of buffer above top of window, or Top, Bot or All.
%P -- print percent of buffer above bottom of window, perhaps plus Top,
or print Bottom or All.
%n -- print Narrow if appropriate.
%t -- visited file is text or binary (if OS supports this distinction).
%q -- print percent of buffer above both the top and the bottom of the
window, separated by -, or All.
%s -- print process status.
%z -- print mnemonics of keyboard, terminal, and buffer coding systems.
%Z -- like %z, but including the end-of-line format.
%e -- print error message about full memory.
%@ -- print @ or hyphen. @ means that default-directory is on a
remote machine.
%[ -- print one [ for each recursive editing level. %] similar.
%% -- print %. %- -- print infinitely many dashes.
%& -- print * if the buffer is modified, otherwise hyphen.
%+ -- print *, % or hyphen (modified, read-only, neither).
%* -- print %, * or hyphen (read-only, modified, neither).
For a modified read-only buffer, %+ prints * and %* prints %.
%@ -- print @ if default-directory is on a remote machine, else hyphen.
%[ -- print one [ for each recursive editing level.
%] -- print one ] for each recursive editing level.
%- -- print enough dashes to fill the mode line.
%% -- print %.
Decimal digits after the % specify field width to which to pad. */);
DEFVAR_PER_BUFFER ("major-mode", &BVAR (current_buffer, major_mode),

View file

@ -36624,7 +36624,7 @@ This is used for internal purposes. */);
Vinhibit_redisplay = Qnil;
DEFVAR_LISP ("global-mode-string", Vglobal_mode_string,
doc: /* String (or mode line construct) included (normally) in `mode-line-format'. */);
doc: /* String (or mode line construct) included (normally) in `mode-line-misc-info'. */);
Vglobal_mode_string = Qnil;
DEFVAR_LISP ("overlay-arrow-position", Voverlay_arrow_position,

View file

@ -64,7 +64,7 @@ FROM emacs-base as emacs-eglot
RUN apt-get update && \
apt-get install -y --no-install-recommends -o=Dpkg::Use-Pty=0 \
snapd wget \
snapd wget lsb_release add-apt-repository gpg \
&& rm -rf /var/lib/apt/lists/*
# A recent clangd. It must be at least clangd 14, which is in Debian