diff --git a/lisp/git-auto-sync/my-org-autosync.el b/lisp/git-auto-sync/my-org-autosync.el index 58c392b..cf0b6a5 100644 --- a/lisp/git-auto-sync/my-org-autosync.el +++ b/lisp/git-auto-sync/my-org-autosync.el @@ -69,35 +69,12 @@ ;; (defvar gac-auto-merge-branch-list nil) ;; (make-variable-buffer-local 'gac-auto-merge-branch-list) -(when my/puppet-p - (add-to-list 'emacs-startup-hook - #'(lambda () - (run-at-time 30 300 #'gaff/trigger))) - - (add-hook 'emacs-startup-hook - #'gac-run-ssh-add) - - (add-hook 'emacs-startup-hook - #'keychain-refresh-environment)) - (defun-cached 60 gac-run-gaff () (gaff/trigger)) (defun-cached 15 gac-run-ssh-add () (rb/ssh-add)) -(add-hook 'git-auto-commit-mode-hook - #'gac-run-gaff) - -(add-hook 'git-auto-commit-mode-hook - #'gac-after-save-func t t) - -(add-hook 'git-auto-commit-mode-hook - #'gac-run-ssh-add) - -(add-hook 'git-auto-commit-mode-hook - #'keychain-refresh-environment) - (add-to-list 'safe-local-variable-values '(gac-automatically-push-p . t)) @@ -180,8 +157,33 @@ (timer-event-handler timer)) (remhash k gac--debounce-timers))) -(add-hook 'kill-emacs-hook - 'gac-activate-all-timers) + +(when (not noninteractive) + (when my/puppet-p + (add-to-list 'emacs-startup-hook + #'(lambda () + (run-at-time 30 300 #'gaff/trigger))) + + (add-hook 'emacs-startup-hook + #'gac-run-ssh-add) + + (add-hook 'emacs-startup-hook + #'keychain-refresh-environment)) + + (add-hook 'git-auto-commit-mode-hook + #'gac-run-gaff) + + (add-hook 'git-auto-commit-mode-hook + #'gac-after-save-func t t) + + (add-hook 'git-auto-commit-mode-hook + #'gac-run-ssh-add) + + (add-hook 'git-auto-commit-mode-hook + #'keychain-refresh-environment) + + (add-hook 'kill-emacs-hook + 'gac-activate-all-timers)) ;; (add-hook 'gaff/after-merge-hook ;; (lambda () diff --git a/run-tests.el b/run-tests.el new file mode 100644 index 0000000..a16e3a4 --- /dev/null +++ b/run-tests.el @@ -0,0 +1,36 @@ +;;; run-tests.el --- -*- lexical-binding: t -*- + +;; Copyright (C) 2023 Benson Chu + +;; Author: Benson Chu +;; Created: [2023-02-27 20:26] + +;; This file is not part of GNU Emacs + +;; This program is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;;; Code: + +(message "Loading Emacs config...") +(let ((inhibit-message t)) + (load (expand-file-name "init.el" + user-emacs-directory))) +(message "Running tests...") +(load (expand-file-name "tests/my-org-tests.el" + user-emacs-directory)) + +(provide 'run-tests) +;;; run-tests.el ends here diff --git a/tests/my-org-tests.el b/tests/my-org-tests.el index b988a1a..5477072 100644 --- a/tests/my-org-tests.el +++ b/tests/my-org-tests.el @@ -10,7 +10,8 @@ (buffer-gensym (gensym "buffer"))) `(progn ,@(save-window-excursion - (let ((buffer (find-file-noselect file))) + (let ((inhibit-message t) + (buffer (find-file-noselect file))) (prog1 (with-current-buffer buffer (beginning-of-buffer) (when (not (org-at-heading-p)) @@ -36,7 +37,8 @@ (buffer-gensym (gensym "buffer"))) `(progn ,@(save-window-excursion - (let ((buffer (find-file-noselect file))) + (let ((buffer (find-file-noselect file)) + (inhibit-message t)) (prog1 (with-current-buffer buffer (beginning-of-buffer) (when (not (org-at-heading-p)) @@ -107,4 +109,4 @@ (ert-run-tests-interactively t) -;; (progn (setq org-disabled-tests nil) (mapcar (lambda (sym) (put sym 'ert--test nil)) (apropos-internal "" #'ert-test-boundp))) +;; (progn (setq org-disabled-tests nil) (mapcar (lambda (sym) (put sym 'ert--test nil)) (apropos-internal "" #'ert-test-boundp))))