Skip to content

Fixed a bug in counsel-list-processes-action-switch and made some improvements to counsel-find-file #430

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

Closed
wants to merge 3 commits into from

Conversation

sKolar42
Copy link
Contributor

The counsel-list-processes-action-switch fix was simple, and possibly my fault in the first place.

The counsel-find-file changes fix a bug with the use of ffap. With point on a file name such as dev/emacs/BUGS, it wouldn't expand the file name completely, leaving the user on emacs/ with no available options.

The final piece is additional actions to counsel-find-file. Helm has all of these, and I've found them to be useful.

* counsel.el (counsel-list-processes-action-switch): Use buf instead of x for switch-to-buffer.
* counsel.el (counsel-find-file): Use expand-file-name after getting a file name at point.
* counsel.el (counsel-find-file): Added view-file, delete-file, load-file, and
  byte-compile-file as additional actions.
@abo-abo abo-abo closed this in d425392 Mar 11, 2016
@abo-abo
Copy link
Owner

abo-abo commented Mar 11, 2016

Thanks.

I did not add the extra actions, since they're not very useful (ELisp ones and read-only-mode), while the delete-file one is actually pretty dangerous. Users can add those to their own config if they wish.

Is dunni@gnu.org your email? Just wondering if you have the Emacs CA.

@sKolar42
Copy link
Contributor Author

Yes and yes.

@abo-abo
Copy link
Owner

abo-abo commented Mar 11, 2016

OK. Thanks for the contributions. I'm glad it won't be a hassle for you to make more, if need be:)

@kaushalmodi
Copy link
Contributor

About the delete-file being dangerous, I add it to my config with a red face:

(ivy-set-actions
     'counsel-find-file
     `(("x"
        (lambda (x) (delete-file (expand-file-name x ivy--directory)))
        ,(propertize "delete" 'face 'font-lock-warning-face))))

@abo-abo
Copy link
Owner

abo-abo commented Mar 12, 2016

I think it's dangerous because of a finger slip being a factor - d is very easy to press.

Note how dired implements it: dxy is a lot safer than a plain d.

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

Successfully merging this pull request may close these issues.

3 participants