Comments (10)
Do you mean something like this?
(defun helm-bufler-path-source (path)
"Return Helm source for Bufler group at PATH.
PATH is a Bufler path, e.g. like the value of the frame parameter
`bufler-workspace-path' after calling `bufler-workspace-focus-buffer'."
(let ((source-name (concat "Bufler: " (bufler-format-path path))))
(helm-make-source source-name 'helm-source-sync
:header-name source-name
:candidates (lambda ()
(let* ((bufler-vc-state nil)
(group-path (unless current-prefix-arg
;; FIXME: This initial-nil-skipping logic probably belongs elsewhere.
(if (car path) path (cdr path)))))
(bufler-buffer-alist-at group-path)))
:action (cons (cons "Switch to buffer with Bufler" 'helm-bufler-switch-buffer)
helm-type-buffer-actions))))
(helm :sources (list (helm-bufler-path-source '("Projectile"))))
from bufler.el.
Can't reproduce, because if I try to eval
(helm :sources (list (helm-bufler-path-source '("Projectile"))))
I get this error:
(void-variable path)
from bufler.el.
It requires lexical binding.
from bufler.el.
I tried replacing let*
with lexical-let
, now there are no candidates in helm. The same thing when I moved the code to helm-bufler.el
from bufler.el.
I tried replacing
let*
withlexical-let
That's not how lexical binding works in Emacs.
Place this code in an Elisp buffer, save it to a file, revert the buffer, and evaluate it:
;; -*- lexical-binding: t; -*-
(defun helm-bufler-path-source (path)
"Return Helm source for Bufler group at PATH.
PATH is a Bufler path, e.g. like the value of the frame parameter
`bufler-workspace-path' after calling `bufler-workspace-focus-buffer'."
(let ((source-name (concat "Bufler: " (bufler-format-path path))))
(helm-make-source source-name 'helm-source-sync
:header-name source-name
:candidates (lambda ()
(let* ((bufler-vc-state nil)
(group-path (unless current-prefix-arg
;; FIXME: This initial-nil-skipping logic probably belongs elsewhere.
(if (car path) path (cdr path)))))
(bufler-buffer-alist-at group-path)))
:action (cons (cons "Switch to buffer with Bufler" 'helm-bufler-switch-buffer)
helm-type-buffer-actions))))
(helm :sources (list (helm-bufler-path-source '("Projectile"))))
from bufler.el.
The same thing: executed without errors, but there are not any candidates in helm.
from bufler.el.
It works for me, e.g. to see buffers in the *Special*
group:
(helm :sources (list (helm-bufler-path-source '("*Special*"))))
from bufler.el.
It works for me with *Special*
too, but not with Projectile
.
This is my init.el:
(use-package projectile
:straight t
:config
(projectile-mode 1)
(setq projectile-completion-system 'helm))
(use-package helm
:straight t
:config
(helm-mode 1))
(use-package bufler
:straight t)
(use-package helm-bufler
:straight t)
(defun helm-bufler-path-source (path)
"Return Helm source for Bufler group at PATH.
PATH is a Bufler path, e.g. like the value of the frame parameter
`bufler-workspace-path' after calling `bufler-workspace-focus-buffer'."
(let ((source-name (concat "Bufler: " (bufler-format-path path))))
(helm-make-source source-name 'helm-source-sync
:header-name source-name
:candidates (lambda ()
(let* ((bufler-vc-state nil)
(group-path (unless current-prefix-arg
;; FIXME: This initial-nil-skipping logic probably belongs elsewhere.
(if (car path) path (cdr path)))))
(bufler-buffer-alist-at group-path)))
:action (cons (cons "Switch to buffer with Bufler" 'helm-bufler-switch-buffer)
helm-type-buffer-actions))))
(helm :sources '(helm-bufler-source))
(helm :sources (list (helm-bufler-path-source '("Projectile:"))))
(helm :sources (list (helm-bufler-path-source '("*Special*"))))
I can see some Projectile
candidates with (helm :sources '(helm-bufler-source))
, but there are not any candidates with (helm :sources (list (helm-bufler-path-source '("Projectile:"))))
from bufler.el.
The code (helm-bufler-path-source '("Projectile:"))
requires that there be a group named Projectile:
in your configured groups.
from bufler.el.
I have this config for bulfer-group
:
(setq bufler-groups
(bufler-defgroups
(group
;; Subgroup collecting these "special special" buffers
;; separately for convenience.
(name-match "**Special**"
(rx bos "*" (or "Messages" "Warnings" "scratch" "Backtrace") "*")))
;; All buffers under "~/.emacs.d" (or wherever it is).
(group
;; Subgroup collecting buffers in a projectile project.
(auto-projectile)))
With M-x bufler
at least I can see a few groups named Projectile: *project-name1*
Projectile: *project-name2*
and etc. in my case.
I would like to add all this groups to helm-mini-default-sources
.
from bufler.el.
Related Issues (20)
- Warnings with bufler-switch-buffer HOT 3
- cons: Symbol’s value as variable is void: max-width HOT 3
- Bufler doesn't display buffer kills on exwm windows HOT 6
- bufler-list-buffer-switch does not respect window cofiguration HOT 10
- Switching to buffer without deleting window? HOT 3
- Bufler installation from MELPA fails with compilation error HOT 8
- max-width variables seem un-used HOT 8
- Error while loading autoloads HOT 12
- bufler-groups explanation HOT 2
- Sidebar? HOT 4
- tab-bar-switch-to-{prev,next}-tab and related issues HOT 1
- replace $HOME in Path on *Bulfer* HOT 2
- Simple example to add a buffer with a certain name to Bufler's list? HOT 3
- bufler-mode-map/bufler-mode as minor mode? HOT 1
- Relative path column HOT 1
- Add bookmark function
- butler-reverse inconsistent with documentation HOT 1
- Subgroups and syntax? HOT 3
- (buffler-group-auto-parent-project) don't work, if homedir is git repository HOT 3
- README does not correctly reflect state of bufler-tabs-mode HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bufler.el.