aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2023-03-20 06:30:30 +0100
committerStefan Kangas2023-03-20 06:30:30 +0100
commitc194a31fc4581125afa202e1641e3f2f54cd98bd (patch)
tree4400a703f7fcc8210ab16431dbd137ebe6d3aa21
parent32bfeaf007046b8cdba2dd5aa5f5a556652ccb23 (diff)
parent028f11027384b6fb6807ea4057073e3be4003e9e (diff)
downloademacs-c194a31fc4581125afa202e1641e3f2f54cd98bd.tar.gz
emacs-c194a31fc4581125afa202e1641e3f2f54cd98bd.zip
Merge from origin/emacs-29
028f1102738 Fix quoting of font-family in 'hfy-family' 4cb8a850b08 ; Tweak doc/misc/eglot.texi d5d4959ed7d Document how to construct JSONRPC arrays in Eglot manual 078cf512eef * test/infra/Dockerfile.emba: Use debian:bullseye. 61adb44318a * configure.ac: Fix native comp compatibility check (bug#... d814c249f44 * test/infra/Dockerfile.emba: Install clangd. 27edd7f88cb Remove 'package-vc--query-spec' 39fea115515 Do not store :lisp-dir in package descriptors 168165178f3 Use 'package-vc-selected-packages' to store package specs
-rw-r--r--configure.ac4
-rw-r--r--doc/emacs/package.texi23
-rw-r--r--doc/misc/eglot.texi30
-rw-r--r--lisp/emacs-lisp/package-vc.el68
-rw-r--r--lisp/htmlfontify.el4
-rw-r--r--test/infra/Dockerfile.emba5
6 files changed, 55 insertions, 79 deletions
diff --git a/configure.ac b/configure.ac
index 25afe3a6981..c5300beb2ba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4289,8 +4289,8 @@ If you really want to try it anyway, use the configure option
4289fi 4289fi
4290 4290
4291if test "${with_native_compilation}" != "no"; then 4291if test "${with_native_compilation}" != "no"; then
4292 if test "${HAVE_PDUMPER}" = no; then 4292 if test "$with_unexec" = yes; then
4293 AC_MSG_ERROR(['--with-native-compilation' requires '--with-dumping=pdumper']) 4293 AC_MSG_ERROR(['--with-native-compilation' is not compatible with unexec])
4294 fi 4294 fi
4295 if test "${HAVE_ZLIB}" = no; then 4295 if test "${HAVE_ZLIB}" = no; then
4296 AC_MSG_ERROR(['--with-native-compilation' requires zlib]) 4296 AC_MSG_ERROR(['--with-native-compilation' requires zlib])
diff --git a/doc/emacs/package.texi b/doc/emacs/package.texi
index d993b7b071f..7a2bc11d03c 100644
--- a/doc/emacs/package.texi
+++ b/doc/emacs/package.texi
@@ -558,29 +558,6 @@ regular package listing. If you just wish to clone the source of a
558package, without adding it to the package list, use 558package, without adding it to the package list, use
559@code{package-vc-checkout}. 559@code{package-vc-checkout}.
560 560
561@vindex package-vc-selected-packages
562@findex package-vc-install-selected-packages
563 An alternative way to use @code{package-vc-install} is via the
564@code{package-vc-selected-packages} user option. This is an alist of
565packages to install, where each key is a package name and the value is
566@code{nil}, indicating that any revision is to install, a string,
567indicating a specific revision or a package specification plist. The
568side effect of setting the user option is to install the package, but
569the process can also be manually triggered using the function
570@code{package-vc-install-selected-packages}. Here is an example of
571how the user option:
572
573@example
574@group
575(setopt package-vc-selected-packages
576 '((modus-themes . "0f39eb3fd9") ;specific revision
577 (auctex . nil) ;any revision
578 (foo ;a package specification
579 :url "https://git.sv.gnu.org/r/foo-mode.git"
580 :branch "trunk")))
581@end group
582@end example
583
584@findex package-report-bug 561@findex package-report-bug
585@findex package-vc-prepare-patch 562@findex package-vc-prepare-patch
586 With the source checkout, you might want to reproduce a bug against 563 With the source checkout, you might want to reproduce a bug against
diff --git a/doc/misc/eglot.texi b/doc/misc/eglot.texi
index 735da5f0163..85f83ee4b26 100644
--- a/doc/misc/eglot.texi
+++ b/doc/misc/eglot.texi
@@ -977,9 +977,9 @@ facilities.
977 977
978Though many language servers work well out-of-the-box, most allow 978Though many language servers work well out-of-the-box, most allow
979fine-grained control of their operation via specific configuration 979fine-grained control of their operation via specific configuration
980options that vary from server to server. A small number of servers 980options that are transmitted over the LSP protocol and vary from
981require such special configuration to work acceptably, or even to work 981server to server. A small number of servers require such special
982at all. 982configuration to work acceptably, or even to work at all.
983 983
984After having setup a server executable program in 984After having setup a server executable program in
985@code{eglot-server-programs} (@pxref{Setting Up LSP Servers}) and 985@code{eglot-server-programs} (@pxref{Setting Up LSP Servers}) and
@@ -1016,8 +1016,9 @@ server reads the file @file{~/.config/pycodestyle} for user
1016configuration. The @command{clangd} C/C++ server reads both 1016configuration. The @command{clangd} C/C++ server reads both
1017@file{~/.config/clangd/config.yaml} for user configuration and 1017@file{~/.config/clangd/config.yaml} for user configuration and
1018@file{.clangd} for project configuration. It may be advantageous to 1018@file{.clangd} for project configuration. It may be advantageous to
1019use these mechanisms instead of Eglot's, as the latter have the 1019use these mechanisms instead of Eglot's, as this will probably work
1020advantage of working with other LSP clients. 1020with other LSP clients and may be easier to debug than options riding
1021on the LSP wire.
1021 1022
1022@node Project-specific configuration 1023@node Project-specific configuration
1023@section Project-specific configuration 1024@section Project-specific configuration
@@ -1201,7 +1202,7 @@ the LSP handshake. This is done using the
1201The argument @code{(:compilationDatabasePath "/tmp")} is Emacs's 1202The argument @code{(:compilationDatabasePath "/tmp")} is Emacs's
1202representation in plist format of a simple JSON object 1203representation in plist format of a simple JSON object
1203@code{@{"compilationDatabasePath": "/tmp"@}}. To learn how to 1204@code{@{"compilationDatabasePath": "/tmp"@}}. To learn how to
1204represent more deeply nested options in this format, @xref{JSONRPC 1205represent more deeply nested options in this format, @pxref{JSONRPC
1205objects in Elisp}. 1206objects in Elisp}.
1206 1207
1207In this case, the two examples achieve exactly the same, but notice 1208In this case, the two examples achieve exactly the same, but notice
@@ -1214,7 +1215,7 @@ supported. It consists of @emph{globally} setting
1214@code{eglot-workspace-configuration}, a variable originally intended 1215@code{eglot-workspace-configuration}, a variable originally intended
1215for project-specific configuration. This has the same effect as 1216for project-specific configuration. This has the same effect as
1216giving all your projects a certain default configuration, as described 1217giving all your projects a certain default configuration, as described
1217in @xref{Project-specific configuration}. Here is an example. 1218in @ref{Project-specific configuration}. Here is an example:
1218 1219
1219@lisp 1220@lisp
1220(setq-default eglot-workspace-configuration 1221(setq-default eglot-workspace-configuration
@@ -1241,17 +1242,21 @@ keyword-value property sub-plists corresponding to JSON sub-objects.
1241For representing the JSON leaf values @code{true}, @code{false}, 1242For representing the JSON leaf values @code{true}, @code{false},
1242@code{null} and @code{@{@}}, you can use the Lisp values @code{t}, 1243@code{null} and @code{@{@}}, you can use the Lisp values @code{t},
1243@code{:json-false}, @code{nil}, and @code{eglot-@{@}}, respectively. 1244@code{:json-false}, @code{nil}, and @code{eglot-@{@}}, respectively.
1245JSON arrays are represented as Elisp vectors surrounded by square brackets
1246(@pxref{Vectors,,,elisp,GNU Emacs Lisp Reference Manual}).
1244 1247
1245For example, this plist: 1248For example, the plist
1246 1249
1247@lisp 1250@lisp
1248(:pylsp (:plugins (:jedi_completion (:include_params t 1251(:pylsp (:plugins (:jedi_completion (:include_params t
1249 :fuzzy t) 1252 :fuzzy t
1250 :pylint (:enabled :json-false))) 1253 :cache_for ["pandas" "numpy"]
1254 :pylint (:enabled :json-false))))
1251 :gopls (:usePlaceholders t)) 1255 :gopls (:usePlaceholders t))
1252@end lisp 1256@end lisp
1253 1257
1254Is serialized by Eglot to the following JSON text: 1258@noindent
1259is serialized by Eglot to the following JSON text:
1255 1260
1256@example 1261@example
1257@{ 1262@{
@@ -1259,7 +1264,8 @@ Is serialized by Eglot to the following JSON text:
1259 "plugins": @{ 1264 "plugins": @{
1260 "jedi_completion": @{ 1265 "jedi_completion": @{
1261 "include_params": true, 1266 "include_params": true,
1262 "fuzzy": true 1267 "fuzzy": true,
1268 "cache_for": [ "pandas", "numpy" ],
1263 @}, 1269 @},
1264 "pylint": @{ 1270 "pylint": @{
1265 "enabled": false 1271 "enabled": false
diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index ea2766b8dc4..253b35f1f1a 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -48,7 +48,6 @@
48;;; Code: 48;;; Code:
49 49
50(eval-when-compile (require 'rx)) 50(eval-when-compile (require 'rx))
51(eval-when-compile (require 'inline))
52(eval-when-compile (require 'map)) 51(eval-when-compile (require 'map))
53(eval-when-compile (require 'cl-lib)) 52(eval-when-compile (require 'cl-lib))
54(require 'package) 53(require 'package)
@@ -139,7 +138,6 @@ the `clone' function."
139 (package-desc-create :name name :kind 'vc)) 138 (package-desc-create :name name :kind 'vc))
140 spec))))))) 139 spec)))))))
141 140
142;;;###autoload
143(defcustom package-vc-selected-packages '() 141(defcustom package-vc-selected-packages '()
144 "List of packages that must be installed. 142 "List of packages that must be installed.
145Each member of the list is of the form (NAME . SPEC), where NAME 143Each member of the list is of the form (NAME . SPEC), where NAME
@@ -174,13 +172,9 @@ is a symbol designating the package and SPEC is one of:
174 172
175 All other keys are ignored. 173 All other keys are ignored.
176 174
177This user option differs from `package-selected-packages' in that 175This user option will be automatically updated to store package
178it is meant to be specified manually. If you want to install all 176specifications for packages that are not specified in any
179the packages in the list, you cal also use 177archive."
180`package-vc-install-selected-packages'.
181
182Note that this option will not override an existing source
183package installation or revert the checked out revision."
184 :type '(alist :tag "List of packages you want to be installed" 178 :type '(alist :tag "List of packages you want to be installed"
185 :key-type (symbol :tag "Package") 179 :key-type (symbol :tag "Package")
186 :value-type 180 :value-type
@@ -191,10 +185,6 @@ package installation or revert the checked out revision."
191 (:lisp-dir string) 185 (:lisp-dir string)
192 (:main-file string) 186 (:main-file string)
193 (:vc-backend symbol))))) 187 (:vc-backend symbol)))))
194 :initialize #'custom-initialize-default
195 :set (lambda (sym val)
196 (custom-set-default sym val)
197 (package-vc-install-selected-packages))
198 :version "29.1") 188 :version "29.1")
199 189
200(defvar package-vc--archive-spec-alist nil 190(defvar package-vc--archive-spec-alist nil
@@ -224,19 +214,17 @@ All other values are ignored.")
224The optional argument NAME can be used to override the default 214The optional argument NAME can be used to override the default
225name for PKG-DESC." 215name for PKG-DESC."
226 (alist-get 216 (alist-get
227 (or name (package-desc-name pkg-desc)) 217 (setq name (or name (package-desc-name pkg-desc)))
228 (if (package-desc-archive pkg-desc) 218 (if (and (package-desc-archive pkg-desc)
219 (not (alist-get name package-vc-selected-packages
220 nil nil #'string=)))
229 (alist-get (intern (package-desc-archive pkg-desc)) 221 (alist-get (intern (package-desc-archive pkg-desc))
230 package-vc--archive-spec-alist) 222 package-vc--archive-spec-alist)
231 (apply #'append (mapcar #'cdr package-vc--archive-spec-alist))) 223 ;; Consult both our local list of package specifications, as well
232 nil nil #'string=)) 224 ;; as the lists provided by the archives.
233 225 (apply #'append (cons package-vc-selected-packages
234(define-inline package-vc--query-spec (pkg-desc prop) 226 (mapcar #'cdr package-vc--archive-spec-alist))))
235 "Query the property PROP for the package specification of PKG-DESC. 227 '() nil #'string=))
236If no package specification can be determined, the function will
237return nil."
238 (inline-letevals (pkg-desc prop)
239 (inline-quote (plist-get (package-vc--desc->spec ,pkg-desc) ,prop))))
240 228
241(defun package-vc--read-archive-data (archive) 229(defun package-vc--read-archive-data (archive)
242 "Update `package-vc--archive-spec-alist' for ARCHIVE. 230 "Update `package-vc--archive-spec-alist' for ARCHIVE.
@@ -309,12 +297,11 @@ asynchronously."
309 (directory (file-name-concat 297 (directory (file-name-concat
310 (or (package-desc-dir pkg-desc) 298 (or (package-desc-dir pkg-desc)
311 (expand-file-name name package-user-dir)) 299 (expand-file-name name package-user-dir))
312 (and-let* ((extras (package-desc-extras pkg-desc))) 300 (plist-get pkg-spec :lisp-dir)))
313 (alist-get :lisp-dir extras)))) 301 (file (expand-file-name
314 (file (or (plist-get pkg-spec :main-file) 302 (or (plist-get pkg-spec :main-file)
315 (expand-file-name 303 (concat name ".el"))
316 (concat name ".el") 304 directory)))
317 directory))))
318 (if (file-exists-p file) file 305 (if (file-exists-p file) file
319 ;; The following heuristic is only necessary when fetching a 306 ;; The following heuristic is only necessary when fetching a
320 ;; repository with URL that would break the above assumptions. 307 ;; repository with URL that would break the above assumptions.
@@ -495,12 +482,12 @@ documentation and marking the package as installed."
495 missing))) 482 missing)))
496 483
497 (let ((default-directory (file-name-as-directory pkg-dir)) 484 (let ((default-directory (file-name-as-directory pkg-dir))
498 (pkg-file (expand-file-name (package--description-file pkg-dir) pkg-dir))) 485 (pkg-file (expand-file-name (package--description-file pkg-dir) pkg-dir))
486 (pkg-spec (package-vc--desc->spec pkg-desc)))
499 ;; Generate autoloads 487 ;; Generate autoloads
500 (let* ((name (package-desc-name pkg-desc)) 488 (let* ((name (package-desc-name pkg-desc))
501 (auto-name (format "%s-autoloads.el" name)) 489 (auto-name (format "%s-autoloads.el" name))
502 (extras (package-desc-extras pkg-desc)) 490 (lisp-dir (plist-get pkg-spec :lisp-dir)))
503 (lisp-dir (alist-get :lisp-dir extras)))
504 (package-generate-autoloads 491 (package-generate-autoloads
505 name (file-name-concat pkg-dir lisp-dir)) 492 name (file-name-concat pkg-dir lisp-dir))
506 (when lisp-dir 493 (when lisp-dir
@@ -520,8 +507,7 @@ documentation and marking the package as installed."
520 (package-vc--generate-description-file pkg-desc pkg-file) 507 (package-vc--generate-description-file pkg-desc pkg-file)
521 508
522 ;; Detect a manual 509 ;; Detect a manual
523 (when-let ((pkg-spec (package-vc--desc->spec pkg-desc)) 510 (when (executable-find "install-info")
524 ((executable-find "install-info")))
525 (dolist (doc-file (ensure-list (plist-get pkg-spec :doc))) 511 (dolist (doc-file (ensure-list (plist-get pkg-spec :doc)))
526 (package-vc--build-documentation pkg-desc doc-file)))) 512 (package-vc--build-documentation pkg-desc doc-file))))
527 513
@@ -584,7 +570,6 @@ attribute in PKG-SPEC."
584 (unless (file-exists-p dir) 570 (unless (file-exists-p dir)
585 (make-directory (file-name-directory dir) t) 571 (make-directory (file-name-directory dir) t)
586 (let ((backend (or (plist-get pkg-spec :vc-backend) 572 (let ((backend (or (plist-get pkg-spec :vc-backend)
587 (package-vc--query-spec pkg-desc :vc-backend)
588 (package-vc--guess-backend url) 573 (package-vc--guess-backend url)
589 (plist-get (alist-get (package-desc-archive pkg-desc) 574 (plist-get (alist-get (package-desc-archive pkg-desc)
590 package-vc--archive-data-alist 575 package-vc--archive-data-alist
@@ -659,9 +644,14 @@ abort installation?" name))
659 ;; file system or between installations. 644 ;; file system or between installations.
660 (throw 'done (setq lisp-dir name))))) 645 (throw 'done (setq lisp-dir name)))))
661 646
662 (when lisp-dir 647 ;; Ensure we have a copy of the package specification
663 (push (cons :lisp-dir lisp-dir) 648 (unless (equal (alist-get name (mapcar #'cdr package-vc--archive-spec-alist)) pkg-spec)
664 (package-desc-extras pkg-desc))) 649 (customize-save-variable
650 'package-vc-selected-packages
651 (cons (cons name pkg-spec)
652 (seq-remove (lambda (spec) (string= name (car spec)))
653 package-vc-selected-packages))))
654
665 (package-vc--unpack-1 pkg-desc pkg-dir))) 655 (package-vc--unpack-1 pkg-desc pkg-dir)))
666 656
667(defun package-vc--read-package-name (prompt &optional allow-url installed) 657(defun package-vc--read-package-name (prompt &optional allow-url installed)
diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el
index 1ab33cc6411..f0e38242e48 100644
--- a/lisp/htmlfontify.el
+++ b/lisp/htmlfontify.el
@@ -757,7 +757,9 @@ may happen."
757 255)) 757 255))
758 '(0 1 2)))))) 758 '(0 1 2))))))
759 759
760(defun hfy-family (family) (list (cons "font-family" family))) 760(defun hfy-family (family)
761 (list (cons "font-family"
762 (format "\"%s\"" (string-replace "\"" "\\\\\"" family)))))
761(defun hfy-bgcol (color) (list (cons "background" (hfy-triplet color)))) 763(defun hfy-bgcol (color) (list (cons "background" (hfy-triplet color))))
762(defun hfy-color (color) (list (cons "color" (hfy-triplet color)))) 764(defun hfy-color (color) (list (cons "color" (hfy-triplet color))))
763(define-obsolete-function-alias 'hfy-colour #'hfy-color "27.1") 765(define-obsolete-function-alias 'hfy-colour #'hfy-color "27.1")
diff --git a/test/infra/Dockerfile.emba b/test/infra/Dockerfile.emba
index c005d872cb8..872591333e6 100644
--- a/test/infra/Dockerfile.emba
+++ b/test/infra/Dockerfile.emba
@@ -24,7 +24,7 @@
24# Maintainer: Ted Zlatanov <tzz@lifelogs.com> 24# Maintainer: Ted Zlatanov <tzz@lifelogs.com>
25# URL: https://emba.gnu.org/emacs/emacs 25# URL: https://emba.gnu.org/emacs/emacs
26 26
27FROM debian:stretch as emacs-base 27FROM debian:bullseye as emacs-base
28 28
29RUN apt-get update && \ 29RUN apt-get update && \
30 apt-get install -y --no-install-recommends -o=Dpkg::Use-Pty=0 \ 30 apt-get install -y --no-install-recommends -o=Dpkg::Use-Pty=0 \
@@ -34,9 +34,10 @@ RUN apt-get update && \
34 34
35FROM emacs-base as emacs-inotify 35FROM emacs-base as emacs-inotify
36 36
37# We install clangd for Eglot tests.
37RUN apt-get update && \ 38RUN apt-get update && \
38 apt-get install -y --no-install-recommends -o=Dpkg::Use-Pty=0 \ 39 apt-get install -y --no-install-recommends -o=Dpkg::Use-Pty=0 \
39 inotify-tools \ 40 inotify-tools clangd \
40 && rm -rf /var/lib/apt/lists/* 41 && rm -rf /var/lib/apt/lists/*
41 42
42COPY . /checkout 43COPY . /checkout