summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--TODO.org1796
-rw-r--r--custom/sdcv-mode.el414
-rw-r--r--early-init.el15
-rw-r--r--init.el21
-rw-r--r--localrepo/archive-contents17
-rw-r--r--localrepo/closql-20240405.1948.tarbin30720 -> 10240 bytes
-rw-r--r--localrepo/dash-20240405.946.tarbin358400 -> 10240 bytes
-rw-r--r--localrepo/dashboard-20240407.12.tar (renamed from localrepo/dashboard-20240327.29.tar)bin174080 -> 174080 bytes
-rw-r--r--localrepo/forge-20240405.1509.tarbin409600 -> 0 bytes
-rw-r--r--localrepo/forge-20240407.2150.tarbin0 -> 10240 bytes
-rw-r--r--localrepo/ghub-20240311.1716.tarbin163840 -> 0 bytes
-rw-r--r--localrepo/ghub-20240408.1356.tarbin0 -> 10240 bytes
-rw-r--r--localrepo/git-commit-20240320.2311.tarbin61440 -> 10240 bytes
-rw-r--r--localrepo/ledger-mode-20240408.416.tar (renamed from localrepo/ledger-mode-20240326.2002.tar)bin327680 -> 327680 bytes
-rw-r--r--localrepo/lsp-mode-20240408.57.tar (renamed from localrepo/lsp-mode-20240406.356.tar)bin1484800 -> 1484800 bytes
-rw-r--r--localrepo/lsp-ui-20240406.2119.tar (renamed from localrepo/lsp-ui-20240330.2227.tar)bin163840 -> 163840 bytes
-rw-r--r--localrepo/magit-20240404.1901.tarbin1863680 -> 10240 bytes
-rw-r--r--localrepo/magit-section-20240311.1407.tarbin122880 -> 10240 bytes
-rw-r--r--localrepo/nov-20240407.1219.tar (renamed from localrepo/nov-20230715.1434.tar)bin51200 -> 51200 bytes
-rw-r--r--localrepo/pdf-tools-1.1.0.tarbin6400000 -> 6400000 bytes
-rw-r--r--localrepo/pos-tip-20240209.837.tarbin0 -> 40960 bytes
-rw-r--r--localrepo/sdcv-20220210.1412.tarbin0 -> 20480 bytes
-rw-r--r--localrepo/showtip-20090830.1040.tarbin0 -> 10240 bytes
-rw-r--r--localrepo/transient-20240405.1443.tarbin378880 -> 10240 bytes
-rw-r--r--localrepo/treepy-20230715.2154.tarbin30720 -> 10240 bytes
-rw-r--r--localrepo/vterm-20240325.1551.tarbin634880 -> 522240 bytes
-rw-r--r--localrepo/with-editor-20240101.2226.tarbin71680 -> 10240 bytes
-rw-r--r--localrepo/yaml-20231211.1501.tarbin112640 -> 10240 bytes
-rw-r--r--modules/ai-config.el32
-rw-r--r--modules/calibredb-epub-config.el4
-rw-r--r--modules/dirvish-config.el40
-rw-r--r--modules/epa-config.el5
-rw-r--r--modules/eshell-vterm-config.el35
-rw-r--r--modules/font-config.el8
-rw-r--r--modules/games-config.el2
-rw-r--r--modules/org-config.el28
-rw-r--r--modules/org-drill-config.el95
-rw-r--r--modules/system-utils.el6
-rw-r--r--modules/test-code.el89
-rw-r--r--modules/ui-theme.el28
-rw-r--r--modules/user-constants.el86
-rw-r--r--modules/vc-config.el5
-rw-r--r--modules/wrap-up.el2
-rwxr-xr-xscripts/build-emacs-from-source.sh (renamed from scripts/build-emacs-from-src.sh)0
-rwxr-xr-xscripts/reset-to-first-launch.sh (renamed from scripts/reset.sh)6
46 files changed, 1231 insertions, 1504 deletions
diff --git a/.gitignore b/.gitignore
index 828dc13d..b9170f1c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,3 +38,4 @@ auto-save-list/
/forge-database.sqlite
/.scratch
/.elfeed-db/
+/persist/
diff --git a/TODO.org b/TODO.org
index 0d86d0f2..c70882a7 100644
--- a/TODO.org
+++ b/TODO.org
@@ -1,23 +1,7 @@
-
=== Emacs Config Tasks ===
* Emacs Config Inbox
-** TODO Check into spacious padding mode
-
-Sample Config from Damien Cassou's Emacs Config
-#+BEGIN_QUOTE
-(use-package spacious-padding
- :demand t
- :hook (server-after-make-frame . spacious-padding-mode)
- :config
- (progn
- (setq spacious-padding-subtle-mode-line
- '(:mode-line-active error :mode-line-inactive shadow))))
-
-#+END_QUOTE
-[[https://raw.githubusercontent.com/DamienCassou/emacs.d/master/init.el][]]
-Captured On: [2024-04-06 Sat 10:54]
* DOING Emacs Config v0.7 [2/4]
** DONE Supplement Existing Functionality [9/9]
*** DONE [#B] Make sure eshell has same path as other shells
@@ -156,53 +140,49 @@ This is the result of overriding that function in cj/invincible-buffers in syste
*** DONE [#C] Bookmark-save-flag Replaces Bookmark-set-and-save
CLOSED: [2024-04-03 Wed 15:00]
remove cj/bookmark-set-and-save if setting bookmark-save-flat to 1 saves when adding/modifying a bookmark
-** DOING Open v0.7 Fit and Finish (ends 2024.04.18) [0/6]
-*** DOING [#B] Mu4e Doesn't Launch Properly on Fresh Archinstall
-Error was something about the mu server exiting.
-**** DOING Setup Virtualbox Testing
-***** DONE Create ArchBase and ArchSetup Images
-CLOSED: [2024-04-07 Sun 13:48]
-***** DOING Run Archsetup in ArchSetup Image
-***** TODO Run Mu4e Install Found in ~/.emacs.d/scripts/
-***** TODO Snapshot the Image
-*** TODO [#A] S-<right> is Undefined Error in Org Mode
-(should be org-agenda-todo-nextset)
-**** 2024-04-07 Sun @ 11:48:44 -0500 it's simply undefined in org-mode
-Looks like I just added it to org-agenda-mode?
-*** TODO [#A] Error When Starting org-drill in cj/org-drill-start
-let: Symbol’s function definition is void: org-drill
-*** TODO [#C] Dashboard Icons Aren't Correct or Sized Correctly on Fractal
+** DOING Open v0.7 Fit and Finish (ends 2024.04.18) [16/19]
+*** TODO [#B] Saving an Event for Today and Today's Calendar Doesn't Show the Event
+**** 2024-04-11 Thu @ 01:28:15 -0500 Reproduction
+- C-c c to bring up the capture templates
+- Select 'e' for event
+- Enter an event for the same day, then choose some time in the future (11:00pm)
+- Once completed, select f8
+Actual Behavior: Agenda shows and event isn't listed.
+Expected Behavior: Agenda shows with no events.
+
+I checked the schedule file and the event was properly entered.
+Tested on a fresh archsetup, but replicates on current laptop.
+*** TODO [#A] Fix Incorrect Refile Targets After Launch
*** TODO [#C] Check if Including Dired Buffers in Autorevert-mode Slows Tramp
-*** [#D] Completed v.07 Fit and Finish
-**** DONE [#A] Remove Security Keys
+*** DONE [#A] Remove Keys
CLOSED: [2024-04-07 Sun 13:46]
-***** Remove OpenAPI Key From ai-config.el
-****** 2024-04-07 Sun @ 13:21:22 -0500 Issue in ai-config.el
- ;; BUG: .authinfo.gpg not accessed for this key
-***** Purge History to Remove Historical Issues
+**** Remove OpenAPI Key From ai-config.el
+***** 2024-04-07 Sun @ 13:21:22 -0500 Issue in ai-config.el
+;; BUG: .authinfo.gpg not accessed for this key
+**** Purge History to Remove Historical Issues
Do this after other secrets are removed
-****** Google OAuth file in assets
-******* 2024-04-07 Sun @ 13:23:51 -0500 This One's in History. Fix by Purging History
-****** OpenAPI Key in help-utils.el
-******* 2024-04-07 Sun @ 13:19:10 -0500 Need to Erase History
+***** Google OAuth file in assets
+****** 2024-04-07 Sun @ 13:23:51 -0500 This One's in History. Fix by Purging History
+***** OpenAPI Key in help-utils.el
+****** 2024-04-07 Sun @ 13:19:10 -0500 Need to Erase History
Originally, I thought this was a duplicate use-package declaration.
Now it appears this is in history. I can simply:
- force delete the .git file
- recommit everything
- force push back to github and git.cjennings.net
- check the security section again to ensure it's gone.
-****** Google OAuth Client ID and Client Secret in org-agenda-config.el
-**** DONE [#B] cj/kill-buffers renamed
+***** Google OAuth Client ID and Client Secret in org-agenda-config.el
+*** DONE [#B] Rename cj/kill-buffers
CLOSED: [2024-04-04 Thu 19:17]
-**** DONE [#B] cj/kill-buffers doesn't select current buffer in completing read by default
+*** DONE [#B] cj/kill-buffers Doesn't Select Current Buffer in Completing Read by Default
CLOSED: [2024-04-04 Thu 19:17]
-**** DONE [#B] cj/kill-buffers should allow adding to invincible-buffers with C-u prefix
+*** DONE [#B] cj/kill-buffers Should Allow Adding to Invincible-buffers With C-u Prefix
CLOSED: [2024-04-04 Thu 19:33]
-**** DONE [#B] Mu4e Reply All Should Be Default
+*** DONE [#B] Mu4e Reply All Should Be Default
CLOSED: [2024-04-04 Thu 20:45]
make 'r' reply-all (or wide reply) and 'R' reply
no need to remove 'W' (for wide reply)
-***** 2024-04-04 Thu @ 20:36:56 -0500 Solution Tested to Be Working
+**** 2024-04-04 Thu @ 20:36:56 -0500 Solution Tested to Be Working
Need to adjust 'mu4e-view-mode'. Within that mode:
- the reply method is named "mu4e-compose-reply"
- the reply-all method is named "mu4e-compose-wide-reply"
@@ -215,19 +195,82 @@ There doesn't seem to be anything already mapped to "R", so adding the following
#+end_src
Tested both keys on a mail that had many recipients and it behaved in the way I expected.
-**** DONE [#B] cj/hyphenate-whitespace-in-region should leave point where it started
+*** DONE [#B] Hyphenating Whitespace Should Leave Point Where It Started
CLOSED: [2024-04-04 Thu 22:07]
-**** DONE [#C] Remove unnecessary .gitmodule file
-CLOSED: [2024-04-07 Sun 14:07]
-**** DONE [#C] move files in project root to assets
+*** DONE [#C] Move Non Init Visible Files in Emacs Config Root to Assets
CLOSED: [2024-04-07 Sun 14:21]
-***** 2024-04-07 Sun @ 14:07:56 -0500 files to move
+**** 2024-04-07 Sun @ 14:07:56 -0500 files to move
abbrev_defs
elfeed-dashboard
-**** DONE [#B] Kill All Windows Also Kills Invisible Buffers
+*** DONE [#B] Kill All Windows Also Kills Invisible Buffers
CLOSED: [2024-04-08 Mon 16:14]
-**** DONE [#C] Ripgrep Should Finish with Point on Results Buffer
+*** DONE [#C] Ripgrep Should Finish with Point on Results Buffer
CLOSED: [2024-04-08 Mon 16:14]
+*** DONE [#B] Dictionary Doesn't Work Via C-h d
+CLOSED: [2024-04-08 Mon 20:00]
+**** 2024-04-08 Mon @ 19:23:13 -0500 There's a Package on Melpa
+https://melpa.org/#/sdcv
+
+Also, it mentioned I needed stardict. I installed it, but it didn't change the error
+**** 2024-04-08 Mon @ 19:23:01 -0500 Issue
+Tried to look up agency and the dictionary failed.
+
+Found 1 items, similar to agency.
+-->Webster's Revised Unabridged Dictionary (1913)
+
+===
+Above this section the text is displayed.
+When copying and pasting the text, the rest of the text is displayed below
+===
+
+Found 1 items, similar to agency.
+-->Webster's Revised Unabridged Dictionary (1913)
+-->Agency
+
+Agency \A"gen*cy\, n.; pl. {Agencies}. [agentia, fr. L. agens,
+agentis: cf. F. agence. See {Agent}.]
+ 1. The faculty of acting or of exerting power; the state of
+ being in action; action; instrumentality.
+
+ The superintendence and agency of Providence in the
+ natural world. --Woodward.
+
+ 2. The office of an agent, or factor; the relation between a
+ principal and his agent; business of one intrusted with
+ the concerns of another.
+
+ 3. The place of business of am agent.
+
+ Syn: Action; operation; efficiency; management.
+
+ This was from cut and paste, the actual text didn't show.
+
+*** DONE [#A] S-<right> is Undefined Error in Org Mode
+CLOSED: [2024-04-08 Mon 21:30]
+(should be org-agenda-todo-nextset)
+**** 2024-04-07 Sun @ 11:48:44 -0500 it's simply undefined in org-mode
+Looks like I just added it to org-agenda-mode?
+*** DONE [#A] Error When Starting org-drill in cj/org-drill-start
+CLOSED: [2024-04-10 Wed 16:50]
+let: Symbol’s function definition is void: org-drill
+*** DONE [#C] Dashboard Icons Aren't Correct or Sized Correctly on Fractal
+CLOSED: [2024-04-10 Wed 17:16]
+*** DONE [#B] Fresh Install: Error When No Macros File Found
+CLOSED: [2024-04-11 Thu 01:11]
+default location: ~/sync/org/macros.el
+*** DONE [#B] Mu4e Doesn't Launch Properly on Fresh Archinstall
+CLOSED: [2024-04-11 Thu 01:18]
+Error was something about the mu server exiting.
+**** DONE Setup Virtualbox Testing
+CLOSED: [2024-04-11 Thu 01:18]
+***** DONE Create ArchBase and AqrchSetup Images
+CLOSED: [2024-04-07 Sun 13:48]
+***** DONE Run Archsetup in ArchSetup Image
+CLOSED: [2024-04-10 Wed 19:11]
+***** DONE Run Mu4e Install Found in ~/.emacs.d/scripts/
+CLOSED: [2024-04-11 Thu 01:17]
+***** DONE Snapshot the Image
+CLOSED: [2024-04-11 Thu 01:18]
** DOING Complete v0.7 Release Checklist [8/11]
*** DOING 2 Week Fit and Finish (ends 2024.04.18)
*** TODO Clean Launch from Archsetup
@@ -353,13 +396,13 @@ In order to use flyspell-correct-ivy interface you have to install flyspell-corr
Or via use-package.
(use-package flyspell-correct
- :after flyspell
- :bind (:map flyspell-mode-map ("C-;" . flyspell-correct-wrapper)))
+:after flyspell
+:bind (:map flyspell-mode-map ("C-;" . flyspell-correct-wrapper)))
(use-package flyspell-correct-ivy
- :after flyspell-correct)
+:after flyspell-correct)
If you do not want any binding, just replace :bind (:map
- flyspell-mode-map ("C-;" . flyspell-correct-wrapper)) with :defer t to use lazy loading.
+flyspell-mode-map ("C-;" . flyspell-correct-wrapper)) with :defer t to use lazy loading.
Note that in order to access actions in ivy interface you need to press M-o. More on ivy mini buffer key bindings you can read in official documentation.
#+END_QUOTE
@@ -622,40 +665,40 @@ Captured On: [2023-11-18 Sat 08:06]
*** TODO Dired Config with Sorting
#+BEGIN_QUOTE
(use-package dired
- :bind (
- :map dired-mode-map
- ("C-a" . my/dired-move-beginning-of-line)
- ("k" . dired-do-delete)
- ("D" . nil)
- ("s" . cc/dired-sort-by))
- :hook (dired-mode . dired-hide-details-mode)
- :init
- (progn
- (setq dired-auto-revert-buffer t)
- (setq dired-dwim-target t)
- (setq dired-listing-switches "-alh")
- (setq dired-recursive-deletes 'always)
- (setq dired-mouse-drag-files t)
-
- (defun my/dired-move-beginning-of-line ()
- (interactive)
- (let ((point (point)))
- (dired-move-to-filename)
- (when (= point (point))
- (move-beginning-of-line nil)))))
- :config
- (progn
- ;; http://yummymelon.com/devnull/enhancing-dired-sorting-with-transient.html
- (defun cc/--dired-sort-by (criteria &optional prefix-args)
- "Sort current Dired buffer according to CRITERIA and PREFIX-ARGS.
+:bind (
+:map dired-mode-map
+("C-a" . my/dired-move-beginning-of-line)
+("k" . dired-do-delete)
+("D" . nil)
+("s" . cc/dired-sort-by))
+:hook (dired-mode . dired-hide-details-mode)
+:init
+(progn
+(setq dired-auto-revert-buffer t)
+(setq dired-dwim-target t)
+(setq dired-listing-switches "-alh")
+(setq dired-recursive-deletes 'always)
+(setq dired-mouse-drag-files t)
+
+(defun my/dired-move-beginning-of-line ()
+(interactive)
+(let ((point (point)))
+(dired-move-to-filename)
+(when (= point (point))
+(move-beginning-of-line nil)))))
+:config
+(progn
+;; http://yummymelon.com/devnull/enhancing-dired-sorting-with-transient.html
+(defun cc/--dired-sort-by (criteria &optional prefix-args)
+"Sort current Dired buffer according to CRITERIA and PREFIX-ARGS.
This function will invoke `dired-sort-other' with arguments built from
CRITERIA and PREFIX-ARGS.
CRITERIA is a keyword of which the following are supported:
- :name :date-added :version
- :kind :date-metadata-changed :size
- :date-last-opened :date-modified
+:name :date-added :version
+:kind :date-metadata-changed :size
+:date-last-opened :date-modified
PREFIX-ARGS is a list of GNU ls arguments. If nil, then it will use the value
of `cc-dired-listing-switches'. Otherwise this is typically populated by the
@@ -664,117 +707,117 @@ Transient menu `cc/dired-sort-by'.
This function requires GNU ls from coreutils installed.
See the man page `ls(1)' for details."
- (let ((arg-list (list "-l")))
- (if prefix-args
- (nconc arg-list prefix-args)
- (nconc arg-list cc-dired-listing-switches))
- (cond
- ((eq criteria :name)
- (message "Sorted by name"))
-
- ((eq criteria :kind)
- (message "Sorted by kind")
- (push "--sort=extension" arg-list))
-
- ((eq criteria :date-last-opened)
- (message "Sorted by date last opened")
- (push "--sort=time" arg-list)
- (push "--time=access" arg-list))
-
- ((eq criteria :date-added)
- (message "Sorted by date added")
- (push "--sort=time" arg-list)
- (push "--time=creation" arg-list))
-
- ((eq criteria :date-modified)
- (message "Sorted by date modified")
- (push "--sort=time" arg-list)
- (push "--time=modification" arg-list))
-
- ((eq criteria :date-metadata-changed)
- (message "Sorted by date metadata changed")
- (push "--sort=time" arg-list)
- (push "--time=status" arg-list))
-
- ((eq criteria :version)
- (message "Sorted by version")
- (push "--sort=version" arg-list))
-
- ((eq criteria :size)
- (message "Sorted by size")
- (push "-S" arg-list))
-
- (t
- (message "Default sorted by name")))
-
- (dired-sort-other (mapconcat 'identity arg-list " "))))
-
- (require 'transient)
- (transient-define-prefix cc/dired-sort-by ()
- "Transient menu to sort Dired buffer by different criteria.
+(let ((arg-list (list "-l")))
+(if prefix-args
+(nconc arg-list prefix-args)
+(nconc arg-list cc-dired-listing-switches))
+(cond
+((eq criteria :name)
+(message "Sorted by name"))
+
+((eq criteria :kind)
+(message "Sorted by kind")
+(push "--sort=extension" arg-list))
+
+((eq criteria :date-last-opened)
+(message "Sorted by date last opened")
+(push "--sort=time" arg-list)
+(push "--time=access" arg-list))
+
+((eq criteria :date-added)
+(message "Sorted by date added")
+(push "--sort=time" arg-list)
+(push "--time=creation" arg-list))
+
+((eq criteria :date-modified)
+(message "Sorted by date modified")
+(push "--sort=time" arg-list)
+(push "--time=modification" arg-list))
+
+((eq criteria :date-metadata-changed)
+(message "Sorted by date metadata changed")
+(push "--sort=time" arg-list)
+(push "--time=status" arg-list))
+
+((eq criteria :version)
+(message "Sorted by version")
+(push "--sort=version" arg-list))
+
+((eq criteria :size)
+(message "Sorted by size")
+(push "-S" arg-list))
+
+(t
+(message "Default sorted by name")))
+
+(dired-sort-other (mapconcat 'identity arg-list " "))))
+
+(require 'transient)
+(transient-define-prefix cc/dired-sort-by ()
+"Transient menu to sort Dired buffer by different criteria.
This function requires GNU ls from coreutils installed."
- :value '("--human-readable"
- "--group-directories-first"
- "--time-style=long-iso")
- ; TODO: support cc-dired-listing-switches
- [["Arguments"
- ("-a" "all" "--all")
- ("g" "group directories first" "--group-directories-first")
- ("-r" "reverse" "--reverse")
- ("-h" "human readable" "--human-readable")
- ("t" "time style" "--time-style="
- :choices ("full-iso" "long-iso" "iso" "locale"))]
-
- ["Sort By"
- ("n"
- "Name"
- (lambda () (interactive)
- (cc/--dired-sort-by :name
- (transient-args transient-current-command)))
- :transient nil)
- ("k"
- "Kind"
- (lambda () (interactive)
- (cc/--dired-sort-by :kind
- (transient-args transient-current-command)))
- :transient nil)
- ("l"
- "Date Last Opened"
- (lambda () (interactive)
- (cc/--dired-sort-by :date-last-opened
- (transient-args transient-current-command)))
- :transient nil)
- ("a"
- "Date Added"
- (lambda () (interactive)
- (cc/--dired-sort-by :date-added
- (transient-args transient-current-command)))
- :transient nil)
- ("m"
- "Date Modified"
- (lambda () (interactive)
- (cc/--dired-sort-by :date-modified
- (transient-args transient-current-command)))
- :transient nil)
- ("M"
- "Date Metadata Changed"
- (lambda () (interactive)
- (cc/--dired-sort-by :date-metadata-changed
- (transient-args transient-current-command)))
- :transient nil)
- ("v"
- "Version"
- (lambda () (interactive)
- (cc/--dired-sort-by :version
- (transient-args transient-current-command)))
- :transient nil)
- ("s"
- "Size"
- (lambda () (interactive)
- (cc/--dired-sort-by :size
- (transient-args transient-current-command)))
- :transient nil)]])))
+:value '("--human-readable"
+"--group-directories-first"
+"--time-style=long-iso")
+; TODO: support cc-dired-listing-switches
+[["Arguments"
+("-a" "all" "--all")
+("g" "group directories first" "--group-directories-first")
+("-r" "reverse" "--reverse")
+("-h" "human readable" "--human-readable")
+("t" "time style" "--time-style="
+:choices ("full-iso" "long-iso" "iso" "locale"))]
+
+["Sort By"
+("n"
+"Name"
+(lambda () (interactive)
+(cc/--dired-sort-by :name
+(transient-args transient-current-command)))
+:transient nil)
+("k"
+"Kind"
+(lambda () (interactive)
+(cc/--dired-sort-by :kind
+(transient-args transient-current-command)))
+:transient nil)
+("l"
+"Date Last Opened"
+(lambda () (interactive)
+(cc/--dired-sort-by :date-last-opened
+(transient-args transient-current-command)))
+:transient nil)
+("a"
+"Date Added"
+(lambda () (interactive)
+(cc/--dired-sort-by :date-added
+(transient-args transient-current-command)))
+:transient nil)
+("m"
+"Date Modified"
+(lambda () (interactive)
+(cc/--dired-sort-by :date-modified
+(transient-args transient-current-command)))
+:transient nil)
+("M"
+"Date Metadata Changed"
+(lambda () (interactive)
+(cc/--dired-sort-by :date-metadata-changed
+(transient-args transient-current-command)))
+:transient nil)
+("v"
+"Version"
+(lambda () (interactive)
+(cc/--dired-sort-by :version
+(transient-args transient-current-command)))
+:transient nil)
+("s"
+"Size"
+(lambda () (interactive)
+(cc/--dired-sort-by :size
+(transient-args transient-current-command)))
+:transient nil)]])))
#+END_QUOTE
[[https://github.com/DamienCassou/emacs.d/blob/master/init.el#L352][emacs.d/init.el at master · DamienCassou/emacs.d]]
Captured On: [2024-04-05 Fri 15:15]
@@ -1201,42 +1244,42 @@ Captured On: [2023-11-04 Sat 17:24]
*** TODO Review Interesting Modus Themes Settings for Ideas
#+BEGIN_QUOTE
(use-package modus-themes
- :demand t
- :init
- (progn
- (setq modus-themes-bold-constructs t)
- (setq modus-themes-org-blocks 'greyscale)
- (setq modus-themes-italic-constructs t)
-
- (setq modus-themes-headings
- '((1 . (1.6))
- (2 . (background 1.5))
- (3 . (background bold 1.2))
- (4 . (1.1))
- (t . ())))
-
- (load-theme 'modus-operandi))
- :config
- (progn
- (with-eval-after-load 'pdf-tools
- ;; Configure PDF page colors. The code below comes from Modus
- ;; Info manual (Backdrop for pdf-tools (DIY)).
- (defun my/pdf-tools-backdrop ()
- "Change background to be different from standard background."
- (face-remap-add-relative
- 'default
- `(:background ,(modus-themes-color 'bg-alt))))
-
- (defun my/pdf-tools-midnight-mode-toggle ()
- "Change background of pdf-view-mode to adapt to current Modus theme."
- (when (eq major-mode 'pdf-view-mode)
- (if (eq (car custom-enabled-themes) 'modus-vivendi)
- (pdf-view-midnight-minor-mode 1)
- (pdf-view-midnight-minor-mode -1))
- (my/pdf-tools-backdrop)))
-
- (add-hook 'pdf-tools-enabled-hook #'my/pdf-tools-midnight-mode-toggle)
- (add-hook 'modus-themes-after-load-theme-hook #'my/pdf-tools-midnight-mode-toggle))))
+:demand t
+:init
+(progn
+(setq modus-themes-bold-constructs t)
+(setq modus-themes-org-blocks 'greyscale)
+(setq modus-themes-italic-constructs t)
+
+(setq modus-themes-headings
+'((1 . (1.6))
+(2 . (background 1.5))
+(3 . (background bold 1.2))
+(4 . (1.1))
+(t . ())))
+
+(load-theme 'modus-operandi))
+:config
+(progn
+(with-eval-after-load 'pdf-tools
+;; Configure PDF page colors. The code below comes from Modus
+;; Info manual (Backdrop for pdf-tools (DIY)).
+(defun my/pdf-tools-backdrop ()
+"Change background to be different from standard background."
+(face-remap-add-relative
+'default
+`(:background ,(modus-themes-color 'bg-alt))))
+
+(defun my/pdf-tools-midnight-mode-toggle ()
+"Change background of pdf-view-mode to adapt to current Modus theme."
+(when (eq major-mode 'pdf-view-mode)
+(if (eq (car custom-enabled-themes) 'modus-vivendi)
+(pdf-view-midnight-minor-mode 1)
+(pdf-view-midnight-minor-mode -1))
+(my/pdf-tools-backdrop)))
+
+(add-hook 'pdf-tools-enabled-hook #'my/pdf-tools-midnight-mode-toggle)
+(add-hook 'modus-themes-after-load-theme-hook #'my/pdf-tools-midnight-mode-toggle))))
#+END_QUOTE
[[https://github.com/DamienCassou/emacs.d/blob/master/init.el#L352][emacs.d/init.el at master · DamienCassou/emacs.d]]
Captured On: [2024-04-05 Fri 14:30]
@@ -1504,18 +1547,18 @@ If this variable is non-nil, every stack frame of the backtrace is displayed as
With debugger-stack-frame-as-list non-nil, the above example would look as follows:
----------- Buffer: backtrace-output ------------
- (backtrace)
- (list 'testing (backtrace))
- (progn ...)
- (eval (progn (1+ var) (list 'testing (backtrace))))
- (setq ...)
- (save-excursion ...)
- (let ...)
- (with-output-to-temp-buffer ...)
- (eval (with-output-to-temp-buffer ...))
- (eval-last-sexp-1 nil)
- (eval-last-sexp nil)
- (call-interactively eval-last-sexp)
+(backtrace)
+(list 'testing (backtrace))
+(progn ...)
+(eval (progn (1+ var) (list 'testing (backtrace))))
+(setq ...)
+(save-excursion ...)
+(let ...)
+(with-output-to-temp-buffer ...)
+(eval (with-output-to-temp-buffer ...))
+(eval-last-sexp-1 nil)
+(eval-last-sexp nil)
+(call-interactively eval-last-sexp)
----------- Buffer: backtrace-output ------------
#+END_QUOTE
[[https://www.gnu.org/software/emacs/manual/html_node/elisp/Internals-of-Debugger.html][Internals of Debugger (GNU Emacs Lisp Reference Manual)]]
@@ -1523,8 +1566,8 @@ Captured On: [2024-04-05 Fri 14:20]
*** TODO Print larger lists before abbreviating in edebug
#+BEGIN_QUOTE
(use-package edebug
- :init
- (setq edebug-print-length 5000))
+:init
+(setq edebug-print-length 5000))
#+END_QUOTE
[[https://github.com/DamienCassou/emacs.d/blob/master/init.el][emacs.d/init.el at master · DamienCassou/emacs.d]]
Captured On: [2024-04-05 Fri 14:24]
@@ -1534,133 +1577,133 @@ Captured On: [2024-04-05 Fri 15:28]
*** TODO Evaluate saveplace mode for Emacs
#+BEGIN_QUOTE
(use-package saveplace
- :demand t
- :config
- (progn
- (save-place-mode)))
+:demand t
+:config
+(progn
+(save-place-mode)))
#+END_QUOTE
[[https://github.com/DamienCassou/emacs.d/blob/master/init.el#L352][emacs.d/init.el at master · DamienCassou/emacs.d]]
Captured On: [2024-04-05 Fri 14:33]
*** TODO Avy config for issuing other commands
#+BEGIN_QUOTE
(use-package avy
- :bind* (("C-," . avy-goto-char-timer)
- :map isearch-mode-map
- ("C-," . avy-isearch))
- :bind (("M-g g" . avy-goto-line))
- :init
- (progn
- ;; home row on a Colemak keyboard:
- (setq avy-keys '(?a ?r ?s ?t ?d ?h ?n ?e ?i ?o))
- ;; Let me easily use actions beyond jump:
- (setq avy-single-candidate-jump nil)
- (setq avy-flyspell-correct-function #'ispell-word)
- (setq avy-timeout-seconds 0.4))
- :config
- (progn
- (defmacro my/avy-without-moving-point (point &rest body)
- "Move point to POINT than execute BODY and restore previous location."
- (declare (indent 1))
- `(unwind-protect
- (save-excursion
- (goto-char point)
- ,@body)
- (select-window (cdr (ring-ref avy-ring 0)))))
-
- (defun my/avy-action-help (point)
- "Show the Emacs help for thing at POINT."
- (my/avy-without-moving-point point
- (helpful-at-point)))
-
- (defun my/avy-action-kill-whole-line (point)
- "Kill the whole line at POINT."
- (my/avy-without-moving-point point
- (kill-whole-line)))
-
- (defun my/avy-action-embark (point)
- "Start `embark-act' at POINT."
- (my/avy-without-moving-point point
- (embark-act)))
-
- (setq avy-dispatch-alist
- '(
- ;; (?a) in avy-keys
- ;; (?b)
- ;; (?c)
- ;; (?d) in avy-keys
- ;; (?e) in avy-keys
- ;; (?f)
- ;; (?g)
- ;; (?h) in avy-keys
- ;; (?i) in avy-keys
- ;; (?j)
- ;; (?k)
- ;; (?l)
- ;; (?m)
- ;; (?n) in avy-keys
- ;; (?o) in avy-keys
- ;; (?p)
- ;; (?q)
- ;; (?r) in avy-keys
- ;; (?s) in avy-keys
- ;; (?t) in avy-keys
- ;; (?u)
- ;; (?v)
- ;; (?w)
- ;; (?x)
- ;; (?y)
- ;; (?z)
- ;; (?A)
- ;; (?B)
- ;; (?C)
- ;; (?D)
- ;; (?E)
- ;; (?F)
- ;; (?G)
- ;; (?H)
- ;; (?I)
- ;; (?J)
- ;; (?K)
- ;; (?L)
- ;; (?M)
- ;; (?N)
- ;; (?O)
- ;; (?P)
- ;; (?Q)
- ;; (?R)
- ;; (?S)
- ;; (?T)
- ;; (?U)
- ;; (?V)
- ;; (?W)
- ;; (?X)
- ;; (?Y)
- ;; (?Z)
- (?$ . avy-action-ispell)
- (?? . my/avy-action-help)
- (?\C-w . avy-action-kill-stay)
- (?\C-k . my/avy-action-kill-whole-line)
- (?\M-w . avy-action-copy)
- (?\C-\S-a . my/avy-action-embark)))))
+:bind* (("C-," . avy-goto-char-timer)
+:map isearch-mode-map
+("C-," . avy-isearch))
+:bind (("M-g g" . avy-goto-line))
+:init
+(progn
+;; home row on a Colemak keyboard:
+(setq avy-keys '(?a ?r ?s ?t ?d ?h ?n ?e ?i ?o))
+;; Let me easily use actions beyond jump:
+(setq avy-single-candidate-jump nil)
+(setq avy-flyspell-correct-function #'ispell-word)
+(setq avy-timeout-seconds 0.4))
+:config
+(progn
+(defmacro my/avy-without-moving-point (point &rest body)
+"Move point to POINT than execute BODY and restore previous location."
+(declare (indent 1))
+`(unwind-protect
+(save-excursion
+(goto-char point)
+,@body)
+(select-window (cdr (ring-ref avy-ring 0)))))
+
+(defun my/avy-action-help (point)
+"Show the Emacs help for thing at POINT."
+(my/avy-without-moving-point point
+(helpful-at-point)))
+
+(defun my/avy-action-kill-whole-line (point)
+"Kill the whole line at POINT."
+(my/avy-without-moving-point point
+(kill-whole-line)))
+
+(defun my/avy-action-embark (point)
+"Start `embark-act' at POINT."
+(my/avy-without-moving-point point
+(embark-act)))
+
+(setq avy-dispatch-alist
+'(
+;; (?a) in avy-keys
+;; (?b)
+;; (?c)
+;; (?d) in avy-keys
+;; (?e) in avy-keys
+;; (?f)
+;; (?g)
+;; (?h) in avy-keys
+;; (?i) in avy-keys
+;; (?j)
+;; (?k)
+;; (?l)
+;; (?m)
+;; (?n) in avy-keys
+;; (?o) in avy-keys
+;; (?p)
+;; (?q)
+;; (?r) in avy-keys
+;; (?s) in avy-keys
+;; (?t) in avy-keys
+;; (?u)
+;; (?v)
+;; (?w)
+;; (?x)
+;; (?y)
+;; (?z)
+;; (?A)
+;; (?B)
+;; (?C)
+;; (?D)
+;; (?E)
+;; (?F)
+;; (?G)
+;; (?H)
+;; (?I)
+;; (?J)
+;; (?K)
+;; (?L)
+;; (?M)
+;; (?N)
+;; (?O)
+;; (?P)
+;; (?Q)
+;; (?R)
+;; (?S)
+;; (?T)
+;; (?U)
+;; (?V)
+;; (?W)
+;; (?X)
+;; (?Y)
+;; (?Z)
+(?$ . avy-action-ispell)
+(?? . my/avy-action-help)
+(?\C-w . avy-action-kill-stay)
+(?\C-k . my/avy-action-kill-whole-line)
+(?\M-w . avy-action-copy)
+(?\C-\S-a . my/avy-action-embark)))))
#+END_QUOTE
[[https://github.com/DamienCassou/emacs.d/blob/master/init.el#L352][emacs.d/init.el at master · DamienCassou/emacs.d]]
Captured On: [2024-04-05 Fri 16:04]
*** TODO Investigate auto-compile package
#+BEGIN_QUOTE
(use-package auto-compile
- :demand t
- :init
- (progn
- (setq auto-compile-display-buffer nil)
- (setq auto-compile-source-recreate-deletes-dest t)
- (setq auto-compile-toggle-deletes-nonlib-dest t)
- (setq auto-compile-update-autoloads t))
- :hook (auto-compile-inhibit-compile . auto-compile-inhibit-compile-detached-git-head)
- :config
- (progn
- (auto-compile-on-load-mode)
- (auto-compile-on-save-mode)
- (auto-compile-use-mode-line-set nil nil)))
+:demand t
+:init
+(progn
+(setq auto-compile-display-buffer nil)
+(setq auto-compile-source-recreate-deletes-dest t)
+(setq auto-compile-toggle-deletes-nonlib-dest t)
+(setq auto-compile-update-autoloads t))
+:hook (auto-compile-inhibit-compile . auto-compile-inhibit-compile-detached-git-head)
+:config
+(progn
+(auto-compile-on-load-mode)
+(auto-compile-on-save-mode)
+(auto-compile-use-mode-line-set nil nil)))
#+END_QUOTE
[[https://github.com/DamienCassou/emacs.d/blob/master/init.el][emacs.d/init.el at master · DamienCassou/emacs.d]]
@@ -1669,7 +1712,7 @@ Captured On: [2024-04-05 Fri 14:16]
Looks like it makes scripts executable on save
#+BEGIN_QUOTE
(use-package executable
- :hook (after-save . executable-make-buffer-file-executable-if-script-p))
+:hook (after-save . executable-make-buffer-file-executable-if-script-p))
#+END_QUOTE
[[https://github.com/DamienCassou/emacs.d/blob/master/init.el][emacs.d/init.el at master · DamienCassou/emacs.d]]
Captured On: [2024-04-05 Fri 14:25]
@@ -1677,13 +1720,13 @@ Captured On: [2024-04-05 Fri 14:25]
perhaps you can also move it across to a specific column?
#+BEGIN_QUOTE
(use-package drag-stuff
- :demand t
- :config
- (progn
- (drag-stuff-global-mode)
- (drag-stuff-define-keys)
- (dolist (mode '(org-mode rebase-mode emacs-lisp-mode mpdel-playlist-current-playlist-mode))
- (add-to-list 'drag-stuff-except-modes mode))))
+:demand t
+:config
+(progn
+(drag-stuff-global-mode)
+(drag-stuff-define-keys)
+(dolist (mode '(org-mode rebase-mode emacs-lisp-mode mpdel-playlist-current-playlist-mode))
+(add-to-list 'drag-stuff-except-modes mode))))
#+END_QUOTE
[[https://github.com/DamienCassou/emacs.d/blob/master/init.el#L352][emacs.d/init.el at master · DamienCassou/emacs.d]]
Captured On: [2024-04-05 Fri 15:26]
@@ -1694,11 +1737,11 @@ Captured On: [2024-04-05 Fri 15:23]
[[https://github.com/thamer/runner][thamer/runner: Improved "open with" suggestions for dired mode in Emacs]]
(use-package runner
- :demand t
- :after dired
- :init
- (progn
- (setq runner-run-in-background t)))
+:demand t
+:after dired
+:init
+(progn
+(setq runner-run-in-background t)))
Captured On: [2024-04-05 Fri 15:16]
@@ -1706,24 +1749,24 @@ Captured On: [2024-04-05 Fri 15:16]
#+BEGIN_QUOTE
Package lin is available.
- Status: Available from gnu-local -- Install
- Archive: gnu-local
- Version: 1.0.0
- Commit: 09cf249c78385502a2ead30c4fa1468cf96939f7
- Summary: Make `hl-line-mode' more suitable for selection UIs
- Requires: emacs-27.1
- Website: https://git.sr.ht/~protesilaos/lin
- Keywords: convenience faces theme
- Maintainer: Lin Development <~protesilaos/lin@lists.sr.ht>
- Author: Protesilaos Stavrou <info@protesilaos.com>
+Status: Available from gnu-local -- Install
+Archive: gnu-local
+Version: 1.0.0
+Commit: 09cf249c78385502a2ead30c4fa1468cf96939f7
+Summary: Make `hl-line-mode' more suitable for selection UIs
+Requires: emacs-27.1
+Website: https://git.sr.ht/~protesilaos/lin
+Keywords: convenience faces theme
+Maintainer: Lin Development <~protesilaos/lin@lists.sr.ht>
+Author: Protesilaos Stavrou <info@protesilaos.com>
Other versions: 1.0.0 (gnu).
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- LIN IS NOTICEABLE (LIN.EL)
+━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+LIN IS NOTICEABLE (LIN.EL)
- Protesilaos Stavrou
- info@protesilaos.com
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+Protesilaos Stavrou
+info@protesilaos.com
+━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This manual, written by Protesilaos Stavrou, describes the specifics of
@@ -1739,9 +1782,9 @@ Current development target is 1.1.0-dev.
⁃ Official manual: <https://protesilaos.com/emacs/lin>
⁃ Change log: <https://protesilaos.com/emacs/lin-changelog>
⁃ Git repo on SourceHut: <https://git.sr.ht/~protesilaos/lin>
- • Mirrors:
- ⁃ GitHub: <https://github.com/protesilaos/lin>
- ⁃ GitLab: <https://gitlab.com/protesilaos/lin>
+• Mirrors:
+⁃ GitHub: <https://github.com/protesilaos/lin>
+⁃ GitLab: <https://gitlab.com/protesilaos/lin>
⁃ Mailing list: <https://lists.sr.ht/~protesilaos/lin>
Table of Contents
@@ -1764,55 +1807,55 @@ Table of Contents
1 COPYING
═════════
- Copyright (C) 2021-2022 Free Software Foundation, Inc.
+Copyright (C) 2021-2022 Free Software Foundation, Inc.
- Permission is granted to copy, distribute and/or modify
- this document under the terms of the GNU Free
- Documentation License, Version 1.3 or any later version
- published by the Free Software Foundation; with no
- Invariant Sections, with the Front-Cover Texts being “A
- GNU Manual,” and with the Back-Cover Texts as in (a)
- below. A copy of the license is included in the section
- entitled “GNU Free Documentation License.”
+Permission is granted to copy, distribute and/or modify
+this document under the terms of the GNU Free
+Documentation License, Version 1.3 or any later version
+published by the Free Software Foundation; with no
+Invariant Sections, with the Front-Cover Texts being “A
+GNU Manual,” and with the Back-Cover Texts as in (a)
+below. A copy of the license is included in the section
+entitled “GNU Free Documentation License.”
- (a) The FSF’s Back-Cover Text is: “You have the freedom to
- copy and modify this GNU manual.”
+(a) The FSF’s Back-Cover Text is: “You have the freedom to
+copy and modify this GNU manual.”
2 Overview LIN
══════════════
- Lin is a stylistic enhancement for Emacs’ built-in `hl-line-mode'. It
- remaps the `hl-line' face (or equivalent) buffer-locally to a style
- that is optimal for major modes where line selection is the primary
- mode of interaction.
-
- The idea is that `hl-line-mode' cannot work equally well for contexts
- with competing priorities: (i) line selection, or (ii) simple line
- highlight. In the former case, the current line needs to be made
- prominent because it carries a specific meaning of some significance
- in the given context: the user has to select a line. Whereas in the
- latter case, the primary mode of interaction does not revolve around
- the line highlight itself: it may be because the focus is on editing
- text or reading through the buffer’s contents, so the current line
- highlight is more of a reminder of the point’s location on the
- vertical axis.
-
- `lin-mode' enables `hl-line-mode' in the current buffer and remaps the
- appropriate face to the `lin-face'. The `lin-global-mode' follows the
- same principle, though it applies to all hooks specified in the user
- option `lin-mode-hooks'.
-
- Users can select their preferred style by customizing the user option
- `lin-face'. Options include the faces `lin-red', `lin-green',
- `lin-yellow', `lin-blue' (default), `lin-magenta', `lin-cyan',
- `lin-mac', `lin-red-override-fg', `lin-green-override-fg',
- `lin-yellow-override-fg', `lin-blue-override-fg',
- `lin-magenta-override-fg', `lin-cyan-override-fg',
- `lin-mac-override-fg', or any other face that preferably has a
- background attribute. The Lin faces with the `-override-fg' suffix
- set a foreground value which replaces that of the underlying text.
- Whereas the others only specify a background attribute.
+Lin is a stylistic enhancement for Emacs’ built-in `hl-line-mode'. It
+remaps the `hl-line' face (or equivalent) buffer-locally to a style
+that is optimal for major modes where line selection is the primary
+mode of interaction.
+
+The idea is that `hl-line-mode' cannot work equally well for contexts
+with competing priorities: (i) line selection, or (ii) simple line
+highlight. In the former case, the current line needs to be made
+prominent because it carries a specific meaning of some significance
+in the given context: the user has to select a line. Whereas in the
+latter case, the primary mode of interaction does not revolve around
+the line highlight itself: it may be because the focus is on editing
+text or reading through the buffer’s contents, so the current line
+highlight is more of a reminder of the point’s location on the
+vertical axis.
+
+`lin-mode' enables `hl-line-mode' in the current buffer and remaps the
+appropriate face to the `lin-face'. The `lin-global-mode' follows the
+same principle, though it applies to all hooks specified in the user
+option `lin-mode-hooks'.
+
+Users can select their preferred style by customizing the user option
+`lin-face'. Options include the faces `lin-red', `lin-green',
+`lin-yellow', `lin-blue' (default), `lin-magenta', `lin-cyan',
+`lin-mac', `lin-red-override-fg', `lin-green-override-fg',
+`lin-yellow-override-fg', `lin-blue-override-fg',
+`lin-magenta-override-fg', `lin-cyan-override-fg',
+`lin-mac-override-fg', or any other face that preferably has a
+background attribute. The Lin faces with the `-override-fg' suffix
+set a foreground value which replaces that of the underlying text.
+Whereas the others only specify a background attribute.
3 Installation
@@ -1824,107 +1867,122 @@ Table of Contents
3.1 GNU ELPA package
────────────────────
- The package is available as `lin'. Simply do:
+The package is available as `lin'. Simply do:
- ┌────
- │ M-x package-refresh-contents
- │ M-x package-install
- └────
+┌────
+│ M-x package-refresh-contents
+│ M-x package-install
+└────
- And search for it.
+And search for it.
- GNU ELPA provides the latest stable release. Those who prefer to
- follow the development process in order to report bugs or suggest
- changes, can use the version of the package from the GNU-devel ELPA
- archive. Read:
- <https://protesilaos.com/codelog/2022-05-13-emacs-elpa-devel/>.
+GNU ELPA provides the latest stable release. Those who prefer to
+follow the development process in order to report bugs or suggest
+changes, can use the version of the package from the GNU-devel ELPA
+archive. Read:
+<https://protesilaos.com/codelog/2022-05-13-emacs-elpa-devel/>.
3.2 Manual installation
───────────────────────
- Assuming your Emacs files are found in `~/.emacs.d/', execute the
- following commands in a shell prompt:
+Assuming your Emacs files are found in `~/.emacs.d/', execute the
+following commands in a shell prompt:
- ┌────
- │ cd ~/.emacs.d
- │
- │ # Create a directory for manually-installed packages
- │ mkdir manual-packages
- │
- │ # Go to the new directory
- │ cd manual-packages
- │
- │ # Clone this repo, naming it "lin"
- │ git clone https://git.sr.ht/~protesilaos/lin lin
- └────
+┌────
+│ cd ~/.emacs.d
+│
+│ # Create a directory for manually-installed packages
+│ mkdir manual-packages
+│
+│ # Go to the new directory
+│ cd manual-packages
+│
+│ # Clone this repo, naming it "lin"
+│ git clone https://git.sr.ht/~protesilaos/lin lin
+└────
- Finally, in your `init.el' (or equivalent) evaluate this:
+Finally, in your `init.el' (or equivalent) evaluate this:
- ┌────
- │ ;; Make Elisp files in that directory available to the user.
- │ (add-to-list 'load-path "~/.emacs.d/manual-packages/lin")
- └────
+┌────
+│ ;; Make Elisp files in that directory available to the user.
+│ (add-to-list 'load-path "~/.emacs.d/manual-packages/lin")
+└────
- Everything is in place to set up the package.
+Everything is in place to set up the package.
4 Sample configuration
══════════════════════
- ┌────
- │ (require 'lin)
- │
- │ (setq lin-face 'lin-blue) ; check doc string for alternative styles
- │
- │ ;; You can use this to live update the face:
- │ ;;
- │ ;; (customize-set-variable 'lin-face 'lin-green)
- │
- │ (setq lin-mode-hooks
- │ '(bongo-mode-hook
- │ dired-mode-hook
- │ elfeed-search-mode-hook
- │ git-rebase-mode-hook
- │ grep-mode-hook
- │ ibuffer-mode-hook
- │ ilist-mode-hook
- │ ledger-report-mode-hook
- │ log-view-mode-hook
- │ magit-log-mode-hook
- │ mu4e-headers-mode
- │ notmuch-search-mode-hook
- │ notmuch-tree-mode-hook
- │ occur-mode-hook
- │ org-agenda-mode-hook
- │ pdf-outline-buffer-mode-hook
- │ proced-mode-hook
- │ tabulated-list-mode-hook))
- │
- │ (lin-global-mode 1)
- └────
-
- Check out Christian Tietze’s blog post on integrating Lin with
- Neotree: <https://christiantietze.de/posts/2022/03/hl-line-priority/>.
+┌────
+│ (require 'lin)
+│
+│ (setq lin-face 'lin-blue) ; check doc string for alternative styles
+│
+│ ;; You can use this to live update the face:
+│ ;;
+│ ;; (customize-set-variable 'lin-face 'lin-green)
+│
+│ (setq lin-mode-hooks
+│ '(bongo-mode-hook
+│ dired-mode-hook
+│ elfeed-search-mode-hook
+│ git-rebase-mode-hook
+│ grep-mode-hook
+│ ibuffer-mode-hook
+│ ilist-mode-hook
+│ ledger-report-mode-hook
+│ log-view-mode-hook
+│ magit-log-mode-hook
+│ mu4e-headers-mode
+│ notmuch-search-mode-hook
+│ notmuch-tree-mode-hook
+│ occur-mode-hook
+│ org-agenda-mode-hook
+│ pdf-outline-buffer-mode-hook
+│ proced-mode-hook
+│ tabulated-list-mode-hook))
+│
+│ (lin-global-mode 1)
+└────
+
+Check out Christian Tietze’s blog post on integrating Lin with
+Neotree: <https://christiantietze.de/posts/2022/03/hl-line-priority/>.
5 Acknowledgements
══════════════════
- Lin is meant to be a collective effort. Every bit of help matters.
+Lin is meant to be a collective effort. Every bit of help matters.
- Author/maintainer
- Protesilaos Stavrou.
+Author/maintainer
+Protesilaos Stavrou.
- Contributions to code or documentation
- Christian Tietze, Damien Cassou, Federico Stilman, Gautier
- Ponsinet, Kai von Fintel, Nicolas De Jaeghere.
+Contributions to code or documentation
+Christian Tietze, Damien Cassou, Federico Stilman, Gautier
+Ponsinet, Kai von Fintel, Nicolas De Jaeghere.
#+END_QUOTE
[[help:Package][]]
Captured On: [2024-04-05 Fri 14:43]
+*** TODO Check into spacious padding mode
+
+Sample Config from Damien Cassou's Emacs Config
+#+BEGIN_QUOTE
+(use-package spacious-padding
+:demand t
+:hook (server-after-make-frame . spacious-padding-mode)
+:config
+(progn
+(setq spacious-padding-subtle-mode-line
+'(:mode-line-active error :mode-line-inactive shadow))))
+
+#+END_QUOTE
+[[https://raw.githubusercontent.com/DamienCassou/emacs.d/master/init.el][]]
+Captured On: [2024-04-06 Sat 10:54]
** Emacs Help Config Backlog [0/1]
*** TODO Remap keys from regular help to these instead of overwriting them in help-config
** Emacs Host Environment Backlog [0/1]
@@ -2061,175 +2119,175 @@ Captured On: [2023-11-18 Sat 07:16]
*** TODO Large Ledger Configuration
#+BEGIN_QUOTE
(use-package ledger-mode
- :hook (ledger-mode . my/configure-ledger-mode)
- :mode "\\.hledger\\'"
- :bind (
- :map ledger-mode-map
- ("C-c C-r" . ledger-report)
- ("C-c C-c" . my/ledger-lint)
- ;; To get outline-minor-mode in ledger buffers:
- ("TAB" . org-cycle)
- :map ledger-report-mode-map
- ("C-c C-r" . ledger-report))
- :init
- (progn
- (setq ledger-reports
- (mapcar
- (lambda (pair)
- (list (car pair)
- (format "%s %s"
- "%(binary) -f %(ledger-file)"
- (cdr pair))))
- '(("Account statement" . "register --ignore-assertions --auto ^%(account)")
- ("Income statement" . "balance --ignore-assertions --auto --tree --period %(month) --invert ^income ^expense")
- ("Balance sheet" . "balance --ignore-assertions --auto --tree ^asset ^debt \"^equity:\"")
- ("Budget" . "balance --ignore-assertions --auto --tree --empty ^budget not:unbudgeted"))))
-
- ;; For hledger
- (progn
- (setq ledger-mode-should-check-version nil)
- (setq ledger-binary-path (executable-find "hledger"))
- (setq ledger-report-links-in-register nil)
- (setq ledger-report-native-highlighting-arguments '("--color=always"))
- (setq ledger-report-auto-width nil))
-
- (setq ledger-reconcile-default-commodity "EUR")
- (setq ledger-report-use-header-line t)
- (setq ledger-report-use-native-highlighting t)
- (setq ledger-report-auto-refresh-sticky-cursor t)
- (setq ledger-report-use-strict t)
- (setq ledger-highlight-xact-under-point nil)
- (setq ledger-copy-transaction-insert-blank-line-after t)
-
- (defun my/ledger-configure-outline-minor-mode ()
- "Configure a ledger buffer when `outline-minor-mode' is active."
- (font-lock-add-keywords 'ledger-mode outline-font-lock-keywords)
- (setq-local ;; copied from outline-mode major mode:
- imenu-generic-expression
- (list (list nil (concat "^\\(?:" outline-regexp "\\).*$") 0))))
-
- (defun my/configure-ledger-mode ()
- "Configure the current Ledger buffer."
- ;; use TAB to complete:
- (setq-local tab-always-indent 'complete)
- (add-hook 'outline-minor-mode-hook #'my/ledger-configure-outline-minor-mode nil t)))
- :config
- (progn
- (let ((date-format "%A, %B %-e"))
- (defun my/ledger-position-at-date (moment)
- "Move point in current buffer to insert new transaction at MOMENT.
+:hook (ledger-mode . my/configure-ledger-mode)
+:mode "\\.hledger\\'"
+:bind (
+:map ledger-mode-map
+("C-c C-r" . ledger-report)
+("C-c C-c" . my/ledger-lint)
+;; To get outline-minor-mode in ledger buffers:
+("TAB" . org-cycle)
+:map ledger-report-mode-map
+("C-c C-r" . ledger-report))
+:init
+(progn
+(setq ledger-reports
+(mapcar
+(lambda (pair)
+(list (car pair)
+(format "%s %s"
+"%(binary) -f %(ledger-file)"
+(cdr pair))))
+'(("Account statement" . "register --ignore-assertions --auto ^%(account)")
+("Income statement" . "balance --ignore-assertions --auto --tree --period %(month) --invert ^income ^expense")
+("Balance sheet" . "balance --ignore-assertions --auto --tree ^asset ^debt \"^equity:\"")
+("Budget" . "balance --ignore-assertions --auto --tree --empty ^budget not:unbudgeted"))))
+
+;; For hledger
+(progn
+(setq ledger-mode-should-check-version nil)
+(setq ledger-binary-path (executable-find "hledger"))
+(setq ledger-report-links-in-register nil)
+(setq ledger-report-native-highlighting-arguments '("--color=always"))
+(setq ledger-report-auto-width nil))
+
+(setq ledger-reconcile-default-commodity "EUR")
+(setq ledger-report-use-header-line t)
+(setq ledger-report-use-native-highlighting t)
+(setq ledger-report-auto-refresh-sticky-cursor t)
+(setq ledger-report-use-strict t)
+(setq ledger-highlight-xact-under-point nil)
+(setq ledger-copy-transaction-insert-blank-line-after t)
+
+(defun my/ledger-configure-outline-minor-mode ()
+"Configure a ledger buffer when `outline-minor-mode' is active."
+(font-lock-add-keywords 'ledger-mode outline-font-lock-keywords)
+(setq-local ;; copied from outline-mode major mode:
+imenu-generic-expression
+(list (list nil (concat "^\\(?:" outline-regexp "\\).*$") 0))))
+
+(defun my/configure-ledger-mode ()
+"Configure the current Ledger buffer."
+;; use TAB to complete:
+(setq-local tab-always-indent 'complete)
+(add-hook 'outline-minor-mode-hook #'my/ledger-configure-outline-minor-mode nil t)))
+:config
+(progn
+(let ((date-format "%A, %B %-e"))
+(defun my/ledger-position-at-date (moment)
+"Move point in current buffer to insert new transaction at MOMENT.
MOMENT is an encoded date."
- (let ((heading (format "*** %s" (format-time-string date-format moment))))
- (goto-char (point-min))
- (search-forward heading)
- (forward-line)
- (re-search-forward "; \\*\\*\\*" nil t)
- (goto-char (line-beginning-position)))))
-
- (advice-add #'ledger-xact-find-slot :override #'my/ledger-position-at-date)
-
- (defun my/ledger-lint ()
- "Lint my ledger file."
- (interactive)
- (require 'autoclose-shell)
- (save-buffer)
- (autoclose-shell-start "lint-system" '("lint-system")))
-
- (defun my/ledger-insert-mortgage-transaction ()
- "Read accounting data for MORTGAGE and write the ledger entry."
- (interactive)
- (ensure-empty-lines 1)
- (let* ((description (read-string "Description: "))
- (date (ledger-read-date "Date: "))
- (begining (point)))
- (insert (format "%s %s\n" date description))
- (insert (format " asset:current:couple 0\n"))
- (insert (format " expense:misc 0\n"))
- (save-excursion
- (goto-char begining)
- (my/ledger-mortgage-rewrite))))
-
- (defun my/ledger-mortgage-read-numbers ()
- "Returns the numbers of the current mortgage reimbursement transaction.
+(let ((heading (format "*** %s" (format-time-string date-format moment))))
+(goto-char (point-min))
+(search-forward heading)
+(forward-line)
+(re-search-forward "; \\*\\*\\*" nil t)
+(goto-char (line-beginning-position)))))
+
+(advice-add #'ledger-xact-find-slot :override #'my/ledger-position-at-date)
+
+(defun my/ledger-lint ()
+"Lint my ledger file."
+(interactive)
+(require 'autoclose-shell)
+(save-buffer)
+(autoclose-shell-start "lint-system" '("lint-system")))
+
+(defun my/ledger-insert-mortgage-transaction ()
+"Read accounting data for MORTGAGE and write the ledger entry."
+(interactive)
+(ensure-empty-lines 1)
+(let* ((description (read-string "Description: "))
+(date (ledger-read-date "Date: "))
+(begining (point)))
+(insert (format "%s %s\n" date description))
+(insert (format " asset:current:couple 0\n"))
+(insert (format " expense:misc 0\n"))
+(save-excursion
+(goto-char begining)
+(my/ledger-mortgage-rewrite))))
+
+(defun my/ledger-mortgage-read-numbers ()
+"Returns the numbers of the current mortgage reimbursement transaction.
The returned value is of the form (:capital CAPITAL :insurance INSURANCE :interest INTEREST)."
- (cl-labels ((parse-number (string) (string-to-number (string-replace "," "." string))))
- (let* ((number-regexp (rx (1+ (any digit)) ?, (1+ (any digit))))
- (regexp (rx "ECHEANCE PRET"
- (? " -")
- " DONT CAP "
- (group-n 1 (regexp number-regexp))
- " ASS. "
- (group-n 2 (regexp number-regexp))
- "E"
- (? " -")
- " INT. "
- (group-n 3 (regexp number-regexp))
- (? " COM. 0,00E"))))
- (save-match-data
- (save-excursion
- (ledger-navigate-beginning-of-xact)
- (when-let* (((re-search-forward regexp (line-end-position)))
- (capital (parse-number (match-string 1)))
- (insurance (parse-number (match-string 2)))
- (interest (parse-number (match-string 3))))
- (list :capital capital :insurance insurance :interest interest)))))))
-
- (defun my/ledger-mortgage-guess-type (numbers)
- "Return the type of the transaction with NUMBERS.
+(cl-labels ((parse-number (string) (string-to-number (string-replace "," "." string))))
+(let* ((number-regexp (rx (1+ (any digit)) ?, (1+ (any digit))))
+(regexp (rx "ECHEANCE PRET"
+(? " -")
+" DONT CAP "
+(group-n 1 (regexp number-regexp))
+" ASS. "
+(group-n 2 (regexp number-regexp))
+"E"
+(? " -")
+" INT. "
+(group-n 3 (regexp number-regexp))
+(? " COM. 0,00E"))))
+(save-match-data
+(save-excursion
+(ledger-navigate-beginning-of-xact)
+(when-let* (((re-search-forward regexp (line-end-position)))
+(capital (parse-number (match-string 1)))
+(insurance (parse-number (match-string 2)))
+(interest (parse-number (match-string 3))))
+(list :capital capital :insurance insurance :interest interest)))))))
+
+(defun my/ledger-mortgage-guess-type (numbers)
+"Return the type of the transaction with NUMBERS.
The type is either 'ecoptz, 'immo1 or 'immo2.
NUMBERS is of the form (:capital CAPITAL :insurance INSURANCE :interest INTEREST)."
- (cond
- ((and (>= (map-elt numbers :insurance) 0.1)
- (= (map-elt numbers :interest) 0))
- 'ecoptz)
- ((or (>= (map-elt numbers :insurance) 0.1)
- (= (map-elt numbers :interest) 0))
- (user-error "Invalid numbers: %S" numbers))
- ((>= (map-elt numbers :capital) 700) 'immo1)
- (t 'immo2)))
-
- (defun my/ledger-mortgage-rewrite ()
- "Rewrite the mortgage transaction at point."
- (interactive)
- (when-let* ((numbers (my/ledger-mortgage-read-numbers))
- (total (seq-reduce
- #'+
- (map-values (my/ledger-mortgage-read-numbers))
- 0))
- (mortgage-type (my/ledger-mortgage-guess-type numbers)))
- (save-match-data
- (save-excursion
- (ledger-navigate-beginning-of-xact)
- (when (re-search-forward " .*$" (line-end-position)) ; skip date
- (replace-match " banque populaire prêt" t)
- (next-line)
- (delete-region (line-beginning-position) (line-end-position))
- (insert (format " asset:current:couple %.2f" (- total)))
- (ledger-navigate-end-of-xact)
- (delete-region (line-beginning-position) (line-end-position))
- (map-do
- (lambda (number-type number)
- (when (> number 0)
- (let ((account (if (eq number-type :insurance)
- "expense:util:insurance"
- (format "expense:mortgage:%s%s" mortgage-type number-type))))
- (insert " " account " " (number-to-string number) "\n"))))
- numbers)
- (delete-backward-char 1) ; remove additional newline
- (ledger-post-align-dwim))))))))
+(cond
+((and (>= (map-elt numbers :insurance) 0.1)
+(= (map-elt numbers :interest) 0))
+'ecoptz)
+((or (>= (map-elt numbers :insurance) 0.1)
+(= (map-elt numbers :interest) 0))
+(user-error "Invalid numbers: %S" numbers))
+((>= (map-elt numbers :capital) 700) 'immo1)
+(t 'immo2)))
+
+(defun my/ledger-mortgage-rewrite ()
+"Rewrite the mortgage transaction at point."
+(interactive)
+(when-let* ((numbers (my/ledger-mortgage-read-numbers))
+(total (seq-reduce
+#'+
+(map-values (my/ledger-mortgage-read-numbers))
+0))
+(mortgage-type (my/ledger-mortgage-guess-type numbers)))
+(save-match-data
+(save-excursion
+(ledger-navigate-beginning-of-xact)
+(when (re-search-forward " .*$" (line-end-position)) ; skip date
+(replace-match " banque populaire prêt" t)
+(next-line)
+(delete-region (line-beginning-position) (line-end-position))
+(insert (format " asset:current:couple %.2f" (- total)))
+(ledger-navigate-end-of-xact)
+(delete-region (line-beginning-position) (line-end-position))
+(map-do
+(lambda (number-type number)
+(when (> number 0)
+(let ((account (if (eq number-type :insurance)
+"expense:util:insurance"
+(format "expense:mortgage:%s%s" mortgage-type number-type))))
+(insert " " account " " (number-to-string number) "\n"))))
+numbers)
+(delete-backward-char 1) ; remove additional newline
+(ledger-post-align-dwim))))))))
(use-package flymake-hledger
- :config
- (progn
- (setq flymake-hledger-command '("hledger" "--auto"))
+:config
+(progn
+(setq flymake-hledger-command '("hledger" "--auto"))
- ;; Enable 4 optional checks. See URL
- ;; https://hledger.org/1.30/hledger.html#check for the meaning of
- ;; each check and a list of all of them.
- (dolist (check '("ordereddates" "payees" "recentassertions" "tags"))
- (add-to-list 'flymake-hledger-checks check))))
+;; Enable 4 optional checks. See URL
+;; https://hledger.org/1.30/hledger.html#check for the meaning of
+;; each check and a list of all of them.
+(dolist (check '("ordereddates" "payees" "recentassertions" "tags"))
+(add-to-list 'flymake-hledger-checks check))))
#+END_QUOTE
[[https://github.com/DamienCassou/emacs.d/blob/master/init.el#L352][emacs.d/init.el at master · DamienCassou/emacs.d]]
@@ -2237,58 +2295,58 @@ Captured On: [2024-04-05 Fri 15:21]
*** TODO Ledger Import Config
#+BEGIN_QUOTE
(use-package ledger-complete
- :init
- (progn
- (setq ledger-complete-in-steps nil)))
+:init
+(progn
+(setq ledger-complete-in-steps nil)))
(use-package ledger-import
- :hook ((ledger-import-finished . my/ledger-import-finish))
- :config
- (progn
- (setq ledger-import-boobank-import-from-date "2023-07-29")
- (setq ledger-import-autosync-command
- '("hledger-autosync" "--assertions"
- "--payee-format" "{payee}"))
-
- (defun my/ledger-import-alert ()
- "Notify the user that import is finished."
- (alert "Finished"
- :title "Ledger-autosync"
- :buffer (current-buffer)))
-
- (defun my/ledger-import-remove-EUR ()
- "Remove the EUR commodity in the current buffer."
- (goto-char (point-min))
- (while (search-forward " EUR" nil t)
- (replace-match ""))
- (ledger-mode-clean-buffer))
-
- (defun my/ledger-import-merge-autosync-transactions ()
- "Merge all autosync transactions into just one."
- (goto-char (point-min))
- (search-forward "Autosync Balance Assertion")
- (delete-matching-lines "Autosync Balance Assertion")
- (delete-matching-lines "^$"))
-
- (defun my/ledger-import-add-today-date-as-outline ()
- "Add today's date as `outline-mode' markup."
- (goto-char (point-min))
- (search-forward "Autosync Balance Assertion")
- (goto-char (line-beginning-position))
- (insert (format "*** %s\n\n" (format-time-string "%B %-d"))))
-
- (defun my/ledger-import-finish ()
- "Some actions to do when ledger-import finishes."
- (interactive)
- (my/ledger-import-remove-EUR)
- (my/ledger-import-merge-autosync-transactions)
- (my/ledger-import-add-today-date-as-outline)
- (my/ledger-import-alert))
-
- ;; Fill `ledger-import-accounts' and `ledger-import-ofx-rewrite-rules':
- (let ((file (expand-file-name "~/.password-store/Secure_Notes/ledger-accounts.gpg")))
- (when (file-exists-p file)
- (load file t)))))
+:hook ((ledger-import-finished . my/ledger-import-finish))
+:config
+(progn
+(setq ledger-import-boobank-import-from-date "2023-07-29")
+(setq ledger-import-autosync-command
+'("hledger-autosync" "--assertions"
+"--payee-format" "{payee}"))
+
+(defun my/ledger-import-alert ()
+"Notify the user that import is finished."
+(alert "Finished"
+:title "Ledger-autosync"
+:buffer (current-buffer)))
+
+(defun my/ledger-import-remove-EUR ()
+"Remove the EUR commodity in the current buffer."
+(goto-char (point-min))
+(while (search-forward " EUR" nil t)
+(replace-match ""))
+(ledger-mode-clean-buffer))
+
+(defun my/ledger-import-merge-autosync-transactions ()
+"Merge all autosync transactions into just one."
+(goto-char (point-min))
+(search-forward "Autosync Balance Assertion")
+(delete-matching-lines "Autosync Balance Assertion")
+(delete-matching-lines "^$"))
+
+(defun my/ledger-import-add-today-date-as-outline ()
+"Add today's date as `outline-mode' markup."
+(goto-char (point-min))
+(search-forward "Autosync Balance Assertion")
+(goto-char (line-beginning-position))
+(insert (format "*** %s\n\n" (format-time-string "%B %-d"))))
+
+(defun my/ledger-import-finish ()
+"Some actions to do when ledger-import finishes."
+(interactive)
+(my/ledger-import-remove-EUR)
+(my/ledger-import-merge-autosync-transactions)
+(my/ledger-import-add-today-date-as-outline)
+(my/ledger-import-alert))
+
+;; Fill `ledger-import-accounts' and `ledger-import-ofx-rewrite-rules':
+(let ((file (expand-file-name "~/.password-store/Secure_Notes/ledger-accounts.gpg")))
+(when (file-exists-p file)
+(load file t)))))
#+END_QUOTE
[[https://github.com/DamienCassou/emacs.d/blob/master/init.el#L352][emacs.d/init.el at master · DamienCassou/emacs.d]]
Captured On: [2024-04-05 Fri 15:21]
@@ -2391,19 +2449,19 @@ People sometimes ask about having multi-character shortcuts for bookmarks; an ea
With Hydra installed, we can add multi-character shortcuts, for instance:
(defhydra my-mu4e-bookmarks-work (:color blue)
- "work bookmarks"
- ("b" (mu4e-search "banana AND maildir:/work") "banana")
- ("u" (mu4e-search "flag:unread AND maildir:/work") "unread"))
+"work bookmarks"
+("b" (mu4e-search "banana AND maildir:/work") "banana")
+("u" (mu4e-search "flag:unread AND maildir:/work") "unread"))
(defhydra my-mu4e-bookmarks-personal (:color blue)
- "personal bookmarks"
- ("c" (mu4e-search "capybara AND maildir:/personal") "capybara")
- ("u" (mu4e-search "flag:unread AND maildir:/personal") "unread"))
+"personal bookmarks"
+("c" (mu4e-search "capybara AND maildir:/personal") "capybara")
+("u" (mu4e-search "flag:unread AND maildir:/personal") "unread"))
(defhydra my-mu4e-bookmarks (:color blue)
- "mu4e bookmarks"
- ("p" (my-mu4e-bookmarks-personal/body) "Personal")
- ("w" (my-mu4e-bookmarks-work/body) "Work"))
+"mu4e bookmarks"
+("p" (my-mu4e-bookmarks-personal/body) "Personal")
+("w" (my-mu4e-bookmarks-work/body) "Work"))
Now, you can bind a convenient key to my-mu4e-bookmarks/body.
#+END_QUOTE
@@ -2440,15 +2498,15 @@ Captured On: [2024-04-05 Fri 15:03]
*** TODO Mail Settings for (Email) Address-at-point
#+BEGIN_QUOTE
(use-package goto-addr
- :bind (
- :map goto-address-highlight-keymap
- ("C-c C-o" . goto-address-at-point))
- :hook (((prog-mode magit-process-mode) . goto-address-mode))
- :config
- (progn
- ;; Recommended by modus-themes (2.7.0 release notes):
- (setq goto-address-mail-face 'link)
- (setq goto-address-mail-mouse-face 'highlight)))
+:bind (
+:map goto-address-highlight-keymap
+("C-c C-o" . goto-address-at-point))
+:hook (((prog-mode magit-process-mode) . goto-address-mode))
+:config
+(progn
+;; Recommended by modus-themes (2.7.0 release notes):
+(setq goto-address-mail-face 'link)
+(setq goto-address-mail-mouse-face 'highlight)))
#+END_QUOTE
[[https://github.com/DamienCassou/emacs.d/blob/master/init.el#L352][emacs.d/init.el at master · DamienCassou/emacs.d]]
Captured On: [2024-04-05 Fri 14:35]
@@ -2506,21 +2564,21 @@ Birthdays aren't showing up in the agenda from org-contacts
*** TODO Investigate Org Caldav to Integrate Calendar With Agenda
#+BEGIN_QUOTE
(use-package org-caldav
- :bind (("C-. o S" . org-caldav-sync))
- :config
- (progn
- (setq org-caldav-url "https://licorne.ninja/remote.php/dav/calendars/DamienCassou"
- org-caldav-calendar-id "personal"
- org-caldav-inbox org-default-calendar-file
- org-caldav-files '()
- org-icalendar-timezone "Europe/Berlin"
- org-caldav-sync-changes-to-org 'all)
-
- (defun my/org-caldav-archive-year ()
- "Archive a given year in my calendar."
- (interactive)
- (while (re-search-forward "^ *<2021-.*>$" nil t)
- (org-archive-subtree)))))
+:bind (("C-. o S" . org-caldav-sync))
+:config
+(progn
+(setq org-caldav-url "https://licorne.ninja/remote.php/dav/calendars/DamienCassou"
+org-caldav-calendar-id "personal"
+org-caldav-inbox org-default-calendar-file
+org-caldav-files '()
+org-icalendar-timezone "Europe/Berlin"
+org-caldav-sync-changes-to-org 'all)
+
+(defun my/org-caldav-archive-year ()
+"Archive a given year in my calendar."
+(interactive)
+(while (re-search-forward "^ *<2021-.*>$" nil t)
+(org-archive-subtree)))))
#+END_QUOTE
[[https://github.com/DamienCassou/emacs.d/blob/master/init.el#L352][emacs.d/init.el at master · DamienCassou/emacs.d]]
Captured On: [2024-04-05 Fri 15:24]
@@ -2778,7 +2836,7 @@ his is what I did:
We want a small emacs window centred on the screen.
#+BEGIN_SRC sh :tangle ~/scripts/emacs-capture :shebang "#!/bin/sh"
-emacsclient -c -F "((name . \"emacs-capture\") (height . 10) (width . 80) (left . 632) (top . 452) (user-position . t) (menu-bar-lines . 0))" "$@"
+ emacsclient -c -F "((name . \"emacs-capture\") (height . 10) (width . 80) (left . 632) (top . 452) (user-position . t) (menu-bar-lines . 0))" "$@"
#+END_SRC
The =left= and =top= cells do the centering for a 1920x1080
@@ -2788,14 +2846,14 @@ display. For other sizes, =xwininfo= is yr friend: left =
**** Register handler for org-protocol
#+BEGIN_SRC sh :tangle ~/.local/share/applications/emacs-capture.desktop
-[Desktop Entry]
-Name=Org Capture
-Exec=/home/fran/scripts/emacs-capture %u
-Comment=Capture the web into org
-Icon=/usr/share/icons/hicolor/scalable/apps/emacs24.svg
-Type=Application
-Terminal=false
-MimeType=x-scheme-handler/org-protocol;
+ [Desktop Entry]
+ Name=Org Capture
+ Exec=/home/fran/scripts/emacs-capture %u
+ Comment=Capture the web into org
+ Icon=/usr/share/icons/hicolor/scalable/apps/emacs24.svg
+ Type=Application
+ Terminal=false
+ MimeType=x-scheme-handler/org-protocol;
#+END_SRC
After installing this, you need to evaluate (with =C-c C-c=)
@@ -2803,7 +2861,7 @@ the following to register the mime-type with the OS:
#+NAME: update-block
#+BEGIN_SRC sh
-update-desktop-database ~/.local/share/applications
+ update-desktop-database ~/.local/share/applications
#+END_SRC
#+END_QUOTE
[[https://www.reddit.com/r/emacs/comments/fvlcqg/anyone_using_orgprotocol_with_only_a_window/][(3) Anyone using org-protocol with only a window manager but no desktop environment? : emacs]]
@@ -3175,16 +3233,16 @@ Captured On: [2023-08-01 Tue 07:48]
*** TODO Review Interesting Elisp Settings
#+BEGIN_QUOTE
(use-package elisp-mode
- :hook ((emacs-lisp-mode . my/elisp-mode-reduce-mode-name)
- (emacs-lisp-mode . my/eldoc-shows-more-information))
- :config
- (progn
- (defun my/elisp-mode-reduce-mode-name ()
- (setq-local mode-name "Elisp"))
-
- (defun my/eldoc-shows-more-information ()
- (remove-hook 'eldoc-documentation-functions #'elisp-eldoc-var-docstring t)
- (add-hook 'eldoc-documentation-functions #'elisp-eldoc-var-docstring-with-value nil t))))
+:hook ((emacs-lisp-mode . my/elisp-mode-reduce-mode-name)
+(emacs-lisp-mode . my/eldoc-shows-more-information))
+:config
+(progn
+(defun my/elisp-mode-reduce-mode-name ()
+(setq-local mode-name "Elisp"))
+
+(defun my/eldoc-shows-more-information ()
+(remove-hook 'eldoc-documentation-functions #'elisp-eldoc-var-docstring t)
+(add-hook 'eldoc-documentation-functions #'elisp-eldoc-var-docstring-with-value nil t))))
#+END_QUOTE
[[https://github.com/DamienCassou/emacs.d/blob/master/init.el#L352][emacs.d/init.el at master · DamienCassou/emacs.d]]
Captured On: [2024-04-05 Fri 14:31]
@@ -3330,18 +3388,18 @@ Identify those situations and fix.
*** TODO replacement current yes-or-no replacement in Emacs Config?
#+BEGIN_QUOTE
(progn ; `map-ynp'
- ;; Make all "yes or no" prompts show "y or n" instead
- (setq read-answer-short t)
- (setq use-short-answers t))
+;; Make all "yes or no" prompts show "y or n" instead
+(setq read-answer-short t)
+(setq use-short-answers t))
#+END_QUOTE
[[https://github.com/DamienCassou/emacs.d/blob/master/init.el][emacs.d/init.el at master · DamienCassou/emacs.d]]
Captured On: [2024-04-05 Fri 14:17]
*** TODO Don't allow the user to switch out of answering y/n questions in minibuffer
#+BEGIN_QUOTE
(progn ; `subr'
- ;; recommended by
- ;; (info "(embark) How does Embark call the actions?")
- (setq y-or-n-p-use-read-key t))
+;; recommended by
+;; (info "(embark) How does Embark call the actions?")
+(setq y-or-n-p-use-read-key t))
#+END_QUOTE
[[https://github.com/DamienCassou/emacs.d/blob/master/init.el][emacs.d/init.el at master · DamienCassou/emacs.d]]
Captured On: [2024-04-05 Fri 14:21]
@@ -3485,19 +3543,19 @@ Scroll text of selected window upward ARG lines; or near full screen if no ARG.
*** TODO Consider implementing vundo package
#+BEGIN_QUOTE
(use-package vundo
- :bind ("C-x u" . vundo)
- :hook ((vundo-mode . my/vundo-setup))
- :init
- (progn
- (setq vundo-window-max-height 5))
- :config
- (progn
- (setq vundo-glyph-alist vundo-unicode-symbols)
-
- (defun my/vundo-setup ()
- "Remove mode-line and header-line."
- (setq mode-line-format nil)
- (setq header-line-format nil))))
+:bind ("C-x u" . vundo)
+:hook ((vundo-mode . my/vundo-setup))
+:init
+(progn
+(setq vundo-window-max-height 5))
+:config
+(progn
+(setq vundo-glyph-alist vundo-unicode-symbols)
+
+(defun my/vundo-setup ()
+"Remove mode-line and header-line."
+(setq mode-line-format nil)
+(setq header-line-format nil))))
#+END_QUOTE
[[https://github.com/DamienCassou/emacs.d/blob/master/init.el#L352][emacs.d/init.el at master · DamienCassou/emacs.d]]
Captured On: [2024-04-05 Fri 15:14]
@@ -3510,10 +3568,10 @@ https://github.com/zevlg/telega.el/wiki/Configuration-snippets
*** TODO Consider Olivetti Settings
#+BEGIN_QUOTE
(use-package olivetti
- :hook (((Info-mode help-mode helpful-mode eww-mode) . olivetti-mode))
- :init
- (progn
- (setq olivetti-body-width 84)))
+:hook (((Info-mode help-mode helpful-mode eww-mode) . olivetti-mode))
+:init
+(progn
+(setq olivetti-body-width 84)))
#+END_QUOTE
[[https://github.com/DamienCassou/emacs.d/blob/master/init.el#L352][emacs.d/init.el at master · DamienCassou/emacs.d]]
Captured On: [2024-04-05 Fri 14:35]
@@ -3924,96 +3982,96 @@ Captured On: [2024-02-29 Thu 10:12]
*** TODO Forge Config
#+BEGIN_QUOTE
(use-package forge
- :demand t
- :after magit
- :hook (forge-post-submit-callback . my/forge-start-timer-for-draft-pullreq)
- :config
- (progn
- (setq-default forge-buffer-draft-p t)
-
- (defun my/forge-start-timer-for-draft-pullreq (pullreq &rest _)
- "Start a `tmr' timer if PULLREQ is draft."
- (when (map-elt pullreq 'draft)
- (when-let* ((url (map-elt pullreq 'url))
- (minutes (cond
- ((string-match-p "foretagsplatsen/monitor" url) 15)
- (t 10))))
- (require 'tmr)
- (tmr minutes (format "Check draft %s" url) t))))))
+:demand t
+:after magit
+:hook (forge-post-submit-callback . my/forge-start-timer-for-draft-pullreq)
+:config
+(progn
+(setq-default forge-buffer-draft-p t)
+
+(defun my/forge-start-timer-for-draft-pullreq (pullreq &rest _)
+"Start a `tmr' timer if PULLREQ is draft."
+(when (map-elt pullreq 'draft)
+(when-let* ((url (map-elt pullreq 'url))
+(minutes (cond
+((string-match-p "foretagsplatsen/monitor" url) 15)
+(t 10))))
+(require 'tmr)
+(tmr minutes (format "Check draft %s" url) t))))))
(use-package forge-topic
- :init
- (progn
- (setq forge-topic-list-limit '(60 . -1))))
+:init
+(progn
+(setq forge-topic-list-limit '(60 . -1))))
#+END_QUOTE
[[https://github.com/DamienCassou/emacs.d/blob/master/init.el#L352][emacs.d/init.el at master · DamienCassou/emacs.d]]
Captured On: [2024-04-05 Fri 15:18]
*** TODO Magit Config to Review
#+BEGIN_QUOTE
(use-package magit
- :bind ((
- :map magit-mode-map
- ("M-w" . magit-copy-section-value)))
- :init
- (progn
- (setq magit-diff-refine-hunk t)
- (setq magit-process-find-password-functions '(magit-process-password-auth-source))
- (setq magit-branch-prefer-remote-upstream '("master"))
- (setq magit-branch-adjust-remote-upstream-alist '(("origin/master" "master")
- ("origin/main" "main")))
- (setq magit-module-sections-nested nil)
- (setq magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)
- (setq magit-no-confirm '(amend-published trash))
- (setq magit-revision-insert-related-refs nil)
- (setq magit-revision-show-gravatars t)
- (setq magit-clone-set-remote.pushDefault t))
- :config
- (progn
- ;; Enable magit-clean
- (put 'magit-clean 'disabled nil)
-
- ;; Add modules in magit status buffer:
- (magit-add-section-hook 'magit-status-sections-hook
- 'magit-insert-modules
- 'magit-insert-unpulled-from-upstream)
-
- ;; Only show the module sections I'm interested in
- (with-eval-after-load "magit-submodule"
- (remove-hook 'magit-module-sections-hook 'magit-insert-modules-overview)
- (remove-hook 'magit-module-sections-hook 'magit-insert-modules-unpulled-from-pushremote)
- (remove-hook 'magit-module-sections-hook 'magit-insert-modules-unpushed-to-upstream)
- (remove-hook 'magit-module-sections-hook 'magit-insert-modules-unpushed-to-pushremote))
-
- (transient-replace-suffix 'magit-commit 'magit-commit-autofixup
- '("x" "Absorb changes" magit-commit-absorb))
-
- (dir-locals-set-class-variables 'my/magit-huge-git-repository
- '((magit-status-mode
- .
- ((eval . (magit-disable-section-inserter 'magit-insert-tags-header))
- (eval . (magit-disable-section-inserter 'magit-insert-untracked-files))
- (eval . (magit-disable-section-inserter 'magit-insert-modules))))))
-
- (let ((huge-repos
- '("~/Documents/projects/nix/nixpkgs-master"
- "~/Documents/projects/nix-system/nixpkgs/")))
- (dolist (repo huge-repos)
- (dir-locals-set-directory-class
- (expand-file-name repo)
- 'my/magit-huge-git-repository)))))
+:bind ((
+:map magit-mode-map
+("M-w" . magit-copy-section-value)))
+:init
+(progn
+(setq magit-diff-refine-hunk t)
+(setq magit-process-find-password-functions '(magit-process-password-auth-source))
+(setq magit-branch-prefer-remote-upstream '("master"))
+(setq magit-branch-adjust-remote-upstream-alist '(("origin/master" "master")
+("origin/main" "main")))
+(setq magit-module-sections-nested nil)
+(setq magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)
+(setq magit-no-confirm '(amend-published trash))
+(setq magit-revision-insert-related-refs nil)
+(setq magit-revision-show-gravatars t)
+(setq magit-clone-set-remote.pushDefault t))
+:config
+(progn
+;; Enable magit-clean
+(put 'magit-clean 'disabled nil)
+
+;; Add modules in magit status buffer:
+(magit-add-section-hook 'magit-status-sections-hook
+'magit-insert-modules
+'magit-insert-unpulled-from-upstream)
+
+;; Only show the module sections I'm interested in
+(with-eval-after-load "magit-submodule"
+(remove-hook 'magit-module-sections-hook 'magit-insert-modules-overview)
+(remove-hook 'magit-module-sections-hook 'magit-insert-modules-unpulled-from-pushremote)
+(remove-hook 'magit-module-sections-hook 'magit-insert-modules-unpushed-to-upstream)
+(remove-hook 'magit-module-sections-hook 'magit-insert-modules-unpushed-to-pushremote))
+
+(transient-replace-suffix 'magit-commit 'magit-commit-autofixup
+'("x" "Absorb changes" magit-commit-absorb))
+
+(dir-locals-set-class-variables 'my/magit-huge-git-repository
+'((magit-status-mode
+.
+((eval . (magit-disable-section-inserter 'magit-insert-tags-header))
+(eval . (magit-disable-section-inserter 'magit-insert-untracked-files))
+(eval . (magit-disable-section-inserter 'magit-insert-modules))))))
+
+(let ((huge-repos
+'("~/Documents/projects/nix/nixpkgs-master"
+"~/Documents/projects/nix-system/nixpkgs/")))
+(dolist (repo huge-repos)
+(dir-locals-set-directory-class
+(expand-file-name repo)
+'my/magit-huge-git-repository)))))
(use-package magit-diff
- :bind (
- :map magit-diff-section-map
- ;; disable binding that I use for begining of buffer
- ("C-x a" . nil)))
+:bind (
+:map magit-diff-section-map
+;; disable binding that I use for begining of buffer
+("C-x a" . nil)))
(use-package magit-extras
- :demand (project magit))
+:demand (project magit))
(use-package magit-tbdiff
- :demand t
- :after magit)
+:demand t
+:after magit)
#+END_QUOTE
[[https://github.com/DamienCassou/emacs.d/blob/master/init.el#L352][emacs.d/init.el at master · DamienCassou/emacs.d]]
Captured On: [2024-04-05 Fri 15:19]
@@ -4200,7 +4258,7 @@ Captured On: [2024-03-20 Wed 09:11]
TLDR: add
#+begin_src sh
--xrm "emacs.synchronous: true"
+ -xrm "emacs.synchronous: true"
#+end_src
to the end of the emacs startup command
diff --git a/custom/sdcv-mode.el b/custom/sdcv-mode.el
deleted file mode 100644
index bdb89cd6..00000000
--- a/custom/sdcv-mode.el
+++ /dev/null
@@ -1,414 +0,0 @@
-;;; sdcv-mode.el --- major mode to do dictionary query through sdcv
-
-;; Copyright 2006~2008 pluskid,
-;; 2011 gucong
-;;
-;; Author: pluskid <pluskid@gmail.com>,
-;; gucong <gucong43216@gmail.com>
-;;
-;; This program is free software; you can redistribute it and/or
-;; modify it under the terms of the GNU General Public License as
-;; published by the Free Software Foundation; either version 2, or (at
-;; your option) any later version.
-;;
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with this program; if not, write to the Free Software
-;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-;;; Commentary:
-
-;; This is a major mode to view output of dictionary search of sdcv.
-
-;; Put this file into your load-path and the following into your
-;; ~/.emacs:
-;; (require 'sdcv-mode)
-;; (global-set-key (kbd "C-c d") 'sdcv-search)
-
-;;; Changelog:
-
-;; 2012/01/02
-;; * New variable: `sdcv-word-processor'
-;; * Breaking change:
-;; for `sdcv-dictionary-list' and `sdcv-dictionary-alist',
-;; non-list (non-nil) value now means full dictionary list
-;; * Rewrite `sdcv-search' for both interactive and non-interactive use
-;; * `sdcv-dictionary-list' is left for customization use only
-;; * Better highlighting.
-;;
-;; 2011/06/30
-;; * New feature: parse output for failed lookup
-;; * Keymap modification
-;;
-;; 2008/06/11
-;; * sdcv-mode v 0.1 init (with background process)
-
-;;; Code:
-
-(require 'outline)
-(provide 'sdcv-mode)
-(eval-when-compile
- (require 'cl))
-
-;;; ==================================================================
-;;; Frontend, search word and display sdcv buffer
-(defun sdcv-search (word &optional dict-list-name dict-list interactive-p)
- "Search WORD through the command-line tool sdcv.
-The result will be displayed in buffer named with
-`sdcv-buffer-name' with `sdcv-mode' if called interactively.
-
-When provided with DICT-LIST-NAME, query `sdcv-dictionary-alist'
-to get the new dictionary list before search.
-Alternatively, dictionary list can be specified directly
-by DICT-LIST. Any non-list value of it means using all dictionaries.
-
-When called interactively, prompt for the word.
-Prefix argument have the following meaning:
-If `sdcv-dictionary-alist' is defined,
-use prefix argument to select a new DICT-LIST-NAME.
-Otherwise, prefix argument means using all dictionaries.
-
-Word may contain some special characters:
- * match zero or more characters
- ? match zero or one character
- / used at the beginning, for fuzzy search
- | used at the beginning, for data search
- \ escape the character right after"
- (interactive
- (let* ((dict-list-name
- (and current-prefix-arg sdcv-dictionary-alist
- (completing-read "Select dictionary list: "
- sdcv-dictionary-alist nil t)))
- (dict-list
- (and current-prefix-arg (not sdcv-dictionary-alist)))
- (guess (or (and transient-mark-mode mark-active
- (buffer-substring-no-properties
- (region-beginning) (region-end)))
- (current-word nil t)))
- (word (read-string (format "Search dict (default: %s): " guess)
- nil nil guess)))
- (list word dict-list-name dict-list t)))
- ;; init current dictionary list
- (when (null sdcv-current-dictionary-list)
- (setq sdcv-current-dictionary-list sdcv-dictionary-list))
- ;; dict-list-name to dict-list
- (when (and (not dict-list) dict-list-name)
- (if (not sdcv-dictionary-alist)
- (error "`sdcv-dictionary-alist' not defined"))
- (setq dict-list
- (cdr (assoc dict-list-name sdcv-dictionary-alist))))
- ;; prepare new dictionary list
- (when (and dict-list (not (equal sdcv-current-dictionary-list dict-list)))
- (setq sdcv-current-dictionary-list dict-list)
- ;; kill sdcv process
- (and (get-process sdcv-process-name)
- (kill-process (get-process sdcv-process-name)))
- (while (get-process sdcv-process-name)
- (sleep-for 0.01)))
- (let ((result
- (concat ">>>"
- (mapconcat
- (lambda (w) (sdcv-do-lookup w))
- (if sdcv-word-processor
- (let ((processed (funcall sdcv-word-processor word)))
- (if (listp processed) processed (list processed)))
- (list word))
- ">>>"))))
- (if (not interactive-p)
- result
- (with-current-buffer (get-buffer-create sdcv-buffer-name)
- (setq buffer-read-only nil)
- (erase-buffer)
- (insert result))
- (sdcv-goto-sdcv)
- (sdcv-mode)
- (sdcv-mode-reinit))))
-
-(defun sdcv-list-dictionary ()
- "Show available dictionaries."
- (interactive)
- (let (resize-mini-windows)
- (shell-command "sdcv -l" sdcv-buffer-name)))
-
-(defvar sdcv-current-dictionary-list nil)
-
-(defun sdcv-generate-dictionary-argument ()
- "Generate dictionary argument for sdcv from `sdcv-current-dictionary-list'
-and `sdcv-dictionary-path'."
- (append
- (and sdcv-dictionary-path (list "--data-dir" sdcv-dictionary-path))
- (and (listp sdcv-current-dictionary-list)
- (mapcan (lambda (dict)
- (list "-u" dict))
- sdcv-current-dictionary-list))))
-
-;;; ==================================================================
-;;; utilities to switch from and to sdcv buffer
-(defvar sdcv-previous-window-conf nil
- "Window configuration before switching to sdcv buffer.")
-(defun sdcv-goto-sdcv ()
- "Switch to sdcv buffer in other window."
- (interactive)
- (unless (eq (current-buffer)
- (sdcv-get-buffer))
- (setq sdcv-previous-window-conf (current-window-configuration)))
- (let* ((buffer (sdcv-get-buffer))
- (window (get-buffer-window buffer)))
- (if (null window)
- (switch-to-buffer-other-window buffer)
- (select-window window))))
-(defun sdcv-return-from-sdcv ()
- "Bury sdcv buffer and restore the previous window configuration."
- (interactive)
- (if (window-configuration-p sdcv-previous-window-conf)
- (progn
- (set-window-configuration sdcv-previous-window-conf)
- (setq sdcv-previous-window-conf nil)
- (bury-buffer (sdcv-get-buffer)))
- (bury-buffer)))
-
-(defun sdcv-get-buffer ()
- "Get the sdcv buffer. Create one if there's none."
- (let ((buffer (get-buffer-create sdcv-buffer-name)))
- (with-current-buffer buffer
- (unless (eq major-mode 'sdcv-mode)
- (sdcv-mode)))
- buffer))
-
-;;; ==================================================================
-;;; The very major mode
-(defvar sdcv-mode-font-lock-keywords
- '(
- ;; dictionary name
- ("^-->\\(.*\\)$" . (1 sdcv-hit-face))
- ("^==>\\(.*\\)$" . (1 sdcv-failed-face))
- ("^\\(>>>.*\\)$" . (1 sdcv-heading-face))
- )
- "Expressions to hilight in `sdcv-mode'")
-
-(defvar sdcv-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "q" 'sdcv-return-from-sdcv)
- (define-key map (kbd "RET") 'sdcv-search)
- (define-key map "a" 'show-all)
- (define-key map "h" 'hide-body)
- (define-key map "o" 'sdcv-toggle-entry)
- (define-key map "n" 'sdcv-next-entry)
- (define-key map "p" 'sdcv-previous-entry)
- map)
- "Keymap for `sdcv-mode'.")
-
-(define-derived-mode sdcv-mode nil "sdcv"
- "Major mode to look up word through sdcv.
-\\{sdcv-mode-map}
-Turning on Text mode runs the normal hook `sdcv-mode-hook'."
- (setq font-lock-defaults '(sdcv-mode-font-lock-keywords))
- (setq buffer-read-only t)
- (set (make-local-variable 'outline-regexp) "-->.*\n-->\\|==>\\|>>>")
- (set (make-local-variable font-lock-string-face) nil)
-)
-
-(defun sdcv-mode-reinit ()
- "Re-initialize buffer.
-Hide all entrys but the first one and goto
-the beginning of the buffer."
- (ignore-errors
- (setq buffer-read-only nil)
- (sdcv-parse-failed)
- (setq buffer-read-only t)
- (hide-body)
- (goto-char (point-min))
- (forward-line 1)
- (show-entry)))
-
-(defun sdcv-parse-failed ()
- (goto-char (point-min))
- (let (save-word)
- (while (re-search-forward "^[0-9]+).*-->\\(.*\\)$" nil t)
- (let ((cur-word (match-string-no-properties 1)))
- (unless (string= save-word cur-word)
- (setq save-word cur-word)
- (re-search-backward "^\\(.\\)" nil t)
- (match-string 1)
- (insert (format "\n==>%s\n" save-word)))))))
-
-(defun sdcv-next-entry ()
- (interactive)
- (outline-next-heading)
- (show-entry)
- (recenter-top-bottom 0))
-(defun sdcv-previous-entry ()
- (interactive)
- (outline-previous-heading)
- (show-entry)
- (recenter-top-bottom 0))
-
-(defun sdcv-toggle-entry ()
- (interactive)
- (save-excursion
- (outline-back-to-heading)
- (if (not (outline-invisible-p (line-end-position)))
- (hide-entry)
- (show-entry))))
-
-;;; ==================================================================
-;;; Support for sdcv process in background
-(defun sdcv-do-lookup (word)
- "Send the word to the sdcv process and return the result."
- (let ((process (sdcv-get-process)))
- (process-send-string process (concat word "\n"))
- (with-current-buffer (process-buffer process)
- (let ((i 0) rlt done)
- (while (and (not done)
- (< i sdcv-wait-timeout))
- (when (sdcv-match-tail sdcv-word-prompts)
- (setq rlt (buffer-substring-no-properties (point-min)
- (point-max)))
- (setq done t))
- (when (sdcv-match-tail sdcv-choice-prompts)
- (process-send-string process "-1\n"))
- (unless done
- (sleep-for sdcv-wait-interval)
- (setq i (+ i sdcv-wait-interval))))
- (unless (< i sdcv-wait-timeout)
- ;; timeout
- (kill-process process)
- (error "ERROR: timeout waiting for sdcv"))
- (erase-buffer)
- rlt))))
-
-(defvar sdcv-wait-timeout 2
- "The max time (in seconds) to wait for the sdcv process to
-produce some output.")
-(defvar sdcv-wait-interval 0.01
- "The interval (in seconds) to sleep each time to wait for
-sdcv's output.")
-
-(defconst sdcv-process-name "%sdcv-mode-process%")
-(defconst sdcv-process-buffer-name "*sdcv-mode-process*")
-
-(defvar sdcv-word-prompts '("Enter word or phrase: "
- "请输入单词或短语:"
- "請輸入單字或片語:")
- "A list of prompts that sdcv use to prompt for word.")
-
-(defvar sdcv-choice-prompts '("Your choice[-1 to abort]: "
- "您的选择为:"
- "您的選擇為:")
- "A list of prompts that sdcv use to prompt for a choice
-of multiple candicates.")
-
-(defvar sdcv-result-patterns '("^Found [0-9]+ items, similar to [*?/|]*\\(.+?\\)[*?]*\\."
- "^发现 [0-9]+ 条记录和 [*?/|]*\\(.+?\\)[*?]* 相似。"
- )
- "A list of patterns to extract result word of sdcv. Special
-characters are stripped.")
-
-(defun sdcv-get-process ()
- "Get or create the sdcv process."
- (let ((process (get-process sdcv-process-name)))
- (when (null process)
- (with-current-buffer (get-buffer-create
- sdcv-process-buffer-name)
- (erase-buffer)
- (setq process (apply 'start-process
- sdcv-process-name
- sdcv-process-buffer-name
- sdcv-program-path
- (sdcv-generate-dictionary-argument)))
- ;; kill the initial prompt
- (let ((i 0))
- (message "starting sdcv...")
- (while (and (not (sdcv-match-tail sdcv-word-prompts))
- (< i sdcv-wait-timeout))
- (sleep-for sdcv-wait-interval)
- (setq i (+ i sdcv-wait-interval)))
- (unless (< i sdcv-wait-timeout)
- ;; timeout
- (kill-process process)
- (error "ERROR: timeout waiting for sdcv"))
- (erase-buffer))))
- process))
-
-(defun sdcv-buffer-tail (length)
- "Get a substring of length LENGTH at the end of
-current buffer."
- (let ((beg (- (point-max) length))
- (end (point-max)))
- (if (< beg (point-min))
- (setq beg (point-min)))
- (buffer-substring-no-properties beg end)))
-
-(defun sdcv-match-tail (prompts)
- (let ((done nil)
- (prompt nil))
- (while (and (not done)
- prompts)
- (setq prompt (car prompts))
- (setq prompts (cdr prompts))
- (when (string-equal prompt
- (sdcv-buffer-tail (length prompt)))
- (delete-region (- (point-max) (length prompt))
- (point-max))
- (setq done t)))
- done))
-
-
-;;;;##################################################################
-;;;; User Options, Variables
-;;;;##################################################################
-
-(defvar sdcv-buffer-name "*sdcv*"
- "The name of the buffer of sdcv.")
-(defvar sdcv-dictionary-list t
- "A list of dictionaries to use.
-Each entry is a string denoting the name of a dictionary, which
-is then passed to sdcv through the '-u' command line option.
-Any non-list value means using all the dictionaries.")
-(defvar sdcv-dictionary-alist nil
- "An alist of dictionaries, used to interactively form
-dictionary list. It has the form:
- ((\"full\" . t)
- (\"group1\" \"dict1\" \"dict2\" ...)
- (\"group2\" \"dict2\" \"dict3\"))
-Any cons cell here means using all dictionaries.
-")
-
-(defvar sdcv-program-path "sdcv"
- "The path of sdcv program.")
-
-(defvar sdcv-dictionary-path nil
- "The path of dictionaries.")
-
-(defvar sdcv-word-processor nil
- "This is the function that take a word (stirng)
-and return a word or a list of words for lookup by `sdcv-search'.
-All lookup result(s) will finally be concatenated together.
-
-`nil' value means do nothing with the original word.
-
-The following is an example. This function takes the original word and
-compare whether simplified and traditional form of the word are the same.
-If not, look up both of the words.
-
- (lambda (word)
- (let ((sim (chinese-conv word \"simplified\"))
- (tra (chinese-conv word \"traditional\")))
- (if (not (string= sim tra))
- (list sim tra)
- word)))
-")
-
-(defvar sdcv-hit-face 'font-lock-type-face
- "Face for search hits")
-(defvar sdcv-failed-face 'font-lock-keyword-face
- "Face for suggestions for a failed lookup.")
-(defvar sdcv-heading-face 'highlight
- "Face for heading of lookup")
-
-(provide 'sdcv-mode)
-;;; sdcv-mode.el ends here
diff --git a/early-init.el b/early-init.el
index 942345b0..69ba1b7d 100644
--- a/early-init.el
+++ b/early-init.el
@@ -37,14 +37,21 @@
;; -------------------------------- Debug Flags --------------------------------
;; debugging enabled during emacs startup. disabled after emacs startup.
-(setq debug-on-error nil) ;; default nil. turn on to debug issues only.
-(setq debug-on-quit nil) ;; debug on C-g (breaking out of hangs/freezes)
+;; set these values now
+(setq debug-on-error t) ;; default nil. turn on to debug issues only.
+(setq debug-on-quit t) ;; debug on C-g (breaking out of hangs/freezes)
-(add-hook 'after-init-hook
+;; reset to these values after startup
+(add-hook 'emacs-startup-hook
(lambda ()
- (setq debug-on-error nil)
+ (setq debug-on-error nil)
(setq debug-on-quit nil)))
+;; ------------------------------ Compile Warnings -----------------------------
+
+;; log warnings, but don't popup the warnings buffer
+(setq native-comp-async-report-warnings-errors 'silent)
+
;; --------------------------- Use Online Repos Flag ---------------------------
;; set to nil to only use localrepo or the local elpa-mirrors
diff --git a/init.el b/init.el
index 9e20aa00..86c26b9f 100644
--- a/init.el
+++ b/init.el
@@ -17,30 +17,13 @@
(defvar user-mail-address "c@cjennings.net"
"The user's email address.")
-;; ------------------------- Directory / File Constants ------------------------
-
-(defconst code-dir (concat user-home-dir "/code/"))
-(defconst projects-dir (concat user-home-dir "/projects/"))
-(defconst sync-dir (concat user-home-dir "/sync/org/")) ;; emacs data to be sync'd across machines
-(defconst roam-dir (concat sync-dir "/roam/")) ;; emacs org roam data
-(defconst snippets-dir (concat sync-dir "snippets")) ;; snippets
-
-(defconst emacs-init-file (concat user-emacs-directory "init.el")) ;; 'user-init-file' might be compiled
-(defconst emacs-early-init-file (concat user-emacs-directory "early-init.el"))
-(defvar schedule-file (concat sync-dir "schedule.org")) ;; scheduled events & appointments
-(defvar inbox-file (concat roam-dir "inbox.org")) ;; tasks and task inbox
-(defvar contacts-file (concat sync-dir "contacts.org")) ;; org-contacts
-(defvar article-file (concat sync-dir "article-queue.org")) ;; articles to read
-(defvar article-archive (concat sync-dir "article-archive.org")) ;; articles to keep
-(defvar ledger-file (concat user-home-dir "/projects/finances/main.ledger")) ;; $$$
-(defvar macros-file (concat sync-dir "macros.el")) ;; macros with cj/save-macro are saved here
-
;; ---------------------------- System Configuration ---------------------------
-(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 'system-defaults)
diff --git a/localrepo/archive-contents b/localrepo/archive-contents
index 188655c2..87bfeaf4 100644
--- a/localrepo/archive-contents
+++ b/localrepo/archive-contents
@@ -22,7 +22,7 @@
(counsel . [(0 14 2) ((emacs (24 5)) (ivy (0 14 2)) (swiper (0 14 2))) "Various completion functions using Ivy" tar])
(css-eldoc . [(20220415 1629) nil "an eldoc-mode plugin for CSS source code" tar])
(dash . [(20240405 946) ((emacs (24))) "A modern list library for Emacs" tar])
- (dashboard . [(20240327 29) ((emacs (26 1))) "A startup screen extracted from Spacemacs" tar])
+ (dashboard . [(20240407 12) ((emacs (26 1))) "A startup screen extracted from Spacemacs" tar])
(devdocs . [(0 6 1) ((emacs (27 1))) "Emacs viewer for DevDocs" tar])
(dired-hacks-utils . [(20230512 1107) ((dash (2 5 0))) "Utilities and helpers for dired-hacks collection" tar])
(dired-hide-dotfiles . [(20210222 1919) ((emacs (25 1))) "Hide dotfiles in dired" tar])
@@ -59,9 +59,9 @@
(flyspell-correct . [(20220520 630) ((emacs (24))) "Correcting words with flyspell via custom interface" tar])
(flyspell-correct-ivy . [(20220520 630) ((flyspell-correct (0 6 1)) (ivy (0 8 0)) (emacs (24 4))) "Correcting words with flyspell via ivy interface" tar])
(fontaine . [(1 0 0) ((emacs (27 1))) "Set font configurations using presets" tar])
- (forge . [(20240405 1509) ((emacs (25 1)) (compat (29 1 4 4)) (closql (20240125)) (dash (2 19 1)) (emacsql (20240124)) (ghub (20240101)) (let-alist (1 0 6)) (magit (20240125)) (markdown-mode (2 6)) (seq (2 24)) (transient (20240201)) (yaml (0 5 5))) "Access Git forges from Magit." tar])
+ (forge . [(20240407 2150) ((emacs (26 1)) (compat (29 1 4 5)) (closql (20240405)) (dash (2 19 1)) (emacsql (20240124)) (ghub (20240311)) (let-alist (1 0 6)) (magit (20240404)) (markdown-mode (2 6)) (seq (2 24)) (transient (20240405)) (yaml (0 5 5))) "Access Git forges from Magit." tar])
(free-keys . [(1 0) ((cl-lib (0 3))) "Show free keybindings for modkeys or prefixes" tar])
- (ghub . [(20240311 1716) ((emacs (25 1)) (compat (29 1 4 4)) (let-alist (1 0 6)) (treepy (0 1 2))) "Client libraries for Git forge APIs." tar])
+ (ghub . [(20240408 1356) ((emacs (25 1)) (compat (29 1 4 4)) (let-alist (1 0 6)) (treepy (0 1 2))) "Client libraries for Git forge APIs." tar])
(git-commit . [(20240320 2311) ((emacs (25 1)) (compat (29 1 4 4)) (transient (20231204)) (with-editor (20230917))) "Edit Git commit messages." tar])
(git-gutter . [(20220922 256) ((emacs (25 1))) "Port of Sublime Text plugin GitGutter" tar])
(git-timemachine . [(20240309 1109) ((emacs (24 3)) (transient (0 1 0))) "Walk through git revisions of a file" tar])
@@ -85,12 +85,12 @@
(js2-mode . [(20231224) ((emacs (24 1)) (cl-lib (0 5))) "Improved JavaScript editing mode" tar])
(json-mode . [(0 2) ((emacs (25 1))) "Major mode for editing JSON files" tar])
(kv . [(20140108 1534) nil "key/value data structure functions" tar])
- (ledger-mode . [(20240326 2002) ((emacs (25 1))) "Helper code for use with the ledger command-line tool" tar])
+ (ledger-mode . [(20240408 416) ((emacs (25 1))) "Helper code for use with the ledger command-line tool" tar])
(leetcode . [(20230524 1851) ((emacs (26 1)) (dash (2 16 0)) (graphql (0 1 1)) (spinner (1 7 3)) (aio (1 0)) (log4e (0 3 3))) "An leetcode client" tar])
(ligature . [(20220808 1225) ((emacs (28))) "Display typographical ligatures in major modes" tar])
(log4e . [(20240123 1313) nil "provide logging framework for elisp" tar])
- (lsp-mode . [(20240406 356) ((emacs (27 1)) (dash (2 18 0)) (f (0 20 0)) (ht (2 3)) (spinner (1 7 3)) (markdown-mode (2 3)) (lv (0)) (eldoc (1 11))) "LSP mode" tar])
- (lsp-ui . [(20240330 2227) ((emacs (27 1)) (dash (2 18 0)) (lsp-mode (6 0)) (markdown-mode (2 3))) "UI modules for lsp-mode" tar])
+ (lsp-mode . [(20240408 57) ((emacs (27 1)) (dash (2 18 0)) (f (0 20 0)) (ht (2 3)) (spinner (1 7 3)) (markdown-mode (2 3)) (lv (0)) (eldoc (1 11))) "LSP mode" tar])
+ (lsp-ui . [(20240406 2119) ((emacs (27 1)) (dash (2 18 0)) (lsp-mode (6 0)) (markdown-mode (2 3))) "UI modules for lsp-mode" tar])
(lv . [(0 15 0) nil "Other echo area" tar])
(madhat2r-theme . [(20170203 30) ((emacs (24))) "dark color theme that is easy on the eyes" tar])
(magit . [(20240404 1901) ((emacs (25 1)) (compat (29 1 4 4)) (dash (20240103)) (git-commit (20240123)) (magit-section (20240114)) (seq (2 24)) (transient (20240201)) (with-editor (20240101))) "A Git porcelain inside Emacs." tar])
@@ -102,7 +102,7 @@
(move-text . [(20231204 1514) nil "Move current line or region with Mdown." tar])
(nerd-icons . [(20240319 833) ((emacs (24 3))) "Emacs Nerd Font Icons Library" tar])
(nerd-icons-ibuffer . [(20230417 1549) ((emacs (24 3)) (nerd-icons (0 0 1))) "Display nerd icons in ibuffer" tar])
- (nov . [(20230715 1434) ((esxml (0 3 6)) (emacs (25 1))) "Featureful EPUB reader mode" tar])
+ (nov . [(20240407 1219) ((esxml (0 3 6)) (emacs (25 1))) "Featureful EPUB reader mode" tar])
(numpydoc . [(20230811 1708) ((emacs (25 1)) (s (1 12 0)) (dash (2 18 0))) "NumPy style docstring insertion" tar])
(olivetti . [(20231104 538) ((emacs (24 4))) "Minor mode for a nice writing environment" tar])
(openwith . [(20120531 2136) nil "Open files with external programs" tar])
@@ -120,6 +120,7 @@
(persistent-scratch . [(20230225 1439) ((emacs (24))) "Preserve the scratch buffer across Emacs sessions" tar])
(poetry . [(20240329 1103) ((transient (0 2 0)) (pyvenv (1 2)) (emacs (25 1))) "Interface to Poetry" tar])
(popup . [(0 5 9) ((emacs (24 3))) "Visual Popup User Interface" tar])
+ (pos-tip . [(20240209 837) nil "Show tooltip at point" tar])
(prescient . [(20240226 204) ((emacs (25 1))) "Better sorting and filtering" tar])
(projectile . [(2 8 0) ((emacs (25 1))) "Manage and navigate projects in Emacs easily" tar])
(promise . [(20210307 727) ((emacs (25 1))) "Promises/A+" tar])
@@ -130,6 +131,8 @@
(request . [(0 3 3) ((emacs (24 4))) "Compatible layer for URL request in Emacs" tar])
(ripgrep . [(20220520 1410) nil "Front-end for ripgrep, a command line search tool" tar])
(s . [(20220902 1511) nil "The long lost Emacs string manipulation library." tar])
+ (sdcv . [(20220210 1412) ((emacs (24 3)) (popup (0 5 3)) (showtip (0 1)) (pos-tip (0 4 6)) (cl-lib (0 3))) "Interface for sdcv (StartDict console version)." tar])
+ (showtip . [(20090830 1040) nil "Show tip at cursor" tar])
(simple-httpd . [(20230821 1458) ((cl-lib (0 3))) "pure elisp HTTP server" tar])
(spinner . [(1 7 4) ((emacs (24 3))) "Add spinners and progressline for ongoing operations" tar])
(sudo-edit . [(20220801 1317) ((emacs (24)) (cl-lib (0 5))) "Open files as another user" tar])
diff --git a/localrepo/closql-20240405.1948.tar b/localrepo/closql-20240405.1948.tar
index 4ec6f89b..9df64990 100644
--- a/localrepo/closql-20240405.1948.tar
+++ b/localrepo/closql-20240405.1948.tar
Binary files differ
diff --git a/localrepo/dash-20240405.946.tar b/localrepo/dash-20240405.946.tar
index d176257e..9df64990 100644
--- a/localrepo/dash-20240405.946.tar
+++ b/localrepo/dash-20240405.946.tar
Binary files differ
diff --git a/localrepo/dashboard-20240327.29.tar b/localrepo/dashboard-20240407.12.tar
index 62b2f527..91edc38a 100644
--- a/localrepo/dashboard-20240327.29.tar
+++ b/localrepo/dashboard-20240407.12.tar
Binary files differ
diff --git a/localrepo/forge-20240405.1509.tar b/localrepo/forge-20240405.1509.tar
deleted file mode 100644
index ebf23ad1..00000000
--- a/localrepo/forge-20240405.1509.tar
+++ /dev/null
Binary files differ
diff --git a/localrepo/forge-20240407.2150.tar b/localrepo/forge-20240407.2150.tar
new file mode 100644
index 00000000..9df64990
--- /dev/null
+++ b/localrepo/forge-20240407.2150.tar
Binary files differ
diff --git a/localrepo/ghub-20240311.1716.tar b/localrepo/ghub-20240311.1716.tar
deleted file mode 100644
index 3bd3e32e..00000000
--- a/localrepo/ghub-20240311.1716.tar
+++ /dev/null
Binary files differ
diff --git a/localrepo/ghub-20240408.1356.tar b/localrepo/ghub-20240408.1356.tar
new file mode 100644
index 00000000..9df64990
--- /dev/null
+++ b/localrepo/ghub-20240408.1356.tar
Binary files differ
diff --git a/localrepo/git-commit-20240320.2311.tar b/localrepo/git-commit-20240320.2311.tar
index 6072782e..9df64990 100644
--- a/localrepo/git-commit-20240320.2311.tar
+++ b/localrepo/git-commit-20240320.2311.tar
Binary files differ
diff --git a/localrepo/ledger-mode-20240326.2002.tar b/localrepo/ledger-mode-20240408.416.tar
index 2c4e776c..189e0097 100644
--- a/localrepo/ledger-mode-20240326.2002.tar
+++ b/localrepo/ledger-mode-20240408.416.tar
Binary files differ
diff --git a/localrepo/lsp-mode-20240406.356.tar b/localrepo/lsp-mode-20240408.57.tar
index 122ad294..7c42c833 100644
--- a/localrepo/lsp-mode-20240406.356.tar
+++ b/localrepo/lsp-mode-20240408.57.tar
Binary files differ
diff --git a/localrepo/lsp-ui-20240330.2227.tar b/localrepo/lsp-ui-20240406.2119.tar
index 76fe7785..8491bf56 100644
--- a/localrepo/lsp-ui-20240330.2227.tar
+++ b/localrepo/lsp-ui-20240406.2119.tar
Binary files differ
diff --git a/localrepo/magit-20240404.1901.tar b/localrepo/magit-20240404.1901.tar
index 9174ca22..9df64990 100644
--- a/localrepo/magit-20240404.1901.tar
+++ b/localrepo/magit-20240404.1901.tar
Binary files differ
diff --git a/localrepo/magit-section-20240311.1407.tar b/localrepo/magit-section-20240311.1407.tar
index 6a5a7936..9df64990 100644
--- a/localrepo/magit-section-20240311.1407.tar
+++ b/localrepo/magit-section-20240311.1407.tar
Binary files differ
diff --git a/localrepo/nov-20230715.1434.tar b/localrepo/nov-20240407.1219.tar
index 941c3f6d..214fb33d 100644
--- a/localrepo/nov-20230715.1434.tar
+++ b/localrepo/nov-20240407.1219.tar
Binary files differ
diff --git a/localrepo/pdf-tools-1.1.0.tar b/localrepo/pdf-tools-1.1.0.tar
index be713b47..85cb0a38 100644
--- a/localrepo/pdf-tools-1.1.0.tar
+++ b/localrepo/pdf-tools-1.1.0.tar
Binary files differ
diff --git a/localrepo/pos-tip-20240209.837.tar b/localrepo/pos-tip-20240209.837.tar
new file mode 100644
index 00000000..38149cd7
--- /dev/null
+++ b/localrepo/pos-tip-20240209.837.tar
Binary files differ
diff --git a/localrepo/sdcv-20220210.1412.tar b/localrepo/sdcv-20220210.1412.tar
new file mode 100644
index 00000000..0cf52431
--- /dev/null
+++ b/localrepo/sdcv-20220210.1412.tar
Binary files differ
diff --git a/localrepo/showtip-20090830.1040.tar b/localrepo/showtip-20090830.1040.tar
new file mode 100644
index 00000000..ed98b10d
--- /dev/null
+++ b/localrepo/showtip-20090830.1040.tar
Binary files differ
diff --git a/localrepo/transient-20240405.1443.tar b/localrepo/transient-20240405.1443.tar
index 975259d0..9df64990 100644
--- a/localrepo/transient-20240405.1443.tar
+++ b/localrepo/transient-20240405.1443.tar
Binary files differ
diff --git a/localrepo/treepy-20230715.2154.tar b/localrepo/treepy-20230715.2154.tar
index 894ee497..9df64990 100644
--- a/localrepo/treepy-20230715.2154.tar
+++ b/localrepo/treepy-20230715.2154.tar
Binary files differ
diff --git a/localrepo/vterm-20240325.1551.tar b/localrepo/vterm-20240325.1551.tar
index 4b0990e7..86f3c3ba 100644
--- a/localrepo/vterm-20240325.1551.tar
+++ b/localrepo/vterm-20240325.1551.tar
Binary files differ
diff --git a/localrepo/with-editor-20240101.2226.tar b/localrepo/with-editor-20240101.2226.tar
index 29c69688..9df64990 100644
--- a/localrepo/with-editor-20240101.2226.tar
+++ b/localrepo/with-editor-20240101.2226.tar
Binary files differ
diff --git a/localrepo/yaml-20231211.1501.tar b/localrepo/yaml-20231211.1501.tar
index adc0aa53..9df64990 100644
--- a/localrepo/yaml-20231211.1501.tar
+++ b/localrepo/yaml-20231211.1501.tar
Binary files differ
diff --git a/modules/ai-config.el b/modules/ai-config.el
index 2240d0ac..be4cffa9 100644
--- a/modules/ai-config.el
+++ b/modules/ai-config.el
@@ -23,7 +23,8 @@
;; integration with ChatGPT and other large language models.
(use-package gptel
- :defer .5
+ :defer t
+ :commands (gptel gptel-send)
:bind
("C-h G" . gptel)
(:map gptel-mode-map
@@ -34,33 +35,22 @@
(gptel-default-mode 'org-mode)
:config
(setq gptel-directives
- '((default
- . "You are a large language model living in Emacs and a careful and
+ '((default
+ . "You are a large language model living in Emacs and a careful and
knowledgeable emacs-lisp programmer. Respond accurately and concisely.")
- (programming
- . "You are a large language model and a careful programmer. Provide code
+ (programming
+ . "You are a large language model and a careful programmer. Provide code
and only code as output without any additional text, prompt or note.")
- (writing
- . "You are a large language model and a writing assistant. Respond
+ (writing
+ . "You are a large language model and a writing assistant. Respond
concisely.")
- (chat
- . "You are a large language model and a conversation partner. Respond
+ (chat
+ . "You are a large language model and a conversation partner. Respond
concisely.")))
;; grab the secret from ~/.authinfo.gpg
+ (setq auth-sources '((:source "~/.authinfo.gpg")))
(setq gptel-api-key (auth-source-pick-first-password :host "api.openai.com")))
-;; ----------------------------- Gptel Send Region -----------------------------
-;; convenience function to send a selection to Gptel.
-
-(defun cj/gptel-send-region (&optional prefix)
- "Verify a region is selected and call gptel-send with PREFIX."
- (interactive "P")
- (if (use-region-p)
- (gptel-send (prefix-numeric-value prefix))
- (error "No region selected")))
-
-(global-set-key (kbd "C-; g") 'cj/gptel-send-region)
-
(provide 'ai-config)
;;; ai-config.el ends here
diff --git a/modules/calibredb-epub-config.el b/modules/calibredb-epub-config.el
index 92e65e2a..4b794cd3 100644
--- a/modules/calibredb-epub-config.el
+++ b/modules/calibredb-epub-config.el
@@ -39,7 +39,7 @@
(use-package nov
:defer .5
- :after (visual-fill-column)
+ :after visual-fill-column
:mode ("\\.epub\\'" . nov-mode)
;; :hook (nov-mode . cj/nov-apply-preferences)
:bind
@@ -48,7 +48,7 @@
("b" . bookmark-bmenu-list)
("r" . nov-render-document)
("l" . recenter-top-bottom)
- ("d" . sdcv-search)
+ ("d" . sdcv-search-input)
("." . cj/forward-paragraph-and-center)
("<" . nov-history-back)
(">" . nov-history-forward)
diff --git a/modules/dirvish-config.el b/modules/dirvish-config.el
index e089f010..f35d2934 100644
--- a/modules/dirvish-config.el
+++ b/modules/dirvish-config.el
@@ -53,26 +53,26 @@
:custom
(dirvish-quick-access-entries
'(("h" "~/" "home")
- ("rsb" "/sshx:cjennings@wolf.usbx.me:/home/cjennings/" "seedbox")
- ("rcj" "/sshx:cjennings@cjennings.net:~" "cjennings.net")
- ("dn" "~/downloads/" "downloads")
- ("lt" "~/.local/share/Trash" "trash")
- ("cj" "~/code/cjennings.net" "cjennings.net")
- ("co" "~/code" "code")
- ("df" "~/.dotfiles/" "dotfiles")
- ("dr" "~/sync/org/drill/" "org drill files")
- ("dt" "~/downloads/torrents/complete/" "torrents")
- ("dx" "~/documents/" "documents")
- ("gc" "~/code/golangcourse" "golang course")
- ("mp" "~/sync/playlists/" "playlists")
- ("mv" "~/magic/video/" "magic/video")
- ("mx" "~/music/" "music")
- ("my" "~/magic/youtube/" "magic/youtube")
- ("or" "~/sync/org/" "sync")
- ("pr" "~/projects/" "projects")
- ("ps" "~/pictures/screenshots/" "screenshots")
- ("pw" "~/pictures/wallpaper" "wallpaper")
- ("px" "~/pictures/" "pictures")
+ ("rsb" "/sshx:cjennings@wolf.usbx.me:/home/cjennings/" "remote seedbox")
+ ("rcj" "/sshx:cjennings@cjennings.net:~" "remote cjennings.net")
+ ("co" "~/code" "code")
+ ("df" "~/.dotfiles/" "dotfiles")
+ ("dn" "~/downloads/" "downloads")
+ ("dr" "~/sync/org/drill/" "org drill files")
+ ("dt" "~/downloads/torrents/complete/" "torrents")
+ ("dx" "~/documents/" "documents")
+ ("gc" "~/code/golangcourse" "golang course")
+ ("lt" "~/.local/share/Trash" "trash")
+ ("mp" "~/sync/playlists/" "playlists")
+ ("mv" "~/magic/video/" "magic/video")
+ ("mx" "~/music/" "music")
+ ("my" "~/magic/youtube/" "magic/youtube")
+ ("or" "~/sync/org/" "sync")
+ ("pl" "~/sync/playlists" "playlists")
+ ("pr" "~/projects/" "projects")
+ ("ps" "~/pictures/screenshots/" "screenshots")
+ ("pw" "~/pictures/wallpaper" "wallpaper")
+ ("px" "~/pictures/" "pictures")
("tg" "~/sync/org/text.games" "text games")
("vx" "~/videos/" "videos")))
(dirvish-attributes '(vscode-icon file-size))
diff --git a/modules/epa-config.el b/modules/epa-config.el
index 8d9d8f13..0e3972a0 100644
--- a/modules/epa-config.el
+++ b/modules/epa-config.el
@@ -10,9 +10,10 @@
(use-package auth-source
:ensure nil ;; built in
- :defer .5
+ :demand t ;; load this package early
:config
- (setq auth-sources '((:source "~/.authinfo.gpg")))
+ (setq auth-sources '("~/.authinfo.gpg"))
+ ;; (setq auth-sources '((:source "~/.authinfo.gpg")))
(setenv "GPG_AGENT_INFO" nil) ;; emacs use internal prompt, not gpg agent
(setq auth-source-debug t)) ;; echo debug info to Messages
diff --git a/modules/eshell-vterm-config.el b/modules/eshell-vterm-config.el
index cf73205f..7d37d9e5 100644
--- a/modules/eshell-vterm-config.el
+++ b/modules/eshell-vterm-config.el
@@ -37,12 +37,6 @@
:ensure nil ;; built-in
:defer .5
:config
- ;; for plan 9 smart shell functionality
- (require 'em-smart)
- (setq eshell-where-to-jump 'begin)
- (setq eshell-review-quick-commands nil)
- (setq eshell-smart-space-goes-to-end t)
-
(setq eshell-banner-message "")
(setq eshell-scroll-to-bottom-on-input 'all)
(setq eshell-error-if-no-glob t)
@@ -51,6 +45,12 @@
(setq eshell-prefer-lisp-functions nil)
(setq eshell-destroy-buffer-when-process-dies t)
+ (add-hook
+ 'eshell-mode-hook
+ (lambda ()
+ (setq pcomplete-cycle-completions nil)))
+ (setq eshell-cmpl-cycle-completions nil)
+
(add-to-list 'eshell-modules-list 'eshell-tramp)
(add-hook 'eshell-hist-mode-hook
@@ -101,11 +101,10 @@
(use-package xterm-color
:defer .5
:after eshell
- :hook (eshell-before-prompt-hook . (lambda ()
- (setq xterm-color-preserve-properties t)))
+ :hook
+ (eshell-before-prompt-hook . (lambda ()
+ (setq xterm-color-preserve-properties t)))
:config
- (add-to-list 'eshell-preoutput-filter-functions 'xterm-color-filter)
- (setq eshell-output-filter-functions (remove 'eshell-handle-ansi-color eshell-output-filter-functions))
(setenv "TERM" "xterm-256color"))
;; ------------------------------ Vterm ------------------------------
@@ -138,15 +137,15 @@
:config
(setq vterm-toggle-fullscreen-p nil)
(add-to-list 'display-buffer-alist
- '((lambda (buffer-or-name _)
- (let ((buffer (get-buffer buffer-or-name)))
- (with-current-buffer buffer
- (or (equal major-mode 'vterm-mode)
- (string-prefix-p vterm-buffer-name (buffer-name buffer))))))
- (display-buffer-reuse-window display-buffer-at-bottom)
+ '((lambda (buffer-or-name _)
+ (let ((buffer (get-buffer buffer-or-name)))
+ (with-current-buffer buffer
+ (or (equal major-mode 'vterm-mode)
+ (string-prefix-p vterm-buffer-name (buffer-name buffer))))))
+ (display-buffer-reuse-window display-buffer-at-bottom)
(dedicated . t) ;dedicated is supported in Emacs 27+
- (reusable-frames . visible)
- (window-height . 0.3))))
+ (reusable-frames . visible)
+ (window-height . 0.3))))
(provide 'eshell-vterm-config)
;;; eshell-vterm-config.el ends here.
diff --git a/modules/font-config.el b/modules/font-config.el
index 6678d2f9..fc9d8b18 100644
--- a/modules/font-config.el
+++ b/modules/font-config.el
@@ -40,7 +40,13 @@
(Codelia-Only
:default-family "Codelia Ligatures")
(Liberation_Mono-Only
- :default-family "Liberation Mono")
+ :default-family "Liberation Mono")
+ (24-point-font
+ :default-height 240)
+ (20-point-font
+ :default-height 200)
+ (16-point-font
+ :default-height 160)
(12-point-font
:default-height 120)
(13-point-font
diff --git a/modules/games-config.el b/modules/games-config.el
index 6b198be3..e0439630 100644
--- a/modules/games-config.el
+++ b/modules/games-config.el
@@ -15,7 +15,7 @@
("d" dunnet "Dunnet : Emacs' Built-n Text Adventure" :column "Game")
("g" gomoku "Gomoku : Tic Tac Toe, but Five in a Row" :column "Game")
("m" malyon "Malyon : The Text Adventure Player" :column "Game")
- ("t" tetris "Tetris : Combine falling blocks and scoreq" :column "Game"))
+ ("t" tetris "Tetris : Combine falling blocks and score" :column "Game"))
(global-set-key (kbd "M-G") 'hydra-games/body)
;; ----------------------------------- Malyon ----------------------------------
diff --git a/modules/org-config.el b/modules/org-config.el
index 1bfcf704..6a177d30 100644
--- a/modules/org-config.el
+++ b/modules/org-config.el
@@ -31,12 +31,12 @@
(interactive)
(save-excursion
(ignore-errors
- (progn
- (org-sort-entries t ?a)
- (org-sort-entries t ?p)
- (org-sort-entries t ?t)
- (org-cycle)
- (org-cycle)))))
+ (progn
+ (org-sort-entries t ?a)
+ (org-sort-entries t ?p)
+ (org-sort-entries t ?t)
+ (org-cycle)
+ (org-cycle)))))
;; ---------------------------------- Org Mode ---------------------------------
@@ -45,7 +45,7 @@
:ensure nil ;; use the built-in package
:pin manual ;; never upgrade from the version built-into Emacs
:preface
- ;; create an org-table-map so you can use C-c t as prefix
+ ;; create an org-table-map so we can use C-c t as prefix
(define-prefix-command 'org-table-map)
(global-set-key (kbd "C-c T") 'org-table-map)
:bind
@@ -117,7 +117,6 @@
(unbind-key "C-'" org-mode-map)
(unbind-key "C-," org-mode-map)
-
;; ORG-PROTOCOL
;; enable recognition of org-protocol:// as a parameter
(require 'org-protocol)
@@ -131,16 +130,15 @@
(setq org-list-allow-alphabetical t) ;; allow alpha ordered lists (i.e., a), A), a., etc.)
;; INDENTATION
- (setq org-startup-indented t) ;; load org files indented
- (setq org-adapt-indentation t) ;; adapt indentation to outline node level
- (setq org-indent-indentation-per-level 2) ;; indent two character-widths per level
+ (setq org-startup-indented t) ;; load org files indented
+ (setq org-adapt-indentation t) ;; adapt indentation to outline node level
+ (setq org-indent-indentation-per-level 2) ;; indent two character-widths per level
;; INLINE IMAGES
- (setq org-startup-with-inline-images t) ;; preview images by default
- (setq org-image-actual-width '(500)) ;; keep image
- ;; sizes in check
+ (setq org-startup-with-inline-images t) ;; preview images by default
+ (setq org-image-actual-width '(500)) ;; keep image sizes in check
- (setq org-bookmark-names-plist nil) ;; don't set org-capture bookmarks
+ (setq org-bookmark-names-plist nil) ;; don't set org-capture bookmarks
;; force pdfs exported from org to open in emacs
(add-to-list 'org-file-apps '("\\.pdf\\'" . emacs)))
diff --git a/modules/org-drill-config.el b/modules/org-drill-config.el
index 127a94f7..be0256d3 100644
--- a/modules/org-drill-config.el
+++ b/modules/org-drill-config.el
@@ -4,7 +4,7 @@
;; Notes: Org-Drill
;; Start out your org-drill with C-d s, then select your file.
-;; the javascript bookmark I use to capture information from the web is below:
+;; the javascript bookmark I use to capture information from the web for org-drill files:
;; javascript:location.href='org-protocol://capture?template=d&url=%27+encodeURIComponent(location.href)+%27&title=%27+encodeURIComponent(document.title)+%27&body=%27+encodeURIComponent(window.getSelection())
;; create a new bookmark and add "Drill Entry" to the name field and the above
@@ -12,60 +12,11 @@
;; ----------------------------------- Tasks -----------------------------------
-
;;; Code:
-(require 'custom-functions) ;; for cj/merge-list-to-list
-
-(defvar org-drill-files (directory-files (concat sync-dir "drill/")
- t directory-files-no-dot-files-regexp))
-
-(with-eval-after-load 'org
- (cj/merge-list-to-list
- 'org-capture-templates
- '(("d" "Drill Question - Web"
- entry
- (file (lambda () (completing-read "Choose file: " org-drill-files)))
- "* Item :drill:\n%?\n** Answer\n%i\nSource: [[%:link][%:description]]\nCaptured On: %U" :prepend t)
- ("b" "Drill Question - EPUB"
- entry
- (file (lambda () (completing-read "Choose file: " org-drill-files)))
- "* Item :drill:\n%?\n** Answer\n%i\nSource: [[%:link][%(buffer-name (org-capture-get :original-buffer))]]\nCaptured On: %U" :prepend t)
- ("f" "Drill Question - PDF"
- entry
- (file (lambda () (completing-read "Choose file: " org-drill-files)))
- "* Item :drill:\n%?\n** Answer\n%(org-capture-pdf-active-region)\nSource:[[%L][%(buffer-name (org-capture-get :original-buffer))]]\nCaptured On: %U" :prepend t))))
-
(use-package org-drill
:after org
:preface
- (defun cj/drill-start ()
- "Prompt user to pick a drill org file, then starts an org-drill session."
- (interactive)
- (let ((choices org-drill-files))
- (setq chosen-drill-file (completing-read "Choose Flashcard File:" choices ))
- (find-file chosen-drill-file)
- (org-drill)))
-
- (defun cj/drill-edit ()
- "Prompts the user to pick a drill org file, then opens it for editing."
- (interactive)
- (let* ((choices org-drill-files)
- (chosen-drill-file (completing-read "Choose Flashcards to Edit:" choices)))
- (find-file chosen-drill-file)))
-
- (defun cj/drill-capture ()
- "Quickly capture a drill question."
- (interactive)
- (org-capture nil "d"))
-
- (defun cj/drill-refile ()
- "Refile to a drill file."
- (interactive)
- (setq org-refile-targets '((nil :maxlevel . 1)
- (org-drill-files :maxlevel . 1)))
- (call-interactively 'org-refile))
-
;; create an org-drill-map so you can use C-d as prefix
(define-prefix-command 'org-drill-map)
(global-set-key (kbd "C-d") 'org-drill-map)
@@ -83,7 +34,49 @@
(setq org-drill-hide-item-headings-p t) ;; don't show heading text
(setq org-drill-maximum-items-per-session 1000) ;; drill sessions end after 1000 cards
(setq org-drill-maximum-duration 60) ;; each drill session can last up to a an hour
- (setq org-drill-add-random-noise-to-intervals-p t)) ;; slightly vary number of days to repetition
+ (setq org-drill-add-random-noise-to-intervals-p t) ;; slightly vary number of days to repetition
+
+ (defun cj/drill-start ()
+ "Prompt user to pick a drill org file, then starts an org-drill session."
+ (interactive)
+ (let ((choices (directory-files drill-dir nil "^[^.].*\\.org$")))
+ (setq chosen-drill-file (completing-read "Choose Flashcard File:" choices))
+ (find-file (concat drill-dir chosen-drill-file))
+ (require 'org-drill)
+ (org-drill)))
+
+ (defun cj/drill-edit ()
+ "Prompts the user to pick a drill org file, then opens it for editing."
+ (interactive)
+ (let* ((choices drill-dir)
+ (chosen-drill-file (completing-read "Choose Flashcards to Edit:" choices)))
+ (find-file chosen-drill-file)))
+
+ (defun cj/drill-capture ()
+ "Quickly capture a drill question."
+ (interactive)
+ (org-capture nil "d"))
+
+ (defun cj/drill-refile ()
+ "Refile to a drill file."
+ (interactive)
+ (setq org-refile-targets '((nil :maxlevel . 1)
+ (drill-dir :maxlevel . 1)))
+ (call-interactively 'org-refile))
+
+ ;; add useful org drill capture templates
+ (require 'custom-functions)
+ (cj/merge-list-to-list
+ 'org-capture-templates
+ '(("d" "Drill Question - Web" entry
+ (file (lambda () (completing-read "Choose file: " drill-dir)))
+ "* Item :drill:\n%?\n** Answer\n%i\nSource: [[%:link][%:description]]\nCaptured On: %U" :prepend t)
+ ("b" "Drill Question - EPUB" entry
+ (file (lambda () (completing-read "Choose file: " drill-dir)))
+ "* Item :drill:\n%?\n** Answer\n%i\nSource: [[%:link][%(buffer-name (org-capture-get :original-buffer))]]\nCaptured On: %U" :prepend t)
+ ("f" "Drill Question - PDF" entry
+ (file (lambda () (completing-read "Choose file: " drill-dir)))
+ "* Item :drill:\n%?\n** Answer\n%(org-capture-pdf-active-region)\nSource:[[%L][%(buffer-name (org-capture-get :original-buffer))]]\nCaptured On: %U" :prepend t))))
(provide 'org-drill-config)
;;; org-drill-config.el ends here.
diff --git a/modules/system-utils.el b/modules/system-utils.el
index f5967520..62f73dc8 100644
--- a/modules/system-utils.el
+++ b/modules/system-utils.el
@@ -223,11 +223,9 @@ Don't automatically display output buffers, but keep them in buffer list."
;; install Webster's dictionary in StarDict format
;; http://jsomers.net/blog/dictionary
-(use-package sdcv-mode
+(use-package sdcv
:defer 1
- :ensure nil; custom-file
- :load-path "custom/sdcv-mode.el"
- :bind ("C-h d" . 'sdcv-search))
+ :bind ("C-h d" . 'sdcv-search-input))
;; ------------------------------ -Keyboard Macros -----------------------------
;; note that this leverages simple, easy to remember shortcuts
diff --git a/modules/test-code.el b/modules/test-code.el
index 74179c95..85e7bce6 100644
--- a/modules/test-code.el
+++ b/modules/test-code.el
@@ -7,6 +7,28 @@
;;; Code:
+;; ---------------------------------- Yeetube ----------------------------------
+;; youtube frontend for emacs
+
+(use-package yeetube
+ :init (define-prefix-command 'cj/yeetube-map)
+ :bind (("C-c y" . 'cj/yeetube-map)
+ :map cj/yeetube-map
+ ("s" . 'yeetube-search)
+ ("b" . 'yeetube-play-saved-video)
+ ("d" . 'yeetube-download-videos)
+ ("p" . 'yeetube-mpv-toggle-pause)
+ ("v" . 'yeetube-mpv-toggle-video)
+ ("V" . 'yeetube-mpv-toggle-no-video-flag)
+ ("k" . 'yeetube-remove-saved-video))
+ :custom
+ (yeetube-results-limit 50)
+ (yeetube-download-directory (expand-file-name "videos" "~"))
+ (yeetube-filter "Views")
+ (setq yeetube-display-thumbnails nil)
+ :config
+ (setf yeetube-mpv-disable-video nil))
+
;; --------------------------------- Recording ---------------------------------
@@ -22,12 +44,12 @@ If called with a prefix arg C-u, choose the location on where to save the record
otherwise use the default location in `cj/recording-location'."
(interactive "P")
(let* ((location (if arg
- (read-directory-name "Enter recording location: ")
- cj/recording-location))
- (directory (file-name-directory location)))
- (unless (file-directory-p directory)
- (make-directory directory t))
- (cj/ffmpeg-record location)))
+ (read-directory-name "Enter recording location: ")
+ cj/recording-location))
+ (directory (file-name-directory location)))
+ (unless (file-directory-p directory)
+ (make-directory directory t))
+ (cj/ffmpeg-record location)))
(defun cj/ffmpeg-record (directory)
"Start an ffmpeg recording. Save output to DIRECTORY."
@@ -39,13 +61,13 @@ otherwise use the default location in `cj/recording-location'."
(concat "ffmpeg -framerate 30 -f x11grab -i :0.0+ "
"-f pulse -i alsa_input.pci-0000_00_1b.0.analog-stereo "
"-ac 1 -f pulse -i alsa_output.pci-0000_00_1b.0.analog-stereo.monitor "
- "-ac 2 " filename)))
- ;; start the recording
+ "-ac 2 " filename)))
+ ;; start the recording
(setq cj/ffmpeg-process
(start-process-shell-command "ffmpeg-recording"
"*ffmpeg-recording*"
ffmpeg-command))
- (set-process-query-on-exit-flag cj/ffmpeg-process nil)
+ (set-process-query-on-exit-flag cj/ffmpeg-process nil)
(message "Started recording process."))))
(defun cj/stop-recording ()
@@ -62,22 +84,22 @@ otherwise use the default location in `cj/recording-location'."
"Prompt for a string, insert it before and after the word at point or selected region."
(interactive)
(let ((str (read-string "Enter a string: "))
- (regionp (use-region-p)))
- (save-excursion
- (if regionp
- (let ((beg (region-beginning))
- (end (region-end)))
- (goto-char end)
- (insert str)
- (goto-char beg)
- (insert str))
- (if (thing-at-point 'word)
- (let ((bounds (bounds-of-thing-at-point 'word)))
- (goto-char (cdr bounds))
- (insert str)
- (goto-char (car bounds))
- (insert str))
- (message "Can't insert around. No word at point and no region selected."))))))
+ (regionp (use-region-p)))
+ (save-excursion
+ (if regionp
+ (let ((beg (region-beginning))
+ (end (region-end)))
+ (goto-char end)
+ (insert str)
+ (goto-char beg)
+ (insert str))
+ (if (thing-at-point 'word)
+ (let ((bounds (bounds-of-thing-at-point 'word)))
+ (goto-char (cdr bounds))
+ (insert str)
+ (goto-char (car bounds))
+ (insert str))
+ (message "Can't insert around. No word at point and no region selected."))))))
(global-set-key (kbd "C-; i a") 'cj/insert-around-word-or-region)
@@ -115,19 +137,18 @@ otherwise use the default location in `cj/recording-location'."
(use-package wttrin
:defer .5
- :after xterm-color
:load-path ("~/code/emacs-wttrin")
+ :preface
+ ;; dependency for wttrin
+ (use-package xterm-color
+ :demand t)
:bind
("M-W" . wttrin))
-;; dependency for wttrin
-(use-package xterm-color
- :defer .5)
-
;; ------------------------------ ERC Yank To Gist -----------------------------
;; automatically create a Gist if pasting more than 5 lines
;; this module requires https://github.com/defunkt/gist
-;; via ruby: 'gem install gist' via the aur: yay -S gist
+;; via ruby: 'gem install gist' via the aur: yay -S gist
(use-package erc-yank
:defer 1
@@ -144,9 +165,9 @@ otherwise use the default location in `cj/recording-location'."
;; :after racket-mode
;; :commands (org-babel-execute:racket)
;; :quelpa (ob-racket
-;; :fetcher github
-;; :repo "hasu/emacs-ob-racket"
-;; :files ("*.el" "*.rkt")))
+;; :fetcher github
+;; :repo "hasu/emacs-ob-racket"
+;; :files ("*.el" "*.rkt")))
(provide 'test-code)
;;; test-code.el ends here.
diff --git a/modules/ui-theme.el b/modules/ui-theme.el
index 609acab3..8d544f9f 100644
--- a/modules/ui-theme.el
+++ b/modules/ui-theme.el
@@ -60,7 +60,7 @@ If FILENAME isn't readable, return nil."
(with-temp-buffer
(insert-file-contents filename)
(buffer-string))
- 'nil))
+ nil))
(defun cj/write-file-contents (content filename)
"Write CONTENT to FILENAME.
@@ -70,8 +70,8 @@ If FILENAME isn't writeable, return nil. If successful, return t."
(with-temp-buffer
(insert content)
(write-file filename))
- 't)
- 'nil))
+ t)
+ nil))
(defun cj/get-active-theme-name ()
"Return the name of the active UI theme as a string."
@@ -79,7 +79,7 @@ If FILENAME isn't writeable, return nil. If successful, return t."
(defun cj/save-theme-to-file ()
"Save the string representing the current theme to the theme-file."
- (if (equal (cj/write-file-contents (cj/get-active-theme-name) theme-file) 'nil)
+ (if (equal (cj/write-file-contents (cj/get-active-theme-name) theme-file) nil)
(message "Cannot save theme: %s is unwriteable" theme-file)
(message "%s theme saved to %s" (cj/get-active-theme-name) theme-file)))
@@ -94,15 +94,17 @@ Used to handle errors with loading persisted theme."
If the theme is nil, it disables all current themes. If an error occurs
loading the file name, the fallback-theme-name is applied and saved."
(let ((theme-name (cj/read-file-contents theme-file)))
- ;; if theme-name is nil, unload all themes
- (if (string= theme-name "nil")
- (mapcar #'disable-theme custom-enabled-themes)
- ;; apply theme name or if error, load fallback theme
- (progn
- (condition-case err
- (load-theme (intern theme-name) t)
- (error
- (cj/load-fallback-theme (concat "Error loading " theme-name "."))))))))
+ ;; if theme-name is nil, unload all themes and load fallback theme
+ (if (or (string= theme-name "nil") (not theme-name))
+ (progn
+ (mapcar #'disable-theme custom-enabled-themes)
+ (cj/load-fallback-theme "Theme file not found or theme name in it is nil."))
+ ;; apply theme name or if error, load fallback theme
+ (condition-case err
+ (load-theme (intern theme-name) t)
+ (error
+ (cj/load-fallback-theme (concat "Error loading " theme-name
+ ".")))))))
(cj/load-theme-from-file)
diff --git a/modules/user-constants.el b/modules/user-constants.el
new file mode 100644
index 00000000..2702f978
--- /dev/null
+++ b/modules/user-constants.el
@@ -0,0 +1,86 @@
+;;; user-constants.el --- User Constants -*- lexical-binding: t; -*-
+
+;;; Commentary:
+;; user file locations are defined here.
+;; if they aren't found, they are created.
+
+;;; Code:
+
+;; ------------------------ Directory And File Constants -----------------------
+
+(defconst emacs-init-file (concat user-emacs-directory "init.el")
+ "The location of Emacs's main init file.")
+
+(defconst emacs-early-init-file (concat user-emacs-directory "early-init.el")
+ "The location of Emacs's early init file.")
+
+(defconst code-dir (concat user-home-dir "/code/")
+ "Code repositories are located in this directory.")
+
+(defconst projects-dir (concat user-home-dir "/projects/")
+ "Non-code projects and repositories are located in this directory.")
+
+(defconst sync-dir (concat user-home-dir "/sync/org/")
+ "This directory is synchronized across machines.")
+
+(defconst roam-dir (concat sync-dir "roam/")
+ "The location of org-roam files.")
+
+(defconst drill-dir (concat sync-dir "drill/")
+ "The location of org-drill org files.")
+
+(defconst snippets-dir (concat sync-dir "snippets/")
+ "The location of ya-snippet snippets.")
+
+
+(defvar schedule-file (concat sync-dir "schedule.org")
+ "The location of the org file containing scheduled events.")
+
+(defvar inbox-file (concat roam-dir "inbox.org")
+ "The location of the org file that serves as the task inbox.")
+
+(defvar contacts-file (concat sync-dir "contacts.org")
+ "The location of the org file containing org-contacts information.")
+
+(defvar article-file (concat sync-dir "article-inbox.org")
+ "The location of the org file containing new clipped pages to review.")
+
+(defvar article-archive (concat sync-dir "article-archive.org")
+ "The location of the org file that stores saved articples to keep.")
+ ;
+(defvar ledger-file (concat sync-dir "main.ledger")
+ "The location of the user's ledger file.")
+
+(defvar macros-file (concat sync-dir "macros.el")
+ "The location of the macros file for recorded saved macros via M-f3.")
+
+;; ------------------------- Verify Or Create Functions ------------------------
+
+(defun cj/verify-or-create-dir (dir)
+ "Verify the directory DIR exists; create it if it doesn't."
+ (unless (file-directory-p dir)
+ (make-directory dir t)
+ (message "Warning: Directory %s not found, so created it" dir)))
+
+(defun cj/verify-or-create-file (file)
+ "Verify the file FILE exists; create it if it doesn't."
+ (unless (file-exists-p file)
+ (write-region "" nil file)
+ (message "Warning: File %s not found, so created it" file)))
+
+;; ------------------------- Verify Or Create Constants ------------------------
+
+(mapc 'cj/verify-or-create-dir (list sync-dir
+ roam-dir
+ snippets-dir))
+
+(mapc 'cj/verify-or-create-file (list schedule-file
+ inbox-file
+ contacts-file
+ article-file
+ article-archive
+ ledger-file
+ macros-file))
+
+(provide 'user-constants)
+;;; user-constants.el ends here.
diff --git a/modules/vc-config.el b/modules/vc-config.el
index d2cb183b..a9b72507 100644
--- a/modules/vc-config.el
+++ b/modules/vc-config.el
@@ -30,11 +30,6 @@
(setq git-commit-major-mode 'org-mode) ;; edit commit messages in org-mode
(setq magit-display-buffer-function 'magit-display-buffer-fullframe-status-topleft-v1))
-;; -------------------------------- Magit Forge --------------------------------
-
-(use-package forge
- :after magit)
-
;; --------------------------------- Git Gutter --------------------------------
;; mark changed lines since last commit in the margin
diff --git a/modules/wrap-up.el b/modules/wrap-up.el
index fcc0b788..56cd65f0 100644
--- a/modules/wrap-up.el
+++ b/modules/wrap-up.el
@@ -22,7 +22,7 @@
(defun cj/bury-buffers-after-delay ()
"Run cj/bury-buffers after a delay."
- (run-with-timer 10 nil 'cj/bury-buffers))
+ (run-with-timer 1 nil 'cj/bury-buffers))
(add-hook 'emacs-startup-hook 'cj/bury-buffers-after-delay)
diff --git a/scripts/build-emacs-from-src.sh b/scripts/build-emacs-from-source.sh
index a2272838..a2272838 100755
--- a/scripts/build-emacs-from-src.sh
+++ b/scripts/build-emacs-from-source.sh
diff --git a/scripts/reset.sh b/scripts/reset-to-first-launch.sh
index efa15d76..6800bc44 100755
--- a/scripts/reset.sh
+++ b/scripts/reset-to-first-launch.sh
@@ -12,10 +12,9 @@ rm -rf ~/.emacs.d/elpa/
rm -rf ~/.emacs.d/emojis/
rm -rf ~/.emacs.d/erc/
rm -rf ~/.emacs.d/eshell/
-rm -rf ~/.emacs.d/localrepo/
-rm -rf ~/.emacs.d/nov-places
rm -rf ~/.emacs.d/nov-places/
rm -rf ~/.emacs.d/quelpa/
+rm -rf ~/.emacs.d/tramp-autosave/
rm -rf ~/.emacs.d/transient/
rm -rf ~/.emacs.d/tree-sitter/
rm -rf ~/.emacs.d/url/
@@ -24,7 +23,8 @@ rm ~/.emacs.d/.org-id-locations
rm ~/.emacs.d/.pdf-view-restore
rm ~/.emacs.d/org-roam.db
rm ~/.emacs.d/projectile-bookmarks.eld
-rm ~/.emacs.d/projects
+rm ~/.emacs.d/.scratch
+rm ~/.emacs.d/forge-database.sqlite
rm ~/.emacs.d/recentf
rm ~/.emacs.d/tramp-connection-history
rm ~/sync/org/emacs-theme.persist