diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-23 22:47:31 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-23 22:47:31 -0500 |
| commit | 4345ae1abbb06d9f7cb939ea4bc82bb6e2b0e941 (patch) | |
| tree | 814e1aacf1121e9489b8f46643d86ff68d277fed | |
| parent | f2d55d11b375535fa7ebdaf526f674eb99ab7884 (diff) | |
geiser support and org refactoring
- add Geiser-guile for Emacs Guile Support
- combine org-appearance-config with org-config
- move jump to keyboard commands to the keybindings file
- assign winner-undo to F5
- remove undefined compilation setting
| -rw-r--r-- | early-init.el | 5 | ||||
| -rw-r--r-- | init.el | 11 | ||||
| -rw-r--r-- | modules/keybindings.el | 25 | ||||
| -rw-r--r-- | modules/org-appearance-config.el | 64 | ||||
| -rw-r--r-- | modules/org-config.el | 51 | ||||
| -rw-r--r-- | modules/test-code.el | 10 | ||||
| -rw-r--r-- | modules/ui-navigation.el | 5 | ||||
| -rw-r--r-- | modules/user-constants.el | 19 |
8 files changed, 94 insertions, 96 deletions
diff --git a/early-init.el b/early-init.el index 2678815d..bd7ee73a 100644 --- a/early-init.el +++ b/early-init.el @@ -47,11 +47,6 @@ (setq debug-on-error nil) (setq debug-on-quit nil))) -;; -------------------------------- Compilation -------------------------------- - -;; Remove any .eln files inapplicable to this invocation -(setq native-compile-prune-cache t) - ;; --------------------------- Warning Notifications --------------------------- ;; log warnings, but don't popup the warnings buffer @@ -12,20 +12,20 @@ (defvar user-whole-name "Craig Jennings" "The user's full name.") -(defconst user-name (getenv "USER") +(defconst user-name (getenv "USER") "The user's name retrieved from the environment variable.") (defvar user-mail-address "c@cjennings.net" "The user's email address.") ;; ---------------------------- System Configuration --------------------------- -(add-to-list 'load-path (concat user-emacs-directory "assets")) -(add-to-list 'load-path (concat user-emacs-directory "custom")) -(add-to-list 'load-path (concat user-emacs-directory "modules")) +(add-to-list 'load-path (concat user-emacs-directory "assets/")) +(add-to-list 'load-path (concat user-emacs-directory "custom/")) +(add-to-list 'load-path (concat user-emacs-directory "modules/")) (require 'user-constants) -(require 'config-utilities) ;; functions useful when modifying Emacs config (require 'host-environment) ;; convenience functions re: host environment +(require 'config-utilities) ;; functions useful when modifying Emacs config (require 'system-defaults) (require 'keybindings) @@ -91,7 +91,6 @@ (require 'org-config) (require 'org-agenda-config) -(require 'org-appearance-config) (require 'org-babel-config) (require 'org-capture-config) (require 'org-refile-config) diff --git a/modules/keybindings.el b/modules/keybindings.el index 5d8b6bdd..4de768f0 100644 --- a/modules/keybindings.el +++ b/modules/keybindings.el @@ -73,6 +73,31 @@ (global-set-key (kbd "C-c ?") 'hydra-general/body) + +;; ------------------------------ Jump To Commands ----------------------------- +;; quick access for commonly used files + +(defvar jump-to-keymap (make-sparse-keymap) + "Jump-to commonly used files/directories/commands.") +(global-set-key (kbd "C-c j") jump-to-keymap) + +(define-key jump-to-keymap (kbd "s") + #'(lambda () (interactive) (find-file schedule-file))) +(define-key jump-to-keymap (kbd "i") + #'(lambda () (interactive) (find-file inbox-file))) +(define-key jump-to-keymap (kbd "c") + #'(lambda () (interactive) (find-file contacts-file))) +(define-key jump-to-keymap (kbd "a") + #'(lambda () (interactive) (find-file article-file))) +(define-key jump-to-keymap (kbd "A") + #'(lambda () (interactive) (find-file article-archive))) +(define-key jump-to-keymap (kbd "$") + #'(lambda () (interactive) (find-file ledger-file))) +(define-key jump-to-keymap (kbd "m") + #'(lambda () (interactive) (find-file macros-file))) +(define-key jump-to-keymap (kbd "I") + #'(lambda () (interactive) (find-file emacs-init-file))) + ;; ---------------------------- General Keybindings ---------------------------- ;; Avoid hostile bindings diff --git a/modules/org-appearance-config.el b/modules/org-appearance-config.el deleted file mode 100644 index 7522b5c5..00000000 --- a/modules/org-appearance-config.el +++ /dev/null @@ -1,64 +0,0 @@ -;;; org-appearance-config.el --- Org-Mode UI Appearance Settings -*- lexical-binding: t; -*- - -;;; Commentary: -;; - -;;; Code: - -(with-eval-after-load 'org - - ;; face settings need to be called every time org mode is loaded. - (defun cj/set-org-face-settings() - "Sets foreground, background, and font styles for org mode. -To be called every time org is loaded." - (interactive) - ;; org-hide should use fix-pitch to align indents for proportional fonts - (set-face-attribute 'org-hide nil :inherit 'fixed-pitch) - (set-face-attribute 'org-meta-line nil :inherit 'shadow) - - ;; Remove foreground and background from block faces - (set-face-attribute 'org-block nil :foreground 'unspecified :background 'unspecified) - (set-face-attribute 'org-block-begin-line nil :foreground 'unspecified :background 'unspecified) - (set-face-attribute 'org-block-end-line nil :foreground 'unspecified :background 'unspecified) - - ;; Get rid of the background on column views - (set-face-attribute 'org-column nil :background 'unspecified) - (set-face-attribute 'org-column-title nil :background 'unspecified) - - ;; make sure org-links are underlined - (set-face-attribute 'org-link nil :underline t) - - ;; remove hook after first run to avoid calling function everytime a frame is made - (if (daemonp) - (remove-hook 'server-after-make-frame-hook #'cj/set-org-face-settings))) - - ;; if emacsclient, setup hook to run font settings function, otherwise, run it now - (if (daemonp) - (add-hook 'server-after-make-frame-hook #'cj/set-org-face-settings) - (cj/set-org-face-settings)) - - - ;; settings need to be called only once - (setq org-ellipsis " ▾") ;; change ellipses to down arrow - (setq org-hide-emphasis-markers t) ;; remove emphasis markers to keep the screen clean - (setq org-hide-leading-stars t) ;; hide leading stars, just show one per line - (setq org-pretty-entities t) ;; render special symbols - (setq org-pretty-entities-include-sub-superscripts nil) ;; ...except superscripts and subscripts - (setq org-fontify-emphasized-text nil) ;; ...and don't render bold and italic markup - (setq org-fontify-whole-heading-line t) ;; fontify the whole line for headings (for face-backgrounds) - (add-hook 'org-mode-hook 'prettify-symbols-mode) - - - - ;; nicer bullets than simple asterisks. - (use-package org-superstar - :after org - :config - (org-superstar-configure-like-org-bullets) - (setq org-superstar-leading-bullet ?\s) - (add-hook 'org-mode-hook (lambda () (org-superstar-mode 1)))) - - ) ;; end with-eval-after-load - -(provide 'org-appearance-config) -;;; org-appearance-config.el ends here. diff --git a/modules/org-config.el b/modules/org-config.el index f084a8c0..ac206d09 100644 --- a/modules/org-config.el +++ b/modules/org-config.el @@ -18,11 +18,14 @@ ;;; Code: -;; --------------------------------- Constants --------------------------------- +;; ------------------------------- Org Constants ------------------------------- ;; note: some constants used here are defined in init.el -(defvar org-archive-location (concat sync-dir "/archives/archive.org::datetree/")) ;; location of archive file -(defvar org-project-files (list schedule-file)) +(defvar org-archive-location + (concat sync-dir "/archives/archive.org::datetree/") + "Location of the archive file. +The archive file is where org entries that are archived via +org-archive-subtree-default are placed.") ;; ---------------------------- Org General Settings --------------------------- @@ -60,6 +63,36 @@ ;; force pdfs exported from org to open in emacs (add-to-list 'org-file-apps '("\\.pdf\\'" . emacs))) +;; -------------------------- Org Appearance Settings -------------------------- + +(defun cj/org-appearance-settings() + "Set foreground, background, and font styles for org mode." + (interactive) + ;; org-hide should use fix-pitch to align indents for proportional fonts + (set-face-attribute 'org-hide nil :inherit 'fixed-pitch) + (set-face-attribute 'org-meta-line nil :inherit 'shadow) + + ;; Remove foreground and background from block faces + (set-face-attribute 'org-block nil :foreground 'unspecified :background 'unspecified) + (set-face-attribute 'org-block-begin-line nil :foreground 'unspecified :background 'unspecified) + (set-face-attribute 'org-block-end-line nil :foreground 'unspecified :background 'unspecified) + + ;; Get rid of the background on column views + (set-face-attribute 'org-column nil :background 'unspecified) + (set-face-attribute 'org-column-title nil :background 'unspecified) + + ;; make sure org-links are underlined + (set-face-attribute 'org-link nil :underline t) + + (setq org-ellipsis " ▾") ;; change ellipses to down arrow + (setq org-hide-emphasis-markers t) ;; remove emphasis markers to keep the screen clean + (setq org-hide-leading-stars t) ;; hide leading stars, just show one per line + (setq org-pretty-entities t) ;; render special symbols + (setq org-pretty-entities-include-sub-superscripts nil) ;; ...except superscripts and subscripts + (setq org-fontify-emphasized-text nil) ;; ...and don't render bold and italic markup + (setq org-fontify-whole-heading-line t) ;; fontify the whole line for headings (for face-backgrounds) + (add-hook 'org-mode-hook 'prettify-symbols-mode)) + ;; ----------------------------- Org TODO Settings --------------------------- (defun cj/org-todo-settings () @@ -175,8 +208,20 @@ :config (cj/org-general-settings) + (cj/org-appearance-settings) (cj/org-todo-settings)) + +;; ------------------------------- Org Superstar ------------------------------- + +;; nicer bullets than simple asterisks. +(use-package org-superstar + :after org + :config + (org-superstar-configure-like-org-bullets) + (setq org-superstar-leading-bullet ?\s) + (add-hook 'org-mode-hook (lambda () (org-superstar-mode 1)))) + ;; ------------------------------- Org-Checklist ------------------------------- ;; needed for org-habits to reset checklists once task is complete ;; this was a part of org-contrib which was deprecated diff --git a/modules/test-code.el b/modules/test-code.el index d9759e6e..409f8e07 100644 --- a/modules/test-code.el +++ b/modules/test-code.el @@ -7,6 +7,16 @@ ;;; Code: +;; -------------------------------- Geiser Guile ------------------------------- +;; Guile support in Emacs + +(use-package geiser-guile + :defer 1 + :commands (geiser-guile) + :bind ("C-c G" . geiser-guile) + :config + (setq geiser-guile-binary "/usr/bin/guile")) + ;; ---------------------------------- Yeetube ---------------------------------- ;; youtube frontend for emacs diff --git a/modules/ui-navigation.el b/modules/ui-navigation.el index e9f3cdc5..49c9f631 100644 --- a/modules/ui-navigation.el +++ b/modules/ui-navigation.el @@ -116,7 +116,8 @@ This function won't work with more than one split window." (buffer-files-list (delq nil (mapcar (lambda (buf) (when (buffer-file-name buf) - (expand-file-name (buffer-file-name buf)))) (buffer-list))))) + (expand-file-name (buffer-file-name buf)))) + (buffer-list))))) (mapc (lambda (buf-file) (setq recently-killed-list @@ -134,7 +135,7 @@ This function won't work with more than one split window." (use-package winner-mode :ensure nil ;; built-in :defer .5 - :bind ("C-z C-z" . winner-undo)) + :bind ("<f5>" . winner-undo)) (provide 'ui-navigation) ;;; ui-navigation.el ends here diff --git a/modules/user-constants.el b/modules/user-constants.el index 269ea540..6ed74d37 100644 --- a/modules/user-constants.el +++ b/modules/user-constants.el @@ -10,6 +10,9 @@ ;; ------------------------ Directory And File Constants ----------------------- ;; DIRECTORIES +(defconst user-home-dir (getenv "HOME") + "The user's home directory per the environment variable.") + (defconst emacs-init-file (concat user-emacs-directory "init.el") "The location of Emacs's main init file.") @@ -84,21 +87,5 @@ ledger-file macros-file)) -;; ------------------------------ Jump To Commands ----------------------------- -;; quick access for commonly used files - -(defvar jump-to-keymap nil "Jump-to commonly used files/directories/commands.") -(setq jump-to-keymap (make-sparse-keymap)) -(global-set-key (kbd "C-c j") jump-to-keymap) -(define-key jump-to-keymap (kbd "s") #'(lambda () (interactive) (find-file schedule-file))) -(define-key jump-to-keymap (kbd "i") #'(lambda () (interactive) (find-file inbox-file))) -(define-key jump-to-keymap (kbd "c") #'(lambda () (interactive) (find-file contacts-file))) -(define-key jump-to-keymap (kbd "a") #'(lambda () (interactive) (find-file article-file))) -(define-key jump-to-keymap (kbd "A") #'(lambda () (interactive) (find-file article-archive))) -(define-key jump-to-keymap (kbd "$") #'(lambda () (interactive) (find-file ledger-file))) -(define-key jump-to-keymap (kbd "m") #'(lambda () (interactive) (find-file macros-file))) -(define-key jump-to-keymap (kbd "I") #'(lambda () (interactive) (find-file emacs-init-file))) - - (provide 'user-constants) ;;; user-constants.el ends here. |
