Add version to dashboard

As well as some code to make the native compilation mode startup better.
This commit is contained in:
Howard Abrams 2021-12-08 13:56:30 -08:00
parent d756049f90
commit 4778e0692c
2 changed files with 59 additions and 13 deletions

View file

@ -52,6 +52,42 @@ While that enables the =:straight t= extension to =use-package=, let's just have
straight-default-vc 'git))
#+END_SRC
See the details in [[https://dev.to/jkreeftmeijer/emacs-package-management-with-straight-el-and-use-package-3oc8][this essay]].
** OS Path and Native Compilation
With the way I start Emacs, I may not have the PATH I /actually/ use (from the shell) available, so we'll force it (code taken [[https://www.emacswiki.org/emacs/ExecPath][from here]]):
#+BEGIN_SRC emacs-lisp
(defun set-exec-path-from-shell ()
"Set up Emacs' `exec-path' and PATH environment variable to match
that used by the user's shell.
This is particularly useful under Mac OS X and macOS, where GUI
apps are not started from a shell."
(interactive)
(let ((path-from-shell (replace-regexp-in-string
(rx (zero-or-more space) eol)
""
(shell-command-to-string "$SHELL --login -c 'echo $PATH'"))))
(setenv "PATH" path-from-shell)
(setq exec-path (split-string path-from-shell path-separator))))
(set-exec-path-from-shell)
#+END_SRC
Clear up a Mac-specific issue that sometimes arises since I'm switching to [[http://akrl.sdf.org/gccemacs.html][native compilation project]], as the =Emacs.app= that I use doesn't have its =bin= directory, e.g. =Emacs.app/Contents/MacOS/bin=:
#+BEGIN_SRC emacs-lisp
(when (equal system-type 'darwin)
(add-to-list 'exec-path (concat invocation-directory "bin") t))
#+END_SRC
Getting tired off all the packages that I load spewing a bunch of warnings that I can't do anything about:
#+BEGIN_SRC emacs-lisp
(when (and (fboundp 'native-comp-available-p)
(native-comp-available-p))
(setq native-comp-async-report-warnings-errors nil
native-comp-deferred-compilation t))
#+END_SRC
** Basic Libraries
The following packages come with Emacs, but seems like they still need loading:
#+BEGIN_SRC emacs-lisp

View file

@ -28,7 +28,17 @@ The [[https://github.com/emacs-dashboard/emacs-dashboard][emacs-dashboard]] proj
#+BEGIN_SRC emacs-lisp
(use-package dashboard
:init
(setq dashboard-banner-logo-title "Welcome to Emacs"
(defun ha-dashboard-version ()
(let ((smaller-version (replace-regexp-in-string
(rx " (" (zero-or-more any) eol) "" (emacs-version))))
(string-replace "\n" "" smaller-version)))
(setq dashboard-banner-logo-title
(format "Emacs %s ⸺ %s"
(if (and (fboundp 'native-comp-available-p)
(native-comp-available-p))
"with Native Compilation" "")
(ha-dashboard-version))
dashboard-startup-banner "~/other/hamacs/support/levitating-gnu.png"
dashboard-center-content t
dashboard-set-init-info t