]> git.earman.xyz Git - emacsinit.git/commitdiff
Add ielm config, tweak org options
authorrearman <rearman@r717.net>
Mon, 6 May 2024 21:13:36 +0000 (17:13 -0400)
committerrearman <rearman@r717.net>
Mon, 6 May 2024 21:13:36 +0000 (17:13 -0400)
init.org

index dd70247a400184d0399a6ff76c20f2d028f399a6..c9ada0291e7c3486ff93e6a931edbe64e45c3574 100644 (file)
--- a/init.org
+++ b/init.org
@@ -492,7 +492,12 @@ Just some basic/misc stuff.  I don't think I've seen too many configs that don't
       org-agenda-window-setup 'current-window
       org-link-file-path-type 'absolute
       org-startup-folded t
-      org-startup-indented t)
+      org-startup-indented t
+      org-fontify-done-headline nil
+      org-fontify-todo-headline nil
+      org-goto-interface 'outline-path-completion
+      org-outline-path-complete-in-steps nil
+      org-goto-max-level 9)
 #+END_SRC
 
 *** Bindings
@@ -784,7 +789,51 @@ I have only been able to get these to work when they are within an add-hook lamb
             (keymap-set eshell-mode-map ")" 'eshell-send-on-close-paren)
             (keymap-set eshell-mode-map "C-d" 'eshell-quit-or-delete-char)))
 #+END_SRC
+** ielm configuration
+I wanted something more like a standard lisp REPL in emacs.  Found =ielm=.
+*** Send on Close-Paren
+I wanted something like what the Genera environment has, where putting in a final close-paren will send the command, without having to hit enter.
+
+#+BEGIN_SRC emacs-lisp
+(defun ielm-send-on-close-paren ()
+  "Makes ielm act somewhat like genera.
+Makes a closing paren execute the sexp."
+  (interactive)
+  (insert-char ?\))
+  (when (= 0 (car (syntax-ppss)))
+         (ielm-send-input)))
+#+END_SRC
+*** Persistent command history
+**** Read History
+#+BEGIN_SRC emacs-lisp
+(defun g-ielm-init-history ()
+  "Stolen from https://n16f.net/blog/making-ielm-more-comfortable."
+  (let ((path (expand-file-name "ielm/history" user-emacs-directory)))
+    (make-directory (file-name-directory path) t)
+    (setq-local comint-input-ring-file-name path))
+    (setq-local comint-input-ring-size 10000
+                comint-input-ignoredups t)
+    (comint-read-input-ring))
 
+(add-hook 'ielm-mode-hook 'g-ielm-init-history)
+#+END_SRC
+**** Write History
+#+BEGIN_SRC emacs-lisp
+(defun g-ielm-write-history (&rest _args)
+  "Stolen from https://n16f.net/blog/making-ielm-more-comfortable."
+  (with-file-modes #o600
+    (comint-write-input-ring)))
+
+(advice-add 'ielm-send-input :after 'g-ielm-write-history)
+#+END_SRC
+*** Bindings
+#+BEGIN_SRC emacs-lisp
+(keymap-global-set "C-c i" 'ielm)
+(add-hook 'ielm-mode-hook
+          (lambda ()
+            (keymap-set inferior-emacs-lisp-mode-map "C-l" 'comint-clear-buffer)
+            (keymap-set inferior-emacs-lisp-mode-map ")" 'ielm-send-on-close-paren)))
+#+END_SRC
 ** Defuns and Bindings
 I have quite a few math and work-related defuns, and fewer editing ones.  Inversely, I have more editing related bindings than work-related ones.  This makes sense, considering my usage patterns.