From d1563eb1a7e65fbf22fe588825e2180ab44ab6ae Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 22 Feb 2021 09:58:12 -0600 Subject: Remove COMMENTed sections They're in the Git history, right? --- config.org | 344 ------------------------------------------------------------- 1 file changed, 344 deletions(-) diff --git a/config.org b/config.org index f3cea78..f1c5cff 100644 --- a/config.org +++ b/config.org @@ -569,173 +569,6 @@ I want the git version. (minions-mode +1) #+end_src -**** COMMENT Simple modeline :package: - -After trying =doom-mode-line= and =smart-mode-line=, I think I've finally -landed on a good one: =simple-modeline=. - -#+begin_src emacs-lisp :noweb-ref packages - (straight-use-package 'simple-modeline) -#+end_src - -#+begin_src emacs-lisp :noweb-ref settings - (setq-default simple-modeline-segments - '(;; left side - (acdw/modeline/modified - simple-modeline-segment-buffer-name - acdw/modeline/vc-status - acdw/modeline/position) - ;; right side - (simple-modeline-segment-minor-modes - simple-modeline-segment-input-method - simple-modeline-segment-misc-info - simple-modeline-segment-process - acdw/modeline/acdw-minions - simple-modeline-segment-major-mode))) -#+end_src - -#+begin_src emacs-lisp :noweb-ref modes - (simple-modeline-mode +1) -#+end_src - -***** Simple modeline custom segments - -****** COMMENT Functions to figure out what window is focused - -How is this not built into Emacs? Oh well, I have [[https://github.com/jamesnvc/dotfiles/blob/master/emacs.d/modules/cogent-modeline.el][Cogent]] to thank. - -#+begin_src emacs-lisp :noweb-ref variables - (defvar cogent-line-selected-window (frame-selected-window)) -#+end_src - -#+begin_src emacs-lisp :noweb-ref functions - (defun cogent-line-set-selected-window (&rest _args) - (when (not (minibuffer-window-active-p (frame-selected-window))) - (setq cogent-line-selected-window (frame-selected-window)) - (force-mode-line-update))) - - (defun cogent-line-unset-selected-window () - (setq cogent-line-selected-window nil) - (force-mode-line-update)) - - (defun cogent-line-selected-window-active-p () - (eq cogent-line-selected-window (selected-window))) -#+end_src - -#+begin_src emacs-lisp :noweb-ref hooks - (add-hook 'window-configuration-change-hook #'cogent-line-set-selected-window) - (add-hook 'focus-in-hook #'cogent-line-set-selected-window) - (add-hook 'focus-out-hook #'cogent-line-unset-selected-window) - (advice-add 'handle-switch-frame :after #'cogent-line-set-selected-window) - (advice-add 'select-window :after #'cogent-line-set-selected-window) -#+end_src - -****** Tweak =simple-modeline-segment-modified= - -#+begin_src emacs-lisp :noweb-ref functions - (defun acdw/modeline/modified () - "Show the modified/readonly state in the modeline. - See `simple-modeline-status-modified'." - (if (not (string-match-p "\\*.*\\*" (buffer-name))) - (let* ((read-only (and buffer-read-only (buffer-file-name))) - (modified (buffer-modified-p))) - (propertize - (if read-only " ×" (if modified " ●" " ○")) - 'face `(:inherit - ,(if modified 'simple-modeline-status-modified - (if read-only 'simple-modeline-status-error - 'simple-modeline-unimportant))) - 'help-echo (format - "Buffer is %s and %smodified\nmouse-1: Toggle read-only status." - (if read-only "read-only" "writable") - (if modified "" "not ")) - 'local-map (purecopy (simple-modeline-make-mouse-map - 'mouse-1 - (lambda (event) - (interactive "e") - (with-selected-window (posn-window (event-start event)) - (read-only-mode 'toggle))))) - 'mouse-face 'mode-line-highlight)) - "_")) -#+end_src - -****** Easier minor-modes - -#+begin_src emacs-lisp :noweb-ref functions - (defun acdw/modeline/acdw-minions () - "Show `acdw/mode' icon as a button to enable `minions-minor-modes-menu'. - - This enables me to `blackout' all global minor-mode - lighters (including `acdw/mode'), and hide them behind a button, - saving space in the mode line." - (propertize " ⱷ" - 'help-echo "Minor modes" - 'local-map (purecopy (simple-modeline-make-mouse-map - 'mouse-1 - (lambda (event) - (interactive "e") - (with-selected-window (posn-window - (event-start event)) - (minions-minor-modes-menu))))) - 'mouse-face 'mode-line-highlight)) -#+end_src - -****** Shorter VC-mode segment - -#+begin_src emacs-lisp :noweb-ref functions - (defun acdw/modeline/vc-status () - "Displays the VC status in the modeline." - '(vc-mode (:eval - (let ((branch-name (replace-regexp-in-string - (format "^\s*%s:?-?" - (vc-backend buffer-file-name)) - "" vc-mode)) - (f (cond ((string= "up-to-date" - (vc-state buffer-file-name)) - '((:slant normal))) - (t - '((:slant italic)))))) - (propertize (concat " " branch-name) - 'face f - 'help-echo (format - "%s: %s\nmouse-1: Run magit-status" - vc-mode - (vc-state buffer-file-name)) - 'local-map (purecopy - (simple-modeline-make-mouse-map - 'mouse-1 - (lambda (ev) - (interactive "e") - (with-selected-window - (posn-window - (event-start ev)) - (magit-status-setup-buffer - (file-name-directory - buffer-file-name)))))) - 'mouse-face 'mode-line-highlight))))) -#+end_src - -****** Position in file - -#+begin_src emacs-lisp :noweb-ref functions - (defun acdw/modeline/position () - "Displays the current cursor position in the mode-line." - `((line-number-mode (-6 " %l")) - ((column-number-mode - (column-number-indicator-zero-based - (4 ":%c") - (4 ":%C")))) - " " mode-line-percent-position "%% " - ,(if (region-active-p) - (propertize (format "+%s " - (apply #'+ (mapcar - (lambda (pos) - (- (cdr pos) - (car pos))) - (region-bounds)))) - 'font-lock-face 'font-lock-variable-name-face)))) -#+end_src - **** Blackout some modes :package: Like =diminish= or =delight=, =blackout= allows me to remove some @@ -755,29 +588,6 @@ Shows where we are in the modeline. (which-function-mode +1) #+end_src -**** COMMENT Nyan mode :package: - -+Fuck it, let's have some fun.+ COMMENTED out because it messes up my -modeline :( - -This obviously needs a lot more research. - -#+begin_src emacs-lisp :noweb-ref packages - (straight-use-package 'nyan-mode) -#+end_src - -I add it to the modeline [[*Simple modeline][below]]. - -#+begin_src emacs-lisp :noweb-ref settings - (setq-default nyan-bar-length 20) -#+end_src - -But I still have to enable the mode ?! - -#+begin_src emacs-lisp :noweb-ref settings - (nyan-mode +1) -#+end_src - **** Mode-line faces #+begin_src emacs-lisp :noweb-ref linux-specific @@ -891,52 +701,6 @@ to /hide/ those contents. read-file-name-completion-ignore-case t) #+end_src -*** COMMENT Selectrum :package: - -*COMMENT 2021-02-01*: For some reason, selectrum will randomly do a thing where -it, like, flashes up and down in the minibuffer? I don't know how to explain -it, it's super weird. I guess I should file a bug report ... but until then, -I'll just use =icomplete-vertical=. - -My minibuffer completion system uses =selectrum=, =prescient=, =company=, -and =marginalia=. At some point, I'd like to take a deep dive in =embark= -(possibly switching out =selectrum=), =ido=, =orderless=, or others, -for now .... I just want to see my completions. - -#+begin_src emacs-lisp :noweb-ref packages - (straight-use-package 'selectrum) -#+end_src - -#+begin_src emacs-lisp :noweb-ref modes - (selectrum-mode +1) -#+end_src - -*** COMMENT Prescient :package: - -#+begin_src emacs-lisp :noweb-ref packages - (straight-use-package 'prescient) - (require 'prescient) -#+end_src - -Prescient can persist itself too. - -#+begin_src emacs-lisp :noweb-ref modes - (prescient-persist-mode +1) -#+end_src - -**** COMMENT Selectrum integration - -Let's have =prescient= and =selectrum= work together. - -#+begin_src emacs-lisp :noweb-ref packages - (straight-use-package 'selectrum-prescient) -#+end_src - -#+begin_src emacs-lisp :noweb-ref modes - (with-eval-after-load 'selectrum - (selectrum-prescient-mode +1)) -#+end_src - *** Icomplete #+begin_src emacs-lisp :noweb-ref packages @@ -1063,15 +827,6 @@ I like the rich annotations provided by =marginalia=. nil)) #+end_src -**** COMMENT Integration with Selectrum - -#+begin_src emacs-lisp :noweb-ref functions - (advice-add #'marginalia-cycle :after - (lambda () - (when (bound-and-true-p selectrum-mode) - (selectrum-exhibit)))) -#+end_src - ** Imenu #+begin_src emacs-lisp :noweb-ref settings @@ -1344,20 +1099,6 @@ the user is looking at something else. ** Garbage collection -*** COMMENT Garbage Collection Magic Hack :package: - -Look, I'm not going to look too deeply into this. It's /magic/ afer -all. - -#+begin_src emacs-lisp :noweb-ref packages - (straight-use-package 'gcmh) -#+end_src - -#+begin_src emacs-lisp :noweb-ref modes - (gcmh-mode +1) - (blackout 'gcmh-mode) -#+end_src - *** Simple GC munging about From [[https://bling.github.io/blog/2016/01/18/why-are-you-changing-gc-cons-threshold/][bling]], from ... 2016? Maybe this isn't great, but it's one less package so @@ -1836,26 +1577,6 @@ already commented. That's it. ** Word count -*** COMMENT WC Mode :package: - -I'm just going to comment this out for right now because I honestly -don't know if it's that useful. - -#+begin_src emacs-lisp :noweb-ref packages - (straight-use-package 'wc-mode) -#+end_src - -#+begin_src emacs-lisp :noweb-ref hooks - (defun hook--wc-mode-no-keybinds () - (wc-mode +1) - (define-key wc-mode-map (kbd "C-c C-w w") nil) - (define-key wc-mode-map (kbd "C-c C-w l") nil) - (define-key wc-mode-map (kbd "C-c C-w a") nil) - (define-key wc-mode-map (kbd "C-c C-w c") nil)) - - (add-hook 'text-mode-hook #'hook--wc-mode-no-keybinds) -#+end_src - *** Key binding I just found out that =M-== counts the words in a region. That's great, but I @@ -2475,71 +2196,6 @@ See [[https://github.com/redguardtoo/mastering-emacs-in-one-year-guide/blob/mast )) #+end_src -*** COMMENT Elfeed-goodies - -#+begin_src emacs-lisp :noweb-ref packages - (straight-use-package 'elfeed-goodies) -#+end_src - -#+begin_src emacs-lisp :noweb-ref hooks - (with-eval-after-load 'elfeed - (require 'elfeed-goodies) - (elfeed-goodies/setup)) -#+end_src - -#+begin_src emacs-lisp :noweb-ref settings - (setq-default elfeed-goodies/entry-pane-position 'top - elfeed-goodies/powerline-default-separator nil - elfeed-goodies/tag-column-width 16) -#+end_src - -*** COMMENT Elfeed-protocol - -I'm not /the most/ happy with this -- it seems like a lot for not that -much -- but until I figure out a proper syncing solution, it'll do. - -#+begin_src emacs-lisp :noweb-ref packages - (straight-use-package 'elfeed-protocol) -#+end_src - -#+begin_src emacs-lisp :noweb-ref settings - (setq-default elfeed-protocol-ttrss-maxsize 200 - elfeed-feeds - '(("ttrss+https://acdw@rss.tildeverse.org" - :use-authinfo t))) -#+end_src - -#+begin_src emacs-lisp :noweb-ref modes - (with-eval-after-load 'elfeed - (elfeed-protocol-enable)) -#+end_src - -For whatever reason, =G= (=elfeed-search-fetch=) doesn't fetch anything -new from TTRSS. So I rebind it to ... =elfeed-protocol-ttrss-reinit= -(=elfeed-protocol-ttrss-update= doesn't pull everything for some reason -... this kind of thing is why I'm looking at other elfeed-sync -options). - -#+begin_src emacs-lisp :noweb-ref bindings - (with-eval-after-load 'elfeed-protocol - (defun acdw-elfeed-protocol-ttrss-update-then-reinit () - "Update, then reinit, the first entry in `elfeed-feeds'." - (interactive) - (let ((url (caar elfeed-feeds)) - (msg-update "Elfeed Protocol: Updating...") - (msg-reinit "Elfeed Protocol: Re-initializing...")) - (message "%s" msg-update) - (elfeed-protocol-ttrss-update url) - (message "%s Done." msg-update) - - (message "%s" msg-reinit) - (elfeed-protocol-ttrss-reinit url) - (message "%s Done." msg-reinit))) - - (define-key elfeed-search-mode-map "G" - #'acdw-elfeed-protocol-ttrss-update-then-reinit)) -#+end_src - ** 0x0 (null pointer) :package: An ease-of-life package that lets me upload my shitty code to share it with -- cgit 1.4.1-21-gabe81