Define a quick, throw-away abbrev for a single Emacs session.
When using Python and Numpy, outputs are sometimes shortened with an ellipsis:
array(['1007.65', '1007.63', '1007.66', ..., '993.40', '993.40', '993.57'], dtype=object)
To display the array in full, you need to issue this mouthful of a statement:
with np.printoptions(threshold=np.inf): print(my_arr['field_name'])
This seems like a perfect situation for an abbrev!
Here's what I do:
fpfor "full print"
- With point immediately after
C-x a g(
- In the minibuffer prompt for
Global abbrev for "fp":, put
with np.printoptions(threshold=np.inf): print()and press
- The minibuffer exits, returning me to my original buffer with point after
C-x a e(
If I check
list-abbrevs, there it is:
(global-abbrev-table) "with np.printoptions(threshold=np.inf): print()" 0 "fp"
My understanding is that I don't need
abbrev-mode enabled, as that's only used for automatic expansion. Incidentally, enabling
abbrev-mode still doesn't expand
I'm at a loss for what I'm doing wrong and would appreciate some advice!