summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/custom-buffer-file.el (renamed from modules/custom-file-buffer.el)6
-rw-r--r--modules/mail-config.el4
-rw-r--r--modules/org-agenda-config.el47
-rw-r--r--modules/org-gcal-config.el21
-rw-r--r--modules/org-roam-config.el1
-rw-r--r--modules/popper-config.el1
-rw-r--r--modules/prog-general.el8
-rw-r--r--modules/prog-lisp.el5
-rw-r--r--modules/selection-framework.el25
-rw-r--r--modules/system-commands.el138
-rw-r--r--modules/wip.el154
11 files changed, 205 insertions, 205 deletions
diff --git a/modules/custom-file-buffer.el b/modules/custom-buffer-file.el
index 08f974fd..9438e8ed 100644
--- a/modules/custom-file-buffer.el
+++ b/modules/custom-buffer-file.el
@@ -1,4 +1,4 @@
-;;; custom-file-buffer.el --- Custom Buffer and File Operations -*- coding: utf-8; lexical-binding: t; -*-
+;;; custom-buffer-file.el --- Custom Buffer and File Operations -*- coding: utf-8; lexical-binding: t; -*-
;;
;;; Commentary:
;; This module provides custom buffer and file operations including PostScript
@@ -256,5 +256,5 @@ Do not save the deleted text in the kill ring."
"C-; b P" "copy file path"))
-(provide 'custom-file-buffer)
-;;; custom-file-buffer.el ends here.
+(provide 'custom-buffer-file)
+;;; custom-buffer-file.el ends here.
diff --git a/modules/mail-config.el b/modules/mail-config.el
index 402c2589..1d5a14ea 100644
--- a/modules/mail-config.el
+++ b/modules/mail-config.el
@@ -283,9 +283,9 @@ Prompts user for the action when executing."
;; user composes org mode; recipient receives html
(use-package org-msg
- :ensure nil ;; loading locally for fixes
+ ;; :vc (:url "https://github.com/cjennings/org-msg" :rev :newest)
+ :load-path "/home/cjennings/code/org-msg"
:defer 1
- :load-path "~/code/org-msg/"
:after (org mu4e)
:preface
(defvar-keymap cj/email-map
diff --git a/modules/org-agenda-config.el b/modules/org-agenda-config.el
index 7b436424..211ff4fe 100644
--- a/modules/org-agenda-config.el
+++ b/modules/org-agenda-config.el
@@ -54,7 +54,7 @@
(window-height . fit-window-to-buffer)))
;; reset s-left/right each time org-agenda is enabled
- (add-hook 'org-agenda-mode-hook (lambda ()
+s (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)))
@@ -68,7 +68,6 @@
(defun cj/add-files-to-org-agenda-files-list (directory)
"Search for files named \\='todo.org\\=' add them to org-project-files.
-
DIRECTORY is a string of the path to begin the search."
(interactive "D")
(setq org-agenda-files
@@ -81,10 +80,9 @@ DIRECTORY is a string of the path to begin the search."
;; agenda targets is the schedule, contacts, project todos,
;; inbox, and org roam projects.
(defun cj/build-org-agenda-list ()
- "Rebuilds the org agenda list without checking org-roam for projects.
-
+ "Rebuilds the org agenda list.
Begins with the inbox-file, schedule-file, and contacts-file.
-Then adds all todo.org files from projects-dir and code-dir.
+Then adds all todo.org files from projects-dir.
Reports elapsed time in the messages buffer."
(interactive)
(let ((start-time (current-time)))
@@ -105,7 +103,6 @@ Reports elapsed time in the messages buffer."
(defun cj/todo-list-all-agenda-files ()
"Displays an \\='org-agenda\\=' todo list.
-
The contents of the agenda will be built from org-project-files and org-roam
files that have project in their filetag."
(interactive)
@@ -118,7 +115,6 @@ files that have project in their filetag."
(defun cj/todo-list-from-this-buffer ()
"Displays an \\='org-agenda\\=' todo list built from the current buffer.
-
If the current buffer isn't an org buffer, inform the user."
(interactive)
(if (eq major-mode 'org-mode)
@@ -153,7 +149,6 @@ If the current buffer isn't an org buffer, inform the user."
(defun cj/org-agenda-skip-subtree-if-not-overdue ()
"Skip an agenda subtree if it is not an overdue deadline or scheduled task.
-
An entry is considered overdue if it has a scheduled or deadline date strictly
before today, is not marked as done, and is not a habit."
(let* ((subtree-end (save-excursion (org-end-of-subtree t)))
@@ -176,7 +171,6 @@ before today, is not marked as done, and is not a habit."
(defun cj/org-skip-subtree-if-priority (priority)
"Skip an agenda subtree if it has a priority of PRIORITY.
-
PRIORITY may be one of the characters ?A, ?B, or ?C."
(let ((subtree-end (save-excursion (org-end-of-subtree t)))
(pri-value (* 1000 (- org-lowest-priority priority)))
@@ -187,7 +181,6 @@ PRIORITY may be one of the characters ?A, ?B, or ?C."
(defun cj/org-skip-subtree-if-keyword (keywords)
"Skip an agenda subtree if it has a TODO keyword in KEYWORDS.
-
KEYWORDS must be a list of strings."
(let ((subtree-end (save-excursion (org-end-of-subtree t))))
(if (member (org-get-todo-state) keywords)
@@ -224,12 +217,10 @@ KEYWORDS must be a list of strings."
(defun cj/main-agenda-display ()
"Display the main daily org-agenda view.
-
This uses all org-agenda targets and presents three sections:
- All unfinished priority A tasks
- Today's schedule, including habits with consistency graphs
- All priority B and C unscheduled/undeadlined tasks
-
The agenda is rebuilt from all sources before display, including:
- inbox-file and schedule-file
- Org-roam nodes tagged as \"Project\"
@@ -263,9 +254,11 @@ This allows a line to show in an agenda without being scheduled or a deadline."
;; Install CHIME from GitHub using use-package :vc (Emacs 29+)
(use-package chime
- :vc (:url "https://github.com/cjennings/chime.el" :rev :newest)
- :after (alert org-agenda)
:demand t
+ ;; :vc (:url "https://github.com/cjennings/chime.el" :rev :newest) ;; using latest on github
+ :after (alert org-agenda)
+ :ensure nil ;; using local version
+ :load-path "~/code/chime.el"
:bind
("C-c A" . chime-check)
:config
@@ -273,13 +266,29 @@ This allows a line to show in an agenda without being scheduled or a deadline."
;; This gives two notifications per event without any after-event notifications
(setq chime-alert-time '(5 0))
- ;; Modeline display: show upcoming events within 60 minutes
- (setq chime-modeline-lookahead 120)
+ ;; Modeline display: show upcoming events within 2 hours
+ (setq chime-enable-modeline t)
+ (setq chime-modeline-lookahead 180)
(setq chime-modeline-format " ⏰ %s")
- ;; Chime sound: plays when notifications appear
- (setq chime-play-sound t)
- ;; Uses bundled chime.wav by default
+ ;; Tooltip settings: show up to 20 upcoming events (regardless of how far in future)
+ ;; chime-modeline-tooltip-lookahead defaults to 525600 (1 year) - effectively unlimited
+ (setq chime-modeline-tooltip-max-events 20)
+
+ ;; Modeline content: show title and countdown only (omit event time)
+ (setq chime-notification-text-format "%t (%u)")
+
+ ;; Time-until format: compact style like " in 10m" or " in 1h 37m"
+ (setq chime-time-left-format-short " in %mm") ; Under 1 hour: " in 10m"
+ (setq chime-time-left-format-long " in %hh %mm") ; 1 hour+: " in 1h 37m"
+ (setq chime-time-left-format-at-event "right now")
+
+ ;; Title truncation: limit long event titles to 15 characters
+ ;; This affects only the title, not the icon or countdown
+ (setq chime-max-title-length 25) ; "Very Long Me... ( in 10m)"
+
+ ;; Chime sound: disabled
+ (setq chime-play-sound nil)
;; Notification settings
(setq chime-notification-title "Reminder")
diff --git a/modules/org-gcal-config.el b/modules/org-gcal-config.el
index cc7cab90..0c309a0e 100644
--- a/modules/org-gcal-config.el
+++ b/modules/org-gcal-config.el
@@ -105,16 +105,25 @@ enabling bidirectional sync so changes push back to Google Calendar."
(require 'plstore)
(setq plstore-cache-passphrase-for-symmetric-encryption t)
- ;; Enable debugging for HTTP requests
- (require 'request)
- (setq request-log-level 'debug)
- (setq request-message-level 'debug)
-
;; set org-gcal timezone based on system timezone
(setq org-gcal-local-timezone (cj/detect-system-timezone))
;; Reload client credentials (should already be loaded by org-gcal, but ensure it's set)
- (org-gcal-reload-client-id-secret))
+ (org-gcal-reload-client-id-secret)
+
+ ;; Auto-save gcal files after sync completes
+ (defun cj/org-gcal-save-files-after-sync (&rest _)
+ "Save all org-gcal files after sync completes."
+ (dolist (entry org-gcal-fetch-file-alist)
+ (let* ((file (cdr entry))
+ (buffer (get-file-buffer file)))
+ (when (and buffer (buffer-modified-p buffer))
+ (with-current-buffer buffer
+ (save-buffer)
+ (message "Saved %s after org-gcal sync" (file-name-nondirectory file)))))))
+
+ ;; Advise org-gcal--sync-unlock which is called when sync completes
+ (advice-add 'org-gcal--sync-unlock :after #'cj/org-gcal-save-files-after-sync))
;; Set up automatic initial sync on boot with error handling
;;(run-with-idle-timer
diff --git a/modules/org-roam-config.el b/modules/org-roam-config.el
index f78b68da..a6b42ce7 100644
--- a/modules/org-roam-config.el
+++ b/modules/org-roam-config.el
@@ -19,6 +19,7 @@
;; ---------------------------------- Org Roam ---------------------------------
(use-package org-roam
+ :defer 1
:commands (org-roam-node-find org-roam-node-insert org-roam-db-autosync-mode)
:config
;; Enable autosync mode after org-roam loads
diff --git a/modules/popper-config.el b/modules/popper-config.el
index b0f503e8..d9a9d9b0 100644
--- a/modules/popper-config.el
+++ b/modules/popper-config.el
@@ -26,6 +26,7 @@
'("\\*Messages\\*"
"Output\\*$"
"\\*Async Shell Command\\*"
+ "\\*Async-native-compile-log\\*"
help-mode
compilation-mode))
(add-to-list 'display-buffer-alist
diff --git a/modules/prog-general.el b/modules/prog-general.el
index 669922ef..d8d9627d 100644
--- a/modules/prog-general.el
+++ b/modules/prog-general.el
@@ -264,12 +264,8 @@ If no such file exists there, display a message."
("C-c s n" . yas-new-snippet)
("C-c s e" . yas-visit-snippet-file)
:config
- (setq yas-snippet-dirs '(snippets-dir)))
-
-(use-package ivy-yasnippet
- :after yasnippet
- :bind
- ("C-c s i" . ivy-yasnippet))
+ (setq yas-snippet-dirs (list snippets-dir))
+ (yas-reload-all))
;; --------------------- Display Color On Color Declaration --------------------
;; display the actual color as highlight to color hex code
diff --git a/modules/prog-lisp.el b/modules/prog-lisp.el
index 7693c253..cfa015ae 100644
--- a/modules/prog-lisp.el
+++ b/modules/prog-lisp.el
@@ -97,9 +97,12 @@
:commands (with-mock mocklet mocklet-function)) ;; mock/stub framework
;; --------------------------------- Elisp Lint --------------------------------
+;; Comprehensive linting for Emacs Lisp code (indentation, whitespace, etc.)
+;; Used by chime.el 'make lint' target for code quality checks
(use-package elisp-lint
- :commands (elisp-lint-file elisp-lint-directory))
+ :ensure t
+ :commands (elisp-lint-file elisp-lint-directory elisp-lint-files-batch))
;; ------------------------------ Package Tooling ------------------------------
diff --git a/modules/selection-framework.el b/modules/selection-framework.el
index 0bc71f64..a89afc02 100644
--- a/modules/selection-framework.el
+++ b/modules/selection-framework.el
@@ -27,7 +27,6 @@
(vertico-resize nil) ; Don't resize the minibuffer
(vertico-sort-function #'vertico-sort-history-alpha) ; History first, then alphabetical
:bind (:map vertico-map
- ;; Match ivy's C-j C-k behavior
("C-j" . vertico-next)
("C-k" . vertico-previous)
("C-l" . vertico-insert) ; Insert current candidate
@@ -128,7 +127,7 @@
;; Use Consult for completion-at-point
(setq completion-in-region-function #'consult-completion-in-region))
-(global-unset-key (kbd "C-s"))
+;; Override default search with consult-line
(keymap-global-set "C-s" #'consult-line)
;; Consult integration with Embark
@@ -152,10 +151,10 @@
(use-package orderless
:demand t
:custom
- (completion-styles '(orderless))
+ (completion-styles '(orderless basic))
(completion-category-defaults nil)
- (completion-category-overrides '((file (styles partial-completion))
- (multi-category (styles orderless))))
+ (completion-category-overrides '((file (styles partial-completion orderless basic))
+ (multi-category (styles orderless basic))))
(orderless-matching-styles '(orderless-literal
orderless-regexp
orderless-initialism
@@ -183,16 +182,10 @@
nil
(window-parameters (mode-line-format . none)))))
-;; this typo causes crashes
-;; (add-to-list 'display-buffer-alist
-;; '("\\=\\*Embark Collect \\(Live\\|Completions\\)\\*"
-;; nil
-;; (window-parameters (mode-line-format . none)))))
-
;; --------------------------- Consult Integration ----------------------------
;; Additional integrations for specific features
-;; Yasnippet integration - replaces ivy-yasnippet
+;; Yasnippet integration
(use-package consult-yasnippet
:after yasnippet
:bind ("C-c s i" . consult-yasnippet))
@@ -204,7 +197,7 @@
("C-c ! c" . consult-flycheck)))
;; ---------------------------------- Company ----------------------------------
-;; In-buffer completion (retained from original configuration)
+;; In-buffer completion for text and code
(use-package company
:demand t
@@ -261,7 +254,11 @@
;; which-key labels
(with-eval-after-load 'which-key
- (which-key-add-key-based-replacements "C-c h" "consult history"))
+ (which-key-add-key-based-replacements
+ "C-c h" "consult history"
+ "C-c s i" "insert snippet"
+ "M-g" "goto menu"
+ "M-s" "search menu"))
(provide 'selection-framework)
;;; selection-framework.el ends here
diff --git a/modules/system-commands.el b/modules/system-commands.el
new file mode 100644
index 00000000..fb8c0611
--- /dev/null
+++ b/modules/system-commands.el
@@ -0,0 +1,138 @@
+;;; system-commands.el --- System power and session management -*- lexical-binding: t; coding: utf-8; -*-
+;; author: Craig Jennings <c@cjennings.net>
+;;
+;;; Commentary:
+;;
+;; System commands for logout, lock, suspend, shutdown, reboot, and Emacs
+;; exit/restart. Provides both a keymap (C-; !) and a completing-read menu.
+;;
+;; Commands include:
+;; - Logout (terminate user session)
+;; - Lock screen (slock)
+;; - Suspend (systemctl suspend)
+;; - Shutdown (systemctl poweroff)
+;; - Reboot (systemctl reboot)
+;; - Exit Emacs (kill-emacs)
+;; - Restart Emacs (via systemctl --user restart emacs.service)
+;;
+;; Dangerous commands (logout, suspend, shutdown, reboot) require confirmation.
+;;
+;;; Code:
+
+(eval-when-compile (require 'keybindings))
+(eval-when-compile (require 'subr-x))
+(require 'rx)
+
+;; ------------------------------ System Commands ------------------------------
+
+(defun cj/system-cmd--resolve (cmd)
+ "Return (values symbol-or-nil command-string label) for CMD."
+ (cond
+ ((symbolp cmd)
+ (let ((val (and (boundp cmd) (symbol-value cmd))))
+ (unless (and (stringp val) (not (string-empty-p val)))
+ (user-error "Variable %s is not a non-empty string" cmd))
+ (list cmd val (symbol-name cmd))))
+ ((stringp cmd)
+ (let ((s (string-trim cmd)))
+ (when (string-empty-p s) (user-error "Command string is empty"))
+ (list nil s "command")))
+ (t (user-error "Error: cj/system-cmd expects a string or a symbol"))))
+
+(defun cj/system-cmd (cmd)
+ "Run CMD (string or symbol naming a string) detached via the shell.
+Shell expansions like $(...) are supported. Output is silenced.
+If CMD is deemed dangerous, ask for confirmation."
+ (interactive (list (read-shell-command "System command: ")))
+ (pcase-let ((`(,sym ,cmdstr ,label) (cj/system-cmd--resolve cmd)))
+ (when (and sym (get sym 'cj/system-confirm)
+ (memq (read-char-choice
+ (format "Run %s now (%s)? (Y/n) " label cmdstr)
+ '(?y ?Y ?n ?N ?\r ?\n ?\s))
+ '(?n ?N)))
+ (user-error "Aborted"))
+ (let ((proc (start-process-shell-command "cj/system-cmd" nil
+ (format "nohup %s >/dev/null 2>&1 &" cmdstr))))
+ (set-process-query-on-exit-flag proc nil)
+ (set-process-sentinel proc #'ignore)
+ (message "Running %s..." label))))
+
+(defmacro cj/defsystem-command (name var cmdstr &optional confirm)
+ "Define VAR with CMDSTR and interactive command NAME to run it.
+If CONFIRM is non-nil, mark VAR to always require confirmation."
+ (declare (indent defun))
+ `(progn
+ (defvar ,var ,cmdstr)
+ ,(when confirm `(put ',var 'cj/system-confirm t))
+ (defun ,name ()
+ ,(format "Run %s via `cj/system-cmd'." var)
+ (interactive)
+ (cj/system-cmd ',var))))
+
+;; Define system commands
+(cj/defsystem-command cj/system-cmd-logout logout-cmd "loginctl terminate-user $(whoami)" t)
+(cj/defsystem-command cj/system-cmd-lock lockscreen-cmd "slock")
+(cj/defsystem-command cj/system-cmd-suspend suspend-cmd "systemctl suspend" t)
+(cj/defsystem-command cj/system-cmd-shutdown shutdown-cmd "systemctl poweroff" t)
+(cj/defsystem-command cj/system-cmd-reboot reboot-cmd "systemctl reboot" t)
+
+(defun cj/system-cmd-exit-emacs ()
+ "Exit Emacs server and all clients."
+ (interactive)
+ (when (memq (read-char-choice
+ "Exit Emacs? (Y/n) "
+ '(?y ?Y ?n ?N ?\r ?\n ?\s))
+ '(?n ?N))
+ (user-error "Aborted"))
+ (kill-emacs))
+
+(defun cj/system-cmd-restart-emacs ()
+ "Restart Emacs server after saving buffers."
+ (interactive)
+ (when (memq (read-char-choice
+ "Restart Emacs? (Y/n) "
+ '(?y ?Y ?n ?N ?\r ?\n ?\s))
+ '(?n ?N))
+ (user-error "Aborted"))
+ (save-some-buffers)
+ ;; Start the restart process before killing Emacs
+ (run-at-time 0.5 nil
+ (lambda ()
+ (call-process-shell-command
+ "systemctl --user restart emacs.service && emacsclient -c"
+ nil 0)))
+ (run-at-time 1 nil #'kill-emacs)
+ (message "Restarting Emacs..."))
+
+(defvar-keymap cj/system-command-map
+ :doc "Keymap for system commands."
+ "L" #'cj/system-cmd-logout
+ "r" #'cj/system-cmd-reboot
+ "s" #'cj/system-cmd-shutdown
+ "S" #'cj/system-cmd-suspend
+ "l" #'cj/system-cmd-lock
+ "E" #'cj/system-cmd-exit-emacs
+ "e" #'cj/system-cmd-restart-emacs)
+(keymap-set cj/custom-keymap "!" cj/system-command-map)
+
+(defun cj/system-command-menu ()
+ "Present system commands via \='completing-read\='."
+ (interactive)
+ (let* ((commands '(("Logout System" . cj/system-cmd-logout)
+ ("Lock Screen" . cj/system-cmd-lock)
+ ("Suspend System" . cj/system-cmd-suspend)
+ ("Shutdown System" . cj/system-cmd-shutdown)
+ ("Reboot System" . cj/system-cmd-reboot)
+ ("Exit Emacs" . cj/system-cmd-exit-emacs)
+ ("Restart Emacs" . cj/system-cmd-restart-emacs)))
+ (choice (completing-read "System command: " commands nil t)))
+ (when-let ((cmd (alist-get choice commands nil nil #'equal)))
+ (call-interactively cmd))))
+
+(keymap-set cj/custom-keymap "!" #'cj/system-command-menu)
+
+(with-eval-after-load 'which-key
+ (which-key-add-key-based-replacements "C-; !" "system commands"))
+
+(provide 'system-commands)
+;;; system-commands.el ends here
diff --git a/modules/wip.el b/modules/wip.el
index db94cdb1..93c799fb 100644
--- a/modules/wip.el
+++ b/modules/wip.el
@@ -14,135 +14,6 @@
;;
;;; Code:
-(eval-when-compile (require 'user-constants))
-(eval-when-compile (require 'keybindings))
-(eval-when-compile (require 'subr-x)) ;; for system commands
-(require 'rx) ;; for system commands
-
-;; ------------------------------ System Commands ------------------------------
-
-(defun cj/system-cmd--resolve (cmd)
- "Return (values symbol-or-nil command-string label) for CMD."
- (cond
- ((symbolp cmd)
- (let ((val (and (boundp cmd) (symbol-value cmd))))
- (unless (and (stringp val) (not (string-empty-p val)))
- (user-error "Variable %s is not a non-empty string" cmd))
- (list cmd val (symbol-name cmd))))
- ((stringp cmd)
- (let ((s (string-trim cmd)))
- (when (string-empty-p s) (user-error "Command string is empty"))
- (list nil s "command")))
- (t (user-error "Error: cj/system-cmd expects a string or a symbol"))))
-
-(defun cj/system-cmd (cmd)
- "Run CMD (string or symbol naming a string) detached via the shell.
-Shell expansions like $(...) are supported. Output is silenced.
-If CMD is deemed dangerous, ask for confirmation."
- (interactive (list (read-shell-command "System command: ")))
- (pcase-let ((`(,sym ,cmdstr ,label) (cj/system-cmd--resolve cmd)))
- (when (and sym (get sym 'cj/system-confirm)
- (memq (read-char-choice
- (format "Run %s now (%s)? (Y/n) " label camdstr)
- '(?y ?Y ?n ?N ?\r ?\n ?\s))
- '(?n ?N)))
- (user-error "Aborted"))
- (let ((proc (start-process-shell-command "cj/system-cmd" nil
- (format "nohup %s >/dev/null 2>&1 &" cmdstr))))
- (set-process-query-on-exit-flag proc nil)
- (set-process-sentinel proc #'ignore)
- (message "Running %s..." label))))
-
-(defmacro cj/defsystem-command (name var cmdstr &optional confirm)
- "Define VAR with CMDSTR and interactive command NAME to run it.
-If CONFIRM is non-nil, mark VAR to always require confirmation."
- (declare (indent defun))
- `(progn
- (defvar ,var ,cmdstr)
- ,(when confirm `(put ',var 'cj/system-confirm t))
- (defun ,name ()
- ,(format "Run %s via `cj/system-cmd'." var)
- (interactive)
- (cj/system-cmd ',var))))
-
-;; Define system commands
-(cj/defsystem-command cj/system-cmd-logout logout-cmd "loginctl terminate-user $(whoami)" t)
-(cj/defsystem-command cj/system-cmd-lock lockscreen-cmd "slock")
-(cj/defsystem-command cj/system-cmd-suspend suspend-cmd "systemctl suspend" t)
-(cj/defsystem-command cj/system-cmd-shutdown shutdown-cmd "systemctl poweroff" t)
-(cj/defsystem-command cj/system-cmd-reboot reboot-cmd "systemctl reboot" t)
-
-(defun cj/system-cmd-exit-emacs ()
- "Exit Emacs server and all clients."
- (interactive)
- (when (memq (read-char-choice
- "Exit Emacs? (Y/n) "
- '(?y ?Y ?n ?N ?\r ?\n ?\s))
- '(?n ?N))
- (user-error "Aborted"))
- (kill-emacs))
-
-(defun cj/system-cmd-restart-emacs ()
- "Restart Emacs server after saving buffers."
- (interactive)
- (when (memq (read-char-choice
- "Restart Emacs? (Y/n) "
- '(?y ?Y ?n ?N ?\r ?\n ?\s))
- '(?n ?N))
- (user-error "Aborted"))
- (save-some-buffers)
- ;; Start the restart process before killing Emacs
- (run-at-time 0.5 nil
- (lambda ()
- (call-process-shell-command
- "systemctl --user restart emacs.service && emacsclient -c"
- nil 0)))
- (run-at-time 1 nil #'kill-emacs)
- (message "Restarting Emacs..."))
-
-;; (defvar-keymap cj/system-command-map
-;; :doc "Keymap for system commands."
-;; "L" #'cj/system-cmd-logout
-;; "r" #'cj/system-cmd-reboot
-;; "s" #'cj/system-cmd-shutdown
-;; "S" #'cj/system-cmd-suspend
-;; "l" #'cj/system-cmd-lock
-;; "E" #'cj/system-cmd-exit-emacs
-;; "e" #'cj/system-cmd-restart-emacs)
-;; (keymap-set cj/custom-keymap "!" cj/system-command-map)
-
-(defun cj/system-command-menu ()
- "Present system commands via \='completing-read\='."
- (interactive)
- (let* ((commands '(("Logout System" . cj/system-cmd-logout)
- ("Lock Screen" . cj/system-cmd-lock)
- ("Suspend System" . cj/system-cmd-suspend)
- ("Shutdown System" . cj/system-cmd-shutdown)
- ("Reboot System" . cj/system-cmd-reboot)
- ("Exit Emacs" . cj/system-cmd-exit-emacs)
- ("Restart Emacs" . cj/system-cmd-restart-emacs)))
- (choice (completing-read "System command: " commands nil t)))
- (when-let ((cmd (alist-get choice commands nil nil #'equal)))
- (call-interactively cmd))))
-
-(keymap-set cj/custom-keymap "!" #'cj/system-command-menu)
-
-(with-eval-after-load 'which-key
- (which-key-add-key-based-replacements "C-; !" "system commands"))
-
-;; --------------------------- Org Upcoming Modeline ---------------------------
-
-;; (use-package org-upcoming-modeline
-;; :after org
-;; :load-path "~/code/org-upcoming-modeline/org-upcoming-modeline.el"
-;; :config
-;; (setq org-upcoming-modeline-keep-late 300)
-;; (setq org-upcoming-modeline-ignored-keywords '("DONE" "CANCELLED" "FAILED"))
-;; (setq org-upcoming-modeline-trim 30)
-;; (setq org-upcoming-modeline-days-ahead 5)
-;; (setq org-upcoming-modeline-format (lambda (ms mh) (format "📅 %s %s" ms mh)))
-;; (org-upcoming-modeline-mode))
-
;; ----------------------------------- Efrit -----------------------------------
;; not working as of Wednesday, September 03, 2025 at 12:44:09 AM CDT
@@ -185,30 +56,5 @@ If CONFIRM is non-nil, mark VAR to always require confirmation."
:bind ("M-p" . pomm)
:commands (pomm pomm-third-time))
-;; ----------------------------------- Popper ----------------------------------
-
-;; (use-package popper
-;; :bind (("C-`" . popper-toggle)
-;; ("M-`" . popper-cycle)
-;; ("C-M-`" . popper-toggle-type))
-;; :custom
-;; (popper-display-control-nil)
-;; :init
-;; (setq popper-reference-buffers
-;; '("\\*Messages\\*"
-;; "Output\\*$"
-;; "\\*Async Shell Command\\*"
-;; ;; "\\*scratch\\*"
-;; help-mode
-;; compilation-mode))
-;; (add-to-list 'display-buffer-alist
-;; '(popper-display-control-p ; Predicate to match popper buffers
-;; (display-buffer-in-side-window)
-;; (side . bottom)
-;; (slot . 0)
-;; (window-height . 0.5))) ; Half the frame height
-;; (popper-mode +1)
-;; (popper-echo-mode +1))
-
(provide 'wip)
;;; wip.el ends here.