Fixed a bit of the startup

This commit is contained in:
Howard Abrams 2023-08-29 12:00:32 -07:00
parent da51188cc1
commit 1f9f59d9ed
3 changed files with 18 additions and 18 deletions

View file

@ -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)

View file

@ -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:

View file

@ -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