emacs27 everywhere

master
trémeur 2 years ago
parent e679097154
commit bfd5775927

@ -259,18 +259,12 @@ Let me search my journal files, not synced to my work computer. Set regexp searc
Dims inactive buffers. Adjustments for =modus-themes= as suggested.
#+BEGIN_SRC emacs-lisp
(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)))
(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=
@ -381,12 +375,9 @@ Shows, or at least purports to show, =git diff= in the left margin if the file i
** =lastfm=
This works only for =emacs27= and above, and I dont want to use it at work, so heres a nested =unless= in case my Emacs version ever gets updated there.
#+BEGIN_SRC emacs-lisp
(unless (version< emacs-version "27")
(unless (atwork)
(use-package lastfm)))
(unless (atwork)
(use-package lastfm))
#+END_SRC
** =markdown-mode=
@ -500,13 +491,12 @@ Track when I complete todos.
*** Export settings
In =emacs27= and above, I can set certain headlines not to be exported. I havent used this yet but it sounds useful.
This can set certain headlines not to be exported. I havent used it yet but it sounds useful.
#+BEGIN_SRC emacs-lisp
(unless (version< emacs-version "27")
(use-package org-contrib)
(require 'ox-extra)
(ox-extras-activate '(ignore-headlines)))
(use-package org-contrib)
(require 'ox-extra)
(ox-extras-activate '(ignore-headlines))
#+END_SRC
Add a couple of classes for LaTeX export.
@ -555,19 +545,18 @@ Settings for export, mostly for DW post previews but also fic?? And work I guess
Export non-breaking spaces properly; from, believe it or not, [[https://orgmode.org/manual/Advanced-Export-Configuration.html][the Org Manual]].
#+BEGIN_SRC emacs-lisp
(unless (version< emacs-version "27")
(defun my-html-filter-nobreaks (text backend info)
"Keep non-breaking spaces in HTML org export"
(when (org-export-derived-backend-p backend 'html)
(replace-regexp-in-string " " "&nbsp;" text)))
(add-to-list 'org-export-filter-plain-text-functions
'my-html-filter-nobreaks)
(defun my-latex-filter-nobreaks (text backend info)
"Keep non-breaking spaces in LaTeX org export"
(when (org-export-derived-backend-p backend 'latex)
(replace-regexp-in-string " " "~" text)))
(add-to-list 'org-export-filter-plain-text-functions
'my-latex-filter-nobreaks))
(defun my-html-filter-nobreaks (text backend info)
"Keep non-breaking spaces in HTML org export"
(when (org-export-derived-backend-p backend 'html)
(replace-regexp-in-string " " "&nbsp;" text)))
(add-to-list 'org-export-filter-plain-text-functions
'my-html-filter-nobreaks)
(defun my-latex-filter-nobreaks (text backend info)
"Keep non-breaking spaces in LaTeX org export"
(when (org-export-derived-backend-p backend 'latex)
(replace-regexp-in-string " " "~" text)))
(add-to-list 'org-export-filter-plain-text-functions
'my-latex-filter-nobreaks)
#+END_SRC
*** Packages
@ -601,25 +590,16 @@ Automate a tiny part of something I was previously doing manually.
(setq org-journal-file-header 'org-journal-file-header-func)))
#+END_SRC
**** =org-modern= and =org-bullets=
**** =org-modern=
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]].
Use =org-modern=. [[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")
(progn
(use-package org-bullets
:custom
(org-bullets-bullet-list '("✸"))
(org-ellipsis " ⤵")
:hook
(org-mode . org-bullets-mode)))
(progn
(use-package org-modern
:hook
(org-mode . org-modern-mode))
(set-face-attribute 'org-table nil :inherit 'fixed-pitch)
(custom-set-variables '(org-modern-table nil))))
(use-package org-modern
:hook
(org-mode . org-modern-mode))
(set-face-attribute 'org-table nil :inherit 'fixed-pitch)
(custom-set-variables '(org-modern-table nil))
#+END_SRC
**** =org-noter=
@ -638,10 +618,9 @@ RIP =interleave=, but this does ok as a replacement.
Display the file outline in a sidebar.
#+BEGIN_SRC emacs-lisp
(unless (version< emacs-version "27")
(use-package org-sidebar
:bind
("C-c C-x s" . org-sidebar-tree)))
(use-package org-sidebar
:bind
("C-c C-x s" . org-sidebar-tree))
#+END_SRC
**** =org-wc=
@ -649,10 +628,9 @@ Display the file outline in a sidebar.
Display word counts next to org headings.
#+BEGIN_SRC emacs-lisp
(unless (version< emacs-version "27")
(use-package org-wc
:bind
("C-c C-x w" . org-wc-display)))
(use-package org-wc
:bind
("C-c C-x w" . org-wc-display))
#+END_SRC
*** Agenda settings
@ -882,33 +860,18 @@ Highlights current line.
** Theme/colours
Set a theme.
Set a theme from =modus-themes=.
#+BEGIN_SRC emacs-lisp
(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)))
(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
Set colours unless =modus-operandi= is active.
#+BEGIN_SRC emacs-lisp
(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
Use Noto fonts to match my system fonts on Linux. This has to be done differently on Windows for some reason.

Loading…
Cancel
Save