GNU bug report logs -
#70525
[PATCH] Make auto-reveal customizations easier to extend
Previous Next
Reported by: Paul Nelson <ultrono <at> gmail.com>
Date: Tue, 23 Apr 2024 03:56:02 UTC
Severity: normal
Tags: patch
Done: Arash Esbati <arash <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 70525 <at> debbugs.gnu.org (full text, mbox):
Hi Arash,
> thanks for the patch. I have one question: You suggest we introduce a
> new custom option `TeX-fold-auto-reveal-commands' which will be used in
> another custom option `TeX-fold-auto-reveal' in the setter? Is the plan
> that users add functions provided by external packages to
> `TeX-fold-auto-reveal-commands' and then that value is used when
> `TeX-fold-auto-reveal' is set? Basically this hunk:
>
> > diff --git a/tex-fold.el b/tex-fold.el
> > index 62f0834c..4f4ee377 100644
> > --- a/tex-fold.el
> > +++ b/tex-fold.el
> > @@ -257,10 +257,19 @@ After that, changing the prefix key requires manipulating keymaps."
> > (define-key map "i" #'TeX-fold-clearout-item)
> > map))
> >
> > +(defcustom TeX-fold-auto-reveal-commands
> > + '((key-binding [left])
> > + (key-binding [right])
> > + backward-char
> > + forward-char
> > + mouse-set-point)
> > + "List of commands that may cause a fold to be revealed.
> > +This list is consulted by the default value of `TeX-fold-auto-reveal'."
> > + :type '(repeat (choice (function :tag "Function")
> > + (sexp :tag "Key binding"))))
> > +
> > (defcustom TeX-fold-auto-reveal
> > - '(eval (TeX-fold-arrived-via (key-binding [left]) (key-binding [right])
> > - #'backward-char #'forward-char
> > - #'mouse-set-point))
> > + '(eval (apply 'TeX-fold-arrived-via TeX-fold-auto-reveal-commands))
>
I think what you describe is indeed the plan, but I'll elaborate just
in case. I had in mind that external packages would add to
*-reveal-commands via setup functions, with lines such as
(add-to-list 'preview-auto-reveal-commands #'tex-parens-down-list)
Users can similarly add their own commands in their own config. This
is simpler than adding to the internals of the lisp form in the
current default value of *-reveal.
Of course, this is only for users who use the default setting. Other
users can continue to customize the *-reveal behavior however they
prefer.
I'm not sure I understand what you mean when you say "that value is
used when *-reveal is set". The value would be used every time the
lisp form in *-reveal is evaluated by the preview/folding libraries.
Thanks, best,
Paul
This bug report was last modified 1 year and 20 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.