From bbbea78d848e129fbb5f60d1069dc3da0f20786c Mon Sep 17 00:00:00 2001 From: Blendoit Date: Thu, 5 Nov 2020 21:54:03 -0800 Subject: Start work on sd-document-properties. --- custom.el | 2 +- smart-documents.org | 123 +++++++++++++++++++++++++++-------------- smart-documents.pdf | Bin 237863 -> 242223 bytes themes/blendoit-light-theme.el | 14 +++-- 4 files changed, 90 insertions(+), 49 deletions(-) diff --git a/custom.el b/custom.el index 93653be..ec70032 100644 --- a/custom.el +++ b/custom.el @@ -15,7 +15,7 @@ '(company-quickhelp-color-foreground "#DCDCCC") '(custom-enabled-themes nil) '(custom-safe-themes - '("bac014130231bcb21409a5ba0368ae6a437d36cb3cd710a814c2b8399dacd0a3" "3db2664cf7a2f3ca8add66736e8b432ad7aed88159c74dc220ffdc0580d37ffa" "41d8c624783c3bf1624ac595936a6968fbd7297ffdc40a0c9b080fa750027df0" "abf6e5f8aa2af79ac329a7bfcac3111dab0025ce3eaea24e424fb9e3e77e1162" "6dd0e1980e88c5bc5c4c9ab1e8b16b13287a4fa5a2e11970c0d26dfbcf2d62f3" "e479b796a220addcd20678fbb95018e4945ca574ba9900b54d107ed1569c704c" "46d1602c1e28e6223fec2bcd008312bc57a08e5ccc8c2ac35c40e6a5d2a20244" "57c9cc95433eb236e74a3b501d3bebb2716e1988cf633c47384d33d8a83a7940" "1229a1fe390f71ddeec71efd61129af285d032364a1957f9954845a6c5f617a1" "42350b596ca9d6a283ce13efb9bbb7774064d917e04ea3220ebf32b95a677d60" "07b0edb4d75390504029f7905ca8add46af2c8bb13cec46efb0d880de014464c" "884b3999dfeff6d4f45859239a46b84399ab1b3602dd2ee6d11f3a3e39fe088d" "0c5c0078062fafd063a227b4cebb49b65434ea6e9557e3aaf8bc3212ba986512" "469032293efae7c0c86a95c39cab8b0ff8883cf4af3f2c292313cf6a71195b40" "8fb0949f4229860cf19034b924eb99c664327c9250fb92a2633bdf4b4abaf060" "c3a2a37e84e474c73c2b468553f9b5b73341419f72bbc1f4a4bcc1230ef86c85" "6495716176be0ced4142593b94a410135e0b373b686a869637824260d2f1ca11" "4467b1c8d7cc78fe98345c9c63eb62cf37844dc6868630add365494bde455715" "faeef63cb31f796b4bdf22f38e614934ab34d7deacaeb89b3e9cccf70aac5a85" "370fb305168fea1614535dc9ca30f496918eaca754b6c8969dd77fa872bec695" "e9f0c0c3397d07eb1c6c3551d67fd151e24bc6d72ec678841623ed572677c97a" "5c32236ef318adafe4102f627f330fa8f448046dfd838eef5cc09c7f682cf71f" "e343fecfb8d681186d594002c9b44ce48c2061599d7e4ec635cf1ca2a277a47a" "302dc61dc55600c7424f945dce9e74fba7df19f4a7bfb72aefd93193fa82ede4" "58f1f85248ba913387d1e7ed02a867161b315cfb5acff0c234e013ffd2577d22" "a256abf590bbc3257cc11d91a312e9fe8487dc1b95a5b7b732dd2f96a7fe5a45" "30368d6195cae9298304e6ac0534b90c85b1655965f1206c5c624270f0f46002" "311aa5df3223b5b4a7c638aad3befb4de9c7f46360d52acd1fa2cd2232b1dcbd" default)) + '("8bc595fa3d4cde8770ec075aa939bff9ba28f3e70fe34292a43e22690bc63c76" "ab538dce25085abac8ab09b184e9cef8273082a1b2a792f1bf1bf08ecc30056a" "0326fd263f840b21da906e36c54976e211cfcc252800e6ee7dad4a7eb5a3e819" "77dfce3ef0bdf852a7a1b3527aa384c3c895eec7792a68c2d694b7341364da26" "1692d3b1f4bf5c6c55dd090d6a10c613c0b213510892ae305c1f2518cb1a3ab3" "7ddce903be67800840ef2660310123e2ee11c8ec716ac54333d961307389ccde" "95ea953c58a6510531acf2231d9bddad92015214dce68e8ffe216b51237a3a5f" "47ff07593ae6fc4069b49ee32b0f7422239ad3b6619dc37358b9e76c4b014e81" "8a7a94e776727c6ff6ac14ae88826281eea80c687ffee71a8b188e415b737525" "566f33a94ac1f29db041d55a22fb677b1f9abd02a3ea529ac2b67b93624247ac" "bac014130231bcb21409a5ba0368ae6a437d36cb3cd710a814c2b8399dacd0a3" "3db2664cf7a2f3ca8add66736e8b432ad7aed88159c74dc220ffdc0580d37ffa" "41d8c624783c3bf1624ac595936a6968fbd7297ffdc40a0c9b080fa750027df0" "abf6e5f8aa2af79ac329a7bfcac3111dab0025ce3eaea24e424fb9e3e77e1162" "6dd0e1980e88c5bc5c4c9ab1e8b16b13287a4fa5a2e11970c0d26dfbcf2d62f3" "e479b796a220addcd20678fbb95018e4945ca574ba9900b54d107ed1569c704c" "46d1602c1e28e6223fec2bcd008312bc57a08e5ccc8c2ac35c40e6a5d2a20244" "57c9cc95433eb236e74a3b501d3bebb2716e1988cf633c47384d33d8a83a7940" "1229a1fe390f71ddeec71efd61129af285d032364a1957f9954845a6c5f617a1" "42350b596ca9d6a283ce13efb9bbb7774064d917e04ea3220ebf32b95a677d60" "07b0edb4d75390504029f7905ca8add46af2c8bb13cec46efb0d880de014464c" "884b3999dfeff6d4f45859239a46b84399ab1b3602dd2ee6d11f3a3e39fe088d" "0c5c0078062fafd063a227b4cebb49b65434ea6e9557e3aaf8bc3212ba986512" "469032293efae7c0c86a95c39cab8b0ff8883cf4af3f2c292313cf6a71195b40" "8fb0949f4229860cf19034b924eb99c664327c9250fb92a2633bdf4b4abaf060" "c3a2a37e84e474c73c2b468553f9b5b73341419f72bbc1f4a4bcc1230ef86c85" "6495716176be0ced4142593b94a410135e0b373b686a869637824260d2f1ca11" "4467b1c8d7cc78fe98345c9c63eb62cf37844dc6868630add365494bde455715" "faeef63cb31f796b4bdf22f38e614934ab34d7deacaeb89b3e9cccf70aac5a85" "370fb305168fea1614535dc9ca30f496918eaca754b6c8969dd77fa872bec695" "e9f0c0c3397d07eb1c6c3551d67fd151e24bc6d72ec678841623ed572677c97a" "5c32236ef318adafe4102f627f330fa8f448046dfd838eef5cc09c7f682cf71f" "e343fecfb8d681186d594002c9b44ce48c2061599d7e4ec635cf1ca2a277a47a" "302dc61dc55600c7424f945dce9e74fba7df19f4a7bfb72aefd93193fa82ede4" "58f1f85248ba913387d1e7ed02a867161b315cfb5acff0c234e013ffd2577d22" "a256abf590bbc3257cc11d91a312e9fe8487dc1b95a5b7b732dd2f96a7fe5a45" "30368d6195cae9298304e6ac0534b90c85b1655965f1206c5c624270f0f46002" "311aa5df3223b5b4a7c638aad3befb4de9c7f46360d52acd1fa2cd2232b1dcbd" default)) '(electric-indent-mode nil) '(fci-rule-color "#383838") '(fringe-mode 0 nil (fringe)) diff --git a/smart-documents.org b/smart-documents.org index 431cd57..dbe5590 100644 --- a/smart-documents.org +++ b/smart-documents.org @@ -67,7 +67,7 @@ the first time. "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'.") + "List of target sections in `my/literate-config' to be unpacked.") (defun sd-unpack-sections () "Unpack literate configuration into `emacs-user-directory'." @@ -166,7 +166,8 @@ 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. -From the GNU website[fn::[[https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html]]] +From the GNU +website[fn::[[https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html]]] #+END_QUOTE This file can be found here: [[file:init.el]] @@ -266,13 +267,12 @@ Backups are very important! #+BEGIN_SRC emacs-lisp :tangle yes (setq backup-directory-alist `((".*" . ,temporary-file-directory)) - auto-save-file-name-transforms `((".*" ,temporary-file-directory t)) - backup-by-copying t ; Don't delink hardlinks - version-control t ; Use version numbers on backups - delete-old-versions t ; Automatically delete excess backups - kept-new-versions 20 ; how many of the newest versions to keep - kept-old-versions 5 ; and how many of the old - ) + auto-save-file-name-transforms `((".*" ,temporary-file-directory t)) + backup-by-copying t ; Don't delink hardlinks + version-control t ; Use version numbers on backups + delete-old-versions t ; Automatically delete excess backups + kept-new-versions 20 ; how many of the newest versions to keep + kept-old-versions 5) ; and how many of the old #+END_SRC ** Initial and default frames @@ -450,11 +450,12 @@ It seems that starting with Emacs 27.1, Control + mousewheel works. ** Navigation -=Alt= (=Meta=) is the privileged key for motion in a buffer. It precedes a -numerical argument, and a movement command. You may navigate in a buffer by -keeping =Alt= pressed, optionally inputting a number from the keypad or number -row, then pressing any of the following movement keys: =j=, =k=, =h=, and -=l=. You will move in that direction by the according numerical argument. +=Alt= (=Meta=) is the privileged key for motion in a buffer. It is followed by +an optional numerical argument, and a movement command. You may navigate in a +buffer by keeping =Alt= pressed, optionally inputting a number from the keypad +or number row, then pressing any of the following movement keys: =j=, =k=, =h=, +and =l=. You will move in that direction in the amount of the numerical +argument. #+NAME: keybinding-navigation #+CAPTION[Navigation keybindings]: Navigation keybindings. @@ -466,7 +467,6 @@ row, then pressing any of the following movement keys: =j=, =k=, =h=, and | Word | =M-f= | =M-b= | | Paragraph | =M-a= | =M-e= | - We prevent Org mode from overriding preferred navigation keys. #+BEGIN_SRC emacs-lisp :tangle yes @@ -826,17 +826,13 @@ Get inspiration from ~ibuffer-sidebar~ and create a better sidebar. ;; (load-file) #+END_SRC -*** Icons +# *** Icons -Icon fonts +# Icon fonts -#+BEGIN_SRC emacs-lisp :tangle yes -(use-package all-the-icons) -#+END_SRC - -#+BEGIN_SRC emacs-lisp :tangle yes -(use-package mode-icons) -#+END_SRC +# #+BEGIN_SRC emacs-lisp :tangle yes +# (use-package all-the-icons) +# #+END_SRC *** Better parentheses @@ -868,11 +864,17 @@ This highlights hexadecimal numbers which look like colors, in that same color. * ~org-mode~ -Phew, I can finally introduce Org mode! I am so *excited*. +Org mode is so significant that this section of the paper deserves its own +introduction. + +** Introduction + +Phew, after all this initialization, I can finally introduce Org mode! I am so +*excited*. Org mode replaces aword processor, a presentation creator, and a spreadsheet -editor. IMHO, the spreadsheet ability captures more than 80% use cases wherein -one wishes to include a table in a text document destined for physical +editor. The spreadsheet ability captures more than 80% use cases wherein one +wishes to include a table in a text document destined for physical publication. (It is clear that Excel spreadsheets are /not/ destined for physical publication---simply attempt to print an Excel spreadsheet with the default settings.) In my opinion, Org mode matches all /useful/ features of @@ -911,26 +913,33 @@ Org base directory is in user home on GNU/Linux, or in =AppData= in MS Windows. (setq org-directory (concat user-emacs-directory "~/org")) #+END_SRC -First, we hide markup symbols for *bold*, /italic/, _underlined_ and -+strikethrough+ text, and ensure our document appears indented upon -loading:[fn::It /appears/ indented, but the underlying plaintext file does not -contain tab characters!] +** TODO Org cosmetics + +First, we ensure the display of markup symbols for *bold*, /italic/, +_underlined_ and +strikethrough+ text, and ensure our document appears indented +upon loading.[fn::It /appears/ indented, but the underlying plaintext file does +not contain tab characters!] -For the time being, I will in fact display emphasis markers, because hiding -them corrupts tables. +We then set values for many other Org-related cosmetic symbols. -#+NAME: org-format #+BEGIN_SRC emacs-lisp :tangle yes -(setq org-hide-emphasis-markers nil - org-startup-indented t - org-src-preserve-indentation nil - org-edit-src-content-indentation 0) + (setq org-hide-emphasis-markers nil + org-startup-indented t + org-src-preserve-indentation nil + org-edit-src-content-indentation 2 + org-ellipsis "  ") ; folding symbol #+END_SRC -We enable the dynamic numbering of headlines in an Org buffer. +*** Dynamic numbering of headlines + +We enable the dynamic numbering of headlines in an Org buffer. We also set the +numbering face to ~org-special-keyword~, which specifies a ~:background white~ +attribute. This is necessary because otherwise, the background of the numbering +may be overridden by the ~TODO~ face attribute ~:background coral~. #+BEGIN_SRC emacs-lisp :tangle yes (add-hook 'org-mode-hook 'org-num-mode) +(setq org-num-face 'org-special-keyword) #+END_SRC By default, we hide Org document properties such as =#+TITLE=, =#+AUTHOR=, and @@ -939,13 +948,43 @@ populated. We can nevertheless always access those properties and edit them manually, with a simple keyboard shortcut (cf. Section [[Open Org mode document properties]]). -#+BEGIN_SRC emacs-lisp :tangle yes +*** Document properties + +#+BEGIN_SRC emacs-lisp :tangle no +(defun org-property-value (property) +"Return the value of a given Org document property." +(save-excursion + (goto-char (point-min)) + (when (re-search-forward + (concat + "^[[:space:]]*#\\+" + property + ":[[:space:]]*\\(.*?\\)[[:space:]]*$") + nil t) + (match-string 1)))) + (defun sd-document-properties () -"Open separate buffer enabling the editing of Org mode properties.") + "Open separate buffer to edit Org mode properties." + (interactive) + (let ((title (car (org-property-value "TITLE"))) + (date (org-property-value "DATE"))) + (with-output-to-temp-buffer "Smart Document Properties" + (print title) + (print date)))) #+END_SRC +#+RESULTS: +: sd-document-properties + +#+BEGIN_SRC emacs-lisp :tangle yes +(add-hook 'org-src-mode-hook + '(lambda () + "Disable flycheck for `emacs-lisp-mode'." + (setq-local flycheck-disabled-checkers + '(emacs-lisp-checkdoc)))) +#+END_SRC -** TODO Languages executable in smart documents +** Languages executable in Smart Documents The following languages can be written inside =SRC= blocks, in view of being executed by the Org Babel backend. diff --git a/smart-documents.pdf b/smart-documents.pdf index 8ea51f4..47e177f 100644 Binary files a/smart-documents.pdf and b/smart-documents.pdf differ diff --git a/themes/blendoit-light-theme.el b/themes/blendoit-light-theme.el index 27c441b..c31b006 100644 --- a/themes/blendoit-light-theme.el +++ b/themes/blendoit-light-theme.el @@ -1,5 +1,5 @@ (deftheme blendoit-light - "Created 2020-11-04.") + "Created 2020-11-05.") (custom-theme-set-faces 'blendoit-light @@ -11,12 +11,12 @@ '(minibuffer-prompt ((t (:inherit org-meta-line)))) '(highlight ((t (:background "deep sky blue" :foreground "white")))) '(region ((t (:background "gainsboro")))) - '(shadow ((t (:foreground "dark slate gray")))) + '(shadow ((t (:foreground "light slate gray")))) '(secondary-selection ((((class color) (min-colors 88) (background light)) (:background "yellow1")) (((class color) (min-colors 88) (background dark)) (:background "SkyBlue4")) (((class color) (min-colors 16) (background light)) (:background "yellow")) (((class color) (min-colors 16) (background dark)) (:background "SkyBlue4")) (((class color) (min-colors 8)) (:foreground "black" :background "cyan")) (t (:inverse-video t)))) '(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 (:foreground "slate gray" :slant italic)))) + '(font-lock-comment-delimiter-face ((t (:foreground "slate gray")))) + '(font-lock-comment-face ((t (:foreground "light slate gray" :slant italic)))) '(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")))) @@ -64,7 +64,7 @@ '(org-document-info ((t (:weight bold)))) '(org-table ((t (:height 0.8 :family "Hack")))) '(org-block ((t (:height 0.8 :family "Hermit")))) - '(org-special-keyword ((t (:inherit org-meta-line :weight bold :background "white")))) + '(org-special-keyword ((t (:background "white" :weight bold :inherit org-meta-line)))) '(org-level-1 ((t (:foreground "black" :weight bold :height 1.6 :family "Jost*")))) '(org-level-2 ((t (:foreground "gray30" :weight bold :height 1.4)))) '(org-level-3 ((t (:foreground "gray45" :weight bold :height 1.2)))) @@ -86,6 +86,8 @@ '(tab-line-tab-current ((t (:inherit tab-line-tab :background "grey85" :foreground "red")))) '(tab-line-close-highlight ((t (:foreground "red")))) '(tab-line-highlight ((default (:inherit (tab-line-tab))))) - '(default ((t (:background "white" :foreground "black" :height 140 :family "Hack"))))) + '(default ((t (:background "white" :foreground "black" :height 140 :family "Hack")))) + '(org-quote ((t (:inherit variable-pitch :slant italic)))) + '(org-ellipsis ((t (:inherit shadow :background "white"))))) (provide-theme 'blendoit-light) -- cgit v1.2.3