From d81010103d2d8af5e34e049d99673e545aaae15a Mon Sep 17 00:00:00 2001 From: colin Date: Fri, 5 Apr 2024 20:08:17 -0700 Subject: nicer tangle config --- init-el.org | 230 +++++------------------------------------------------------- 1 file changed, 16 insertions(+), 214 deletions(-) diff --git a/init-el.org b/init-el.org index 6cab7d7..b9ad35f 100644 --- a/init-el.org +++ b/init-el.org @@ -1,5 +1,9 @@ -*- buffer-read-only: t -*- #+auto_tangle: t +#+PROPERTY: header-args:elisp+ :tangle ~/.emacs.d/init.el +#+PROPERTY: header-args:elisp+ :results none +#+PROPERTY: header-args:elisp+ :lexical t +#+PROPERTY: header-args:elisp+ :noweb-sep "\n\n" #+OPTIONS: html-style:nil * init.el @@ -24,7 +28,7 @@ #+name: preamble #+begin_src elisp :noweb no-export - +;;; PREAMBLE (setq custom-file (concat user-emacs-directory "../notes/custom.el")) (load custom-file 'noerror) @@ -172,6 +176,8 @@ I'm using melpa and elpa package archives. #+name: my-leader-key-major-mode-menu #+begin_src elisp :results none +;; major mode leaader keys + (defvar my-major-mode-list nil "subcommands by major-mode") (setf my-major-mode-list '((org-mode my-org-command) @@ -212,14 +218,12 @@ I'm using melpa and elpa package archives. * Org Mode Configs -#+name: org-mode-config -#+begin_src elisp :noweb no-export -#+end_src - ** Org Mode Main Config #+name: org-mode-main-config #+begin_src elisp :noweb no-export :results none +;; org mode config + (package-install 'org) (require 'org) (setq org-duration-format 'h:mm) @@ -269,7 +273,7 @@ I'm using melpa and elpa package archives. ** My-Leader Key for Org Major Mode #+name: org-mode-leader-key-menu #+begin_src elisp :results none :noweb no-export - +;; org mode leader keys and related commands (defun org-src--source-buffer () (marker-buffer org-src--beg-marker)) @@ -349,90 +353,13 @@ again, if it was whent he org edit src buffer was opened." #+end_src -** Org Protocol Config - -Following the guide [[https://orgmode.org/worg/org-contrib/org-protocol.html][here]] about setting up org protocol and emacs -server. - -This allows emacs to intercept org protocol requests from emacsclient -in order to take some actions. I'm using it here as part of a DIY -read-it-later app - I can push a button in my web browser and cache an -article for later reading. - -*** Org init.el config -First, update the config - -#+name: org-protocol-config -#+begin_src elisp :noweb no-export - -(server-start) -(require 'org-protocol) - -#+end_src - -#+RESULTS: org-protocol-config -: org-protocol - - -*** desktop entry -Second, make an org-protocol desktop entry - -#+begin_src conf :tangle ~/.local/share/applications/org-protocol.desktop :results none - -[Desktop Entry] -Name=org-protocol -Comment=Intercept calls from emacsclient to trigger custom actions -Categories=Other; -Keywords=org-protocol; -Icon=emacs -Type=Application -Exec=emacsclient -n %u -Terminal=false -StartupWMClass=Emacs -MimeType=x-scheme-handler/org-protocol; - -#+end_src - -and tell your system about it. You might need to install something: - -#+begin_src bash -sudo apt-get install desktop-file-utils -#+end_src - -Then run this: - -#+begin_src bash -update-desktop-database ~/.local/share/applications/ -#+end_src - -#+RESULTS: - -Finally, to actually use it, make a book mark like so: - -e.g. here's one for org capture - -#+begin_src - javascript:location.href='org-protocol://capture:/w/'+encodeURIComponent(location.href)+'/'+encodeURIComponent(document.title)+'/'+encodeURIComponent(window.getSelection()) -#+end_src - -** COMMENT Bells and Whistles - -#+name: org-bells-and-wistles -#+begin_src elisp :results none -(package-install 'org-superstar) -(require 'org-superstar) -(add-hook 'org-mode-hook (lambda () - (org-superstar-mode 1) - (visual-line-mode))) - -#+end_src - - * UI ** Fonts #+name: ui-fonts #+begin_src elisp :noweb no-export +;; fonts + (add-to-list 'default-frame-alist '(font . "DejaVu Sans Mono-10") ;'(font . "Comic Mono-11") @@ -488,6 +415,8 @@ e.g. here's one for org capture #+name: ui-tweaks-config #+begin_src elisp :results none +;; global keys + (global-unset-key (kbd "")) (global-unset-key "\C-z") (setq-default indent-tabs-mode nil) @@ -501,6 +430,8 @@ e.g. here's one for org capture #+name: ui-completion-engine #+begin_src elisp :results none +;; command completions + (package-install 'ivy) ;(package-install 'smex) (package-install 'amx) @@ -1576,132 +1507,3 @@ Saves to a temp file and puts the filename in the kill ring." (load "~/projects/cicadas.org/cicatasks.el") #+end_src -* Tangle - -This block of code tangles the above into =~/.emacs.d/init.el= which -emacs loads at startup. - -#+begin_src elisp :tangle ~/.emacs.d/init.el :noweb no-export :results none -;;;; init.el - -;;;; DO NOT EDIT: This file has been generated by org-babel-tangle -;;;; from a source file called init-el.org. - -<> -<> -<> - -(message "Preamble and Setup Loaded") -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; LEADER KEY DEFINITION AND TOPLEVEL MENUS ;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - - -<> -<> -<> -<> -<> -<> - -(message "Leader Key Setup Loaded") -;;;;;;;;;;;;;;;;;;;;;; -;; ORG-MODE CONFIGS ;; -;;;;;;;;;;;;;;;;;;;;;; - -<> -<> -<> -<> - -(message "Org-Mode Config Loaded ") - -;;;;;;;; -;; UI ;; -;;;;;;;; - -<> -<> -<> - -<> -<> -<> -<> -<> -<> - -<> -<> -<> -<> -<> - -(message "UI Config Loaded") -;;;;;;;;;;;;;;;;;;;;; -;; TIME MANAGEMENT ;; -;;;;;;;;;;;;;;;;;;;;; - -<> -<> -<> -<> -<> -<> - -(message "Time Management Config Loaded") - -;;;;;;;;;;;;;;;;;;;;;;;;; -;; COMMUNICATION TOOLS ;; -;;;;;;;;;;;;;;;;;;;;;;;;; - -<> - -(message "Communication tools Config Loaded") -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; READING, WRITING, AND NOTETAKING ;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -<> -<> -<> -<> -<> -<> -<> -<> -<> -<> -<> -<> - -(message "Reading and Writing Config Loaded") - -;;;;;;;;;;;;;;;;;; -;; SOFTWARE DEV ;; -;;;;;;;;;;;;;;;;;; - -<> -<> -<> -<> -<> -<> -<> -<> -<> -<> - -(message "Software Dev Config Loaded") -;;;;;;;;;;;;;;;;;;;;;; -;; TOOLS AND UTILS ;; -;;;;;;;;;;;;;;;;;;;;;; - -<> -<> -<> - -(message "Tools and Utils Config Loaded") -(message "FINISHED LOADED") - -#+end_src -- cgit v1.2.3