Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot pre-set 'follow attribute #2639

Closed
1 task done
alexvorobiev opened this issue Mar 2, 2024 · 3 comments
Closed
1 task done

Cannot pre-set 'follow attribute #2639

alexvorobiev opened this issue Mar 2, 2024 · 3 comments
Labels

Comments

@alexvorobiev
Copy link

What happened?

I want to always see the content of the buffers whenever I have the buffers source active. I tried adding this line to my configuration

(helm-set-attr 'follow 1 helm-source-buffers-list)

but helm-set-attr calls helm-get-current-source which fails with No buffer named *helm* error.

How to reproduce?

Run

(helm-set-attr 'follow 1 helm-source-buffers-list)

prior to calling any helm commands.

Helm Version

Master branch

Emacs Version

Emacs-30+

OS

GNU/Linux

Relevant backtrace (if possible)

Debugger entered--Lisp error: (error "No buffer named *helm*")
  helm-get-current-source()
  helm-set-attr(follow 1 nil)
  eval((helm-set-attr 'follow 1 helm-source-buffers-list) nil)
  elisp--eval-last-sexp(nil)
  #f(compiled-function () #<bytecode 0x299f04123357a>)()
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  command-execute(eval-last-sexp)

Minimal configuration

  • I agree using a minimal configuration
@thierryvolpiatto
Copy link
Member

thierryvolpiatto commented Mar 2, 2024 via email

@alexvorobiev
Copy link
Author

alexvorobiev commented Mar 2, 2024

Thanks! Yes, I am aware of helm-follow-mode-persistent and I do use it but I have many computers - both physical and often temporary virtual - and would prefer a configuration where everything is pre-configured to my liking from the beginning. I also share my settings with others (often beginners) and telling them to memorize yet another emacs key which they need to use only once seems cruel. After some experimentation I came up with this code (an excerpt form my much larger helm configuration) which seems to be doing what I want:

(setq helm-follow-mode-persistent t)

(unless (listp 'helm-source-names-using-follow)
    (setq helm-source-names-using-follow (list)))

(add-to-list 'helm-source-names-using-follow "Buffers")

Does it look reasonable? It feels like the the last line is good ergonomics and it looks more straightforward than the customizable source for this particular case. If helm-source-names-using-follow were initialized with an empty list by default, the approach (and the strings corresponding to the source names - I couldn't find them in the documentation) would maybe also be worth mentioning somewhere in the help.

@thierryvolpiatto
Copy link
Member

thierryvolpiatto commented Mar 3, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants