2023-04-08 16:53:12 +00:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; various workspaces used day to day
|
|
|
|
|
2023-04-08 17:27:42 +00:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; load most recent auto save
|
|
|
|
(defun kmn/workspace-load-auto ()
|
|
|
|
(interactive)
|
|
|
|
(persp-load-state-from-file "persp-auto-save")
|
2023-04-10 19:22:13 +00:00
|
|
|
(persistent-scratch-restore)
|
2023-04-08 17:27:42 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; save the current workspace to `latest` filename
|
|
|
|
(defun kmn/workspace-save-latest ()
|
|
|
|
(interactive)
|
|
|
|
(persp-save-state-to-file "latest")
|
2023-04-10 19:22:13 +00:00
|
|
|
(persistent-scratch-save-to-file
|
|
|
|
(expand-file-name ".persistent-scratch-latest" user-emacs-directory))
|
2023-04-08 17:27:42 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; load `latest` file name to current workspace
|
|
|
|
(defun kmn/workspace-load-latest ()
|
|
|
|
(interactive)
|
|
|
|
(persp-load-state-from-file "latest")
|
2023-04-10 19:22:13 +00:00
|
|
|
(persistent-scratch-restore-from-file
|
|
|
|
(expand-file-name ".persistent-scratch-latest" user-emacs-directory))
|
2023-04-08 17:27:42 +00:00
|
|
|
)
|
2023-04-08 16:53:12 +00:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; org-mode workspace
|
2023-04-11 15:35:56 +00:00
|
|
|
(when (not kmn/is-dayjob)
|
2023-04-08 16:53:12 +00:00
|
|
|
(defun kmn/workspace-org ()
|
|
|
|
(interactive)
|
|
|
|
; start with fresh frame
|
|
|
|
(delete-other-windows)
|
2023-04-08 19:02:06 +00:00
|
|
|
(kmn/kill-other-buffers)
|
2023-04-11 13:28:16 +00:00
|
|
|
(ignore-errors (kill-buffer "*scratch*"))
|
2023-04-08 19:02:06 +00:00
|
|
|
; front load org-agenda so it doesnt reshuffle the frame layout on us
|
|
|
|
(org-agenda nil "r")
|
|
|
|
(split-window-below)
|
|
|
|
(next-multiframe-window)
|
2023-04-08 16:53:12 +00:00
|
|
|
; show kmn's slipbox
|
|
|
|
(find-file "~/org/orgzly/_slipbox.org")
|
|
|
|
; split window for additional file to show
|
|
|
|
(split-window-below)
|
|
|
|
(next-multiframe-window)
|
|
|
|
; show kmn health notes/data tracker
|
|
|
|
(find-file "~/org/health/health_mike.org")
|
2023-04-08 19:02:06 +00:00
|
|
|
; switch to top of agenda window so most useful window is focused
|
2023-04-08 17:27:42 +00:00
|
|
|
(next-multiframe-window)
|
|
|
|
(goto-char 0)
|
|
|
|
)
|
2023-04-11 15:35:56 +00:00
|
|
|
)
|
2023-04-08 19:22:25 +00:00
|
|
|
|
2023-04-11 16:08:54 +00:00
|
|
|
(when kmn/is-dayjob
|
|
|
|
(defun kmn/workspace-org ()
|
|
|
|
(interactive)
|
|
|
|
; start with fresh frame
|
|
|
|
(delete-other-windows)
|
|
|
|
(kmn/kill-other-buffers)
|
|
|
|
(ignore-errors (kill-buffer "*scratch*"))
|
|
|
|
; front load org-agenda so it doesnt reshuffle the frame layout on us
|
|
|
|
(org-agenda nil "r")
|
|
|
|
(split-window-below)
|
|
|
|
(next-multiframe-window)
|
|
|
|
; show slipbox
|
2023-04-11 16:39:15 +00:00
|
|
|
(find-file "~/org/_slipbox.org")
|
2023-04-11 16:08:54 +00:00
|
|
|
; split window for additional file to show
|
|
|
|
(split-window-below)
|
|
|
|
(next-multiframe-window)
|
|
|
|
(find-file "~/org/_habits.org")
|
|
|
|
(find-file "~/org/_todo.org")
|
|
|
|
(find-file "~/org/_index.org")
|
|
|
|
; switch to top of agenda window so most useful window is focused
|
|
|
|
(next-multiframe-window)
|
|
|
|
(goto-char 0)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2023-04-08 19:22:25 +00:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; org-mode workspace for termux devices (mobile / android)
|
2023-04-11 15:35:56 +00:00
|
|
|
(when (not kmn/is-dayjob)
|
2023-04-08 19:22:25 +00:00
|
|
|
(defun kmn/workspace-org-single-window ()
|
|
|
|
(interactive)
|
|
|
|
; start with fresh frame
|
|
|
|
(delete-other-windows)
|
|
|
|
(kmn/kill-other-buffers)
|
2023-04-11 13:28:16 +00:00
|
|
|
(ignore-errors (kill-buffer "*scratch*"))
|
2023-04-08 19:22:25 +00:00
|
|
|
; Open main files used as 'gateway' to everything else
|
|
|
|
(find-file "~/org/health/health_houdini.org")
|
|
|
|
(find-file "~/org/health/health_mike.org")
|
|
|
|
(find-file "~/org/orgzly/_habits.org")
|
|
|
|
(find-file "~/org/orgzly/_todo.org")
|
|
|
|
(find-file "~/org/orgzly/_slipbox.org")
|
|
|
|
(find-file "~/org/_index.org")
|
|
|
|
; Personal startup screen - orgmode agenda with all TODO
|
|
|
|
(org-agenda nil "r")
|
|
|
|
; start at the top of the agenda
|
|
|
|
(goto-char 0)
|
|
|
|
)
|
2023-04-11 15:35:56 +00:00
|
|
|
)
|
2023-04-08 17:27:42 +00:00
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; empty code workspace
|
2023-04-08 18:52:14 +00:00
|
|
|
(defun kmn/workspace-code-empty (&optional dir_path)
|
2023-04-08 17:27:42 +00:00
|
|
|
(interactive)
|
|
|
|
(delete-other-windows)
|
2023-04-08 18:52:14 +00:00
|
|
|
(kmn/kill-other-buffers)
|
2023-04-11 13:28:16 +00:00
|
|
|
(ignore-errors (kill-buffer "*scratch*"))
|
2023-04-10 19:22:13 +00:00
|
|
|
(scratch 'text-mode)
|
2023-04-08 17:27:42 +00:00
|
|
|
; show dired at `~` in left side window
|
2023-04-08 18:52:14 +00:00
|
|
|
(kmn/dired-directory-on-left dir_path)
|
|
|
|
)
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; emacs config development
|
|
|
|
(defun kmn/workspace-code-emacs-config()
|
|
|
|
(interactive)
|
|
|
|
(kmn/workspace-code-empty "~/.emacs.d.profiles")
|
|
|
|
(find-file "~/.emacs.d.profiles/org/init.el")
|
|
|
|
(find-file "~/.emacs.d.profiles/code/init.el")
|
|
|
|
(find-file "~/.emacs.d.profiles/common/_global.el")
|
|
|
|
(find-file "~/.emacs.d.profiles/common/generic_functions.el")
|
|
|
|
(find-file "~/.emacs.d.profiles/common/workspaces.el")
|
|
|
|
)
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; hugo development
|
|
|
|
(defun kmn/workspace-code-generic()
|
|
|
|
(interactive)
|
|
|
|
(kmn/workspace-code-empty "~/src")
|
2023-04-08 16:53:12 +00:00
|
|
|
)
|
2023-04-11 19:44:25 +00:00
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; scratch buffers frame - use 'scratch and prompts to manage as needed
|
|
|
|
(defun kmn/workspace-frame-scratch()
|
|
|
|
(interactive)
|
|
|
|
(let ((frame (make-frame)))
|
|
|
|
(select-frame-set-input-focus frame)
|
|
|
|
(delete-other-windows)
|
2023-04-12 19:18:53 +00:00
|
|
|
(scratch 'text-mode)
|
2023-04-11 19:44:25 +00:00
|
|
|
)
|
|
|
|
)
|
2023-04-12 22:18:53 +00:00
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; scratch buffers frame, prompt for initial mode - use 'scratch and prompts to manage as needed
|
|
|
|
(defun kmn/workspace-frame-scratch-prompt()
|
|
|
|
(interactive)
|
|
|
|
(let ((frame (make-frame)))
|
|
|
|
(select-frame-set-input-focus frame)
|
|
|
|
(delete-other-windows)
|
|
|
|
(scratch (let ((current-prefix-arg t)) (scratch--buffer-querymode)))
|
|
|
|
)
|
|
|
|
)
|