Organizational bug fix

This commit is contained in:
Howard Abrams 2024-06-03 22:14:37 -07:00
parent 13c579c354
commit 2bf50e1f78
5 changed files with 132 additions and 122 deletions

View file

@ -316,12 +316,49 @@ Pressing the ~SPACE~ can activate a /leader key sequence/ I define in my [[file:
#+end_src
This extends the =use-package= to include a =:general= keybinding section.
Since I seldom remember keybindings, or even function names, for major-modes, I pull them all together into a nice table using the [[https://github.com/jerrypnz/major-mode-hydra.el][Major Mode Hydra]] project:
Since I seldom remember keybindings, or even function names, for major-modes, I pull them all together into a nice table using the [[https://github.com/jerrypnz/major-mode-hydrajjj0.el][Major Mode Hydra]] project:
#+begin_src emacs-lisp
(use-package major-mode-hydra
:config
(global-set-key (kbd "s-,") #'major-mode-hydra))
#+end_src
For this feature, I may want to pull it out into its own file, so as to keep all of its features together... however, those feature often /depend/ of the functions they are calling. If so, we would have a series like this:
#+begin_src emacs-lisp
(use-package major-mode-hydra
:config
(major-mode-hydra-define Info-mode (:quit-key "q")
("Overview"
(("d" Info-directory "Directory")
("t" Info-top-node "Top")
("T" Info-toc "Contents"))
"Goto"
(("m" link-hint-open-link "Menu...")
("n" Info-goto-node "Node...")
("i" Info-index "Index..."))
"History"
(("M-h" Info-history "List")
("H" Info-history-back "Back" :color pink)
("L" Info-history-forward "Forward" :color pink))
"Navigation"
(("u" Info-up "Up" :color pink)
("p" Info-backward-node "Backward" :color pink)
("n" Info-forward-node "Forward" :color pink))
"References"
(("l" Info-follow-reference "Choose")
("j" Info-next-reference "Next" :color pink)
("k" Info-prev-reference "Previous" :color pink))
"Scroll"
(("SPC" Info-scroll-up "Up" :color pink)
("DEL" Info-scroll-down "Down" :color pink)
("RET" Info-follow-nearest-node "Open"))
"Misc"
(("o" org-store-link "Store link")
("b" Info-bookmark-jump "Bookmark")
("w" Info-goto-node-web "View on Web")))))
#+end_src
** Additional Global Packages
The following defines my use of the Emacs completion system. Ive decided my /rules/ will be:
- Nothing should automatically appear; that is annoying and distracting.

View file

@ -130,92 +130,6 @@ And if I cant find the cursor, and dont want to move it to see it, I can h
(use-package pulsar
:bind ("<f8>" . pulsar-pulse-line))
#+end_src
* Themes
One does get used to a particular collection of colors. After happily using Steve Purcells Tomorrow theme for many years, I decided to push it a little /warmer/.
#+begin_src emacs-lisp
(use-package flexoki-themes
:config
(load-theme 'flexoki-themes-dark t)
(defun ha-flexoki-themes-update ()
"Slight tweaks to the flexoki-themes.
I found the background a tad too stark."
(if (eq flexoki-themes-set-theme 'dark)
(progn
(set-face-attribute 'default nil :background "#161514")
(set-face-attribute 'region nil :background "#bc5215")
(set-face-attribute 'org-block nil :background "#1b1a19")
(set-face-attribute 'org-block-begin-line nil :background "#1d1c1b")
(set-face-attribute 'org-block-begin-line nil :background "#1d1c1b"))
(set-face-attribute 'region nil :background "#da702c")
(set-face-attribute 'org-block-begin-line nil :foreground "#fffcf0")))
:custom
(flexoki-themes-set-theme 'dark)
(flexoki-themes-use-bold-keywords t)
(flexoki-themes-use-bold-builtins t)
(flexoki-themes-use-italic-comments t)
:hook (flexoki-themes-after-load-themes . ha-flexoki-themes-update))
#+end_src
Most of the time, Emacs is on my desk is a darkened room, so I choose the dark theme:
#+begin_src emacs-lisp
(defun laptop-inside ()
"Customize the theme for inside programming."
(interactive)
(load-theme 'flexoki-themes-dark t)
(ha-word-processor-fonts))
#+end_src
But, when feeling adventurous, I /sometimes/ take my laptop outside:
#+begin_src emacs-lisp
(defun laptop-in-the-sun ()
"Customize the theme for outside programming."
(interactive)
(load-theme 'flexoki-themes-light t)
(ha-word-processor-fonts))
#+end_src
Ive been playing around with making the current window more pronounced.
This isnt needed as much with the [[*Window Dimmer][Window Dimmer]] feature, but if I do, this would be the settings:
#+begin_src emacs-lisp :tangle no
(set-face-attribute 'mode-line nil :background "#cccccc")
(set-face-attribute 'mode-line-inactive nil :background "#888888")
#+end_src
Oh, and turn off the line highlighting:
#+begin_src emacs-lisp
(global-hl-line-mode -1)
#+end_src
And of course, the default is /inside/ where it is dark and safe:
#+begin_src emacs-lisp
(laptop-inside)
#+end_src
* Full Size Frame
Taken from [[https://emacsredux.com/blog/2020/12/04/maximize-the-emacs-frame-on-startup/][this essay]], I figured I would start the initial frame automatically in fullscreen, but not any subsequent frames (as this could be part of the capturing system).
#+begin_src emacs-lisp
(add-to-list 'initial-frame-alist '(fullscreen . maximized))
#+end_src
But when capturing, I subsequently open smaller frames that shouldnt be /odd looking/:
#+begin_src emacs-lisp
(add-to-list 'default-frame-alist '(ns-transparent-titlebar . t))
(add-to-list 'default-frame-alist '(ns-appearance . dark))
#+end_src
Now that Im using v29 of Emacs, I can /un-decorate/ the non-full-sized frames:
#+begin_src emacs-lisp
(add-to-list 'default-frame-alist '(undecorated-round . t))
#+end_src
* Font Configuration
Am I ever really ever satisfied with any font? I regularly change my font based on the monospace du jour... [[http://blogs.adobe.com/typblography/2012/09/source-code-pro.html][Source Code Pro]] is attractive, and has been a staple on every programmers' screen. However, we all want ligatures, [[https://github.com/i-tu/Hasklig][Hasklig]] is a nice font that is thinner and easier to read than [[https://github.com/tonsky/FiraCode][Fira]], but [[https://typeof.net/Iosevka/][Iosevka]] seems to have it all. Oh, Microsoft just gave us [[https://docs.microsoft.com/en-us/windows/terminal/cascadia-code][Cascadia]] and that seems shiny. However, the [[https://github.com/ryanoasis/nerd-fonts][Nerd Font project]] adds the ligatures as well as all the other niceties to a font.
@ -382,8 +296,8 @@ Which font to choose?
#+begin_src emacs-lisp
(use-package mixed-pitch
:hook
(text-mode . mixed-pitch-mode))
:straight (:host github :repo "jabranham/mixed-pitch")
:hook (text-mode . mixed-pitch-mode))
#+end_src
** Zooming or Increasing Font Size
Do we want to increase the size of font in a single window (using =text-scale-increase=), or globally (using my new =font-size-increase=)?
@ -417,6 +331,93 @@ And some keybindings to call them:
(global-set-key (kbd "s-=") 'font-size-increase)
(global-set-key (kbd "s--") 'font-size-decrease)
#+end_src
* Themes
One does get used to a particular collection of colors. After happily using Steve Purcells Tomorrow theme for many years, I decided to push it a little /warmer/.
#+begin_src emacs-lisp
(use-package flexoki-themes
:straight (:host github :repo "crmsnbleyd/flexoki-emacs-theme")
:config
(load-theme 'flexoki-themes-dark t)
(defun ha-flexoki-themes-update ()
"Slight tweaks to the flexoki-themes.
I found the background a tad too stark."
(if (eq flexoki-themes-set-theme 'dark)
(progn
(set-face-attribute 'default nil :background "#161514")
(set-face-attribute 'region nil :background "#bc5215")
(set-face-attribute 'org-block nil :background "#1b1a19")
(set-face-attribute 'org-block-begin-line nil :background "#1d1c1b")
(set-face-attribute 'org-block-begin-line nil :background "#1d1c1b"))
(set-face-attribute 'region nil :background "#da702c")
(set-face-attribute 'org-block-begin-line nil :foreground "#fffcf0")))
:custom
(flexoki-themes-set-theme 'dark)
(flexoki-themes-use-bold-keywords t)
(flexoki-themes-use-bold-builtins t)
(flexoki-themes-use-italic-comments t)
:hook (flexoki-themes-after-load-themes . ha-flexoki-themes-update))
#+end_src
Most of the time, Emacs is on my desk is a darkened room, so I choose the dark theme:
#+begin_src emacs-lisp
(defun laptop-inside ()
"Customize the theme for inside programming."
(interactive)
(load-theme 'flexoki-themes-dark t)
(ha-word-processor-fonts))
#+end_src
But, when feeling adventurous, I /sometimes/ take my laptop outside:
#+begin_src emacs-lisp
(defun laptop-in-the-sun ()
"Customize the theme for outside programming."
(interactive)
(load-theme 'flexoki-themes-light t)
(ha-word-processor-fonts))
#+end_src
Ive been playing around with making the current window more pronounced.
This isnt needed as much with the [[*Window Dimmer][Window Dimmer]] feature, but if I do, this would be the settings:
#+begin_src emacs-lisp :tangle no
(set-face-attribute 'mode-line nil :background "#cccccc")
(set-face-attribute 'mode-line-inactive nil :background "#888888")
#+end_src
Oh, and turn off the line highlighting:
#+begin_src emacs-lisp
(global-hl-line-mode -1)
#+end_src
And of course, the default is /inside/ where it is dark and safe:
#+begin_src emacs-lisp
(laptop-inside)
#+end_src
* Full Size Frame
Taken from [[https://emacsredux.com/blog/2020/12/04/maximize-the-emacs-frame-on-startup/][this essay]], I figured I would start the initial frame automatically in fullscreen, but not any subsequent frames (as this could be part of the capturing system).
#+begin_src emacs-lisp
(add-to-list 'initial-frame-alist '(fullscreen . maximized))
#+end_src
But when capturing, I subsequently open smaller frames that shouldnt be /odd looking/:
#+begin_src emacs-lisp
(add-to-list 'default-frame-alist '(ns-transparent-titlebar . t))
(add-to-list 'default-frame-alist '(ns-appearance . dark))
#+end_src
Now that Im using v29 of Emacs, I can /un-decorate/ the non-full-sized frames:
#+begin_src emacs-lisp
(add-to-list 'default-frame-alist '(undecorated-round . t))
#+end_src
* Emojis, Icons and Whatnot
Display these two symbols as one:
#+begin_src emacs-lisp

View file

@ -761,37 +761,7 @@ Let's make Info behave a little more VI-like:
"U" 'Info-directory
"T" 'Info-top-node
"p" 'Info-backward-node
"n" 'Info-forward-node)
:config
(major-mode-hydra-define Info-mode (:quit-key "q")
("Overview"
(("d" Info-directory "Directory")
("t" Info-top-node "Top")
("T" Info-toc "Contents"))
"Goto"
(("m" link-hint-open-link "Menu...")
("n" Info-goto-node "Node...")
("i" Info-index "Index..."))
"History"
(("M-h" Info-history "List")
("H" Info-history-back "Back" :color pink)
("L" Info-history-forward "Forward" :color pink))
"Navigation"
(("u" Info-up "Up" :color pink)
("p" Info-backward-node "Backward" :color pink)
("n" Info-forward-node "Forward" :color pink))
"References"
(("l" Info-follow-reference "Choose")
("j" Info-next-reference "Next" :color pink)
("k" Info-prev-reference "Previous" :color pink))
"Scroll"
(("SPC" Info-scroll-up "Up" :color pink)
("DEL" Info-scroll-down "Down" :color pink)
("RET" Info-follow-nearest-node "Open"))
"Misc"
(("o" org-store-link "Store link")
("b" Info-bookmark-jump "Bookmark")
("w" Info-goto-node-web "View on Web")))))
"n" 'Info-forward-node))
#+end_src
* Consult
The [[https://github.com/minad/consult][consult project]] aims to use libraries like [[*Vertico][Vertico]] to enhance specific, built-in, Emacs functions. I appreciate this project that when selecting an element in the minibuffer, it displays what you are looking at… for instance, it previews a buffer before choosing it. Unlike /Vertico/ and /Orderless/, you need to bind keys to its special functions (or rebind existing keys that do something similar).

View file

@ -2,6 +2,7 @@
#+author: Howard X. Abrams
#+date: 2020-09-10
#+tags: emacs org
#+startup: inlineimages
A literate programming file for making Org file more readable.

View file

@ -1235,7 +1235,7 @@ I adapted this code from the [[https://github.com/emacsmirror/poly-ansible][poly
#+begin_src emacs-lisp
(use-package polymode
:config
(define-hostmode poly-yaml-hostmode :mode #'yaml-ts-mode)
(define-hostmode poly-yaml-hostmode :mode 'yaml-ts-mode)
(defcustom pm-inner/jinja2
(pm-inner-chunkmode :mode #'jinja2-mode
:head-matcher "{[%{#][+-]?"
@ -1260,6 +1260,7 @@ Doing a lot of [[https://github.com/yoshiki/yaml-mode][YAML work]], but the =ya
#+begin_src emacs-lisp
(when (treesit-available-p)
(use-package yaml-ts-mode
:straight (:type built-in)
;; :mode ((rx ".y" (optional "a") "ml" string-end)
;; (rx (optional ".") "yamllint"))
:mode-hydra