From 199bf4ddd8d63f1ddae0652bd3ef48e5a0be067e Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 10 Feb 2021 10:14:29 -0600 Subject: Don't raise GC Cons percentage I think it causes problems with loading the init file --- config.org | 2 +- init.el | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config.org b/config.org index 386363f..baf16dd 100644 --- a/config.org +++ b/config.org @@ -3155,7 +3155,7 @@ the needed boolean expression to tangle config.org. Booleans, yall! #+begin_src emacs-lisp (let* (;; Speed up init (gc-cons-threshold most-positive-fixnum) - (gc-cons-percentage 0.6) + ;; (gc-cons-percentage 0.6) (file-name-handler-alist nil) ;; Config file names (config (expand-file-name "config" diff --git a/init.el b/init.el index ae4ae9f..405bf9b 100644 --- a/init.el +++ b/init.el @@ -18,6 +18,7 @@ (let* (;; Speed up init (gc-cons-threshold most-positive-fixnum) + ;; (gc-cons-percentage 0.6) (file-name-handler-alist nil) ;; Config file names (config (expand-file-name "config" -- cgit 1.4.1-21-gabe81 From cbddf931a34b4d343a31b816781d3997ca3f8fa1 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 10 Feb 2021 10:16:32 -0600 Subject: Enable global-display-fill-column-indicator-mode --- config.org | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config.org b/config.org index baf16dd..da3e495 100644 --- a/config.org +++ b/config.org @@ -1269,6 +1269,12 @@ contents of the files the represent on-disk. Thus, we have (setq-default fill-column 80) #+end_src +I also want to display the fill-column: + +#+begin_src emacs-lisp :noweb-ref modes + (global-display-fill-column-indicator-mode +1) +#+end_src + By default, Emacs uses =C-x f= to set the =fill-column=. I think it's pretty dumb that such an easy-to-reach binding (for Emacs) is set to a function that I /literally/ never use. So I'm going to bind it to =find-file= ... since -- cgit 1.4.1-21-gabe81 From bbf6c6e3f170d6f472f791c40c3cac4413c44489 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 10 Feb 2021 10:17:15 -0600 Subject: Rewrite git-sync integration and add functions --- config.org | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/config.org b/config.org index da3e495..18abf17 100644 --- a/config.org +++ b/config.org @@ -2835,21 +2835,45 @@ Emacs (or the [[https://chrome.google.com/webstore/detail/edit-with-emacs/ljobjl (add-hook 'after-init-hook #'edit-server-start) #+end_src -*** =git-sync= ~/org +*** =git-sync= stuff -I don't know where else to put this, but it's just a little command to -run =git-sync= in =org-directory=. +This function require [[https://github.com/simonthum/git-sync][git-sync]]. #+begin_src emacs-lisp :noweb-ref functions - (defun acdw/org-sync () - "Run git-sync in `org-directory'. + (defun acdw/git-sync (directory) + "Run git-sync in DIRECTORY." + (interactive) + (message "Git-Syncing %s..." directory) + (let ((proc (start-process "git-sync" + (get-buffer-create (format "*git-sync:%s*" directory)) + "git" "-C" (expand-file-name directory) "sync"))) + (add-function :after (process-sentinel proc) + (lambda (proc ev) + (cond + ((string-match "finished\n\\'" ev) + (message "Git-Syncing %s...Done." directory))))))) +#+end_src + +**** ~/org + +#+begin_src emacs-lisp :noweb-ref bindings + (defun acdw/git-sync-org () + "Run `acdw/git-sync' on `org-directory'." + (interactive) + (acdw/git-sync org-directory)) + + (define-key acdw/leader (kbd "C-M-o") #'acdw/git-sync-org) +#+end_src - Requires git-sync." +**** ~/.cache/elfeed/db + +#+begin_src emacs-lisp :noweb-ref bindings + (defun acdw/git-sync-elfeed-db () + "Run `acdw/git-sync' on `elfeed-db-directory'." (interactive) - (async-shell-command - (format "git -C %s sync" (expand-file-name org-directory)))) + (acdw/git-sync elfeed-db-directory)) - (define-key acdw/leader (kbd "C-M-o") #'acdw/org-sync) + (define-key acdw/leader (kbd "C-M-f") #'acdw/git-sync-elfeed-db) #+end_src ** Linux (home) -- cgit 1.4.1-21-gabe81 From fb1096933fc968607f64533d5a1a94a74f0e069e Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 10 Feb 2021 11:51:47 -0600 Subject: Require generic-x Watch to see if this adds a lot of time to startup. --- config.org | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/config.org b/config.org index c31b821..a5d73a1 100644 --- a/config.org +++ b/config.org @@ -1781,6 +1781,15 @@ checks for a shebang). ** Language-specific +*** Generic-x + +from [[https://www.reddit.com/r/emacs/comments/lfww57/weekly_tipstricketc_thread/gmtk79e/][u/Bodertz]], apparently =generic-x= just ... has syntax highlighting for a ton +of (I suppose) generic files. + +#+begin_src emacs-lisp :noweb-ref packages + (require 'generic-x) +#+end_src + *** Emacs Lisp **** Don't limit the length of evaluated expressions -- cgit 1.4.1-21-gabe81 From 2637480106c895b00fea0adf627a20f647fee3f5 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 10 Feb 2021 11:52:20 -0600 Subject: Add DICPATH to Windows install --- config.org | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/config.org b/config.org index a5d73a1..e6fd4b0 100644 --- a/config.org +++ b/config.org @@ -2981,6 +2981,15 @@ I use Windows at work, where I /also/ don't have Admin rights. So I kind of fly-by-night there. Many of the ideas and scripts in this section come from [[https://github.com/termitereform/JunkPile/blob/master/emacs-on-windows.md][termitereform]] on Github. +*** Environment variables + +**** DICPATH, for Hunspell + +#+begin_src emacs-lisp :noweb-ref windows-specific + (setenv "DICPATH" (expand-file-name "exe/share/hunspell" + "~/Applications/")) +#+end_src + *** Settings See also [[https://www.gnu.org/software/emacs/manual/html_mono/efaq-w32.html][the GNU FAQ for Windows]]. At some point I should really dig -- cgit 1.4.1-21-gabe81 From e290f84858e1e88e1eccb60d11693739bf2285f7 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 10 Feb 2021 11:55:00 -0600 Subject: Remove *Linux/Settings (empty heading) --- config.org | 2 -- 1 file changed, 2 deletions(-) diff --git a/config.org b/config.org index e6fd4b0..f8c0f55 100644 --- a/config.org +++ b/config.org @@ -2931,8 +2931,6 @@ This function require [[https://github.com/simonthum/git-sync][git-sync]]. :header-args: :noweb-ref linux-specific :END: -*** Settings - *** Scripts **** em -- cgit 1.4.1-21-gabe81 From d21ccd04906f049c8862095d06b41d9988415379 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 10 Feb 2021 17:34:39 -0600 Subject: Change section style --- config.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.org b/config.org index f8c0f55..481e61a 100644 --- a/config.org +++ b/config.org @@ -531,8 +531,8 @@ I want the git version. modus-themes-bold-constructs t modus-themes-region 'bg-only modus-themes-org-blocks 'grayscale - modus-themes-headings '((1 . line) - (t . t)) + modus-themes-headings '((1 . section) + (t . no-color)) modus-themes-scale-headings nil modus-themes-mode-line 'borderless-3d) #+end_src -- cgit 1.4.1-21-gabe81 From 08cc50111547a0c0e55fa4f403eb6a3f917bd9a6 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 10 Feb 2021 17:35:02 -0600 Subject: Rebind M-= to `count-words' --- config.org | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/config.org b/config.org index 481e61a..7fc3a59 100644 --- a/config.org +++ b/config.org @@ -1576,14 +1576,13 @@ don't know if it's that useful. (add-hook 'text-mode-hook #'hook--wc-mode-no-keybinds) #+end_src -*** Keybinding :crux: +*** Keybinding I just found out that =M-== counts the words in a region. That's great, but I -often want to count the words in the whole buffer. Enter -=crux-with-region-or-buffer=. I could change the binding. .... but I don't want to. +often want to count the words in the whole buffer. #+begin_src emacs-lisp :noweb-ref bindings - (crux-with-region-or-buffer count-words-region) + (define-key acdw/map (kbd "M-=") #'count-words) #+end_src ** Spell checking -- cgit 1.4.1-21-gabe81 From 3d89edf45c2f32f59771b6c6e14793ae6b2760c6 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 10 Feb 2021 17:35:53 -0600 Subject: Add acdw/reading-mode Currently, it increases the text scale, turns on visual-fill-column-mode and iscroll-mode. --- config.org | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/config.org b/config.org index 7fc3a59..4c6717f 100644 --- a/config.org +++ b/config.org @@ -1640,10 +1640,25 @@ Display corrections with =completing-read=. #'(lambda () (blackout 'iscroll-mode))) #+end_src -** TODO Reading mode +** Reading mode A custom mode to make reading comfy +#+begin_src emacs-lisp :noweb-ref modes + (define-minor-mode acdw/reading-mode + "Make reading comfier." + :lighter " Read" ; later: book emoji + (if acdw/reading-mode + (progn ;; turn on + (text-scale-increase +1) + (visual-fill-column-mode +1) + (iscroll-mode +1)) + (progn ;; turn off + (text-scale-increase 0) + (visual-fill-column-mode -1) + (iscroll-mode -1)))) +#+end_src + * Programming ** Comments @@ -2078,12 +2093,7 @@ See [[https://github.com/redguardtoo/mastering-emacs-in-one-year-guide/blob/mast #+end_src #+begin_src emacs-lisp :noweb-ref hooks - (defun hook--elfeed-show () - (text-scale-adjust +1) - (visual-fill-column-mode +1) - (iscroll-mode +1)) - - (add-hook 'elfeed-show-mode-hook #'hook--elfeed-show) + (add-hook 'elfeed-show-mode-hook #'acdw/reading-mode) #+end_src #+begin_src emacs-lisp :noweb-ref bindings @@ -2263,6 +2273,10 @@ others. (define-key elpher-mode-map "G" #'elpher-go-current)) #+end_src +#+begin_src emacs-lisp :noweb-ref hooks + (add-hook 'elpher-mode-hook #'acdw/reading-mode) +#+end_src + *** Gemini-mode :package: #+begin_src emacs-lisp :noweb-ref packages -- cgit 1.4.1-21-gabe81 From fbdb2d0c5fdbca51713964660b2fd52d98ecd799 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 10 Feb 2021 17:36:41 -0600 Subject: Change height of gemini headings --- config.org | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/config.org b/config.org index 4c6717f..b3bc072 100644 --- a/config.org +++ b/config.org @@ -2252,11 +2252,14 @@ others. (setq-default elpher-ipv4-always t) (doremi-face-set 'elpher-gemini-heading1 - '((t (:inherit (modus-theme-heading-1))))) + '((t (:inherit (modus-theme-heading-1) + :height 1.0)))) (doremi-face-set 'elpher-gemini-heading2 - '((t (:inherit (modus-theme-heading-2))))) + '((t (:inherit (modus-theme-heading-2) + :height 1.0)))) (doremi-face-set 'elpher-gemini-heading3 - '((t (:inherit (modus-theme-heading-3))))) + '((t (:inherit (modus-theme-heading-3) + :height 1.0)))) #+end_src #+begin_src emacs-lisp :noweb-ref no-littering -- cgit 1.4.1-21-gabe81 From 89c4d832ca43858010bd8b0e9e1541618694d5dc Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 10 Feb 2021 17:37:14 -0600 Subject: Change book capture filing location They should go under the *Later heading in books.org. --- config.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.org b/config.org index b3bc072..45ff91d 100644 --- a/config.org +++ b/config.org @@ -2750,7 +2750,7 @@ TODO, and Diary. :empty-lines 1) ;; Books to read ("b" "Book to read" entry - (file "books.org") + (file+headline "books.org" "Later") "* TOREAD %^{Title} :PROPERTIES: :Author: %^{Author} -- cgit 1.4.1-21-gabe81 From acb1ed8f5e7565c886a24773a0aba995a32b8166 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 10 Feb 2021 17:43:03 -0600 Subject: Add `display-fill-column-indicator-mode' to `acdw/reading-mode' --- config.org | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config.org b/config.org index 45ff91d..d96596f 100644 --- a/config.org +++ b/config.org @@ -1652,11 +1652,13 @@ A custom mode to make reading comfy (progn ;; turn on (text-scale-increase +1) (visual-fill-column-mode +1) - (iscroll-mode +1)) + (iscroll-mode +1) + (display-fill-column-indicator-mode -1)) (progn ;; turn off (text-scale-increase 0) (visual-fill-column-mode -1) - (iscroll-mode -1)))) + (iscroll-mode -1) + (display-fill-column-indicator-mode +1)))) #+end_src * Programming -- cgit 1.4.1-21-gabe81