[feature request] Customizable prefix bounds #126
villarragut
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
Thanks for the suggestion. I am not sure if adding a customization option is justified, also since we already have the option For now you can use this: (advice-add #'tempel--prefix-bounds :override (lambda () (bounds-of-thing-at-point 'word)) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When editing LaTeX, it's usual to insert templates for fractions or integrals. Unsurprisingly, mine are called fraction and integral, respectively. E.g. the template for fractions is
(fraction "\\frac{" p "}{" p "}")
There is a situation when you have something like
$1+fraction$
and the cursor is between n and the second $. Then, you want to call
tempel-complete
(ortempel-expand
) and get$1+\frac{}{}$
However, it does not work, since fraction is not identified as the prefix.
A workaround is to replace the last line in the function
tempel--prefix-bounds
from this:(bounds-of-thing-at-point 'symbol)))
to this:
(bounds-of-thing-at-point 'word)))
It'd be nice to have a variable to customize this behavior. If its default value were
'symbol
, then it wouldn't break any setups.This is a wonderful package. Thanks for the hard work!
Best wishes,
Victor
Beta Was this translation helpful? Give feedback.
All reactions