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

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

Closed
wants to merge 3 commits into from

Conversation

Projects
None yet
3 participants
@sKolar42
Copy link
Contributor

sKolar42 commented Mar 11, 2016

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.

sKolar42 added some commits Mar 11, 2016

Fixed counsel-list-processes-action-switch to use correct buffer.
* counsel.el (counsel-list-processes-action-switch): Use buf instead of x for switch-to-buffer.
Correctly expand the file name at point
* counsel.el (counsel-find-file): Use expand-file-name after getting a file name at point.
Added additional actions to counsel-find-file.
* 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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor Author

sKolar42 commented Mar 11, 2016

Yes and yes.

@abo-abo

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor

kaushalmodi commented Mar 11, 2016

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

This comment has been minimized.

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
You can’t perform that action at this time.