summaryrefslogtreecommitdiff
path: root/helm-apt.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2013-03-24 10:17:24 +0100
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2013-03-24 10:17:24 +0100
commit4b1edb5bb9bb916cfd0f67d9d7c96472c2b8e705 (patch)
tree49d25090989ff65096366bc304790836275f92b4 /helm-apt.el
parentaa6733f85f92ec46b1d49c412d274ed17ba90ef3 (diff)
* helm-apt.el (helm-shell-command-if-needed): Removed.
(helm-apt-cache-show): Move helm-shell-command-if-needed code here, use view.
Diffstat (limited to 'helm-apt.el')
-rw-r--r--helm-apt.el18
1 files changed, 9 insertions, 9 deletions
diff --git a/helm-apt.el b/helm-apt.el
index 2e38cbb7..99097dc9 100644
--- a/helm-apt.el
+++ b/helm-apt.el
@@ -120,17 +120,17 @@ LINE is displayed like:
package name - description."
(car (split-string line " - ")))
-(defun helm-shell-command-if-needed (command)
- "Run shell command COMMAND to describe package.
-If a buffer named COMMAND already exists, just switch to it."
- (let ((buf (get-buffer command)))
- (helm-switch-to-buffer (get-buffer-create command))
- (unless buf (insert (shell-command-to-string command)))))
-
(defun helm-apt-cache-show (package)
"Show information on apt package PACKAGE."
- (helm-shell-command-if-needed
- (format helm-apt-show-command package)))
+ (let* ((command (format helm-apt-show-command package))
+ (buf (get-buffer command)))
+ (helm-switch-to-buffer (get-buffer-create command))
+ (view-mode 1)
+ (unless buf
+ (let ((inhibit-read-only t))
+ (save-excursion
+ (insert (shell-command-to-string command))))
+ (view-mode 1))))
(defun helm-apt-install (package)
"Run 'apt-get install' shell command on PACKAGE."