]> git.earman.xyz Git - emacsinit.git/commitdiff
Various cleanup
authorrearman <rearman@r717.net>
Tue, 16 Jun 2026 20:15:13 +0000 (16:15 -0400)
committerrearman <rearman@r717.net>
Tue, 16 Jun 2026 20:15:13 +0000 (16:15 -0400)
config.org

index f1dc89b8ba0234312a43482faf7e3a023e42abc4..fcfbc1eb6878395f211471c3a59920b61bdc4bb8 100644 (file)
@@ -219,7 +219,7 @@ Sly really doesn't play well with elodc in the minibuffer, so here are some sett
 *** Configuration
 **** General options
 #+BEGIN_SRC emacs-lisp
-  (with-eval-after-load 'org-mode (add-to-list 'org-export-backends 'md))
+  (with-eval-after-load 'org (add-to-list 'org-export-backends 'md))
 
 (setq org-M-RET-may-split-line nil
       org-cycle-inline-images-display t
@@ -440,8 +440,7 @@ On-again, off-again relationship with this one
   (append-to-file (concat (read-string "New Keyword: ")
                           "\n")
                   nil
-                  howm-keyword-file
-                  "\n"))
+                  howm-keyword-file))
 #+END_SRC
 **** Menu config
 #+BEGIN_SRC emacs-lisp
@@ -1058,24 +1057,20 @@ Must be set after loading any theme
 #+END_SRC
 * UTF-8
 #+BEGIN_SRC emacs-lisp
-(set-charset-priority 'unicode)
 (prefer-coding-system 'utf-8-unix)
 (set-language-environment 'utf-8)
-(set-default-coding-systems 'utf-8)
-(set-keyboard-coding-system 'utf-8-unix)
-(set-terminal-coding-system 'utf-8-unix)
 #+END_SRC
 * Cleanup on write
 #+BEGIN_SRC emacs-lisp
 (defun re/flush-extra-lines ()
   "Change all groups of blank lines to 1 blank line."
   (interactive)
-  (save-excursion (mark-whole-buffer)
-                  (replace-regexp "^\n+"
-                                  "\n"
-                                  nil
-                                  (region-beginning)
-                                  (region-end))))
+  (save-excursion
+    (replace-regexp "^\n+"
+                    "\n"
+                    nil
+                    (point-min)
+                    (point-max))))
 
 (setq require-final-newline t)
 (add-hook 'before-save-hook #'re/flush-extra-lines)
@@ -1086,11 +1081,10 @@ Must be set after loading any theme
 ** Password generation
 #+BEGIN_SRC emacs-lisp
 (defconst *alphanumerics*
-  '("a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m"
-    "n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z"
-    "A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M"
-    "N" "O" "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z"
-    "0" "1" "2" "3" "4" "5" "6" "7" "8" "9")
+  (mapcar #'char-to-string
+          (append (number-sequence ?a ?z)
+                  (number-sequence ?A ?Z)
+                  (number-sequence ?0 ?9)))
   "List of strings of the upper/lower-case English alphabet, and the single-digit numbers.")
 
 (defconst *special-characters*
@@ -1104,7 +1098,7 @@ Must be set after loading any theme
 If `no-special-chars' is t, use only alpha-numeric characters."
   (let ((selected-charset (append *alphanumerics*
                                   (when (null no-special-chars)
-                                    *special-characters*))))
+                                    ,*special-characters*))))
     (elt selected-charset (random (length selected-charset)))))
 
 (defun pw-get-chars (password-length &optional no-special-chars)