Archived
1
0
Fork 0

disable flyspell (for now) due to performance issues ; re-work agendas to be more meaningful

This commit is contained in:
KemoNine 2022-08-25 18:52:29 -04:00
parent 3289b8a202
commit 579d0be5c5
3 changed files with 136 additions and 126 deletions

View file

@ -395,40 +395,40 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; flyspell
(require 'flyspell)
(setenv "LANG" "en_US")
;(require 'flyspell)
;(setenv "LANG" "en_US")
;(setenv "DICPATH" "~/.emacs.d.profiles/common/dictionaries") ; https://github.com/wooorm/dictionaries
(setq ispell-program-name "hunspell")
(setq ispell-dictionary "en_US")
(global-set-key (kbd "C-c y") 'flyspell-toggle )
(defun flyspell-on-for-buffer-type ()
"Enable Flyspell appropriately for the major mode of the current buffer. Uses `flyspell-prog-mode' for modes derived from `prog-mode', so only strings and comments get checked. All other buffers get `flyspell-mode' to check all text. If flyspell is already enabled, does nothing."
(interactive)
(if (not (symbol-value flyspell-mode)) ; if not already on
(progn
(if (derived-mode-p 'prog-mode)
(progn
(message "Flyspell on (code)")
(flyspell-prog-mode))
;; else
(progn
(message "Flyspell on (text)")
(flyspell-mode 1)))
;; I tried putting (flyspell-buffer) here but it didn't seem to work
)))
(defun flyspell-toggle ()
"Turn Flyspell on if it is off, or off if it is on. When turning on, it uses `flyspell-on-for-buffer-type' so code-vs-text is handled appropriately."
(interactive)
(if (symbol-value flyspell-mode)
(progn ; flyspell is on, turn it off
(message "Flyspell off")
(flyspell-mode -1))
; else - flyspell is off, turn it on
(flyspell-on-for-buffer-type)))
(add-hook 'find-file-hook 'flyspell-on-for-buffer-type)
(add-hook 'text-mode-hook 'flyspell-on-for-buffer-type)
(add-hook 'after-change-major-mode-hook 'flyspell-on-for-buffer-type)
;(setq ispell-program-name "hunspell")
;(setq ispell-dictionary "en_US")
;
;(global-set-key (kbd "C-c y") 'flyspell-toggle )
;
;(defun flyspell-on-for-buffer-type ()
; "Enable Flyspell appropriately for the major mode of the current buffer. Uses `flyspell-prog-mode' for modes derived from `prog-mode', so only strings and comments get checked. All other buffers get `flyspell-mode' to check all text. If flyspell is already enabled, does nothing."
; (interactive)
; (if (not (symbol-value flyspell-mode)) ; if not already on
; (progn
; (if (derived-mode-p 'prog-mode)
; (progn
; (message "Flyspell on (code)")
; (flyspell-prog-mode))
; ;; else
; (progn
; (message "Flyspell on (text)")
; (flyspell-mode 1)))
; ;; I tried putting (flyspell-buffer) here but it didn't seem to work
; )))
;
; (defun flyspell-toggle ()
; "Turn Flyspell on if it is off, or off if it is on. When turning on, it uses `flyspell-on-for-buffer-type' so code-vs-text is handled appropriately."
; (interactive)
; (if (symbol-value flyspell-mode)
; (progn ; flyspell is on, turn it off
; (message "Flyspell off")
; (flyspell-mode -1))
; ; else - flyspell is off, turn it on
; (flyspell-on-for-buffer-type)))
;
;(add-hook 'find-file-hook 'flyspell-on-for-buffer-type)
;(add-hook 'text-mode-hook 'flyspell-on-for-buffer-type)
;(add-hook 'after-change-major-mode-hook 'flyspell-on-for-buffer-type)

View file

@ -1,88 +1,99 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; helper for building agenda file lists
(defun load-org-agenda-files-recursively (dir) "Find all directories in DIR."
(unless (file-directory-p dir) (error "Not a directory `%s'" dir))
(unless (equal (directory-files dir nil org-agenda-file-regexp t) nil)
(add-to-list 'org-agenda-files dir)
)
(dolist (file (directory-files dir nil nil t))
(unless (member file '("." ".."))
(let ((file (concat dir file "/")))
(when (file-directory-p file)
(load-org-agenda-files-recursively file)
)
)
)
)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Set some org agendas/dashboards
(setq org-agenda-todo-ignore-scheduled 'all)
(setq org-agenda-sorting-strategy
'(
(agenda habit-down time-up scheduled-down priority-down category-keep)
(todo habit-up time-down scheduled-down deadline-down todo-state-down priority-down alpha-up)
(tags priority-down category-keep)
(search category-keep)
)
)
(setq org-agenda-custom-commands
'(
("P" "Personal"
(
(agenda "" (
(org-agenda-overriding-header "PERSONAL Agenda")
(org-agenda-files (list "~/org/_todo.org"
"~/org/_index.org"
"~/org/health/_health.org"
"~/org/health/health_houdini.org"
"~/org/health/health_mike.org"))
(load-org-agenda-files-recursively "~/org/culinary")
(load-org-agenda-files-recursively "~/org/gaz")
(load-org-agenda-files-recursively "~/org/photography")
(load-org-agenda-files-recursively "~/org/reading")
))
(alltodo "*" (
(org-agenda-overriding-header "PERSONAL To Do List")
(org-agenda-files (list "~/org/_todo.org"
"~/org/_index.org"
"~/org/health/_health.org"
"~/org/health/health_houdini.org"
"~/org/health/health_mike.org"))
(load-org-agenda-files-recursively "~/org/culinary")
(load-org-agenda-files-recursively "~/org/gaz")
(load-org-agenda-files-recursively "~/org/photography")
(load-org-agenda-files-recursively "~/org/reading")
))
)
)
("G" . "Gaming")
("Gd" "Destiny"
(
(agenda "" (
(org-agenda-start-on-weekday 2)
(org-agenda-overriding-header "DESTINY Agenda")
(org-agenda-files (list "~/org/games_destiny.org"))
))
(tags-todo "-crafting-STYLE=\"habit\"" (
(org-agenda-overriding-header "DESTINY To Do List")
(org-agenda-files (list "~/org/games_destiny.org"))
))
(tags-todo "+crafting+weaponleveling" (
(org-agenda-overriding-header "DESTINY Weapon Leveling")
(org-agenda-files (list "~/org/games_destiny.org"))
))
(tags-todo "+crafting+resonance" (
(org-agenda-overriding-header "DESTINY Weapon Shaping")
(org-agenda-files (list "~/org/games_destiny.org"))
))
(tags-todo "+crafting+weaponupgrade" (
(org-agenda-overriding-header "DESTINY Weapon Upgrades")
(org-agenda-files (list "~/org/games_destiny.org"))
))
)
)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; helper for building agenda file lists
(defun load-org-agenda-files-recursively (dir) "Find all directories in DIR."
(unless (file-directory-p dir) (error "Not a directory `%s'" dir))
(unless (equal (directory-files dir nil org-agenda-file-regexp t) nil)
(add-to-list 'org-agenda-files dir)
)
(dolist (file (directory-files dir nil nil t))
(unless (member file '("." ".."))
(let ((file (concat dir file "/")))
(when (file-directory-p file)
(load-org-agenda-files-recursively file)
)
)
)
)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; org-agenda tuning (view stuff only)
(setq org-agenda-todo-ignore-scheduled 'all)
;; Remove completed deadline tasks from the agenda view
(setq org-agenda-skip-deadline-if-done t)
;; Remove completed scheduled tasks from the agenda view
(setq org-agenda-skip-scheduled-if-done t)
;; Remove completed items from search results
(setq org-agenda-skip-timestamp-if-done t)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Set some org agendas/dashboards
(setq org-agenda-sorting-strategy
'(
(agenda habit-down time-up scheduled-down priority-down category-keep)
(todo habit-up time-down scheduled-down deadline-down todo-state-down priority-down alpha-up)
(tags priority-down category-keep)
(search category-keep)
)
)
(setq org-agenda-files (list "~/org/_todo.org"
"~/org/_index.org"
"~/org/health/_health.org"
"~/org/health/health_houdini.org"
"~/org/health/health_mike.org"))
(load-org-agenda-files-recursively "~/org/reading")
(setq org-agenda-custom-commands
'(
("r" "Personal"
(
(agenda "" (
(org-agenda-overriding-header "Personal")
))
(todo "WIP" (
(org-agenda-overriding-header "WIP")
))
(todo "READY" (
(org-agenda-overriding-header "Ready")
))
(tags-todo "+PRIORITY<\"D\"-STYLE=\"habit\"-TODO=\"WIP\"-TODO=\"READY\"" (
(org-agenda-overriding-header "To Do")
))
(tags-todo "+PRIORITY>=\"D\"-STYLE=\"habit\"-TODO=\"WIP\"-TODO=\"READY\"" (
(org-agenda-overriding-header "Low Priority")
))
)
)
("d" "Destiny"
(
(agenda "" (
(org-agenda-start-on-weekday 2)
(org-agenda-overriding-header "Destiny")
(org-agenda-files (list "~/org/games_destiny.org"))
))
(todo "WIP" (
(org-agenda-overriding-header "WIP")
(org-agenda-files (list "~/org/games_destiny.org"))
))
(todo "READY" (
(org-agenda-overriding-header "Ready")
(org-agenda-files (list "~/org/games_destiny.org"))
))
(tags-todo "+resonance_needed>0-STYLE=\"habit\"-WIP-READY" (
(org-agenda-overriding-header "Weapon Shaping")
(org-agenda-files (list "~/org/games_destiny.org"))
))
(tags-todo "+resonance_needed<=0+level_at_all_perks_or_higher<>\"true\"-STYLE=\"habit\"-TODO=\"WIP\"-TODO=\"READY\"" (
(org-agenda-overriding-header "Weapon Leveling")
(org-agenda-files (list "~/org/games_destiny.org"))
))
(tags-todo "+resonance_needed<=0+level_at_all_perks_or_higher=\"true\"+masterworked<>\"true\"-STYLE=\"habit\"-TODO=\"WIP\"-TODO=\"READY\"" (
(org-agenda-overriding-header "Weapon Upgrades")
(org-agenda-files (list "~/org/games_destiny.org"))
))
)
)
("o" . "Photography")
)
)

View file

@ -97,12 +97,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; files
(setq org-default-notes-file "~/org/_index.org")
;; Collect all .org from my Org directory and subdirs
(setq org-agenda-file-regexp "\\`[^.].*\\.org\\'") ; default value
(setq org-agenda-file-regexp "\\`[^.].*\\.org\\'")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; agendas
(setq org-agenda-sticky t)
(load "~/.emacs.d.profiles/org/config-org-agendas.el")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;