From cd1aa7e14ca37157cb7dee2e4a3fa7f1aeb901fc Mon Sep 17 00:00:00 2001 From: Thierry Volpiatto Date: Sat, 7 Apr 2012 10:24:33 +0200 Subject: New command to show all and some arrangements. * helm-color.el (helm-custom-faces-init): new (helm-c-source-customize-face): use it * helm-utils.el (helm-show-all-in-this-source-only): Show only current source of this helm session. (helm-show-all-candidates): Overhide helm-candidate-number-limit. * helm.el (helm-set-source-filter): don't loose cur selection. (helm-init-candidates-in-buffer): Initialize a candidates-in-buffer session more easily. --- helm-color.el | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'helm-color.el') diff --git a/helm-color.el b/helm-color.el index c3aad06a..3bfc57f1 100644 --- a/helm-color.el +++ b/helm-color.el @@ -22,18 +22,24 @@ ;;; Customize Face ;; ;; +(defun helm-custom-faces-init () + "Initialize buffer for `helm-c-source-customize-face'." + (unless (helm-candidate-buffer) + (save-selected-window + (list-faces-display)) + (let ((cands (with-current-buffer (get-buffer "*Faces*") + (goto-char (point-min)) + (forward-line 3) + (buffer-substring (point) (point-max))))) + (helm-init-candidates-in-buffer "*helm faces*" cands)))) + (defvar helm-c-source-customize-face '((name . "Customize Face") - (init . (lambda () - (unless (helm-candidate-buffer) - (save-selected-window - (list-faces-display)) - (helm-candidate-buffer (get-buffer "*Faces*"))))) + (init . helm-custom-faces-init) (candidates-in-buffer) (get-line . buffer-substring) (action . (lambda (line) - (customize-face (intern (car (split-string line)))))) - (requires-pattern . 3)) + (customize-face (intern (car (split-string line))))))) "See (info \"(emacs)Faces\")") ;;; Colors browser @@ -41,10 +47,11 @@ ;; (defvar helm-c-source-colors '((name . "Colors") - (init . (lambda () (unless (helm-candidate-buffer) - (save-selected-window - (list-colors-display)) - (helm-candidate-buffer (get-buffer "*Colors*"))))) + (init . (lambda () + (unless (helm-candidate-buffer) + (save-selected-window + (list-colors-display)) + (helm-candidate-buffer (get-buffer "*Colors*"))))) (candidates-in-buffer) (get-line . buffer-substring) (action -- cgit v1.2.3