Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
;; This file: ;; http://angg.twu.net/elisp/eepitch-pl-tools.el.html ;; http://angg.twu.net/elisp/eepitch-pl-tools.el ;; (find-angg "elisp/eepitch-pl-tools.el") ;; Author: Eduardo Ochs <eduardoochs@gmail.com> ;; Date: 2022apr08 ;; Public domain. ;; ;; Tools for implementing variants of `eepitch-preprocess-line'. ;; See: https://lists.gnu.org/archive/html/eev/2022-04/msg00002.html ;; https://lists.gnu.org/archive/html/eev/2022-04/msg00003.html ;; Basic variants of `eepitch-preprocess-line'. ;; See: (find-eepitch-intro "3.3. `eepitch-preprocess-line'") (setq eepitch-preprocess-regexp "^#: ") (defun eepitch-preprocess-line-0 (line) line) (defun eepitch-preprocess-line-1 (line) (replace-regexp-in-string eepitch-preprocess-regexp "" line)) ;; Change `eepitch-preprocess-line'. ;; (find-eev "eepitch.el" "eepitch-this-line") ;; (find-eev "eepitch.el" "eepitch-this-line" "defun eepitch-preprocess-line") ;; Default when not experimenting with new features: same regexp everywhere. (defun eepitch-preprocess-line (line) (eepitch-preprocess-line-1 line)) ;; Some tools. ;; Tests: (eepitch-pl-get-line) ;; (eepitch-pl-flash 0 2) ;; (eepitch-pl-flash 2 10) ;; (eepitch-pl-flash-re "^;; ?") ;; (eepitch-pl-flash-re ";; ?") ;; (eepitch-pl-flash-re (rx alpha)) ;; (eepitch-pl-flash-re (rx digit)) ;; (defun eepitch-pl-flash (offset1 offset2 &optional face duration) "`ee-flash' the part of current line between OFFSET1 and OFFSET2." (ee-flash (+ (ee-bol) offset1) (+ (ee-bol) offset2) face duration)) (defun eepitch-pl-get-line () (buffer-substring-no-properties (ee-bol) (ee-eol))) (defun eepitch-pl-flash-re (re &optional subexp face duration) (let* ((line (eepitch-pl-get-line))) (when (string-match re line) (eepitch-pl-flash (match-beginning (or subexp 0)) (match-end (or subexp 0)) face duration)))) ;; Local Variables: ;; coding: utf-8-unix ;; End: