简体   繁体   中英

Emacs helm: Adding new sources to helm-mini

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?

The append form doesn't change the value of helm-mini-default-sources , so it, ie, Mx 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM