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

Add counsel-package #869

Merged
merged 1 commit into from Feb 2, 2017

Conversation

Projects
None yet
3 participants
@justbur
Contributor

justbur commented Feb 2, 2017

Allows installing, deleting, describing, and more to come...

I'm not sure about the interface, so I'm happy to make changes.

counsel.el (counsel-package): Add func to manage packages.
Allows installing, deleting, describing, and more to come...

counsel.el (counsel--package-sort): Add
counsel.el (counsel--describe-package): Add

@abo-abo abo-abo merged commit aedea1a into abo-abo:master Feb 2, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

abo-abo added a commit that referenced this pull request Feb 2, 2017

counsel.el (counsel-package): Fix sorting issue
* counsel.el (counsel-package): Pre-sort the candidates instead of using
  ":sort t" and a sorting function. Set "+ " as the initial input,
  instead of "+". This way, you can e.g. type "theme" and match themes,
  instead from matching only packages that start with "theme".

(counsel-package-action): Extract.

(counsel-package-action-describe): Rename from
`counsel--describe-package'.

Add some declarations to silence the byte compiler.

Re #869
@abo-abo

This comment has been minimized.

Owner

abo-abo commented Feb 2, 2017

Thanks. Please review my fixes. The command was selecting wrong packages on my system before the fix.

@justbur

This comment has been minimized.

Contributor

justbur commented Feb 2, 2017

thanks, but I don't understand why the wrong package would have been selected.

@thiderman

This comment has been minimized.

thiderman commented Feb 2, 2017

Nice idea - I really like it!

However, I just installed it (via melpa) and executed it on the first package, and well, it crashes. It does so on everything I've tried. Am I doing something wrong?

Debugger entered--Lisp error: (wrong-type-argument listp "0blayout")
  counsel-package-action("0blayout")
  ivy-call()
  ivy-read("Packages (install +pkg or delete -pkg): " (("+0blayout" . "0blayout") ("+0xc" . "0xc") ("+2048-game" . "2048-game") ("+4clojure" . "4clojure") ("+@" . "@") ("+Save-visited-files" . "Save-visited-files") ("+aa-edit-mode" . "aa-edit-mode") ("+abacus" . "abacus") ("+abc-mode" . "abc-mode") ("+abl-mode" . "abl-mode") ("+abyss-theme" . "abyss-theme") ("+ac-R" . "ac-R") ("+ac-alchemist" . "ac-alchemist") ("+ac-anaconda" . "ac-anaconda") ("+ac-c-headers" . "ac-c-headers") ("+ac-cake" . "ac-cake") ("+ac-cake2" . "ac-cake2") ("+ac-capf" . "ac-capf") ("+ac-cider" . "ac-cider") ("+ac-clang" . "ac-clang") ("+ac-dabbrev" . "ac-dabbrev") ("+ac-dcd" . "ac-dcd") ("+ac-emacs-eclim" . "ac-emacs-eclim") ("+ac-emmet" . "ac-emmet") ("+ac-emoji" . "ac-emoji") ("+ac-etags" . "ac-etags") ("+ac-geiser" . "ac-geiser") ("+ac-haskell-process" . "ac-haskell-process") ("+ac-helm" . "ac-helm") ("+ac-html" . "ac-html") ("+ac-html-angular" . "ac-html-angular") ("+ac-html-bootstrap" . "ac-html-bootstrap") ("+ac-html-csswatcher" . "ac-html-csswatcher") ("+ac-inf-ruby" . "ac-inf-ruby") ("+ac-ispell" . "ac-ispell") ("+ac-ja" . "ac-ja") ("+ac-js2" . "ac-js2") ("+ac-math" . "ac-math") ("+ac-mozc" . "ac-mozc") ("+ac-nrepl" . "ac-nrepl") ("+ac-octave" . "ac-octave") ("+ac-php" . "ac-php") ("+ac-php-core" . "ac-php-core") ("+ac-python" . "ac-python") ("+ac-racer" . "ac-racer") ("+ac-skk" . "ac-skk") ("+ac-slime" . "ac-slime") ("+ac-sly" . "ac-sly") ("+ace-flyspell" . "ace-flyspell") ("+ace-isearch" . "ace-isearch") ...) :action counsel-package-action :initial-input "^+ " :require-match t :caller counsel-package)
  counsel-package()
  funcall-interactively(counsel-package)
  call-interactively(counsel-package record nil)
  command-execute(counsel-package record)
  #[257 "\304\305!\203\f�\306\307�!!\210��\307�!\211��\310\307�!\311\")\207" [current-prefix-arg prefix-arg this-command real-this-command featurep smex smex-rank intern command-execute record] 4 "\n\n(fn CMD)"]("counsel-package")
  ivy-call()
  ivy-read("M-x " [MUR =WP6*e^g^j:r:6y:oz1Ko= JUPITER TUOX RUNIC DISPUTED THANTHAKHAT debugger-previous-window CHITUEUMCHIEUCH LIMBU counsel-faces KHANG INTERSYLLABIC SOCCER HHI QUINCUNX TEI HLUX BSKA- noBreak UPRIGHT NGG Serto\ Batnan MIRI SSUX TIMER HHU SUT old-val MWO SZEE --cl-block-ivy-state-dynamic-collection-- MUOP extra-ag-args D019 NGU \12346 DEZH PASUQ ORDER CHANG YUI GYU args-end SWE counsel-faces-action-describe SWG Droid\ Sans\ Hebrew TURU D028 ...] :predicate commandp :require-match t :history extended-command-history :action #[257 "\304\305!\203\f�\306\307�!!\210��\307�!\211��\310\307�!\311\")\207" [current-prefix-arg prefix-arg this-command real-this-command featurep smex smex-rank intern command-execute record] 4 "\n\n(fn CMD)"] :sort t :keymap (keymap (mouse-2 . th/paste-from-x-clipboard) (27 keymap (121 . th/paste-from-x-clipboard)) (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input "^" :caller counsel-M-x)
  counsel-M-x()
  funcall-interactively(counsel-M-x)
  call-interactively(counsel-M-x nil nil)
  command-execute(counsel-M-x)
@justbur

This comment has been minimized.

Contributor

justbur commented Feb 2, 2017

@thiderman I'm sure @abo-abo knows better, but I believe you need to update ivy. The handling of alists changed at some point.

@abo-abo

This comment has been minimized.

Owner

abo-abo commented Feb 2, 2017

Exactly, a remove/reinstall should solve this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment