Updated March 18, 2021

Most of my code has changed a lot recently. Check updated posts.

For each post can update code listed in that post. Keep in mind code for linux and wsl configs will have their own posts, except in the case of .early-init and init.el, which have system switches (to load system specific dot-files).

Also note: abandoned convention of listing init lines. Now if you want to find the code, and there is now plenty of decent emacs code, use the search function. The site is not large.

Defvar vs setq

Defvar includes messages, and in some cases combines with :custom in use-package to add additional functionality. I replaced in my init all instance of defvar with setq.

Also, no longer require paths to libraries as properly configured the load path see post: Emacs Configuration Overview.

Original Post Below


Directly below are the subheadings to the first main heading of my initialization file, see my last post Emacs Configuration Overview.

Directly below are the subheadings to the first main heading of my initialization file, see my last post Emacs Configuration Overview. I'll go through the lines of code in order, but remember, the line numbers you see in Hugo's code block css styling are relative to the code on this page not the emacs initialization file [Hugo is the Static Content Management System based on GO I used to make this blog]. There are roughly 760 lines of code beneath these subheadings (all of it quick and dirty). I'll go through the relevant stuff and skip anything redundant in this post and the next few. Each post will have the following reference headings, and then the breakdown and write-up below that.

Beginning of Initialization File

  • SET UP, DEFAULTS, AND CUSTOMIZATION
    • Necessary Adjustments when you set-up on a new computer
    • Paths to Update on Change
    • Executable Paths
    • Libraries
    • Function declarations
    • Emacs Customization Seperate File
    • Emax Defaults
    • Some Defaults
    • Frames, Buffers, And Lines
    • Some Custom Default Functions
    • Some New Key Bindings
    • Popup, Pos-tip,Tooltip, Posframe
    • Which Key

Oh yes, when I installed the dashboard package there was an option to choose a picture. That's when I named my Emacs configuration. Welcome to Poseidon the text editor.

emacs initialization file posiedon configuration image

Necessary Adjustments when you set-up on a new computer

steps needed to get set-up on a new computer

  1. install emacs
  2. install external executables
  3. paste .emacs and myinit.org from active emacs installation to new emacs installation
  4. Change load paths in myinit.org
  5. paste dependency folders to new emacs (snippets, etc.)
  6. adjust home variable on new system
  7. adjust emacs to have administrator rights
  8. restart emacs and deal with each error as emacs runs through myinit.org code (Most errors should be easily resolved by updating directory paths, providing missing libraries, ensuring executables and missing library dependencies are installed)
  9. to troubleshoot basic errors use emacs debugger, messages, and the restart-emacs package. Also, comment out org tangle blocks and initialize the init incrementally.

Paths to Update on Change

Here paths to executables, libraries, and external urls are stored in variables. When you install Poseidon on a new system, or change a program or its location, change the path variable assignments here. Later in the code, usually in a use-package :config or a function the variables are called.

Oh, btw, before the path assignments is an org-tangle block, delineated by the org-mode elisp code on lines 2 and 4. Everything inside them is processed by emacs, everything outside is notes and text you can push to the web easily.


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49

; most of the executables I use from within emacs, except some security ones and some of the browsers
(defvar xampp-p ".../xampp/xampp-control.exe")
(defvar notepad++-p ".../Program Files/Notepad++/notepad++.exe")
(defvar backup-init-p ".../emacs/emax/run-backup-init-silently.vbs")
(defvar image-magick-p ".../Program Files/ImageMagick-7.0.8-Q16/magick.exe")
(defvar dropbox-p ".../Program Files (x86)/Dropbox/Client/Dropbox.exe")
(defvar wordnet-command-p ".../Program Files (x86)/WordNet/2.1/bin/wn.exe")
(defvar win-calc-p ".../Windows/System32/calc.exe")
(defvar screen-cast-p  ".../Program Files (x86)/Screencast-O-Matic/v2/Screencast-O-Matic.exe")
(defvar fsviewer-p ".../Program Files (x86)/FastStone Image Viewer/FSViewer.exe")
(defvar gimp-p ".../Program Files/GIMP 2/bin/gimp-2.10.exe" )
(defvar 7z-p ".../Program Files/7-Zip/7z.exe")
(defvar winword-p ".../Program Files/Microsoft Office/root/Office16/WINWORD.exe")
(defvar excel-p ".../Program Files/Microsoft Office/root/Office16/EXCEL.exe")
(defvar mpd-start-p ".../Users/Methuselah/Documents/mpd-windows-master/start-silently-mpd.vbs")
(defvar mpd-stop-p ".../Users/Methuselah/Documents/mpd-windows-master/stop-mpd-silently.vbs")
(defvar keycast-p ".../Program Files/Keycastow/keycastow.exe")
(defvar pandoc-p ".../Users/Methuselah/AppData/Local/Pandoc/pandoc.exe")
(defvar firefox-p ".../Program Files/Mozilla Firefox/firefox.exe")
(defvar git-exe-p ".../Program Files/Git/mingw64/libexec/git-core/git.exe")
(defvar win-ubuntu-exe-p ".../Windows/System32/wsl.exe")
(defvar atom-exe-p  ".../Users/Methuselah/AppData/Local/atom/atom.exe")
(defvar default-comspec-p "C:\\Windows\\system32\\cmd.exe")
(defvar bash-comspec-p "C:\\Windows\\system32\\wsl.exe")
(defvar default-shell-file-name-p ".../emacs/libexec/emacs/26.2/x86_64-w64-mingw32/cmdproxy.exe")
(defvar bash-shell-file-name-p ".../Windows/system32/bash.exe")
(defvar git-bash-shell-file-name-p ".../Program Files/Git/git-bash.exe")
(defvar onedrive-p ".../Users/Methuselah/AppData/Local/Microsoft/OneDrive/OneDrive.exe")
(defvar deploy-cloud-nine-p ".../Hugo/sites/cloudnine-build-directory/cloudnine-deploy-silently.vbs")
(defvar deploy-build-hello-p ".../Hugo/sites/buildhello-build-directory/buildhello-deploy-silently.vbs")
(defvar image-magick-convert-p ".../Program Files/ImageMagick-7.0.8-Q16/convert.exe")
(defvar inkscape-p ".../Program Files/Inkscape/inkscape.exe" )
(defvar ag-executable-p ".../emacs/ag/ag.exe")
(defvar ispell-program-name-p ".../emacs/hunspell-1.3.2-3-w32-bin/bin/hunspell.exe")

;library paths

(defvar auto-yas-p "~/emax/elpa/auto-yasnippet-20190326.958/")
(defvar yas-p "~/.emacs.d/elpa/yasnippet-20190724.1204/")
(defvar wordnet-dictionary-p ".../Program Files (x86)/WordNet/2.1/dict/")
(defvar comp-ispell-dic-p ".../emacs/.emacs.d/misc/english-words.dic")
(defvar dash-p ".../emacs/emax/elpa/dashboard-20190721.504/" )
(defvar dash-image-p  "~/.emacs.d/images/poseidon_2.png")
(defvar all-the-icons-p ".../emacs/.emacs.d/all-the-icons-fonts/")
(defvar auto-yas-dir-p ".../emacs/.emacs.d/auto-yas-snippets/")
(defvar yas-snippets-p ".../emacs/.emacs.d/snippets/")
(defvar which-key-posframe-p ".../emacs/emax/elpa/which-key-posframe-20190427.1103/which-key-posframe.el")
(defvar hydra-posframe-p ".../emacs/emax/elpa/hydra-posframe/")

So there's the first 130 lines or so of my init file (52 shown here plus the paths I didn't bother to paste in and some text). Btw, it doesn't matter where you store your stuff, as long as emacs knows where it is. In fact, that's the point of assigning the paths to variables. When your paths or path names change, you don't have to search the document for each path. Coming up are the function declarations.


That’s all for now…