File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -438,6 +438,7 @@ i.e. the loop is not entered after running COMMAND."
438
438
(define-key map (kbd "M-a") #'helm-mark-all)
439
439
(define-key map (kbd "M-U") #'helm-unmark-all)
440
440
(define-key map (kbd "C-M-a") #'helm-show-all-candidates-in-source)
441
+ (define-key map (kbd "C-M-f") #'helm-limit-to-sources)
441
442
(define-key map (kbd "C-M-e") #'helm-display-all-sources)
442
443
(define-key map (kbd "C-s") #'undefined)
443
444
(define-key map (kbd "M-s") #'undefined)
@@ -2421,6 +2422,28 @@ show ARG number of candidates."
2421
2422
(helm-set-source-filter nil)))
2422
2423
(put 'helm-display-all-sources 'helm-only t)
2423
2424
2425
+ (defun helm-limit-to-sources ()
2426
+ "Limit sources to display from current session.
2427
+ This is a toggle command, when hit a second time reset to all sources."
2428
+ (interactive)
2429
+ (with-helm-alive-p
2430
+ (with-helm-buffer
2431
+ (if (null helm-source-filter)
2432
+ (when (cdr helm-sources)
2433
+ (let ((headers (helm-comp-read
2434
+ "Limit to source(s): "
2435
+ (mapcar
2436
+ (lambda (s)
2437
+ (let* ((name (assoc-default 'name s))
2438
+ (disp (helm-aif (assoc-default 'header-name s)
2439
+ (funcall it name) name)))
2440
+ (cons disp name)))
2441
+ helm-sources)
2442
+ :marked-candidates t
2443
+ :allow-nest t
2444
+ :buffer "*helm sources*")))
2445
+ (helm-set-source-filter headers)))
2446
+ (helm-set-source-filter nil)))))
2424
2447
2425
2448
;;; Source infos fns.
2426
2449
;;
You can’t perform that action at this time.
0 commit comments