[nlinum] Show deprecation (Emacs 26.1+) warning on startup

The warning:
nlinum layer is deprecated for Emacs 26.1 and above
wasn't shown until SPC h SPC was pressed.

Because the variable: configuration-layer--used-layers
wasn't populated before the warning check occurred in
nlinum/packages.el.

The solution (suggested by syl20bnr) was to move the
check to a new file: nlinum/config.el.
This commit is contained in:
duianto 2020-02-17 07:14:15 +01:00 committed by Maximilian Wolff
parent fbe6b907e2
commit f578e618a5
No known key found for this signature in database
GPG key ID: 2DD07025BFDBD89A
2 changed files with 16 additions and 5 deletions

View file

@ -0,0 +1,14 @@
;;; config.el --- nlinum Layer packages File
;;
;; Copyright (c) 2012-2020 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(when (configuration-layer/layer-usedp 'nlinum)
(spacemacs-buffer/warning (concat "nlinum layer is deprecated for Emacs 26.1 and above."
" You can safely remove it from your dotfile.")))

View file

@ -50,8 +50,5 @@
(nlinum-relative-setup-evil)
(add-hook 'nlinum-mode-hook 'nlinum-relative-on))
(spacemacs/set-leader-keys "tr" 'spacemacs/nlinum-relative-toggle)))))
(defconst nlinum-packages nil)
(when (configuration-layer/layer-usedp 'nlinum)
(spacemacs-buffer/warning (concat "nlinum layer is deprecated for Emacs 26.1 and above."
" You can safely remove it from your dotfile."))))
;; Emacs version 26 and above
(defconst nlinum-packages nil))