diff options
| author | Craig Jennings <craigmartinjennings@gmail.com> | 2024-04-11 03:23:03 -0500 |
|---|---|---|
| committer | Craig Jennings <craigmartinjennings@gmail.com> | 2024-04-11 03:23:03 -0500 |
| commit | 315f0122ea041d02bb81ad7d4b112a20252cbba8 (patch) | |
| tree | b1cc4e6931557cbde4bc3f3aa5208a4057ffdd6d | |
| parent | 07fd4f1a6930dc62880b0fd7a0496270f4c2efd6 (diff) | |
fixed agenda and refile issues
- fixed building refile-targets not building accurately
- fixed events in schedule.org not showing up in agendas
| -rw-r--r-- | TODO.org | 125 | ||||
| -rw-r--r-- | modules/org-agenda-config.el | 85 | ||||
| -rw-r--r-- | modules/org-config.el | 1 | ||||
| -rw-r--r-- | modules/org-refile-config.el | 87 |
4 files changed, 166 insertions, 132 deletions
@@ -140,49 +140,62 @@ 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) [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 +** DOING Open v0.7 Fit and Finish (ends 2024.04.18) [0/3] +*** TODO [#B] Neither Feebleline nor Moodline Displays on Archsetup Fresh Install +*** TODO [#C] Theme Doesn't Fallback on Wombat Correctly if No Theme Persist File *** TODO [#C] Check if Including Dired Buffers in Autorevert-mode Slows Tramp -*** DONE [#A] Remove Keys +*** [#D] Resolved v0.7 Fit and Finish Work [16/16] +**** 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 +***** 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 +***** 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] Rename cj/kill-buffers +****** Google OAuth Client ID and Client Secret in org-agenda-config.el +**** 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 [#B] Saving an Event for Today and Today's Calendar Doesn't Show the Event +Fix was to include schedule-file alongside inbox in cj/build-org-agenda-list () +***** 2024-04-11 Thu @ 01:48:07 -0500 Observation +Relaunching Emacs doesn't matter. Is the schedule file included in the agenda targets? +***** 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. +**** 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" @@ -195,24 +208,17 @@ 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] Hyphenating Whitespace 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] 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 -abbrev_defs -elfeed-dashboard -*** 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 [#B] Kill All Windows Also Kills Invisible Buffers CLOSED: [2024-04-08 Mon 16:14] -*** DONE [#B] Dictionary Doesn't Work Via C-h d +**** 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 +***** 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 +***** 2024-04-08 Mon @ 19:23:01 -0500 Issue Tried to look up agency and the dictionary failed. Found 1 items, similar to agency. @@ -245,32 +251,33 @@ agentis: cf. F. agence. See {Agent}.] 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 +**** 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 +**** 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 +***** DONE Setup Virtualbox Testing CLOSED: [2024-04-11 Thu 01:18] -***** DONE Create ArchBase and AqrchSetup Images +****** DONE Create ArchBase and AqrchSetup Images CLOSED: [2024-04-07 Sun 13:48] -***** DONE Run Archsetup in ArchSetup Image +****** DONE Run Archsetup in ArchSetup Image CLOSED: [2024-04-10 Wed 19:11] -***** DONE Run Mu4e Install Found in ~/.emacs.d/scripts/ +****** DONE Run Mu4e Install Found in ~/.emacs.d/scripts/ CLOSED: [2024-04-11 Thu 01:17] -***** DONE Snapshot the Image +****** DONE Snapshot the Image CLOSED: [2024-04-11 Thu 01:18] +**** 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 +abbrev_defs +elfeed-dashboard +**** DONE [#C] Ripgrep Should Finish with Point on Results Buffer +CLOSED: [2024-04-08 Mon 16:14] +**** DONE [#C] Dashboard Icons Aren't Correct or Sized Correctly on Fractal +CLOSED: [2024-04-10 Wed 17:16] +**** DONE [#A] Fix Incorrect Refile Targets After Launch +CLOSED: [2024-04-11 Thu 03:21] ** DOING Complete v0.7 Release Checklist [8/11] *** DOING 2 Week Fit and Finish (ends 2024.04.18) *** TODO Clean Launch from Archsetup @@ -1303,7 +1310,11 @@ should pull in m3u files in ~/music directory ; do a completing-read with gnuchess, fruit, crafty, stockfish, etc. ;; (ideally based on what's found on the system's path) -** Emacs General Backlog [0/29] +** Emacs General Backlog [0/31 +*** TODO Consider Collapsing Code and Project Directories Into One List +You don't actually treat them any differently. +Ideally, code-dir is where cloning repositories would go to, but even then, the user should choose as there are non-code git repositories. +Having a list would also make the setup more flexible in case you wanted to use another directory in your agenda or as a refile target. *** TODO Add Current Directory Into Load-path in Emacs #+BEGIN_QUOTE Add current directory into load-path in Emacs diff --git a/modules/org-agenda-config.el b/modules/org-agenda-config.el index c034aa05..f0bf7256 100644 --- a/modules/org-agenda-config.el +++ b/modules/org-agenda-config.el @@ -4,25 +4,26 @@ ;;; Commentary: ;; Agenda views are tied to the F8 (fate) key. -;; f8 - A daily schedule with task items with a scheduled date or deadline of -;; the current day. This is followed by a task list containing tasks from -;; all agenda sources. -;; C-f8 - A task list containing all tasks from all agenda sources -;; M-f8 - A task list containing all tasks from the current org-mode buffer. + +;; f8 - DAILY SCHEDULE containing a events with a scheduled date or deadline of +;; the current day. This is followed by... +;; - TASK LIST containing tasks from all agenda sources. + +;; C-f8 - TASK LIST containing all tasks from all agenda sources + +;; M-f8 - TASK LIST containing all tasks from the current org-mode buffer. ;; NOTE: ;; Files that contain information relevant to the agenda will be found in the -;; following places: the schedule-file, org-roam notes tagged as 'projects' and -;; project todo.org files found in project-dir and code-dir. The function -;; that rebuilds the agenda list. +;; following places: the schedule-file, org-roam notes tagged as 'Projects' and +;; project todo.org files found in project-dir and code-dir. ;; How the agenda is created: -;; In order to stay current, the files containing agenda information are queried -;; before calling the functions in the section org-agenda functions to display -;; the data. - -;; This way, we can maximize flexibility and limit the agenda-files to a smaller -;; set of files for a scoped agenda. +;; The inbox and schedule files are always included first. However, in order to +;; stay current, the files containing agenda information are queried before +;; calling the functions in the section org-agenda functions to display the +;; data. This way, any newly created events from project todo.org files, or +;; org-roam Project files will be included. ;;; Code: @@ -66,8 +67,8 @@ ;; ------------------ Org TODO Next/Previous Set Keybindings ----------------- (add-hook 'org-agenda-mode-hook (lambda () - (local-set-key (kbd "s-<right>") #'org-agenda-todo-nextset) - (local-set-key (kbd "s-<left>") #'org-agenda-todo-previousset))) + (local-set-key (kbd "s-<right>") #'org-agenda-todo-nextset) + (local-set-key (kbd "s-<left>") #'org-agenda-todo-previousset))) ;; ------------------------------ Org Super Agenda ----------------------------- @@ -170,35 +171,39 @@ This allows a line to show in an agenda without being scheduled or a deadline." ;; org-agenda-files list. (defun cj/add-files-to-org-agenda-files (directory) - "Recursively searches for files named 'todo.org'. -Searches in DIRECTORY and adds them to org-project-files." - (interactive "D") + "Recursively searches for files named 'todo.org', + Searches in DIRECTORY and adds them to org-project-files." + (interactive "D") (setq org-agenda-files - (append org-agenda-files - (directory-files-recursively directory "^[Tt][Oo][Dd][Oo]\\.[Oo][Rr][Gg]$" t)))) + (append (directory-files-recursively directory + "^[Tt][Oo][Dd][Oo]\\.[Oo][Rr][Gg]$" t) + org-agenda-files))) + ;; NOTE: the following functions require org-roam functionality (with-eval-after-load 'org-roam-config - ;; ---------------------------- Rebuild Org Agenda --------------------------- - - (defun cj/build-org-agenda-list () - "Rebuilds the org agenda list." - (interactive) - ;; reset org-agenda-files to inbox-file - (setq org-agenda-files (list inbox-file)) - (let ((new-files - (append - (cj/org-roam-list-notes-by-tag "Project")))) - (dolist (file new-files) - (unless (member file org-agenda-files) - (setq org-agenda-files (cons file org-agenda-files))))) - - (cj/add-files-to-org-agenda-files projects-dir) - (cj/add-files-to-org-agenda-files code-dir)) - - ;; build org-agenda-list for the first time once emacs init is complete. - (add-hook 'emacs-startup-hook 'cj/build-org-agenda-list) + ;; ---------------------------- Rebuild Org Agenda --------------------------- + + (defun cj/build-org-agenda-list () + "Rebuilds the org agenda list. +Begins with the inbox-file and schedule-file, then searches for org-roam +Projects and adds all todo.org files from code and project directories." + (interactive) + ;; reset org-agenda-files to inbox-file + (setq org-agenda-files (list inbox-file schedule-file)) + (let ((new-files + (append + (cj/org-roam-list-notes-by-tag "Project")))) + (dolist (file new-files) + (unless (member file org-agenda-files) + (setq org-agenda-files (cons file org-agenda-files))))) + + (cj/add-files-to-org-agenda-files projects-dir) + (cj/add-files-to-org-agenda-files code-dir)) + + ;; build org-agenda-list for the first time once emacs init is complete. + (add-hook 'emacs-startup-hook 'cj/build-org-agenda-list) ;; ------------------------ Org Agenda Display Functions ----------------------- diff --git a/modules/org-config.el b/modules/org-config.el index 6a177d30..0094cc9d 100644 --- a/modules/org-config.el +++ b/modules/org-config.el @@ -54,7 +54,6 @@ (:map org-mode-map ("C-c ?" . hydra-general/body) ;; was org-table-field-info ("C-c I" . org-table-field-info) ;; was C-c ? - ("C-c w" . cj/org-refile-in-file) ("C-\\" . org-match-sparse-tree) ("C-c t" . org-set-tags-command) ("C-c l" . org-store-link) diff --git a/modules/org-refile-config.el b/modules/org-refile-config.el index 8c058d66..3f71d91d 100644 --- a/modules/org-refile-config.el +++ b/modules/org-refile-config.el @@ -5,58 +5,77 @@ ;;; Code: -(with-eval-after-load 'org-roam-config - (require 'org-refile) +(use-package org-refile + :ensure nil ;; built-in + :defer .5 + :bind + (:map org-mode-map + ("C-c C-w" . cj/org-refile) + ("C-c w" . cj/org-refile-in-file)) + :config ;; ----------------------------- Org Refile Targets ---------------------------- ;; sets refile targets ;; - adds project files in org-roam to the refile targets ;; - adds todo.org files in subdirectories of the code and project directories - (defun cj/add-files-to-org-refile-targets (directory) - "Recursively searches for all files named 'todo.org' in DIRECTORY and adds them to org-project-files." - (interactive "D") - (let ((files (directory-files-recursively directory "^[Tt][Oo][Dd][Oo]\\.[Oo][Rr][Gg]$" t))) - (dolist (file files) - (add-to-list 'org-refile-targets `(,file . (:level . 1)))))) - (defun cj/build-org-refile-targets() - "Build org-refile-targets. -Starts with the schedule file, then adds the Emacs task list, -and any task list in the code or projects directories." + "Build org-refile-targets." (interactive) - (let ((new-files - (append - (cj/org-roam-list-notes-by-tag "Project") - (cj/org-roam-list-notes-by-tag "Topic")))) - (dolist (file new-files) - (unless (member file org-agenda-files) - (setq org-agenda-files (cons file org-agenda-files)))) - ) - (setq org-refile-targets '((org-agenda-files :maxlevel . 1))) - (cj/add-files-to-org-refile-targets user-emacs-directory) - (cj/add-files-to-org-refile-targets code-dir) - (cj/add-files-to-org-refile-targets projects-dir)) - - ;; --------------------------------- Org-Refile ------------------------------- + (let (new-files) + ;; Start with the inbox and the schedule files. + (setq new-files `((,inbox-file . (:maxlevel . 1)) (,schedule-file . (:maxlevel . 1)))) + + ;; Extend new-files with the project and topic files. + (let ((project-and-topic-files (append (cj/org-roam-list-notes-by-tag "Project") + (cj/org-roam-list-notes-by-tag "Topic")))) + (let ((file-rule `(:level . 1))) + (dolist (file project-and-topic-files) + (unless (assoc file new-files) + (push `(,file . ,file-rule) new-files))))) + + ;; Extend new-files with todo.org files in the specified directories. + (dolist (dir (list user-emacs-directory code-dir projects-dir)) + (let ((todo-files (directory-files-recursively dir "^[Tt][Oo][Dd][Oo]\\.[Oo][Rr][Gg]$"))) + (let ((file-rule `(:level . 1))) + (dolist (file todo-files) + (unless (assoc file new-files) + (push `(,file . ,file-rule) new-files)))))) + + ;; Set org-refile-targets. + (setq org-refile-targets (nreverse new-files)))) + + ;; -------------------------------- Org-Refile ------------------------------- + ;; used in place of org-refile to ensure the refile targets are rebuilt. + + (defun cj/org-refile (&optional ARG DEFAULT-BUFFER RFLOC MSG) + "Simply rebuilds the refile targets before calling org-refile. +ARG DEFAULT-BUFFER RFLOC and MSG parameters passed to org-refile." + (interactive "P") + (cj/build-org-refile-targets) + (org-refile ARG DEFAULT-BUFFER RFLOC MSG)) + + ;; ----------------------------- Org Refile In File ---------------------------- ;; convenience function for scoping the refile candidates to the current buffer. (defun cj/org-refile-in-file () "Refile to a target within the current file and save the buffer." - (interactive) - (let ((org-refile-targets `(((,(buffer-file-name)) :maxlevel . 6)))) + (interactive) + (let ((org-refile-targets `(((,(buffer-file-name)) :maxlevel . 6)))) (call-interactively 'org-refile) (save-buffer))) - ;; ----------------------- Save Org Files After Refile ----------------------- - ;; advice that saves all open org buffers after a refile is complete + ) ; end use-package statement + + +;; ----------------------- Save Org Files After Refile ----------------------- +;; advice that saves all open org buffers after a refile is complete - (advice-add 'org-refile :after - (lambda (&rest _) - (org-save-all-org-buffers))) +(advice-add 'org-refile :after + (lambda (&rest _) + (org-save-all-org-buffers))) - ) ;; end with eval-after-load 'org-roam (provide 'org-refile-config) ;;; org-refile-config.el ends here. |
