From 1f9f59d9ed785ed69e2374b519195470f54d09e3 Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Tue, 29 Aug 2023 12:00:32 -0700 Subject: [PATCH] Fixed a bit of the startup --- elisp/beep.el | 19 +++++++++---------- ha-dashboard.org | 15 ++++++++------- ha-programming.org | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/elisp/beep.el b/elisp/beep.el index 85c83c6..037fb09 100644 --- a/elisp/beep.el +++ b/elisp/beep.el @@ -23,8 +23,7 @@ "Play a default notification sound file. Customize the variable, `beep-alert-sound-file' to adjust the sound." (if (fboundp 'play-sound-internal) - (ignore-errors - (play-sound-file beep-alert-sound-file)) + (play-sound-file beep-alert-sound-file) (call-process-shell-command (format "afplay %s &" beep-alert-sound-file) nil 0))) (defvar beep-speech-executable "say %s" @@ -36,23 +35,23 @@ Customize the variable, `beep-speech-executable'." (let ((command (format beep-speech-executable phrase))) (async-shell-command command))) -(defun beep--when-finished (phrase &optional to-speak) +(defun beep-when-finished (phrase &optional to-speak) "Notify us with string, PHRASE, to grab our attention. Useful after a long process has completed, but use sparingly, as this can be pretty distracting." - (message phrase) (when (functionp 'alert) (alert phrase :title "Completed")) (beep--beep) - (beep--speak (or to-speak phrase))) + (beep--speak (or to-speak phrase)) + (message phrase)) (defun compile-and-notify () "Call `compile' and notify us when finished. -See `beep--when-finished' for details." +See `beep-when-finished' for details." (interactive) (let ((default-directory (projectile-project-root))) (call-interactively 'compile) - (beep--when-finished "The compile command has finished."))) + (beep-when-finished "The compile command has finished."))) (defvar beep-func-too-long-time 5 "The number of seconds a function runs before it is considered taking too much time, and needing to be alerted when it has finished.") @@ -68,11 +67,11 @@ See `beep--when-finished' for details." decode-time first)) (when (> duration beep-func-too-long-time) - (beep--when-finished (format "The function, %s, has finished." func))))) + (beep-when-finished (format "The function, %s, has finished." func))))) (defun recompile-and-notify () "Call `recompile' and notify us when finished. -See `beep--when-finished' for details." +See `beep-when-finished' for details." (interactive) (beep--after-function 'recompile)) @@ -93,7 +92,7 @@ See `beep--when-finished' for details." decode-time first)) (when (> duration beep-func-too-long-time) - (beep--when-finished (format "The function, %s, has finished." + (beep-when-finished (format "The function, %s, has finished." (beep--extract-function-name orig-function)))))) (defun beep--extract-function-name (expr) diff --git a/ha-dashboard.org b/ha-dashboard.org index 778a71f..c85c6db 100644 --- a/ha-dashboard.org +++ b/ha-dashboard.org @@ -101,12 +101,12 @@ I would appreciate seeing if my Emacs installation has the features that I expec (feature-combo (all-the-icons-faicon "database") "Sqlite")) (when (gnutls-available-p) (feature-combo (all-the-icons-faicon "expeditedssl") "TLS")) - ;; TODO: - ;; Mailutils? How do we figure out if we are using Gnu Mailutils? - ;; (mail-icon (all-the-icons-material "mail")) - ;; XWidgets? Need to get on my Linux box and compile this. - ;; (widget-icon (all-the-icons-material "widgets")) - (when (fboundp 'module-load) + (when (or (string-search "with-mailutils" system-configuration-options) + (string-search "without-pop" system-configuration-options)) + (feature-combo (all-the-icons-material "mail") "GNU Mail")) + (when (fboundp 'make-xwidget) + (feature-combo (all-the-icons-material "widgets") "XWidgets")) + (when module-file-suffix ; or (fboundp 'module-load) (feature-combo (all-the-icons-faicon "th") "Modules")) (when (json-available-p) (feature-combo (all-the-icons-fileicon "config-js") "JSON")) @@ -257,7 +257,8 @@ The =dashboard= project hooks to [[help:emacs-startup-hook][emacs-startup-hook]] ;; (shrink-window-horizontally (- (window-size nil t) 50)) (shrink-window-horizontally 40) (goto-char (point-min)) - (call-interactively 'ha-hamacs-features)) + (add-hook 'after-init (lambda () + (call-interactively 'ha-hamacs-features)))) #+end_src * Technical Artifacts :noexport: diff --git a/ha-programming.org b/ha-programming.org index 180a69f..d25f0a5 100644 --- a/ha-programming.org +++ b/ha-programming.org @@ -608,7 +608,7 @@ As I've mentioned [[http://www.howardism.org/Technical/Emacs/beep-for-emacs.html (use-package beep :straight nil ; Already in the load-path - :hook (after-init . (lambda () (beep--when-finished "Emacs has started." "Eemacs has started"))) + :hook (after-init . (lambda () (beep-when-finished "Emacs has started." "Eemacs has started"))) :config (dolist (func '(org-publish org-publish-all