;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/street.el ;; ;; use with: ;; https://dataswamp.org/~incal/GATOR (require 'align-incal) (require 'math-incal) (require 'today) (defun streets-complete () (interactive) (let*((beg (point-min)) (num (how-many "^;; i" beg)) (tot (how-many "^;; ." beg)) (pct (percent num tot t)) (out (format "%d %s" num pct)) ) (message "%s" out) )) (defun today-street () (interactive) (save-excursion (beginning-of-line) (forward-char 3) (delete-char 1) (insert "i") (end-of-line) (insert-at-col (format-time-string "%F") 69) ) (save-buffer) (streets-complete) ) (defalias 'ts #'today-street) (defalias 'c #'streets-complete) (provide 'street)