Compare commits

...

2 Commits

Author SHA1 Message Date
Frieder Schlesier 0ff6257a93 add crafted-writing-packages (for latex)
Signed-off-by: Frieder Schlesier <frieder@fschl.de>
2023-07-17 23:58:26 +02:00
Frieder Schlesier 6d84262718 fix tangle all org-files
Signed-off-by: Frieder Schlesier <frieder@fschl.de>
2023-07-17 23:58:26 +02:00
6 changed files with 179 additions and 204 deletions

View File

@ -5,7 +5,7 @@ my Notes and LaTeX support.
** Handling emacs Configuration changes
*** TODO auto-tangle all .org files in this project
*** DONE auto-tangle all .org files in this project
currently every =fschl-module.org= file contains it's own
=org-babel-tangle-config()= block There must be a more generalized
solution, e.g. set it up to auto-tangle all .org files within/below
@ -27,7 +27,7 @@ solution, e.g. set it up to auto-tangle all .org files within/below
*** TODO syncable org-files, agenda files, calendar setup
*** TODO extend TODO-keyword: NEXT, MAYBE, MEETING, CALL, CANCELED, HOLD
*** DONE extend TODO-keyword: NEXT, MAYBE, MEETING, CALL, CANCELED, HOLD
*** TODO make org-roam work with simple key chords
@ -37,12 +37,12 @@ solution, e.g. set it up to auto-tangle all .org files within/below
*** TODO get used to clocking and export
# *** TODO graphviz setup
*** TODO graphviz setup
# ** Communication Tools
** Communication Tools
# *** TODO IRC client + setup
# e.g. for system-crafter, gnu guix, rde
*** TODO IRC client + setup
e.g. for system-crafter, gnu guix, rde
*** TODO matrix client setup
e.g. for Chemnitzer LinuxTage, system-crafter, rde,...

View File

@ -10,6 +10,20 @@
(tool-bar-mode -1)
(scroll-bar-mode -1)
(defun org-babel-tangle-config ()
"Tangle all Org-mode files in `user-emacs-directory` after save."
(let ((user-emacs-dir (expand-file-name user-emacs-directory))
(buffer-file (expand-file-name (buffer-file-name))))
(when (and (string-equal (file-name-extension (buffer-file-name)) "org")
(string-equal (file-name-directory (buffer-file-name)) user-emacs-dir))
(let ((default-directory user-emacs-dir)
(org-confirm-babel-evaluate nil))
(org-babel-tangle-file (buffer-file-name))))))
(add-hook 'org-mode-hook
(lambda ()
(add-hook 'after-save-hook #'org-babel-tangle-config)))
(defvar fschl-org-file (expand-file-name "fschl-org.el" user-emacs-directory))
(when (and fschl-org-file
(file-exists-p fschl-org-file))
@ -28,7 +42,12 @@
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(LaTeX-electric-left-right-brace t)
'(Man-notify-method 'aggressive t)
'(TeX-auto-save t)
'(TeX-electric-math '("$" . "$"))
'(TeX-electric-sub-and-superscript t)
'(TeX-parse-self t)
'(bookmark-save-flag 1 t)
'(completion-category-overrides '((file (styles partial-completion))))
'(completion-cycle-threshold 3)
@ -54,18 +73,26 @@
'(ibuffer-movement-cycle nil)
'(ibuffer-old-time 24)
'(kill-do-not-save-duplicates t)
'(load-prefer-newer t t)
'(org-hide-emphasis-markers t t)
'(org-link-descriptive t t)
'(org-mouse-1-follows-link t t)
'(org-return-follows-link t t)
'(load-prefer-newer t)
'(markdown-enable-html t)
'(markdown-enable-math t)
'(org-hide-emphasis-markers t)
'(org-latex-compiler "xelatex")
'(org-link-descriptive t)
'(org-mouse-1-follows-link t)
'(org-return-follows-link t)
'(package-archive-priorities
'(("gnu" . 99)
("nongnu" . 80)
("stable" . 70)
("melpa" . 0)))
'(package-selected-packages
'(combobulate treesit-auto ibuffer-project aggressive-indent editorconfig tree-sitter-langs tree-sitter-ispell tree-sitter-indent tree-sitter eglot magit helpful elisp-demos all-the-icons org-appear denote evil-nerd-commenter evil-collection evil vertico orderless marginalia embark-consult embark corfu-terminal corfu consult cape))
'(auctex pandoc-mode markdown-mode combobulate treesit-auto ibuffer-project aggressive-indent editorconfig tree-sitter-langs tree-sitter-ispell tree-sitter-indent tree-sitter eglot magit helpful elisp-demos all-the-icons org-appear denote evil-nerd-commenter evil-collection evil vertico orderless marginalia embark-consult embark corfu-terminal corfu consult cape))
'(reftex-plug-into-AUCTeX t t)
'(safe-local-variable-values
'((vc-prepare-patches-separately)
(diff-add-log-use-relative-names . t)
(vc-git-annotate-switches . "-w")))
'(scroll-conservatively 101)
'(scroll-margin 0)
'(scroll-preserve-screen-position t)

View File

@ -1,6 +1,6 @@
;;; fschl-org.el -- Fschl Crafted Emacs user customization file -*- lexical-binding: t; -*-
;; This file is generated from fschl-org.org. If you want to edit the
;; configuration, DO NOT edit fschl-org.el, edit fsch-org.org, instead.
;; This file is generated from the .org-file with the same name. If you want to edit the
;; configuration, DO NOT edit this .el-file, edit .org, instead.
;;(add-to-list 'package-selected-packages 'org-roam)
(add-to-list 'package-selected-packages 'ox-latex)
@ -55,16 +55,39 @@
(eval-after-load 'ox-koma-letter
'(progn
(add-to-list 'org-latex-classes
'("Brief-de-modern"
"\\documentclass\[Brief-de-modern\]\{scrlttr2\}
\[DEFAULT-PACKAGES]
\[PACKAGES]
\[EXTRA]"))
'("Brief-de-modern"
"\\documentclass\[Brief-de-modern\]\{scrlttr2\}
\[DEFAULT-PACKAGES]
\[PACKAGES]
\[EXTRA]"))
;; \\usepackage[english]{babel}
;; \\setkomavar{frombank}{(1234)\\,567\\,890}
;; \\usepackage[english]{babel}
;; \\setkomavar{frombank}{(1234)\\,567\\,890}
(setq org-koma-letter-default-class "Brief-de-modern")))
(setq org-koma-letter-default-class "Brief-de-modern")))
(defvar letter-template
"* Preamble :noexport:
\# #+TITLE: ?
\# #+DATE:
\
\#+SUBJECT: Betreff des Briefs
\
\#+LCO: Absender-Frieder
\# #+LCO: Absender-Marcelle
\# #+LCO: Absender-FamilieSchlesier
\#+LCO: Brief-de-modern
\#+STARTUP: showall
\
\* To-address :to:
\
\# * From :from:
\
\* Sehr geehrte Damen und Herren,
\?
\
\* Mit freundlichen Grüßen, :closing:
\
Frieder Schlesier")
(setq org-capture-templates
'(("t" "todo list item" entry
@ -83,31 +106,10 @@
"* TODO %?\n SCHEDULED: %^T \n %^L \n"
:tree-type month
)
; ("l" "letter to Documents/letters/<datetime.org>"
; entry (file fschl/create-org-letter)
; "* Preamble :noexport:
;# #+TITLE: ?
;# #+DATE:
;
;#+SUBJECT: Betreff des Briefs
;
;#+LCO: Absender-Frieder
;# #+LCO: Absender-Marcelle
;# #+LCO: Absender-FamilieSchlesier
;#+LCO: Brief-de-modern
;#+STARTUP: showall
;
;* To-address :to:
;
;# * From :from:
;
;* Sehr geehrte Damen und Herren,
;?
;
;* Mit freundlichen Grüßen, :closing:
;
;Frieder Schlesier"
; )
("l" "letter to Documents/letters/<datetime.org>"
entry (file fschl/create-org-letter)
letter-template
)
("m" "Schedule a meeting" entry
(file+headline "~/Documents/Org/tasks.org")
"* MEETING %?\n SCHEDULED: %^T\n %a"
@ -126,18 +128,9 @@
)
)
(use-package ox-moderncv
:load-path "~/src/org-cv/"
:init (require 'ox-moderncv))
(setq org-ref-default-bibliography '("~/Documents/references/references.bib")
org-ref-pdf-directory "~/Documents/references/"
org-ref-bibliography-notes "~/Documents/references/notes.org")
;; Tangle the code blocks to fschl-org.el on save.
(defun org-babel-tangle-config ()
(when (string-equal (buffer-file-name)
(expand-file-name "fschl-org.org" user-emacs-directory))
;; Dynamic scoping to the rescue
(let ((org-confirm-babel-evaluate nil))
(org-babel-tangle))))
(add-hook 'org-mode-hook
(lambda ()
(add-hook 'after-save-hook #'org-babel-tangle-config)))

View File

@ -2,19 +2,17 @@
#+PROPERTY: header-args:emacs-lisp :tangle ./fschl-org.el :mkdirp yes
* Basic configuration
** Additional Packages
#+begin_src emacs-lisp
;;; fschl-org.el -- Fschl Crafted Emacs user customization file -*- lexical-binding: t; -*-
;; This file is generated from fschl-org.org. If you want to edit the
;; configuration, DO NOT edit fschl-org.el, edit fsch-org.org, instead.
;;; fschl-org.el -- Fschl Crafted Emacs user customization file -*- lexical-binding: t; -*-
;; This file is generated from the .org-file with the same name. If you want to edit the
;; configuration, DO NOT edit this .el-file, edit .org, instead.
;;(add-to-list 'package-selected-packages 'org-roam)
(add-to-list 'package-selected-packages 'ox-latex)
(add-to-list 'package-selected-packages 'ox-koma-letter)
(add-to-list 'package-selected-packages 'ox-moderncv)
(package-install-selected-packages :noconfirm)
;;(add-to-list 'package-selected-packages 'org-roam)
(add-to-list 'package-selected-packages 'ox-latex)
(add-to-list 'package-selected-packages 'ox-koma-letter)
(add-to-list 'package-selected-packages 'ox-moderncv)
(package-install-selected-packages :noconfirm)
#+end_src
** Configure Org-Roam
@ -42,7 +40,7 @@
"~/Documents/Org/birthdays.org")))
#+end_src
Add Week to Calendar
*** Add Week to Calendar
#+begin_src emacs-lisp
(setq calendar-week-start-day 1)
@ -59,6 +57,7 @@ Add Week to Calendar
'font-lock-face 'font-lock-keyword-face))
#+end_src
*** Custom TODO keywords
#+begin_src emacs-lisp
(setq org-todo-keywords
(quote ((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d)")
@ -80,113 +79,98 @@ Add Week to Calendar
- https://orgmode.org/manual/Template-expansion.html
*** Export Letter
#+begin_src emacs-lisp
(eval-after-load 'ox '(require 'ox-koma-letter))
(eval-after-load 'ox '(require 'ox-moderncv))
(eval-after-load 'ox-koma-letter
'(progn
(add-to-list 'org-latex-classes
'("Brief-de-modern"
"\\documentclass\[Brief-de-modern\]\{scrlttr2\}
\[DEFAULT-PACKAGES]
\[PACKAGES]
\[EXTRA]"))
(eval-after-load 'ox '(require 'ox-koma-letter))
(eval-after-load 'ox '(require 'ox-moderncv))
(eval-after-load 'ox-koma-letter
'(progn
(add-to-list 'org-latex-classes
'("Brief-de-modern"
"\\documentclass\[Brief-de-modern\]\{scrlttr2\}
\[DEFAULT-PACKAGES]
\[PACKAGES]
\[EXTRA]"))
;; \\usepackage[english]{babel}
;; \\setkomavar{frombank}{(1234)\\,567\\,890}
;; \\usepackage[english]{babel}
;; \\setkomavar{frombank}{(1234)\\,567\\,890}
(setq org-koma-letter-default-class "Brief-de-modern")))
(setq org-koma-letter-default-class "Brief-de-modern")))
(defvar letter-template
"* Preamble :noexport:
\# #+TITLE: ?
\# #+DATE:
\
\#+SUBJECT: Betreff des Briefs
\
\#+LCO: Absender-Frieder
\# #+LCO: Absender-Marcelle
\# #+LCO: Absender-FamilieSchlesier
\#+LCO: Brief-de-modern
\#+STARTUP: showall
\
\* To-address :to:
\
\# * From :from:
\
\* Sehr geehrte Damen und Herren,
\?
\
\* Mit freundlichen Grüßen, :closing:
\
Frieder Schlesier")
#+end_src
*** Capture Templates
#+begin_src emacs-lisp
(setq org-capture-templates
'(("t" "todo list item" entry
(file+olp+datetree "~/Documents/Org/tasks.org")
"* TODO %?\n SCHEDULED: %^T"
:tree-type month
)
("T" "todo list item with source" entry
(file+olp+datetree "~/Documents/Org/tasks.org")
"* TODO %?\n %a \n SCHEDULED: %^T \n %^G \n"
:tree-type month
)
(setq org-capture-templates
'(("t" "todo list item" entry
(file+olp+datetree "~/Documents/Org/tasks.org")
"* TODO %?\n SCHEDULED: %^T"
:tree-type month
)
("T" "todo list item with source" entry
(file+olp+datetree "~/Documents/Org/tasks.org")
"* TODO %?\n %a \n SCHEDULED: %^T \n %^G \n"
:tree-type month
)
("r" "Todo research some website/software" entry
(file+olp+datetree "~/Documents/Org/tasks.org")
"* TODO %?\n SCHEDULED: %^T \n %^L \n"
:tree-type month
)
; ("l" "letter to Documents/letters/<datetime.org>"
; entry (file fschl/create-org-letter)
; "* Preamble :noexport:
;# #+TITLE: ?
;# #+DATE:
;
;#+SUBJECT: Betreff des Briefs
;
;#+LCO: Absender-Frieder
;# #+LCO: Absender-Marcelle
;# #+LCO: Absender-FamilieSchlesier
;#+LCO: Brief-de-modern
;#+STARTUP: showall
;
;* To-address :to:
;
;# * From :from:
;
;* Sehr geehrte Damen und Herren,
;?
;
;* Mit freundlichen Grüßen, :closing:
;
;Frieder Schlesier"
; )
("m" "Schedule a meeting" entry
(file+headline "~/Documents/Org/tasks.org")
"* MEETING %?\n SCHEDULED: %^T\n %a"
)
("p" "Schedule a phone call" entry
(file+headline "~/Documents/Org/tasks.org")
"* PHONE %?\n SCHEDULED: %^T\\n %a"
)
("a" "Articles: keep notes of online articles"
entry
(file+datetree "~/Documents/Org/journal.org")
"* %? \n%x \n %u\n- $?"
:tree-type month
:kill-buffer t
:empty-lines-before 1)
("r" "Todo research some website/software" entry
(file+olp+datetree "~/Documents/Org/tasks.org")
"* TODO %?\n SCHEDULED: %^T \n %^L \n"
:tree-type month
)
("l" "letter to Documents/letters/<datetime.org>"
entry (file fschl/create-org-letter)
letter-template
)
("m" "Schedule a meeting" entry
(file+headline "~/Documents/Org/tasks.org")
"* MEETING %?\n SCHEDULED: %^T\n %a"
)
("p" "Schedule a phone call" entry
(file+headline "~/Documents/Org/tasks.org")
"* PHONE %?\n SCHEDULED: %^T\\n %a"
)
("a" "Articles: keep notes of online articles"
entry
(file+datetree "~/Documents/Org/journal.org")
"* %? \n%x \n %u\n- $?"
:tree-type month
:kill-buffer t
:empty-lines-before 1)
)
)
)
#+end_src
** TODO not sure if we actually need this
** TeX and research
- Write a CV in org-mode: https://titan-c.gitlab.io/org-cv/
- requires: ~texlive-latex-extra texlive-xetex~
#+begin_src emacs-lisp
(setq org-ref-default-bibliography '("~/Documents/references/references.bib")
org-ref-pdf-directory "~/Documents/references/"
org-ref-bibliography-notes "~/Documents/references/notes.org")
#+end_src
** Auto-tangle on save
Whenever you edit =init.org= in Emacs and save it, it updates =init.el= in
the same directory.
See the [[https://orgmode.org/manual/Extracting-Source-Code.html][Org Manual]] for details and alternatives.
#+begin_src emacs-lisp
;; Tangle the code blocks to fschl-org.el on save.
(defun org-babel-tangle-config ()
(when (string-equal (buffer-file-name)
(expand-file-name "fschl-org.org" user-emacs-directory))
;; Dynamic scoping to the rescue
(let ((org-confirm-babel-evaluate nil))
(org-babel-tangle))))
(add-hook 'org-mode-hook
(lambda ()
(add-hook 'after-save-hook #'org-babel-tangle-config)))
(use-package ox-moderncv
:load-path "~/src/org-cv/"
:init (require 'ox-moderncv))
(setq org-ref-default-bibliography '("~/Documents/references/references.bib")
org-ref-pdf-directory "~/Documents/references/"
org-ref-bibliography-notes "~/Documents/references/notes.org")
#+end_src

18
init.el
View File

@ -1,6 +1,6 @@
;;; init.el -- Fschl Crafted Emacs user customization file -*- lexical-binding: t; -*-
;; This file is generated from init.org. If you want to edit the
;; configuration, DO NOT edit init.el, edit init.org, instead.
;; This file is generated from the .org-file with the same name. If you want to edit the
;; configuration, DO NOT edit this .el-file, edit .org, instead.
(setq user-emacs-directory "~/.config/crafted-emacs-configdir/")
(setq crafted-emacs-home "~/src/crafted-emacs/")
@ -16,6 +16,7 @@
(require 'crafted-org-packages)
(require 'crafted-ui-packages)
(require 'crafted-ide-packages)
(require 'crafted-writing-packages)
(package-install-selected-packages :noconfirm)
@ -26,18 +27,7 @@
(require 'crafted-org-config)
(require 'crafted-ui-config)
(require 'crafted-ide-config)
(require 'crafted-writing-config)
(unless crafted-startup-inhibit-splash
(setq initial-buffer-choice #'crafted-startup-screen))
;; Tangle the code blocks to config.el on save.
(defun org-babel-tangle-config ()
(when (string-equal (buffer-file-name)
(expand-file-name "init.org" user-emacs-directory))
;; Dynamic scoping to the rescue
(let ((org-confirm-babel-evaluate nil))
(org-babel-tangle))))
(add-hook 'org-mode-hook
(lambda ()
(add-hook 'after-save-hook #'org-babel-tangle-config)))

View File

@ -6,8 +6,8 @@
** Set import directories for =crafted-emacs=
#+begin_src emacs-lisp
;;; init.el -- Fschl Crafted Emacs user customization file -*- lexical-binding: t; -*-
;; This file is generated from init.org. If you want to edit the
;; configuration, DO NOT edit init.el, edit init.org, instead.
;; This file is generated from the .org-file with the same name. If you want to edit the
;; configuration, DO NOT edit this .el-file, edit .org, instead.
(setq user-emacs-directory "~/.config/crafted-emacs-configdir/")
(setq crafted-emacs-home "~/src/crafted-emacs/")
@ -26,6 +26,7 @@
(require 'crafted-org-packages)
(require 'crafted-ui-packages)
(require 'crafted-ide-packages)
(require 'crafted-writing-packages)
(package-install-selected-packages :noconfirm)
#+end_src
@ -39,28 +40,8 @@
(require 'crafted-org-config)
(require 'crafted-ui-config)
(require 'crafted-ide-config)
(require 'crafted-writing-config)
(unless crafted-startup-inhibit-splash
(setq initial-buffer-choice #'crafted-startup-screen))
#+end_src
** Auto-tangle on save
Whenever you edit =init.org= in Emacs and save it, it updates =init.el= in
the same directory.
See the [[https://orgmode.org/manual/Extracting-Source-Code.html][Org Manual]] for details and alternatives.
#+begin_src emacs-lisp
;; Tangle the code blocks to config.el on save.
(defun org-babel-tangle-config ()
(when (string-equal (buffer-file-name)
(expand-file-name "init.org" user-emacs-directory))
;; Dynamic scoping to the rescue
(let ((org-confirm-babel-evaluate nil))
(org-babel-tangle))))
(add-hook 'org-mode-hook
(lambda ()
(add-hook 'after-save-hook #'org-babel-tangle-config)))
#+end_src