4

Helm has builtin helm-mini command which includes buffers and recentf in its sources.

(setq helm-source-buffers-list
      (helm-make-source "Buffers" 'helm-source-buffers)))
(helm :sources helm-mini-default-sources
      :buffer "*helm mini*"
      :truncate-lines t)

There is one more package helm recent dirs which provides helm interface to recentd It uses '(helm-source-dired-recent-dirs) as it source.

I am trying to combine those two so i am adding this in helm-mini

(append helm-mini-default-sources '(helm-source-dired-recent-dirs))

but it doesn't work. Am I missing something?

Community
  • 1
  • 1
Chillar Anand
  • 27,936
  • 9
  • 119
  • 136

1 Answers1

5

The append form doesn't change the value of helm-mini-default-sources, so it, i.e., M-x helm-mini, does not work. You can combine setq and append or just add-to-list:

(setq helm-mini-default-sources
      (append helm-mini-default-sources'(helm-source-dired-recent-dirs)))
;; or
(add-to-list 'helm-mini-default-sources 'helm-source-dired-recent-dirs 'append)

but the more flexible way is just using a plain setq because you can choose source and their order:

(setq helm-mini-default-sources '(helm-source-buffers-list
                                  helm-source-dired-recent-dirs
                                  helm-source-recentf
                                  helm-source-buffer-not-found))

There is no needs to write your own helm-mini function, use the built-in one is enough.

xuchunyang
  • 919
  • 7
  • 12
  • 1
    initially, if `helm-source-dired-recent-dirs` is empty; then helm-mini throws error? – Chillar Anand Jun 14 '15 at 09:32
  • 2
    Use `(require 'helm-dired-recent-dirs)` to introduce the variable `helm-source-dired-recent-dirs` before using `helm-mini`, you should add it to your Emacs conf. – xuchunyang Jun 14 '15 at 11:28