aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Okay <colin@cicadas.surf>2022-09-08 07:51:25 -0500
committerColin Okay <colin@cicadas.surf>2022-09-08 07:51:25 -0500
commit04ecb5b706fe0d00dccf33973d7fee7bbe8880c2 (patch)
tree90239db09108cdcecafaff418a3453790a30f425
parent80564aedc2f21037eac827a8080868862b4bf9c0 (diff)
Add: my-package-install; Tweak: emms stuff
Evidently, this whole time, (package-install 'org) wasn't doing anything - just using the built in org. In order to install org from one of the archives, one must pick the package-desc instance out from the package-archive-contents.
-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"))))