5 Commity

Autor SHA1 Wiadomość Data
  Mitchell Tishmack 7994a1cd85 Emacs 27.1 org initialization fixes 5 lat temu
  Mitchell Tishmack 71086e0594 Fix minor bug if emacs 27.1 is in use 5 lat temu
  Mitchell Tishmack 9c73ab35c8 Remove workgroups2 setup, not using it anyway 5 lat temu
  Mitchell Tishmack 9ffea3fea2 Move desktop-save to the end of the init file 5 lat temu
  Mitchell Tishmack 8812163962 use-package org-habit is fraught, convert it to straight elisp 5 lat temu
1 zmienionych plików z 48 dodań i 62 usunięć
  1. +48
    -62
      emacs.org

+ 48
- 62
emacs.org Wyświetl plik

@@ -67,32 +67,27 @@ TODO: make this stuff work sanely in emacs org mode and via external tangling. N

*** use-package bootstrap

This configuration is using *use-package* extensively. Install it early so we can
use it elsewhere.
This configuration is using *use-package* extensively. Install it early so we can use it elsewhere.

First strip out any existing org load-path prior to package initialization.
First strip out any existing org load-path prior to package initialization, but only if use-package isn't installed. If we always remove all org load-path entries from the load path entirely after they're installed we can cause bad behavior on restarts.

#+BEGIN_SRC emacs-lisp
(require 'cl)
(setq load-path (remove-if (lambda (x) (string-match-p "org$" x)) load-path))
(setq load-path (remove-if (lambda (x) (string-match-p "org-" x)) load-path))
#+END_SRC
Then, before doing *ANY* package initialization, make use-package setup/use org from the package repos and pin it so that other packages can't muck that up if/when they install.

Actual org configuration is done later in another use-package block.

#+BEGIN_SRC emacs-lisp
(unless (package-installed-p 'use-package)
(progn
(require 'cl)
(setq load-path (remove-if (lambda (x) (string-match-p "org$" x)) load-path))
(package-refresh-contents)
(package-install 'use-package)
(package-initialize)))
(package-initialize)
))

(require 'use-package)
(setq use-package-verbose t)
#+END_SRC

Then, before doing *ANY* package initialization, make use-package setup/use org
from the package repos and pin it so that other packages can't muck that up.

#+BEGIN_SRC emacs-lisp
(use-package org
:ensure org-plus-contrib
:pin org)
@@ -315,8 +310,9 @@ detection. But again as I don't use/speak/read them. Ok tradeoff.

#+BEGIN_SRC emacs-lisp
(if (version<= "27.1" emacs-version)
((setq bidi-inhibit-bpa t)
(global-so-long-mode 1)))
(progn
(setq bidi-inhibit-bpa t)
(global-so-long-mode 1)))
#+END_SRC

Ref: https://200ok.ch/posts/2020-09-29_comprehensive_guide_on_handling_long_lines_in_emacs.html
@@ -752,22 +748,6 @@ top to look at.
:hook (magit-mode . magit-todos-mode))
#+END_SRC

*** TODO workgroups2 :broken:

Save workgroup layouts. Similar..ish to desktop-save.

#+BEGIN_SRC emacs-lisp :tangle no
(use-package workgroups2
:ensure t
:custom
(wg-session-file "~/.emacs.d/workgroups")
(wg-prefix-key (kbd "C-c C-w"))
(wg-mode-line-display-on nil)
:init
(workgroups-mode 1)
)
#+END_SRC

*** autopair

Highlight matching ()'s []'s etc...
@@ -994,16 +974,14 @@ Validate that this installs from scratch fine, blocking babel executions is ass.

**** TODO org-habit customization :testing:

Figure out the customization needed here.
Figure out the customization needed here. Note that org-habit isn't a feature we can use-package against.

#+BEGIN_SRC emacs-lisp
(use-package org-habit
:after org
:ensure t
:custom
(org-habit-graph-column 44)
(org-habit-preceding-days 31)
(org-habit-following-days 7))
(add-to-list 'org-modules 'org-habit)
(custom-set-variables
'(org-habit-graph-column 44)
'(org-habit-preceding-days 31)
'(org-habit-following-days 7))
#+END_SRC

**** TODO org-bullets review if alternative is worth it :validation:
@@ -1160,28 +1138,6 @@ Make buffer names unique based on their directory and not have <N> or other nons
(custom-set-variables '(uniquify-buffer-name-style 'post-forward))
#+END_SRC

*** desktop-save

Desktop saving of session information handy to keep the same buffers between sessions.

#+BEGIN_SRC emacs-lisp
(require 'desktop)

(desktop-save-mode 1)

(custom-set-variables
'(desktop-restore-eager 5)
'(desktop-path '("~/.emacs.d"))
'(desktop-dirname "~/.emacs.d")
'(desktop-base-file-name "desktop")
)

(defun local-desktop-save ()
(interactive)
(if (eq (desktop-owner) (emacs-pid))
(desktop-save desktop-dirname)))
#+END_SRC

*** TODO super-save :validation:testing:

REMOVE ME && TODO IF THIS WORKS
@@ -1699,6 +1655,36 @@ Create *auto-insert-alist* so all the mode lists are the same
auto-insert-alist)
)
#+END_SRC

*** desktop-save

Note: this is at the end so that anything that might get eval()'d from the desktop file can have been loaded by this point. Important as my org mode setup ordering requires some shenanigans.

Desktop saving of session information handy to keep the same buffers between sessions.

#+BEGIN_SRC emacs-lisp
(defun desktop-setup ()

(require 'desktop)

(desktop-save-mode 1)

(custom-set-variables
'(desktop-restore-eager 5)
'(desktop-path '("~/.emacs.d"))
'(desktop-dirname "~/.emacs.d")
'(desktop-base-file-name "desktop")
)

(defun local-desktop-save ()
(interactive)
(if (eq (desktop-owner) (emacs-pid))
(desktop-save desktop-dirname)))
)

;;(add-hook 'after-init-hook 'desktop-setup)
#+END_SRC

* custom

Load this up last to allow for local customization if needed and to keep from custom writing to the init.el file.


Ładowanie…
Anuluj
Zapisz