Add configuration for emacs-helpful
This commit is contained in:
parent
28ff76fc03
commit
cb90aa8b43
3 changed files with 97 additions and 4 deletions
|
@ -68,7 +68,9 @@
|
||||||
#:select (home-dunst-default-service))
|
#:select (home-dunst-default-service))
|
||||||
#:use-module ((oni home services emacs)
|
#:use-module ((oni home services emacs)
|
||||||
#:select (home-emacs-service-type
|
#:select (home-emacs-service-type
|
||||||
home-emacs-configuration))
|
home-emacs-configuration
|
||||||
|
home-emacs-helpful-service-type
|
||||||
|
home-emacs-helpful-configuration))
|
||||||
#:use-module ((oni home services environment)
|
#:use-module ((oni home services environment)
|
||||||
#:select (home-environment-service))
|
#:select (home-environment-service))
|
||||||
#:use-module ((oni home services flameshot)
|
#:use-module ((oni home services flameshot)
|
||||||
|
@ -316,6 +318,11 @@
|
||||||
"(load custom-file)\n"
|
"(load custom-file)\n"
|
||||||
"(provide 'init)\n"
|
"(provide 'init)\n"
|
||||||
";;; init.el ends here\n")))))
|
";;; init.el ends here\n")))))
|
||||||
|
(service home-emacs-helpful-service-type
|
||||||
|
(home-emacs-helpful-configuration
|
||||||
|
(configurations
|
||||||
|
(list
|
||||||
|
(local-file "../services/emacs/helpful.el")))))
|
||||||
|
|
||||||
(service home-flameshot-service-type)
|
(service home-flameshot-service-type)
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,13 @@
|
||||||
#:use-module ((gnu services configuration)
|
#:use-module ((gnu services configuration)
|
||||||
#:select (serialize-package
|
#:select (serialize-package
|
||||||
define-configuration
|
define-configuration
|
||||||
|
define-configuration/no-serialization
|
||||||
text-config?
|
text-config?
|
||||||
serialize-text-config))
|
serialize-text-config))
|
||||||
#:use-module ((gnu packages emacs)
|
#:use-module ((gnu packages emacs)
|
||||||
#:select (emacs))
|
#:select (emacs))
|
||||||
|
#:use-module ((gnu packages emacs-xyz)
|
||||||
|
#:select (emacs-helpful))
|
||||||
#:use-module ((gnu home services)
|
#:use-module ((gnu home services)
|
||||||
#:select (service-type
|
#:select (service-type
|
||||||
service-extension
|
service-extension
|
||||||
|
@ -23,12 +26,20 @@
|
||||||
#:select (package?))
|
#:select (package?))
|
||||||
|
|
||||||
#:export (home-emacs-service-type
|
#:export (home-emacs-service-type
|
||||||
home-emacs-configuration))
|
home-emacs-configuration
|
||||||
|
|
||||||
|
home-emacs-helpful-service-type
|
||||||
|
home-emacs-helpful-configuration))
|
||||||
|
|
||||||
|
(define-configuration/no-serialization home-emacs-extension
|
||||||
|
(configurations
|
||||||
|
(text-config '())
|
||||||
|
"The configuration for the extension."))
|
||||||
|
|
||||||
(define-configuration home-emacs-configuration
|
(define-configuration home-emacs-configuration
|
||||||
(package
|
(package
|
||||||
(package emacs)
|
(package emacs)
|
||||||
"Package to use for setting Emacs")
|
"Package to use for setting Emacs")
|
||||||
(configurations
|
(configurations
|
||||||
(text-config '())
|
(text-config '())
|
||||||
"A list of other configuration files to autoload"))
|
"A list of other configuration files to autoload"))
|
||||||
|
@ -36,6 +47,13 @@
|
||||||
(define (add-emacs-packages config)
|
(define (add-emacs-packages config)
|
||||||
(list (home-emacs-configuration-package config)))
|
(list (home-emacs-configuration-package config)))
|
||||||
|
|
||||||
|
(define (home-emacs-extensions original-config extension-configs)
|
||||||
|
(home-emacs-configuration
|
||||||
|
(inherit original-config)
|
||||||
|
(configurations
|
||||||
|
(apply append (home-emacs-configuration-configurations original-config)
|
||||||
|
(map home-emacs-extension-configurations extension-configs)))))
|
||||||
|
|
||||||
(define (home-emacs-shepherd-service config)
|
(define (home-emacs-shepherd-service config)
|
||||||
(list
|
(list
|
||||||
(shepherd-service
|
(shepherd-service
|
||||||
|
@ -69,5 +87,35 @@
|
||||||
home-files-service-type
|
home-files-service-type
|
||||||
home-emacs-config-files)))
|
home-emacs-config-files)))
|
||||||
(compose identity)
|
(compose identity)
|
||||||
|
(extend home-emacs-extensions)
|
||||||
(default-value (home-emacs-configuration))
|
(default-value (home-emacs-configuration))
|
||||||
(description "Install and configure Emacs.")))
|
(description "Install and configure Emacs.")))
|
||||||
|
|
||||||
|
(define-configuration/no-serialization home-emacs-helpful-configuration
|
||||||
|
(package
|
||||||
|
(package emacs-helpful)
|
||||||
|
"Package to use for setting emacs-helpful.")
|
||||||
|
(configurations
|
||||||
|
(text-config '())
|
||||||
|
"Configuration for emacs-helpful."))
|
||||||
|
|
||||||
|
(define (add-emacs-helpful config)
|
||||||
|
(home-emacs-extension
|
||||||
|
(configurations (home-emacs-helpful-configuration-configurations config))))
|
||||||
|
|
||||||
|
(define (add-emacs-helpful-packages config)
|
||||||
|
(list (home-emacs-helpful-configuration-package config)))
|
||||||
|
|
||||||
|
(define home-emacs-helpful-service-type
|
||||||
|
(service-type
|
||||||
|
(name 'home-emacs-helpful)
|
||||||
|
(extensions
|
||||||
|
(list (service-extension
|
||||||
|
home-emacs-service-type
|
||||||
|
add-emacs-helpful)
|
||||||
|
(service-extension
|
||||||
|
home-profile-service-type
|
||||||
|
add-emacs-helpful-packages)))
|
||||||
|
(compose identity)
|
||||||
|
(default-value (home-emacs-helpful-configuration))
|
||||||
|
(description "Install and configure emacs-helpful.")))
|
||||||
|
|
38
oni/home/services/emacs/helpful.el
Normal file
38
oni/home/services/emacs/helpful.el
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
;;; helpful.el --- Helpful configuration -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;; Copyright (C) 2023 Tom Willemse
|
||||||
|
|
||||||
|
;; Author: Tom Willemse <tom@ryuslash.org>
|
||||||
|
;; Keywords: local
|
||||||
|
|
||||||
|
;; This program is free software; you can redistribute it and/or modify
|
||||||
|
;; it under the terms of the GNU General Public License as published by
|
||||||
|
;; the Free Software Foundation, either version 3 of the License, or
|
||||||
|
;; (at your option) any later version.
|
||||||
|
|
||||||
|
;; This program is distributed in the hope that it will be useful,
|
||||||
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
;; GNU General Public License for more details.
|
||||||
|
|
||||||
|
;; You should have received a copy of the GNU General Public License
|
||||||
|
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; This is my helpful configuration.
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
(use-package helpful
|
||||||
|
:config
|
||||||
|
(global-set-key [remap describe-callable] #'helpful-callable)
|
||||||
|
(global-set-key [remap describe-function] #'helpful-function)
|
||||||
|
(global-set-key (kbd "C-h M") #'helpful-macro)
|
||||||
|
(global-set-key [remap describe-command] #'helpful-command)
|
||||||
|
(global-set-key [remap describe-key] #'helpful-key)
|
||||||
|
(global-set-key [remap describe-variable] #'helpful-variable)
|
||||||
|
(global-set-key (kbd "C-h T") #'helpful-at-point))
|
||||||
|
|
||||||
|
(provide 'helpful)
|
||||||
|
;;; helpful.el ends here
|
Loading…
Reference in a new issue