fix typo and use a layer variable for auto nameless-mode

This commit is contained in:
AdrieanKhisbe 2017-10-25 19:45:56 +02:00 committed by syl20bnr
parent 48b0484348
commit 71f8919ebf
3 changed files with 18 additions and 12 deletions

View File

@ -98,11 +98,13 @@ function or press ~o~ to go out of it.
7) Press ~a~ to stop debugging.
* Nameless
Nameless hides package namespaces in your emacs-lisp code, adn replace it by leading ~:~
It can be toggled by ~SPC m~.
Nameless hides package namespaces in your emacs-lisp code, and replaces it by leading ~:~
It can be toggled by ~SPC m :~.
To have it automatically on, you need to add ~(setq nameless-auto-mode t)~ in ~dotspacemacs/user-init~.
Further configuration can be done with variable ~nameless-global-aliases~, cf [[https://github.com/Malabarba/Nameless#requiring-other-packages-as-aliases][original library documentation]]
To have it automatically on, you need to define a layer variable:
=(emacs-lisp :variables emacs-lisp-nameless-mode t)= in =.spacemacs= =dotspacemacs/layers=
Further configuration can be done with the custom variable =nameless-global-aliases=, cf [[https://github.com/Malabarba/Nameless#requiring-other-packages-as-aliases][original library documentation]]
* Key bindings

View File

@ -13,3 +13,6 @@
(spacemacs|define-jump-handlers emacs-lisp-mode)
(spacemacs|define-jump-handlers lisp-interaction-mode)
(defvar emacs-lisp-nameless-mode nil
"If non-nil, nameless-mode is automatically turn on for emacs-lisp buffers.")

View File

@ -182,14 +182,15 @@
(defun emacs-lisp/init-nameless ()
(use-package nameless
:defer t
:init (progn
(when (bound-and-true-p nameless-auto-mode)
(add-hook 'emacs-lisp-mode-hook 'nameless-mode-from-hook))
(spacemacs|add-toggle nameless
:status nameless-mode
:on (nameless-mode)
:off (nameless-mode -1)
:evil-leader-for-mode (emacs-lisp-mode . ":")))))
:init
(progn
(when emacs-lisp-nameless-mode
(add-hook 'emacs-lisp-mode-hook 'nameless-mode-from-hook))
(spacemacs|add-toggle nameless
:status nameless-mode
:on (nameless-mode)
:off (nameless-mode -1)
:evil-leader-for-mode (emacs-lisp-mode . ":")))))
(defun emacs-lisp/init-overseer ()
(use-package overseer