From 9bc754c50cbb699cdc6a34949ea6a2f0a26c8049 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Sun, 13 Sep 2015 22:47:09 -0400 Subject: [PATCH] spacemacs-core: cleanup prefix functions Also change the way the command symbols are constructed --- layers/+distribution/spacemacs-core/funcs.el | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/layers/+distribution/spacemacs-core/funcs.el b/layers/+distribution/spacemacs-core/funcs.el index 36644e80d..e00f39e08 100644 --- a/layers/+distribution/spacemacs-core/funcs.el +++ b/layers/+distribution/spacemacs-core/funcs.el @@ -63,10 +63,6 @@ (defun spacemacs/system-is-mswindows () (string-equal system-type "windows-nt")) -(defvar spacemacs/prefix-command-string "group:" - "Prefix string for prefix commands.") -(defvar spacemacs/prefix-titles (list)) - (defun spacemacs/jump-in-buffer () (interactive) (cond @@ -75,11 +71,14 @@ (t (call-interactively 'helm-semantic-or-imenu)))) +(defvar spacemacs/prefix-titles nil + "alist for mapping command prefixes to long names.") + (defun spacemacs/declare-prefix (prefix name &optional long-name) "Declare a prefix PREFIX. PREFIX is a string describing a key sequence. NAME is a symbol name used as the prefix command. -LONG-NAME if given is stored in `spacemacs/prefix-command-alist'." - (let* ((command (intern (concat spacemacs/prefix-command-string name))) +LONG-NAME if given is stored in `spacemacs/prefix-titles'." + (let* ((command name) (full-prefix (concat dotspacemacs-leader-key " " prefix)) (full-prefix-emacs (concat dotspacemacs-emacs-leader-key " " prefix)) (full-prefix-lst (listify-key-sequence (kbd full-prefix))) @@ -101,7 +100,7 @@ LONG-NAME if given is stored in `spacemacs/prefix-command-alist'." "Declare a prefix PREFIX. MODE is the mode in which this prefix command should be added. PREFIX is a string describing a key sequence. NAME is a symbol name used as the prefix command." - (let ((command (intern (concat spacemacs/prefix-command-string name))) + (let ((command (intern (concat (symbol-name mode) name))) (full-prefix (concat dotspacemacs-leader-key " " prefix)) (full-prefix-emacs (concat dotspacemacs-emacs-leader-key " " prefix))) (unless long-name (setq long-name name))