[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: eepitch with prefixes
From: |
Eduardo Ochs |
Subject: |
Re: eepitch with prefixes |
Date: |
Sat, 9 Apr 2022 15:52:30 -0300 |
Hi Tomas,
On Sat, 9 Apr 2022 at 06:36, Tomas Hlavaty <tom@logand.com> wrote:
> (...)
the current implementation of `eepitch-preprocess-line',
described here,
(find-eepitch-intro "3.3. `eepitch-preprocess-line'")
http://angg.twu.net/eev-intros/find-eepitch-intro.html#3.3
is stable. After years thinking on what would be the right way to
implement preprocessing I found that way, that it is flexible enough
and elegant enough. It will not change - neither in the next 10 years,
or ever(*).
I'm not sure if I read your e-mails correctly, but you seem to be
suggesting that there are users who would like to use
`eepitch-preprocess-line', but for whom the step of putting a block of
four lines like this one
;; See: (find-eepitch-intro "3.3. `eepitch-preprocess-line'")
(setq eepitch-preprocess-regexp "")
(defun eepitch-preprocess-line (line)
(replace-regexp-in-string eepitch-preprocess-regexp "" line))
in their ".emacs"es is too hard. Well, if I had to interact with a
user like that I would say something like: `eepitch-preprocess-line'
is a feature that should only be used by people who know how `defun'
works... so please read the first six sections of this tutorial when
you have time:
(find-elisp-intro)
http://angg.twu.net/eev-intros/find-elisp-intro.html
Anyway: I like `eepitch-preprocess-line' very much, but I think that
`eepitch-preprocess-regexp' 1) could be made into a function, 2) could
have a shorter name. What do you think of this?
;; See: (find-elnode "Creating Buffer-Local")
;; (find-elnode "Creating Buffer-Local" "defvar-local")
;; (find-hvariable 'eepitch-pl-re)
(defvar-local eepitch-pl-re nil)
(defvar eepitch-pl-re-mail-reader-mode "^ ")
(defun eepitch-pl-re ()
(or eepitch-pl-re
(and (eq major-mode 'hlavaty-mail-reader-mode)
eepitch-pl-re-mail-reader-mode)
""))
;; See: (find-eepitch-intro "3.3. `eepitch-preprocess-line'")
(defun eepitch-preprocess-line (line)
(replace-regexp-in-string (eepitch-pl-re) "" line))
;; TODO: Use `eepitch-pl-flash-re'. See:
;; http://angg.twu.net/elisp/eepitch-pl-tools.el.html
;; http://angg.twu.net/elisp/eepitch-pl-tools.el
;; (find-anggwget-elisp "elisp/eepitch-pl-tools.el")
;; (find-eevgrep "grep --color=auto -nH --null -e flash *.el")
I haven't tested it. I would be great if you could play with it for
some days, modify it to make it more convenient to use, and then
discuss your ideas...
Cheers,
Eduardo...
(*): there are some things in eepitch that I would like to change, but
I don't want to break existing code, so I would do that by
implementing an "eepitch2" in which the code is factored differently
and special behaviors are easier to set up...