*** 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
(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
#+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)
** 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*
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)