;;; -*- lexical-binding: t -*- ;; ;; -------------------------------------------------------------------------- (require 'cl-lib) (cl-pushnew "." load-path :test #'string=) (require 'luki-lisp) ;; -------------------------------------------------------------------------------- (-> 'll-dwim) (-> 'll-tabs) ;; ----------------------------------------------------------------------------- (defun horizontal-line () (i) ;; TODO: not harcode 3 (for Elisp's ";; ", len 3) (insert (make-string (- (or fill-column 80) 3) ?\-)) (comment-region (pos-bol) (pos-eol)) (when (looking-at "$") (forward-char))) (defalias 'hl #'horizontal-line) ;; ----------------------------------------------------------------------------- (defun increase-values (&optional inc beg end) (interactive `(,current-prefix-arg ,@(use-region))) (if (lu inc) (setq inc (1st inc)) (unless (n inc) (setq inc 1))) (or beg (setq beg (point-min))) (or end (setq end (point-max))) (save-mark-and-excursion (goto-beg) (while (re-search-forward "[[:digit:]]+" end t) (let* ((digit (string-to-number (match-string 0))) (sum (+ digit inc))) (replace-match (@f "%s" sum)))))) ;; -------------------------------------------------------------------------- (defun back-to-dwim () (i) (scroll-right) (let ((beg (point))) (back-to-indentation) (when (= beg (point)) (beginning-of-line)))) ;; -------------------------------------------------------------------------- (defun before-save-hook-f () (untab-all) (delete-trailing-whitespace)) (add-hook 'before-save-hook #'before-save-hook-f) ;; -------------------------------------------------------------------------- (<- 'll-edit)