From 04ecb5b706fe0d00dccf33973d7fee7bbe8880c2 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Thu, 8 Sep 2022 07:51:25 -0500 Subject: 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. --- init-el.org | 28 ++++++++++++++++------------ 1 file 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")))) -- cgit v1.2.3