From dc98a60744c4d60eca24b81111ffdde80127fd93 Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Sun, 15 May 2022 13:29:21 +0200 Subject: Minor changes. --- init.el | 11 ++++---- smart-documents.org | 80 ++++++++++++++++++++++++++++++++++++----------------- 2 files changed, 59 insertions(+), 32 deletions(-) diff --git a/init.el b/init.el index a5a8f5b..e6cfd3f 100644 --- a/init.el +++ b/init.el @@ -1,3 +1,6 @@ +;; -*- mode: emacs-lisp; -*- + + ;;; init.el --- Load literate configuration file, smart-documents.org. ;;; Commentary: @@ -5,18 +8,14 @@ ;;; Code: -;; First of all, we indicate the path to our literate configuration file. +;; First, we indicate the path to our literate configuration file. (setq sd-literate-config (concat user-emacs-directory "smart-documents.org")) -;; Then, we load this file into Emacs' memory. +;; Then, we load our literate configuration into Emacs' memory. (org-babel-load-file sd-literate-config) (provide 'init) ;;; init.el ends here - -;; Local Variables: -;; mode: emacs-lisp -;; End: diff --git a/smart-documents.org b/smart-documents.org index fa5f5eb..8fa4cb2 100644 --- a/smart-documents.org +++ b/smart-documents.org @@ -49,6 +49,9 @@ personal GNU Emacs customizations with a tutorial. This paper is a ** TODO Integrate site publishing recipes +** TODO ~transient-*-file~ paths + +Put them somewhere it makes sense. * Introduction @@ -196,7 +199,7 @@ file]]) The commonality between all these files is that they tend to reference... other files. Thus, I decided to refer to them as meta files. -A meta files should follow the following best principles: +A meta files should follow the following best practices: - Be located at [[help:sd-path-meta][sd-path-meta]] :: This ensures a tidy [[help:user-emacs-directory][user-emacs-directory]]. @@ -330,9 +333,9 @@ Backups are very important! #+BEGIN_SRC emacs-lisp :tangle yes (setq backup-directory-alist - `((".*" . ,temporary-file-directory)) + `((".*" . "~/.cache/emacs/")) auto-save-file-name-transforms - `((".*" ,temporary-file-directory t)) + `((".*" ,"~/.cache/emacs/" 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 @@ -340,20 +343,30 @@ Backups are very important! kept-old-versions 5) ; and how many of the old #+END_SRC +** Undo history + +We save undo history in a designated directory, so as not to pollute +our file hierarchy. + +#+BEGIN_SRC emacs-lisp :tangle yes + (setq undo-tree-history-directory-alist '(("." . "~/.cache/emacs/"))) +#+END_SRC + + ** Initial and default frames We set the dimensions of the initial frame: #+BEGIN_SRC emacs-lisp :tangle yes - (add-to-list 'initial-frame-alist '(width . 70)) - (add-to-list 'initial-frame-alist '(height . 30)) + (add-to-list 'initial-frame-alist '(width . 80)) + (add-to-list 'initial-frame-alist '(height . 24)) #+END_SRC We also set the dimensions of subsequent frames: #+BEGIN_SRC emacs-lisp :tangle yes - (add-to-list 'default-frame-alist '(width . 70)) - (add-to-list 'default-frame-alist '(height . 30)) + (add-to-list 'default-frame-alist '(width . 80)) + (add-to-list 'default-frame-alist '(height . 24)) #+END_SRC Transparency. @@ -771,8 +784,12 @@ modifiable field. Many clever programming tricks can be performed with #+NAME: hungry-delete #+BEGIN_SRC emacs-lisp :tangle yes - (use-package hungry-delete) - (global-hungry-delete-mode) + (use-package hungry-delete + :config (progn + (global-hungry-delete-mode) + (add-to-list + 'hungry-delete-except-modes ;; Otherwise minibuffer paths can't be backspaced. + 'minibuffer-mode))) #+END_SRC ** Utilities @@ -906,7 +923,7 @@ Yeah, a Telegram client exists for Emacs. :defer t) #+END_SRC -*** Drawings +*** COMMENT Drawings @@ -943,13 +960,13 @@ Yeah, a Telegram client exists for Emacs. title Example diagram with Plantuml package "Package 1" as pkg1 { - node node1 - node node2 + node node1 + node node2 } package "Package 2" as pkg2 { - component "Component 1" as comp1 - component "Component 2" as comp2 - interface "Interface" as int + component "Component 1" as comp1 + component "Component 2" as comp2 + interface "Interface" as int } pkg1 .. pkg2 @@ -995,6 +1012,14 @@ Python is included by default on most Linux distributions. (use-package lua-mode) #+END_SRC +*** Web languages + +Encompasses HTML, CSS, Javascript, Jinja(2), as well as many other +web-related markup languages. + +#+BEGIN_SRC emacs-lisp :tangle yes + (use-package web-mode) +#+END_SRC ** File formats @@ -1351,7 +1376,7 @@ being executed by the Org Babel backend upon document export. (plantuml . t) (emacs-lisp . t) (awk . t) - (ledger . t) + ;; (ledger . t) ;; Deprecated in Emacs 28.1? (latex . t) (C . t) (gnuplot . t) @@ -1504,7 +1529,7 @@ work. The following makes =TODO= items appear red and =CLOSED= items appear green in Org's LaTeX exports. Very stylish, much flair! -**** AUCTEX +**** COMMENT AUCTEX #+BEGIN_SRC emacs-lisp :tangle yes (use-package tex @@ -1682,9 +1707,12 @@ PDF. The binding is defined in Section [[Export to PDF]]. (interactive) (sd-indent-buffer) (delete-trailing-whitespace) - (when (string-equal - major-mode "org-mode") - (sd-org-fix-headlines-spacing))) + (cond + ((string-equal major-mode "org-mode") + (sd-org-fix-headlines-spacing)) + ((string-equal major-mode "python-mode") + (or (shell-command (concat "~/.local/bin/black " buffer-file-name)) + (message "Could not find black Python formatter."))))) #+END_SRC @@ -1868,7 +1896,7 @@ Now, we describe the actual format of the header line. (image-animate sd-icon-loading 0 t) #+END_SRC -**** Mode line +**** TODO COMMENT Mode line This interpretation of the ideal mode line is the result of carefully studying the default ~mode-line~, as well as studying various @@ -2003,7 +2031,7 @@ unusable. Thus, we /describe/ two themes that were developed (load-theme 'sd-compagnon-dark) #+END_SRC -#+BEGIN_SRC emacs-lisp :tangle no +#+BEGIN_SRC emacs-lisp :tangle yes (load-theme 'molokai) #+END_SRC @@ -2011,7 +2039,7 @@ unusable. Thus, we /describe/ two themes that were developed (load-theme 'sd-light) #+END_SRC -#+BEGIN_SRC emacs-lisp :tangle yes +#+BEGIN_SRC emacs-lisp :tangle no (load-theme 'sd-dark) #+END_SRC @@ -2058,7 +2086,7 @@ Purple is Emacs' main logo color. Since we use Emacs for coding a lot, code syntax highlighting to could be in the pink/purple shades. This is also a nod to Spacemacs' dark theme.2 hour -*** Cursors +*** TODO Cursors In order to imitate other modern text editors, we resort to a blinking bar cursor. We choose red, the most captivating color, because the @@ -2124,7 +2152,7 @@ Emacs. - Courier Prime[fn::https://quoteunquoteapps.com/courierprime/index.php] :: monospace in print -**** Using proportional fonts when needed +**** COMMENT Using proportional fonts when needed We use ~variable-pitch-mode~ for appropriate modes. @@ -2218,7 +2246,7 @@ steps taken to make Emacs more palatable to modern word processors users. -* Local files variables +* COMMENT Local files variables :PROPERTIES: :UNNUMBERED: t :END: -- cgit v1.2.3