From 0aa0b2396219aaa5b1ac3f31d8260cbc2606f61a Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Tue, 30 Jan 2024 13:24:02 -0800 Subject: [PATCH] =?UTF-8?q?Add=20custom=20=E2=80=98emacs-company=E2=80=99?= =?UTF-8?q?=20package,=20remove=20custom=20=E2=80=98emacs-notmuch=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The custom ‘emacs-notmuch’ package isn't necessary anymore since my patch was submitted[1] The custom ‘emacs-company’ fixes some issues with icons and images not loading while installed with Guix. [1]: https://issues.guix.gnu.org/68667 --- oni/home/config/rincewind.scm | 29 +++++++++++----------- oni/packages/emacs.scm | 45 +++++++++++++++++++---------------- 2 files changed, 40 insertions(+), 34 deletions(-) diff --git a/oni/home/config/rincewind.scm b/oni/home/config/rincewind.scm index a18e196..4191d40 100644 --- a/oni/home/config/rincewind.scm +++ b/oni/home/config/rincewind.scm @@ -23,7 +23,8 @@ #:use-module ((gnu packages emacs-xyz) #:select (emacs-org-roam emacs-guix - emacs-org-contacts)) + emacs-org-contacts + emacs-company)) #:use-module ((gnu packages file-systems) #:select (tmsu)) #:use-module ((gnu packages forth) @@ -139,7 +140,7 @@ #:select (count-emails)) #:use-module ((oni packages emacs) #:select (emacs-inkplate - oni-emacs-notmuch + oni-emacs-company emacs-outli emacs-syncthing-status)) #:use-module ((oni packages emacs-config) @@ -214,8 +215,8 @@ `((with-branch . ,(string-append (package-name package) "=master")))) package)) -(define with-my-emacs-notmuch-package - (package-input-rewriting `((,emacs-notmuch . ,oni-emacs-notmuch)))) +(define with-my-emacs-company-package + (package-input-rewriting `((,emacs-company . ,oni-emacs-company)))) (define rincewind-picom-service (service home-picom-service-type @@ -268,15 +269,15 @@ emacs-guix (emacs-oni-org-roam my-emacs) - emacs-oni-elisp + (with-my-emacs-company-package emacs-oni-elisp) emacs-oni-core emacs-oni-elfeed - emacs-oni-eshell + (with-my-emacs-company-package emacs-oni-eshell) emacs-oni-compilation - emacs-oni-common-lisp + (with-my-emacs-company-package emacs-oni-common-lisp) emacs-oni-gui emacs-oni-magit - (with-my-emacs-notmuch-package emacs-oni-notmuch) + emacs-oni-notmuch emacs-oni-hy emacs-oni-project emacs-oni-bookmark @@ -284,12 +285,12 @@ emacs-oni-browse-url emacs-oni-c emacs-oni-circe - emacs-oni-clojure - emacs-oni-cmake + (with-my-emacs-company-package emacs-oni-clojure) + (with-my-emacs-company-package emacs-oni-cmake) emacs-oni-conf - emacs-oni-cpp - emacs-oni-csharp - emacs-oni-css + (with-my-emacs-company-package emacs-oni-cpp) + (with-my-emacs-company-package emacs-oni-csharp) + (with-my-emacs-company-package emacs-oni-css) emacs-oni-diff-hl emacs-oni-ediff emacs-oni-elm @@ -309,7 +310,7 @@ emacs-oni-nxml emacs-oni-package emacs-oni-projectile - emacs-oni-scheme + (with-my-emacs-company-package emacs-oni-scheme) emacs-oni-sh emacs-oni-shr emacs-oni-tramp diff --git a/oni/packages/emacs.scm b/oni/packages/emacs.scm index 5fe317b..b3f8d2f 100644 --- a/oni/packages/emacs.scm +++ b/oni/packages/emacs.scm @@ -417,33 +417,38 @@ new-theme for a while. I couldn't think of a name so I named it after him.") (description "A simple capf (Completion-At-Point Function) for completing yasnippet snippets.") (license license:gpl3)))) -(define-public oni-emacs-notmuch +(define-public oni-emacs-company (package - (inherit notmuch) - (name "oni-emacs-notmuch") + (name "oni-emacs-company") + (version "0.10.2") + (source + (origin + (method url-fetch) + (uri (string-append "https://elpa.gnu.org/packages/" + "company-" version ".tar")) + (sha256 + (base32 "0j2qrnx2w2al4f2n37b89q0pkabh5ccv00gsknvgaylhy0za5gq9")))) (build-system emacs-build-system) - (native-inputs '()) - (inputs - (list notmuch)) (arguments (list - #:exclude #~(cons* "make-deps.el" "rstdoc.el" %default-exclude) - #:include #~(cons* "notmuch-logo.svg" %default-include) + #:include #~(cons* "icons/" %default-include) #:phases #~(modify-phases %standard-phases - (add-after 'unpack 'chdir - (lambda _ - (chdir "emacs"))) - (add-after 'chdir 'patch-paths - (lambda* (#:key inputs #:allow-other-keys) - (let ((notmuch (search-input-file inputs "/bin/notmuch"))) - (substitute* "notmuch-lib.el" - (("\"notmuch\"") - (string-append "\"" notmuch "\""))))))))) - (synopsis "Run Notmuch within Emacs") + (add-after 'move-doc 'install-doc-images + (lambda* (#:key outputs #:allow-other-keys) + (let ((images (find-files "./images/small/" ".*\\.png$"))) + (for-each (lambda (image) + (install-file image + (string-append #$output "/share/info/images/small"))) + images))))))) + (home-page "https://company-mode.github.io/") + (synopsis "Modular text completion framework") (description - "This package provides an Emacs-based interface to the Notmuch mail -system."))) + "Company is a modular completion mechanism. Modules for retrieving +completion candidates are called back-ends, modules for displaying them are +front-ends. Company comes with many back-ends, e.g., @code{company-elisp}. +These are distributed in separate files and can be used individually.") + (license license:gpl3+))) (define-public emacs-golden-ratio (let ((commit "375c9f287dfad68829582c1e0a67d0c18119dab9")