Fixed minor bugs
This commit is contained in:
parent
086725397a
commit
285bf2d86c
4 changed files with 12 additions and 8 deletions
|
@ -141,7 +141,7 @@ And let’s see the results:
|
||||||
** My Code Location
|
** My Code Location
|
||||||
Much of my more complicated code comes from my website essays and other projects. The destination shows up here:
|
Much of my more complicated code comes from my website essays and other projects. The destination shows up here:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(add-to-list 'load-path (expand-file-name "~/.emacs.d/elisp"))
|
(add-to-list 'load-path (expand-file-name "elisp" user-emacs-directory))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Hopefully, this will tie me over while I transition.
|
Hopefully, this will tie me over while I transition.
|
||||||
|
@ -227,12 +227,12 @@ With this function, we can test/debug/reload any individual file, via:
|
||||||
"Load or reload an org-mode FILE containing literate
|
"Load or reload an org-mode FILE containing literate
|
||||||
Emacs configuration code."
|
Emacs configuration code."
|
||||||
(interactive (list (completing-read "Org file: "
|
(interactive (list (completing-read "Org file: "
|
||||||
(ha-hamacs-files :all))))
|
(ha-hamacs-files :all))))
|
||||||
;; TODO: Replace concat here:
|
;; TODO: Replace concat here:
|
||||||
(let ((full-file (file-name-concat hamacs-source-dir file)))
|
(let ((full-file (file-name-concat hamacs-source-dir file)))
|
||||||
(when (file-exists-p full-file)
|
(when (file-exists-p full-file)
|
||||||
(ignore-errors
|
(ignore-errors
|
||||||
(org-babel-load-file full-file)))))
|
(org-babel-load-file full-file)))))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Tangling the Hamacs
|
** Tangling the Hamacs
|
||||||
|
|
|
@ -477,14 +477,17 @@ Using [[https://github.com/joaotavora/yasnippet][yasnippet]] to expand templates
|
||||||
(expand-file-name "snippets" user-emacs-directory))
|
(expand-file-name "snippets" user-emacs-directory))
|
||||||
(yas-global-mode +1))
|
(yas-global-mode +1))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Check out [[http://joaotavora.github.io/yasnippet/][the documentation]] for writing them.
|
Check out [[http://joaotavora.github.io/yasnippet/][the documentation]] for writing them.
|
||||||
|
|
||||||
Since I have troubles installing Doom’s [[https://github.com/hlissner/doom-snippets][collection of snippets]], lets use the [[http://github.com/AndreaCrotti/yasnippet-snippets][yasnippet-snippets]] package:
|
Since I have troubles installing Doom’s [[https://github.com/hlissner/doom-snippets][collection of snippets]], lets use the [[http://github.com/AndreaCrotti/yasnippet-snippets][yasnippet-snippets]] package:
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package yasnippet-snippets)
|
(use-package yasnippet-snippets)
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Auto Insert Templates
|
*** Auto Insert Templates
|
||||||
The [[https://www.emacswiki.org/emacs/AutoInsertMode][auto-insert]] feature is a wee bit complicated. All I want is to associate a filename regular expression with a YASnippet template. I'm stealing some ideas from Henrik Lissner's [[https://github.com/hlissner/doom-emacs/blob/develop/modules/editor/file-templates/autoload.el][set-file-template!]] macro, but simpler?
|
The [[https://www.emacswiki.org/emacs/AutoInsertMode][auto-insert]] feature is a wee bit complicated. All I want is to associate a filename regular expression with a YASnippet template. I'm stealing some ideas from Henrik Lissner's [[https://github.com/hlissner/doom-emacs/blob/develop/modules/editor/file-templates/autoload.el][set-file-template!]] macro, but simpler?
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package autoinsert
|
(use-package autoinsert
|
||||||
:init
|
:init
|
||||||
|
@ -509,6 +512,7 @@ Since auto insertion requires entering data for particular fields, and for that
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
And since I'll be associating snippets with new files all over my configuration, let's make a helper function:
|
And since I'll be associating snippets with new files all over my configuration, let's make a helper function:
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(defun ha-auto-insert-file (filename-re snippet-name)
|
(defun ha-auto-insert-file (filename-re snippet-name)
|
||||||
"Autofill file buffer matching FILENAME-RE regular expression.
|
"Autofill file buffer matching FILENAME-RE regular expression.
|
||||||
|
|
|
@ -58,7 +58,7 @@ In normal Org file, I like large headers, but in my Journal, where each task is
|
||||||
But new files could use /my formatting/ (which is different than the options available in the project):
|
But new files could use /my formatting/ (which is different than the options available in the project):
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(ha-auto-insert-file (rx "journal/" (zero-or-more any) (= 8 digit)) "journal")
|
(ha-auto-insert-file (rx "journal/" (zero-or-more any) (= 8 digit)) "journal")
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
This depends on the following [[file:~/.doom.d/snippets/org-journal-mode/__journal][snippet/template file]]:
|
This depends on the following [[file:~/.doom.d/snippets/org-journal-mode/__journal][snippet/template file]]:
|
||||||
|
|
|
@ -280,7 +280,7 @@ I’m interested in using [[https://devdocs.io/][devdocs.io]] instead, which is
|
||||||
|
|
||||||
The =devdocs-lookup= command attempts to guess which documentation it should display based on the mode, but if I’m editing YAML files, I actually want to pull up the Ansible documentation, and probably the Jinja ones too.
|
The =devdocs-lookup= command attempts to guess which documentation it should display based on the mode, but if I’m editing YAML files, I actually want to pull up the Ansible documentation, and probably the Jinja ones too.
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp :tangle no
|
||||||
(defun ha-devdocs-major-mode ()
|
(defun ha-devdocs-major-mode ()
|
||||||
"My mapping of major mode to Devdocs slug."
|
"My mapping of major mode to Devdocs slug."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
@ -1143,8 +1143,8 @@ With the =markdown-header-scaling= set, we no longer need to color the headers i
|
||||||
:after org
|
:after org
|
||||||
:config
|
:config
|
||||||
(let ((default-color (face-attribute 'default :foreground)))
|
(let ((default-color (face-attribute 'default :foreground)))
|
||||||
(set-face-attribute 'markdown-italic-face nil :foreground nil)
|
(set-face-attribute 'markdown-italic-face nil :foreground 'unspecified)
|
||||||
(set-face-attribute 'markdown-bold-face nil :foreground nil)
|
(set-face-attribute 'markdown-bold-face nil :foreground 'unspecified)
|
||||||
(set-face-attribute 'markdown-pre-face nil
|
(set-face-attribute 'markdown-pre-face nil
|
||||||
:foreground (face-attribute 'org-code :foreground))
|
:foreground (face-attribute 'org-code :foreground))
|
||||||
(set-face-attribute 'markdown-code-face nil
|
(set-face-attribute 'markdown-code-face nil
|
||||||
|
|
Loading…
Reference in a new issue