Skip to content

Commit

Permalink
Move 'executable-find' away from 'aurel-call-pacman'
Browse files Browse the repository at this point in the history
Use it in 'aurel-pacman-program' definition instead.
  • Loading branch information
alezost committed Jul 9, 2015
1 parent cd77f24 commit 45e3f12
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions aurel.el
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ Return non-nil, if ACTION was performed; return nil otherwise."

;;; Interacting with pacman

(defcustom aurel-pacman-program "pacman"
(defcustom aurel-pacman-program (executable-find "pacman")
"Absolute or relative name of `pacman' program."
:type 'string
:group 'aurel)
Expand Down Expand Up @@ -519,18 +519,16 @@ Contain 2 parenthesized groups: parameter name and its value.")
"Call `aurel-pacman-program' with arguments ARGS.
Insert output in BUFFER. If it is nil, use `aurel-pacman-buffer-name'.
Return numeric exit status."
(let ((pacman (executable-find aurel-pacman-program)))
(or pacman
(error (concat "Couldn't find '%s'.\n"
"Set aurel-pacman-program to a proper value")
aurel-pacman-program))
(with-current-buffer
(or buffer (get-buffer-create aurel-pacman-buffer-name))
(erase-buffer)
(let ((process-environment
(cons (concat "LANG=" aurel-pacman-locale)
process-environment)))
(apply #'call-process pacman nil t nil args)))))
(or aurel-pacman-program
(error (concat "Couldn't find pacman.\n"
"Set aurel-pacman-program to a proper value")))
(with-current-buffer
(or buffer (get-buffer-create aurel-pacman-buffer-name))
(erase-buffer)
(let ((process-environment
(cons (concat "LANG=" aurel-pacman-locale)
process-environment)))
(apply #'call-process aurel-pacman-program nil t nil args))))

(defun aurel-get-foreign-packages ()
"Return list of names of installed foreign packages."
Expand Down

0 comments on commit 45e3f12

Please sign in to comment.