From c1b330ca807b37bf86ab8573df5c0896d58a5bcf Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 31 Mar 2021 19:10:09 -0500 Subject: Fixup comments for outshine-mode --- init.el | 156 ++++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 79 insertions(+), 77 deletions(-) diff --git a/init.el b/init.el index da2e440..1e2e586 100644 --- a/init.el +++ b/init.el @@ -7,27 +7,27 @@ ;; This file is NOT part of GNU Emacs. -;;; License: +;;;- License: ;; Everyone is permitted to do whatever with this software, without ;; limitation. This software comes without any warranty whatsoever, ;; but with two pieces of advice: ;; - Don't hurt yourself. ;; - Make good choices. -;;; Code: +;;;- Code: ;;; `setup' -- configuration macro (straight-use-package '(setup :host nil :repo "https://git.sr.ht/~zge/setup")) (require 'setup) -;; shorthand for `customize-set-variable' (via setup) +;;;; shorthand for `customize-set-variable' (via setup) (defmacro setc (&rest args) "Customize user options using ARGS like `setq'." (declare (debug setq)) `(setup (:option ,@args))) -;; Install packages with `straight-use-package' +;;;; Install packages with `straight-use-package' (setup-define :straight (lambda (recipe) `(straight-use-package ',recipe)) @@ -39,7 +39,7 @@ (car recipe) recipe)))) -;; Set options using `setq-default', instead of `customize-set-variable' +;;;; Set options using `setq-default', instead of `customize-set-variable' ;; From what I can tell, `customize-set-variable' loads "all the dependencies ;; for each SYMBOL it sets (see `custom-load-symbol'). Since I don't want to do ;; that all the time, here's `:set'. DON'T USE THIS HARDLY EVER. Honestly, I @@ -51,7 +51,7 @@ :debug '(sexp form) :repeatable t) -;; Bind keys to `acdw/map' +;;;; Bind keys to `acdw/map' (setup-define :acdw/map (lambda (key command) `(progn @@ -63,7 +63,7 @@ :debug '(form sexp) :repeatable t) -;; Bind keys to `acdw/leader' +;;;; Bind keys to `acdw/leader' (setup-define :acdw/leader (lambda (key command) `(progn @@ -75,7 +75,7 @@ :debug '(form sexp) :repeatable t) -;; Bind keys, and autoload the functions they're bound to. +;;;; Bind keys, and autoload the functions they're bound to. (setup-define :bind-autoload (lambda (key command) `(progn @@ -87,16 +87,16 @@ :debug '(form sexp) :repeatable t) -;;; About me +;;; Good defaults + +;;;; About me (setc user-full-name "Case Duckworth" user-mail-address "acdw@acdw.net" calendar-location-name "Baton Rouge, LA" calendar-latitude 30.4 calendar-longitude -91.1) -;;; Good defaults - -;; Lines +;;;; Lines (setc fill-column 80 word-wrap t truncate-lines nil) @@ -105,7 +105,7 @@ (global-display-fill-column-indicator-mode +1) (global-so-long-mode +1) -;; Whitespace +;;;; Whitespace (setc whitespace-style '(empty indentation space-before-tab space-after-tab) indent-tabs-mode nil @@ -113,7 +113,7 @@ smie-indent-basic tab-width) (add-hook 'before-save-hook #'whitespace-cleanup) -;; Pairs +;;;; Pairs (setc show-paren-delay 0 show-paren-style 'mixed show-paren-when-point-inside-paren t @@ -121,7 +121,7 @@ (show-paren-mode +1) (add-hook 'prog-mode-hook #'electric-pair-local-mode) -;; Killing and yanking +;;;; Killing and yanking (setc save-interprogram-paste-before-kill t yank-pop-change-selection t x-select-enable-clipboard t @@ -130,7 +130,7 @@ kill-do-not-save-duplicates t) (delete-selection-mode +1) -;; Encoding +;;;; Encoding (setc local-coding-system 'utf-8-unix coding-system-for-read 'utf-8-unix coding-system-for-write 'utf-8-unix @@ -147,14 +147,14 @@ (set-keyboard-coding-system 'utf-8-unix) (set-selection-coding-system 'utf-8-unix) -;; Uniquify +;;;; Uniquify (setup (:require uniquify) (:option uniquify-buffer-name-style 'forward uniquify-separator path-separator uniquify-after-kill-buffer-p t uniquify-ignore-buffers-re "^\\*")) -;; Files +;;;; Files (setc backup-directory-alist `((".*" . ,(acdw/in-dir "backup/" t))) tramp-backup-directory-alist backup-directory-alist auto-save-file-name-transforms `((".*" ,(acdw/in-dir "auto-save/" t) t)) @@ -163,21 +163,26 @@ delete-old-versions t version-control t vc-make-backup-files t) -(auto-save-visited-mode +1) +;;;;; Auto-save files +(auto-save-visited-mode +1) +;; And /actually/ save all buffers when unfocused (add-function :after after-focus-change-function (defun hook--auto-save-when-unfocused () "Save all buffers when out of focus." (acdw/when-unfocused #'save-some-buffers t))) +;;;;; Autorevert files (setup (:require autorevert) (global-auto-revert-mode +1)) +;;;;; Save place in files (setup (:require saveplace) (:option save-place-file (acdw/in-dir "places.el") save-place-forget-unreadable-files (eq acdw/system :home)) (save-place-mode +1)) +;;;;; Keep track of recent files (setup (:require recentf) (:option recentf-save-file (acdw/in-dir "recentf.el") recentf-max-menu-items 100 @@ -186,7 +191,7 @@ (append recentf-exclude) acdw/dir) (recentf-mode +1)) -;; Minibuffer +;;;; Minibuffer (setc minibuffer-prompt-properties '(read-only t cursor-intangible t face minibuffer-prompt) enable-recursive-minibuffers t @@ -196,6 +201,7 @@ (file-name-shadow-mode +1) (fset 'yes-or-no-p #'y-or-n-p) +;;;;; Save minibuffer command history (and others) (setup (:require savehist) (:option (append savehist-additional-variables) 'kill-ring (append savehist-additional-variables) 'search-ring @@ -206,6 +212,7 @@ savehist-file (acdw/in-dir "savehist.el")) (savehist-mode +1)) +;;;;; Completion framework (setup (:require icomplete) (:option completion-ignore-case t read-buffer-completion-ignore-case t @@ -219,21 +226,22 @@ (fido-mode -1) (icomplete-mode +1)) +;;;;; `imenu' (setup imenu (:option imenu-auto-rescan t)) -;; Cursor +;;;; Cursor (setc cursor-type 'bar cursor-in-non-selected-windows 'hollow) -;; Scrolling +;;;; Scrolling (setc auto-window-vscroll nil fast-but-imprecise-scrolling t scroll-margin 0 scroll-conservatively 101 scroll-preserve-screen-position 1) -;; Fonts +;;;; Fonts ;; Load them /after/ the first frame comes into focus (add-function :after after-focus-change-function (defun hook--setup-fonts () @@ -253,8 +261,7 @@ (remove-function after-focus-change-function 'hook--setup-fonts))) - -;; MS Windows +;;;; MS Windows (setc w32-allow-system-shell t w32-pass-lwindow-to-system nil w32-lwindow-modifier 'super @@ -263,7 +270,7 @@ w32-pass-apps-to-system nil w32-apps-modifier 'hyper) -;;; Dired +;;;; Dired (setup dired (:setq-default dired-recursive-copies 'always dired-recursive-deletes 'always @@ -281,11 +288,7 @@ hl-line-mode) (:acdw/map "C-x C-j" dired-jump)) - ;;;; Web browsing -(when (eq acdw/system :work) - (add-to-list 'exec-path "C:/Program Files/Mozilla Firefox")) - (setup browse-url (:setq-default browse-url-browser-function 'eww-browse-url browse-url-secondary-browser-function @@ -293,7 +296,9 @@ 'browse-url-firefox 'browse-url-default-browser) browse-url-new-window-flag t - browse-url-firefox-new-window-is-tab t)) + browse-url-firefox-new-window-is-tab t) + (when (eq acdw/system :work) + (add-to-list 'exec-path "C:/Program Files/Mozilla Firefox"))) (setup shr (:option shr-width fill-column @@ -308,24 +313,24 @@ (add-hook 'text-mode-hook #'goto-address-mode) (add-hook 'prog-mode-hook #'goto-address-prog-mode) -;; Eshell +;;;; Eshell (setup eshell (:option eshell-directory-name (acdw/in-dir "eshell/" t) eshell-aliases-file (acdw/in-dir "eshell/aliases" t))) -;; Debugger +;;;; Debugger (setup debugger (:hook visual-line-mode) (:acdw/leader "d" toggle-debug-on-error)) -;; Garbage collection +;;;; Garbage collection (add-hook 'minibuffer-setup-hook #'acdw/gc-disable) (add-hook 'minibuffer-exit-hook #'acdw/gc-enable) (add-function :after after-focus-change-function (defun hook--gc-when-unfocused () (acdw/when-unfocused #'garbage-collect))) -;; Etc. good defaults +;;;; Etc. good defaults (setc custom-file (acdw/in-dir "custom.el") inhibit-startup-screen t initial-buffer-choice t @@ -344,7 +349,7 @@ (:work "aduckworth") (:other (getenv "USER")))) -;; Etc. bindings +;;;; Etc. bindings (autoload 'ehelp-command "ehelp" nil nil 'keymap) (define-key acdw/map (kbd "C-h") 'ehelp-command) (define-key acdw/map [remap just-one-space] #'cycle-spacing) @@ -352,27 +357,24 @@ (define-key acdw/map (kbd "M-=") #'count-words) (define-key acdw/map (kbd "C-x C-b") #'ibuffer) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; Here ends the package-less configuration. Everything following requires a -;;; package to be downloaded. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Packages -;;; Interactivity +;;;; Interactivity -;;;; Begin-end +;;;;; Begin-end (setup (:straight beginend) (beginend-global-mode +1)) -;;;; MWIM +;;;;; MWIM (setup (:straight mwim) (:acdw/map "C-a" mwim-beginning "C-e" mwim-end)) -;;;; Expand-region +;;;;; Expand-region (setup (:straight expand-region) (:acdw/map "C-=" er/expand-region)) -;;;; CRUX +;;;;; CRUX (setup (:straight crux) (:acdw/map "M-o" crux-other-window-or-switch-buffer "C-k" crux-kill-and-join-forward @@ -382,7 +384,7 @@ "C-c i" crux-find-user-init-file) (crux-reopen-as-root-mode +1)) -;;;; AVY ... & friends +;;;;; AVY ... & friends (setup (:straight avy) (:acdw/map "C-:" avy-goto-char "C-'" avy-goto-char-timer @@ -403,7 +405,7 @@ call `zzz-to-char'." (call-interactively #'zzz-up-to-char))) (:acdw/map "M-z" acdw/zzz-up-to-char)) -;;;; anzu +;;;;; anzu (setup (:straight anzu) (:option anzu-replace-to-string-separator " → " anzu-cons-mode-line-p nil) @@ -418,20 +420,20 @@ call `zzz-to-char'." (global-anzu-mode +1)) -;;;; smart hungry delete +;;;;; smart hungry delete (setup (:straight smart-hungry-delete) (:acdw/map "" smart-hungry-delete-backward-char "C-d" smart-hungry-delete-forward-char) (smart-hungry-delete-add-default-hooks)) -;;; Functionality +;;;; Functionality -;;;; Async +;;;;; Async (setup (:straight async) (autoload 'dired-async-mode "dired-async.el" nil t) (dired-async-mode +1)) -;;;; Undo-fu +;;;;; Undo-fu (setup (:straight undo-fu) (:acdw/map "C-/" undo-fu-only-undo "C-?" undo-fu-only-redo)) @@ -442,9 +444,9 @@ call `zzz-to-char'." undo-fu-session-directory (acdw/in-dir "undo/" t)) (global-undo-fu-session-mode +1)) -;;; Minibuffer +;;;; Minibuffer -;;;; Icomplete-vertical +;;;;; Icomplete-vertical (setup (:straight icomplete-vertical) (let ((map icomplete-minibuffer-map)) (let ((command #'icomplete-forward-completions)) @@ -457,11 +459,11 @@ call `zzz-to-char'." (define-key map (kbd "C-RET") #'minibuffer-complete-and-exit)) (icomplete-vertical-mode +1)) -;;;; Orderless +;;;;; Orderless (setup (:straight orderless) (:option (prepend completion-styles) 'orderless)) -;;;; Consult +;;;;; Consult (setup (:straight consult) (:acdw/map ;; C-c bindings (`mode-specific-map') @@ -495,15 +497,15 @@ call `zzz-to-char'." (:option register-preview-delay 0 register-preview-function #'consult-register-preview)) -;;;; Marginalia +;;;;; Marginalia (setup (:straight marginalia) (:option marginalia-annotators '(marginalia-annotators-heavy marginalia-annotators-light)) (marginalia-mode +1)) -;;; UI +;;;; UI -;;;; Modus themes +;;;;; Modus themes (setup (:straight (modus-themes :host gitlab :repo "protesilaos/modus-themes")) @@ -517,7 +519,7 @@ call `zzz-to-char'." (acdw/sunrise-sunset #'modus-themes-load-operandi #'modus-themes-load-vivendi)) -;;;; Mode line +;;;;; Mode line (setup (:straight simple-modeline) (setup (:straight minions)) (:option simple-modeline-segments @@ -534,32 +536,32 @@ call `zzz-to-char'." (require 'acdw-modeline) (simple-modeline-mode +1)) -;;;; Olivetti +;;;;; Olivetti ;; also useful for `acdw/reading-mode' (setup (:straight olivetti) (:option olivetti-body-width (+ fill-column 4) olivetti-minimum-body-width fill-column)) -;;;; Outshine +;;;;; Outshine (setup (:straight outshine) (:option outline-minor-mode-prefix "") (:hook-into emacs-lisp-mode)) -;;; Utilities +;;;; Utilities -;;;; 0x0 -- upload files to a nullpointer +;;;;; 0x0 -- upload files to a nullpointer (setup (:straight (0x0 :host nil :repo "https://git.sr.ht/~zge/nullpointer-emacs")) (:option 0x0-default-host 'ttm)) -;;; System tie-ins -;; Instead of using `setup''s `:needs', I'm going to wrap these in +;;;; System tie-ins +;; Insctead of using `setup''s `:needs', I'm going to wrap these in ;; `exectuable-find' forms. I don't want to waste time with pulling packages ;; that won't work on a machine. -;;; Applications +;;;; Applications -;;;; Magit +;;;;; Magit (setup (:straight magit) (:acdw/leader "g" magit-status) (:option magit-display-buffer-function @@ -568,7 +570,7 @@ call `zzz-to-char'." (display-buffer buffer '(display-buffer-same-window))) magit-popup-display-buffer-action '((display-buffer-same-window)))) -;;;; File browsing +;;;;; File browsing (setup (:straight dired-subtree) (define-key dired-mode-map "i" #'dired-subtree-toggle)) @@ -578,7 +580,7 @@ call `zzz-to-char'." (setup (:straight trashed) (:option trashed-action-confirmer 'y-or-n-p)) -;;;; Gemini/gopher browsing +;;;;; Gemini/gopher browsing (setup (:straight (elpher :host nil :repo "git://thelambdalab.xyz/elpher.git")) (:option elpher-ipv4-always t @@ -598,12 +600,12 @@ call `zzz-to-char'." (:option (append auto-mode-alist) '("\\.\\(gemini\\|gmi\\)\\'" . gemini-mode))) -;;;; Read e-books (nov.el) +;;;;; Read e-books (nov.el) (setup (:straight nov) (:option nov-text-width fill-column (append auto-mode-alist) '("\\.epub\\'" . nov-mode))) -;;;; Org mode +;;;;; Org mode (setup (:straight (org :host nil :repo "https://code.orgmode.org/bzg/org-mode.git")) (require 'acdw-org) @@ -629,14 +631,14 @@ call `zzz-to-char'." (:bind "RET" unpackaged/org-return-dwim) (add-hook 'before-save-hook #'acdw/hook--org-mode-fix-blank-lines)) -;;; Programming languages +;;;; Programming languages -;;;; Formatting +;;;;; Formatting (setup (:straight (apheleia :host github :repo "raxod502/apheleia")) (apheleia-global-mode +1)) -;;;; Emacs lisp +;;;;; Emacs lisp (setup emacs-lisp-mode (:option eval-expression-print-length nil eval-expression-print-level nil @@ -645,7 +647,7 @@ call `zzz-to-char'." (setup (:straight macrostep) (define-key emacs-lisp-mode-map (kbd "C-c e") #'macrostep-expand)) -;;;; Shell scripts +;;;;; Shell scripts (setup sh-mode (:option sh-basic-offset tab-width sh-indent-after-case 0 @@ -663,7 +665,7 @@ call `zzz-to-char'." (:hook flymake-mode flymake-shellcheck-load))) -;;;; Web languages +;;;;; Web languages (setup (:straight web-mode) (:option css-level-offset 2 js-indent-level 2 @@ -678,4 +680,4 @@ call `zzz-to-char'." (add-to-list 'auto-mode-alist `(,(concat "\\." extension "\\'") . web-mode)))) -;;; init.el ends here +;;;- init.el ends here -- cgit 1.4.1-21-gabe81