diff options
author | Blendoit <blendoit@gmail.com> | 2020-10-04 20:54:12 -0700 |
---|---|---|
committer | Blendoit <blendoit@gmail.com> | 2020-10-04 20:54:12 -0700 |
commit | 5cc72005748960596a7e0003cdf34b95685b03b3 (patch) | |
tree | cc8694afc154648af5bfee57f4ba3bbea15f77a4 | |
parent | f92c4dfc8cbc1c4288618600a962819b2762042f (diff) |
Start work on user details.
-rw-r--r-- | .gitignore | 23 | ||||
-rw-r--r-- | blendoit/.gitignore | 5 | ||||
-rw-r--r-- | blendoit/blendoit-init.pdf | bin | 124805 -> 0 bytes | |||
-rw-r--r-- | blendoit/blendoit-sidebar.el.bkp | 23 | ||||
-rw-r--r-- | init-custom.el | 4 | ||||
-rw-r--r-- | init.el | 31 | ||||
-rw-r--r-- | smart-documents.org (renamed from blendoit/blendoit-init.org) | 232 | ||||
-rw-r--r-- | smart-documents.pdf | bin | 0 -> 104689 bytes | |||
-rw-r--r-- | snippets/org-mode/quote | 7 | ||||
-rw-r--r-- | snippets/org-mode/src | 3 | ||||
-rw-r--r-- | themes/blendoit-light-theme.el | 10 |
11 files changed, 179 insertions, 159 deletions
@@ -1,27 +1,20 @@ # .gitignore -*.elc +# All secrets! +secret* -# TeX artifacts -*.tex -*.lot -*.lof +# .org => .el => .elc +*.el +*.elc # These directories are populated on config execution. elpa/** url/** +meta/** auto-save-list/** transient/** +_minted* # Tangled config .el file from .org -blendoit/blendoit-init.el +smart-documents.el -# Misc -*.eld -ido.last -recentf -srecode-map.el -.org-id-locations -network-security.data -places -projectile.cache diff --git a/blendoit/.gitignore b/blendoit/.gitignore deleted file mode 100644 index dff4699..0000000 --- a/blendoit/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -# blendoit/.gitignore - -_minted-blendoit-init/ -secrets.org -secrets.el
\ No newline at end of file diff --git a/blendoit/blendoit-init.pdf b/blendoit/blendoit-init.pdf Binary files differdeleted file mode 100644 index f9f4985..0000000 --- a/blendoit/blendoit-init.pdf +++ /dev/null diff --git a/blendoit/blendoit-sidebar.el.bkp b/blendoit/blendoit-sidebar.el.bkp deleted file mode 100644 index 8677083..0000000 --- a/blendoit/blendoit-sidebar.el.bkp +++ /dev/null @@ -1,23 +0,0 @@ -;;; blendoit-sidebar.el --- Modern buffer list in sidebar
-
-;; Copyright (C) 2020 Marius Peter
-
-;; Author: Marius Peter <mpeter@ucla.edu>
-;; Version: 0.1
-;; Package-Requires: ((flange "1.0"))
-;; Keywords: multimedia, frobnicate
-;; URL: http://example.com/jrhacker/superfrobnicate
-
-;; Commentary:
-
-;; This package provides an auto-hiding sidebar with a list of open buffers.
-
-;; Code:
-
-;;;###autoload
-(define-minor-mode blendoit-sidebar-mode)
-
-
-(provide 'blendoit-sidebar)
-
-;;; blendoit-sidebar.el ends here
diff --git a/init-custom.el b/init-custom.el index 55f9072..4aab2a2 100644 --- a/init-custom.el +++ b/init-custom.el @@ -15,11 +15,11 @@ '(company-quickhelp-color-foreground "#DCDCCC") '(custom-enabled-themes nil) '(custom-safe-themes - '("311aa5df3223b5b4a7c638aad3befb4de9c7f46360d52acd1fa2cd2232b1dcbd" default)) + '("5c32236ef318adafe4102f627f330fa8f448046dfd838eef5cc09c7f682cf71f" "e343fecfb8d681186d594002c9b44ce48c2061599d7e4ec635cf1ca2a277a47a" "302dc61dc55600c7424f945dce9e74fba7df19f4a7bfb72aefd93193fa82ede4" "58f1f85248ba913387d1e7ed02a867161b315cfb5acff0c234e013ffd2577d22" "a256abf590bbc3257cc11d91a312e9fe8487dc1b95a5b7b732dd2f96a7fe5a45" "30368d6195cae9298304e6ac0534b90c85b1655965f1206c5c624270f0f46002" "311aa5df3223b5b4a7c638aad3befb4de9c7f46360d52acd1fa2cd2232b1dcbd" default)) '(fci-rule-color "#383838") '(fringe-mode 0 nil (fringe)) '(indicate-empty-lines t) - '(line-number-mode nil) + '(line-number-mode t) '(message-required-headers '((optional . References) From)) '(nrepl-message-colors '("#CC9393" "#DFAF8F" "#F0DFAF" "#7F9F7F" "#BFEBBF" "#93E0E3" "#94BFF3" "#DC8CC3")) @@ -10,35 +10,10 @@ ;;; Code: -;; SET BACKUPS AND SAVE BEHAVIOURS HERE +(org-babel-load-file "~/.emacs.d/smart-documents.org") -(org-babel-load-file "~/.emacs.d/blendoit/blendoit-init.org") - -(setq my/literate-config (concat user-emacs-directory "blendoit/blendoit-init.org")) -(setq my/literate-config-compiled (concat user-emacs-directory "blendoit/blendoit-init.elc")) - -;; (defun my/load-config-linux () -;; "Bootstrap a full `.emacs.d/' configuration for GNU/Linux." -;; (setq user-emacs-directory "/run/media/blendux/1924-4A2F/dotemacs/") -;; (setq my/literate-config (concat user-emacs-directory "blendoit/blendoit-init.org")) -;; (setq my/literate-config-compiled (concat user-emacs-directory "blendoit/blendoit-init.elc")) -;; (load-file my/literate-config-compiled) -;; (message "It worked. Take a break.")) - -;; (defun my/load-config-windows () -;; "Bootstrap a full `.emacs.d/' configuration for MS Windows." -;; (setq alphabet (mapcar 'string "ABCDEFFGHIJKLMNOPQRSTUVWXYZ")) -;; (setq drives (mapcar '(lambda (drive) (concat drive ":")) alphabet)) -;; (setq user-emacs-directory (substring (locate-file "dotemacs/init.el" drives) 0 12)) -;; (setq my/literate-config (concat user-emacs-directory "blendoit/blendoit-init.org")) -;; (setq my/literate-config-compiled (concat user-emacs-directory "blendoit/blendoit-init.elc")) -;; (load-file my/literate-config-compiled) -;; (message "It worked. Take a break.")) - -;; ;; Perform the configuration bootstrap, per the running OS. -;; (cond ((string-equal system-type "gnu/linux") (my/load-config-linux)) -;; ((string-equal system-type "windows-nt") (my/load-config-windows)) -;; (t (message "You're running neither GNU/Linux nor MS Windows."))) +(setq my/literate-config (concat user-emacs-directory "smart-documents.org")) +;; (setq my/literate-config-compiled (concat user-emacs-directory "blendoit-init.elc")) (provide 'init) diff --git a/blendoit/blendoit-init.org b/smart-documents.org index 57e0931..dc3cf69 100644 --- a/blendoit/blendoit-init.org +++ b/smart-documents.org @@ -1,4 +1,6 @@ -#+TITLE: My Literate GNU Emacs Config +# -*- mode: org; -*- # + +#+TITLE: Smart Documents #+AUTHOR: Marius Peter #+DATE: <2020-07-23 Thu> #+EMAIL: blendoit@gmail.com @@ -6,26 +8,36 @@ #+SETUPFILE: ~/.emacs.d/templates/documents/general.org #+INCLUDE: ~/.emacs.d/templates/documents/general.org_title +#+LATEX_HEADER: \setmainfont{urw gothic} + #+LATEX: \begin{abstract} -GNU Emacs is most often used as a text editor. The utmost level of -customization is afforded by enabling the user to rewrite \textit{any} part of -the source code and observe the editor's modified behaviour in real time. Since -its inception in 1984, GNU Emacs has grown to be much more than a -full-featured, high-productivity text editor---new \textit{modes} have been -written to interact with hundreds of file formats, including \texttt{.txt}, -\texttt{.pdf}, \texttt{.jpg}, \texttt{.csv}, and \texttt{.zip} just to name a -few. This configuration file itself was written in \textit{Org mode}, a -collection of functions enabling the harmonious mixing of code and comments in -view of publication: this is the endgame of \textit{literate programming}. +The idea of /Smart Documents/ came to me as I was reflecting on how to improve +the document production process in my workplace. So much time was wasted on +formatting; output PDFs were awfully inconsistent, and conveyed poor brand +awareness from a typographical standpoint. + #+LATEX: \end{abstract} * Introduction +GNU Emacs is most often used as a text editor. The utmost level of +customization is afforded by enabling the user to rewrite /any/ part of the +source code and observe the editor's modified behaviour in real time. Since its +inception in 1984, GNU Emacs has grown to be much more than a full-featured, +high-productivity text editor---new /modes/ have been written to interact with +hundreds of file formats, including =.txt=, =.pdf=, =.jpg=, =.csv=, and =.zip= +just to name a few. This configuration file itself was written in /Org mode/, a +collection of functions enabling the harmonious mixing of code and comments in +view of publication: this is the endgame of /literate programming/, and the +basis of my vision for /Smart Documents/. + The following sections were laid out very deliberately. When we start Emacs, -Emacs Lisp source code blocks contained in this document are evaluated +the source code blocks contained in this document are evaluated sequentially---our editing environment is constructed in real time as we execute the blocks in order. For instance, we only begin loading packages once -we ensured ~use-package~ is working properly. +we ensured ~use-package~ is working properly.[fn::For more information on the +detailed steps Emacs takes upon starting, refer to +[[https://www.gnu.org/software/emacs/manual/html_node/elisp/Startup-Summary.html]].] Customizing Emacs goes far, far beyond this document---feel free to experiment and discover. @@ -35,33 +47,47 @@ and discover. - ~C-h k~ describe key These three commands will attempt to describe the element currently under our -cursor, however you can start typing to search for another symbol. +cursor, however one can start typing to search for another symbol. + +** =init.el= + +When Emacs first starts up, it looks for the following files in order and +attempts to load the contents of the first existing file. From the manual: + +#+BEGIN_QUOTE +Traditionally, file =~/.emacs= is used as the init file, although Emacs also +looks at =~/.emacs.el=, =~/.emacs.d/init.el=, =~/.config/emacs/init.el=, or +other +locations.[fn::[[https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html]]] +#+END_QUOTE + + If no file is found, Emacs then loads in its purely vanilla state. * TODO First-time setup -Spacemacs-like dialog for default settings. - -#+NAME: first-setup -# #+BEGIN_SRC emacs-lisp -# ;; Prompt enterprise or personal install. Create file in .emacs.d/ on Linux, -# ;; AppData/ on Windows. Ask user for details and preferred bindings. -# -# ; Check if .emacs.d exists -# -# ; If it does, warn user -# -# ; Copy init-bootstrap.el from USB to where operating systems expects init.el -# -# ;; (defun blendoit/first-time-setup-windows-nt () -# ;; "Execute the first-time setup on MS Windows. -# ;; If no `.emacs.d/' config exists on local system, copy -# ;; init-bootstrap.el to `~.emacs.d/'." -# ;; (interactive) -# ;; (find-file "~/.emacs.d/blendoit/blendoit-init.org")) -# -# ;; (cond ((string-equal system-type "windows-nt")blendoit/first-time-setup-windows-nt) -# ;; ((string-equal system-type "gnu/linux") blendoit/first-time-setup-linux)) -# #+END_SRC +** TODO User details + +The advantage of working with /Smart Documents/ is that they can automatically +be populated with our details in the header, footer, or other appropriate +element. + +#+NAME: user-details +#+BEGIN_SRC emacs-lisp + (defun my/tokenize-user-details () + "Tokenize user details." + + (cons 'user-full-name user-full-name)) + + (unless (file-exists-p (concat user-emacs-directory + "meta/user-details")) + (setq user-full-name (read-string "Enter full user name:")) + (setq user-mail-address (read-string "Enter user e-mail address:")) + (setq user-details '(user-full-name + user-mail-address)) + (append-to-file "Foobar\n" nil "~/.emacs.d/meta/foobar")) +#+END_SRC + + ** File system paths @@ -97,7 +123,7 @@ stop]]. We will then present profiling report in Section [[Profiling --- report] ; (profiler-start) #+END_SRC -** Emacs client +** TODO Emacs client Makes opening emacs faster for following instances. @@ -106,20 +132,6 @@ Makes opening emacs faster for following instances. ; (setq initial-buffer-choice (lambda () (get-buffer "*dashboard*"))) #+END_SRC -** Custom file - -Load settings created automatically by GNU Emacs Custom. (For example, any -clickable option/toggle is saved here.) Useful for fooling around with M-x -customize-group <package>. - -user-emacs-directory - -#+NAME: custom-file-location -#+BEGIN_SRC emacs-lisp - (setq custom-file (concat user-emacs-directory "init-custom.el")) - (load custom-file) -#+END_SRC - ** Customization shortcuts We begin by defining a user shortcut to this very file. We load this as early as @@ -143,6 +155,58 @@ Now, different shortcuts for other customization actions: (global-set-key (kbd "C-c f") 'customize-face) #+END_SRC +** Locations + +In this section, we'll be tidying up the =.emacs.d/= directory---by default, +many Emacs packages create files useful for themselves in our +~user-emacs-directory~. This leads to undesirable clutter. Certain packages +create files that log recently visited files ([[Recently visited files]]); log +location of known projects ([[Projects' bookmarks]]); log location in recently +visited files ([[Location in previously visited file]]) The commonality +between all these files is that they tend to reference... other files. Thus, I +decided to refer to them as meta-files. First, let's designate a folder to collect +our meta-files together: + +#+BEGIN_SRC emacs-lisp +(setq my/meta-files-location (concat user-emacs-directory "meta/")) +#+END_SRC + +*** Custom file + +Load settings created automatically by GNU Emacs Custom. (For example, any +clickable option/toggle is saved here.) Useful for fooling around with ~M-x +customize-group <package>~. + +#+NAME: custom-file-location +#+BEGIN_SRC emacs-lisp + (setq custom-file (concat user-emacs-directory "init-custom.el")) + (load custom-file) +#+END_SRC + +*** Recently visited files + +#+BEGIN_SRC emacs-lisp + (setq recentf-save-file (concat + my/meta-files-location + "recentf")) +#+END_SRC + +*** Projects' bookmarks + +#+BEGIN_SRC emacs-lisp + (setq projectile-known-projects-file (concat + my/meta-files-location + "projectile-bookmarks.eld")) +#+END_SRC + +*** Location in previously visited file + +#+BEGIN_SRC emacs-lisp + (setq save-place-file (concat + my/meta-files-location + "places")) +#+END_SRC + ** Backups Backups are so important that they should be described right after the shortcut @@ -184,16 +248,14 @@ GNU/Linux. Frame transparency increases when focus is lost. ** Secrets -The code contained in the =secrets.org= file is loaded by Emacs, but not +The code containe din the =secrets.org= file is loaded by Emacs, but not rendered in this PDF for the sake of privacy. It contains individually identifying information such as names and e-mail addresses, which are used to -populate Org templates (Section [[~org-mode~]]). - -You need to create this =secrets.org= file, as it is ignored by =git= by -default. +populate Org templates (Section [[~org-mode~]]). You need to create this +=secrets.org= file, as it is ignored by =git= by default. #+BEGIN_SRC emacs-lisp - (org-babel-load-file "~/.emacs.d/blendoit/secrets.org") + (org-babel-load-file "~/.emacs.d/secrets.org") #+END_SRC * Global key bindings @@ -207,13 +269,8 @@ keyboard shortcuts.] (cua-mode) #+END_SRC - ** Keyboard navigation -#+BEGIN_SRC emacs-lisp - (global-set-key (kbd "C-`") 'delete-other-windows) -#+END_SRC - *** Saving a file #+BEGIN_SRC emacs-lisp @@ -232,6 +289,12 @@ keyboard shortcuts.] (global-set-key (kbd "C-r") 'counsel-recentf) #+END_SRC +*** Make only window + +#+BEGIN_SRC emacs-lisp + (global-set-key (kbd "C-`") 'delete-other-windows) +#+END_SRC + *** Locating a file #+BEGIN_SRC emacs-lisp @@ -402,7 +465,7 @@ format: #+BEGIN_SRC emacs-lisp (setq org-time-stamp-custom-formats - '("%d %b, %Y (%a)" . "%d %b, %Y (%a), at %H:%M")) + '("%d %b. %Y (%a)" . "%d %b. %Y (%a), at %H:%M")) #+END_SRC *** LaTeX export @@ -526,19 +589,19 @@ however cleaner to separate table of contents with the rest of the work. The following makes =TODO= items appear red and =CLOSED= items appear green in Org's LaTeX exports. Very stylish, much flair! -*** Export +*** TODO Export This creates a shorter binding for the most common Org export: Org \rightarrow LaTeX \rightarrow PDF. #+BEGIN_SRC emacs-lisp -(defun my/org-quick-export () - "Org export to PDF and open. - This basically reimplements `C-c C-e C-a l o'." - (interactive) + (defun my/org-quick-export () + "Org async export to PDF and open. + This basically reimplements `C-c C-e C-a l o'." + (interactive) (org-open-file (org-latex-export-to-pdf))) -(global-set-key (kbd "C-c e") 'my/org-quick-export) + (global-set-key (kbd "C-c e") 'my/org-quick-export) #+END_SRC ** TODO ~evil-mode~ @@ -757,7 +820,7 @@ We replace the standard welcome screen with our own. (setq dashboard-banner-logo-title "A modern professional text editor.")) #+END_SRC -*** Mode line +*** TODO Mode line #+NAME: powerline #+BEGIN_SRC emacs-lisp @@ -780,7 +843,7 @@ Get inspiration from ~ibuffer-sidebar~ and create a better sidebar. (show-paren-mode 1) #+END_SRC -*** Colored keywords for those colors +*** Highlight ``color keywords'' in their color This highlights hexadecimal numbers which look like colors, in that same color. @@ -790,6 +853,15 @@ This highlights hexadecimal numbers which look like colors, in that same color. (add-hook 'prog-mode-hook 'rainbow-mode)) #+END_SRC +*** UTF-8 bullet points in =Org mode= + +#+BEGIN_SRC emacs-lisp + (use-package org-bullets + :config + (when (string-equal system-type "gnu/linux") + (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))))) +#+END_SRC + * Editing preferences These customizations enhance editor usability. They are not brought about @@ -910,7 +982,7 @@ describe two themes that were developed purposefully and iteratively. ** My light and dark themes -A highly legible unambiguous and thoughtful theme. +A highly legible, unambiguous, and classic theme. *** Colors @@ -958,20 +1030,20 @@ cursor is a more MS Word-like bar. (setq-default cursor-type 'bar) #+END_SRC -*** Faces +*** Fonts -- ~default~: Hack +- Hack :: ~default~ and ~fixed-pitch~ - Legible, modern monospace font - Strict, sharp, uncompromising -- ~fixed-pitch~: Hack -- ~variable-pitch~: Liberation Sans +- Liberation Sans :: ~variable-pitch~ - Libre alternative to Arial -- ~org-block~: Hermit + - Unoffensive +- Hermit :: ~org-block~, anything Org/meta in general - Slightly wider than Hack - More opinionated shapes - Very legible parentheses -**** ~variable-pitch-mode~ +**** Using proportional fonts when needed We use ~variable-pitch-mode~ for appropriate modes. @@ -983,7 +1055,7 @@ We use ~variable-pitch-mode~ for appropriate modes. **** TODO Default font size Make default font size larger on displays of which the resolution is greater -than =1920x1080=. +than 1920\times1080. #+BEGIN_SRC emacs-lisp #+END_SRC diff --git a/smart-documents.pdf b/smart-documents.pdf Binary files differnew file mode 100644 index 0000000..22120d2 --- /dev/null +++ b/smart-documents.pdf diff --git a/snippets/org-mode/quote b/snippets/org-mode/quote new file mode 100644 index 0000000..633dca7 --- /dev/null +++ b/snippets/org-mode/quote @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: quote +# key: quote +# -- +#+BEGIN_QUOTE +$0 +#+END_QUOTE
\ No newline at end of file diff --git a/snippets/org-mode/src b/snippets/org-mode/src index da052d2..e6da583 100644 --- a/snippets/org-mode/src +++ b/snippets/org-mode/src @@ -1,5 +1,6 @@ -# key: src +# -*- mode: snippet -*- # name: src +# key: src # -- #+BEGIN_SRC ${1:emacs-lisp} $0 diff --git a/themes/blendoit-light-theme.el b/themes/blendoit-light-theme.el index 9fe1d99..0b97d46 100644 --- a/themes/blendoit-light-theme.el +++ b/themes/blendoit-light-theme.el @@ -1,5 +1,5 @@ (deftheme blendoit-light - "Created 2020-09-07.") + "Created 2020-10-04.") (custom-theme-set-faces 'blendoit-light @@ -16,7 +16,7 @@ '(trailing-whitespace ((((class color) (background light)) (:background "red1")) (((class color) (background dark)) (:background "red1")) (t (:inverse-video t)))) '(font-lock-builtin-face ((t (:foreground "dark slate blue")))) '(font-lock-comment-delimiter-face ((t (:foreground "dim gray" :inherit font-lock-comment-face)))) - '(font-lock-comment-face ((t (:slant italic :foreground "slate gray" :inherit variable-pitch)))) + '(font-lock-comment-face ((t (:foreground "slate gray" :slant italic :height 1.1)))) '(font-lock-constant-face ((t (:foreground "dark cyan")))) '(font-lock-function-name-face ((((class color) (min-colors 88) (background light)) (:foreground "Blue1")) (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue")) (((class color) (min-colors 16) (background light)) (:foreground "Blue")) (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue")) (((class color) (min-colors 8)) (:weight bold :foreground "blue")) (t (:weight bold :inverse-video t)))) '(font-lock-keyword-face ((t (:foreground "slate blue")))) @@ -59,10 +59,10 @@ '(org-code ((t (:background "light grey" :foreground "black" :family "Hack")))) '(org-checkbox-statistics-todo ((t (:inherit org-checkbox :foreground "tomato")))) '(org-checkbox-statistics-done ((t (:inherit org-checkbox :foreground "ForestGreen")))) - '(org-verbatim ((t (:inherit shadow)))) - '(font-lock-doc-face ((t (:Family "Liberation Sans" :inherit font-lock-string-face)))) + '(org-verbatim ((t (:inherit fixed-pitch :foreground "DodgerBlue1" :foundry "Hack")))) + '(font-lock-doc-face ((t (:inherit font-lock-string-face :Family "Liberation Sans")))) '(org-document-info ((t (:weight bold)))) - '(org-table ((t (:foreground "SteelBlue" :inherit fixed-pitch)))) + '(org-table ((t (:height 0.8 :family "Hack")))) '(org-block ((t (:height 0.8 :family "Hermit")))) '(org-special-keyword ((t (:inherit org-meta-line)))) '(org-level-1 ((t (:foreground "black" :weight bold :height 1.6)))) |