diff options
| author | Craig Jennings <c@cjennings.net> | 2025-10-27 21:05:06 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2025-10-27 21:05:06 -0500 |
| commit | d77ca19cf7106a0eecbff1588c13b8b52b98b85f (patch) | |
| tree | eea65ea265d4a11a9c4888357f09f5b471737a45 | |
| parent | a8a6bb0b6a49ba83903c84ad0790585c6e40f2b8 (diff) | |
refactor: Rename custom-file-buffer to custom-buffer-file
Renamed the module 'custom-file-buffer' to 'custom-buffer-file' to
ensure consistency across the codebase. This change affects module
imports and test files. Additionally, new module
'system-commands.el' has been created to handle system power and
session management commands, removing these functionalities from
'wip.el'.
| -rw-r--r-- | init.el | 7 | ||||
| -rw-r--r-- | modules/custom-buffer-file.el (renamed from modules/custom-file-buffer.el) | 6 | ||||
| -rw-r--r-- | modules/system-commands.el | 138 | ||||
| -rw-r--r-- | modules/wip.el | 154 | ||||
| -rw-r--r-- | tests/test-custom-buffer-file-clear-to-bottom-of-buffer.el (renamed from tests/test-custom-file-buffer-clear-to-bottom-of-buffer.el) | 10 | ||||
| -rw-r--r-- | tests/test-custom-buffer-file-clear-to-top-of-buffer.el (renamed from tests/test-custom-file-buffer-clear-to-top-of-buffer.el) | 10 | ||||
| -rw-r--r-- | tests/test-custom-buffer-file-copy-link-to-buffer-file.el (renamed from tests/test-custom-file-buffer-copy-link-to-buffer-file.el) | 10 | ||||
| -rw-r--r-- | tests/test-custom-buffer-file-copy-path-to-buffer-file-as-kill.el (renamed from tests/test-custom-file-buffer-copy-path-to-buffer-file-as-kill.el) | 10 | ||||
| -rw-r--r-- | tests/test-custom-buffer-file-copy-whole-buffer.el (renamed from tests/test-custom-file-buffer-copy-whole-buffer.el) | 10 | ||||
| -rw-r--r-- | tests/test-custom-buffer-file-delete-buffer-and-file.el (renamed from tests/test-custom-file-buffer-delete-buffer-and-file.el) | 10 | ||||
| -rw-r--r-- | tests/test-custom-buffer-file-move-buffer-and-file.el (renamed from tests/test-custom-file-buffer-move-buffer-and-file.el) | 10 | ||||
| -rw-r--r-- | tests/test-custom-buffer-file-rename-buffer-and-file.el (renamed from tests/test-custom-file-buffer-rename-buffer-and-file.el) | 10 |
12 files changed, 185 insertions, 200 deletions
@@ -29,7 +29,7 @@ (require 'custom-case) ;; operations for upper/lower/title case (require 'custom-comments) ;; operations with comments (require 'custom-datetime) ;; date/timestamp insertion in various formats -(require 'custom-file-buffer) ;; custom buffer and file operations and keymap +(require 'custom-buffer-file) ;; custom buffer and file operations and keymap (require 'custom-line-paragraph) ;; operations on lines and paragraphs (require 'custom-misc) ;; miscellaneous functions (require 'custom-ordering) ;; ordering and sorting operations @@ -110,7 +110,7 @@ (require 'org-contacts-config) ;; fully integrated org-mode contacts management (require 'org-drill-config) (require 'org-export-config) -(require 'org-gcal-config) +(require 'org-gcal-config) ;; bi directional sync google calendar for org-agenda (require 'org-refile-config) ;; refile org-branches (require 'org-roam-config) ;; personal knowledge management in org mode (require 'org-webclipper) ;; "instapaper" to org-roam workflow @@ -134,7 +134,7 @@ ;; ------------------------- Personal Workflow Related ------------------------- (require 'reconcile-open-repos) -(require 'local-repository) +(require 'local-repository) ;; local repository for easy config portability ;; ------------------------------- Entertainment ------------------------------- @@ -146,6 +146,7 @@ ;;(require 'wip) (require 'lorem-optimum) (require 'jumper) +(require 'system-commands) ;; ---------------------------------- Wrap Up ---------------------------------- 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/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. diff --git a/tests/test-custom-file-buffer-clear-to-bottom-of-buffer.el b/tests/test-custom-buffer-file-clear-to-bottom-of-buffer.el index 969f9bb7..bd309880 100644 --- a/tests/test-custom-file-buffer-clear-to-bottom-of-buffer.el +++ b/tests/test-custom-buffer-file-clear-to-bottom-of-buffer.el @@ -1,7 +1,7 @@ -;;; test-custom-file-buffer-clear-to-bottom-of-buffer.el --- Tests for cj/clear-to-bottom-of-buffer -*- lexical-binding: t; -*- +;;; test-custom-buffer-file-clear-to-bottom-of-buffer.el --- Tests for cj/clear-to-bottom-of-buffer -*- lexical-binding: t; -*- ;;; Commentary: -;; Tests for the cj/clear-to-bottom-of-buffer function from custom-file-buffer.el +;; Tests for the cj/clear-to-bottom-of-buffer function from custom-buffer-file.el ;; ;; This function deletes all text from point to the end of the current buffer. ;; It does not save the deleted text in the kill ring. @@ -22,7 +22,7 @@ (provide 'ps-print) ;; Now load the actual production module -(require 'custom-file-buffer) +(require 'custom-buffer-file) ;;; Setup and Teardown @@ -159,5 +159,5 @@ (should-error (cj/clear-to-bottom-of-buffer))) (test-clear-to-bottom-teardown))) -(provide 'test-custom-file-buffer-clear-to-bottom-of-buffer) -;;; test-custom-file-buffer-clear-to-bottom-of-buffer.el ends here +(provide 'test-custom-buffer-file-clear-to-bottom-of-buffer) +;;; test-custom-buffer-file-clear-to-bottom-of-buffer.el ends here diff --git a/tests/test-custom-file-buffer-clear-to-top-of-buffer.el b/tests/test-custom-buffer-file-clear-to-top-of-buffer.el index 18e3f71b..2bf79b27 100644 --- a/tests/test-custom-file-buffer-clear-to-top-of-buffer.el +++ b/tests/test-custom-buffer-file-clear-to-top-of-buffer.el @@ -1,7 +1,7 @@ -;;; test-custom-file-buffer-clear-to-top-of-buffer.el --- Tests for cj/clear-to-top-of-buffer -*- lexical-binding: t; -*- +;;; test-custom-buffer-file-clear-to-top-of-buffer.el --- Tests for cj/clear-to-top-of-buffer -*- lexical-binding: t; -*- ;;; Commentary: -;; Tests for the cj/clear-to-top-of-buffer function from custom-file-buffer.el +;; Tests for the cj/clear-to-top-of-buffer function from custom-buffer-file.el ;; ;; This function deletes all text from point to the beginning of the current buffer. ;; It does not save the deleted text in the kill ring. @@ -22,7 +22,7 @@ (provide 'ps-print) ;; Now load the actual production module -(require 'custom-file-buffer) +(require 'custom-buffer-file) ;;; Setup and Teardown @@ -158,5 +158,5 @@ (should-error (cj/clear-to-top-of-buffer))) (test-clear-to-top-teardown))) -(provide 'test-custom-file-buffer-clear-to-top-of-buffer) -;;; test-custom-file-buffer-clear-to-top-of-buffer.el ends here +(provide 'test-custom-buffer-file-clear-to-top-of-buffer) +;;; test-custom-buffer-file-clear-to-top-of-buffer.el ends here diff --git a/tests/test-custom-file-buffer-copy-link-to-buffer-file.el b/tests/test-custom-buffer-file-copy-link-to-buffer-file.el index 94d1e01e..262968d6 100644 --- a/tests/test-custom-file-buffer-copy-link-to-buffer-file.el +++ b/tests/test-custom-buffer-file-copy-link-to-buffer-file.el @@ -1,7 +1,7 @@ -;;; test-custom-file-buffer-copy-link-to-buffer-file.el --- Tests for cj/copy-link-to-buffer-file -*- lexical-binding: t; -*- +;;; test-custom-buffer-file-copy-link-to-buffer-file.el --- Tests for cj/copy-link-to-buffer-file -*- lexical-binding: t; -*- ;;; Commentary: -;; Tests for the cj/copy-link-to-buffer-file function from custom-file-buffer.el +;; Tests for the cj/copy-link-to-buffer-file function from custom-buffer-file.el ;; ;; This function copies the full file:// path of the current buffer's file to ;; the kill ring. For non-file buffers, it does nothing (no error). @@ -22,7 +22,7 @@ (provide 'ps-print) ;; Now load the actual production module -(require 'custom-file-buffer) +(require 'custom-buffer-file) ;;; Setup and Teardown @@ -205,5 +205,5 @@ (should (null kill-ring)))) (test-copy-link-teardown))) -(provide 'test-custom-file-buffer-copy-link-to-buffer-file) -;;; test-custom-file-buffer-copy-link-to-buffer-file.el ends here +(provide 'test-custom-buffer-file-copy-link-to-buffer-file) +;;; test-custom-buffer-file-copy-link-to-buffer-file.el ends here diff --git a/tests/test-custom-file-buffer-copy-path-to-buffer-file-as-kill.el b/tests/test-custom-buffer-file-copy-path-to-buffer-file-as-kill.el index e7a6f64b..08959a85 100644 --- a/tests/test-custom-file-buffer-copy-path-to-buffer-file-as-kill.el +++ b/tests/test-custom-buffer-file-copy-path-to-buffer-file-as-kill.el @@ -1,7 +1,7 @@ -;;; test-custom-file-buffer-copy-path-to-buffer-file-as-kill.el --- Tests for cj/copy-path-to-buffer-file-as-kill -*- lexical-binding: t; -*- +;;; test-custom-buffer-file-copy-path-to-buffer-file-as-kill.el --- Tests for cj/copy-path-to-buffer-file-as-kill -*- lexical-binding: t; -*- ;;; Commentary: -;; Tests for the cj/copy-path-to-buffer-file-as-kill function from custom-file-buffer.el +;; Tests for the cj/copy-path-to-buffer-file-as-kill function from custom-buffer-file.el ;; ;; This function copies the full path of the current buffer's file to the kill ring ;; and returns the path. It signals an error if the buffer is not visiting a file. @@ -22,7 +22,7 @@ (provide 'ps-print) ;; Now load the actual production module -(require 'custom-file-buffer) +(require 'custom-buffer-file) ;;; Setup and Teardown @@ -201,5 +201,5 @@ (should-error (cj/copy-path-to-buffer-file-as-kill) :type 'user-error)) (test-copy-path-teardown))) -(provide 'test-custom-file-buffer-copy-path-to-buffer-file-as-kill) -;;; test-custom-file-buffer-copy-path-to-buffer-file-as-kill.el ends here +(provide 'test-custom-buffer-file-copy-path-to-buffer-file-as-kill) +;;; test-custom-buffer-file-copy-path-to-buffer-file-as-kill.el ends here diff --git a/tests/test-custom-file-buffer-copy-whole-buffer.el b/tests/test-custom-buffer-file-copy-whole-buffer.el index a0546b18..181c491a 100644 --- a/tests/test-custom-file-buffer-copy-whole-buffer.el +++ b/tests/test-custom-buffer-file-copy-whole-buffer.el @@ -1,7 +1,7 @@ -;;; test-custom-file-buffer-copy-whole-buffer.el --- Tests for cj/copy-whole-buffer -*- lexical-binding: t; -*- +;;; test-custom-buffer-file-copy-whole-buffer.el --- Tests for cj/copy-whole-buffer -*- lexical-binding: t; -*- ;;; Commentary: -;; Tests for the cj/copy-whole-buffer function from custom-file-buffer.el +;; Tests for the cj/copy-whole-buffer function from custom-buffer-file.el ;; ;; This function copies the entire contents of the current buffer to the kill ring. ;; Point and mark are left exactly where they were. No transient region is created. @@ -22,7 +22,7 @@ (provide 'ps-print) ;; Now load the actual production module -(require 'custom-file-buffer) +(require 'custom-buffer-file) ;;; Setup and Teardown @@ -190,5 +190,5 @@ (should (null (text-properties-at 0 (car kill-ring))))) (test-copy-whole-buffer-teardown))) -(provide 'test-custom-file-buffer-copy-whole-buffer) -;;; test-custom-file-buffer-copy-whole-buffer.el ends here +(provide 'test-custom-buffer-file-copy-whole-buffer) +;;; test-custom-buffer-file-copy-whole-buffer.el ends here diff --git a/tests/test-custom-file-buffer-delete-buffer-and-file.el b/tests/test-custom-buffer-file-delete-buffer-and-file.el index 1c43ff3b..4af8d2a7 100644 --- a/tests/test-custom-file-buffer-delete-buffer-and-file.el +++ b/tests/test-custom-buffer-file-delete-buffer-and-file.el @@ -1,7 +1,7 @@ -;;; test-custom-file-buffer-delete-buffer-and-file.el --- Tests for cj/delete-buffer-and-file -*- lexical-binding: t; -*- +;;; test-custom-buffer-file-delete-buffer-and-file.el --- Tests for cj/delete-buffer-and-file -*- lexical-binding: t; -*- ;;; Commentary: -;; Tests for the cj/delete-buffer-and-file function from custom-file-buffer.el +;; Tests for the cj/delete-buffer-and-file function from custom-buffer-file.el ;; ;; This function deletes both the current buffer and the file it visits. ;; It uses vc-delete-file for version-controlled files and delete-file @@ -42,7 +42,7 @@ (provide 'ps-print) ;; Now load the actual production module -(require 'custom-file-buffer) +(require 'custom-buffer-file) ;;; Setup and Teardown @@ -667,5 +667,5 @@ (should-error (cj/delete-buffer-and-file)))) (test-delete-buffer-and-file-teardown))) -(provide 'test-custom-file-buffer-delete-buffer-and-file) -;;; test-custom-file-buffer-delete-buffer-and-file.el ends here +(provide 'test-custom-buffer-file-delete-buffer-and-file) +;;; test-custom-buffer-file-delete-buffer-and-file.el ends here diff --git a/tests/test-custom-file-buffer-move-buffer-and-file.el b/tests/test-custom-buffer-file-move-buffer-and-file.el index 1fc16011..e8f4563d 100644 --- a/tests/test-custom-file-buffer-move-buffer-and-file.el +++ b/tests/test-custom-buffer-file-move-buffer-and-file.el @@ -1,7 +1,7 @@ -;;; test-custom-file-buffer-move-buffer-and-file.el --- Tests for cj/move-buffer-and-file -*- lexical-binding: t; -*- +;;; test-custom-buffer-file-move-buffer-and-file.el --- Tests for cj/move-buffer-and-file -*- lexical-binding: t; -*- ;;; Commentary: -;; Tests for the cj/--move-buffer-and-file function from custom-file-buffer.el +;; Tests for the cj/--move-buffer-and-file function from custom-buffer-file.el ;; ;; This is the internal (non-interactive) implementation that moves both the ;; current buffer and its visited file to a new directory. It handles trailing @@ -25,7 +25,7 @@ (provide 'ps-print) ;; Now load the actual production module -(require 'custom-file-buffer) +(require 'custom-buffer-file) ;;; Setup and Teardown @@ -932,5 +932,5 @@ (kill-buffer (current-buffer))) (test-move-buffer-and-file-teardown))) -(provide 'test-custom-file-buffer-move-buffer-and-file) -;;; test-custom-file-buffer-move-buffer-and-file.el ends here +(provide 'test-custom-buffer-file-move-buffer-and-file) +;;; test-custom-buffer-file-move-buffer-and-file.el ends here diff --git a/tests/test-custom-file-buffer-rename-buffer-and-file.el b/tests/test-custom-buffer-file-rename-buffer-and-file.el index ca8acff8..1eb61f1b 100644 --- a/tests/test-custom-file-buffer-rename-buffer-and-file.el +++ b/tests/test-custom-buffer-file-rename-buffer-and-file.el @@ -1,7 +1,7 @@ -;;; test-custom-file-buffer-rename-buffer-and-file.el --- Tests for cj/--rename-buffer-and-file -*- lexical-binding: t; -*- +;;; test-custom-buffer-file-rename-buffer-and-file.el --- Tests for cj/--rename-buffer-and-file -*- lexical-binding: t; -*- ;;; Commentary: -;; Tests for the cj/--rename-buffer-and-file function from custom-file-buffer.el +;; Tests for the cj/--rename-buffer-and-file function from custom-buffer-file.el ;; ;; This is the internal (non-interactive) implementation that renames both the ;; current buffer and its visited file. The interactive wrapper @@ -24,7 +24,7 @@ (provide 'ps-print) ;; Now load the actual production module -(require 'custom-file-buffer) +(require 'custom-buffer-file) ;;; Setup and Teardown @@ -935,5 +935,5 @@ (kill-buffer (current-buffer))) (test-rename-buffer-and-file-teardown))) -(provide 'test-custom-file-buffer-rename-buffer-and-file) -;;; test-custom-file-buffer-rename-buffer-and-file.el ends here +(provide 'test-custom-buffer-file-rename-buffer-and-file) +;;; test-custom-buffer-file-rename-buffer-and-file.el ends here |
