~elais/shaolin-emacs-archive

bcbefe9bb09d08ce6f76ec781f3406834816d2d1 — Elais Player 4 years ago fbb777f master
create setq! macro

The setq! macro automates making sure custom variables as opposed to modifying
variables directly through setq
5 files changed, 69 insertions(+), 19 deletions(-)

M etc/custom.el
M lisp/shao-completion.el
M lisp/shao-defaults.el
M lisp/shao-lsp.el
A lisp/shao-scheme.el
M etc/custom.el => etc/custom.el +5 -2
@@ 3,13 3,16 @@
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(recentf-max-saved-items 50)
 '(safe-local-variable-values
   '((eval modify-syntax-entry 43 "'")
     (eval modify-syntax-entry 36 "'")
     (eval modify-syntax-entry 126 "'"))))
     (eval modify-syntax-entry 126 "'")))
 '(save-abbrevs 'silently)
 '(tao-theme-use-sepia nil))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )
 '(selectrum-current-candidate ((t (:inherit region)))))

M lisp/shao-completion.el => lisp/shao-completion.el +1 -0
@@ 32,6 32,7 @@
;;
;;; Packages
(use-package company
  :demand t
  :diminish company-mode
  :commands (company-complete-common
             company-manual-begin

M lisp/shao-defaults.el => lisp/shao-defaults.el +28 -8
@@ 1,15 1,35 @@
;;; shao-defaults.el --- defaults -*- lexical-binding: t; -*-

;;
;;; Macros

;; Borrowed from Doom Emacs at Henrik's suggestion, please support his work.
(defmacro setq! (&rest settings)
  "A stripped-down `customize-set-variable' with the syntax of `setq'.
This can be used as a drop-in replacement for `setq'. Particularly when you know
a variable has a custom setter (a :set property in its `defcustom' declaration).
This triggers setters. `setq' does not."
  (macroexp-progn
   (cl-loop for (var val) on settings by 'cddr
            collect `(funcall (or (get ',var 'custom-set) #'set)
                              ',var ,val))))

;;
;;; Default Values

;; Credentials  
(setq! user-full-name "Elais Player"
       user-mail-address "elais@fastmail.com")

;; Startup optimizations
(setq inhibit-startup-message t
      inhibit-startup-echo-area-message user-login-name
      inhibit-default-init t
      initial-major-mode 'fundamental-mode
      initial-scratch-message nil)
(setq! inhibit-startup-message t
       inhibit-startup-echo-area-message user-login-name
       inhibit-default-init t
       initial-major-mode 'fundamental-mode
       initial-scratch-message nil)

;; Find .authinfo
(setq auth-sources (list "~/.authinfo.gpg"))
(setq! auth-sources (list "~/.authinfo.gpg"))

(setq-default truncate-lines t)



@@ 52,8 72,8 @@
  
(use-package no-littering
  :config
  (setq auto-save-file-name-transforms
  (setq! auto-save-file-name-transforms
	`((".*" ,(no-littering-expand-var-file-name "auto-save/") t)))
  (setq custom-file (no-littering-expand-etc-file-name "custom.el")))
  (setq! custom-file (no-littering-expand-etc-file-name "custom.el")))

(provide 'shao-defaults)

M lisp/shao-lsp.el => lisp/shao-lsp.el +2 -9
@@ 30,17 30,10 @@
;; bloat

;;; Code:

(use-package direnv
  :demand t
  :hook ((before-hack-local-variables . direnv-update-environment))
  :config
  (direnv-mode +1))
  
(use-package eglot
  :after (company direnv)
  :commands (eglot eglot-ensure)
  :hook ((js-mode . eglot-ensure)))
  :after (company envrc)
  :commands (eglot eglot-ensure))

(provide 'shao-lsp)


A lisp/shao-scheme.el => lisp/shao-scheme.el +33 -0
@@ 0,0 1,33 @@
;;; shao-scheme.el --- Scheme Config -*- lexical-binding: t; -*-
;;
;; Copyright (C) 2020 Elais Player
;;
;; Author: Elais Player <https://git.sr.ht/elais>
;; Maintainer: Elais Player <elais@fastmail.com>
;; Created: June 13, 2020
;; Modified: June 13, 2020
;; Version: 0.0.1
;; Keywords:
;; Homepage: https://git.sr.ht/YY/shaolin-emacs
;; Package-Requires: ((emacs 27))
;;
;; This file is not part of GNU Emacs.
;;
;;; Commentary:
;;
;;  A scheme configuration
;;
;;; Code:

(use-package geiser-install
  :hook ((scheme-mode . geiser-mode))
  :custom
  (geiser-active-implementations '(guile))
  (geiser-smart-tab-p t)
  (geiser-repl-query-on-kill-p nil)
  (geiser-repl-history-filename (expand-file-name
                                 "etc/geiser-history"
                                 user-emacs-directory)))

(provide 'shao-scheme)
;;; shao-scheme.el ends here