[core] enable lexical binding for all

This commit is contained in:
Thanh 2022-03-25 15:41:32 -06:00 committed by Maxi Wolff
parent a69aba732a
commit dd1e077c5d
22 changed files with 52 additions and 54 deletions

View File

@ -1,4 +1,4 @@
;;; core-command-line.el --- Spacemacs Core File
;;; core-command-line.el --- Spacemacs Core File -*- lexical-binding: t -*-
;;
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
;;

View File

@ -1,4 +1,4 @@
;;; core-compilation.el --- Spacemacs Core File -*- no-byte-compile: t -*-
;;; core-compilation.el --- Spacemacs Core File -*- lexical-binding: t; no-byte-compile: t -*-
;;
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
;;

View File

@ -1,5 +1,4 @@
;; -*- nameless-current-name: "configuration-layer" -*-
;;; core-configuration-layer.el --- Spacemacs Core File
;;; core-configuration-layer.el --- Spacemacs Core File -*- lexical-binding: t -*-
;;
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
;;
@ -359,13 +358,6 @@ is ignored."
(when (configuration-layer/layer-used-p (car layers))
(car layers))))
(cl-defmethod cfgl-package-set-property ((pkg cfgl-package) slot value)
"Set SLOT to the given VALUE for the package PKG.
If `configuration-layer--package-properties-read-onlyp' is non-nil then VALUE
is not set for the given SLOT."
(unless configuration-layer--package-properties-read-onlyp
(eval `(oset pkg ,slot value))))
(defvar configuration-layer-elpa-archives nil
"List of ELPA archives required by Spacemacs. This value is set by the lock
file.")
@ -639,7 +631,7 @@ To prevent package from being installed or uninstalled set the variable
;; install used packages
(configuration-layer//filter-distant-packages
configuration-layer--used-packages t
'(not (oref pkg :lazy-install)))
(lambda (pkg) (not (oref pkg :lazy-install))))
;; also install all other packages if requested
(when (eq 'all dotspacemacs-install-packages)
(let (all-other-packages)
@ -849,15 +841,15 @@ a new object."
(null (oref obj :owners)))
(fboundp init-func))))
(when min-version
(cfgl-package-set-property obj :min-version
(oset obj :min-version
(version-to-list min-version)))
(when step
(cfgl-package-set-property obj :step step))
(oset obj :step step))
(when toggle
(cfgl-package-set-property obj :toggle toggle))
(oset obj :toggle toggle))
(when (and ownerp requires)
(cfgl-package-set-property obj :requires requires))
(cfgl-package-set-property obj :excluded
(oset obj :requires requires))
(oset obj :excluded
(and (configuration-layer/layer-used-p layer-name)
(or excluded (oref obj :excluded))))
(when location
@ -870,14 +862,14 @@ a new object."
(configuration-layer/get-layer-local-dir
layer-name)
pkg-name-str))))
(cfgl-package-set-property
(oset
obj :location `(recipe :fetcher file :path ,path))))
((eq 'dotfile layer-name) nil))
(cfgl-package-set-property obj :location location)))
(oset obj :location location)))
;; cannot override protected packages
(unless copyp
;; a bootstrap package is protected
(cfgl-package-set-property
(oset
obj :protected (or protected (eq 'bootstrap step)))
(when protected
(push pkg-name configuration-layer--protected-packages)))
@ -1242,7 +1234,7 @@ USEDP if non-nil indicates that made packages are used packages."
(unless obj
(setq obj (configuration-layer/make-package xpkg 'dotfile)))
(configuration-layer//add-package obj usedp)
(cfgl-package-set-property obj :excluded t))))
(oset obj :excluded t))))
(defun configuration-layer/lazy-install (layer-name &rest props)
"Configure auto-installation of layer with name LAYER-NAME."
@ -1270,7 +1262,7 @@ USEDP if non-nil indicates that made packages are used packages."
(oset layer :lazy-install lazy)
(dolist (pkg-name package-names)
(let ((pkg (configuration-layer/get-package pkg-name)))
(cfgl-package-set-property pkg :lazy-install lazy))))))
(oset pkg :lazy-install lazy))))))
;; configure `auto-mode-alist'
(dolist (x extensions)
(let ((ext (car x))
@ -1320,7 +1312,7 @@ PREDICATE is an additional expression that eval to a boolean."
(or (null usedp)
(cfgl-package-used-p pkg))
(or (null predicate)
(eval predicate)))
(funcall predicate pkg)))
(spacemacs-buffer/warning "Cannot find package for %s" x)
nil)))))
@ -1714,7 +1706,7 @@ RNAME is the name symbol of another existing layer."
(let ((pkg (configuration-layer/get-package x)))
(eq 'built-in (oref pkg :location)))))))))
(defun configuration-layer//install-package (pkg)
(defun configuration-layer//install-package (pkg pkg-name installed-count not-inst-count)
"Unconditionally install the package PKG."
(let* ((layer (when pkg (car (oref pkg :owners))))
(location (when pkg (oref pkg :location)))
@ -1722,24 +1714,28 @@ RNAME is the name symbol of another existing layer."
(spacemacs-buffer/replace-last-line
(format "--> installing %s: %s%s... [%s/%s]"
(if layer "package" "dependency")
pkg-name (if layer (format "@%S" layer) "")
installed-count not-inst-count) t)
pkg-name
(if layer (format "@%S" layer) "")
installed-count
not-inst-count)
t)
(spacemacs//redisplay)
(unless (package-installed-p pkg-name min-version)
(condition-case-unless-debug err
(cond
((or (null pkg) (eq 'elpa location))
(configuration-layer//install-from-elpa pkg-name)
(when pkg (cfgl-package-set-property pkg :lazy-install nil)))
(when pkg (oset pkg :lazy-install nil)))
((and (listp location) (eq 'recipe (car location)))
(configuration-layer//install-from-recipe pkg)
(cfgl-package-set-property pkg :lazy-install nil))
(oset pkg :lazy-install nil))
(t (configuration-layer//warning "Cannot install package %S."
pkg-name)))
('error
(configuration-layer//error
(concat "\nAn error occurred while installing %s "
"(error: %s)\n") pkg-name err)
(concat "\nAn error occurred while installing %s " "(error: %s)\n")
pkg-name
err)
(spacemacs//redisplay))))))
(defun configuration-layer//lazy-install-p (layer-name)
@ -1767,7 +1763,7 @@ RNAME is the name symbol of another existing layer."
(lambda (x)
(let* ((pkg-name (if (listp x) (car x) x))
(pkg (configuration-layer/get-package pkg-name)))
(cfgl-package-set-property pkg :lazy-install nil)
(oset pkg :lazy-install nil)
(when (cfgl-package-distant-p pkg)
pkg-name)))
(oref layer :packages)))))
@ -1811,13 +1807,13 @@ RNAME is the name symbol of another existing layer."
(let ((pkg (configuration-layer/get-package pkg-name)))
(when (and pkg (memq (oref pkg :step) '(bootstrap pre)))
(setq installed-count (1+ installed-count))
(configuration-layer//install-package pkg))))
(configuration-layer//install-package pkg pkg-name installed-count not-inst-count))))
;; then all other packages
(dolist (pkg-name upkg-names)
(let ((pkg (configuration-layer/get-package pkg-name)))
(unless (and pkg (memq (oref pkg :step) '(bootstrap pre)))
(setq installed-count (1+ installed-count))
(configuration-layer//install-package pkg))))
(configuration-layer//install-package pkg pkg-name installed-count not-inst-count))))
(spacemacs-buffer/append "\n")
(unless init-file-debug
;; get rid of all delayed warnings when byte-compiling packages
@ -1855,7 +1851,7 @@ RNAME is the name symbol of another existing layer."
pkg-name recipes-var))))
(defun configuration-layer//filter-packages-with-deps-recur
(pkg-names filter &optional use-archive)
(checked-packages pkg-names filter &optional use-archive)
"Return a filtered PKG-NAMES list where each elements satisfies FILTER."
(when pkg-names
(let (result)
@ -1870,6 +1866,7 @@ RNAME is the name symbol of another existing layer."
(configuration-layer//get-package-deps-from-alist pkg-name)))
(install-deps
(when deps (configuration-layer//filter-packages-with-deps-recur
checked-packages
(mapcar 'car deps) filter))))
(when install-deps
(setq result (append install-deps result))))
@ -1881,7 +1878,8 @@ RNAME is the name symbol of another existing layer."
(pkg-names filter &optional use-archive)
"Return a filtered PKG-NAMES list where each elements satisfies FILTER."
(let ((checked-packages))
(configuration-layer//filter-packages-with-deps-recur pkg-names filter use-archive)))
(configuration-layer//filter-packages-with-deps-recur
checked-packages pkg-names filter use-archive)))
(defun configuration-layer//get-uninstalled-packages (pkg-names)
"Return a filtered list of PKG-NAMES to install."

View File

@ -1,4 +1,4 @@
;;; core-custom-settings.el --- Spacemacs Core File
;;; core-custom-settings.el --- Spacemacs Core File -*- lexical-binding: t -*-
;;
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
;;

View File

@ -1,4 +1,4 @@
;;; core-display-init.el --- Spacemacs Core File
;;; core-display-init.el --- Spacemacs Core File -*- lexical-binding: t -*-
;;
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
;;

View File

@ -1,4 +1,4 @@
;;; core-spacemacs.el --- Spacemacs Core File
;;; core-spacemacs.el --- Spacemacs Core File -*- lexical-binding: t -*-
;;
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
;;

View File

@ -1,4 +1,4 @@
;;; core-dotspacemacs.el --- Spacemacs Core File
;;; core-dotspacemacs.el --- Spacemacs Core File -*- lexical-binding: t -*-
;;
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
;;

View File

@ -1,4 +1,4 @@
;;; core-early-funcs.el --- Spacemacs Core File
;;; core-early-funcs.el --- Spacemacs Core File -*- lexical-binding: t -*-
;;
;; This file is sourced by emacs early-init.el file.
;;

View File

@ -1,4 +1,4 @@
;;; core-emacs-backports.el --- Spacemacs Core File
;;; core-emacs-backports.el --- Spacemacs Core File -*- lexical-binding: t -*-
;;
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
;;

View File

@ -1,4 +1,4 @@
;;; core-env.el --- Spacemacs Core File
;;; core-env.el --- Spacemacs Core File -*- lexical-binding: t -*-
;;
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
;;

View File

@ -1,4 +1,4 @@
;;; core-fonts-support.el --- Spacemacs Core File
;;; core-fonts-support.el --- Spacemacs Core File -*- lexical-binding: t -*-
;;
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
;;

View File

@ -1,4 +1,4 @@
;;; core-funcs.el --- Spacemacs Core File
;;; core-funcs.el --- Spacemacs Core File -*- lexical-binding: t -*-
;;
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
;;

View File

@ -1,4 +1,4 @@
;;; core-hooks.el --- Spacemacs Core File
;;; core-hooks.el --- Spacemacs Core File -*- lexical-binding: t -*-
;;
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
;;

View File

@ -1,4 +1,4 @@
;;; core-jump.el --- Spacemacs Core File
;;; core-jump.el --- Spacemacs Core File -*- lexical-binding: t -*-
;;
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
;;

View File

@ -1,4 +1,4 @@
;;; core-keybindings.el --- Spacemacs Core File
;;; core-keybindings.el --- Spacemacs Core File -*- lexical-binding: t -*-
;;
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
;;

View File

@ -1,4 +1,4 @@
;;; core-progress-bar.el --- Spacemacs Core File
;;; core-progress-bar.el --- Spacemacs Core File -*- lexical-binding: t -*-
;;
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
;;

View File

@ -1,4 +1,4 @@
;;; core-spacemacs.el --- Spacemacs Core File
;;; core-spacemacs.el --- Spacemacs Core File -*- lexical-binding: t -*-
;;
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
;;

View File

@ -1,4 +1,4 @@
;;; core-spacemacs-buffer.el --- Spacemacs Core File
;;; core-spacemacs-buffer.el --- Spacemacs Core File -*- lexical-binding: t -*-
;;
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
;;

View File

@ -1,4 +1,4 @@
;;; core-spacemacs.el --- Spacemacs Core File
;;; core-spacemacs.el --- Spacemacs Core File -*- lexical-binding: t -*-
;;
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
;;

View File

@ -1,4 +1,4 @@
;;; core-themes-support.el --- Spacemacs Core File
;;; core-themes-support.el --- Spacemacs Core File -*- lexical-binding: t -*-
;;
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
;;

View File

@ -1,4 +1,4 @@
;;; core-toggle.el --- Spacemacs Core File
;;; core-toggle.el --- Spacemacs Core File -*- lexical-binding: t -*-
;;
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
;;

View File

@ -1,4 +1,4 @@
;;; core-use-package-ext.el --- Spacemacs Core File
;;; core-use-package-ext.el --- Spacemacs Core File -*- lexical-binding: t -*-
;;
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
;;