Add version to dashboard
As well as some code to make the native compilation mode startup better.
This commit is contained in:
		
							parent
							
								
									d756049f90
								
							
						
					
					
						commit
						4778e0692c
					
				
					 2 changed files with 59 additions and 13 deletions
				
			
		| 
						 | 
					@ -52,6 +52,42 @@ While that enables the =:straight t= extension to =use-package=, let's just have
 | 
				
			||||||
           straight-default-vc 'git))
 | 
					           straight-default-vc 'git))
 | 
				
			||||||
#+END_SRC
 | 
					#+END_SRC
 | 
				
			||||||
See the details in [[https://dev.to/jkreeftmeijer/emacs-package-management-with-straight-el-and-use-package-3oc8][this essay]].
 | 
					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
 | 
					** Basic Libraries
 | 
				
			||||||
The following packages come with Emacs, but seems like they still need loading:
 | 
					The following packages come with Emacs, but seems like they still need loading:
 | 
				
			||||||
#+BEGIN_SRC emacs-lisp
 | 
					#+BEGIN_SRC emacs-lisp
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -26,20 +26,30 @@ A literate programming file to configure the Emacs UI.
 | 
				
			||||||
* Dashboard
 | 
					* Dashboard
 | 
				
			||||||
The [[https://github.com/emacs-dashboard/emacs-dashboard][emacs-dashboard]] project makes a nicer startup screen.
 | 
					The [[https://github.com/emacs-dashboard/emacs-dashboard][emacs-dashboard]] project makes a nicer startup screen.
 | 
				
			||||||
#+BEGIN_SRC emacs-lisp
 | 
					#+BEGIN_SRC emacs-lisp
 | 
				
			||||||
    (use-package dashboard
 | 
					  (use-package dashboard
 | 
				
			||||||
      :init
 | 
					    :init
 | 
				
			||||||
      (setq dashboard-banner-logo-title "Welcome to Emacs"
 | 
					    (defun ha-dashboard-version ()
 | 
				
			||||||
            dashboard-startup-banner "~/other/hamacs/support/levitating-gnu.png"
 | 
					      (let ((smaller-version (replace-regexp-in-string
 | 
				
			||||||
            dashboard-center-content t
 | 
					                     (rx " (" (zero-or-more any) eol) "" (emacs-version))))
 | 
				
			||||||
            dashboard-set-init-info t
 | 
					        (string-replace "\n" "" smaller-version)))
 | 
				
			||||||
            dashboard-projects-switch-function 'projectile-persp-switch-project
 | 
					 | 
				
			||||||
            dashboard-items '((projects . 5)
 | 
					 | 
				
			||||||
                              ;; (agenda . 5)
 | 
					 | 
				
			||||||
                              (bookmarks . 5)))
 | 
					 | 
				
			||||||
      :config
 | 
					 | 
				
			||||||
      (dashboard-setup-startup-hook)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
      (setq dashboard-footer-messages (list (ha--dad-joke))))
 | 
					    (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
 | 
				
			||||||
 | 
					          dashboard-projects-switch-function 'projectile-persp-switch-project
 | 
				
			||||||
 | 
					          dashboard-items '((projects . 5)
 | 
				
			||||||
 | 
					                            ;; (agenda . 5)
 | 
				
			||||||
 | 
					                            (bookmarks . 5)))
 | 
				
			||||||
 | 
					    :config
 | 
				
			||||||
 | 
					    (dashboard-setup-startup-hook)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    (setq dashboard-footer-messages (list (ha--dad-joke))))
 | 
				
			||||||
#+END_SRC
 | 
					#+END_SRC
 | 
				
			||||||
* Mode Line
 | 
					* Mode Line
 | 
				
			||||||
Let's install and load some of packages from the [[https://github.com/hlissner/doom-emacs][Doom Emacs]] project, like [[https://github.com/seagle0128/doom-modeline][doom-modeline]] and maybe the themes:
 | 
					Let's install and load some of packages from the [[https://github.com/hlissner/doom-emacs][Doom Emacs]] project, like [[https://github.com/seagle0128/doom-modeline][doom-modeline]] and maybe the themes:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue