diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2015-05-22 07:20:25 +0200 |
---|---|---|
committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2015-05-22 07:20:25 +0200 |
commit | 17dde51f9494a28e54adb68c6c7540cf28ff9a9c (patch) | |
tree | e9f1d6e02540f26dea50e15465ddad4166490882 /helm-color.el | |
parent | b28cecaef77773d3ebb026cecd2aff647cb5b109 (diff) |
Use helm-source to define sources in helm-color.
* helm-color.el: Do it.
Diffstat (limited to 'helm-color.el')
-rw-r--r-- | helm-color.el | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/helm-color.el b/helm-color.el index af4af763..7707c5d0 100644 --- a/helm-color.el +++ b/helm-color.el @@ -37,16 +37,15 @@ (kill-buffer "*Faces*"))) (defvar helm-source-customize-face - '((name . "Customize Face") - (init . helm-custom-faces-init) - (candidates-in-buffer) - (get-line . buffer-substring) - (action . (("Customize" - . (lambda (line) - (customize-face (intern (car (split-string line)))))) - ("Copy name" - . (lambda (line) - (kill-new (car (split-string line " " t)))))))) + (helm-build-in-buffer-source "Customize Face" + :init 'helm-custom-faces-init + :get-line 'buffer-substring + :action '(("Customize" + . (lambda (line) + (customize-face (intern (car (split-string line)))))) + ("Copy name" + . (lambda (line) + (kill-new (car (split-string line " " t))))))) "See (info \"(emacs)Faces\")") ;;; Colors browser @@ -108,19 +107,18 @@ map)) (defvar helm-source-colors - `((name . "Colors") - (init . helm-colors-init) - (candidates-in-buffer) - (get-line . buffer-substring) - (keymap . ,helm-color-map) - (persistent-help . "Kill entry in RGB format.") - (persistent-action . helm-color-kill-rgb) - (mode-line . helm-color-mode-line-string) - (action - ("Copy Name (C-c N)" . helm-color-kill-name) - ("Copy RGB (C-c R)" . helm-color-kill-rgb) - ("Insert Name (C-c n)" . helm-color-insert-name) - ("Insert RGB (C-c r)" . helm-color-insert-rgb)))) + (helm-build-in-buffer-source "Colors" + :init 'helm-colors-init + :get-line 'buffer-substring + :keymap helm-color-map + :persistent-help "Kill entry in RGB format." + :persistent-action 'helm-color-kill-rgb + :mode-line 'helm-color-mode-line-string + :action + '(("Copy Name (C-c N)" . helm-color-kill-name) + ("Copy RGB (C-c R)" . helm-color-kill-rgb) + ("Insert Name (C-c n)" . helm-color-insert-name) + ("Insert RGB (C-c r)" . helm-color-insert-rgb)))) (defun helm-colors-get-name (candidate) "Get color name." @@ -148,9 +146,8 @@ (defun helm-colors () "Preconfigured `helm' for color." (interactive) - (helm-other-buffer - '(helm-source-colors helm-source-customize-face) - "*helm colors*")) + (helm :sources '(helm-source-colors helm-source-customize-face) + :buffer "*helm colors*")) (provide 'helm-color) |