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. Dims inactive buffers. Adjustments for =modus-themes= as suggested.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(if (version< emacs-version "27") (use-package dimmer
(use-package dimmer :config
:init (setq dimmer-fraction 0.4)
(dimmer-mode t) (setq dimmer-adjustment-mode :foreground)
:config (setq dimmer-use-colorspace :rgb)
(setq dimmer-fraction 0.4)) (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 #+END_SRC
** =doom-modeline= ** =doom-modeline=
@ -381,12 +375,9 @@ Shows, or at least purports to show, =git diff= in the left margin if the file i
** =lastfm= ** =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 #+BEGIN_SRC emacs-lisp
(unless (version< emacs-version "27") (unless (atwork)
(unless (atwork) (use-package lastfm))
(use-package lastfm)))
#+END_SRC #+END_SRC
** =markdown-mode= ** =markdown-mode=
@ -500,13 +491,12 @@ Track when I complete todos.
*** Export settings *** 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 #+BEGIN_SRC emacs-lisp
(unless (version< emacs-version "27") (use-package org-contrib)
(use-package org-contrib) (require 'ox-extra)
(require 'ox-extra) (ox-extras-activate '(ignore-headlines))
(ox-extras-activate '(ignore-headlines)))
#+END_SRC #+END_SRC
Add a couple of classes for LaTeX export. 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]]. 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 #+BEGIN_SRC emacs-lisp
(unless (version< emacs-version "27") (defun my-html-filter-nobreaks (text backend info)
(defun my-html-filter-nobreaks (text backend info) "Keep non-breaking spaces in HTML org export"
"Keep non-breaking spaces in HTML org export" (when (org-export-derived-backend-p backend 'html)
(when (org-export-derived-backend-p backend 'html) (replace-regexp-in-string " " "&nbsp;" text)))
(replace-regexp-in-string " " "&nbsp;" text))) (add-to-list 'org-export-filter-plain-text-functions
(add-to-list 'org-export-filter-plain-text-functions 'my-html-filter-nobreaks)
'my-html-filter-nobreaks) (defun my-latex-filter-nobreaks (text backend info)
(defun my-latex-filter-nobreaks (text backend info) "Keep non-breaking spaces in LaTeX org export"
"Keep non-breaking spaces in LaTeX org export" (when (org-export-derived-backend-p backend 'latex)
(when (org-export-derived-backend-p backend 'latex) (replace-regexp-in-string " " "~" text)))
(replace-regexp-in-string " " "~" text))) (add-to-list 'org-export-filter-plain-text-functions
(add-to-list 'org-export-filter-plain-text-functions 'my-latex-filter-nobreaks)
'my-latex-filter-nobreaks))
#+END_SRC #+END_SRC
*** Packages *** 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))) (setq org-journal-file-header 'org-journal-file-header-func)))
#+END_SRC #+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 #+BEGIN_SRC emacs-lisp
(if (version< emacs-version "27") (use-package org-modern
(progn :hook
(use-package org-bullets (org-mode . org-modern-mode))
:custom (set-face-attribute 'org-table nil :inherit 'fixed-pitch)
(org-bullets-bullet-list '("✸")) (custom-set-variables '(org-modern-table nil))
(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))))
#+END_SRC #+END_SRC
**** =org-noter= **** =org-noter=
@ -638,10 +618,9 @@ RIP =interleave=, but this does ok as a replacement.
Display the file outline in a sidebar. Display the file outline in a sidebar.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(unless (version< emacs-version "27") (use-package org-sidebar
(use-package org-sidebar :bind
:bind ("C-c C-x s" . org-sidebar-tree))
("C-c C-x s" . org-sidebar-tree)))
#+END_SRC #+END_SRC
**** =org-wc= **** =org-wc=
@ -649,10 +628,9 @@ Display the file outline in a sidebar.
Display word counts next to org headings. Display word counts next to org headings.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(unless (version< emacs-version "27") (use-package org-wc
(use-package org-wc :bind
:bind ("C-c C-x w" . org-wc-display))
("C-c C-x w" . org-wc-display)))
#+END_SRC #+END_SRC
*** Agenda settings *** Agenda settings
@ -882,33 +860,18 @@ Highlights current line.
** Theme/colours ** Theme/colours
Set a theme. Set a theme from =modus-themes=.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(if (version< emacs-version "27") (use-package modus-themes
(progn :config
(use-package tao-theme) (setq modus-themes-bold-constructs t)
(load-theme 'tao-yang t)) (setq modus-themes-italic-constructs t)
(progn (setq modus-themes-mixed-fonts t)
(use-package modus-themes (setq modus-themes-org-blocks 'gray-background))
:config (load-theme 'modus-operandi-tinted t)
(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
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 ** Fonts
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.

Loading…
Cancel
Save