summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlendoit <blendoit@gmail.com>2020-11-03 22:35:02 -0800
committerBlendoit <blendoit@gmail.com>2020-11-03 22:35:02 -0800
commit6e3eb5e3e221c6f30a49825d6d7b0c752719b52c (patch)
tree215f8ee2c864b70a3cdfd85eebc590eafc88b66c
parentb86c38b9a0c01f9488e88e085d8d4eb19e7b3771 (diff)
Header and mode lines.
-rw-r--r--custom.el3
-rw-r--r--init.el12
-rw-r--r--smart-documents.org87
-rw-r--r--themes/blendoit-light-theme.el2
4 files changed, 82 insertions, 22 deletions
diff --git a/custom.el b/custom.el
index 83bb388..8e105f2 100644
--- a/custom.el
+++ b/custom.el
@@ -15,7 +15,8 @@
'(company-quickhelp-color-foreground "#DCDCCC")
'(custom-enabled-themes nil)
'(custom-safe-themes
- '("e479b796a220addcd20678fbb95018e4945ca574ba9900b54d107ed1569c704c" "46d1602c1e28e6223fec2bcd008312bc57a08e5ccc8c2ac35c40e6a5d2a20244" "57c9cc95433eb236e74a3b501d3bebb2716e1988cf633c47384d33d8a83a7940" "1229a1fe390f71ddeec71efd61129af285d032364a1957f9954845a6c5f617a1" "42350b596ca9d6a283ce13efb9bbb7774064d917e04ea3220ebf32b95a677d60" "07b0edb4d75390504029f7905ca8add46af2c8bb13cec46efb0d880de014464c" "884b3999dfeff6d4f45859239a46b84399ab1b3602dd2ee6d11f3a3e39fe088d" "0c5c0078062fafd063a227b4cebb49b65434ea6e9557e3aaf8bc3212ba986512" "469032293efae7c0c86a95c39cab8b0ff8883cf4af3f2c292313cf6a71195b40" "8fb0949f4229860cf19034b924eb99c664327c9250fb92a2633bdf4b4abaf060" "c3a2a37e84e474c73c2b468553f9b5b73341419f72bbc1f4a4bcc1230ef86c85" "6495716176be0ced4142593b94a410135e0b373b686a869637824260d2f1ca11" "4467b1c8d7cc78fe98345c9c63eb62cf37844dc6868630add365494bde455715" "faeef63cb31f796b4bdf22f38e614934ab34d7deacaeb89b3e9cccf70aac5a85" "370fb305168fea1614535dc9ca30f496918eaca754b6c8969dd77fa872bec695" "e9f0c0c3397d07eb1c6c3551d67fd151e24bc6d72ec678841623ed572677c97a" "5c32236ef318adafe4102f627f330fa8f448046dfd838eef5cc09c7f682cf71f" "e343fecfb8d681186d594002c9b44ce48c2061599d7e4ec635cf1ca2a277a47a" "302dc61dc55600c7424f945dce9e74fba7df19f4a7bfb72aefd93193fa82ede4" "58f1f85248ba913387d1e7ed02a867161b315cfb5acff0c234e013ffd2577d22" "a256abf590bbc3257cc11d91a312e9fe8487dc1b95a5b7b732dd2f96a7fe5a45" "30368d6195cae9298304e6ac0534b90c85b1655965f1206c5c624270f0f46002" "311aa5df3223b5b4a7c638aad3befb4de9c7f46360d52acd1fa2cd2232b1dcbd" default))
+ '("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))
'(indicate-empty-lines t)
diff --git a/init.el b/init.el
index 695891b..ceffb35 100644
--- a/init.el
+++ b/init.el
@@ -10,11 +10,13 @@
;; Emacs will startup faster next time, because it will load
;; a byte-compiled version of our literate configuration file.
-(cond ((file-exists-p (concat my/literate-config ".el"))
- (load my/literate-config))
- ((file-exists-p (concat my/literate-config ".org"))
- (org-babel-load-file (concat my/literate-config ".org")))
- (t (message "No literate configuration file detected.")))
+;; (cond ((file-exists-p (concat my/literate-config ".el"))
+;; (load my/literate-config))
+;; ((file-exists-p (concat my/literate-config ".org"))
+;; (org-babel-load-file (concat my/literate-config ".org")))
+;; (t (message "No literate configuration file detected.")))
+
+(org-babel-load-file (concat my/literate-config ".org"))
(provide 'init)
diff --git a/smart-documents.org b/smart-documents.org
index 965da6a..7682532 100644
--- a/smart-documents.org
+++ b/smart-documents.org
@@ -446,6 +446,33 @@ It seems that starting with Emacs 27.1, Control + mousewheel works.
(global-set-key (kbd "C-+") 'text-scale-increase)
#+END_SRC
+
+** Navigation
+
+*** Move down one line
+
+#+BEGIN_SRC emacs-lisp :tangle yes
+(global-set-key (kbd "M-j") 'next-line)
+#+END_SRC
+
+*** Move up one line
+
+#+BEGIN_SRC emacs-lisp :tangle yes
+(global-set-key (kbd "M-k") 'previous-line)
+#+END_SRC
+
+*** Move left one character
+
+#+BEGIN_SRC emacs-lisp :tangle yes
+(global-set-key (kbd "M-h") 'left-char)
+#+END_SRC
+
+*** Move right one character
+
+#+BEGIN_SRC emacs-lisp :tangle yes
+(global-set-key (kbd "M-l") 'right-char)
+#+END_SRC
+
** Customizing the editor
*** Customize a variable
@@ -588,8 +615,10 @@ them corrupts tables.
org-edit-src-content-indentation 0)
#+END_SRC
-#+BEGIN_SRC emacs-lisp :tangle yes
+We enable the dynamic numbering of headlines in an Org buffer.
+#+BEGIN_SRC emacs-lisp :tangle no
+; (add-hook 'org-mode-hook 'org-num-mode)
#+END_SRC
*** Languages executable in smart documents
@@ -1073,31 +1102,59 @@ The keybinding for opening a recently visited file is described in paragraph
** Frame
-*** TODO Header & mode line
-Complete mode line rewrite. Might require new package.
+*** TODO Header & mode lines
-Top of the buffer is more intuitive for buffer info, bottom is more intuitive
-for buffer action.
+# Top of the buffer is more intuitive for buffer info, bottom is more intuitive
+# for buffer action.
-This is pretty much a gutted out powerline.
-
-**** Header line
+First, we create a function to calculate available width between left and right
+portions of the header and mode line.
+#+NAME: sd-mode-line-render
#+BEGIN_SRC emacs-lisp :tangle yes
+(defun sd-mode-line-render (left right)
+ "Return a string of `window-width' length
+ containing LEFT, and RIGHT aligned respectively."
+ (let* ((available-width (- (window-width) (length left) 2)))
+ (format (format " %%s %%%ds " available-width) left right)))
+#+END_SRC
+
+**** TODO Header line
+
+In Org mode, the document header line will be the title of the document we are
+working on currently.
+
+#+BEGIN_SRC emacs-lisp :tangle no
(add-hook org-mode-hook
- '(lambda ()
- "Set the header line to show `org-document-title'."
+ (lambda ()
+ "Set the header line to show #+TITLE and #+DATE."
(setq header-line-format
- (save-excursion
- (goto-char (point-min))
- (when (re-search-forward "^[[:space:]]*#\\+TITLE:[[:space:]]*\\(.*?\\)[[:space:]]*$" nil t)
- (match-string 1))))
+ (concat (save-excursion
+ (goto-char (point-min))
+ (when (re-search-forward
+ "^[[:space:]]*#\\+TITLE:[[:space:]]*\\(.*?\\)[[:space:]]*$"
+ nil t)
+ (match-string 1)))
+ (save-excursion
+ (goto-char (point-min))
+ (when (re-search-forward
+ "^[[:space:]]*#\\+DATE:[[:space:]]*\\(.*?\\)[[:space:]]*$"
+ nil t)
+ (match-string 1)))))))
#+END_SRC
**** Mode line
+Then, we use the previously declared function to set up our mode line.
+
+#+NAME: mode-line-format
#+BEGIN_SRC emacs-lisp :tangle yes
-(setq mode-line-format )
+(setq-default mode-line-format
+ '((:eval (sd-mode-line-render
+ ;; left
+ (format-mode-line "[%*] %b")
+ ;; right
+ (format-mode-line "Line: %l ")))))
#+END_SRC
** Window
diff --git a/themes/blendoit-light-theme.el b/themes/blendoit-light-theme.el
index c780c07..6d19a22 100644
--- a/themes/blendoit-light-theme.el
+++ b/themes/blendoit-light-theme.el
@@ -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 (:foreground "slate gray" :slant italic :height 1.1))))
+ '(font-lock-comment-face ((t (:foreground "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"))))
Copyright 2019--2024 Marius PETER