Add org-format-fr, use modus-themes

master
trémeur 2 years ago
parent 64d6179e0d
commit 91158f65e1

@ -256,14 +256,21 @@ Let me search my journal files, not synced to my work computer. Set regexp searc
** =dimmer= ** =dimmer=
Dims inactive buffers. Dims inactive buffers. Adjustments for =modus-themes= as suggested.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package dimmer (if (version< emacs-version "27")
:init (use-package dimmer
(dimmer-mode t) :init
:config (dimmer-mode t)
(setq dimmer-fraction 0.4)) :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 #+END_SRC
** =doom-modeline= ** =doom-modeline=
@ -358,7 +365,7 @@ Save elfeed state properly when exiting Emacs.
** =git-gutter= ** =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 dont 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 #+BEGIN_SRC emacs-lisp
(use-package git-gutter (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. Add the =memoir= class for LaTeX export.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(if (version< emacs-version "27") (if (version< emacs-version "27")
(with-eval-after-load 'ox-latex (with-eval-after-load 'ox-latex
(add-to-list 'org-latex-classes (add-to-list 'org-latex-classes
'("article-std" '("article-std"
"\\documentclass{article} "\\documentclass{article}
[NO-DEFAULT-PACKAGES] [NO-DEFAULT-PACKAGES]
\\input{$HOME/.emacs.d/header.tex} %$" \\input{$HOME/.emacs.d/header.tex} %$"
("\\section{%s}" . "\\section*{%s}") ("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")))) ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))))
(add-to-list 'org-latex-classes (add-to-list 'org-latex-classes
'("memoir" '("memoir"
"\\documentclass[9pt,b6paper]{memoir} "\\documentclass[9pt,b6paper]{memoir}
[NO-DEFAULT-PACKAGES] [NO-DEFAULT-PACKAGES]
\\usepackage[namechapters]{optional} \\usepackage[namechapters]{optional}
\\input{$HOME/.emacs.d/fic-export-files/header.tex} %$" \\input{$HOME/.emacs.d/fic-export-files/header.tex} %$"
("\\chapter{%s}" . "\\chapter*{%s}") ("\\chapter{%s}" . "\\chapter*{%s}")
("\\section{%s}" . "\\section*{%s}") ("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")))) ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))))
#+END_SRC #+END_SRC
Settings for export, mostly for DW post previews but also fic?? And work I guess, I do that sometimes. 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-with-toc nil)
(setq org-export-time-stamp-file nil) (setq org-export-time-stamp-file nil)
(if (atwork) (if (atwork)
(progn (progn
(setq org-export-with-author nil) (setq org-export-with-author nil)
(setq org-latex-default-class "article-std")) (setq org-latex-default-class "article-std"))
(unless (version< emacs-version "27") (unless (version< emacs-version "27")
(setq org-latex-default-class "memoir"))) (setq org-latex-default-class "memoir")))
(setq org-latex-compiler "xelatex") (setq org-latex-compiler "xelatex")
(setq org-html-validation-link nil) (setq org-html-validation-link nil)
(setq org-html-doctype "html5") (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= **** =org-modern= and =org-bullets=
Use =org-modern= on =emacs27= and above (although Im 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 #+BEGIN_SRC emacs-lisp
(if (version< emacs-version "27") (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-html-entities-fontification t)
(setq web-mode-enable-current-element-highlight t) (setq web-mode-enable-current-element-highlight t)
:bind :bind
("C-c /" . web-mode-element-close) ("C-c /" . web-mode-element-close))
:custom-face
(web-mode-html-entity-face ((t (:underline t)))))
#+END_SRC #+END_SRC
** =yasnippet= ** =yasnippet=
@ -878,21 +883,33 @@ Highlights current line.
(global-hl-line-mode 1)) (global-hl-line-mode 1))
#+END_SRC #+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 #+BEGIN_SRC emacs-lisp
(use-package tao-theme) (if (version< emacs-version "27")
(load-theme 'tao-yang t) (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 #+END_SRC
** Colours Set colours unless =modus-operandi= is active.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(set-cursor-color "#61805c") (if (version< emacs-version "27")
(set-face-attribute 'region nil :background "#fcf6a7") (progn
(set-face-background 'hl-line "#ddffd6") (set-cursor-color "#61805c")
(set-face-attribute 'region nil :background "#fcf6a7")
(set-face-background 'hl-line "#ddffd6")))
#+END_SRC #+END_SRC
** Fonts ** 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. 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 #+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 (custom-set-faces
'(default ((t (:family "Noto Mono" :foundry "outline" :slant normal :weight normal :height 98 :width normal))))
'(italic ((t (:slant italic)))) '(italic ((t (:slant italic))))
'(variable-pitch ((t (:family "Noto Sans" :height 90)))) '(variable-pitch ((t (:family "Noto Sans" :height 90))))
'(fixed-pitch ((t (:family "Noto Mono" :height 90))))) '(fixed-pitch ((t (:family "Noto Mono" :height 100))))
(custom-set-faces '(modus-themes-fixed-pitch ((t (:family "Noto Mono" :height 100))))))
'(italic ((t (:slant italic))))
'(variable-pitch ((t (:family "Noto Sans" :height 90))))
'(fixed-pitch ((t (:family "Noto Mono" :height 90))))))
#+END_SRC #+END_SRC
Use the =mixed-pitch= package to determine the font intelligently in modes that contain both text and prog elements. Use the =mixed-pitch= package to determine the font intelligently in modes that contain both text and prog elements.

@ -49,3 +49,74 @@
(goto-char (point-min)) (goto-char (point-min))
(while (re-search-forward "=\"\\([^>]*\\)”" nil t) (while (re-search-forward "=\"\\([^>]*\\)”" nil t)
(replace-match "=\"\\1\""))) (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 ")))

Loading…
Cancel
Save