diff --git a/emacs.d/custom.el b/emacs.d/custom.el index 0644ea7..70e9132 100644 --- a/emacs.d/custom.el +++ b/emacs.d/custom.el @@ -4,7 +4,7 @@ ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(package-selected-packages - '(py-isort lsp-python-ms helm-lsp go-mode company projectile helm adoc-mode csv-mode php-mode python-black cython-mode scss-mode vue-mode tide rust-mode company-auctex tex-site auctex sphinx-doc company-lsp lsp-ui lsp-mode ws-butler use-package smartparens pip-requirements osx-clipboard monokai-theme markdown-mode helm-projectile helm-ag godoctor go-guru go-eldoc go-autocomplete flycheck-gometalinter doom-modeline dockerfile-mode docker-compose-mode diminish company-go company-anaconda))) + '(py-isort flycheck lsp-python-ms helm-lsp go-mode company projectile helm adoc-mode csv-mode php-mode python-black cython-mode scss-mode vue-mode tide rust-mode company-auctex tex-site auctex sphinx-doc company-lsp lsp-ui lsp-mode ws-butler use-package smartparens pip-requirements osx-clipboard monokai-theme markdown-mode helm-projectile helm-ag godoctor go-guru go-eldoc go-autocomplete flycheck-gometalinter doom-modeline dockerfile-mode docker-compose-mode diminish company-go company-anaconda))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. diff --git a/emacs.d/init.el b/emacs.d/init.el index 52ab2a8..786f6d2 100644 --- a/emacs.d/init.el +++ b/emacs.d/init.el @@ -1,3 +1,11 @@ +;; https://github.com/kiwanami/emacs-epc/issues/35#issuecomment-756701267 +(setq byte-compile-warnings '(cl-functions)) + +;; Fix for emacs 28.0.50 changing `define-obsolete-function-alias` +;; https://www.reddit.com/r/emacs/comments/kqb9s9/cannot_recompile_packagess_error_wrong_number_of/gj3cfn3/?utm_source=reddit&utm_medium=web2x&context=3 +(load "~/.emacs.d/vendor/emacs_27_obsolete") + + ;; -- Startup optimizations -- ;; The below will increase the GC limits and remove the file name regex checker ;; for 5 seconds. This helps reduce the number of GC calls and the total time spent diff --git a/emacs.d/use-package/.travis.yml b/emacs.d/use-package/.travis.yml index 2c8f3ab..9928239 100644 --- a/emacs.d/use-package/.travis.yml +++ b/emacs.d/use-package/.travis.yml @@ -15,11 +15,12 @@ install: - tar xf emacs-bin-${EMACS_VERSION}.tar.gz -C / - export EMACS=/tmp/emacs/bin/emacs - $EMACS --version -dist: trusty +dist: bionic addons: apt: packages: - texinfo + - libgnutls30 script: - make - make test diff --git a/emacs.d/use-package/NEWS.md b/emacs.d/use-package/NEWS.md index 3b39c01..1f51696 100644 --- a/emacs.d/use-package/NEWS.md +++ b/emacs.d/use-package/NEWS.md @@ -1,5 +1,88 @@ # Changes +## 2.4.1 + +This is mostly a bug-fix release: + +- Update the documentation for :custom as per #850 + +- Fix broken test due to #850 + +- better tests + +- add test for #845 + +- Support keymap symbol in bind-key. Fix #845 + +- use-package-core.el: use the Emacs set-default function to avoid saving :custom vars twice + +- Fix Travis + +- typo, should be a vector, not a bytecode object + + Solves https://github.com/jwiegley/use-package/issues/842 + +- Add special value back again, in case needed for backwards compat + + I don't know why this special value exists, but perhaps old client code uses it. + + The additional `t' in the macro expansion is accidental but not harmful I guess. + +- Even when there's no :config, run any pre/post config hooks + + i.e., following the existing docs for use-package-inject-hooks, these hooks are + run: + + use-package--foo--pre-config-hook + use-package--foo--post-config-hook + + This should make config customisations more predictable (for example, spacemacs + uses these hooks extensively to allow 'layers' to be customised). + + I got rid of the "special" default value for :config, because it doesn't seem to + be treated any differently than nil. + + Fixes #785 + +- Clarify the documentation for :after + +- add table of contents to README + +- Fix typos + + Typos found with codespell. + +- Fix typos + +- Attempt to explain omit "-hook" better + +- Update tests + +- Switch from `require' to `load' + `featurep' + +- Use `require', not `load', when byte-compiling + +- Make custom-face evaluate elisp. + + Fix #696. + +- Add a line of documentation for (use-pacakage ... :hook). + +- Fix typo in README + +- Fix documentation for defer + +- Add no-query option for pdf-tools-install + +- Fix typo in README + +- Fix all notes in README + +- Mention use-package-ensure in README + + Without requiring `use-package-ensure`, setting `use-package-always-ensure` + did not actually work for me. + ## 2.4 ### Breaking changes diff --git a/emacs.d/use-package/README.md b/emacs.d/use-package/README.md index 3f26dda..15f3d4b 100644 --- a/emacs.d/use-package/README.md +++ b/emacs.d/use-package/README.md @@ -376,8 +376,12 @@ The documentation string is not mandatory. **NOTE**: these are only for people who wish to keep customizations with their accompanying use-package declarations. Functionally, the only benefit over using `setq` in a `:config` block is that customizations might execute code -when values are assigned. If you currently use `M-x customize-option` and save -to a settings file, you do not want to use this option. +when values are assigned. + +**NOTE**: The customized values are **not** saved in the Emacs `custom-file`. +Thus you should either use the `:custom` option **or** you should use `M-x +customize-option` which will save customized values in the Emacs `custom-file`. +Do not use both. ### Customizing faces diff --git a/emacs.d/use-package/bind-key.el b/emacs.d/use-package/bind-key.el index 01e1d4d..fef2374 100644 --- a/emacs.d/use-package/bind-key.el +++ b/emacs.d/use-package/bind-key.el @@ -154,11 +154,13 @@ spelled-out keystrokes, e.g., \"C-c C-z\". See documentation of COMMAND must be an interactive function or lambda form. -KEYMAP, if present, should be a keymap and not a quoted symbol. +KEYMAP, if present, should be a keymap variable or symbol. For example: (bind-key \"M-h\" #'some-interactive-function my-mode-map) + (bind-key \"M-h\" #'some-interactive-function 'my-mode-map) + If PREDICATE is non-nil, it is a form evaluated to determine when a key should be bound. It must return non-nil in such cases. Emacs can evaluate this form at any time that it does redisplay @@ -171,10 +173,11 @@ can safely be called at any time." `(let* ((,namevar ,key-name) (,keyvar (if (vectorp ,namevar) ,namevar (read-kbd-macro ,namevar))) + (kmap (if (and ,keymap (symbolp ,keymap)) (symbol-value ,keymap) ,keymap)) (,kdescvar (cons (if (stringp ,namevar) ,namevar (key-description ,namevar)) - (quote ,keymap))) - (,bindingvar (lookup-key (or ,keymap global-map) ,keyvar))) + (if (symbolp ,keymap) ,keymap (quote ,keymap)))) + (,bindingvar (lookup-key (or kmap global-map) ,keyvar))) (let ((entry (assoc ,kdescvar personal-keybindings)) (details (list ,command (unless (numberp ,bindingvar) @@ -183,11 +186,11 @@ can safely be called at any time." (setcdr entry details) (add-to-list 'personal-keybindings (cons ,kdescvar details)))) ,(if predicate - `(define-key (or ,keymap global-map) ,keyvar + `(define-key (or kmap global-map) ,keyvar '(menu-item "" nil :filter (lambda (&optional _) (when ,predicate ,command)))) - `(define-key (or ,keymap global-map) ,keyvar ,command))))) + `(define-key (or kmap global-map) ,keyvar ,command))))) ;;;###autoload (defmacro unbind-key (key-name &optional keymap) diff --git a/emacs.d/use-package/default.mk b/emacs.d/use-package/default.mk index 5b25721..b7ef111 100644 --- a/emacs.d/use-package/default.mk +++ b/emacs.d/use-package/default.mk @@ -63,9 +63,9 @@ ELGS = ## Versions ########################################################## -VERSION = 2.4 +VERSION = 2.4.1 -USE_PACKAGE_VERSION = 2.4 +USE_PACKAGE_VERSION = 2.4.1 EMACS_VERSION = 24.3 diff --git a/emacs.d/use-package/use-package-core.el b/emacs.d/use-package/use-package-core.el index e81e229..cd5b907 100644 --- a/emacs.d/use-package/use-package-core.el +++ b/emacs.d/use-package/use-package-core.el @@ -6,7 +6,7 @@ ;; Maintainer: John Wiegley ;; Created: 17 Jun 2012 ;; Modified: 29 Nov 2017 -;; Version: 2.4 +;; Version: 2.4.1 ;; Package-Requires: ((emacs "24.3")) ;; Keywords: dotemacs startup speed config package ;; URL: https://github.com/jwiegley/use-package @@ -56,7 +56,7 @@ "A use-package declaration for simplifying your `.emacs'." :group 'startup) -(defconst use-package-version "2.4" +(defconst use-package-version "2.4.1" "This version of use-package.") (defcustom use-package-keywords @@ -1394,7 +1394,9 @@ no keyword implies `:all'." (comment (nth 2 def))) (unless (and comment (stringp comment)) (setq comment (format "Customized with use-package %s" name))) - `(customize-set-variable (quote ,variable) ,value ,comment))) + `(funcall (or (get (quote ,variable) 'custom-set) #'set-default) + (quote ,variable) + ,value))) args) (use-package-process-keywords name rest state))) @@ -1561,7 +1563,9 @@ this file. Usage: :load-path Add to the `load-path' before attempting to load the package. :diminish Support for diminish.el (if installed). :delight Support for delight.el (if installed). -:custom Call `customize-set-variable' with each variable definition. +:custom Call `custom-set' or `set-default' with each variable + definition without modifying the Emacs `custom-file'. + (compare with `custom-set-variables'). :custom-face Call `customize-set-faces' with each face definition. :ensure Loads the package using package.el if necessary. :pin Pin the package to an archive." diff --git a/emacs.d/use-package/use-package-tests.el b/emacs.d/use-package/use-package-tests.el index 6143818..42bf074 100644 --- a/emacs.d/use-package/use-package-tests.el +++ b/emacs.d/use-package/use-package-tests.el @@ -1133,7 +1133,11 @@ (match-expansion (use-package foo :custom (foo bar)) `(progn - (customize-set-variable 'foo bar "Customized with use-package foo") + (funcall + (or + (get 'foo 'custom-set) + (function set-default)) + 'foo bar) (require 'foo nil nil)))) (ert-deftest use-package-test/:custom-face-1 () @@ -1936,6 +1940,18 @@ (define-prefix-command 'my/map) (bind-key "" 'my/map nil nil)))) + +(ert-deftest bind-key/845 () + (defvar test-map (make-keymap)) + (bind-key "" 'ignore 'test-map) + (should (eq (lookup-key test-map (kbd "")) 'ignore)) + (let ((binding (cl-find "" personal-keybindings :test 'string= :key 'caar))) + (message "test-map %s" test-map) + (message "binding %s" binding) + (should (eq (cdar binding) 'test-map)) + (should (eq (nth 1 binding) 'ignore)) + (should (eq (nth 2 binding) nil)))) + ;; Local Variables: ;; indent-tabs-mode: nil ;; no-byte-compile: t diff --git a/emacs.d/use-package/use-package.el b/emacs.d/use-package/use-package.el index 1a8fff8..0e194d5 100644 --- a/emacs.d/use-package/use-package.el +++ b/emacs.d/use-package/use-package.el @@ -6,7 +6,7 @@ ;; Maintainer: John Wiegley ;; Created: 17 Jun 2012 ;; Modified: 29 Nov 2017 -;; Version: 2.4 +;; Version: 2.4.1 ;; Package-Requires: ((emacs "24.3") (bind-key "2.4")) ;; Keywords: dotemacs startup speed config package ;; URL: https://github.com/jwiegley/use-package diff --git a/emacs.d/use-package/use-package.org b/emacs.d/use-package/use-package.org index cff3ccc..5e5c0b6 100644 --- a/emacs.d/use-package/use-package.org +++ b/emacs.d/use-package/use-package.org @@ -11,7 +11,7 @@ #+TEXINFO_DIR_CATEGORY: Emacs #+TEXINFO_DIR_TITLE: use-package: (use-package). #+TEXINFO_DIR_DESC: Declarative package configuration for Emacs. -#+SUBTITLE: for version 2.4 +#+SUBTITLE: for version 2.4.1 #+TEXINFO_DEFFN: t #+OPTIONS: H:4 num:3 toc:2 creator:t @@ -171,7 +171,7 @@ doing so, to make sure you are not using an outdated value for ~load-path~. should display something like #+BEGIN_EXAMPLE - use-package-version’s value is "2.4" + use-package-version’s value is "2.4.1" #+END_EXAMPLE If you are completely new to use-package then see {{{link-jump(Getting diff --git a/emacs.d/use-package/use-package.texi b/emacs.d/use-package/use-package.texi index 63ed295..cad42bd 100644 --- a/emacs.d/use-package/use-package.texi +++ b/emacs.d/use-package/use-package.texi @@ -30,7 +30,7 @@ General Public License for more details. @finalout @titlepage @title use-package User Manual -@subtitle for version 2.4 +@subtitle for version 2.4.1 @author John Wiegley @page @vskip 0pt plus 1filll @@ -262,7 +262,7 @@ C-h v use-package-version RET should display something like @example -use-package-version’s value is "2.4" +use-package-version’s value is "2.4.1" @end example If you are completely new to use-package then see @ref{Getting Started}. diff --git a/emacs.d/vendor/emacs_27_obsolete.el b/emacs.d/vendor/emacs_27_obsolete.el new file mode 100644 index 0000000..ee0e9fb --- /dev/null +++ b/emacs.d/vendor/emacs_27_obsolete.el @@ -0,0 +1,92 @@ +(defun make-obsolete (obsolete-name current-name &optional when) + "Make the byte-compiler warn that function OBSOLETE-NAME is obsolete. +OBSOLETE-NAME should be a function name or macro name (a symbol). + +The warning will say that CURRENT-NAME should be used instead. +If CURRENT-NAME is a string, that is the `use instead' message +\(it should end with a period, and not start with a capital). +WHEN should be a string indicating when the function +was first made obsolete, for example a date or a release number." + (declare (advertised-calling-convention + ;; New code should always provide the `when' argument. + (obsolete-name current-name when) "23.1")) + (put obsolete-name 'byte-obsolete-info + ;; The second entry used to hold the `byte-compile' handler, but + ;; is not used any more nowadays. + (purecopy (list current-name nil when))) + obsolete-name) + +(defmacro define-obsolete-function-alias (obsolete-name current-name + &optional when docstring) + "Set OBSOLETE-NAME's function definition to CURRENT-NAME and mark it obsolete. + +\(define-obsolete-function-alias \\='old-fun \\='new-fun \"22.1\" \"old-fun's doc.\") + +is equivalent to the following two lines of code: + +\(defalias \\='old-fun \\='new-fun \"old-fun's doc.\") +\(make-obsolete \\='old-fun \\='new-fun \"22.1\") + +WHEN should be a string indicating when the function was first +made obsolete, for example a date or a release number. + +See the docstrings of `defalias' and `make-obsolete' for more details." + (declare (doc-string 4) + (advertised-calling-convention + ;; New code should always provide the `when' argument. + (obsolete-name current-name when &optional docstring) "23.1")) + `(progn + (defalias ,obsolete-name ,current-name ,docstring) + (make-obsolete ,obsolete-name ,current-name ,when))) + +(defun make-obsolete-variable (obsolete-name current-name &optional when access-type) + "Make the byte-compiler warn that OBSOLETE-NAME is obsolete. +The warning will say that CURRENT-NAME should be used instead. +If CURRENT-NAME is a string, that is the `use instead' message. +WHEN should be a string indicating when the variable +was first made obsolete, for example a date or a release number. +ACCESS-TYPE if non-nil should specify the kind of access that will trigger + obsolescence warnings; it can be either `get' or `set'." + (declare (advertised-calling-convention + ;; New code should always provide the `when' argument. + (obsolete-name current-name when &optional access-type) "23.1")) + (put obsolete-name 'byte-obsolete-variable + (purecopy (list current-name access-type when))) + obsolete-name) + +(defmacro define-obsolete-variable-alias (obsolete-name current-name + &optional when docstring) + "Make OBSOLETE-NAME a variable alias for CURRENT-NAME and mark it obsolete. +This uses `defvaralias' and `make-obsolete-variable' (which see). +See the Info node `(elisp)Variable Aliases' for more details. + +If CURRENT-NAME is a defcustom or a defvar (more generally, any variable +where OBSOLETE-NAME may be set, e.g. in an init file, before the +alias is defined), then the define-obsolete-variable-alias +statement should be evaluated before the defcustom, if user +customizations are to be respected. The simplest way to achieve +this is to place the alias statement before the defcustom (this +is not necessary for aliases that are autoloaded, or in files +dumped with Emacs). This is so that any user customizations are +applied before the defcustom tries to initialize the +variable (this is due to the way `defvaralias' works). + +WHEN should be a string indicating when the variable was first +made obsolete, for example a date or a release number. + +For the benefit of Customize, if OBSOLETE-NAME has +any of the following properties, they are copied to +CURRENT-NAME, if it does not already have them: +`saved-value', `saved-variable-comment'." + (declare (doc-string 4) + (advertised-calling-convention + ;; New code should always provide the `when' argument. + (obsolete-name current-name when &optional docstring) "23.1")) + `(progn + (defvaralias ,obsolete-name ,current-name ,docstring) + ;; See Bug#4706. + (dolist (prop '(saved-value saved-variable-comment)) + (and (get ,obsolete-name prop) + (null (get ,current-name prop)) + (put ,current-name prop (get ,obsolete-name prop)))) + (make-obsolete-variable ,obsolete-name ,current-name ,when))) diff --git a/gitconfig b/gitconfig index 29d1f43..117e912 100644 --- a/gitconfig +++ b/gitconfig @@ -1,7 +1,7 @@ [user] name = brettlangdon - email = brett.langdon@datadoghq.com - signingkey = E6600FB894DB3D19 + email = me@brett.is + signingkey = A70042D88B95AA2B [credential] helper = store diff --git a/zshrc.d/.env.zsh b/zshrc.d/.env.zsh index d882c3c..16e8004 100644 --- a/zshrc.d/.env.zsh +++ b/zshrc.d/.env.zsh @@ -42,7 +42,12 @@ PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH:$HOME/.local/bin" PATH="$PATH:/usr/local/go/bin:$GOPATH/bin" PATH="/usr/local/heroku/bin:$PATH" PATH="/usr/local/opt/python/libexec/bin:$PATH" +PATH="/usr/local/opt/sqlite/bin:$PATH" PATH="$HOME/.cargo/bin:$PATH" +PATH="/usr/local/opt/python@3.8/libexec/bin:$PATH" +PATH="~/.local/bin:/usr/local/bin:/usr/local/sbin:/sbin:$PATH" +PATH="$PATH:/usr/local/go/bin:$GOPATH/bin" +PATH="$HOME/.poetry/bin:$PATH" export PATH="$HOME/.rvm/bin:$PATH" export MANPATH="/usr/local/opt/coreutils/libexec/gnuman:$MANPATH"