diff --git a/config.org b/config.org index c7db0af..107f213 100644 --- a/config.org +++ b/config.org @@ -256,14 +256,21 @@ Let me search my journal files, not synced to my work computer. Set regexp searc ** =dimmer= -Dims inactive buffers. +Dims inactive buffers. Adjustments for =modus-themes= as suggested. #+BEGIN_SRC emacs-lisp - (use-package dimmer - :init - (dimmer-mode t) - :config - (setq dimmer-fraction 0.4)) + (if (version< emacs-version "27") + (use-package dimmer + :init + (dimmer-mode t) + :config + (setq dimmer-fraction 0.4)) + (use-package dimmer + :config + (setq dimmer-fraction 0.4) + (setq dimmer-adjustment-mode :foreground) + (setq dimmer-use-colorspace :rgb) + (dimmer-mode 1))) #+END_SRC ** =doom-modeline= @@ -358,7 +365,7 @@ Save elfeed state properly when exiting Emacs. ** =git-gutter= -Shows, or at least purports to show, =git diff= in the left margin if the file is being tracked by =git=. The colours don’t seem to work properly with the current theme. +Shows, or at least purports to show, =git diff= in the left margin if the file is being tracked by =git=. #+BEGIN_SRC emacs-lisp (use-package git-gutter @@ -505,26 +512,26 @@ In =emacs27= and above, I can set certain headlines not to be exported. I haven Add the =memoir= class for LaTeX export. #+BEGIN_SRC emacs-lisp -(if (version< emacs-version "27") -(with-eval-after-load 'ox-latex -(add-to-list 'org-latex-classes -'("article-std" -"\\documentclass{article} -[NO-DEFAULT-PACKAGES] -\\input{$HOME/.emacs.d/header.tex} %$" -("\\section{%s}" . "\\section*{%s}") -("\\subsection{%s}" . "\\subsection*{%s}") -("\\subsubsection{%s}" . "\\subsubsection*{%s}")))) -(add-to-list 'org-latex-classes -'("memoir" -"\\documentclass[9pt,b6paper]{memoir} -[NO-DEFAULT-PACKAGES] -\\usepackage[namechapters]{optional} -\\input{$HOME/.emacs.d/fic-export-files/header.tex} %$" -("\\chapter{%s}" . "\\chapter*{%s}") -("\\section{%s}" . "\\section*{%s}") -("\\subsection{%s}" . "\\subsection*{%s}") -("\\subsubsection{%s}" . "\\subsubsection*{%s}")))) + (if (version< emacs-version "27") + (with-eval-after-load 'ox-latex + (add-to-list 'org-latex-classes + '("article-std" + "\\documentclass{article} + [NO-DEFAULT-PACKAGES] + \\input{$HOME/.emacs.d/header.tex} %$" + ("\\section{%s}" . "\\section*{%s}") + ("\\subsection{%s}" . "\\subsection*{%s}") + ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))) + (add-to-list 'org-latex-classes + '("memoir" + "\\documentclass[9pt,b6paper]{memoir} + [NO-DEFAULT-PACKAGES] + \\usepackage[namechapters]{optional} + \\input{$HOME/.emacs.d/fic-export-files/header.tex} %$" + ("\\chapter{%s}" . "\\chapter*{%s}") + ("\\section{%s}" . "\\section*{%s}") + ("\\subsection{%s}" . "\\subsection*{%s}") + ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))) #+END_SRC Settings for export, mostly for DW post previews but also fic?? And work I guess, I do that sometimes. @@ -538,11 +545,11 @@ Settings for export, mostly for DW post previews but also fic?? And work I guess (setq org-export-with-toc nil) (setq org-export-time-stamp-file nil) (if (atwork) - (progn - (setq org-export-with-author nil) - (setq org-latex-default-class "article-std")) - (unless (version< emacs-version "27") - (setq org-latex-default-class "memoir"))) + (progn + (setq org-export-with-author nil) + (setq org-latex-default-class "article-std")) + (unless (version< emacs-version "27") + (setq org-latex-default-class "memoir"))) (setq org-latex-compiler "xelatex") (setq org-html-validation-link nil) (setq org-html-doctype "html5") @@ -599,7 +606,7 @@ Automate a tiny part of something I was previously doing manually. **** =org-modern= and =org-bullets= -Use =org-modern= on =emacs27= and above (although I’m still not wild about it), =org-bullets= otherwise. [[https://github.com/minad/org-modern/issues/5#issuecomment-1318003940][Fix for issue with table widths]], which makes me slightly less not-wild. +Use =org-modern= on =emacs27= and above, =org-bullets= otherwise. [[https://github.com/minad/org-modern/issues/5#issuecomment-1318003940][Fix for issue with table widths]]. #+BEGIN_SRC emacs-lisp (if (version< emacs-version "27") @@ -825,9 +832,7 @@ This is good for auto indentation, folding, killing elements, apparently XPath?? (setq web-mode-enable-html-entities-fontification t) (setq web-mode-enable-current-element-highlight t) :bind - ("C-c /" . web-mode-element-close) - :custom-face - (web-mode-html-entity-face ((t (:underline t))))) + ("C-c /" . web-mode-element-close)) #+END_SRC ** =yasnippet= @@ -878,21 +883,33 @@ Highlights current line. (global-hl-line-mode 1)) #+END_SRC -*** =tao-theme= +** Theme/colours -Nice monochrome-ish light theme, reminiscent of [[https://edwardtufte.github.io/tufte-css/][Tufte CSS]]. +Set a theme. #+BEGIN_SRC emacs-lisp - (use-package tao-theme) - (load-theme 'tao-yang t) + (if (version< emacs-version "27") + (progn + (use-package tao-theme) + (load-theme 'tao-yang t)) + (progn + (use-package modus-themes + :config + (setq modus-themes-bold-constructs t) + (setq modus-themes-italic-constructs t) + (setq modus-themes-mixed-fonts t) + (setq modus-themes-org-blocks 'gray-background)) + (load-theme 'modus-operandi-tinted t))) #+END_SRC -** Colours +Set colours unless =modus-operandi= is active. #+BEGIN_SRC emacs-lisp - (set-cursor-color "#61805c") - (set-face-attribute 'region nil :background "#fcf6a7") - (set-face-background 'hl-line "#ddffd6") + (if (version< emacs-version "27") + (progn + (set-cursor-color "#61805c") + (set-face-attribute 'region nil :background "#fcf6a7") + (set-face-background 'hl-line "#ddffd6"))) #+END_SRC ** Fonts @@ -900,16 +917,17 @@ Nice monochrome-ish light theme, reminiscent of [[https://edwardtufte.github.io/ Use Noto fonts to match my system fonts on Linux. This has to be done differently on Windows for some reason. #+BEGIN_SRC emacs-lisp - (if (iswin) + (if (iswin) + (custom-set-faces + '(default ((t (:family "Noto Mono" :foundry "outline" :slant normal :weight normal :height 98 :width normal)))) + '(italic ((t (:slant italic)))) + '(variable-pitch ((t (:family "Noto Sans" :height 90)))) + '(fixed-pitch ((t (:family "Noto Mono" :height 90))))) (custom-set-faces - '(default ((t (:family "Noto Mono" :foundry "outline" :slant normal :weight normal :height 98 :width normal)))) '(italic ((t (:slant italic)))) '(variable-pitch ((t (:family "Noto Sans" :height 90)))) - '(fixed-pitch ((t (:family "Noto Mono" :height 90))))) - (custom-set-faces - '(italic ((t (:slant italic)))) - '(variable-pitch ((t (:family "Noto Sans" :height 90)))) - '(fixed-pitch ((t (:family "Noto Mono" :height 90)))))) + '(fixed-pitch ((t (:family "Noto Mono" :height 100)))) + '(modus-themes-fixed-pitch ((t (:family "Noto Mono" :height 100)))))) #+END_SRC Use the =mixed-pitch= package to determine the font intelligently in modes that contain both text and prog elements. diff --git a/custom/org-format.el b/custom/org-format.el index a31e2f8..c1a51df 100644 --- a/custom/org-format.el +++ b/custom/org-format.el @@ -49,3 +49,74 @@ (goto-char (point-min)) (while (re-search-forward "=\"\\([^>]*\\)”" nil t) (replace-match "=\"\\1\""))) + +(defun org-format-fr () + "Correct formatting in a French org file" + (interactive) + (org-format) + (goto-char (point-min)) + (while (re-search-forward " …" nil t) + (replace-match "…")) + (goto-char (point-min)) + (while (re-search-forward "“" nil t) + (replace-match "«")) + (goto-char (point-min)) + (while (re-search-forward "« " nil t) + (replace-match "«")) + (goto-char (point-min)) + (while (re-search-forward "«" nil t) + (replace-match "« ")) + (goto-char (point-min)) + (while (re-search-forward "«  " nil t) + (replace-match "« ")) + (goto-char (point-min)) + (while (re-search-forward "”" nil t) + (replace-match "»")) + (goto-char (point-min)) + (while (re-search-forward " »" nil t) + (replace-match "»")) + (goto-char (point-min)) + (while (re-search-forward "»" nil t) + (replace-match " »")) + (goto-char (point-min)) + (while (re-search-forward "  »" nil t) + (replace-match " »")) + (goto-char (point-min)) + (while (re-search-forward " ;" nil t) + (replace-match ";")) + (goto-char (point-min)) + (while (re-search-forward ";" nil t) + (replace-match " ;")) + (goto-char (point-min)) + (while (re-search-forward "  ;" nil t) + (replace-match " ;")) + (goto-char (point-min)) + (while (re-search-forward " :" nil t) + (replace-match ":")) + (goto-char (point-min)) + (while (re-search-forward ":" nil t) + (replace-match " :")) + (goto-char (point-min)) + (while (re-search-forward "  :" nil t) + (replace-match " :")) + (goto-char (point-min)) + (while (re-search-forward " !" nil t) + (replace-match "!")) + (goto-char (point-min)) + (while (re-search-forward "!" nil t) + (replace-match " !")) + (goto-char (point-min)) + (while (re-search-forward "  !" nil t) + (replace-match " !")) + (goto-char (point-min)) + (while (re-search-forward " \\?" nil t) + (replace-match "\?")) + (goto-char (point-min)) + (while (re-search-forward "\\?" nil t) + (replace-match " \?")) + (goto-char (point-min)) + (while (re-search-forward "  \\?" nil t) + (replace-match " \?")) + (goto-char (point-min)) + (while (re-search-forward "\n- " nil t) + (replace-match "\n– ")))