From 95e6d6c069f2cb251f656fc32a96eb1a9a076690 Mon Sep 17 00:00:00 2001 From: Blendoit Date: Thu, 29 Oct 2020 23:56:45 -0700 Subject: `sd' packing & unpacking. --- custom.el | 4 ++-- smart-documents.org | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 52 insertions(+), 3 deletions(-) diff --git a/custom.el b/custom.el index 6b1340d..d5e7fa3 100644 --- a/custom.el +++ b/custom.el @@ -15,7 +15,7 @@ '(company-quickhelp-color-foreground "#DCDCCC") '(custom-enabled-themes nil) '(custom-safe-themes - '("0c5c0078062fafd063a227b4cebb49b65434ea6e9557e3aaf8bc3212ba986512" "469032293efae7c0c86a95c39cab8b0ff8883cf4af3f2c292313cf6a71195b40" "8fb0949f4229860cf19034b924eb99c664327c9250fb92a2633bdf4b4abaf060" "c3a2a37e84e474c73c2b468553f9b5b73341419f72bbc1f4a4bcc1230ef86c85" "6495716176be0ced4142593b94a410135e0b373b686a869637824260d2f1ca11" "4467b1c8d7cc78fe98345c9c63eb62cf37844dc6868630add365494bde455715" "faeef63cb31f796b4bdf22f38e614934ab34d7deacaeb89b3e9cccf70aac5a85" "370fb305168fea1614535dc9ca30f496918eaca754b6c8969dd77fa872bec695" "e9f0c0c3397d07eb1c6c3551d67fd151e24bc6d72ec678841623ed572677c97a" "5c32236ef318adafe4102f627f330fa8f448046dfd838eef5cc09c7f682cf71f" "e343fecfb8d681186d594002c9b44ce48c2061599d7e4ec635cf1ca2a277a47a" "302dc61dc55600c7424f945dce9e74fba7df19f4a7bfb72aefd93193fa82ede4" "58f1f85248ba913387d1e7ed02a867161b315cfb5acff0c234e013ffd2577d22" "a256abf590bbc3257cc11d91a312e9fe8487dc1b95a5b7b732dd2f96a7fe5a45" "30368d6195cae9298304e6ac0534b90c85b1655965f1206c5c624270f0f46002" "311aa5df3223b5b4a7c638aad3befb4de9c7f46360d52acd1fa2cd2232b1dcbd" default)) + '("46d1602c1e28e6223fec2bcd008312bc57a08e5ccc8c2ac35c40e6a5d2a20244" "57c9cc95433eb236e74a3b501d3bebb2716e1988cf633c47384d33d8a83a7940" "1229a1fe390f71ddeec71efd61129af285d032364a1957f9954845a6c5f617a1" "42350b596ca9d6a283ce13efb9bbb7774064d917e04ea3220ebf32b95a677d60" "07b0edb4d75390504029f7905ca8add46af2c8bb13cec46efb0d880de014464c" "884b3999dfeff6d4f45859239a46b84399ab1b3602dd2ee6d11f3a3e39fe088d" "0c5c0078062fafd063a227b4cebb49b65434ea6e9557e3aaf8bc3212ba986512" "469032293efae7c0c86a95c39cab8b0ff8883cf4af3f2c292313cf6a71195b40" "8fb0949f4229860cf19034b924eb99c664327c9250fb92a2633bdf4b4abaf060" "c3a2a37e84e474c73c2b468553f9b5b73341419f72bbc1f4a4bcc1230ef86c85" "6495716176be0ced4142593b94a410135e0b373b686a869637824260d2f1ca11" "4467b1c8d7cc78fe98345c9c63eb62cf37844dc6868630add365494bde455715" "faeef63cb31f796b4bdf22f38e614934ab34d7deacaeb89b3e9cccf70aac5a85" "370fb305168fea1614535dc9ca30f496918eaca754b6c8969dd77fa872bec695" "e9f0c0c3397d07eb1c6c3551d67fd151e24bc6d72ec678841623ed572677c97a" "5c32236ef318adafe4102f627f330fa8f448046dfd838eef5cc09c7f682cf71f" "e343fecfb8d681186d594002c9b44ce48c2061599d7e4ec635cf1ca2a277a47a" "302dc61dc55600c7424f945dce9e74fba7df19f4a7bfb72aefd93193fa82ede4" "58f1f85248ba913387d1e7ed02a867161b315cfb5acff0c234e013ffd2577d22" "a256abf590bbc3257cc11d91a312e9fe8487dc1b95a5b7b732dd2f96a7fe5a45" "30368d6195cae9298304e6ac0534b90c85b1655965f1206c5c624270f0f46002" "311aa5df3223b5b4a7c638aad3befb4de9c7f46360d52acd1fa2cd2232b1dcbd" default)) '(fci-rule-color "#383838") '(fringe-mode 0 nil (fringe)) '(indicate-empty-lines t) @@ -30,7 +30,7 @@ '(org-log-done 'time) '(org-startup-align-all-tables t) '(package-selected-packages - '(dashboard undo-tree hungry-delete smooth-scroll smooth-scrolling delight yasnippet-snippets yasnippet org-sticky-header awesome-tab tabbar-ruler tabbar-mode linum-relative dumb-jump csv-mode rainbow-mode org-mouse projectile minimap gnuplot ledger-mode company-mode wombat-theme wombar-theme which-key srefactor-lisp srefactor all-the-icons flycheck ibuffer-sidebar pdf-tools magit rainbow-delimiters smartparens mixed-pitch org-bullets use-package tabbar powerline ivy-hydra flatui-theme evil counsel company benchmark-init)) + '(mode-icons dashboard undo-tree hungry-delete smooth-scroll smooth-scrolling delight yasnippet-snippets yasnippet org-sticky-header awesome-tab tabbar-ruler tabbar-mode linum-relative dumb-jump csv-mode rainbow-mode org-mouse projectile minimap gnuplot ledger-mode company-mode wombat-theme wombar-theme which-key srefactor-lisp srefactor all-the-icons flycheck ibuffer-sidebar pdf-tools magit rainbow-delimiters smartparens mixed-pitch org-bullets use-package tabbar powerline ivy-hydra flatui-theme evil counsel company benchmark-init)) '(pdf-view-midnight-colors '("#DCDCCC" . "#383838")) '(save-place-mode t) '(send-mail-function 'smtpmail-send-it) diff --git a/smart-documents.org b/smart-documents.org index 3765038..109c9b2 100644 --- a/smart-documents.org +++ b/smart-documents.org @@ -1,4 +1,4 @@ -# -*- mode: org; -*- # +# -*- mode: org; -*- #+TITLE: Smart Documents #+AUTHOR: Marius Peter @@ -64,6 +64,45 @@ You can always press ~f1~ to access Emacs in-built help. The following code blocks are normally evaluated once---upon starting Emacs for the first time. +** TODO Unpacking our literate configuration +:PROPERTIES: +:sd-unpack-path: sd.el +:END: + +#+BEGIN_SRC emacs-lisp :tangle no +(defvar sd-packed-p t + "Boolean to track literate configuration packed/unpacked status.") + +(defvar sd-unpack-sections (org-property-values "sd-unpack-path") + "List of target sections in `my/literate-config' to be unpacked into `user-emacs-directory'.") + +(defun sd-unpack-sections () + "Unpack literate configuration into `emacs-user-directory'." + (interactive) + (mapcar 'sd-unpack sd-unpack-sections) + ) + +(defun sd-unpack-section (section) + "Unpack SECTION into `user-emacs-directory'. +If nil, unpack section under point. +Make go through list of headings and unpack first matching SECTION." + (interactive) + (if (not section) + (insert (concat "\nThe contents of this Section was automatically moved to\n=" + user-emacs-directory (org-entry-get nil "sd-unpack-path") "=.\n" + "Use `sd-pack-section' to copy the contents back into this section.")))) + + +(defun sd-pack-section () + "Pack SECTION into `my/literate-config'." + (interactive) + (message "foobar!!!")) + +(global-set-key (kbd "C-t") 'sd-pack-section) + +(sd-unpack "init.el") +#+END_SRC + ** TODO User details One advantage of working with /Smart Documents/ is that they can automatically @@ -108,6 +147,13 @@ https://git-scm.com/download/win] * Early setup ** The first file to load +:PROPERTIES: +:sd-unpack-path: init.el +:END: + +The contents of this Section was automatically moved to +=~/.emacs.d/init.el=. +Use `sd-pack-section' to copy the contents back into this section. This is the very first user-editable file loaded by Emacs.[fn::This feature became available in version 27.1.] In it, we disable GUI elements that would @@ -116,6 +162,9 @@ otherwise be loaded and displayed once Emacs is ready to accept user input. It can be found here: [[file:early-init.el]] ** The second file to load +:PROPERTIES: +:sd-unpack-path: early-init.el +:END: #+BEGIN_QUOTE Traditionally, file =~/.emacs= is used as the init file, although Emacs also -- cgit v1.2.3