aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init-el.org28
1 files changed, 16 insertions, 12 deletions
diff --git a/init-el.org b/init-el.org
index 381af60..9b884c3 100644
--- a/init-el.org
+++ b/init-el.org
@@ -79,14 +79,22 @@ So, to use this file for the very first time you must
;; PACKAGES SETUP
(require 'cl)
-(defun my-package-install (package &optional dont-select)
- (package-install package dont-select))
+(defun my-package-install (package &optional archive dont-select)
+ "archive is a string naming the archive. Will attempt"
+ (unless (assoc package package-alist)
+ (let* ((pkg-descs
+ (assoc package package-archive-contents))
+ (desc
+ (if archive
+ (find archive pkg-descs :test 'equalp :key 'package-desc-archive))))
+ (when desc
+ (package-install desc dont-select)))))
(require 'package)
(add-to-list 'package-archives
- '("melpa" . "https://melpa.org/packages/") t)
-(add-to-list 'package-archives
'("elpa" . "https://elpa.gnu.org/packages/") t)
+(add-to-list 'package-archives
+ '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
(package-refresh-contents)
@@ -231,7 +239,8 @@ So, to use this file for the very first time you must
#+name: org-mode-main-config
#+begin_src elisp :noweb no-export :results none
-(package-install 'org)
+(my-package-install 'org "melpa")
+(require 'org)
(setq org-duration-format 'h:mm)
(setq org-edit-src-content-indentation 0)
@@ -2046,13 +2055,8 @@ messages echo to the echo area.
(defun update-cicadas-now-listening-to ()
(let ((track
- (first
- (last
- (split-string
- (format emms-mode-line-format
- (emms-track-description
- (emms-playlist-current-selected-track)))
- "/")))))
+ (emms-track-description
+ (emms-playlist-current-selected-track))))
(with-temp-buffer
(insert track)
(write-file "/ssh:colin@cicadas.surf:~/.now-listening-to"))))