0

I have a large set of abbreviations I defined inside an abbrev-table. Take one of them:

(define-abbrev-table 'latex-mode-abbrev-table 
  '(("ff" "my abbreviation!" 0 nil)))

If I run a predefined function that calls things through skeleton-read is there a way to expand abbreviations within that query? In other words if I define a function,

   (define-skeleton myfunc  ""  "" (setq v1 (skeleton-read "put something ")))

and call it with M-x then within the bottom bar where I type in the value can I use my abbreviation (by typing ff and then hitting the space bar) while typing there (nothing happens by default)?

Drew
  • 75,699
  • 9
  • 109
  • 225
JeffDror
  • 53
  • 5

1 Answers1

2

skeleton-read will read from the minibuffer, which is a separate buffer that's not using latex-mode, which is why your abbrev isn't working there.

You could put your abbrev in global-abbrev-table so it's also available in the minibuffers, you could do:

(define-skeleton myfunc
 ""  ""
 (setq v1 (minibuffer-with-setup-hook
              (lambda () (setq local-abbrev-table latex-mode-abbrev-table))
            (skeleton-read "put something "))))

to make latex-mode abbrevs available in this specific minibuffer.

Stefan
  • 26,154
  • 3
  • 46
  • 84