summaryrefslogtreecommitdiff
path: root/helm-apt.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2016-08-28 12:32:03 +0200
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2016-08-28 12:36:14 +0200
commit8273f88be5dcec15ff3d7d1fccf97ff3931cbff0 (patch)
tree81592d12189da5044101f1fc8b938cb3cff2a140 /helm-apt.el
parentc864f015d7ff151dcb4fce7726a3a3495833c578 (diff)
Fix helm-apt action.
* helm-apt.el (helm-apt-generic-action): Keep term prompt when saying no. Show candidates in special buffer.
Diffstat (limited to 'helm-apt.el')
-rw-r--r--helm-apt.el32
1 files changed, 15 insertions, 17 deletions
diff --git a/helm-apt.el b/helm-apt.el
index d8ea2fa8..d65a1158 100644
--- a/helm-apt.el
+++ b/helm-apt.el
@@ -244,25 +244,23 @@ Support install, remove and purge actions."
(ansi-term (getenv "SHELL") "term apt")
(setq helm-apt-term-buffer (buffer-name)))
(term-line-mode)
- (let ((command (cl-case action
- (install "sudo apt-get install ")
- (reinstall "sudo apt-get install --reinstall ")
- (uninstall "sudo apt-get remove ")
- (purge "sudo apt-get purge ")
- (t (error "Unknown action"))))
- (beg (point))
- end
- (cand-list (mapconcat (lambda (x) (format "'%s'" x))
- (helm-marked-candidates) " ")))
- (goto-char (point-max))
- (insert (concat command cand-list))
- (setq end (point))
- (if (y-or-n-p (format "%s package(s)" (symbol-name action)))
- (progn
+ (let* ((command (cl-case action
+ (install "sudo apt-get install ")
+ (reinstall "sudo apt-get install --reinstall ")
+ (uninstall "sudo apt-get remove ")
+ (purge "sudo apt-get purge ")
+ (t (error "Unknown action"))))
+ (cands (helm-marked-candidates))
+ (cand-list (mapconcat (lambda (x) (format "'%s'" x)) cands " ")))
+ (with-helm-display-marked-candidates "*apt candidates*"
+ cands
+ (when (y-or-n-p (format "%s package(s)" (symbol-name action)))
+ (with-current-buffer helm-apt-term-buffer
+ (goto-char (point-max))
+ (insert (concat command cand-list))
(setq helm-external-commands-list nil)
(setq helm-apt-installed-packages nil)
- (term-char-mode) (term-send-input))
- (delete-region beg end))))
+ (term-char-mode) (term-send-input))))))
;;;###autoload
(defun helm-apt (arg)